summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-20 12:29:06 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-20 12:29:06 +0000
commit315fe60c7cd20eae841370506e052abfaf700997 (patch)
treece1a6824109b8612de5f381273a0c0316873acc2
parentd8a33e766dab7f88bd7385ee802d9f7156608110 (diff)
downloadmailutils-315fe60c7cd20eae841370506e052abfaf700997.tar.gz
mailutils-315fe60c7cd20eae841370506e052abfaf700997.tar.bz2
(sieve_test_lookup,sieve_action_lookup)
(sieve_register_test,sieve_register_action): Accept the pointer to sieve machine as first argument.
-rw-r--r--libsieve/register.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libsieve/register.c b/libsieve/register.c
index 64b9a4735..f70b726a9 100644
--- a/libsieve/register.c
+++ b/libsieve/register.c
@@ -25,9 +25,6 @@
#include <string.h>
#include <sieve.h>
-static list_t test_list;
-static list_t action_list;
-
static sieve_register_t *
sieve_lookup (list_t list, const char *name)
{
@@ -50,24 +47,25 @@ sieve_lookup (list_t list, const char *name)
}
sieve_register_t *
-sieve_test_lookup (const char *name)
+sieve_test_lookup (sieve_machine_t mach, const char *name)
{
- return sieve_lookup (test_list, name);
+ return sieve_lookup (mach->test_list, name);
}
sieve_register_t *
-sieve_action_lookup (const char *name)
+sieve_action_lookup (sieve_machine_t mach, const char *name)
{
- return sieve_lookup (action_list, name);
+ return sieve_lookup (mach->action_list, name);
}
static int
-sieve_register (list_t *list,
+sieve_register (list_t *pool,
+ list_t *list,
const char *name, sieve_handler_t handler,
sieve_data_type *arg_types,
sieve_tag_group_t *tags, int required)
{
- sieve_register_t *reg = malloc (sizeof (*reg));
+ sieve_register_t *reg = sieve_palloc (pool, sizeof (*reg));
if (!reg)
return ENOMEM;
@@ -93,17 +91,23 @@ sieve_register (list_t *list,
int
-sieve_register_test (const char *name, sieve_handler_t handler,
+sieve_register_test (sieve_machine_t mach,
+ const char *name, sieve_handler_t handler,
sieve_data_type *arg_types,
sieve_tag_group_t *tags, int required)
{
- return sieve_register (&test_list, name, handler, arg_types, tags, required);
+ return sieve_register (&mach->memory_pool,
+ &mach->test_list, name, handler,
+ arg_types, tags, required);
}
int
-sieve_register_action (const char *name, sieve_handler_t handler,
+sieve_register_action (sieve_machine_t mach,
+ const char *name, sieve_handler_t handler,
sieve_data_type *arg_types,
sieve_tag_group_t *tags, int required)
{
- return sieve_register (&action_list, name, handler, arg_types, tags, required);
+ return sieve_register (&mach->memory_pool,
+ &mach->action_list, name, handler,
+ arg_types, tags, required);
}

Return to:

Send suggestions and report system problems to the System administrator.