]> source.dussan.org Git - rspamd.git/commitdiff
Constify subr structure.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Mar 2015 17:08:02 +0000 (17:08 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Mar 2015 17:08:02 +0000 (17:08 +0000)
src/libutil/expression.c
src/libutil/expression.h

index c24f139b8db3ff998b9b779b007444db48f2a739..0016893551b3966f830ad277527eeb51af552619 100644 (file)
@@ -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) {
index 7d771963dc4ef163ce41b0736d3042a1525c11c1..8605bbbda6dcc03a65927ed33217e2608ae630c3 100644 (file)
@@ -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);