15 #include <haka/container/list.h> 86 #define ALERT(name, nsrc, ntgt) \ 87 struct alert_node *_sources[nsrc+1] = {0}; \ 88 struct alert_node *_targets[ntgt+1] = {0}; \ 89 struct alert name = { \ 90 sources: nsrc==0 ? NULL : _sources, \ 91 targets: ntgt==0 ? NULL : _targets, 107 #define ALERT_NODE(alert, name, index, type, ...) \ 108 struct alert_node _node##name##index = { type }; \ 109 alert.name[index] = &_node##name##index; \ 110 char *_node##name##index_list[] = { __VA_ARGS__, NULL }; \ 111 _node##name##index.list = _node##name##index_list 120 #define ALERT_REF(alert, count, ...) \ 121 uint64 _alert_ref[count] = { __VA_ARGS__ }; \ 122 alert.alert_ref_count = count; \ 123 alert.alert_ref = _alert_ref 131 #define ALERT_METHOD_REF(alert, ...) \ 132 char *_method_ref[] = { __VA_ARGS__, NULL }; \ 133 alert.method_ref = _method_ref 166 const char *header,
const char *indent,
bool color);
178 void (*destroy)(
struct alerter *state);
181 bool mark_for_remove;
char ** method_ref
Definition: alert.h:72
const char * alert_node_to_str(alert_node_type type)
Definition: alert.c:226
char * method_description
Definition: alert.h:71
struct alert_node ** targets
Definition: alert.h:74
alert_node_type type
Definition: alert.h:56
alert_level
Definition: alert.h:21
bool alert_update(uint64 id, const struct alert *alert)
Definition: alert.c:163
char * description
Definition: alert.h:66
uint64 alert(const struct alert *alert)
Definition: alert.c:142
alert_completion completion
Definition: alert.h:70
unsigned HAKA_64BIT_TYPE uint64
Definition: types.h:30
bool remove_alerter(struct alerter *alerter)
Definition: alert.c:75
void enable_stdout_alert(bool enable)
void remove_all_alerter()
Definition: alert.c:107
char ** list
Definition: alert.h:57
alert_level severity
Definition: alert.h:67
const char * alert_completion_to_str(alert_completion completion)
Definition: alert.c:215
struct alert_node ** sources
Definition: alert.h:73
bool add_alerter(struct alerter *alerter)
Definition: alert.c:55
unsigned char bool
Definition: types.h:17
alert_node_type
Definition: alert.h:45
alert_completion
Definition: alert.h:34
const char * alert_tostring(uint64 id, const struct time *time, const struct alert *alert, const char *header, const char *indent, bool color)
Definition: alert.c:273
double confidence_num
Definition: alert.h:69
uint64 * alert_ref
Definition: alert.h:76
const char * alert_level_to_str(alert_level level)
Definition: alert.c:203
size_t alert_ref_count
Definition: alert.h:75
alert_level confidence
Definition: alert.h:68