diff options
author | Ondřej Surý <ondrej@sury.org> | 2013-04-16 11:31:22 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2013-04-18 08:28:36 +0200 |
commit | 32b1307c62a5e8385118b6d7ce84743d125d335d (patch) | |
tree | 70cb1251e9ac6341c6a93b9a2ba3b35762ce59a7 /src/gd_errors.h | |
parent | 21efcc3092a76540476a3f5e0ddc236214d05de0 (diff) | |
download | libgd-32b1307c62a5e8385118b6d7ce84743d125d335d.tar.gz |
Use custom error handler instead of fprintf(stderr, ...)
Diffstat (limited to 'src/gd_errors.h')
-rw-r--r-- | src/gd_errors.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gd_errors.h b/src/gd_errors.h new file mode 100644 index 0000000..0020ac3 --- /dev/null +++ b/src/gd_errors.h @@ -0,0 +1,26 @@ +#ifndef GD_ERRORS_H +#define GD_ERRORS_H + +#include <syslog.h> + +/* +LOG_EMERG system is unusable +LOG_ALERT action must be taken immediately +LOG_CRIT critical conditions +LOG_ERR error conditions +LOG_WARNING warning conditions +LOG_NOTICE normal, but significant, condition +LOG_INFO informational message +LOG_DEBUG debug-level message +*/ + +#define E_ERROR LOG_ERR +#define E_WARNING LOG_WARNING +#define E_NOTICE LOG_NOTICE +#define E_INFO LOG_INFO +#define E_DEBUG LOG_DEBUG + +void gd_error(const char *format, ...); +void gd_error_ex(int priority, const char *format, ...); + +#endif |