aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libucl/ucl.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-07 15:29:14 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-07 15:29:14 +0000
commit813496dd02e73d00ca9936397c7a9bed5bcd61a3 (patch)
tree3114931545dc730b1b8787d9e983810db71772a4 /contrib/libucl/ucl.h
parent39ed10ed8fbc506845adb0b44b6ba40a8447b672 (diff)
downloadrspamd-813496dd02e73d00ca9936397c7a9bed5bcd61a3.tar.gz
rspamd-813496dd02e73d00ca9936397c7a9bed5bcd61a3.zip
[Minor] Allow to set include trace function
Diffstat (limited to 'contrib/libucl/ucl.h')
-rw-r--r--contrib/libucl/ucl.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/contrib/libucl/ucl.h b/contrib/libucl/ucl.h
index 852a77cf1..f7f8354c5 100644
--- a/contrib/libucl/ucl.h
+++ b/contrib/libucl/ucl.h
@@ -1280,6 +1280,13 @@ UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *
bool need_expand);
/**
+ * Returns current file for the parser
+ * @param parser parser object
+ * @return current file or NULL if parsing memory
+ */
+UCL_EXTERN const char *ucl_parser_get_cur_file (struct ucl_parser *parser);
+
+/**
* Defines special handler for certain types of data (identified by magic)
*/
typedef bool (*ucl_parser_special_handler_t) (struct ucl_parser *parser,
@@ -1300,13 +1307,39 @@ struct ucl_parser_special_handler {
};
/**
- * Add special handler for a parser
+ * Add special handler for a parser, handles special sequences identified by magic
* @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);
+/**
+ * Handler for include traces:
+ * @param parser parser object
+ * @param parent where include is done from
+ * @param args arguments to an include
+ * @param path path of the include
+ * @param pathlen length of the path
+ * @param user_data opaque userdata
+ */
+typedef void (ucl_include_trace_func_t) (struct ucl_parser *parser,
+ const ucl_object_t *parent,
+ const ucl_object_t *args,
+ const char *path,
+ size_t pathlen,
+ void *user_data);
+
+/**
+ * Register trace function for an include handler
+ * @param parser parser object
+ * @param func function to trace includes
+ * @param user_data opaque data
+ */
+UCL_EXTERN void ucl_parser_set_include_tracer (struct ucl_parser *parser,
+ ucl_include_trace_func_t func,
+ void *user_data);
+
/** @} */
/**