Browse Source

* add f2b_filter_reload()

master
Alex 'AdUser' Z 8 years ago
parent
commit
fc51dc133f
  1. 8
      src/filter.c
  2. 1
      src/filter.h

8
src/filter.c

@ -175,6 +175,14 @@ f2b_filter_match(f2b_filter_t *filter, const char *line, char *buf, size_t buf_s
return filter->match(filter->cfg, line, buf, buf_size);
}
bool
f2b_filter_reload(f2b_filter_t *filter) {
assert(filter != NULL);
filter->flush(filter->cfg);
return f2b_filter_load_file(filter, filter->file);
}
const char *
f2b_filter_error(f2b_filter_t *filter) {
assert(filter != NULL);

1
src/filter.h

@ -27,6 +27,7 @@ typedef struct f2b_filter_t {
f2b_filter_t * f2b_filter_create (f2b_config_section_t *config, const char *id);
const char * f2b_filter_error (f2b_filter_t *f);
bool f2b_filter_reload (f2b_filter_t *f);
bool f2b_filter_append (f2b_filter_t *f, const char *pattern);
bool f2b_filter_match (f2b_filter_t *f, const char *line, char *buf, size_t buf_size);
void f2b_filter_stats (f2b_filter_t *f, char *res, size_t ressize);

Loading…
Cancel
Save