/*
- * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2013 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file filter.c The stand-alone filter program. */
#include <regex.h>
-#include <stdbool.h>
#include "para.h"
#include "filter.cmdline.h"
static char *cf; /* config file */
struct stat statbuf;
- if (filter_cmdline_parser(argc, argv, &conf))
- return -E_FILTER_SYNTAX;
+ filter_cmdline_parser(argc, argv, &conf);
HANDLE_VERSION_FLAG("filter", conf);
if (conf.help_given || conf.detailed_help_given)
print_help_and_die();
.check_ambiguity = 0,
.print_errors = 1
};
- if (filter_cmdline_parser_config_file(cf, &conf, ¶ms))
- return -E_FILTER_SYNTAX;
+ filter_cmdline_parser_config_file(cf, &conf, ¶ms);
}
if (!conf.filter_given)
return -E_NO_FILTERS;
f = filters + fn->filter_num;
if (f->close)
f->close(fn);
- btr_free_node(fn->btrn);
- free(fn->conf);
+ btr_remove_node(&fn->btrn);
+ if (f->free_config)
+ f->free_config(fn->conf);
free(fn);
}
free(fns);
- btr_free_node(sit->btrn);
- btr_free_node(sot->btrn);
+ btr_remove_node(&sit->btrn);
+ btr_remove_node(&sot->btrn);
out:
if (ret < 0)
PARA_EMERG_LOG("%s\n", para_strerror(-ret));