Browse Source

* bind stats() on filter library load

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

2
src/filter.c

@ -96,6 +96,8 @@ f2b_filter_create(f2b_config_section_t *config, const char *file) {
goto cleanup; goto cleanup;
if ((*(void **) (&filter->ready) = dlsym(filter->h, "ready")) == NULL) if ((*(void **) (&filter->ready) = dlsym(filter->h, "ready")) == NULL)
goto cleanup; goto cleanup;
if ((*(void **) (&filter->stats) = dlsym(filter->h, "stats")) == NULL)
goto cleanup;
if ((*(void **) (&filter->match) = dlsym(filter->h, "match")) == NULL) if ((*(void **) (&filter->match) = dlsym(filter->h, "match")) == NULL)
goto cleanup; goto cleanup;
if ((*(void **) (&filter->destroy) = dlsym(filter->h, "destroy")) == NULL) if ((*(void **) (&filter->destroy) = dlsym(filter->h, "destroy")) == NULL)

1
src/filter.h

@ -18,6 +18,7 @@ typedef struct f2b_filter_t {
bool (*append) (void *cfg, const char *pattern); bool (*append) (void *cfg, const char *pattern);
char *(*error) (void *cfg); char *(*error) (void *cfg);
bool (*ready) (void *cfg); bool (*ready) (void *cfg);
bool (*stats) (void *cfg, int **matches, char **pattern, bool reset);
bool (*match) (void *cfg, const char *line, char *buf, size_t buf_size); bool (*match) (void *cfg, const char *line, char *buf, size_t buf_size);
void (*destroy) (void *cfg); void (*destroy) (void *cfg);
} f2b_filter_t; } f2b_filter_t;

Loading…
Cancel
Save