aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-23 16:18:00 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-23 16:18:00 +0400
commit140910a0f6c3dc857f5b949bd9caff91188e78b0 (patch)
tree5cf5e6c746330bb82b4dee06bfb25fec82d68db1 /src/expressions.h
parentbf47a84713c6705326b0eb02e9fab7a061f86695 (diff)
downloadrspamd-140910a0f6c3dc857f5b949bd9caff91188e78b0.tar.gz
rspamd-140910a0f6c3dc857f5b949bd9caff91188e78b0.zip
* Fix expression parser: make it recursive and allow expressions inside function's arguments
* Rewrite functions interface and implement arguments parsing
Diffstat (limited to 'src/expressions.h')
-rw-r--r--src/expressions.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/expressions.h b/src/expressions.h
index 501974112..5debe87b2 100644
--- a/src/expressions.h
+++ b/src/expressions.h
@@ -24,7 +24,7 @@ struct expression_function {
struct expression_argument {
enum {
EXPRESSION_ARGUMENT_NORMAL,
- EXPRESSION_ARGUMENT_FUNCTION
+ EXPRESSION_ARGUMENT_BOOL,
} type; /**< type of argument (text or other function) */
void *data; /**< pointer to its data */
};
@@ -104,4 +104,13 @@ void task_cache_add (struct worker_task *task, void *pointer, int32_t result);
*/
int32_t task_cache_check (struct worker_task *task, void *pointer);
+/**
+ * Parse and return a single function argument for a function (may recurse)
+ * @param expr expression structure that represents function's argument
+ * @param task task object
+ * @param want_string return NULL if argument is not a string
+ * @return expression argument structure or NULL if failed
+ */
+struct expression_argument *get_function_arg (struct expression *expr, struct worker_task *task, gboolean want_string);
+
#endif