func ((gpointer)kk, (gpointer)&res, ud);
});
}
+}
+
+struct rspamd_scan_result *
+rspamd_find_metric_result (struct rspamd_task *task,
+ const gchar *name)
+{
+ struct rspamd_scan_result *res;
+
+ if (name == NULL) {
+ return task->result;
+ }
+
+ DL_FOREACH (task->result, res) {
+ if (res->name && strcmp (res->name, name) == 0) {
+ return res;
+ }
+ }
+
+ return NULL;
}
\ No newline at end of file
struct rspamd_scan_result *rspamd_create_metric_result (struct rspamd_task *task,
const gchar *name, gint lua_sym_cbref);
+/**
+ * Find result with a specific name (NULL means the default result)
+ * @param task
+ * @param name
+ * @return
+ */
+struct rspamd_scan_result *rspamd_find_metric_result (struct rspamd_task *task,
+ const gchar *name);
+
/**
* Adds a new passthrough result to a task
* @param task