rough framework
[lemu] / notify.h
1 #ifndef NOTIFY_H
2 #define NOTIFY_H
3
4 #define NOTIFY_FATAL(msg, args...) do { if (notify_fn) notify_fn(0, __func__, msg , ##args); } while (0)
5 #define NOTIFY_ERROR(msg, args...) do { if (notify_fn) notify_fn(1, __func__, msg , ##args); } while (0)
6 #define NOTIFY_INFO(msg, args...) do { if (notify_fn) notify_fn(2, __func__, msg , ##args); } while (0)
7 #define NOTIFY_DEBUG(msg, args...) do { if (notify_fn) notify_fn(3, __func__, msg , ##args); } while (0)
8
9 extern
10 void (* notify_fn)(int level, const char *func_name, const char *msg, ...) __attribute__((format(printf, 3, 4)));
11
12 void notify_fn_set(void (* notify_fn)(int level, const char *func_name, const char *fmt, ...));
13
14 #endif /* NOTIFY_H */