First preparations for btr support in para_filter.
[paraslash.git] / filter.c
index 7dbc07851b00c78de96b4889663286f468611398..20ea1333b758b4302774a1c075980072d6ebf208 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -7,6 +7,7 @@
 /** \file filter.c The stand-alone filter program. */
 
 #include <regex.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "filter.cmdline.h"
@@ -152,6 +153,12 @@ static int parse_config(int argc, char *argv[])
        return 1;
 }
 
+/* TODO: support more than one filter, actually parse options */
+static int main_btr(void)
+{
+       return 42;
+}
+
 /**
  * The main function of para_filter.
  *
@@ -169,13 +176,17 @@ int main(int argc, char *argv[])
        int ret;
        static struct sched s;
 
-       stdin_set_defaults(sit);
-       sit->buf = para_malloc(sit->bufsize),
-
        filter_init();
        ret = parse_config(argc, argv);
        if (ret < 0)
                goto out;
+       if (conf.buffer_tree_given) {
+               ret = main_btr();
+               goto out;
+       }
+       stdin_set_defaults(sit);
+       sit->buf = para_malloc(sit->bufsize),
+
        ret = init_filter_chain();
        if (ret < 0)
                goto out;