]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - filter_chain.c
Create list of supported filters via autoconf.
[paraslash.git] / filter_chain.c
index def0a81381f42c48a0a7b076f037872c2123af9c..0da4533f496cea2c996ac5ae74428ee7287b40de 100644 (file)
@@ -17,7 +17,8 @@
 #include "error.h"
 #include "string.h"
 
-DEFINE_FILTER_ARRAY(filters);
+/** The array of supported filters. */
+struct filter filters[NUM_SUPPORTED_FILTERS] = {FILTER_ARRAY};
 
 /**
  * Call the init function of each supported filter.
@@ -28,10 +29,10 @@ DEFINE_FILTER_ARRAY(filters);
  */
 void filter_init(struct filter *all_filters)
 {
-       struct filter *f;
+       int i;
 
-       for (f = all_filters; f->name; f++)
-               f->init(f);
+       FOR_EACH_SUPPORTED_FILTER(i)
+               all_filters[i].init(all_filters + i);
 }
 
 /**
@@ -242,7 +243,7 @@ int check_filter_arg(char *fa, void **conf)
 
        *conf = NULL;
 //     PARA_DEBUG_LOG("arg: %s\n", fa);
-       for (j = 0; filters[j].name; j++) {
+       FOR_EACH_SUPPORTED_FILTER(j) {
                const char *name = filters[j].name;
                size_t len = strlen(name);
                char c;