{
struct rspamd_regexp_map_helper *re_map;
+ if (data->cur_data == NULL) {
+ re_map = rspamd_map_helper_new_regexp (data->map,
+ RSPAMD_REGEXP_MAP_FLAG_GLOB|RSPAMD_REGEXP_MAP_FLAG_MULTIPLE);
+ data->cur_data = re_map;
+ }
+
+ return rspamd_parse_kv_list (
+ chunk,
+ len,
+ data,
+ rspamd_map_helper_insert_re,
+ hash_fill,
+ final);
+}
+
+gchar *
+rspamd_glob_list_read_multiple (
+ gchar *chunk,
+ gint len,
+ struct map_cb_data *data,
+ gboolean final)
+{
+ struct rspamd_regexp_map_helper *re_map;
+
if (data->cur_data == NULL) {
re_map = rspamd_map_helper_new_regexp (data->map, RSPAMD_REGEXP_MAP_FLAG_MULTIPLE);
data->cur_data = re_map;
final);
}
+
void
rspamd_regexp_list_fin (struct map_cb_data *data)
{
gint len,
struct map_cb_data *data,
gboolean final);
+
gchar * rspamd_glob_list_read_single (
gchar *chunk,
gint len,
struct map_cb_data *data,
gboolean final);
+gchar * rspamd_glob_list_read_multiple (
+ gchar *chunk,
+ gint len,
+ struct map_cb_data *data,
+ gboolean final);
void rspamd_regexp_list_fin (struct map_cb_data *data);
void rspamd_regexp_list_dtor (struct map_cb_data *data);
}
m->lua_map = map;
}
+ else if (strcmp (type, "glob_multi") == 0) {
+ map = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*map));
+ map->data.re_map = NULL;
+ map->type = RSPAMD_LUA_MAP_REGEXP_MULTIPLE;
+
+ if ((m = rspamd_map_add_from_ucl (cfg, map_obj, description,
+ rspamd_glob_list_read_multiple,
+ rspamd_regexp_list_fin,
+ rspamd_regexp_list_dtor,
+ (void **) &map->data.re_map)) == NULL) {
+ lua_pushnil (L);
+ ucl_object_unref (map_obj);
+
+ return 1;
+ }
+ m->lua_map = map;
+ }
else {
ret = luaL_error (L, "invalid arguments: unknown type '%s'", type);
ucl_object_unref (map_obj);