diff options
-rw-r--r-- | action.c | 10 | ||||
-rw-r--r-- | draw.c | 2 | ||||
-rw-r--r-- | dzen.h | 6 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | util.c | 68 |
5 files changed, 45 insertions, 45 deletions
@@ -1,5 +1,5 @@ /* - * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> + * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> * See LICENSE file for license details. */ @@ -231,7 +231,7 @@ a_togglestick(char * opt[]) { return 0; } -int +static int scroll(int n) { if(dzen.slave_win.last_line_vis < dzen.slave_win.max_lines) return; @@ -334,7 +334,7 @@ a_menuexec(char * opt[]) { return 0; } -int +int a_raise(char * opt[]) { XRaiseWindow(dzen.dpy, dzen.title_win.win); @@ -343,7 +343,7 @@ a_raise(char * opt[]) { return 0; } -int +int a_lower(char * opt[]) { XLowerWindow(dzen.dpy, dzen.title_win.win); @@ -352,7 +352,7 @@ a_lower(char * opt[]) { return 0; } -int +int a_scrollhome(char * opt[]) { if(dzen.slave_win.max_lines) { dzen.slave_win.first_line_vis = 0; @@ -155,7 +155,7 @@ drawheader(char * text) { dzen.y = 0; dzen.w = dzen.title_win.width; dzen.h = dzen.line_height; - + if(text) drawtext(text, 0, -1, dzen.title_win.alignment); XCopyArea(dzen.dpy, dzen.title_win.drawable, dzen.title_win.win, @@ -1,7 +1,7 @@ /* - * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> - * See LICENSE file for license details. - */ +* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> +* See LICENSE file for license details. +*/ #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -176,10 +176,10 @@ x_check_geometry(XRectangle si) { dzen.title_win.x = si.x; if (dzen.title_win.x < si.x) dzen.title_win.x = si.x; - + if(!dzen.title_win.width) dzen.title_win.width = si.width; - + if((dzen.title_win.x + dzen.title_win.width) > (si.x + si.width)) dzen.title_win.width = si.width - (dzen.title_win.x - si.x); if(!dzen.slave_win.width) { @@ -1,7 +1,7 @@ /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> - * (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> - * See LICENSE file for license details. - */ +* (C)opyright MMVII Robert Manea <rob dot manea at gmail dot com> +* See LICENSE file for license details. +*/ #include "dzen.h" #include <stdarg.h> @@ -13,50 +13,50 @@ void * emalloc(unsigned int size) { - void *res = malloc(size); + void *res = malloc(size); - if(!res) - eprint("fatal: could not malloc() %u bytes\n", size); - return res; + if(!res) + eprint("fatal: could not malloc() %u bytes\n", size); + return res; } void eprint(const char *errstr, ...) { - va_list ap; + va_list ap; - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(EXIT_FAILURE); + va_start(ap, errstr); + vfprintf(stderr, errstr, ap); + va_end(ap); + exit(EXIT_FAILURE); } char * estrdup(const char *str) { - void *res = strdup(str); + void *res = strdup(str); - if(!res) - eprint("fatal: could not malloc() %u bytes\n", strlen(str)); - return res; + if(!res) + eprint("fatal: could not malloc() %u bytes\n", strlen(str)); + return res; } void spawn(const char *arg) { - static char *shell = NULL; - - if(!shell && !(shell = getenv("SHELL"))) - shell = "/bin/sh"; - if(!arg) - return; - /* The double-fork construct avoids zombie processes and keeps the code - * clean from stupid signal handlers. */ - if(fork() == 0) { - if(fork() == 0) { - setsid(); - execl(shell, shell, "-c", arg, (char *)NULL); - fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg); - perror(" failed"); - } - exit(0); - } - wait(0); + static char *shell = NULL; + + if(!shell && !(shell = getenv("SHELL"))) + shell = "/bin/sh"; + if(!arg) + return; + /* The double-fork construct avoids zombie processes and keeps the code + * clean from stupid signal handlers. */ + if(fork() == 0) { + if(fork() == 0) { + setsid(); + execl(shell, shell, "-c", arg, (char *)NULL); + fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg); + perror(" failed"); + } + exit(0); + } + wait(0); } |