/** \file filter.c The stand-alone filter program. */
#include <regex.h>
+#include <stdbool.h>
#include "para.h"
#include "filter.cmdline.h"
return 1;
}
+/* TODO: support more than one filter, actually parse options */
+static int main_btr(void)
+{
+ return 42;
+}
+
/**
* The main function of para_filter.
*
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;
sot->input_error = &fc->task.error;
register_task(&sit->task);
- register_task(&fc->task);
register_task(&sot->task);
+ register_task(&fc->task);
s.default_timeout.tv_sec = 1;
s.default_timeout.tv_usec = 0;
ret = schedule(&s);