#include "internal.h" #define DEFINE_EVENT(_name, _id, ...) \ [_name] = { .name = #_name, .event_id = _id, __VA_ARGS__ }, #define DEFINE_EVENT_STATE(_name, ...) \ static const struct event_member_def \ __event_def_##_name[_name##_invalid] = { __VA_ARGS__ }; \ struct event __event_##_name = { \ .name = #_name, \ .max_state = _name##_invalid, \ .def = __event_def_##_name, \ .raw_event_id = 0, \ }; #define DEFINE_EVENT_RAW(_name, _id, _default) \ struct event __event_##_name = { \ .name = #_name, \ .max_state = 0, \ .def = NULL, \ .raw_event_id = _id, \ }; #include struct event *events_list[] = { #define DEFINE_EVENT_STATE(_name, ...) &__event_##_name, #define DEFINE_EVENT_RAW(_name, ...) &__event_##_name, #include NULL, };