diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-05 14:58:37 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-05 14:58:37 +0100 |
commit | a3191bd7b34d3373d151827a6e6592ea82084747 (patch) | |
tree | ab4ecb6c138e1a21cb76aeaf4503d04a253568ae /contrib/libucl/ucl.h | |
parent | 91154ccc0114f1dca3b803a9c9bcfd065297c329 (diff) | |
download | rspamd-a3191bd7b34d3373d151827a6e6592ea82084747.tar.gz rspamd-a3191bd7b34d3373d151827a6e6592ea82084747.zip |
[Feture] Allow external preprocessors in libucl
Diffstat (limited to 'contrib/libucl/ucl.h')
-rw-r--r-- | contrib/libucl/ucl.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/libucl/ucl.h b/contrib/libucl/ucl.h index 812b89477..f0dbeca84 100644 --- a/contrib/libucl/ucl.h +++ b/contrib/libucl/ucl.h @@ -1278,6 +1278,34 @@ UCL_EXTERN bool ucl_parser_pubkey_add (struct ucl_parser *parser, UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool need_expand); +/** + * Defines special handler for certain types of data (identified by magic) + */ +typedef bool (*ucl_parser_special_handler_t) (struct ucl_parser *parser, + const unsigned char *source, size_t source_len, + unsigned char **destination, size_t *dest_len, + void *user_data); + +/** + * Special handler structure + */ +struct ucl_parser_special_handler { + unsigned char *magic; + size_t magic_len; + ucl_parser_special_handler_t handler; + void (*free_function) (unsigned char *data, size_t len, void *user_data); + void *user_data; + struct ucl_parser_special_handler *next; /* Used internally */ +}; + +/** + * Add special handler for a parser + * @param parser parser structure + * @param handler handler structure + */ +UCL_EXTERN void ucl_parser_add_special_handler (struct ucl_parser *parser, + struct ucl_parser_special_handler *handler); + /** @} */ /** |