diff options
author | Bernie Innocenti <bernie@codewiz.org> | 2010-05-03 21:53:47 (GMT) |
---|---|---|
committer | Bernie Innocenti <bernie@codewiz.org> | 2010-05-03 21:53:47 (GMT) |
commit | 1030dc837b10a03a02a85d5504cbeec168ce49e2 (patch) | |
tree | 698eefa87ac437deaf36a4141b326f8ce7986692 /src/util/xerror.c |
Import XaoS r489 (trunk after version 3.5)
Diffstat (limited to 'src/util/xerror.c')
-rw-r--r-- | src/util/xerror.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/util/xerror.c b/src/util/xerror.c new file mode 100644 index 0000000..f7a904f --- /dev/null +++ b/src/util/xerror.c @@ -0,0 +1,43 @@ +#ifdef _plan9_ +#include <u.h> +#include <libc.h> +#endif +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include "config.h" +#include "xerror.h" +#include "aconfig.h" +/*BeOS driver have its own routines in the C++ code */ +#ifndef BEOS_DRIVER +/*On windows we use message boxes done in the ui_win32.c code*/ +#ifndef WIN32_DRIVER +void x_message(CONST char *text, ...) +{ + va_list ap; + va_start(ap, text); + vfprintf(stdout, text, ap); + fprintf(stdout, "\n"); + va_end(ap); +} + +void x_error(CONST char *text, ...) +{ + va_list ap; + va_start(ap, text); + vfprintf(stderr, text, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +void x_fatalerror(CONST char *text, ...) +{ + va_list ap; + va_start(ap, text); + vfprintf(stderr, text, ap); + fprintf(stderr, "\n"); + va_end(ap); + exit(1); +} +#endif +#endif |