diff options
author | sin <sin@2f30.org> | 2014-03-08 17:16:44 +0000 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-03-08 17:16:44 +0000 |
commit | 41841eabd5116c1e045c2023900c7ce7850a2480 (patch) | |
tree | f32d14f3b378801103611af0a6a04ec70930a58b /util | |
parent | 27326b71197a4f73e422f388d5aa3d1b3ea24bac (diff) |
Remove util/
Diffstat (limited to 'util')
-rw-r--r-- | util/eprintf.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/util/eprintf.c b/util/eprintf.c deleted file mode 100644 index 8da0651..0000000 --- a/util/eprintf.c +++ /dev/null @@ -1,56 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "../util.h" - -static void venprintf(int, const char *, va_list); - -void -eprintf(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - venprintf(EXIT_FAILURE, fmt, ap); - va_end(ap); -} - -void -enprintf(int status, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - venprintf(status, fmt, ap); - va_end(ap); -} - -static void -venprintf(int status, const char *fmt, va_list ap) -{ - vfprintf(stderr, fmt, ap); - - if(fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } - - exit(status); -} - -void -weprintf(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } -} |