dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 3a18d4dcd3dc15aef3e5b9332650e8d9a2b6fbde
parent 5bb0fa919bca92b917e237a0aee70ed6b1074682
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Thu, 26 May 2011 20:20:40 +0200

Remove CONFIG_CMDFIFO enable it by default

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
config.h | 2--
config.mk | 2--
dvtm.c | 26+++-----------------------
3 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/config.h b/config.h @@ -139,11 +139,9 @@ Button buttons[] = { { BUTTON3_CLICKED, { mouse_minimize, { NULL } } }, }; -#ifdef CONFIG_CMDFIFO Cmd commands[] = { { "create", { create, { NULL } } }, }; -#endif /* CONFIG_CMDFIFO */ /* gets executed when dvtm is started */ Action actions[] = { diff --git a/config.mk b/config.mk @@ -13,8 +13,6 @@ LIBS = -lc -lutil -lncursesw CFLAGS += -std=c99 -Os ${INCS} -DVERSION=\"${VERSION}\" -DNDEBUG LDFLAGS += -L/usr/lib -L/usr/local/lib ${LIBS} -#CFLAGS += -DCONFIG_CMDFIFO - DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall CC = cc diff --git a/dvtm.c b/dvtm.c @@ -48,9 +48,7 @@ struct Client { uint8_t order; pid_t pid; int pty; -#ifdef CONFIG_CMDFIFO unsigned short int id; -#endif unsigned short int x; unsigned short int y; unsigned short int w; @@ -94,12 +92,10 @@ typedef struct { Action action; } Button; -#ifdef CONFIG_CMDFIFO typedef struct { const char *name; Action action; } Cmd; -#endif enum { BarTop, BarBot, BarOff }; @@ -171,11 +167,7 @@ static bool running = true; static bool runinall = false; #include "mouse.c" - -#ifdef CONFIG_CMDFIFO -# include "cmdfifo.c" -#endif - +#include "cmdfifo.c" #include "statusbar.c" static void @@ -652,16 +644,12 @@ create(const char *args[]) { return; const char *cmd = (args && args[0]) ? args[0] : shell; const char *pargs[] = { "/bin/sh", "-c", cmd, NULL }; -#ifdef CONFIG_CMDFIFO c->id = ++client_id; char buf[8]; snprintf(buf, sizeof buf, "%d", c->id); -#endif const char *env[] = { "DVTM", VERSION, -#ifdef CONFIG_CMDFIFO "DVTM_WINDOW_ID", buf, -#endif NULL }; @@ -869,12 +857,10 @@ cleanup() { endwin(); if (statusfd > 0) close(statusfd); -#ifdef CONFIG_CMDFIFO if (cmdfd > 0) close(cmdfd); if (cmdpath) unlink(cmdpath); -#endif } static void @@ -888,9 +874,7 @@ usage() { cleanup(); eprint("usage: dvtm [-v] [-m mod] [-d escdelay] [-h n] " "[-s status-fifo] " -#ifdef CONFIG_CMDFIFO "[-c cmd-fifo] " -#endif "[cmd...]\n"); exit(EXIT_FAILURE); } @@ -957,14 +941,12 @@ parse_args(int argc, char *argv[]) { statusfd = open_or_create_fifo(argv[++arg]); updatebarpos(); break; -#ifdef CONFIG_CMDFIFO case 'c': cmdfd = open_or_create_fifo(argv[++arg]); if (!(cmdpath = get_realpath(argv[arg]))) error("%s\n", strerror(errno)); setenv("DVTM_CMD_FIFO", cmdpath, 1); break; -#endif default: usage(); } @@ -1018,12 +1000,11 @@ main(int argc, char *argv[]) { FD_ZERO(&rd); FD_SET(STDIN_FILENO, &rd); -#ifdef CONFIG_CMDFIFO if (cmdfd != -1) { FD_SET(cmdfd, &rd); nfds = cmdfd; } -#endif + if (statusfd != -1) { FD_SET(statusfd, &rd); nfds = max(nfds, statusfd); @@ -1075,10 +1056,9 @@ main(int argc, char *argv[]) { continue; } -#ifdef CONFIG_CMDFIFO if (cmdfd != -1 && FD_ISSET(cmdfd, &rd)) handle_cmdfifo(); -#endif + if (statusfd != -1 && FD_ISSET(statusfd, &rd)) handle_statusbar();