summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 17:08:02 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 17:08:02 +0000
commit03d07c2a7511c5a56d92d7373d54275182a2bcf6 (patch)
tree71be308bd32912b8f3fd09fe353d8b254ceb85a1 /src
parent6d65818ca24f83e6b606cd291b3fe17e288f2b07 (diff)
downloadrspamd-03d07c2a7511c5a56d92d7373d54275182a2bcf6.tar.gz
rspamd-03d07c2a7511c5a56d92d7373d54275182a2bcf6.zip
Constify subr structure.
Diffstat (limited to 'src')
-rw-r--r--src/libutil/expression.c5
-rw-r--r--src/libutil/expression.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index c24f139b8..001689355 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -58,7 +58,7 @@ struct rspamd_expression_elt {
};
struct rspamd_expression {
- struct rspamd_atom_subr *subr;
+ const struct rspamd_atom_subr *subr;
GArray *expressions;
GArray *expression_stack;
};
@@ -279,7 +279,7 @@ rspamd_expression_destroy (struct rspamd_expression *expr)
gboolean
rspamd_parse_expression (const gchar *line, gsize len,
- struct rspamd_atom_subr *subr, gpointer subr_data,
+ const struct rspamd_atom_subr *subr, gpointer subr_data,
rspamd_mempool_t *pool, GError **err,
struct rspamd_expression **target)
{
@@ -313,6 +313,7 @@ rspamd_parse_expression (const gchar *line, gsize len,
e->expressions = g_array_new (FALSE, FALSE,
sizeof (struct rspamd_expression_elt));
e->expression_stack = g_array_sized_new (FALSE, FALSE, sizeof (gpointer), 32);
+ e->subr = subr;
/* Shunting-yard algorithm */
while (p < end) {
diff --git a/src/libutil/expression.h b/src/libutil/expression.h
index 7d771963d..8605bbbda 100644
--- a/src/libutil/expression.h
+++ b/src/libutil/expression.h
@@ -65,7 +65,7 @@ struct rspamd_expression;
* @return TRUE if an expression have been parsed
*/
gboolean rspamd_parse_expression (const gchar *line, gsize len,
- struct rspamd_atom_subr *subr, gpointer subr_data,
+ const struct rspamd_atom_subr *subr, gpointer subr_data,
rspamd_mempool_t *pool, GError **err,
struct rspamd_expression **target);