X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Ffilter.h;h=dcbaecbaba41c4c0dc581b091fdff220c5c5f53b;hb=e327d3786ba0371eaaff8e6ba0fe3fc39f095ae2;hp=f551e58fa2faea101403f49c3a27d467924cddf9;hpb=ae0c2eb5d2ea501fd9e458fc138696c268a14569;p=apps%2Fpfixtools.git diff --git a/postlicyd/filter.h b/postlicyd/filter.h index f551e58..dcbaecb 100644 --- a/postlicyd/filter.h +++ b/postlicyd/filter.h @@ -43,6 +43,7 @@ #include "query.h" #include "array.h" + typedef filter_token filter_type_t; typedef hook_token filter_result_t; typedef param_token filter_param_id_t; @@ -116,6 +117,12 @@ typedef void (*filter_destructor_t)(filter_t *filter); typedef void *(*filter_context_constructor_t)(void); typedef void (*filter_context_destructor_t)(void*); +typedef void (*filter_async_handler_t)(filter_context_t *context, + const filter_hook_t *result); + +/** Number of filter currently running. + */ +extern uint32_t filter_running; /* Registration. */ @@ -132,6 +139,8 @@ filter_result_t filter_hook_register(filter_type_t filter, const char *name); __attribute__((nonnull(2))) filter_param_id_t filter_param_register(filter_type_t filter, const char *name); +__attribute__((nonnull)) +void filter_async_handler_register(filter_async_handler_t handler); /* Filter builder. */ @@ -258,10 +267,13 @@ bool filter_test(const filter_t *filter, const query_t *query, /* Filter context */ -__attribute__((nonnull)) +__attribute__((nonnull(1))) void filter_context_prepare(filter_context_t *context, void* qctx); __attribute__((nonnull)) void filter_context_wipe(filter_context_t *context); +__attribute__((nonnull)) +void filter_post_async_result(filter_context_t *context, filter_result_t result); + #endif