}
gboolean
-rspamd_config_parse_ucl (struct rspamd_config *cfg, const gchar *filename,
- GHashTable *vars, GError **err)
+rspamd_config_parse_ucl (struct rspamd_config *cfg,
+ const gchar *filename,
+ GHashTable *vars,
+ ucl_include_trace_func_t inc_trace,
+ void *trace_data,
+ GError **err)
{
struct stat st;
gint fd;
rspamd_ucl_add_conf_macros (parser, cfg);
ucl_parser_set_filevars (parser, filename, true);
+ if (inc_trace) {
+ ucl_parser_set_include_tracer (parser, inc_trace, trace_data);
+ }
+
if (decrypt_keypair) {
struct ucl_parser_special_handler *decrypt_handler;
struct rspamd_rcl_section *top, *logger_section;
const ucl_object_t *logger_obj;
- if (!rspamd_config_parse_ucl (cfg, filename, vars, &err)) {
+ if (!rspamd_config_parse_ucl (cfg, filename, vars, NULL, NULL, &err)) {
msg_err_config_forced ("failed to load config: %e", err);
g_error_free (err);
gboolean rspamd_config_parse_ucl (struct rspamd_config *cfg,
const gchar *filename,
GHashTable *vars,
+ ucl_include_trace_func_t inc_trace,
+ void *trace_data,
GError **err);
gboolean rspamd_config_read (struct rspamd_config *cfg,
const gchar *filename,
LUA_FUNCTION_DEF (config, experimental_enabled);
/***
- * @method rspamd_config:load_ucl(filename)
+ * @method rspamd_config:load_ucl(filename[, include_trace])
* Loads config from the UCL file (but does not perform parsing using rcl)
* @param {string} filename file to load
* @return true or false + error message
lua_pop (L, 1);
- if (!rspamd_config_parse_ucl (cfg, filename, paths, &err)) {
+ if (!rspamd_config_parse_ucl (cfg, filename, paths, NULL, NULL, &err)) {
lua_pushboolean (L, false);
lua_pushfstring (L, "failed to load config: %s", err->message);
g_error_free (err);