From: Josef 'Jeff' Sipek Date: Thu, 28 May 2020 21:43:21 +0000 (-0400) Subject: lib: Expose event_filter_category_to_log_type to the rest of event filter code X-Git-Tag: 2.3.13~493 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc330b22cf9c57696028aa729ee499c325361bf2;p=thirdparty%2Fdovecot%2Fcore.git lib: Expose event_filter_category_to_log_type to the rest of event filter code --- diff --git a/src/lib/event-filter-private.h b/src/lib/event-filter-private.h index 9f566da0db..d8b23a5a7e 100644 --- a/src/lib/event-filter-private.h +++ b/src/lib/event-filter-private.h @@ -26,6 +26,17 @@ enum event_filter_node_type { EVENT_FILTER_NODE_TYPE_EVENT_FIELD, /* field */ }; +enum event_filter_log_type { + EVENT_FILTER_LOG_TYPE_DEBUG = BIT(0), + EVENT_FILTER_LOG_TYPE_INFO = BIT(1), + EVENT_FILTER_LOG_TYPE_WARNING = BIT(2), + EVENT_FILTER_LOG_TYPE_ERROR = BIT(3), + EVENT_FILTER_LOG_TYPE_FATAL = BIT(4), + EVENT_FILTER_LOG_TYPE_PANIC = BIT(5), + + EVENT_FILTER_LOG_TYPE_ALL = 0xff, +}; + struct event_filter_node { enum event_filter_node_type type; enum event_filter_node_op op; @@ -53,4 +64,7 @@ struct event_filter_node { struct event_field field; }; +bool event_filter_category_to_log_type(const char *name, + enum event_filter_log_type *log_type_r); + #endif diff --git a/src/lib/event-filter.c b/src/lib/event-filter.c index 125b8c443b..72e9e8937b 100644 --- a/src/lib/event-filter.c +++ b/src/lib/event-filter.c @@ -17,16 +17,6 @@ enum event_filter_code { EVENT_FILTER_CODE_FIELD = 'f', }; -enum event_filter_log_type { - EVENT_FILTER_LOG_TYPE_DEBUG = BIT(0), - EVENT_FILTER_LOG_TYPE_INFO = BIT(1), - EVENT_FILTER_LOG_TYPE_WARNING = BIT(2), - EVENT_FILTER_LOG_TYPE_ERROR = BIT(3), - EVENT_FILTER_LOG_TYPE_FATAL = BIT(4), - EVENT_FILTER_LOG_TYPE_PANIC = BIT(5), - - EVENT_FILTER_LOG_TYPE_ALL = 0xff, -}; static const char *event_filter_log_type_names[] = { "debug", "info", "warning", "error", "fatal", "panic", }; @@ -109,9 +99,8 @@ void event_filter_unref(struct event_filter **_filter) } } -static bool -event_filter_category_to_log_type(const char *name, - enum event_filter_log_type *log_type_r) +bool event_filter_category_to_log_type(const char *name, + enum event_filter_log_type *log_type_r) { unsigned int i;