Commit e5b11edf e5b11edf9793f392bc9da33ddc4fd0639376df43 by Sergey Poznyakoff

Finish namespace cleanup in libsieve.

* libsieve/actions.c, libsieve/comparator.c, libsieve/conf.c,
libsieve/load.c, libsieve/prog.c, libsieve/register.c,
libsieve/relational.c, libsieve/require.c, libsieve/runtime.c,
libsieve/sieve.h, libsieve/sieve.l, libsieve/sieve.y,
libsieve/tests.c, libsieve/util.c: Prefix all external
identifiers, that are not intended for use by application
programs, with mu_sv_.
1 parent 69b1db83
2008-07-19 Sergey Poznyakoff <gray@gnu.org.ua>
Finish namespace cleanup in libsieve.
* libsieve/actions.c, libsieve/comparator.c, libsieve/conf.c,
libsieve/load.c, libsieve/prog.c, libsieve/register.c,
libsieve/relational.c, libsieve/require.c, libsieve/runtime.c,
libsieve/sieve.h, libsieve/sieve.l, libsieve/sieve.y,
libsieve/tests.c, libsieve/util.c: Prefix all external
identifiers, that are not intended for use by application
programs, with mu_sv_.
Minor fixes.
* NEWS, configure.ac: Raise version to 1.9.91
......
......@@ -31,7 +31,7 @@ extern "C" {
#define __s_cat3__(a,b,c) a ## b ## c
#define SIEVE_EXPORT(module,name) __s_cat3__(module,_LTX_,name)
typedef struct sieve_machine *mu_sieve_machine_t;
typedef struct mu_sieve_machine *mu_sieve_machine_t;
typedef struct
{
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005,
2006, 2007 Free Software Foundation, Inc.
2006, 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -27,7 +27,27 @@
#include <string.h>
#include <sieve.h>
int
static int
sieve_mark_deleted (mu_message_t msg, int deleted)
{
mu_attribute_t attr = 0;
int rc;
rc = mu_message_get_attribute (msg, &attr);
if (!rc)
{
if (deleted)
rc = mu_attribute_set_deleted (attr);
else
rc = mu_attribute_unset_deleted (attr);
}
return rc;
}
static int
sieve_action_stop (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_sieve_log_action (mach, "STOP", NULL);
......@@ -35,7 +55,7 @@ sieve_action_stop (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
return 0;
}
int
static int
sieve_action_keep (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_sieve_log_action (mach, "KEEP", NULL);
......@@ -45,7 +65,7 @@ sieve_action_keep (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
return 0;
}
int
static int
sieve_action_discard (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_sieve_log_action (mach, "DISCARD", _("marking as deleted"));
......@@ -55,7 +75,7 @@ sieve_action_discard (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
return 0;
}
int
static int
sieve_action_fileinto (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
int rc;
......@@ -253,7 +273,7 @@ build_mime (mu_mime_t *pmime, mu_message_t msg, const char *text)
return 0;
}
int
static int
sieve_action_reject (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_mime_t mime = NULL;
......@@ -370,7 +390,7 @@ check_redirect_loop (mu_message_t msg)
return loop;
}
int
static int
sieve_action_redirect (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_message_t msg, newmsg = NULL;
......@@ -487,7 +507,7 @@ mu_sieve_data_type fileinto_args[] = {
};
void
sieve_register_standard_actions (mu_sieve_machine_t mach)
mu_sv_register_standard_actions (mu_sieve_machine_t mach)
{
mu_sieve_register_action (mach, "stop", sieve_action_stop, NULL, NULL, 1);
mu_sieve_register_action (mach, "keep", sieve_action_keep, NULL, NULL, 1);
......
......@@ -40,7 +40,8 @@ int
mu_sieve_register_comparator (mu_sieve_machine_t mach,
const char *name,
int required,
mu_sieve_comparator_t is, mu_sieve_comparator_t contains,
mu_sieve_comparator_t is,
mu_sieve_comparator_t contains,
mu_sieve_comparator_t matches,
mu_sieve_comparator_t regex,
mu_sieve_comparator_t eq)
......@@ -103,7 +104,8 @@ mu_sieve_require_comparator (mu_sieve_machine_t mach, const char *name)
}
mu_sieve_comparator_t
mu_sieve_comparator_lookup (mu_sieve_machine_t mach, const char *name, int matchtype)
mu_sieve_comparator_lookup (mu_sieve_machine_t mach, const char *name,
int matchtype)
{
sieve_comparator_record_t *reg = _lookup (mach->comp_list, name);
if (reg && reg->comp[matchtype])
......@@ -159,7 +161,7 @@ _regex_compile (void *item, void *data)
{
struct regex_data *rd = data;
int rc;
regex_t *preg = mu_sieve_malloc (sieve_machine, sizeof (*preg));
regex_t *preg = mu_sieve_malloc (mu_sieve_machine, sizeof (*preg));
rc = regcomp (preg, (char*)item, rd->flags);
if (rc)
......@@ -169,11 +171,11 @@ _regex_compile (void *item, void *data)
if (errbuf)
{
regerror (rc, preg, errbuf, size);
sieve_compile_error (&mu_sieve_locus, _("Regex error: %s"), errbuf);
mu_sv_compile_error (&mu_sieve_locus, _("Regex error: %s"), errbuf);
free (errbuf);
}
else
sieve_compile_error (&mu_sieve_locus, _("Regex error"));
mu_sv_compile_error (&mu_sieve_locus, _("Regex error"));
return rc;
}
......@@ -204,7 +206,7 @@ comp_false (const char *pattern, const char *text)
}
int
mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
mu_sv_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
{
mu_iterator_t itr;
mu_sieve_runtime_tag_t *match = NULL;
......@@ -234,7 +236,7 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
{
if (match)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("match type specified twice in call to `%s'"),
name);
err = 1;
......@@ -270,7 +272,7 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
if (comp && strcmp (comp->arg->v.string, "i;ascii-numeric"))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
/* TRANSLATORS: Do not translate ':count'.
It is the name of a Sieve tag */
_("comparator %s is incompatible with "
......@@ -289,7 +291,7 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
mu_list_count (val->v.list, &count);
if (count > 1)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("second argument must be a list of one element"));
return 1;
}
......@@ -297,7 +299,7 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
count = strtoul (str, &str, 10);
if (*str)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("second argument cannot be converted to number"));
return 1;
}
......@@ -307,7 +309,7 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
if (mu_sieve_str_to_relcmp (str, NULL, NULL))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("invalid relational match `%s' in call to `%s'"),
str, name);
return 1;
......@@ -317,17 +319,18 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
if (!compfun)
{
compname = comp ? comp->arg->v.string : "i;ascii-casemap";
compfun = mu_sieve_comparator_lookup (sieve_machine, compname, matchtype);
compfun = mu_sieve_comparator_lookup (mu_sieve_machine, compname,
matchtype);
if (!compfun)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("comparator `%s' is incompatible with match type `%s' in call to `%s'"),
compname, match ? match->tag : "is", name);
return 1;
}
}
tmp = mu_sieve_malloc (sieve_machine, sizeof (*tmp));
tmp = mu_sieve_malloc (mu_sieve_machine, sizeof (*tmp));
tmp->tag = TAG_COMPFUN;
tmp->arg = mu_sieve_value_create (SVT_POINTER, compfun);
mu_list_append (tags, tmp);
......@@ -351,7 +354,8 @@ mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args)
rc = mu_sieve_vlist_do (val, _regex_compile, &rd);
mu_sieve_machine_add_destructor (sieve_machine, _free_reglist, rd.list);
mu_sieve_machine_add_destructor (mu_sieve_machine, _free_reglist,
rd.list);
if (rc)
return rc;
......@@ -489,7 +493,7 @@ i_ascii_numeric_eq (const char *pattern, const char *text)
}
void
sieve_register_standard_comparators (mu_sieve_machine_t mach)
mu_sv_register_standard_comparators (mu_sieve_machine_t mach)
{
mu_sieve_register_comparator (mach,
"i;octet",
......
......@@ -63,7 +63,7 @@ mu_sieve_module_init (void *data)
if (p->clearflags & MU_SIEVE_CLEAR_LIBRARY_PATH)
mu_list_destroy (&mu_sieve_library_path);
mu_list_do (p->library_path, _path_append, &mu_sieve_library_path);
sieve_load_add_path (mu_sieve_library_path);
mu_sv_load_add_path (mu_sieve_library_path);
mu_list_destroy (&p->library_path);
mu_list_destroy (&p->include_path);
return 0;
......
......@@ -135,7 +135,7 @@ _add_load_dir (void *item, void *unused)
}
int
sieve_load_add_path (mu_list_t path)
mu_sv_load_add_path (mu_list_t path)
{
if (sieve_init_load_path ())
return 1;
......@@ -143,11 +143,12 @@ sieve_load_add_path (mu_list_t path)
}
int
sieve_load_add_dir (mu_sieve_machine_t mach, const char *name)
mu_sv_load_add_dir (mu_sieve_machine_t mach, const char *name)
{
if (sieve_init_load_path ())
return 1;
mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit, NULL);
mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit,
NULL);
return lt_dladdsearchdir (name);
}
......@@ -161,13 +162,13 @@ mu_sieve_load_ext (mu_sieve_machine_t mach, const char *name)
}
int
sieve_load_add_path (mu_list_t path)
mu_sv_load_add_path (mu_list_t path)
{
return 1;
}
int
sieve_load_add_dir (mu_sieve_machine_t mach, const char *name)
mu_sv_load_add_dir (mu_sieve_machine_t mach, const char *name)
{
return 1;
}
......
......@@ -26,69 +26,70 @@
#include <sieve.h>
int
sieve_code (sieve_op_t *op)
mu_sv_code (sieve_op_t *op)
{
if (sieve_machine->pc >= sieve_machine->progsize)
if (mu_sieve_machine->pc >= mu_sieve_machine->progsize)
{
size_t newsize = sieve_machine->progsize + SIEVE_CODE_INCR;
sieve_op_t *newprog = mu_sieve_mrealloc (sieve_machine, sieve_machine->prog,
newsize *
sizeof sieve_machine->prog[0]);
size_t newsize = mu_sieve_machine->progsize + SIEVE_CODE_INCR;
sieve_op_t *newprog = mu_sieve_mrealloc (mu_sieve_machine,
mu_sieve_machine->prog,
newsize *
sizeof mu_sieve_machine->prog[0]);
if (!newprog)
{
sieve_compile_error (&mu_sieve_locus, _("out of memory!"));
mu_sv_compile_error (&mu_sieve_locus, _("out of memory!"));
return 1;
}
sieve_machine->prog = newprog;
sieve_machine->progsize = newsize;
mu_sieve_machine->prog = newprog;
mu_sieve_machine->progsize = newsize;
}
sieve_machine->prog[sieve_machine->pc++] = *op;
mu_sieve_machine->prog[mu_sieve_machine->pc++] = *op;
return 0;
}
int
sieve_code_instr (sieve_instr_t instr)
mu_sv_code_instr (sieve_instr_t instr)
{
sieve_op_t op;
op.instr = instr;
return sieve_code (&op);
return mu_sv_code (&op);
}
int
sieve_code_handler (mu_sieve_handler_t handler)
mu_sv_code_handler (mu_sieve_handler_t handler)
{
sieve_op_t op;
op.handler = handler;
return sieve_code (&op);
return mu_sv_code (&op);
}
int
sieve_code_list (mu_list_t list)
mu_sv_code_list (mu_list_t list)
{
sieve_op_t op;
op.list = list;
return sieve_code (&op);
return mu_sv_code (&op);
}
int
sieve_code_number (long num)
mu_sv_code_number (long num)
{
sieve_op_t op;
op.number = num;
return sieve_code (&op);
return mu_sv_code (&op);
}
int
sieve_code_string (const char *string)
mu_sv_code_string (const char *string)
{
sieve_op_t op;
op.string = string;
return sieve_code (&op);
return mu_sv_code (&op);
}
mu_sieve_tag_def_t *
......@@ -133,7 +134,7 @@ _run_checker (void *item, void *data)
}
int
sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
mu_sv_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
{
mu_iterator_t itr;
mu_list_t arg_list = NULL;
......@@ -143,7 +144,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
int rc, err = 0;
static mu_sieve_data_type empty[] = { SVT_VOID };
if (sieve_code_handler (reg->handler))
if (mu_sv_code_handler (reg->handler))
return 1;
exp_arg = reg->req_args ? reg->req_args : empty;
......@@ -154,7 +155,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
if (rc)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot create iterator: %s"),
mu_strerror (rc));
return 1;
......@@ -173,7 +174,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
mu_sieve_tag_def_t *tag = find_tag (reg->tags, val->v.string, &cf);
if (!tag)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("invalid tag name `%s' for `%s'"),
val->v.string, reg->name);
err = 1;
......@@ -182,7 +183,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
if (!tag_list && (rc = mu_list_create (&tag_list)))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot create tag list: %s"),
mu_strerror (rc));
err = 1;
......@@ -195,7 +196,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
mu_iterator_next (itr);
if (mu_iterator_is_done (itr))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("required argument for tag %s is missing"),
tag->name);
err = 1;
......@@ -206,7 +207,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
else
tagrec.arg = NULL;
tagptr = mu_sieve_malloc (sieve_machine, sizeof (*tagptr));
tagptr = mu_sieve_malloc (mu_sieve_machine, sizeof (*tagptr));
*tagptr = tagrec;
mu_list_append (tag_list, tagptr);
......@@ -214,7 +215,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
{
if (!chk_list && (rc = mu_list_create (&chk_list)))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot create check list: %s"),
mu_strerror (rc));
err = 1;
......@@ -226,7 +227,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
}
else if (*exp_arg == SVT_VOID)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("too many arguments in call to `%s'"),
reg->name);
err = 1;
......@@ -242,16 +243,16 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
mu_list_create (&list);
mu_list_append (list, val->v.string);
mu_sieve_mfree (sieve_machine, val);
mu_sieve_mfree (mu_sieve_machine, val);
val = mu_sieve_value_create (SVT_STRING_LIST, list);
}
else
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("type mismatch in argument %d to `%s'"),
exp_arg - reg->req_args + 1,
reg->name);
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("expected %s but passed %s"),
mu_sieve_type_str (*exp_arg),
mu_sieve_type_str (val->type));
......@@ -262,7 +263,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
if (!arg_list && (rc = mu_list_create (&arg_list)))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot create arg list: %s"),
mu_strerror (rc));
err = 1;
......@@ -280,7 +281,7 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
{
if (*exp_arg != SVT_VOID)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("too few arguments in call to `%s'"),
reg->name);
err = 1;
......@@ -298,9 +299,9 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
}
if (!err)
err = sieve_code_list (arg_list)
|| sieve_code_list (tag_list)
|| sieve_code_string (reg->name);
err = mu_sv_code_list (arg_list)
|| mu_sv_code_list (tag_list)
|| mu_sv_code_string (reg->name);
if (err)
{
......@@ -313,34 +314,35 @@ sieve_code_command (mu_sieve_register_t *reg, mu_list_t arglist)
}
int
sieve_code_source (const char *name)
mu_sv_code_source (const char *name)
{
char *s;
if (mu_list_locate (sieve_machine->source_list, (void*) name, (void **) &s))
if (mu_list_locate (mu_sieve_machine->source_list,
(void*) name, (void **) &s))
{
s = mu_sieve_mstrdup (sieve_machine, name);
mu_list_append (sieve_machine->source_list, s);
s = mu_sieve_mstrdup (mu_sieve_machine, name);
mu_list_append (mu_sieve_machine->source_list, s);
}
return sieve_code_instr (_mu_sv_instr_source)
|| sieve_code_string (s);
return mu_sv_code_instr (_mu_sv_instr_source)
|| mu_sv_code_string (s);
}
int
sieve_code_line (size_t line)
mu_sv_code_line (size_t line)
{
sieve_op_t op;
op.line = line;
return sieve_code_instr (_mu_sv_instr_line)
|| sieve_code (&op);
return mu_sv_code_instr (_mu_sv_instr_line)
|| mu_sv_code (&op);
}
static int sieve_source_changed;
void
sieve_change_source ()
mu_sv_change_source ()
{
sieve_source_changed = 1;
}
......@@ -351,56 +353,56 @@ sieve_check_source_changed ()
if (sieve_source_changed)
{
sieve_source_changed = 0;
return sieve_code_source (mu_sieve_locus.source_file);
return mu_sv_code_source (mu_sieve_locus.source_file);
}
return 0;
}
int
sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist)
mu_sv_code_action (mu_sieve_register_t *reg, mu_list_t arglist)
{
return sieve_check_source_changed ()
|| sieve_code_line (mu_sieve_locus.source_line)
|| sieve_code_instr (_mu_sv_instr_action)
|| sieve_code_command (reg, arglist);
|| mu_sv_code_line (mu_sieve_locus.source_line)
|| mu_sv_code_instr (_mu_sv_instr_action)
|| mu_sv_code_command (reg, arglist);
}
int
sieve_code_test (mu_sieve_register_t *reg, mu_list_t arglist)
mu_sv_code_test (mu_sieve_register_t *reg, mu_list_t arglist)
{
return sieve_check_source_changed ()
|| sieve_code_line (mu_sieve_locus.source_line)
|| sieve_code_instr (_mu_sv_instr_test)
|| sieve_code_command (reg, arglist);
|| mu_sv_code_line (mu_sieve_locus.source_line)
|| mu_sv_code_instr (_mu_sv_instr_test)
|| mu_sv_code_command (reg, arglist);
}
void
sieve_code_anyof (size_t start)
mu_sv_code_anyof (size_t start)
{
size_t end = sieve_machine->pc;
while (sieve_machine->prog[start+1].pc != 0)
size_t end = mu_sieve_machine->pc;
while (mu_sieve_machine->prog[start+1].pc != 0)
{
size_t next = sieve_machine->prog[start+1].pc;
sieve_machine->prog[start].instr = _mu_sv_instr_brnz;
sieve_machine->prog[start+1].pc = end - start - 2;
size_t next = mu_sieve_machine->prog[start+1].pc;
mu_sieve_machine->prog[start].instr = _mu_sv_instr_brnz;
mu_sieve_machine->prog[start+1].pc = end - start - 2;
start = next;
}
sieve_machine->prog[start].instr = _mu_sv_instr_nop;
sieve_machine->prog[start+1].instr = _mu_sv_instr_nop;
mu_sieve_machine->prog[start].instr = _mu_sv_instr_nop;
mu_sieve_machine->prog[start+1].instr = _mu_sv_instr_nop;
}
void
sieve_code_allof (size_t start)
mu_sv_code_allof (size_t start)
{
size_t end = sieve_machine->pc;
size_t end = mu_sieve_machine->pc;
while (sieve_machine->prog[start+1].pc != 0)
while (mu_sieve_machine->prog[start+1].pc != 0)
{
size_t next = sieve_machine->prog[start+1].pc;
sieve_machine->prog[start+1].pc = end - start - 2;
size_t next = mu_sieve_machine->prog[start+1].pc;
mu_sieve_machine->prog[start+1].pc = end - start - 2;
start = next;
}
sieve_machine->prog[start].instr = _mu_sv_instr_nop;
sieve_machine->prog[start+1].instr = _mu_sv_instr_nop;
mu_sieve_machine->prog[start].instr = _mu_sv_instr_nop;
mu_sieve_machine->prog[start+1].instr = _mu_sv_instr_nop;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2004,
2005, 2007 Free Software Foundation, Inc.
2005, 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......
......@@ -36,7 +36,7 @@ mu_sieve_require (mu_list_t slist)
status = mu_list_get_iterator (slist, &itr);
if (status)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot create iterator: %s"),
mu_strerror (status));
return;
......@@ -74,9 +74,9 @@ mu_sieve_require (mu_list_t slist)
text = _("required action");
}
if (reqfn (sieve_machine, name))
if (reqfn (mu_sieve_machine, name))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("source for the %s %s is not available"),
text,
name);
......
......@@ -76,9 +76,9 @@ instr_run (mu_sieve_machine_t mach)
if (INSTR_DEBUG (mach))
{
mu_sieve_debug (mach, "Arguments: ");
sieve_print_value_list (arg_list, mach->debug_printer, mach->data);
mu_sv_print_value_list (arg_list, mach->debug_printer, mach->data);
mu_sieve_debug (mach, "\nTags:");
sieve_print_tag_list (tag_list, mach->debug_printer, mach->data);
mu_sv_print_tag_list (tag_list, mach->debug_printer, mach->data);
mu_sieve_debug (mach, "\n");
}
......
......@@ -37,7 +37,7 @@ typedef union {
size_t line;
} sieve_op_t;
struct sieve_machine {
struct mu_sieve_machine {
/* Static data */
mu_sieve_locus_t locus; /* Approximate location in the code */
......@@ -81,51 +81,42 @@ struct sieve_machine {
};
extern mu_sieve_locus_t mu_sieve_locus;
extern mu_sieve_machine_t sieve_machine;
extern int sieve_error_count;
extern mu_sieve_machine_t mu_sieve_machine;
extern int mu_sieve_error_count;
#define TAG_COMPFUN "__compfun__"
#define TAG_RELFUN "__relfun__"
void sieve_compile_error (mu_sieve_locus_t *locus,
void mu_sv_compile_error (mu_sieve_locus_t *locus,
const char *fmt, ...) MU_PRINTFLIKE(2,3);
void sieve_debug_internal (mu_sieve_printf_t printer, void *data,
const char *fmt, ...) MU_PRINTFLIKE(3,4);
void sieve_print_value (mu_sieve_value_t *val, mu_sieve_printf_t printer,
void *data);
void sieve_print_value_list (mu_list_t list, mu_sieve_printf_t printer,
void mu_sv_print_value_list (mu_list_t list, mu_sieve_printf_t printer,
void *data);
void sieve_print_tag_list (mu_list_t list, mu_sieve_printf_t printer,
void mu_sv_print_tag_list (mu_list_t list, mu_sieve_printf_t printer,
void *data);
int _sieve_default_error_printer (void *data, const char *fmt, va_list ap);
int _sieve_default_parse_error (void *unused,
const char *filename, int lineno,
const char *fmt, va_list ap);
int sieve_lex_begin (const char *name);
int sieve_lex_begin_string (const char *buf, int bufsize,
int mu_sv_lex_begin (const char *name);
int mu_sv_lex_begin_string (const char *buf, int bufsize,
const char *fname, int line);
void sieve_lex_finish (void);
void mu_sv_lex_finish (void);
int mu_sieve_yyerror (char *s);
int mu_sieve_yylex ();
void sieve_register_standard_actions (mu_sieve_machine_t mach);
void sieve_register_standard_tests (mu_sieve_machine_t mach);
void sieve_register_standard_comparators (mu_sieve_machine_t mach);
int sieve_code (sieve_op_t *op);
int sieve_code_instr (sieve_instr_t instr);
int sieve_code_handler (mu_sieve_handler_t handler);
int sieve_code_list (mu_list_t list);
int sieve_code_number (long num);
int sieve_code_test (mu_sieve_register_t *reg, mu_list_t arglist);
int sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist);
void sieve_code_anyof (size_t start);
void sieve_code_allof (size_t start);
int sieve_code_source (const char *name);
int sieve_code_line (size_t line);
void sieve_change_source (void);
void mu_sv_register_standard_actions (mu_sieve_machine_t mach);
void mu_sv_register_standard_tests (mu_sieve_machine_t mach);
void mu_sv_register_standard_comparators (mu_sieve_machine_t mach);
int mu_sv_code (sieve_op_t *op);
int mu_sv_code_instr (sieve_instr_t instr);
int mu_sv_code_handler (mu_sieve_handler_t handler);
int mu_sv_code_list (mu_list_t list);
int mu_sv_code_number (long num);
int mu_sv_code_test (mu_sieve_register_t *reg, mu_list_t arglist);
int mu_sv_code_action (mu_sieve_register_t *reg, mu_list_t arglist);
void mu_sv_code_anyof (size_t start);
void mu_sv_code_allof (size_t start);
int mu_sv_code_source (const char *name);
int mu_sv_code_line (size_t line);
void mu_sv_change_source (void);
void _mu_sv_instr_action (mu_sieve_machine_t mach);
void _mu_sv_instr_test (mu_sieve_machine_t mach);
......@@ -139,10 +130,8 @@ void _mu_sv_instr_nop (mu_sieve_machine_t mach);
void _mu_sv_instr_source (mu_sieve_machine_t mach);
void _mu_sv_instr_line (mu_sieve_machine_t mach);
int sieve_mark_deleted (mu_message_t msg, int deleted);
int mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args);
int sieve_relational_checker (const char *name, mu_list_t tags, mu_list_t args);
int mu_sv_match_part_checker (const char *name, mu_list_t tags,
mu_list_t args);
int sieve_load_add_path (mu_list_t path);
int sieve_load_add_dir (mu_sieve_machine_t mach, const char *name);
int mu_sv_load_add_path (mu_list_t path);
int mu_sv_load_add_dir (mu_sieve_machine_t mach, const char *name);
......
......@@ -124,7 +124,7 @@ push_source (const char *name)
if (stat (name, &st))
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot stat `%s': %s"), name, strerror (errno));
return 1;
}
......@@ -138,11 +138,11 @@ push_source (const char *name)
{
yyerror (_("recursive inclusion"));
if (ctx->prev)
sieve_compile_error (&ctx->prev->locus,
mu_sv_compile_error (&ctx->prev->locus,
_("`%s' already included here"),
name);
else
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("`%s' already included at top level"),
name);
return 1;
......@@ -151,7 +151,7 @@ push_source (const char *name)
fp = fopen (name, "r");
if (!fp)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("cannot open `%s': %s"), name, strerror (errno));
return 1;
}
......@@ -177,7 +177,7 @@ push_source (const char *name)
mu_sieve_locus.source_line = 1;
sieve_source_inode = st.st_ino;
sieve_change_source ();
mu_sv_change_source ();
return 0;
}
......@@ -207,7 +207,7 @@ pop_source ()
free (context_stack);
context_stack = ctx;
sieve_change_source ();
mu_sv_change_source ();
return 0;
}
......@@ -410,19 +410,19 @@ sieve_searchpath ()
name = get_file_name (p, endp, NULL);
if (name)
{
sieve_load_add_dir (sieve_machine, name);
mu_sv_load_add_dir (mu_sieve_machine, name);
free (name);
}
}
int
sieve_lex_begin (const char *name)
mu_sv_lex_begin (const char *name)
{
return push_source (name);
}
int
sieve_lex_begin_string (const char *buf, int bufsize,
mu_sv_lex_begin_string (const char *buf, int bufsize,
const char *fname, int line)
{
if (!fname)
......@@ -435,12 +435,12 @@ sieve_lex_begin_string (const char *buf, int bufsize,
mu_sieve_locus.source_line = line;
sieve_source_inode = 0;
sieve_change_source ();
mu_sv_change_source ();
return 0;
}
void
sieve_lex_finish ()
mu_sv_lex_finish ()
{
while (pop_source () == 0)
;
......@@ -473,7 +473,7 @@ number ()
static int
string ()
{
yylval.string = mu_sieve_malloc (sieve_machine, yyleng - 1);
yylval.string = mu_sieve_malloc (mu_sieve_machine, yyleng - 1);
memcpy (yylval.string, yytext + 1, yyleng - 2);
yylval.string[yyleng - 2] = 0;
return STRING;
......@@ -532,7 +532,7 @@ line_begin ()
status = mu_list_create (&string_list);
if (status)
{
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
"mu_list_create: %s", mu_strerror (status));
exit (1);
}
......@@ -597,9 +597,10 @@ line_finish ()
}
/* Copy the contents */
yylval.string = mu_sieve_malloc (sieve_machine, length + 1);
yylval.string = mu_sieve_malloc (mu_sieve_machine, length + 1);
p = yylval.string;
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
mu_iterator_next (itr))
{
char *s;
mu_iterator_current (itr, (void **)&s);
......
......@@ -26,10 +26,13 @@
#include <assert.h>
#include <sieve.h>
mu_sieve_machine_t sieve_machine;
int sieve_error_count;
mu_sieve_machine_t mu_sieve_machine;
int mu_sieve_error_count;
static void branch_fixup (size_t start, size_t end);
static int _sieve_default_error_printer (void *, const char *, va_list);
static int _sieve_default_parse_error (void *, const char *, int,
const char *, va_list);
%}
%union {
......@@ -83,32 +86,32 @@ statement : REQUIRE stringorlist ';'
/* All the items in $2 are registered in memory_pool,
so we don't free them */
mu_list_destroy (&$2);
$$ = sieve_machine->pc;
$$ = mu_sieve_machine->pc;
}
| action ';'
/* 1 2 3 4 */
| if cond block else_part
{
sieve_machine->prog[$2].pc = $4.begin - $2 - 1;
mu_sieve_machine->prog[$2].pc = $4.begin - $2 - 1;
if ($4.branch)
branch_fixup ($4.branch, sieve_machine->pc);
branch_fixup ($4.branch, mu_sieve_machine->pc);
}
;
if : IF
{
$$ = sieve_machine->pc;
$$ = mu_sieve_machine->pc;
}
;
else_part : maybe_elsif
{
if ($1.begin)
sieve_machine->prog[$1.cond].pc =
sieve_machine->pc - $1.cond - 1;
mu_sieve_machine->prog[$1.cond].pc =
mu_sieve_machine->pc - $1.cond - 1;
else
{
$$.begin = sieve_machine->pc;
$$.begin = mu_sieve_machine->pc;
$$.branch = 0;
}
}
......@@ -116,8 +119,8 @@ else_part : maybe_elsif
{
if ($1.begin)
{
sieve_machine->prog[$1.cond].pc = $3 - $1.cond - 1;
sieve_machine->prog[$2].pc = $1.branch;
mu_sieve_machine->prog[$1.cond].pc = $3 - $1.cond - 1;
mu_sieve_machine->prog[$2].pc = $1.branch;
$$.begin = $1.begin;
$$.branch = $2;
}
......@@ -144,8 +147,8 @@ elsif_branch : elsif begin cond block
}
| elsif_branch elsif begin cond block
{
sieve_machine->prog[$1.cond].pc = $3 - $1.cond - 1;
sieve_machine->prog[$2].pc = $1.branch;
mu_sieve_machine->prog[$1.cond].pc = $3 - $1.cond - 1;
mu_sieve_machine->prog[$2].pc = $1.branch;
$$.begin = $1.begin;
$$.branch = $2;
$$.cond = $4;
......@@ -154,17 +157,17 @@ elsif_branch : elsif begin cond block
elsif : ELSIF
{
sieve_code_instr (_mu_sv_instr_branch);
$$ = sieve_machine->pc;
sieve_code_number (0);
mu_sv_code_instr (_mu_sv_instr_branch);
$$ = mu_sieve_machine->pc;
mu_sv_code_number (0);
}
;
else : ELSE
{
sieve_code_instr (_mu_sv_instr_branch);
$$ = sieve_machine->pc;
sieve_code_number (0);
mu_sv_code_instr (_mu_sv_instr_branch);
$$ = mu_sieve_machine->pc;
mu_sv_code_number (0);
}
;
......@@ -176,17 +179,17 @@ block : '{' list '}'
testlist : cond_expr
{
$$.start = $$.end = sieve_machine->pc;
if (sieve_code_instr (_mu_sv_instr_brz)
|| sieve_code_number (0))
$$.start = $$.end = mu_sieve_machine->pc;
if (mu_sv_code_instr (_mu_sv_instr_brz)
|| mu_sv_code_number (0))
YYERROR;
}
| testlist ',' cond_expr
{
sieve_machine->prog[$1.end+1].pc = sieve_machine->pc;
$1.end = sieve_machine->pc;
if (sieve_code_instr (_mu_sv_instr_brz)
|| sieve_code_number (0))
mu_sieve_machine->prog[$1.end+1].pc = mu_sieve_machine->pc;
$1.end = mu_sieve_machine->pc;
if (mu_sv_code_instr (_mu_sv_instr_brz)
|| mu_sv_code_number (0))
YYERROR;
$$ = $1;
}
......@@ -194,9 +197,9 @@ testlist : cond_expr
cond : cond_expr
{
sieve_code_instr (_mu_sv_instr_brz);
$$ = sieve_machine->pc;
sieve_code_number (0);
mu_sv_code_instr (_mu_sv_instr_brz);
$$ = mu_sieve_machine->pc;
mu_sv_code_number (0);
}
;
......@@ -204,40 +207,40 @@ cond_expr : test
{ /* to placate bison */ }
| ANYOF '(' testlist ')'
{
sieve_code_anyof ($3.start);
mu_sv_code_anyof ($3.start);
}
| ALLOF '(' testlist ')'
{
sieve_code_allof ($3.start);
mu_sv_code_allof ($3.start);
}
| NOT cond_expr
{
if (sieve_code_instr (_mu_sv_instr_not))
if (mu_sv_code_instr (_mu_sv_instr_not))
YYERROR;
}
;
begin : /* empty */
{
$$ = sieve_machine->pc;
$$ = mu_sieve_machine->pc;
}
;
test : command
{
mu_sieve_register_t *reg = mu_sieve_test_lookup (sieve_machine,
$1.ident);
$$ = sieve_machine->pc;
mu_sieve_register_t *reg =
mu_sieve_test_lookup (mu_sieve_machine, $1.ident);
$$ = mu_sieve_machine->pc;
if (!reg)
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("unknown test: %s"),
$1.ident);
else if (!reg->required)
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("test `%s' has not been required"),
$1.ident);
else if (sieve_code_test (reg, $1.args))
else if (mu_sv_code_test (reg, $1.args))
YYERROR;
}
;
......@@ -251,19 +254,19 @@ command : IDENT maybe_arglist
action : command
{
mu_sieve_register_t *reg = mu_sieve_action_lookup (sieve_machine,
$1.ident);
mu_sieve_register_t *reg =
mu_sieve_action_lookup (mu_sieve_machine, $1.ident);
$$ = sieve_machine->pc;
$$ = mu_sieve_machine->pc;
if (!reg)
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("unknown action: %s"),
$1.ident);
else if (!reg->required)
sieve_compile_error (&mu_sieve_locus,
mu_sv_compile_error (&mu_sieve_locus,
_("action `%s' has not been required"),
$1.ident);
else if (sieve_code_action (reg, $1.args))
else if (mu_sv_code_action (reg, $1.args))
YYERROR;
}
;
......@@ -340,7 +343,7 @@ slist : STRING
int
yyerror (char *s)
{
sieve_compile_error (&mu_sieve_locus, "%s", s);
mu_sv_compile_error (&mu_sieve_locus, "%s", s);
return 0;
}
......@@ -587,22 +590,22 @@ string_comp (const void *item, const void *value)
void
mu_sieve_machine_begin (mu_sieve_machine_t mach, const char *file)
{
sieve_machine = mach;
sieve_error_count = 0;
sieve_code_instr (NULL);
mu_sieve_machine = mach;
mu_sieve_error_count = 0;
mu_sv_code_instr (NULL);
mu_list_create (&mach->source_list);
mu_list_set_comparator (mach->source_list, string_comp);
sieve_register_standard_actions (mach);
sieve_register_standard_tests (mach);
sieve_register_standard_comparators (mach);
mu_sv_register_standard_actions (mach);
mu_sv_register_standard_tests (mach);
mu_sv_register_standard_comparators (mach);
}
void
mu_sieve_machine_finish (mu_sieve_machine_t mach)
{
sieve_code_instr (NULL);
mu_sv_code_instr (NULL);
}
int
......@@ -612,12 +615,12 @@ mu_sieve_compile (mu_sieve_machine_t mach, const char *name)
mu_sieve_machine_begin (mach, name);
if (sieve_lex_begin (name) == 0)
if (mu_sv_lex_begin (name) == 0)
{
rc = yyparse ();
if (sieve_error_count)
if (mu_sieve_error_count)
rc = 1;
sieve_lex_finish ();
mu_sv_lex_finish ();
}
else
rc = 1;
......@@ -637,12 +640,12 @@ mu_sieve_compile_buffer (mu_sieve_machine_t mach,
mu_sieve_machine_begin (mach, fname);
if (sieve_lex_begin_string (buf, bufsize, fname, line) == 0)
if (mu_sv_lex_begin_string (buf, bufsize, fname, line) == 0)
{
rc = yyparse ();
if (sieve_error_count)
if (mu_sieve_error_count)
rc = 1;
sieve_lex_finish ();
mu_sv_lex_finish ();
}
else
rc = 1;
......@@ -656,16 +659,38 @@ mu_sieve_compile_buffer (mu_sieve_machine_t mach,
static void
_branch_fixup (size_t start, size_t end)
{
size_t prev = sieve_machine->prog[start].pc;
size_t prev = mu_sieve_machine->prog[start].pc;
if (!prev)
return;
branch_fixup (prev, end);
sieve_machine->prog[prev].pc = end - prev - 1;
mu_sieve_machine->prog[prev].pc = end - prev - 1;
}
void
static void
branch_fixup (size_t start, size_t end)
{
_branch_fixup (start, end);
sieve_machine->prog[start].pc = end - start - 1;
mu_sieve_machine->prog[start].pc = end - start - 1;
}
static int
_sieve_default_error_printer (void *unused, const char *fmt, va_list ap)
{
return mu_verror (fmt, ap);
}
static int
_sieve_default_parse_error (void *unused, const char *filename, int lineno,
const char *fmt, va_list ap)
{
mu_debug_t debug;
mu_diag_get_debug (&debug);
if (filename)
mu_debug_set_locus (debug, filename, lineno);
mu_diag_vprintf (MU_DIAG_ERROR, fmt, ap);
mu_diag_printf (MU_DIAG_ERROR, "\n");
mu_debug_set_locus (debug, NULL, 0);
return 0;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2007 Free Software Foundation, Inc.
2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -407,7 +407,7 @@ static mu_sieve_tag_def_t mime_tags[] = {
{ address_part_tags, NULL }
#define MATCH_PART_GROUP \
{ match_part_tags, mu_sieve_match_part_checker }
{ match_part_tags, mu_sv_match_part_checker }
#define SIZE_GROUP { size_tags, NULL }
......@@ -454,7 +454,7 @@ mu_sieve_tag_group_t header_tag_groups[] = {
};
void
sieve_register_standard_tests (mu_sieve_machine_t mach)
mu_sv_register_standard_tests (mu_sieve_machine_t mach)
{
mu_sieve_register_test (mach, "false", sieve_test_false, NULL, NULL, 1);
mu_sieve_register_test (mach, "true", sieve_test_true, NULL, NULL, 1);
......
......@@ -173,7 +173,7 @@ mu_sieve_value_create (mu_sieve_data_type type, void *data)
break;
default:
sieve_compile_error (&mu_sieve_locus, _("invalid data type"));
mu_sv_compile_error (&mu_sieve_locus, _("invalid data type"));
abort ();
}
return val;
......@@ -188,16 +188,16 @@ mu_sieve_value_get (mu_list_t vlist, size_t index)
}
void
sieve_compile_error (mu_sieve_locus_t *ploc, const char *fmt, ...)
mu_sv_compile_error (mu_sieve_locus_t *ploc, const char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
sieve_error_count++;
sieve_machine->parse_error_printer (sieve_machine->data,
ploc->source_file,
ploc->source_line,
fmt, ap);
mu_sieve_error_count++;
mu_sieve_machine->parse_error_printer (mu_sieve_machine->data,
ploc->source_file,
ploc->source_line,
fmt, ap);
va_end (ap);
}
......@@ -233,8 +233,12 @@ mu_sieve_arg_error (mu_sieve_machine_t mach, int n)
mu_sieve_error (mach, _("cannot retrieve argument %d"), n);
}
void
sieve_debug_internal (mu_sieve_printf_t printer, void *data, const char *fmt, ...)
static void sieve_debug_internal (mu_sieve_printf_t printer, void *data,
const char *fmt, ...) MU_PRINTFLIKE(3,4);
static void
sieve_debug_internal (mu_sieve_printf_t printer, void *data,
const char *fmt, ...)
{
va_list ap;
......@@ -267,28 +271,6 @@ mu_sieve_log_action (mu_sieve_machine_t mach, const char *action,
va_end (ap);
}
int
_sieve_default_error_printer (void *unused, const char *fmt, va_list ap)
{
return mu_verror (fmt, ap);
}
int
_sieve_default_parse_error (void *unused, const char *filename, int lineno,
const char *fmt, va_list ap)
{
mu_debug_t debug;
mu_diag_get_debug (&debug);
if (filename)
mu_debug_set_locus (debug, filename, lineno);
mu_diag_vprintf (MU_DIAG_ERROR, fmt, ap);
mu_diag_printf (MU_DIAG_ERROR, "\n");
mu_debug_set_locus (debug, NULL, 0);
return 0;
}
const char *
mu_sieve_type_str (mu_sieve_data_type type)
{
......@@ -334,6 +316,9 @@ string_printer (char *s, struct debug_data *dbg)
return 0;
}
static void sieve_print_value (mu_sieve_value_t *, mu_sieve_printf_t,
void *);
static int
value_printer (mu_sieve_value_t *val, struct debug_data *dbg)
{
......@@ -342,8 +327,9 @@ value_printer (mu_sieve_value_t *val, struct debug_data *dbg)
return 0;
}
void
sieve_print_value (mu_sieve_value_t *val, mu_sieve_printf_t printer, void *data)
static void
sieve_print_value (mu_sieve_value_t *val, mu_sieve_printf_t printer,
void *data)
{
struct debug_data dbg;
......@@ -381,7 +367,7 @@ sieve_print_value (mu_sieve_value_t *val, mu_sieve_printf_t printer, void *data)
}
void
sieve_print_value_list (mu_list_t list, mu_sieve_printf_t printer, void *data)
mu_sv_print_value_list (mu_list_t list, mu_sieve_printf_t printer, void *data)
{
mu_sieve_value_t val;
......@@ -405,7 +391,7 @@ tag_printer (mu_sieve_runtime_tag_t *val, struct debug_data *dbg)
}
void
sieve_print_tag_list (mu_list_t list, mu_sieve_printf_t printer, void *data)
mu_sv_print_tag_list (mu_list_t list, mu_sieve_printf_t printer, void *data)
{
struct debug_data dbg;
......@@ -444,25 +430,6 @@ mu_sieve_tag_lookup (mu_list_t taglist, char *name, mu_sieve_value_t **arg)
}
int
sieve_mark_deleted (mu_message_t msg, int deleted)
{
mu_attribute_t attr = 0;
int rc;
rc = mu_message_get_attribute (msg, &attr);
if (!rc)
{
if (deleted)
rc = mu_attribute_set_deleted (attr);
else
rc = mu_attribute_unset_deleted (attr);
}
return rc;
}
int
mu_sieve_vlist_do (mu_sieve_value_t *val, mu_list_action_t *ac, void *data)
{
switch (val->type)
......