]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Expose event_filter_category_to_log_type to the rest of event filter code
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Thu, 28 May 2020 21:43:21 +0000 (17:43 -0400)
committerJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Thu, 28 May 2020 21:43:21 +0000 (17:43 -0400)
src/lib/event-filter-private.h
src/lib/event-filter.c

index 9f566da0db7194839c15f3228ef2e7b473b385e8..d8b23a5a7ea118c6ca2d898436424d0b69b412ef 100644 (file)
@@ -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
index 125b8c443b9ab963fb40c3c336cb63b55b901d86..72e9e8937bba4aff0d327966a576c3ddd4fc1fd7 100644 (file)
@@ -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;