aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--action.c6
-rw-r--r--action.h3
-rw-r--r--config.mk26
-rw-r--r--main.c8
4 files changed, 20 insertions, 23 deletions
diff --git a/action.c b/action.c
index 0b8c7d9..9fb400e 100644
--- a/action.c
+++ b/action.c
@@ -56,7 +56,7 @@ struct action_lookup ac_lookup_table[] = {
ev_list *head = NULL;
int
-new_event(evid) {
+new_event(long evid) {
ev_list *item, *newitem;
if(!head) {
@@ -224,9 +224,9 @@ fill_ev_table(char *input) {
break;
}
if(str4 == kommatoken && str4 != token && eid != -1) {
- if((ah = (void *)get_action_handler(dptoken))) {
+ if((ah = (void *)get_action_handler(dptoken)) == NULL) {
new_event(eid);
- add_handler(eid, i, ah);
+ add_handler(eid, i, get_action_handler(dptoken));
i++;
}
}
diff --git a/action.h b/action.h
index bb49a77..9ec1752 100644
--- a/action.h
+++ b/action.h
@@ -53,7 +53,8 @@ void do_action(long);
int get_ev_id(char *);
void * get_action_handler(char *);
void fill_ev_table(char *);
-void free_ev_table(void);
+void free_event_list(void);
+int find_event(long);
/* action handlers */
int a_print(char **);
diff --git a/config.mk b/config.mk
index d4d9a2b..0efce5e 100644
--- a/config.mk
+++ b/config.mk
@@ -11,30 +11,26 @@ X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
INCS = -I. -I/usr/include -I${X11INC}
-# Uncomment this line to use Xinerama.
-# USE_XINERAMA=y
-
-# (ifdef/else/endif might not be portable; if it doesn't work for you,
-# contact the author and we'll work on a better solution.)
-ifdef USE_XINERAMA
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXinerama
-CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DDZEN_XINERAMA
-else
+
+# No Xinerama, comment the following two lines for Xinerama
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
-endif
-LDFLAGS = ${LIBS}
+# With Xinerama, uncomment the following two lines for Xinerama
+#LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXinerama
+#CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DDZEN_XINERAMA
-# Debugging
-#CFLAGS = -g -Wall -O0 ${INCS} -DVERSION=\"${VERSION}\" -DPOSIX_SOURCE
-#LDFLAGS = -g ${LIBS}
+LDFLAGS = ${LIBS}
-# Solaris
+# Solaris, uncomment for Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}
#CFLAGS += -xtarget=ultra
+# Debugging
+#CFLAGS = -g -Wall -O0 ${INCS} -DVERSION=\"${VERSION}\" -DPOSIX_SOURCE
+#LDFLAGS = -g ${LIBS}
+
# compiler and linker
CC = cc
LD = ${CC}
diff --git a/main.c b/main.c
index 63a191b..ae1782a 100644
--- a/main.c
+++ b/main.c
@@ -51,22 +51,22 @@ clean_up(void) {
}
static void
-catch_sigusr1() {
+catch_sigusr1(int s) {
do_action(sigusr1);
}
static void
-catch_sigusr2() {
+catch_sigusr2(int s) {
do_action(sigusr2);
}
static void
-catch_sigterm() {
+catch_sigterm(int s) {
do_action(onexit);
}
static void
-catch_alrm() {
+catch_alrm(int s) {
do_action(onexit);
clean_up();
exit(0);