scons --> make
[aftubes.git] / errors.h
blobc82d4811deb67002b4e2aafa6293a7e67d7fa524
1 #ifndef ERRORS_H
2 #define ERRORS_H
4 typedef int err_t;
6 #define ERR_GROUP(number) ((number) << 12)
8 err_t make_error_internal(err_t n, void *obj, const char *file, const char *func, int line, const char *fmt, ...);
9 #define make_error(n, obj, ...) make_error_internal((n), (obj), __FILE__, __func__, __LINE__, __VA_ARGS__)
11 err_t get_last_error(void);
12 const char *get_last_error_file(void);
13 int get_last_error_line(void);
14 const char *get_last_error_func(void);
15 const char *get_last_error_message(void);
17 // some common error messages
19 enum {
20 EOK = 0,
21 ENOMEM, // memory full!
22 ENOTIMPL, // not implemented
25 #endif