This is done in verbose/debug mode and when build options are reported.
void flt_register_keywords(struct flt_kw_list *kwl);
struct flt_kw *flt_find_kw(const char *kw);
void flt_dump_kws(char **out);
+void list_filters(FILE *out);
/* Helper function that returns the "global" state of filters attached to a
* stream. */
/* Descriptor for a "filter" keyword. The ->parse() function returns 0 in case
* of success, or a combination of ERR_* flags if an error is encountered. The
- * function pointer can be NULL if not implemented. The function also has an
- * access to the current "server" config line. The ->skip value tells the parser
- * how many words have to be skipped after the keyword. If the function needs to
- * parse more keywords, it needs to update cur_arg.
+ * function pointer can be NULL if not implemented.
*/
struct flt_kw {
const char *kw;
}
}
+/*
+ * Lists the known filters on <out>
+ */
+void
+list_filters(FILE *out)
+{
+ char *filters, *p, *f;
+
+ fprintf(out, "Available filters :\n");
+ flt_dump_kws(&filters);
+ for (p = filters; (f = strtok_r(p,"\n",&p));)
+ fprintf(out, "\t%s\n", f);
+ free(filters);
+}
+
/*
* Parses the "filter" keyword. All keywords must be handled by filters
* themselves
list_pollers(stdout);
putchar('\n');
+ list_filters(stdout);
+ putchar('\n');
}
/*
/* Note: we could disable any poller by name here */
- if (global.mode & (MODE_VERBOSE|MODE_DEBUG))
+ if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) {
list_pollers(stderr);
+ fprintf(stderr, "\n");
+ list_filters(stderr);
+ }
if (!init_pollers()) {
Alert("No polling mechanism available.\n"