summaryrefslogtreecommitdiff
path: root/libsieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-20 12:30:46 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-20 12:30:46 +0000
commitc6594c9993275c999d7d70b7c63bb49070da1414 (patch)
treeeab1cf46f3e1c7babb4fe2face880e0c61674691 /libsieve
parentdee4825117c6de0e359a103f9b6f7e8267dcb163 (diff)
downloadmailutils-c6594c9993275c999d7d70b7c63bb49070da1414.tar.gz
mailutils-c6594c9993275c999d7d70b7c63bb49070da1414.tar.bz2
(sieve_tag_lookup): New function.
Diffstat (limited to 'libsieve')
-rw-r--r--libsieve/util.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/libsieve/util.c b/libsieve/util.c
index 8f391ec5a..2d3c2d083 100644
--- a/libsieve/util.c
+++ b/libsieve/util.c
@@ -359,7 +359,35 @@ sieve_print_tag_list (list_t list, sieve_printf_t printer, void *data)
list_do (list, (list_action_t*) tag_printer, &dbg);
}
-
+static int
+tag_finder (void *item, void *data)
+{
+ sieve_runtime_tag_t *val = item;
+ sieve_runtime_tag_t *target = data;
+
+ if (strcmp (val->tag, target->tag) == 0)
+ {
+ target->arg = val->arg;
+ return 1;
+ }
+ return 0;
+}
+
+int
+sieve_tag_lookup (list_t taglist, char *name, sieve_value_t **arg)
+{
+ sieve_runtime_tag_t t;
+
+ t.tag = name;
+ if (list_do (taglist, tag_finder, &t))
+ {
+ if (arg)
+ *arg = t.arg;
+ return 1;
+ }
+ return 0;
+}
+
int
sieve_mark_deleted (message_t msg, int deleted)
{

Return to:

Send suggestions and report system problems to the System administrator.