src/modules/logwatch_filter.c
changeset 135 9159bd51525f
parent 133 e2d0c0c23b39
child 138 a716c621cb90
--- a/src/modules/logwatch_filter.c	Sun Apr 12 18:35:16 2009 +0300
+++ b/src/modules/logwatch_filter.c	Sun Apr 12 18:56:51 2009 +0300
@@ -7,6 +7,19 @@
 
 #include <assert.h>
 
+struct logwatch_filter* logwatch_filter_lookup (struct logwatch *ctx, const char *name)
+{
+    struct logwatch_filter *filter;
+    
+    // inspect each filter
+    TAILQ_FOREACH(filter, &ctx->filters, logwatch_filters)
+        if (strcmp(filter->name, name) == 0)
+            return filter;
+    
+    // not found
+    return NULL;
+}
+
 struct logwatch_filter* logwatch_filter (struct logwatch *ctx, const char *name, const struct logwatch_source *source,
         const char *pattern, const char *format, struct logwatch_chan *chan, struct error_info *err)
 {