diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-15 17:00:56 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-15 17:00:56 +0200 |
| commit | adaa28a6e600f636f5e86244ccef69e98419ba1a (patch) | |
| tree | a7373162dabedbc0edf809559781489eca5a3fbb /util.c | |
| parent | rearranged several stuff (diff) | |
| download | dwm-adaa28a6e600f636f5e86244ccef69e98419ba1a.tar.gz dwm-adaa28a6e600f636f5e86244ccef69e98419ba1a.zip | |
proceeded with cleaning up, sorting functions, etc
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 24 |
1 files changed, 13 insertions, 11 deletions
| @@ -2,24 +2,15 @@ | |||
| 2 | * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | 2 | * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
| 3 | * See LICENSE file for license details. | 3 | * See LICENSE file for license details. |
| 4 | */ | 4 | */ |
| 5 | #include "dwm.h" | ||
| 5 | 6 | ||
| 6 | #include <stdarg.h> | 7 | #include <stdarg.h> |
| 7 | #include <stdio.h> | 8 | #include <stdio.h> |
| 8 | #include <stdlib.h> | 9 | #include <stdlib.h> |
| 9 | #include <sys/types.h> | ||
| 10 | #include <sys/wait.h> | 10 | #include <sys/wait.h> |
| 11 | #include <unistd.h> | 11 | #include <unistd.h> |
| 12 | 12 | ||
| 13 | #include "dwm.h" | 13 | /* static functions */ |
| 14 | |||
| 15 | void | ||
| 16 | eprint(const char *errstr, ...) { | ||
| 17 | va_list ap; | ||
| 18 | va_start(ap, errstr); | ||
| 19 | vfprintf(stderr, errstr, ap); | ||
| 20 | va_end(ap); | ||
| 21 | exit(1); | ||
| 22 | } | ||
| 23 | 14 | ||
| 24 | static void | 15 | static void |
| 25 | bad_malloc(unsigned int size) | 16 | bad_malloc(unsigned int size) |
| @@ -29,6 +20,8 @@ bad_malloc(unsigned int size) | |||
| 29 | exit(1); | 20 | exit(1); |
| 30 | } | 21 | } |
| 31 | 22 | ||
| 23 | /* extern functions */ | ||
| 24 | |||
| 32 | void * | 25 | void * |
| 33 | emallocz(unsigned int size) | 26 | emallocz(unsigned int size) |
| 34 | { | 27 | { |
| @@ -39,6 +32,15 @@ emallocz(unsigned int size) | |||
| 39 | } | 32 | } |
| 40 | 33 | ||
| 41 | void | 34 | void |
| 35 | eprint(const char *errstr, ...) { | ||
| 36 | va_list ap; | ||
| 37 | va_start(ap, errstr); | ||
| 38 | vfprintf(stderr, errstr, ap); | ||
| 39 | va_end(ap); | ||
| 40 | exit(1); | ||
| 41 | } | ||
| 42 | |||
| 43 | void | ||
| 42 | spawn(Arg *arg) | 44 | spawn(Arg *arg) |
| 43 | { | 45 | { |
| 44 | char **argv = (char **)arg->argv; | 46 | char **argv = (char **)arg->argv; |
