37 dispatch_naming_init(
void)
45 #define DECLARE_ID_MAP_FNS(type) \
47 get_##type##_id(const char *name) \
49 unsigned u = namemap_get_or_create_id(&type##_id_map, name); \
50 tor_assert(u != NAMEMAP_ERR); \
51 tor_assert(u != ERROR_ID); \
52 return (type##_id_t) u; \
55 get_##type##_id_name(type##_id_t id) \
57 return namemap_fmt_name(&type##_id_map, id); \
60 get_num_##type##_ids(void) \
62 return namemap_get_size(&type##_id_map); \
67 DECLARE_ID_MAP_FNS(message);
68 DECLARE_ID_MAP_FNS(channel);
69 DECLARE_ID_MAP_FNS(subsys);
70 DECLARE_ID_MAP_FNS(msg_type);
Utility macros to handle different features and behavior in different compilers.
static namemap_t msg_type_id_map
static namemap_t channel_id_map
static namemap_t message_id_map
static namemap_t subsys_id_map
Header for dispatch_naming.c.
Types used for messages in the dispatcher code.
Internal declarations for namemap structure.
Macros to manage assertions, fatal and non-fatal.