Commit 6178304b 6178304b1670d7288d8a37b9165bda5cbc44c180 by Sergey Poznyakoff

Normalize global namespace. Part 1

Showing 254 changed files with 1088 additions and 978 deletions
2005-08-26 Sergey Poznyakoff <gray@gnu.org.ua>
Normalize global namespace. All exportable symbols begin with mu_.
Part 1: Symbols defined in header files address.h, argcv.h,
attribute.h, auth.h, body.h, daemon.h, debug.h, envelope.h,
errno.h, error.h, filter.h, folder.h, gsasl.h, guile.h, header.h,
iterator.h, libsieve.h, list.h, locker.h, mailbox.h.
Files affected:
* configure.ac, auth/gsasl.c, auth/radius.c, comsat/action.c,
comsat/cfg.c, comsat/comsat.c, dotlock/dotlock.c, examples/addr.c,
examples/argcv.c, examples/base64.c, examples/iconv.c,
examples/listop.c, examples/mimetest.c, examples/msg-send.c,
examples/mta.c, examples/murun.c, examples/nntpclient.c,
examples/numaddr.c, examples/pop3client.c, examples/sfrom.c,
frm/common.c, frm/frm.c, frm/from.c, guimb/collect.c,
guimb/main.c, guimb/util.c, imap4d/append.c, imap4d/auth_gsasl.c,
imap4d/authenticate.c, imap4d/bye.c, imap4d/capability.c,
imap4d/close.c, imap4d/copy.c, imap4d/expunge.c, imap4d/fetch.c,
imap4d/imap4d.c, imap4d/imap4d.h, imap4d/rename.c,
imap4d/search.c, imap4d/select.c, imap4d/status.c, imap4d/store.c,
imap4d/sync.c, imap4d/util.c, include/mailutils/address.h,
include/mailutils/argcv.h, include/mailutils/attribute.h,
include/mailutils/auth.h, include/mailutils/body.h,
include/mailutils/daemon.h, include/mailutils/envelope.h,
include/mailutils/error.h, include/mailutils/filter.h,
include/mailutils/folder.h, include/mailutils/gsasl.h,
include/mailutils/guile.h, include/mailutils/header.h,
include/mailutils/iterator.h, include/mailutils/libsieve.h,
include/mailutils/list.h, include/mailutils/locker.h,
include/mailutils/mailbox.h, include/mailutils/nntp.h,
include/mailutils/pop3.h, include/mailutils/types.h,
lib/mailcap.c, libmu_scm/mu_address.c, libmu_scm/mu_body.c,
libmu_scm/mu_guimb.c, libmu_scm/mu_logger.c,
libmu_scm/mu_mailbox.c, libmu_scm/mu_message.c,
libmu_scm/mu_mime.c, libmu_scm/mu_scm.c, libmu_scm/mu_util.c,
libsieve/Makefile.am, libsieve/actions.c, libsieve/argp.c,
libsieve/comparator.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,
libsieve/extensions/list.c, libsieve/extensions/spamd.c,
libsieve/extensions/timestamp.c, libsieve/extensions/vacation.c,
m4/longdouble.m4, m4/signed.m4, m4/size_max.m4, m4/wchar_t.m4,
m4/wint_t.m4, m4/xsize.m4, mail/alias.c, mail/copy.c,
mail/decode.c, mail/delete.c, mail/escape.c, mail/exit.c,
mail/file.c, mail/followup.c, mail/from.c, mail/hold.c,
mail/inc.c, mail/mail.c, mail/mailline.c, mail/mbox.c,
mail/msgset.y, mail/next.c, mail/page.c, mail/print.c,
mail/quit.c, mail/reply.c, mail/retain.c, mail/send.c,
mail/shell.c, mail/summary.c, mail/tag.c, mail/touch.c,
mail/undelete.c, mail/util.c, mail/write.c, mail.local/main.c,
mail.local/script.c, mail.remote/mail.remote.c,
mailbox/Makefile.am, mailbox/address.c, mailbox/amd.c,
mailbox/argcv.c, mailbox/attachment.c, mailbox/attribute.c,
mailbox/auth.c, mailbox/body.c, mailbox/daemon.c,
mailbox/envelope.c, mailbox/file_stream.c, mailbox/filter.c,
mailbox/filter_iconv.c, mailbox/filter_rfc822.c,
mailbox/filter_trans.c, mailbox/folder.c, mailbox/header.c,
mailbox/iterator.c, mailbox/list.c, mailbox/locker.c,
mailbox/mailbox.c, mailbox/mailer.c, mailbox/mbx_default.c,
mailbox/message.c, mailbox/mime.c, mailbox/mu_argp.c,
mailbox/mu_auth.c, mailbox/muerror.c, mailbox/mutil.c,
mailbox/observer.c, mailbox/parse822.c, mailbox/registrar.c,
mailbox/rfc2047.c, mailbox/sendmail.c, mailbox/smtp.c,
mailbox/ticket.c, mailbox/wicket.c, mailbox/imap/Makefile.am,
mailbox/imap/folder.c, mailbox/imap/mbox.c, mailbox/include/amd.h,
mailbox/include/folder0.h, mailbox/include/imap0.h,
mailbox/include/list0.h, mailbox/include/mime0.h,
mailbox/maildir/Makefile.am, mailbox/maildir/mbox.c,
mailbox/mbox/Makefile.am, mailbox/mbox/folder.c,
mailbox/mbox/mbox.c, mailbox/mbox/mboxscan.c,
mailbox/mh/Makefile.am, mailbox/mh/folder.c, mailbox/mh/mbox.c,
mailbox/nntp/Makefile.am, mailbox/nntp/folder.c,
mailbox/nntp/mbox.c, mailbox/nntp/nntp_iterator.c,
mailbox/nntp/nntp_list_active.c,
mailbox/nntp/nntp_list_distribpats.c,
mailbox/nntp/nntp_list_distributions.c,
mailbox/nntp/nntp_list_extensions.c,
mailbox/nntp/nntp_list_newsgroups.c,
mailbox/nntp/nntp_list_times.c, mailbox/pop/Makefile.am,
mailbox/pop/folder.c, mailbox/pop/mbox.c, mailbox/pop/pop3_capa.c,
mailbox/pop/pop3_iterator.c, messages/messages.c, mh/ali.c,
mh/anno.c, mh/comp.c, mh/folder.c, mh/forw.c, mh/inc.c, mh/mark.c,
mh/mh_alias.y, mh/mh_argp.c, mh/mh_ctx.c, mh/mh_format.c,
mh/mh_init.c, mh/mh_list.c, mh/mh_msgset.c, mh/mh_sequence.c,
mh/mh_stream.c, mh/mh_whatnow.c, mh/mh_whom.c, mh/mhn.c,
mh/mhpath.c, mh/pick.c, mh/pick.y, mh/refile.c, mh/repl.c,
mh/rmf.c, mh/rmm.c, mh/scan.c, mh/send.c, mh/sortm.c,
mimeview/mimetypes.y, mimeview/mimeview.c, movemail/movemail.c,
pop3d/apop.c, pop3d/dele.c, pop3d/expire.c, pop3d/extra.c,
pop3d/list.c, pop3d/lock.c, pop3d/pop3d.c, pop3d/popauth.c,
pop3d/quit.c, pop3d/retr.c, pop3d/rset.c, pop3d/stat.c,
pop3d/top.c, pop3d/uidl.c, pop3d/user.c, readmsg/msglist.c,
readmsg/readmsg.c, sieve/sieve.c, sql/odbc.c.
2005-08-24 Sergey Poznyakoff <gray@gnu.org.ua>
* scripts/ylwrap: Updated from Radius repository
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005 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 @@
#include <gsasl.h>
#include <lbuf.h>
char *gsasl_cram_md5_pwd = SITE_CRAM_MD5_PWD;
char *mu_gsasl_cram_md5_pwd = SITE_CRAM_MD5_PWD;
#define ARG_CRAM_PASSWD 1
......@@ -53,7 +53,7 @@ _gsasl_argp_parser (int key, char *arg, struct argp_state *state)
switch (key)
{
case ARG_CRAM_PASSWD:
gsasl_cram_md5_pwd = arg;
mu_gsasl_cram_md5_pwd = arg;
break;
default:
......@@ -271,7 +271,7 @@ _gsasl_wait (stream_t stream, int *pflags, struct timeval *tvp)
}
int
gsasl_stream_create (stream_t *stream, stream_t transport,
mu_gsasl_stream_create (stream_t *stream, stream_t transport,
Gsasl_session_ctx *ctx, int flags)
{
struct _gsasl_stream *s;
......
......@@ -120,7 +120,7 @@ parse_pairlist (grad_avp_t **plist, const char *input,
if (!input)
return 1;
if ((rc = argcv_get (input, ",", NULL, &argc, &argv)))
if ((rc = mu_argcv_get (input, ",", NULL, &argc, &argv)))
argp_error (argp_state, _("Cannot parse input `%s': %s"),
input, mu_strerror (rc));
......@@ -163,7 +163,7 @@ parse_pairlist (grad_avp_t **plist, const char *input,
if (state != state_delim && state != state_delim)
argp_error (argp_state, _("malformed radius A/V list"));
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
return 0;
}
......
......@@ -123,7 +123,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
memcpy (namep, start, len);
namep[len] = 0;
if (message_get_header (msg, &hdr) == 0
&& header_aget_value (hdr, namep, &sval) == 0)
&& mu_header_aget_value (hdr, namep, &sval) == 0)
{
len = strlen (sval);
obstack_grow (stk, sval, len);
......@@ -148,7 +148,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
if (lncount == 0)
lncount = maxlines;
if (message_get_body (msg, &body) == 0
&& body_get_stream (body, &stream) == 0)
&& mu_body_get_stream (body, &stream) == 0)
{
size_t nread;
char *buf = malloc (size+1);
......@@ -198,7 +198,7 @@ expand_line (const char *str, message_t msg)
p++;
if (*p)
{
c = argcv_unquote_char (*p);
c = mu_argcv_unquote_char (*p);
obstack_1grow (&stk, c);
}
break;
......@@ -353,12 +353,12 @@ run_user_action (FILE *tty, const char *cr, message_t msg)
str = expand_line (stmt, msg);
if (!str)
continue;
if (argcv_get (str, "", NULL, &argc, &argv)
if (mu_argcv_get (str, "", NULL, &argc, &argv)
|| argc == 0
|| argv[0][0] == '#')
{
free (str);
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
continue;
}
......
/* Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
/* Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Inetutils.
......@@ -160,11 +160,11 @@ read_config (const char *config_file)
if (!*ptr || *ptr == '#')
continue;
argcv_get (ptr, "", NULL, &argc, &argv);
mu_argcv_get (ptr, "", NULL, &argc, &argv);
if (argc < 2)
{
syslog (LOG_ERR, _("%s:%d: too few fields"), config_file, line);
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
continue;
}
......@@ -196,7 +196,7 @@ read_config (const char *config_file)
else
{
syslog (LOG_ERR, _("%s:%d: unknown keyword"), config_file, line);
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
continue;
}
......@@ -217,7 +217,7 @@ read_config (const char *config_file)
tail = cur;
}
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
acl = malloc (sizeof *acl);
if (!acl)
......
......@@ -450,15 +450,15 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
return;
}
if ((status = mailbox_create (&mbox, path)) != 0
|| (status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
if ((status = mu_mailbox_create (&mbox, path)) != 0
|| (status = mu_mailbox_open (mbox, MU_STREAM_READ)) != 0)
{
syslog (LOG_ERR, _("Cannot open mailbox %s: %s"),
path, mu_strerror (status));
return;
}
if ((status = mailbox_get_stream (mbox, &stream)))
if ((status = mu_mailbox_get_stream (mbox, &stream)))
{
syslog (LOG_ERR, _("Cannot get stream for mailbox %s: %s"),
path, mu_strerror (status));
......@@ -481,8 +481,8 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
stream_read (stream, blurb, size, offset, &n);
blurb[size] = 0;
if ((status = mailbox_create (&tmp, "/dev/null")) != 0
|| (status = mailbox_open (tmp, MU_STREAM_READ)) != 0)
if ((status = mu_mailbox_create (&tmp, "/dev/null")) != 0
|| (status = mu_mailbox_open (tmp, MU_STREAM_READ)) != 0)
{
syslog (LOG_ERR, _("Cannot create temporary mailbox: %s"),
mu_strerror (status));
......@@ -497,9 +497,9 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
}
stream_write (stream, blurb, size, 0, &count);
mailbox_set_stream (tmp, stream);
mailbox_messages_count (tmp, &count);
mailbox_get_message (tmp, 1, &msg);
mu_mailbox_set_stream (tmp, stream);
mu_mailbox_messages_count (tmp, &count);
mu_mailbox_get_message (tmp, 1, &msg);
run_user_action (fp, cr, msg);
fclose (fp);
......
......@@ -26,6 +26,14 @@ gl_USE_SYSTEM_EXTENSIONS
AC_PREREQ(2.59)
dnl Library versioning
VI_CURRENT=0
VI_REVISION=0
VI_AGE=0
AC_SUBST(VI_CURRENT)
AC_SUBST(VI_REVISION)
AC_SUBST(VI_AGE)
dnl Check for programs
AC_PROG_CC
AC_PROG_INSTALL
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -143,32 +143,32 @@ main (int argc, char *argv[])
argp_err_exit_status = MU_DL_EX_ERROR;
argp_parse (&argp, argc, argv, 0, NULL, NULL);
if ((err = locker_create (&locker, file, flags)))
if ((err = mu_locker_create (&locker, file, flags)))
{
if (debug)
fprintf (stderr, _("Creating locker failed: %s\n"), mu_strerror (err));
return MU_DL_EX_ERROR;
}
locker_set_flags (locker, flags);
mu_locker_set_flags (locker, flags);
if (force != 0)
locker_set_expire_time (locker, force);
mu_locker_set_expire_time (locker, force);
if (retries != 0)
locker_set_retries (locker, retries);
mu_locker_set_retries (locker, retries);
if (setegid (mailgid) < 0)
return MU_DL_EX_ERROR;
if (unlock)
err = locker_remove_lock (locker);
err = mu_locker_remove_lock (locker);
else
err = locker_lock (locker);
err = mu_locker_lock (locker);
setegid(usergid);
locker_destroy (&locker);
mu_locker_destroy (&locker);
if (debug && err)
fprintf (stderr,
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -36,8 +36,8 @@ parse (const char *str)
address_t address = NULL;
mu_set_user_email_domain ("localhost");
status = address_create (&address, str);
address_get_count (address, &pcount);
status = mu_address_create (&address, str);
mu_address_get_count (address, &pcount);
if (status)
{
......@@ -54,45 +54,45 @@ parse (const char *str)
size_t got = 0;
int isgroup;
address_is_group (address, no, &isgroup);
mu_address_is_group (address, no, &isgroup);
printf ("%lu ", (unsigned long) no);
if (isgroup)
{
address_get_personal (address, no, buf, sizeof (buf), &got);
mu_address_get_personal (address, no, buf, sizeof (buf), &got);
printf ("group <%s>\n", buf);
}
else
{
address_get_email (address, no, buf, sizeof (buf), 0);
mu_address_get_email (address, no, buf, sizeof (buf), 0);
printf ("email <%s>\n", buf);
}
address_get_personal (address, no, buf, sizeof (buf), &got);
mu_address_get_personal (address, no, buf, sizeof (buf), &got);
if (got && !isgroup)
printf (" personal <%s>\n", buf);
address_get_comments (address, no, buf, sizeof (buf), &got);
mu_address_get_comments (address, no, buf, sizeof (buf), &got);
if (got)
printf (" comments <%s>\n", buf);
address_get_local_part (address, no, buf, sizeof (buf), &got);
mu_address_get_local_part (address, no, buf, sizeof (buf), &got);
if (got)
{
printf (" local-part <%s>", buf);
address_get_domain (address, no, buf, sizeof (buf), &got);
mu_address_get_domain (address, no, buf, sizeof (buf), &got);
if (got)
printf (" domain <%s>", buf);
printf ("\n");
}
address_get_route (address, no, buf, sizeof (buf), &got);
mu_address_get_route (address, no, buf, sizeof (buf), &got);
if (got)
printf (" route <%s>\n", buf);
}
address_destroy (&address);
mu_address_destroy (&address);
printf ("\n");
return 0;
......
......@@ -38,13 +38,13 @@ main(int argc, char **argv)
char **v;
char *s;
status = argcv_get (buf, delim, comment, &c, &v);
status = mu_argcv_get (buf, delim, comment, &c, &v);
if (status)
{
fprintf (stderr, "cannot parse: %s\n", mu_strerror (status));
continue;
}
status = argcv_string (c, v, &s);
status = mu_argcv_string (c, v, &s);
if (status)
fprintf (stderr, "cannot create string: %s\n", mu_strerror (status));
else
......@@ -52,7 +52,7 @@ main(int argc, char **argv)
printf ("%d: %s\n", c, s);
free (s);
}
argcv_free (c, v);
mu_argcv_free (c, v);
}
free (buf);
exit (0);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -81,7 +81,7 @@ main (int argc, char * argv [])
else
c = stdio_stream_create (&in, stdin, 0);
assert (c == 0);
assert (filter_create (&flt, in, encoding, mode, MU_STREAM_READ) == 0);
assert (mu_filter_create (&flt, in, encoding, mode, MU_STREAM_READ) == 0);
assert (stream_open (in) == 0);
if (output)
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -43,7 +43,7 @@ main (int argc, char **argv)
rc = stdio_stream_create (&in, stdin, 0);
assert (rc == 0);
assert (stream_open (in) == 0);
assert (filter_iconv_create (&cvt, in, argv[1], argv[2], 0, mu_fallback_none) == 0);
assert (mu_filter_iconv_create (&cvt, in, argv[1], argv[2], 0, mu_fallback_none) == 0);
assert (stream_open (cvt) == 0);
rc = stdio_stream_create (&out, stdout, 0);
......
......@@ -42,20 +42,20 @@ print (list_t list)
iterator_t itr;
int rc;
rc = list_get_iterator (list, &itr);
rc = mu_list_get_iterator (list, &itr);
if (rc)
lperror ("list_get_iterator", rc);
lperror ("mu_list_get_iterator", rc);
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
char *text;
rc = iterator_current (itr, (void**) &text);
rc = mu_iterator_current (itr, (void**) &text);
if (rc)
lperror ("iterator_current", rc);
lperror ("mu_iterator_current", rc);
printf ("%s\n", text);
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
}
void
......@@ -66,7 +66,7 @@ next (iterator_t itr, char *arg)
if (skip == 0)
fprintf (stderr, "next arg?\n");
while (skip--)
iterator_next (itr);
mu_iterator_next (itr);
}
void
......@@ -82,9 +82,9 @@ delete (list_t list, int argc, char **argv)
while (--argc)
{
rc = list_remove (list, strdup (*++argv));
rc = mu_list_remove (list, strdup (*++argv));
if (rc)
fprintf (stderr, "list_remove(%s): %s\n", *argv, mu_strerror (rc));
fprintf (stderr, "mu_list_remove(%s): %s\n", *argv, mu_strerror (rc));
}
}
......@@ -101,9 +101,9 @@ add (list_t list, int argc, char **argv)
while (--argc)
{
rc = list_append (list, strdup (*++argv));
rc = mu_list_append (list, strdup (*++argv));
if (rc)
fprintf (stderr, "list_append: %s\n", mu_strerror (rc));
fprintf (stderr, "mu_list_append: %s\n", mu_strerror (rc));
}
}
......@@ -120,9 +120,9 @@ prep (list_t list, int argc, char **argv)
while (--argc)
{
rc = list_prepend (list, strdup (*++argv));
rc = mu_list_prepend (list, strdup (*++argv));
if (rc)
fprintf (stderr, "list_append: %s\n", mu_strerror (rc));
fprintf (stderr, "mu_list_append: %s\n", mu_strerror (rc));
}
}
......@@ -156,9 +156,9 @@ ins (list_t list, int argc, char **argv)
new_item = argv[2];
}
rc = list_insert (list, item, strdup (new_item), argc == 4);
rc = mu_list_insert (list, item, strdup (new_item), argc == 4);
if (rc)
fprintf (stderr, "list_insert: %s\n", mu_strerror (rc));
fprintf (stderr, "mu_list_insert: %s\n", mu_strerror (rc));
}
......@@ -173,9 +173,9 @@ repl (list_t list, int argc, char **argv)
return;
}
rc = list_replace (list, argv[1], strdup (argv[2]));
rc = mu_list_replace (list, argv[1], strdup (argv[2]));
if (rc)
fprintf (stderr, "list_replace: %s\n", mu_strerror (rc));
fprintf (stderr, "mu_list_replace: %s\n", mu_strerror (rc));
}
#define NITR 4
......@@ -211,23 +211,23 @@ find (iterator_t itr, char *arg)
return;
}
iterator_current (itr, (void**)&text);
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
mu_iterator_current (itr, (void**)&text);
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
char *item;
iterator_current (itr, (void**)&item);
mu_iterator_current (itr, (void**)&item);
if (strcmp (arg, item) == 0)
return;
}
fprintf (stderr, "%s not in list\n", arg);
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
char *item;
iterator_current (itr, (void**)&item);
mu_iterator_current (itr, (void**)&item);
if (strcmp (text, item) == 0)
return;
}
......@@ -260,10 +260,10 @@ shell (list_t list)
for (num = 0; num < NITR; num++)
{
rc = list_get_iterator (list, &itr[num]);
rc = mu_list_get_iterator (list, &itr[num]);
if (rc)
lperror ("list_get_iterator", rc);
iterator_first (itr[num]);
lperror ("mu_list_get_iterator", rc);
mu_iterator_first (itr[num]);
}
num = 0;
......@@ -274,24 +274,24 @@ shell (list_t list)
int argc;
char **argv;
rc = iterator_current (itr[num], (void**) &text);
rc = mu_iterator_current (itr[num], (void**) &text);
if (rc)
lperror ("iterator_current", rc);
lperror ("mu_iterator_current", rc);
printf ("%d:(%s)> ", num, text ? text : "NULL");
if (fgets (buf, sizeof buf, stdin) == NULL)
return;
rc = argcv_get (buf, "", "#", &argc, &argv);
rc = mu_argcv_get (buf, "", "#", &argc, &argv);
if (rc)
lperror ("argcv_get", rc);
lperror ("mu_argcv_get", rc);
if (argc > 0)
{
if (strcmp (argv[0], "next") == 0)
next (itr[num], argv[1]);
else if (strcmp (argv[0], "first") == 0)
iterator_first (itr[num]);
mu_iterator_first (itr[num]);
else if (strcmp (argv[0], "del") == 0)
delete (list, argc, argv);
else if (strcmp (argv[0], "add") == 0)
......@@ -320,9 +320,9 @@ shell (list_t list)
fprintf (stderr, "?\n");
else
{
rc = list_get (list, n, (void**) &text);
rc = mu_list_get (list, n, (void**) &text);
if (rc)
fprintf (stderr, "list_get: %s\n", mu_strerror (rc));
fprintf (stderr, "mu_list_get: %s\n", mu_strerror (rc));
else
printf ("%s\n", text);
}
......@@ -330,7 +330,7 @@ shell (list_t list)
else
fprintf (stderr, "?\n");
}
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
}
}
......@@ -359,16 +359,16 @@ main (int argc, char **argv)
argc -= optind;
argv += optind;
rc = list_create (&list);
rc = mu_list_create (&list);
if (rc)
lperror ("list_create", rc);
list_set_comparator (list, string_comp);
lperror ("mu_list_create", rc);
mu_list_set_comparator (list, string_comp);
while (argc--)
{
rc = list_append (list, *argv++);
rc = mu_list_append (list, *argv++);
if (rc)
lperror ("list_append", rc);
lperror ("mu_list_append", rc);
}
shell (list);
......
......@@ -86,7 +86,7 @@ main (int argc, char **argv)
registrar_record (path_record);
registrar_record (pop_record);
if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0)
if ((ret = mu_mailbox_create_default (&mbox, mailbox_name)) != 0)
{
fprintf (stderr, "could not create %s: %s\n",
mailbox_name, mu_strerror (ret));
......@@ -97,19 +97,19 @@ main (int argc, char **argv)
if (debug)
{
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
mu_mailbox_get_debug (mbox, &debug);
mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
}
/* Open the mailbox for reading only. */
if ((ret = mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
if ((ret = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
{
fprintf (stderr, "mailbox open - %s\n", mu_strerror (ret));
exit (2);
}
/* Iterate through the entire message set. */
mailbox_messages_count (mbox, &count);
mu_mailbox_messages_count (mbox, &count);
for (i = 1; i <= count; ++i)
{
......@@ -118,9 +118,9 @@ main (int argc, char **argv)
size_t nparts;
size_t msize, nlines;
if ((ret = mailbox_get_message (mbox, i, &msg)) != 0)
if ((ret = mu_mailbox_get_message (mbox, i, &msg)) != 0)
{
fprintf (stderr, "mailbox_get_message - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_mailbox_get_message - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_size (msg, &msize)) != 0)
......@@ -138,8 +138,8 @@ main (int argc, char **argv)
fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
mu_header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
mu_header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
NULL);
printf ("Message: %lu\n", (unsigned long) i);
printf ("From: %s\n", from);
......@@ -156,8 +156,8 @@ main (int argc, char **argv)
(unsigned long) msize, (unsigned long) nlines);
message_display_parts (msg, 0);
}
mailbox_close (mbox);
mailbox_destroy (&mbox);
mu_mailbox_close (mbox);
mu_mailbox_destroy (&mbox);
return 0;
}
......@@ -209,13 +209,13 @@ message_display_parts (message_t msg, int indent)
fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type),
mu_header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type),
NULL);
printf ("%*.*sType of part %d = %s\n", indent, indent, "", j, type);
printf ("%*.*sMessage part size - %lu/%lu\n", indent, indent, "",
(unsigned long) msize, (unsigned long) nlines);
encoding[0] = '\0';
header_get_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, encoding,
mu_header_get_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, encoding,
sizeof (encoding), NULL);
ismulti = 0;
if ((type[0]
......@@ -236,8 +236,8 @@ message_display_parts (message_t msg, int indent)
mu_strerror (ret));
exit (2);
}
header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
mu_header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
mu_header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
NULL);
printf ("%*.*sEncapsulated message : %s\t%s\n",
indent, indent, "", from, subject);
......@@ -260,8 +260,8 @@ message_display_parts (message_t msg, int indent)
printf ("%*.*sText Message\n", indent, indent, "");
printf ("%*.*sBegin\n", indent, indent, "");
message_get_body (part, &body);
body_get_stream (body, &str);
filter_create (&str, str, encoding, 0, 0);
mu_body_get_stream (body, &str);
mu_filter_create (&str, str, encoding, 0, 0);
offset = 0;
while (stream_readline (str, buf, sizeof (buf), offset, &nbytes) ==
0 && nbytes)
......
......@@ -101,14 +101,14 @@ main (int argc, char *argv[])
if (optfrom)
{
C (address_create (&from, optfrom));
C (mu_address_create (&from, optfrom));
}
if (argv[optind])
{
char **av = argv + optind;
C (address_createv (&to, (const char **) av, -1));
C (mu_address_createv (&to, (const char **) av, -1));
}
C (stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE));
......
......@@ -262,10 +262,10 @@ add_recipient (const char *name)
address_t addr;
int status;
status = address_create (&addr, name);
status = mu_address_create (&addr, name);
if (status == 0)
status = address_union (&recipients, addr);
address_destroy (&addr);
status = mu_address_union (&recipients, addr);
mu_address_destroy (&addr);
return status;
}
......@@ -277,12 +277,12 @@ address_email_string (address_t addr)
size_t count, i, n, length;
char *value, *p;
address_get_email_count (addr, &count);
mu_address_get_email_count (addr, &count);
length = 0;
for (i = 1; i <= count; i++)
{
char *str;
address_aget_email (recipients, i, &str);
mu_address_aget_email (recipients, i, &str);
length += strlen (str) + 3;
free (str);
}
......@@ -297,7 +297,7 @@ address_email_string (address_t addr)
for (i = 1; i <= count; i++)
{
*p++ = '<';
address_get_email (recipients, i, p, length - (p - value), &n);
mu_address_get_email (recipients, i, p, length - (p - value), &n);
p += n;
*p++ = '>';
if (i + 1 <= count)
......@@ -373,11 +373,11 @@ message_finalize (message_t msg, int warn)
return 1;
}
sprintf (warn, "%s %s", pwd->pw_name, SENDER_WARNING);
header_set_value (header, "X-Authentication-Warning", warn, 0);
mu_header_set_value (header, "X-Authentication-Warning", warn, 0);
free (warn);
}
have_to = header_aget_value (header, MU_HEADER_TO, &value) == 0;
have_to = mu_header_aget_value (header, MU_HEADER_TO, &value) == 0;
if (read_recipients)
{
......@@ -391,7 +391,7 @@ message_finalize (message_t msg, int warn)
free (value);
}
if (header_aget_value (header, MU_HEADER_CC, &value) == 0)
if (mu_header_aget_value (header, MU_HEADER_CC, &value) == 0)
{
if (add_recipient (value))
{
......@@ -401,7 +401,7 @@ message_finalize (message_t msg, int warn)
free (value);
}
if (header_aget_value (header, MU_HEADER_BCC, &value) == 0)
if (mu_header_aget_value (header, MU_HEADER_BCC, &value) == 0)
{
if (add_recipient (value))
{
......@@ -409,7 +409,7 @@ message_finalize (message_t msg, int warn)
return 1;
}
free (value);
header_set_value (header, MU_HEADER_BCC, NULL, 1);
mu_header_set_value (header, MU_HEADER_BCC, NULL, 1);
}
}
......@@ -418,10 +418,10 @@ message_finalize (message_t msg, int warn)
size_t n;
int c;
c = address_to_string (recipients, NULL, 0, &n);
c = mu_address_to_string (recipients, NULL, 0, &n);
if (c)
{
mu_error ("%s: address_to_string failure: %s",
mu_error ("%s: mu_address_to_string failure: %s",
progname, mu_strerror (c));
return 1;
}
......@@ -432,8 +432,8 @@ message_finalize (message_t msg, int warn)
return 1;
}
address_to_string (recipients, value, n + 1, &n);
header_set_value (header, MU_HEADER_TO, value, 1);
mu_address_to_string (recipients, value, n + 1, &n);
mu_header_set_value (header, MU_HEADER_TO, value, 1);
free (value);
}
return 0;
......@@ -457,7 +457,7 @@ mta_stdin (int argc, char **argv)
}
make_tmp (stdin, from_person, &tempfile);
if ((c = mailbox_create_default (&mbox, tempfile)) != 0)
if ((c = mu_mailbox_create_default (&mbox, tempfile)) != 0)
{
mu_error ("%s: can't create mailbox %s: %s",
progname, tempfile, mu_strerror (c));
......@@ -465,7 +465,7 @@ mta_stdin (int argc, char **argv)
return 1;
}
if ((c = mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
if ((c = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
{
mu_error ("%s: can't open mailbox %s: %s",
progname, tempfile, mu_strerror (c));
......@@ -473,7 +473,7 @@ mta_stdin (int argc, char **argv)
return 1;
}
mailbox_get_message (mbox, 1, &msg);
mu_mailbox_get_message (mbox, 1, &msg);
if (message_finalize (msg, 1))
return 1;
......@@ -573,7 +573,7 @@ smtp (int fd)
len --;
buf[len] = 0;
if (argcv_get (buf, "", NULL, &argc, &argv))
if (mu_argcv_get (buf, "", NULL, &argc, &argv))
exit (1);
kw = smtp_kw (argv[0]);
......@@ -581,7 +581,7 @@ smtp (int fd)
{
smtp_reply (221, "Done");
state = STATE_QUIT;
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
continue;
}
......@@ -668,7 +668,7 @@ smtp (int fd)
smtp_reply (354,
"Enter mail, end with \".\" on a line by itself");
make_tmp (in, from_person, &tempfile);
if ((c = mailbox_create_default (&mbox, tempfile)) != 0)
if ((c = mu_mailbox_create_default (&mbox, tempfile)) != 0)
{
mu_error ("%s: can't create mailbox %s: %s",
progname,
......@@ -677,7 +677,7 @@ smtp (int fd)
exit (1);
}
if ((c = mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
if ((c = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
{
mu_error ("%s: can't open mailbox %s: %s",
progname,
......@@ -686,14 +686,14 @@ smtp (int fd)
exit (1);
}
mailbox_get_message (mbox, 1, &msg);
mu_mailbox_get_message (mbox, 1, &msg);
if (message_finalize (msg, 0) == 0)
mta_send (msg);
else
smtp_reply (501, "can't send message"); /*FIXME: code?*/
unlink (tempfile);
address_destroy (&recipients);
mu_address_destroy (&recipients);
from_person = NULL;
smtp_reply (250, "Message accepted for delivery");
......@@ -707,7 +707,7 @@ smtp (int fd)
break;
}
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
}
close (fd);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003 Free Software Foundation, Inc.
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -65,7 +65,7 @@ main (int argc, char *argv[])
exit (1);
}
assert (argcv_string (argc - i, &argv[i], &cmdline) == 0);
assert (mu_argcv_string (argc - i, &argv[i], &cmdline) == 0);
if (read_stdin)
{
stream_t in;
......
......@@ -2,7 +2,7 @@
GNU Mailutils nntp functions. This application interactively allows users
to contact a nntp server.
Copyright (C) 2003, 2004 Free Software Foundation
Copyright (C) 2003, 2004, 2005 Free Software Foundation
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -570,14 +570,14 @@ com_list_extensions (char *arg ARG_UNUSED)
if (status == 0)
{
printf ("List Extension:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *extension = NULL;
iterator_current (iterator, (void **) &extension);
mu_iterator_current (iterator, (void **) &extension);
printf (" %s\n", extension);
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -591,15 +591,15 @@ com_list_active (char *arg)
if (status == 0)
{
printf ("List Active:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
char *group = NULL;
unsigned long high;
unsigned long low;
char stat;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_list_active (buffer, &group, &high, &low, &stat);
if (group)
{
......@@ -608,7 +608,7 @@ com_list_active (char *arg)
}
printf (" high(%ld) low(%ld) status(%c)\n", high, low, stat);
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -622,14 +622,14 @@ com_list_active_times (char *arg)
if (status == 0)
{
printf ("List Active.Times:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
char *group = NULL;
char *creator = NULL;
unsigned long time = 0;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_list_active_times (buffer, &group, &time, &creator);
if (group)
{
......@@ -655,7 +655,7 @@ com_list_active_times (char *arg)
}
printf ("\n");
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -669,13 +669,13 @@ com_list_distributions (char *arg ARG_UNUSED)
if (status == 0)
{
printf ("List Distributions:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
char *key = NULL;
char *value = NULL;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_list_distributions (buffer, &key, &value);
if (key)
{
......@@ -689,7 +689,7 @@ com_list_distributions (char *arg ARG_UNUSED)
}
printf ("\n");
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -703,14 +703,14 @@ com_list_distrib_pats (char *arg ARG_UNUSED)
if (status == 0)
{
printf ("List Distrib Pats:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
unsigned long weight = 0;
char *wildmat = NULL;
char *distrib = NULL;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_list_distrib_pats (buffer, &weight, &wildmat, &distrib);
printf (" weight(%ld)", weight);
if (wildmat)
......@@ -725,7 +725,7 @@ com_list_distrib_pats (char *arg ARG_UNUSED)
}
printf ("\n");
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -739,13 +739,13 @@ com_list_newsgroups (char *arg)
if (status == 0)
{
printf ("Newsgroups:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
char *group = NULL;
char *desc = NULL;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_list_newsgroups (buffer, &group, &desc);
if (group)
{
......@@ -759,7 +759,7 @@ com_list_newsgroups (char *arg)
}
printf ("\n");
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -827,15 +827,15 @@ com_newgroups (char *arg)
if (status == 0)
{
printf ("New Groups:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *buffer = NULL;
char *group = NULL;
unsigned long high = 0;
unsigned long low = 0;
char stat = 0;
iterator_current (iterator, (void **) &buffer);
mu_iterator_current (iterator, (void **) &buffer);
mu_nntp_parse_newgroups (buffer, &group, &high, &low, &stat);
if (group)
{
......@@ -844,7 +844,7 @@ com_newgroups (char *arg)
}
printf (" hig(%lu) low(%lu) status(%c)\n", high, low, stat);
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -884,14 +884,14 @@ com_newnews (char *arg)
if (status == 0)
{
printf ("New News:\n");
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *mid = NULL;
iterator_current (iterator, (void **) &mid);
mu_iterator_current (iterator, (void **) &mid);
printf (" %s\n", mid);
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......@@ -64,12 +64,12 @@ _count_items (void *item, void *data)
address_t addr;
size_t count = 0;
if (header_aget_value (vp->hdr, name, &val))
if (mu_header_aget_value (vp->hdr, name, &val))
return 0;
if (address_create (&addr, val) == 0)
if (mu_address_create (&addr, val) == 0)
{
address_get_count (addr, &count);
address_destroy (&addr);
mu_address_get_count (addr, &count);
mu_address_destroy (&addr);
vp->count += count;
}
free (val);
......@@ -78,48 +78,48 @@ _count_items (void *item, void *data)
/* Handler for the numaddr test */
static int
numaddr_test (sieve_machine_t mach, list_t args, list_t tags)
numaddr_test (mu_sieve_machine_t mach, list_t args, list_t tags)
{
sieve_value_t *h, *v;
mu_sieve_value_t *h, *v;
struct val_ctr vc;
int rc;
if (sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE)
if (mu_sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE)
{
sieve_locus_t locus;
sieve_get_locus (mach, &locus);
sieve_debug (mach, "%s:%lu: NUMADDR\n",
mu_sieve_locus_t locus;
mu_sieve_get_locus (mach, &locus);
mu_sieve_debug (mach, "%s:%lu: NUMADDR\n",
locus.source_file,
(unsigned long) locus.source_line);
}
/* Retrieve required arguments: */
/* First argument: list of header names */
h = sieve_value_get (args, 0);
h = mu_sieve_value_get (args, 0);
if (!h)
{
sieve_error (mach, "numaddr: can't get argument 1");
sieve_abort (mach);
mu_sieve_error (mach, "numaddr: can't get argument 1");
mu_sieve_abort (mach);
}
/* Second argument: Limit on the number of addresses */
v = sieve_value_get (args, 1);
v = mu_sieve_value_get (args, 1);
if (!v)
{
sieve_error (mach, "numaddr: can't get argument 2");
sieve_abort (mach);
mu_sieve_error (mach, "numaddr: can't get argument 2");
mu_sieve_abort (mach);
}
/* Fill in the val_ctr structure */
message_get_header (sieve_get_message (mach), &vc.hdr);
message_get_header (mu_sieve_get_message (mach), &vc.hdr);
vc.count = 0;
vc.limit = v->v.number;
/* Count the addresses */
rc = sieve_vlist_do (h, _count_items, &vc);
rc = mu_sieve_vlist_do (h, _count_items, &vc);
/* Here rc >= 1 iff the counted number of addresses is greater or equal
to vc.limit. If `:under' tag was given we reverse the return value */
if (sieve_tag_lookup (tags, "under", NULL))
if (mu_sieve_tag_lookup (tags, "under", NULL))
rc = !rc;
return rc;
}
......@@ -127,20 +127,20 @@ numaddr_test (sieve_machine_t mach, list_t args, list_t tags)
/* Syntactic definitions for the numaddr test */
/* Required arguments: */
static sieve_data_type numaddr_req_args[] = {
static mu_sieve_data_type numaddr_req_args[] = {
SVT_STRING_LIST,
SVT_NUMBER,
SVT_VOID
};
/* Tagged arguments: */
static sieve_tag_def_t numaddr_tags[] = {
static mu_sieve_tag_def_t numaddr_tags[] = {
{ "over", SVT_VOID },
{ "under", SVT_VOID },
{ NULL }
};
static sieve_tag_group_t numaddr_tag_groups[] = {
static mu_sieve_tag_group_t numaddr_tag_groups[] = {
{ numaddr_tags, NULL },
{ NULL }
};
......@@ -148,8 +148,8 @@ static sieve_tag_group_t numaddr_tag_groups[] = {
/* Initialization function. It is the only function exported from this
module. */
int
SIEVE_EXPORT(numaddr,init) (sieve_machine_t mach)
SIEVE_EXPORT(numaddr,init) (mu_sieve_machine_t mach)
{
return sieve_register_test (mach, "numaddr", numaddr_test,
return mu_sieve_register_test (mach, "numaddr", numaddr_test,
numaddr_req_args, numaddr_tag_groups, 1);
}
......
......@@ -2,7 +2,7 @@
GNU Mailutils pop3 functions. This application interactively allows users
to contact a pop3 server.
Copyright (C) 2003, 2004 Free Software Foundation
Copyright (C) 2003, 2004, 2005 Free Software Foundation
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -406,14 +406,14 @@ com_capa (char *arg ARG_UNUSED)
if (status == 0)
{
for (iterator_first (iterator);
!iterator_is_done (iterator); iterator_next (iterator))
for (mu_iterator_first (iterator);
!mu_iterator_is_done (iterator); mu_iterator_next (iterator))
{
char *capa = NULL;
iterator_current (iterator, (void **) &capa);
mu_iterator_current (iterator, (void **) &capa);
printf ("Capa: %s\n", (capa) ? capa : "");
}
iterator_destroy (&iterator);
mu_iterator_destroy (&iterator);
}
return status;
}
......@@ -428,15 +428,15 @@ com_uidl (char *arg)
status = mu_pop3_uidl_all (pop3, &uidl_iterator);
if (status == 0)
{
for (iterator_first (uidl_iterator);
!iterator_is_done (uidl_iterator);
iterator_next (uidl_iterator))
for (mu_iterator_first (uidl_iterator);
!mu_iterator_is_done (uidl_iterator);
mu_iterator_next (uidl_iterator))
{
char *uidl = NULL;
iterator_current (uidl_iterator, (void **) &uidl);
mu_iterator_current (uidl_iterator, (void **) &uidl);
printf ("UIDL: %s\n", (uidl) ? uidl : "");
}
iterator_destroy (&uidl_iterator);
mu_iterator_destroy (&uidl_iterator);
}
}
else
......@@ -461,15 +461,15 @@ com_list (char *arg)
status = mu_pop3_list_all (pop3, &list_iterator);
if (status == 0)
{
for (iterator_first (list_iterator);
!iterator_is_done (list_iterator);
iterator_next (list_iterator))
for (mu_iterator_first (list_iterator);
!mu_iterator_is_done (list_iterator);
mu_iterator_next (list_iterator))
{
char *list = NULL;
iterator_current (list_iterator, (void **) &list);
mu_iterator_current (list_iterator, (void **) &list);
printf ("LIST: %s\n", (list) ? list : "");
}
iterator_destroy (&list_iterator);
mu_iterator_destroy (&list_iterator);
}
}
else
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2004 Free Software Foundation, Inc.
2004, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -36,38 +36,38 @@ main (int argc, const char **argv)
/* Register the formats. */
mu_register_all_mbox_formats ();
status = mailbox_create_default (&mbox, argv[1]);
status = mu_mailbox_create_default (&mbox, argv[1]);
if (status != 0)
{
mu_error ("mailbox_create: %s", mu_strerror (status));
mu_error ("mu_mailbox_create: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
status = mailbox_open (mbox, MU_STREAM_READ);
status = mu_mailbox_open (mbox, MU_STREAM_READ);
if (status != 0)
{
mu_error ("mailbox_open: %s", mu_strerror (status));
mu_error ("mu_mailbox_open: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
mailbox_messages_count (mbox, &total);
mu_mailbox_messages_count (mbox, &total);
for (msgno = 1; msgno <= total; msgno++)
{
message_t msg;
header_t hdr;
if ((status = mailbox_get_message (mbox, msgno, &msg)) != 0
if ((status = mu_mailbox_get_message (mbox, msgno, &msg)) != 0
|| (status = message_get_header (msg, &hdr)) != 0)
{
mu_error ("Error message: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
if (header_aget_value (hdr, MU_HEADER_FROM, &from))
if (mu_header_aget_value (hdr, MU_HEADER_FROM, &from))
from = strdup ("(NO FROM)");
if (header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
if (mu_header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
subject = strdup ("(NO SUBJECT)");
printf ("%s\t%s\n", from, subject);
......@@ -75,13 +75,13 @@ main (int argc, const char **argv)
free (subject);
}
status = mailbox_close (mbox);
status = mu_mailbox_close (mbox);
if (status != 0)
{
mu_error ("mailbox_close: %s", mu_strerror (status));
mu_error ("mu_mailbox_close: %s", mu_strerror (status));
exit (EXIT_FAILURE);
}
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
return 0;
}
......
......@@ -386,16 +386,16 @@ get_personal (header_t hdr, const char *field, char **personal)
char *hfield;
int status;
status = header_aget_value_unfold (hdr, field, &hfield);
status = mu_header_aget_value_unfold (hdr, field, &hfield);
if (status == 0)
{
address_t address = NULL;
char *s;
address_create (&address, hfield);
mu_address_create (&address, hfield);
address_aget_personal (address, 1, &s);
address_destroy (&address);
mu_address_aget_personal (address, 1, &s);
mu_address_destroy (&address);
if (s == NULL)
s = hfield;
else
......@@ -436,7 +436,7 @@ action (observer_t o, size_t type)
msg_index++;
mailbox_get_message (mbox, msg_index, &msg);
mu_mailbox_get_message (mbox, msg_index, &msg);
message_get_attribute (msg, &attr);
message_get_header (msg, &hdr);
......@@ -463,7 +463,7 @@ action (observer_t o, size_t type)
if (show_field) /* FIXME: This should be also rfc2047_decode. */
{
char *hfield;
status = header_aget_value_unfold (hdr, show_field, &hfield);
status = mu_header_aget_value_unfold (hdr, show_field, &hfield);
if (status == 0)
{
format_field ("%s", hfield);
......@@ -484,7 +484,7 @@ action (observer_t o, size_t type)
else
format_field ("");
status = header_aget_value_unfold (hdr, MU_HEADER_SUBJECT,
status = mu_header_aget_value_unfold (hdr, MU_HEADER_SUBJECT,
&tmp);
if (status == 0)
{
......@@ -510,7 +510,7 @@ frm_abort (mailbox_t *mbox)
{
int status;
if ((status = mailbox_close (*mbox)) != 0)
if ((status = mu_mailbox_close (*mbox)) != 0)
{
url_t url;
......@@ -519,7 +519,7 @@ frm_abort (mailbox_t *mbox)
exit (3);
}
mailbox_destroy (mbox);
mu_mailbox_destroy (mbox);
exit (3);
}
......@@ -538,7 +538,7 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
int status;
url_t url;
status = mailbox_create_default (&mbox, mailbox_name);
status = mu_mailbox_create_default (&mbox, mailbox_name);
if (status != 0)
{
if (mailbox_name)
......@@ -553,13 +553,13 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
if (frm_debug)
{
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
mu_mailbox_get_debug (mbox, &debug);
mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
mailbox_get_url (mbox, &url);
mu_mailbox_get_url (mbox, &url);
status = mailbox_open (mbox, MU_STREAM_READ);
status = mu_mailbox_open (mbox, MU_STREAM_READ);
if (status == ENOENT)
*total = 0;
else if (status != 0)
......@@ -578,10 +578,10 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
observer_create (&observer, mbox);
observer_set_action (observer, action, mbox);
mailbox_get_observable (mbox, &observable);
mu_mailbox_get_observable (mbox, &observable);
observable_attach (observable, MU_EVT_MESSAGE_ADD, observer);
status = mailbox_scan (mbox, 1, total);
status = mu_mailbox_scan (mbox, 1, total);
if (status != 0)
{
mu_error (_("Could not scan mailbox `%s': %s."),
......@@ -592,12 +592,12 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
observable_detach (observable, observer);
observer_destroy (&observer, mbox);
if ((status = mailbox_close (mbox)) != 0)
if ((status = mu_mailbox_close (mbox)) != 0)
{
mu_error (_("Could not close mailbox `%s': %s"),
url_to_string (url), mu_strerror (status));
exit (3);
}
}
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
}
......
......@@ -244,16 +244,16 @@ frm_select (size_t index, message_t msg)
message_get_attribute (msg, &attr);
message_get_header (msg, &hdr);
if (attribute_is_read (attr))
if (mu_attribute_is_read (attr))
counter.read++;
else if (attribute_is_seen (attr))
else if (mu_attribute_is_seen (attr))
counter.unread++;
else if (attribute_is_recent (attr))
else if (mu_attribute_is_recent (attr))
counter.new++;
if (((select_attribute & IS_READ) && (!attribute_is_read (attr)))
|| ((select_attribute & IS_NEW) && (!attribute_is_recent (attr)))
|| ((select_attribute & IS_OLD) && (!attribute_is_seen (attr))))
if (((select_attribute & IS_READ) && (!mu_attribute_is_read (attr)))
|| ((select_attribute & IS_NEW) && (!mu_attribute_is_recent (attr)))
|| ((select_attribute & IS_OLD) && (!mu_attribute_is_seen (attr))))
return 0;
if (select_attribute)
......@@ -265,7 +265,7 @@ frm_select (size_t index, message_t msg)
/* This is a clone of the elm program call "frm". It is a good example on
how to use the observable(callback) of libmailbox. "frm" has to
be very interactive, it is not possible to call mailbox_messages_count()
be very interactive, it is not possible to call mu_mailbox_messages_count()
and wait for the scanning to finish before displaying. As soon as the scan
finds a new message we want to know about it. This is done by registering
an observable type MU_MAILBOX_MSG_ADD. The rest is formatting code. */
......
......@@ -92,7 +92,7 @@ from_select (size_t index, message_t msg)
char *sender;
message_get_header (msg, &hdr);
if (header_aget_value_unfold (hdr, MU_HEADER_FROM, &sender) == 0)
if (mu_header_aget_value_unfold (hdr, MU_HEADER_FROM, &sender) == 0)
{
if (strstr (sender, sender_option))
rc = 1;
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -37,8 +37,8 @@ collect_open_default ()
exit (1);
}
}
if (mailbox_create (&mbox, default_mailbox) != 0
|| mailbox_open (mbox, MU_STREAM_RDWR) != 0)
if (mu_mailbox_create (&mbox, default_mailbox) != 0
|| mu_mailbox_open (mbox, MU_STREAM_RDWR) != 0)
{
util_error (_("Cannot open default mailbox %s: %s"),
default_mailbox, mu_strerror (errno));
......@@ -46,7 +46,7 @@ collect_open_default ()
}
/* Suck in the messages */
mailbox_messages_count (mbox, &nmesg);
mu_mailbox_messages_count (mbox, &nmesg);
}
/* Open temporary file for collecting incoming messages */
......@@ -109,8 +109,8 @@ collect_create_mailbox ()
fclose (temp_file);
if (mailbox_create (&mbox, temp_filename) != 0
|| mailbox_open (mbox, MU_STREAM_READ) != 0)
if (mu_mailbox_create (&mbox, temp_filename) != 0
|| mu_mailbox_open (mbox, MU_STREAM_READ) != 0)
{
util_error (_("Cannot create temp mailbox %s: %s"),
temp_filename, strerror (errno));
......@@ -119,7 +119,7 @@ collect_create_mailbox ()
}
/* Suck in the messages */
mailbox_messages_count (mbox, &nmesg);
mu_mailbox_messages_count (mbox, &nmesg);
if (nmesg == 0)
{
......@@ -137,39 +137,39 @@ collect_output ()
if (!temp_filename)
{
mailbox_expunge (mbox);
mu_mailbox_expunge (mbox);
return 0;
}
if (user_name)
saved_umask = umask (077);
if (mailbox_create_default (&outbox, default_mailbox) != 0
|| mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0)
if (mu_mailbox_create_default (&outbox, default_mailbox) != 0
|| mu_mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0)
{
mailbox_destroy (&outbox);
mu_mailbox_destroy (&outbox);
fprintf (stderr, _("Cannot open output mailbox %s: %s\n"),
default_mailbox, strerror (errno));
return 1;
}
mailbox_messages_count (mbox, &count);
mu_mailbox_messages_count (mbox, &count);
for (i = 1; i <= count; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mailbox_get_message (mbox, i, &msg);
mu_mailbox_get_message (mbox, i, &msg);
message_get_attribute (msg, &attr);
if (!attribute_is_deleted (attr))
if (!mu_attribute_is_deleted (attr))
{
attribute_set_recent (attr);
mailbox_append_message (outbox, msg);
mu_attribute_set_recent (attr);
mu_mailbox_append_message (outbox, msg);
}
}
mailbox_close (outbox);
mailbox_destroy (&outbox);
mu_mailbox_close (outbox);
mu_mailbox_destroy (&outbox);
if (user_name)
umask (saved_umask);
......@@ -181,8 +181,8 @@ collect_output ()
void
collect_drop_mailbox ()
{
mailbox_close (mbox);
mailbox_destroy (&mbox);
mu_mailbox_close (mbox);
mu_mailbox_destroy (&mbox);
if (temp_filename)
{
unlink (temp_filename);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2004 Free Software Foundation, Inc.
2004, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -147,7 +147,7 @@ int
main (int argc, char *argv[])
{
int c = argc;
guimb_param_t param;
mu_guimb_param_t param;
struct guimb_data gd;
/* Native Language Support */
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -38,29 +38,29 @@ util_get_sender (int msgno)
message_t msg = NULL;
char buffer[512];
mailbox_get_message (mbox, msgno, &msg);
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_header (msg, &header);
if (header_get_value (header, MU_HEADER_FROM, buffer, sizeof (buffer), NULL)
|| address_create (&addr, buffer))
if (mu_header_get_value (header, MU_HEADER_FROM, buffer, sizeof (buffer), NULL)
|| mu_address_create (&addr, buffer))
{
envelope_t env = NULL;
message_get_envelope (msg, &env);
if (envelope_sender (env, buffer, sizeof (buffer), NULL)
|| address_create (&addr, buffer))
if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL)
|| mu_address_create (&addr, buffer))
{
util_error (_("Cannot determine sender name (msg %d)"), msgno);
return NULL;
}
}
if (address_get_email (addr, 1, buffer, sizeof (buffer), NULL))
if (mu_address_get_email (addr, 1, buffer, sizeof (buffer), NULL))
{
util_error (_("Cannot determine sender name (msg %d)"), msgno);
address_destroy (&addr);
mu_address_destroy (&addr);
return NULL;
}
address_destroy (&addr);
mu_address_destroy (&addr);
return strdup (buffer);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -41,17 +41,17 @@ imap4d_append (struct imap4d_command *command, char *arg)
if (!mboxname)
return util_finish (command, RESP_NO, "Couldn't open mailbox");
status = mailbox_create_default (&dest_mbox, mboxname);
status = mu_mailbox_create_default (&dest_mbox, mboxname);
if (status == 0)
{
/* It SHOULD NOT automatifcllly create the mailbox. */
status = mailbox_open (dest_mbox, MU_STREAM_RDWR);
status = mu_mailbox_open (dest_mbox, MU_STREAM_RDWR);
if (status == 0)
{
status = imap4d_append0 (dest_mbox, flags, sp);
mailbox_close (dest_mbox);
mu_mailbox_close (dest_mbox);
}
mailbox_destroy (&dest_mbox);
mu_mailbox_destroy (&dest_mbox);
}
free (mboxname);
......@@ -64,7 +64,7 @@ imap4d_append (struct imap4d_command *command, char *arg)
static int
_append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
{
message_t msg = envelope_get_owner (envelope);
message_t msg = mu_envelope_get_owner (envelope);
struct tm **tm = message_get_owner (msg);
strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm);
......@@ -119,19 +119,19 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text)
stream_write (stream, text, strlen (text), len, &len);
message_set_stream (msg, stream, &tm);
envelope_create (&env, msg);
envelope_set_date (env, _append_date, msg);
envelope_set_sender (env, _append_sender, msg);
mu_envelope_create (&env, msg);
mu_envelope_set_date (env, _append_date, msg);
mu_envelope_set_sender (env, _append_sender, msg);
message_set_envelope (msg, env, &tm);
rc = mailbox_append_message (mbox, msg);
rc = mu_mailbox_append_message (mbox, msg);
if (rc == 0 && flags)
{
size_t num = 0;
attribute_t attr = NULL;
mailbox_messages_count (mbox, &num);
mailbox_get_message (mbox, num, &msg);
mu_mailbox_messages_count (mbox, &num);
mu_mailbox_get_message (mbox, num, &msg);
message_get_attribute (msg, &attr);
attribute_set_flags (attr, flags);
mu_attribute_set_flags (attr, flags);
}
message_destroy (&msg, &tm);
......
......@@ -33,7 +33,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags)
{
int rc;
rc = gsasl_stream_create (newstr, transport, sess_ctx, flags);
rc = mu_gsasl_stream_create (newstr, transport, sess_ctx, flags);
if (rc)
{
syslog (LOG_ERR, _("cannot create SASL stream: %s"),
......@@ -269,9 +269,9 @@ cb_retrieve (Gsasl_session_ctx *ctx,
if (username && *username == 0 && authentication_id)
*username = strdup (authentication_id);
if (gsasl_cram_md5_pwd && access (gsasl_cram_md5_pwd, R_OK) == 0)
if (mu_gsasl_cram_md5_pwd && access (mu_gsasl_cram_md5_pwd, R_OK) == 0)
{
int rc = gsasl_md5pwd_get_password (gsasl_cram_md5_pwd,
int rc = gsasl_md5pwd_get_password (mu_gsasl_cram_md5_pwd,
authentication_id,
key, keylen);
if (rc == GSASL_OK)
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -44,16 +44,16 @@ auth_add (char *name, imap4d_auth_handler_fp handler)
p->handler = handler;
if (!imap_auth_list)
{
list_create (&imap_auth_list);
list_set_comparator (imap_auth_list, comp);
mu_list_create (&imap_auth_list);
mu_list_set_comparator (imap_auth_list, comp);
}
list_append (imap_auth_list, (void*)p);
mu_list_append (imap_auth_list, (void*)p);
}
void
auth_remove (char *name)
{
list_remove (imap_auth_list, (void*) name);
mu_list_remove (imap_auth_list, (void*) name);
}
static int
......@@ -90,7 +90,7 @@ _auth_try (void *item, void *data)
void
imap4d_auth_capability ()
{
list_do (imap_auth_list, _auth_capa, NULL);
mu_list_do (imap_auth_list, _auth_capa, NULL);
}
int
......@@ -113,7 +113,7 @@ imap4d_authenticate (struct imap4d_command *command, char *arg)
adata.arg = sp;
adata.username = NULL;
if (list_do (imap_auth_list, _auth_try, &adata) == 0)
if (mu_list_do (imap_auth_list, _auth_try, &adata) == 0)
return util_finish (command, RESP_NO,
"Authentication mechanism not supported");
......
......@@ -31,9 +31,9 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
if (mbox)
{
mailbox_flush (mbox, 0);
mailbox_close (mbox);
mailbox_destroy (&mbox);
mu_mailbox_flush (mbox, 0);
mu_mailbox_close (mbox);
mu_mailbox_destroy (&mbox);
}
switch (reason)
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -31,16 +31,16 @@ imap4d_capability_add (const char *str)
{
if (!capa_list)
{
list_create (&capa_list);
list_set_comparator (capa_list, comp);
mu_list_create (&capa_list);
mu_list_set_comparator (capa_list, comp);
}
list_append (capa_list, (void*)str);
mu_list_append (capa_list, (void*)str);
}
void
imap4d_capability_remove (const char *str)
{
list_remove (capa_list, (void*)str);
mu_list_remove (capa_list, (void*)str);
}
void
......@@ -71,7 +71,7 @@ imap4d_capability (struct imap4d_command *command, char *arg ARG_UNUSED)
{
util_send ("* CAPABILITY");
list_do (capa_list, print_capa, NULL);
mu_list_do (capa_list, print_capa, NULL);
imap4d_auth_capability ();
util_send ("\r\n");
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -30,10 +30,10 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED)
const char *msg = NULL;
int status, flags;
mailbox_get_flags (mbox, &flags);
mu_mailbox_get_flags (mbox, &flags);
if ((flags & MU_STREAM_READ) == 0)
{
status = mailbox_flush (mbox, 1);
status = mu_mailbox_flush (mbox, 1);
if (status)
{
syslog (LOG_ERR,
......@@ -44,13 +44,13 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED)
/* No messages are removed, and no error is given, if the mailbox is
selected by an EXAMINE command or is otherwise selected read-only. */
status = mailbox_close (mbox);
status = mu_mailbox_close (mbox);
if (status)
{
syslog (LOG_ERR, _("closing mailbox failed: %s"), mu_strerror (status));
msg = "closing mailbox failed";
}
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
if (msg)
return util_finish (command, RESP_NO, msg);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -81,11 +81,11 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
/* If the destination mailbox does not exist, a server should return
an error. */
status = mailbox_create_default (&cmbox, mailbox_name);
status = mu_mailbox_create_default (&cmbox, mailbox_name);
if (status == 0)
{
/* It SHOULD NOT automatifcllly create the mailbox. */
status = mailbox_open (cmbox, MU_STREAM_RDWR);
status = mu_mailbox_open (cmbox, MU_STREAM_RDWR);
if (status == 0)
{
size_t i;
......@@ -93,12 +93,12 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
{
message_t msg = NULL;
size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0)
mailbox_append_message (cmbox, msg);
if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0)
mu_mailbox_append_message (cmbox, msg);
}
mailbox_close (cmbox);
mu_mailbox_close (cmbox);
}
mailbox_destroy (&cmbox);
mu_mailbox_destroy (&cmbox);
}
free (set);
free (mailbox_name);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -31,7 +31,7 @@ imap4d_expunge (struct imap4d_command *command, char *arg)
return util_finish (command, RESP_NO, "Too many args");
/* FIXME: check for errors. */
mailbox_expunge (mbox);
mu_mailbox_expunge (mbox);
imap4d_sync ();
return util_finish (command, RESP_OK, "Completed");
......
......@@ -169,7 +169,7 @@ imap4d_fetch0 (char *arg, int isuid, char *resp, size_t resplen)
size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
message_t msg = NULL;
if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0)
if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0)
{
char item[32];
char *items = strdup (sp);
......@@ -356,7 +356,7 @@ fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED)
message_get_envelope (command->msg, &env);
date[0] = '\0';
if (envelope_date (env, date, sizeof (date), NULL) == 0)
if (mu_envelope_date (env, date, sizeof (date), NULL) == 0)
{
char *p = date;
if (mu_parse_ctime_date_time ((const char **) &p, &tm, &tz) == 0)
......@@ -498,10 +498,10 @@ fetch_body (struct fetch_command *command, char **arg)
{
attribute_t attr = NULL;
message_get_attribute (command->msg, &attr);
if (!attribute_is_read (attr))
if (!mu_attribute_is_read (attr))
{
util_send ("FLAGS (\\Seen) ");
attribute_set_read (attr);
mu_attribute_set_read (attr);
}
}
else if (strncasecmp (*arg,".PEEK", 5) == 0)
......@@ -534,7 +534,7 @@ fetch_send_header_value (header_t header, const char *name,
if (space)
util_send (" ");
if (header_aget_value (header, name, &buffer) == 0)
if (mu_header_aget_value (header, name, &buffer) == 0)
{
util_send_qstring (buffer);
free (buffer);
......@@ -553,7 +553,7 @@ fetch_send_header_list (header_t header, const char *name,
if (space)
util_send (" ");
if (header_aget_value (header, name, &buffer) == 0)
if (mu_header_aget_value (header, name, &buffer) == 0)
{
send_parameter_list (buffer);
free (buffer);
......@@ -572,7 +572,7 @@ fetch_send_header_address (header_t header, const char *name,
if (space)
util_send (" ");
if (header_aget_value (header, name, &buffer) == 0)
if (mu_header_aget_value (header, name, &buffer) == 0)
{
fetch_send_address (buffer);
free (buffer);
......@@ -603,7 +603,7 @@ fetch_envelope0 (message_t msg)
fetch_send_header_value (header, "Subject", NULL, 1);
/* From: */
header_aget_value (header, "From", &from);
mu_header_aget_value (header, "From", &from);
util_send (" ");
fetch_send_address (from);
......@@ -670,13 +670,13 @@ fetch_bodystructure0 (message_t message, int extension)
/* The subtype. */
if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
{
int argc = 0;
char **argv;
char *s;
argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
s = strchr (argv[0], '/');
if (s)
......@@ -733,7 +733,7 @@ fetch_bodystructure0 (message_t message, int extension)
}
else
util_send (" NIL");
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
free (buffer);
}
else
......@@ -807,13 +807,13 @@ bodystructure (message_t msg, int extension)
message_get_header (msg, &header);
if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
{
int argc = 0;
char **argv;
char *s, *p;
argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
if (strcasecmp (argv[0], "MESSAGE/RFC822") == 0)
message_rfc822 = 1;
......@@ -890,7 +890,7 @@ bodystructure (message_t msg, int extension)
}
else
util_send (" NIL");
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
free (buffer);
}
else
......@@ -914,8 +914,8 @@ bodystructure (message_t msg, int extension)
size_t size = 0;
body_t body = NULL;
message_get_body (msg, &body);
body_size (body, &size);
body_lines (body, &blines);
mu_body_size (body, &size);
mu_body_lines (body, &blines);
util_send (" %d", size + blines);
}
......@@ -1125,9 +1125,9 @@ fetch_header (message_t msg, unsigned long start, unsigned long end)
stream_t stream = NULL;
size_t size = 0, lines = 0;
message_get_header (msg, &header);
header_size (header, &size);
header_lines (header, &lines);
header_get_stream (header, &stream);
mu_header_size (header, &size);
mu_header_lines (header, &lines);
mu_header_get_stream (header, &stream);
return fetch_io (stream, start, end, size + lines);
}
......@@ -1138,9 +1138,9 @@ fetch_body_content (message_t msg, unsigned long start, unsigned long end)
stream_t stream = NULL;
size_t size = 0, lines = 0;
message_get_body (msg, &body);
body_size (body, &size);
body_lines (body, &lines);
body_get_stream (body, &stream);
mu_body_size (body, &size);
mu_body_lines (body, &lines);
mu_body_get_stream (body, &stream);
return fetch_io (stream, start, end, size + lines);
}
......@@ -1152,7 +1152,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end,
size_t n = 0;
off_t offset;
filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ);
mu_filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ);
if (start == ULONG_MAX || end == ULONG_MAX)
{
......@@ -1254,7 +1254,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start,
{
char *value = NULL;
size_t n = 0;
if (header_aget_value (header, array[j], &value))
if (mu_header_aget_value (header, array[j], &value))
continue;
n = asprintf (&buffer, "%s: %s\n", array[j], value);
......@@ -1349,7 +1349,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
header_t header = NULL;
size_t count = 0;
message_get_header (msg, &header);
header_get_field_count (header, &count);
mu_header_get_field_count (header, &count);
for (i = 1; i <= count; i++)
{
char *name = NULL;
......@@ -1358,7 +1358,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
size_t ignore = 0;
/* Get the field name. */
status = header_aget_field_name (header, i, &name);
status = mu_header_aget_field_name (header, i, &name);
if (*name == '\0')
{
free (name);
......@@ -1383,7 +1383,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
}
}
if (header_aget_field_value (header, i, &value) == 0)
if (mu_header_aget_field_value (header, i, &value) == 0)
{
char *nl;
......@@ -1448,8 +1448,8 @@ fetch_send_address (const char *addr)
return RESP_OK;
}
address_create (&address, addr);
address_get_count (address, &count);
mu_address_create (&address, addr);
mu_address_get_count (address, &count);
/* We failed: can't parse. */
if (count == 0)
......@@ -1466,13 +1466,13 @@ fetch_send_address (const char *addr)
util_send ("(");
*buf = '\0';
address_get_personal (address, i, buf, sizeof (buf), NULL);
mu_address_get_personal (address, i, buf, sizeof (buf), NULL);
util_send_qstring (buf);
util_send (" ");
*buf = '\0';
address_get_route (address, i, buf, sizeof (buf), NULL);
mu_address_get_route (address, i, buf, sizeof (buf), NULL);
util_send_qstring (buf);
util_send (" ");
......@@ -1481,18 +1481,18 @@ fetch_send_address (const char *addr)
{
int is_group = 0;
address_is_group (address, i, &is_group);
mu_address_is_group (address, i, &is_group);
if (is_group)
address_get_personal (address, i, buf, sizeof (buf), NULL);
mu_address_get_personal (address, i, buf, sizeof (buf), NULL);
else
address_get_local_part (address, i, buf, sizeof (buf), NULL);
mu_address_get_local_part (address, i, buf, sizeof (buf), NULL);
}
util_send_qstring (buf);
util_send (" ");
*buf = '\0';
address_get_domain (address, i, buf, sizeof (buf), NULL);
mu_address_get_domain (address, i, buf, sizeof (buf), NULL);
util_send_qstring (buf);
util_send (")");
......@@ -1514,7 +1514,7 @@ send_parameter_list (const char *buffer)
return;
}
argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
if (argc == 0)
util_send ("NIL");
......@@ -1575,7 +1575,7 @@ send_parameter_list (const char *buffer)
util_send (" NIL");
util_send (")");
}
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2002, 2003, 2004,
2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -218,7 +219,7 @@ main (int argc, char **argv)
if (daemon_param.pidfile)
{
daemon_create_pidfile (daemon_param.pidfile);
mu_daemon_create_pidfile (daemon_param.pidfile);
}
/* Check TLS environment, i.e. cert and key files */
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2002, 2003, 2004,
2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -291,7 +292,7 @@ void util_set_output (stream_t str);
int util_wait_input (int);
void util_register_event (int old_state, int new_state,
list_action_t *action, void *data);
mu_list_action_t *action, void *data);
void util_event_remove (void *id);
void util_run_events (int old_state, int new_state);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -79,8 +79,8 @@ imap4d_rename (struct imap4d_command *command, char *arg)
}
name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1);
sprintf (name, "mbox:%s", newname);
if (mailbox_create (&newmbox, newname) != 0
|| mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0)
if (mu_mailbox_create (&newmbox, newname) != 0
|| mu_mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0)
{
free (name);
free (newname);
......@@ -89,29 +89,29 @@ imap4d_rename (struct imap4d_command *command, char *arg)
free (name);
free (newname);
if (mailbox_create_default (&inbox, auth_data->name) == 0 &&
mailbox_open (inbox, MU_STREAM_RDWR) == 0)
if (mu_mailbox_create_default (&inbox, auth_data->name) == 0 &&
mu_mailbox_open (inbox, MU_STREAM_RDWR) == 0)
{
size_t no;
size_t total = 0;
mailbox_messages_count (inbox, &total);
mu_mailbox_messages_count (inbox, &total);
for (no = 1; no <= total; no++)
{
message_t message;
if (mailbox_get_message (inbox, no, &message) == 0)
if (mu_mailbox_get_message (inbox, no, &message) == 0)
{
attribute_t attr = NULL;
mailbox_append_message (newmbox, message);
mu_mailbox_append_message (newmbox, message);
message_get_attribute (message, &attr);
attribute_set_deleted (attr);
mu_attribute_set_deleted (attr);
}
}
mailbox_expunge (inbox);
mailbox_close (inbox);
mailbox_destroy (&inbox);
mu_mailbox_expunge (inbox);
mu_mailbox_close (inbox);
mu_mailbox_destroy (&inbox);
}
mailbox_close (newmbox);
mailbox_destroy (&newmbox);
mu_mailbox_close (newmbox);
mu_mailbox_destroy (&newmbox);
return util_finish (command, RESP_OK, "Already exist");
}
......
......@@ -274,12 +274,12 @@ do_search (struct parsebuf *pb)
{
size_t count = 0;
mailbox_messages_count (mbox, &count);
mu_mailbox_messages_count (mbox, &count);
util_send ("* SEARCH");
for (pb->msgno = 1; pb->msgno <= count; pb->msgno++)
{
if (mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0
if (mu_mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0
&& search_run (pb))
{
if (pb->isuid)
......@@ -665,7 +665,7 @@ _scan_header (struct parsebuf *pb, char *name, char *value)
header_t header = NULL;
message_get_header (pb->msg, &header);
if (!header_get_value (header, name, buffer, sizeof(buffer), NULL))
if (!mu_header_get_value (header, name, buffer, sizeof(buffer), NULL))
{
return util_strcasestr (buffer, value) != NULL;
}
......@@ -680,7 +680,7 @@ _header_date (struct parsebuf *pb, time_t *timep)
header_t header = NULL;
message_get_header (pb->msg, &header);
if (!header_get_value (header, "Date", buffer, sizeof(buffer), NULL)
if (!mu_header_get_value (header, "Date", buffer, sizeof(buffer), NULL)
&& util_parse_822_date (buffer, timep))
return 0;
return 1;
......@@ -696,10 +696,10 @@ _scan_header_all (struct parsebuf *pb, char *text)
int i, rc;
message_get_header (pb->msg, &header);
header_get_field_count (header, &fcount);
mu_header_get_field_count (header, &fcount);
for (i = rc = 0; i < fcount; i++)
{
if (header_get_field_value (header, i, buffer, sizeof(buffer), NULL))
if (mu_header_get_field_value (header, i, buffer, sizeof(buffer), NULL))
rc = util_strcasestr (buffer, text) != NULL;
}
return rc;
......@@ -718,9 +718,9 @@ _scan_body (struct parsebuf *pb, char *text)
int rc;
message_get_body (pb->msg, &body);
body_size (body, &size);
body_lines (body, &lines);
body_get_stream (body, &stream);
mu_body_size (body, &size);
mu_body_lines (body, &lines);
mu_body_get_stream (body, &stream);
rc = 0;
while (rc == 0
&& stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0
......@@ -794,7 +794,7 @@ cond_before (struct parsebuf *pb)
envelope_t env;
message_get_envelope (pb->msg, &env);
envelope_date (env, buffer, sizeof (buffer), NULL);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, mesg_time < t);
}
......@@ -820,7 +820,7 @@ cond_from (struct parsebuf *pb)
int rc = 0;
message_get_envelope (pb->msg, &env);
if (envelope_sender (env, buffer, sizeof (buffer), NULL) == 0)
if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL) == 0)
rc = util_strcasestr (buffer, s) != NULL;
_search_push (pb, _scan_header (pb, "from", s));
}
......@@ -863,7 +863,7 @@ cond_on (struct parsebuf *pb)
envelope_t env;
message_get_envelope (pb->msg, &env);
envelope_date (env, buffer, sizeof (buffer), NULL);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, t <= mesg_time && mesg_time <= t + 86400);
}
......@@ -907,7 +907,7 @@ cond_since (struct parsebuf *pb)
envelope_t env;
message_get_envelope (pb->msg, &env);
envelope_date (env, buffer, sizeof (buffer), NULL);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, mesg_time >= t);
}
......
......@@ -48,9 +48,9 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
currently selected mailbox without doing an expunge. */
if (mbox)
{
mailbox_save_attributes (mbox);
mailbox_close (mbox);
mailbox_destroy (&mbox);
mu_mailbox_save_attributes (mbox);
mu_mailbox_close (mbox);
mu_mailbox_destroy (&mbox);
/* Destroy the old uid table. */
imap4d_sync ();
}
......@@ -60,8 +60,8 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
if (!mailbox_name)
return util_finish (command, RESP_NO, "Couldn't open mailbox");
if ((status = mailbox_create (&mbox, mailbox_name)) == 0
&& (status = mailbox_open (mbox, flags)) == 0)
if ((status = mu_mailbox_create (&mbox, mailbox_name)) == 0
&& (status = mu_mailbox_open (mbox, flags)) == 0)
{
select_flags = flags;
state = STATE_SEL;
......@@ -97,10 +97,10 @@ imap4d_select_status ()
return 0; /* FIXME: this should be something! */
if ((status = util_uidvalidity (mbox, &uidvalidity))
|| (status = mailbox_uidnext (mbox, &uidnext))
|| (status = mailbox_messages_count (mbox, &count))
|| (status = mailbox_messages_recent (mbox, &recent))
|| (status = mailbox_message_unseen (mbox, &unseen)))
|| (status = mu_mailbox_uidnext (mbox, &uidnext))
|| (status = mu_mailbox_messages_count (mbox, &count))
|| (status = mu_mailbox_messages_recent (mbox, &recent))
|| (status = mu_mailbox_message_unseen (mbox, &unseen)))
return status;
/* This outputs EXISTS and RECENT responses */
......
......@@ -75,10 +75,10 @@ imap4d_status (struct imap4d_command *command, char *arg)
if (!mailbox_name)
return util_finish (command, RESP_NO, "Error opening mailbox");
status = mailbox_create_default (&smbox, mailbox_name);
status = mu_mailbox_create_default (&smbox, mailbox_name);
if (status == 0)
{
status = mailbox_open (smbox, MU_STREAM_READ);
status = mu_mailbox_open (smbox, MU_STREAM_READ);
if (status == 0)
{
char item[32];
......@@ -110,9 +110,9 @@ imap4d_status (struct imap4d_command *command, char *arg)
}
if (count > 0)
util_send (")\r\n");
mailbox_close (smbox);
mu_mailbox_close (smbox);
}
mailbox_destroy (&smbox);
mu_mailbox_destroy (&smbox);
}
free (mailbox_name);
......@@ -132,7 +132,7 @@ static int
status_messages (mailbox_t smbox)
{
size_t total = 0;
mailbox_messages_count (smbox, &total);
mu_mailbox_messages_count (smbox, &total);
util_send ("MESSAGES %u", total);
return 0;
}
......@@ -141,7 +141,7 @@ static int
status_recent (mailbox_t smbox)
{
size_t recent = 0;
mailbox_messages_recent (smbox, &recent);
mu_mailbox_messages_recent (smbox, &recent);
util_send ("RECENT %u", recent);
return 0;
}
......@@ -150,7 +150,7 @@ static int
status_uidnext (mailbox_t smbox)
{
size_t uidnext = 1;
mailbox_uidnext (smbox, &uidnext);
mu_mailbox_uidnext (smbox, &uidnext);
util_send ("UIDNEXT %u", uidnext);
return 0;
}
......@@ -173,14 +173,14 @@ status_unseen (mailbox_t smbox)
size_t total = 0;
size_t unseen = 0;
size_t i;
mailbox_messages_count (smbox, &total);
mu_mailbox_messages_count (smbox, &total);
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mailbox_get_message (smbox, i, &msg);
mu_mailbox_get_message (smbox, i, &msg);
message_get_attribute (msg, &attr);
if (!attribute_is_seen (attr) && !attribute_is_read (attr))
if (!mu_attribute_is_seen (attr) && !mu_attribute_is_read (attr))
unseen++;
}
util_send ("UNSEEN %d", unseen);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -111,7 +111,7 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
if (msgno)
{
mailbox_get_message (mbox, msgno, &msg);
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &attr);
/* Get the fetch command names. */
......@@ -123,19 +123,19 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
if (!util_attribute_to_type (item, &type))
{
if (how == STORE_ADD )
attribute_set_flags (attr, type);
mu_attribute_set_flags (attr, type);
else if (how == STORE_UNSET )
attribute_unset_flags (attr, type);
mu_attribute_unset_flags (attr, type);
else if (how == STORE_SET )
{
if (first)
{
attribute_set_flags (attr, 0);
mu_attribute_set_flags (attr, 0);
first = 0;
}
attribute_set_flags (attr, type);
mu_attribute_set_flags (attr, type);
}
attribute_set_flags (attr, MU_ATTRIBUTE_MODIFIED);
mu_attribute_set_flags (attr, MU_ATTRIBUTE_MODIFIED);
}
}
}
......
......@@ -53,9 +53,9 @@ notify_flag (size_t msgno, attribute_t oattr)
message_t msg = NULL;
attribute_t nattr = NULL;
int status ;
mailbox_get_message (mbox, msgno, &msg);
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &nattr);
status = attribute_is_equal (oattr, nattr);
status = mu_attribute_is_equal (oattr, nattr);
if (status == 0)
{
......@@ -63,41 +63,41 @@ notify_flag (size_t msgno, attribute_t oattr)
if (!abuf)
imap4d_bye (ERR_NO_MEM);
*abuf = '\0';
if (attribute_is_seen (nattr) && attribute_is_read (nattr))
if (!attribute_is_seen (oattr) && !attribute_is_read (oattr))
if (mu_attribute_is_seen (nattr) && mu_attribute_is_read (nattr))
if (!mu_attribute_is_seen (oattr) && !mu_attribute_is_read (oattr))
{
attribute_set_seen (oattr);
attribute_set_read (oattr);
mu_attribute_set_seen (oattr);
mu_attribute_set_read (oattr);
add_flag (&abuf, "\\Seen");
}
if (attribute_is_answered (nattr))
if (!attribute_is_answered (oattr))
if (mu_attribute_is_answered (nattr))
if (!mu_attribute_is_answered (oattr))
{
attribute_set_answered (oattr);
mu_attribute_set_answered (oattr);
add_flag (&abuf, "\\Answered");
}
if (attribute_is_flagged (nattr))
if (!attribute_is_flagged (oattr))
if (mu_attribute_is_flagged (nattr))
if (!mu_attribute_is_flagged (oattr))
{
attribute_set_flagged (oattr);
mu_attribute_set_flagged (oattr);
add_flag (&abuf, "\\Flagged");
}
if (attribute_is_deleted (nattr))
if (!attribute_is_deleted (oattr))
if (mu_attribute_is_deleted (nattr))
if (!mu_attribute_is_deleted (oattr))
{
attribute_set_deleted (oattr);
mu_attribute_set_deleted (oattr);
add_flag (&abuf, "\\Deleted");
}
if (attribute_is_draft (nattr))
if (!attribute_is_draft (oattr))
if (mu_attribute_is_draft (nattr))
if (!mu_attribute_is_draft (oattr))
{
attribute_set_draft (oattr);
mu_attribute_set_draft (oattr);
add_flag (&abuf, "\\Draft");
}
if (attribute_is_recent (nattr))
if (!attribute_is_recent (oattr))
if (mu_attribute_is_recent (nattr))
if (!mu_attribute_is_recent (oattr))
{
attribute_set_recent (oattr);
mu_attribute_set_recent (oattr);
add_flag (&abuf, "\\Recent");
}
if (*abuf)
......@@ -158,7 +158,7 @@ free_uids (void)
{
size_t i;
for (i = 0; i < uid_table_count; i++)
attribute_destroy (&(uid_table[i].attr), NULL);
mu_attribute_destroy (&(uid_table[i].attr), NULL);
free (uid_table);
uid_table = NULL;
}
......@@ -183,7 +183,7 @@ reset_uids (void)
free_uids ();
mailbox_messages_count (mbox, &total);
mu_mailbox_messages_count (mbox, &total);
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
......@@ -193,14 +193,14 @@ reset_uids (void)
(uid_table_count + 1));
if (!uid_table)
imap4d_bye (ERR_NO_MEM);
mailbox_get_message (mbox, i, &msg);
mu_mailbox_get_message (mbox, i, &msg);
message_get_attribute (msg, &attr);
message_get_uid (msg, &uid);
uid_table[uid_table_count].uid = uid;
uid_table[uid_table_count].msgno = i;
uid_table[uid_table_count].notify = 0;
attribute_create (&(uid_table[uid_table_count].attr), NULL);
attribute_copy (uid_table[uid_table_count].attr, attr);
mu_attribute_create (&(uid_table[uid_table_count].attr), NULL);
mu_attribute_copy (uid_table[uid_table_count].attr, attr);
uid_table_count++;
}
uid_table_loaded = 1;
......@@ -213,7 +213,7 @@ notify (void)
int reset = 0;
size_t recent = 0;
mailbox_messages_count (mbox, &total);
mu_mailbox_messages_count (mbox, &total);
if (!uid_table)
{
......@@ -229,12 +229,12 @@ notify (void)
{
message_t msg = NULL;
size_t uid = 0;
mailbox_get_message (mbox, i, &msg);
mu_mailbox_get_message (mbox, i, &msg);
message_get_uid (msg, &uid);
notify_uid (uid);
}
notify_deleted ();
mailbox_messages_recent (mbox, &recent);
mu_mailbox_messages_recent (mbox, &recent);
}
util_out (RESP_NONE, "%d EXISTS", total);
......@@ -265,9 +265,9 @@ imap4d_sync_flags (size_t msgno)
{
message_t msg = NULL;
attribute_t attr = NULL;
mailbox_get_message (mbox, msgno, &msg);
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &attr);
attribute_copy (uid_table[i].attr, attr);
mu_attribute_copy (uid_table[i].attr, attr);
break;
}
return 0;
......@@ -299,7 +299,7 @@ imap4d_set_observer (mailbox_t mbox)
observer_create (&observer, mbox);
observer_set_action (observer, action, mbox);
mailbox_get_observable (mbox, &observable);
mu_mailbox_get_observable (mbox, &observable);
observable_attach (observable, MU_EVT_MAILBOX_CORRUPT|MU_EVT_MAILBOX_DESTROY,
observer);
mailbox_corrupt = 0;
......@@ -313,16 +313,16 @@ imap4d_sync (void)
If it was a close we do not send any notification. */
if (mbox == NULL)
free_uids ();
else if (!uid_table_loaded || !mailbox_is_updated (mbox))
else if (!uid_table_loaded || !mu_mailbox_is_updated (mbox))
{
if (mailbox_corrupt)
{
/* Some messages have been deleted from the mailbox by some other
party */
int status = mailbox_close (mbox);
int status = mu_mailbox_close (mbox);
if (status)
imap4d_bye (ERR_MAILBOX_CORRUPTED);
status = mailbox_open (mbox, MU_STREAM_RDWR);
status = mu_mailbox_open (mbox, MU_STREAM_RDWR);
if (status)
imap4d_bye (ERR_MAILBOX_CORRUPTED);
imap4d_set_observer (mbox);
......@@ -336,7 +336,7 @@ imap4d_sync (void)
else
{
size_t count = 0;
mailbox_messages_count (mbox, &count);
mu_mailbox_messages_count (mbox, &count);
if (count != uid_table_count)
notify ();
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2001, 2002, 2003, 2004,
2005 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -171,14 +172,14 @@ util_msgset (char *s, size_t ** set, int *n, int isuid)
unsigned long invalid_uid = 0; /* For UID mode only: have we
encountered an uid > max uid? */
status = mailbox_messages_count (mbox, &max);
status = mu_mailbox_messages_count (mbox, &max);
if (status != 0)
return status;
/* If it is a uid sequence, override max with the UID. */
if (isuid)
{
message_t msg = NULL;
mailbox_get_message (mbox, max, &msg);
mu_mailbox_get_message (mbox, max, &msg);
message_get_uid (msg, &max);
}
......@@ -839,7 +840,7 @@ util_print_flags (attribute_t attr)
int flags = 0;
int space = 0;
attribute_get_flags (attr, &flags);
mu_attribute_get_flags (attr, &flags);
for (i = 0; i < _imap4d_nattr; i++)
if (flags & _imap4d_attrlist[i].flag)
{
......@@ -863,7 +864,7 @@ util_attribute_matches_flag (attribute_t attr, const char *item)
{
int flags = 0, mask = 0;
attribute_get_flags (attr, &flags);
mu_attribute_get_flags (attr, &flags);
util_attribute_to_type (item, &mask);
if (mask == MU_ATTRIBUTE_RECENT)
return MU_ATTRIBUTE_IS_UNSEEN (flags);
......@@ -1088,11 +1089,11 @@ util_uidvalidity (mailbox_t smbox, unsigned long *uidvp)
url_t mbox_url = NULL;
url_t smbox_url = NULL;
mailbox_get_url (mbox, &mbox_url);
mailbox_get_url (smbox, &smbox_url);
mu_mailbox_get_url (mbox, &mbox_url);
mu_mailbox_get_url (smbox, &smbox_url);
if (strcmp (url_to_string (mbox_url), url_to_string (smbox_url)) == 0)
smbox = mbox;
return mailbox_uidvalidity (smbox, uidvp);
return mu_mailbox_uidvalidity (smbox, uidvp);
}
......@@ -1198,8 +1199,8 @@ void
util_atexit (void (*fp) (void))
{
if (!atexit_list)
list_create (&atexit_list);
list_append (atexit_list, (void*)fp);
mu_list_create (&atexit_list);
mu_list_append (atexit_list, (void*)fp);
}
static int
......@@ -1223,13 +1224,13 @@ util_bye ()
stream_destroy (&ostream, stream_get_owner (ostream));
}
list_do (atexit_list, atexit_run, 0);
mu_list_do (atexit_list, atexit_run, 0);
}
struct state_event {
int old_state;
int new_state;
list_action_t *action;
mu_list_action_t *action;
void *data;
};
......@@ -1237,7 +1238,7 @@ static list_t event_list;
void
util_register_event (int old_state, int new_state,
list_action_t *action, void *data)
mu_list_action_t *action, void *data)
{
struct state_event *evp = malloc (sizeof (*evp));
if (!evp)
......@@ -1247,14 +1248,14 @@ util_register_event (int old_state, int new_state,
evp->action = action;
evp->data = data;
if (!event_list)
list_create (&event_list);
list_append (event_list, (void*)evp);
mu_list_create (&event_list);
mu_list_append (event_list, (void*)evp);
}
void
util_event_remove (void *id)
{
list_remove (event_list, id);
mu_list_remove (event_list, id);
}
static int
......@@ -1277,15 +1278,15 @@ util_run_events (int old_state, int new_state)
ev.old_state = old_state;
ev.new_state = new_state;
list_get_iterator (event_list, &itr);
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
mu_list_get_iterator (event_list, &itr);
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
struct state_event *p;
iterator_current (itr, (void **)&p);
mu_iterator_current (itr, (void **)&p);
if (event_exec (p, &ev))
break;
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
}
}
......
......@@ -25,52 +25,52 @@
extern "C" {
#endif
extern int address_create (address_t *, const char *);
extern int address_createv (address_t *, const char *v[], size_t);
extern void address_destroy (address_t *);
extern int mu_address_create (address_t *, const char *);
extern int mu_address_createv (address_t *, const char *v[], size_t);
extern void mu_address_destroy (address_t *);
extern address_t address_dup (address_t src);
extern address_t mu_address_dup (address_t src);
/* Set FROM to null, after adding its addresses to TO. */
extern int address_concatenate (address_t to, address_t* from);
extern int mu_address_concatenate (address_t to, address_t* from);
extern int address_get_nth
extern int mu_address_get_nth
(address_t addr, size_t no, address_t *pret);
extern int address_get_email
extern int mu_address_get_email
(address_t, size_t, char *, size_t, size_t *);
extern int address_get_local_part
extern int mu_address_get_local_part
(address_t, size_t, char *, size_t, size_t *);
extern int address_get_domain
extern int mu_address_get_domain
(address_t, size_t, char *, size_t, size_t *);
extern int address_get_personal
extern int mu_address_get_personal
(address_t, size_t, char *, size_t, size_t *);
extern int address_get_comments
extern int mu_address_get_comments
(address_t, size_t, char *, size_t, size_t *);
extern int address_get_route
extern int mu_address_get_route
(address_t, size_t, char *, size_t, size_t *);
extern int address_aget_email
extern int mu_address_aget_email
(address_t, size_t, char **);
extern int address_aget_local_part
extern int mu_address_aget_local_part
(address_t addr, size_t no, char **buf);
extern int address_aget_domain
extern int mu_address_aget_domain
(address_t addr, size_t no, char **buf);
extern int address_aget_personal
extern int mu_address_aget_personal
(address_t addr, size_t no, char **buf);
extern int address_is_group
extern int mu_address_is_group
(address_t, size_t, int*);
extern int address_to_string (address_t, char *, size_t, size_t *);
extern int address_get_count (address_t, size_t *);
extern int address_get_group_count (address_t, size_t *);
extern int address_get_email_count (address_t, size_t *);
extern int address_get_unix_mailbox_count (address_t, size_t *);
extern int mu_address_to_string (address_t, char *, size_t, size_t *);
extern int mu_address_get_count (address_t, size_t *);
extern int mu_address_get_group_count (address_t, size_t *);
extern int mu_address_get_email_count (address_t, size_t *);
extern int mu_address_get_unix_mailbox_count (address_t, size_t *);
extern int address_contains_email (address_t addr, const char *email);
extern int address_union (address_t *a, address_t b);
extern int mu_address_contains_email (address_t addr, const char *email);
extern int mu_address_union (address_t *a, address_t b);
extern size_t address_format_string (address_t addr, char *buf, size_t buflen);
extern size_t mu_address_format_string (address_t addr, char *buf, size_t buflen);
#ifdef __cplusplus
}
......
......@@ -28,20 +28,20 @@
extern "C" {
#endif
extern int argcv_get (const char *command, const char *delim,
extern int mu_argcv_get (const char *command, const char *delim,
const char* cmnt,
int *argc, char ***argv);
extern int argcv_get_n (const char *command, int len,
extern int mu_argcv_get_n (const char *command, int len,
const char *delim, const char *cmnt,
int *argc, char ***argv);
extern int argcv_string (int argc, char **argv, char **string);
extern int argcv_free (int argc, char **argv);
extern int argcv_unquote_char (int c);
extern int argcv_quote_char (int c);
extern size_t argcv_quoted_length (const char *str, int *quote);
extern void argcv_unquote_copy (char *dst, const char *src, size_t n);
extern void argcv_quote_copy (char *dst, const char *src);
extern int mu_argcv_string (int argc, char **argv, char **string);
extern int mu_argcv_free (int argc, char **argv);
extern int mu_argcv_unquote_char (int c);
extern int mu_argcv_quote_char (int c);
extern size_t mu_argcv_quoted_length (const char *str, int *quote);
extern void mu_argcv_unquote_copy (char *dst, const char *src, size_t n);
extern void mu_argcv_quote_copy (char *dst, const char *src);
#ifdef __cplusplus
}
......
......@@ -45,59 +45,59 @@ extern "C" {
#define MU_ATTRIBUTE_IS_UNREAD(f) \
((f) == 0 || ! ((f) & MU_ATTRIBUTE_READ))
extern int attribute_create (attribute_t *, void *);
extern void attribute_destroy (attribute_t *, void *);
extern void * attribute_get_owner (attribute_t);
extern int attribute_is_modified (attribute_t);
extern int attribute_clear_modified (attribute_t);
extern int attribute_set_modified (attribute_t attr);
extern int attribute_is_userflag (attribute_t, int);
extern int attribute_is_seen (attribute_t);
extern int attribute_is_answered (attribute_t);
extern int attribute_is_flagged (attribute_t);
extern int attribute_is_deleted (attribute_t);
extern int attribute_is_draft (attribute_t);
extern int attribute_is_recent (attribute_t);
extern int attribute_is_read (attribute_t);
extern int attribute_set_userflag (attribute_t, int);
extern int attribute_set_seen (attribute_t);
extern int attribute_set_answered (attribute_t);
extern int attribute_set_flagged (attribute_t);
extern int attribute_set_deleted (attribute_t);
extern int attribute_set_draft (attribute_t);
extern int attribute_set_recent (attribute_t);
extern int attribute_set_read (attribute_t);
extern int attribute_unset_userflag (attribute_t, int);
extern int attribute_unset_seen (attribute_t);
extern int attribute_unset_answered (attribute_t);
extern int attribute_unset_flagged (attribute_t);
extern int attribute_unset_deleted (attribute_t);
extern int attribute_unset_draft (attribute_t);
extern int attribute_unset_recent (attribute_t);
extern int attribute_unset_read (attribute_t);
extern int attribute_get_flags (attribute_t, int *);
extern int attribute_set_flags (attribute_t, int);
extern int attribute_unset_flags (attribute_t, int);
extern int attribute_set_set_flags (attribute_t,
extern int mu_attribute_create (attribute_t *, void *);
extern void mu_attribute_destroy (attribute_t *, void *);
extern void * mu_attribute_get_owner (attribute_t);
extern int mu_attribute_is_modified (attribute_t);
extern int mu_attribute_clear_modified (attribute_t);
extern int mu_attribute_set_modified (attribute_t attr);
extern int mu_attribute_is_userflag (attribute_t, int);
extern int mu_attribute_is_seen (attribute_t);
extern int mu_attribute_is_answered (attribute_t);
extern int mu_attribute_is_flagged (attribute_t);
extern int mu_attribute_is_deleted (attribute_t);
extern int mu_attribute_is_draft (attribute_t);
extern int mu_attribute_is_recent (attribute_t);
extern int mu_attribute_is_read (attribute_t);
extern int mu_attribute_set_userflag (attribute_t, int);
extern int mu_attribute_set_seen (attribute_t);
extern int mu_attribute_set_answered (attribute_t);
extern int mu_attribute_set_flagged (attribute_t);
extern int mu_attribute_set_deleted (attribute_t);
extern int mu_attribute_set_draft (attribute_t);
extern int mu_attribute_set_recent (attribute_t);
extern int mu_attribute_set_read (attribute_t);
extern int mu_attribute_unset_userflag (attribute_t, int);
extern int mu_attribute_unset_seen (attribute_t);
extern int mu_attribute_unset_answered (attribute_t);
extern int mu_attribute_unset_flagged (attribute_t);
extern int mu_attribute_unset_deleted (attribute_t);
extern int mu_attribute_unset_draft (attribute_t);
extern int mu_attribute_unset_recent (attribute_t);
extern int mu_attribute_unset_read (attribute_t);
extern int mu_attribute_get_flags (attribute_t, int *);
extern int mu_attribute_set_flags (attribute_t, int);
extern int mu_attribute_unset_flags (attribute_t, int);
extern int mu_attribute_set_set_flags (attribute_t,
int (*_set_flags) (attribute_t, int),
void *);
extern int attribute_set_unset_flags (attribute_t,
extern int mu_attribute_set_unset_flags (attribute_t,
int (*_unset_flags) (attribute_t, int),
void *);
extern int attribute_set_get_flags (attribute_t,
extern int mu_attribute_set_get_flags (attribute_t,
int (*_get_flags) (attribute_t, int *),
void *);
extern int attribute_is_equal (attribute_t, attribute_t att2);
extern int mu_attribute_is_equal (attribute_t, attribute_t att2);
extern int attribute_copy (attribute_t, attribute_t);
extern int mu_attribute_copy (attribute_t, attribute_t);
extern int attribute_to_string (attribute_t, char *, size_t, size_t *);
extern int string_to_flags (const char *, int *);
extern int mu_attribute_to_string (attribute_t, char *, size_t, size_t *);
extern int mu_string_to_flags (const char *, int *);
#ifdef __cplusplus
}
......
......@@ -25,36 +25,36 @@
extern "C" {
#endif
extern int ticket_create (ticket_t *, void *owner);
extern void ticket_destroy (ticket_t *, void *owner);
extern int ticket_set_destroy (ticket_t, void (*) (ticket_t), void *);
extern void *ticket_get_owner (ticket_t);
extern int mu_ticket_create (ticket_t *, void *owner);
extern void mu_ticket_destroy (ticket_t *, void *owner);
extern int mu_ticket_set_destroy (ticket_t, void (*) (ticket_t), void *);
extern void *mu_ticket_get_owner (ticket_t);
extern int ticket_set_pop (ticket_t,
extern int mu_ticket_set_pop (ticket_t,
int (*_pop) (ticket_t, url_t, const char *, char **), void *);
extern int ticket_pop (ticket_t, url_t, const char *, char **);
extern int ticket_set_data (ticket_t, void *, void *owner);
extern int ticket_get_data (ticket_t, void **);
extern int authority_create (authority_t *, ticket_t, void *);
extern void authority_destroy (authority_t *, void *);
extern void *authority_get_owner (authority_t);
extern int authority_set_ticket (authority_t, ticket_t);
extern int authority_get_ticket (authority_t, ticket_t *);
extern int authority_authenticate (authority_t);
extern int authority_set_authenticate (authority_t,
extern int mu_ticket_pop (ticket_t, url_t, const char *, char **);
extern int mu_ticket_set_data (ticket_t, void *, void *owner);
extern int mu_ticket_get_data (ticket_t, void **);
extern int mu_authority_create (authority_t *, ticket_t, void *);
extern void mu_authority_destroy (authority_t *, void *);
extern void *mu_authority_get_owner (authority_t);
extern int mu_authority_set_ticket (authority_t, ticket_t);
extern int mu_authority_get_ticket (authority_t, ticket_t *);
extern int mu_authority_authenticate (authority_t);
extern int mu_authority_set_authenticate (authority_t,
int (*_authenticate) (authority_t), void *);
extern int authority_create_null (authority_t *pauthority, void *owner);
extern int mu_authority_create_null (authority_t *pauthority, void *owner);
extern int wicket_create (wicket_t *, const char *);
extern void wicket_destroy (wicket_t *);
extern int wicket_set_filename (wicket_t, const char *);
extern int wicket_get_filename (wicket_t, char *, size_t, size_t *);
extern int wicket_set_ticket (wicket_t,
extern int mu_wicket_create (wicket_t *, const char *);
extern void mu_wicket_destroy (wicket_t *);
extern int mu_wicket_set_filename (wicket_t, const char *);
extern int mu_wicket_get_filename (wicket_t, char *, size_t, size_t *);
extern int mu_wicket_set_ticket (wicket_t,
int (*) (wicket_t, const char *,
const char *, ticket_t *));
extern int wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *);
extern int mu_wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *);
#ifdef __cplusplus
}
......
......@@ -25,22 +25,22 @@
extern "C" {
#endif
extern int body_create (body_t *, void *owner);
extern void body_destroy (body_t *, void *owner);
extern void * body_get_owner (body_t);
extern int body_is_modified (body_t);
extern int body_clear_modified (body_t);
extern int mu_body_create (body_t *, void *owner);
extern void mu_body_destroy (body_t *, void *owner);
extern void * mu_body_get_owner (body_t);
extern int mu_body_is_modified (body_t);
extern int mu_body_clear_modified (body_t);
extern int body_get_stream (body_t, stream_t *);
extern int body_set_stream (body_t, stream_t, void *owner);
extern int mu_body_get_stream (body_t, stream_t *);
extern int mu_body_set_stream (body_t, stream_t, void *owner);
extern int body_get_filename (body_t, char *, size_t, size_t *);
extern int mu_body_get_filename (body_t, char *, size_t, size_t *);
extern int body_size (body_t, size_t*);
extern int body_set_size (body_t,
extern int mu_body_size (body_t, size_t*);
extern int mu_body_set_size (body_t,
int (*_size) (body_t, size_t*), void *owner);
extern int body_lines (body_t, size_t *);
extern int body_set_lines (body_t,
extern int mu_body_lines (body_t, size_t *);
extern int mu_body_set_lines (body_t,
int (*_lines) (body_t, size_t*), void *owner);
#ifdef __cplusplus
......
......@@ -25,8 +25,8 @@
extern "C" {
#endif
extern int daemon_create_pidfile (const char *);
extern void daemon_remove_pidfile (void);
extern int mu_daemon_create_pidfile (const char *);
extern void mu_daemon_remove_pidfile (void);
#ifdef __cplusplus
}
......
......@@ -25,17 +25,17 @@
extern "C" { /*}*/
#endif
int envelope_create (envelope_t *, void *);
void envelope_destroy (envelope_t *, void *);
void * envelope_get_owner (envelope_t);
int envelope_set_sender (envelope_t,
int mu_envelope_create (envelope_t *, void *);
void mu_envelope_destroy (envelope_t *, void *);
void * mu_envelope_get_owner (envelope_t);
int mu_envelope_set_sender (envelope_t,
int (*_sender) (envelope_t, char *, size_t, size_t*),
void *);
int envelope_sender (envelope_t, char *, size_t, size_t *);
int envelope_set_date (envelope_t,
int mu_envelope_sender (envelope_t, char *, size_t, size_t *);
int mu_envelope_set_date (envelope_t,
int (*_date) (envelope_t, char *, size_t , size_t *),
void *);
int envelope_date (envelope_t, char *, size_t, size_t *);
int mu_envelope_date (envelope_t, char *, size_t, size_t *);
#ifdef __cplusplus
}
......
......@@ -27,11 +27,11 @@
extern "C" {
#endif
typedef int (*error_pfn_t) __PMT ((const char *fmt, va_list ap));
typedef int (*mu_error_pfn_t) (const char *fmt, va_list ap);
extern int mu_verror (const char *fmt, va_list ap);
extern int mu_error (const char *fmt, ...);
extern void mu_error_set_print (error_pfn_t);
extern void mu_error_set_print (mu_error_pfn_t);
int mu_default_error_printer (const char *fmt, va_list ap);
int mu_syslog_error_printer (const char *fmt, va_list ap);
......
......@@ -34,29 +34,29 @@ extern "C" {
#define MU_FILTER_WRITE MU_STREAM_WRITE
#define MU_FILTER_RDWR MU_STREAM_RDWR
struct _filter_record
struct mu_filter_record
{
const char *name;
int (*_filter) __PMT ((filter_t));
int (*_filter) (filter_t);
void *data;
/* Stub function return the fields. */
int (*_is_filter) __PMT ((filter_record_t, const char *));
int (*_get_filter) __PMT ((filter_record_t, int (*(*_filter)) __PMT ((filter_t))));
int (*_is_filter) (filter_record_t, const char *);
int (*_get_filter) (filter_record_t, int (*(*_filter)) (filter_t));
};
extern int filter_create (stream_t *, stream_t, const char*, int, int);
extern int filter_get_list (list_t *);
extern int mu_filter_create (stream_t *, stream_t, const char*, int, int);
extern int mu_filter_get_list (list_t *);
/* List of defaults. */
extern filter_record_t rfc822_filter;
extern filter_record_t qp_filter; /* quoted-printable. */
extern filter_record_t base64_filter;
extern filter_record_t binary_filter;
extern filter_record_t bit8_filter;
extern filter_record_t bit7_filter;
extern filter_record_t rfc_2047_Q_filter;
extern filter_record_t mu_rfc822_filter;
extern filter_record_t mu_qp_filter; /* quoted-printable. */
extern filter_record_t mu_base64_filter;
extern filter_record_t mu_binary_filter;
extern filter_record_t mu_bit8_filter;
extern filter_record_t mu_bit7_filter;
extern filter_record_t mu_rfc_2047_Q_filter;
enum mu_iconv_fallback_mode {
mu_fallback_none,
......@@ -64,7 +64,7 @@ enum mu_iconv_fallback_mode {
mu_fallback_copy_octal
};
extern int filter_iconv_create (stream_t *s, stream_t transport,
extern int mu_filter_iconv_create (stream_t *s, stream_t transport,
const char *fromcode, const char *tocode,
int flags,
enum mu_iconv_fallback_mode fallback_mode);
......
......@@ -25,58 +25,58 @@
extern "C" {
#endif
struct list_response
struct mu_list_response
{
int type; /* MU_FOLDER_ATTRIBUTE_.* flags */
int separator;
char *name;
};
struct folder_list
struct mu_folder_list
{
struct list_response **element;
struct mu_list_response **element;
size_t num;
};
/* Constructor/destructor and possible types. */
extern int folder_create (folder_t *, const char *);
extern void folder_destroy (folder_t *);
extern int folder_open (folder_t, int flag);
extern int folder_close (folder_t);
extern int folder_delete (folder_t, const char *);
extern int folder_rename (folder_t, const char *, const char *);
extern int folder_subscribe (folder_t, const char *);
extern int folder_unsubscribe (folder_t, const char *);
extern int folder_list (folder_t, const char *, const char *,
struct folder_list *);
extern int folder_lsub (folder_t, const char *, const char *,
struct folder_list *);
extern int folder_list_destroy (struct folder_list *);
extern int mu_folder_create (folder_t *, const char *);
extern void mu_folder_destroy (folder_t *);
extern int mu_folder_open (folder_t, int flag);
extern int mu_folder_close (folder_t);
extern int mu_folder_delete (folder_t, const char *);
extern int mu_folder_rename (folder_t, const char *, const char *);
extern int mu_folder_subscribe (folder_t, const char *);
extern int mu_folder_unsubscribe (folder_t, const char *);
extern int mu_folder_list (folder_t, const char *, const char *,
struct mu_folder_list *);
extern int mu_folder_lsub (folder_t, const char *, const char *,
struct mu_folder_list *);
extern int mu_folder_list_destroy (struct mu_folder_list *);
/* Stream settings. */
extern int folder_get_stream (folder_t, stream_t *);
extern int folder_set_stream (folder_t, stream_t);
extern int mu_folder_get_stream (folder_t, stream_t *);
extern int mu_folder_set_stream (folder_t, stream_t);
/* Notifications. */
extern int folder_get_observable (folder_t, observable_t *);
extern int mu_folder_get_observable (folder_t, observable_t *);
/* Debug. */
extern int folder_has_debug (folder_t folder);
extern int folder_get_debug (folder_t, mu_debug_t *);
extern int folder_set_debug (folder_t, mu_debug_t);
extern int mu_folder_has_debug (folder_t folder);
extern int mu_folder_get_debug (folder_t, mu_debug_t *);
extern int mu_folder_set_debug (folder_t, mu_debug_t);
/* Authentication. */
extern int folder_get_authority (folder_t, authority_t *);
extern int folder_set_authority (folder_t, authority_t);
extern int mu_folder_get_authority (folder_t, authority_t *);
extern int mu_folder_set_authority (folder_t, authority_t);
/* URL. */
extern int folder_get_url (folder_t, url_t *);
extern int folder_set_url (folder_t, url_t);
extern int mu_folder_get_url (folder_t, url_t *);
extern int mu_folder_set_url (folder_t, url_t);
/* FIXME: not implemented */
extern int folder_decrement (folder_t);
extern int mu_folder_decrement (folder_t);
#ifdef __cplusplus
......
......@@ -21,12 +21,12 @@
#include <gsasl.h>
int gsasl_stream_create (stream_t *stream, stream_t transport,
int mu_gsasl_stream_create (stream_t *stream, stream_t transport,
Gsasl_session_ctx *ctx,
int flags);
void mu_gsasl_init_argp (void);
extern char *gsasl_cram_md5_pwd;
extern char *mu_gsasl_cram_md5_pwd;
#endif /* not _MAILUTILS_GSASL_H */
......
......@@ -47,19 +47,19 @@ typedef struct
int debug_guile;
mailbox_t mbox;
char *user_name;
int (*init) __PMT ((void *data));
SCM (*catch_body) __PMT ((void *data, mailbox_t mbox));
SCM (*catch_handler) __PMT ((void *data, SCM tag, SCM throw_args));
int (*next) __PMT ((void *data, mailbox_t mbox));
int (*exit) __PMT ((void *data, mailbox_t mbox));
int (*init) (void *data);
SCM (*catch_body) (void *data, mailbox_t mbox);
SCM (*catch_handler) (void *data, SCM tag, SCM throw_args);
int (*next) (void *data, mailbox_t mbox);
int (*exit) (void *data, mailbox_t mbox);
void *data;
} guimb_param_t;
} mu_guimb_param_t;
#ifdef __cplusplus
extern "C" {
#endif
extern SCM scm_makenum (unsigned long val);
extern SCM mu_scm_makenum (unsigned long val);
extern void mu_set_variable (const char *name, SCM value);
extern void mu_scm_init (void);
......@@ -85,7 +85,7 @@ extern SCM mu_port_make_from_stream (SCM msg, stream_t stream, long mode);
extern void mu_scm_mime_init (void);
extern void mu_scm_message_add_owner (SCM MESG, SCM owner);
extern void mu_process_mailbox (int argc, char *argv[], guimb_param_t *param);
extern void mu_process_mailbox (int argc, char *argv[], mu_guimb_param_t *param);
extern void mu_scm_mutil_init (void);
......
......@@ -72,64 +72,64 @@ extern "C" {
/* Mime support header attribute */
extern int header_create (header_t *, const char *, size_t, void *);
extern void header_destroy (header_t *, void *);
extern void *header_get_owner (header_t);
extern int mu_header_create (header_t *, const char *, size_t, void *);
extern void mu_header_destroy (header_t *, void *);
extern void *mu_header_get_owner (header_t);
extern int header_is_modified (header_t);
extern int header_clear_modified (header_t);
extern int mu_header_is_modified (header_t);
extern int mu_header_clear_modified (header_t);
/* Set and get field values by field name. */
extern int header_set_value (header_t, const char *, const char *, int);
extern int header_get_value (header_t, const char *, char *, size_t, size_t *);
extern int header_aget_value (header_t, const char *, char **);
extern int mu_header_set_value (header_t, const char *, const char *, int);
extern int mu_header_get_value (header_t, const char *, char *, size_t, size_t *);
extern int mu_header_aget_value (header_t, const char *, char **);
/* Get field values as an address_t. */
extern int header_get_address (header_t, const char *, address_t *);
extern int mu_header_get_address (header_t, const char *, address_t *);
/* Set and get field values by field index (1-based). */
extern int header_get_field_count (header_t, size_t *count);
extern int header_get_field_value (header_t, size_t index, char *, size_t, size_t *);
extern int header_get_field_name (header_t, size_t index, char *, size_t, size_t *);
extern int header_aget_field_value (header_t, size_t index, char **);
extern int header_aget_field_name (header_t, size_t index, char **);
extern int mu_header_get_field_count (header_t, size_t *count);
extern int mu_header_get_field_value (header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_get_field_name (header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_aget_field_value (header_t, size_t index, char **);
extern int mu_header_aget_field_name (header_t, size_t index, char **);
extern int header_get_value_unfold (header_t header, const char *name,
extern int mu_header_get_value_unfold (header_t header, const char *name,
char *buffer, size_t buflen,
size_t *pn);
extern int header_aget_value_unfold (header_t header, const char *name,
extern int mu_header_aget_value_unfold (header_t header, const char *name,
char **pvalue);
extern int header_get_field_value_unfold (header_t header, size_t num,
extern int mu_header_get_field_value_unfold (header_t header, size_t num,
char *buf, size_t buflen,
size_t *nwritten);
extern int header_aget_field_value_unfold (header_t header, size_t num,
extern int mu_header_aget_field_value_unfold (header_t header, size_t num,
char **pvalue);
extern int header_get_stream (header_t, stream_t *);
extern int header_set_stream (header_t, stream_t, void *);
extern int mu_header_get_stream (header_t, stream_t *);
extern int mu_header_set_stream (header_t, stream_t, void *);
extern int header_size (header_t, size_t *);
extern int header_lines (header_t, size_t *);
extern int mu_header_size (header_t, size_t *);
extern int mu_header_lines (header_t, size_t *);
extern int header_set_set_value (header_t,
extern int mu_header_set_set_value (header_t,
int (*_set_value) (header_t, const char *, const char *, int),
void *);
extern int header_set_get_value (header_t,
extern int mu_header_set_get_value (header_t,
int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
void *);
extern int header_set_get_fvalue (header_t,
extern int mu_header_set_get_fvalue (header_t,
int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
void *);
extern int header_set_size (header_t,
extern int mu_header_set_size (header_t,
int (*_size) (header_t, size_t *), void *);
extern int header_set_lines (header_t,
extern int mu_header_set_lines (header_t,
int (*_lines) (header_t, size_t *), void *);
extern int header_set_fill (header_t,
extern int mu_header_set_fill (header_t,
int (*_fill) (header_t, char *, size_t, off_t, size_t *), void *owner);
......
......@@ -25,29 +25,29 @@
extern "C" {
#endif
extern int iterator_create (iterator_t *, void *);
extern int iterator_dup (iterator_t *piterator, iterator_t orig);
extern void iterator_destroy (iterator_t *);
extern int iterator_first (iterator_t);
extern int iterator_next (iterator_t);
extern int iterator_current (iterator_t, void * const *pitem);
extern int iterator_is_done (iterator_t);
extern int iterator_attach (iterator_t *root, iterator_t iterator);
extern int iterator_detach (iterator_t *root, iterator_t iterator);
extern void iterator_advance (iterator_t iterator, void *e);
extern int iterator_set_first (iterator_t, int (*first) (void *));
extern int iterator_set_next (iterator_t, int (*next) (void *));
extern int iterator_set_getitem (iterator_t,
extern int mu_iterator_create (iterator_t *, void *);
extern int mu_iterator_dup (iterator_t *piterator, iterator_t orig);
extern void mu_iterator_destroy (iterator_t *);
extern int mu_iterator_first (iterator_t);
extern int mu_iterator_next (iterator_t);
extern int mu_iterator_current (iterator_t, void * const *pitem);
extern int mu_iterator_is_done (iterator_t);
extern int mu_iterator_attach (iterator_t *root, iterator_t iterator);
extern int mu_iterator_detach (iterator_t *root, iterator_t iterator);
extern void mu_iterator_advance (iterator_t iterator, void *e);
extern int mu_iterator_set_first (iterator_t, int (*first) (void *));
extern int mu_iterator_set_next (iterator_t, int (*next) (void *));
extern int mu_iterator_set_getitem (iterator_t,
int (*getitem) (void *, void **));
extern int iterator_set_finished_p (iterator_t,
extern int mu_iterator_set_finished_p (iterator_t,
int (*finished_p) (void *));
extern int iterator_set_dup (iterator_t itr,
extern int mu_iterator_set_dup (iterator_t itr,
int (dup) (void **ptr, void *data));
extern int iterator_set_destroy (iterator_t itr,
extern int mu_iterator_set_destroy (iterator_t itr,
int (destroy) (iterator_t, void *data));
extern int iterator_set_curitem_p (iterator_t itr,
extern int mu_iterator_set_curitem_p (iterator_t itr,
int (*curitem_p) (void *, void *));
#ifdef __cplusplus
......
......@@ -25,30 +25,30 @@
extern "C" {
#endif
extern int list_create (list_t *);
extern void list_destroy (list_t *);
extern int list_append (list_t, void *item);
extern int list_prepend (list_t, void *item);
extern int list_insert (list_t list, void *item, void *new_item,
extern int mu_list_create (list_t *);
extern void mu_list_destroy (list_t *);
extern int mu_list_append (list_t, void *item);
extern int mu_list_prepend (list_t, void *item);
extern int mu_list_insert (list_t list, void *item, void *new_item,
int insert_before);
extern int list_is_empty (list_t);
extern int list_count (list_t, size_t *pcount);
extern int list_remove (list_t, void *item);
extern int list_replace (list_t list, void *old_item, void *new_item);
extern int list_get (list_t, size_t _index, void **pitem);
extern int list_to_array (list_t list, void **array, size_t count, size_t *pcount);
extern int list_locate (list_t list, void *item, void **ret_item);
extern int list_get_iterator (list_t, iterator_t *);
extern int mu_list_is_empty (list_t);
extern int mu_list_count (list_t, size_t *pcount);
extern int mu_list_remove (list_t, void *item);
extern int mu_list_replace (list_t list, void *old_item, void *new_item);
extern int mu_list_get (list_t, size_t _index, void **pitem);
extern int mu_list_to_array (list_t list, void **array, size_t count, size_t *pcount);
extern int mu_list_locate (list_t list, void *item, void **ret_item);
extern int mu_list_get_iterator (list_t, iterator_t *);
typedef int list_action_t (void* item, void* cbdata);
typedef int mu_list_action_t (void* item, void* cbdata);
extern int list_do (list_t list, list_action_t * action, void *cbdata);
extern int mu_list_do (list_t list, mu_list_action_t * action, void *cbdata);
typedef int (*list_comparator_t) (const void*, const void*);
typedef int (*mu_list_comparator_t) (const void*, const void*);
extern list_comparator_t list_set_comparator (list_t, list_comparator_t);
extern mu_list_comparator_t mu_list_set_comparator (list_t, mu_list_comparator_t);
extern int list_set_destroy_item (list_t list, void (*destoy_item) (void *));
extern int mu_list_set_destroy_item (list_t list, void (*destoy_item) (void *));
#ifdef __cplusplus
......
......@@ -40,12 +40,12 @@ extern "C" {
enum mu_locker_set_mode
{
mu_locker_set_flags,
mu_locker_assign,
mu_locker_set_bit,
mu_locker_clear_bit
};
/* locker_create() flags */
/* mu_locker_create() flags */
#define MU_LOCKER_SIMPLE 0x00
/* Just try and dotlock the file, not the default because its usually
......@@ -80,34 +80,34 @@ enum mu_locker_set_mode
* to MU_LOCKER_DEFAULT). A flags of 0 resets the flags back to the
* the default.
*/
extern int locker_set_default_flags (int flags, enum mu_locker_set_mode mode);
extern void locker_set_default_retry_timeout (time_t to);
extern void locker_set_default_retry_count (size_t n);
extern void locker_set_default_expire_timeout (time_t t);
extern void locker_set_default_external_program (char *path);
extern int mu_locker_set_default_flags (int flags, enum mu_locker_set_mode mode);
extern void mu_locker_set_default_retry_timeout (time_t to);
extern void mu_locker_set_default_retry_count (size_t n);
extern void mu_locker_set_default_expire_timeout (time_t t);
extern void mu_locker_set_default_external_program (char *path);
/* A flags of 0 means that the default will be used. */
extern int locker_create (locker_t *, const char *filename, int flags);
extern void locker_destroy (locker_t *);
extern int mu_locker_create (locker_t *, const char *filename, int flags);
extern void mu_locker_destroy (locker_t *);
/* Time is measured in seconds. */
extern int locker_set_flags (locker_t, int);
extern int locker_set_expire_time (locker_t, int);
extern int locker_set_retries (locker_t, int);
extern int locker_set_retry_sleep (locker_t, int);
extern int locker_set_external (locker_t, const char* program);
extern int locker_get_flags (locker_t, int*);
extern int locker_get_expire_time (locker_t, int*);
extern int locker_get_retries (locker_t, int*);
extern int locker_get_retry_sleep (locker_t, int*);
extern int locker_get_external (locker_t, char**);
extern int locker_lock (locker_t);
extern int locker_touchlock (locker_t);
extern int locker_unlock (locker_t);
extern int locker_remove_lock (locker_t);
extern int mu_locker_set_flags (locker_t, int);
extern int mu_locker_set_expire_time (locker_t, int);
extern int mu_locker_set_retries (locker_t, int);
extern int mu_locker_set_retry_sleep (locker_t, int);
extern int mu_locker_set_external (locker_t, const char* program);
extern int mu_locker_get_flags (locker_t, int*);
extern int mu_locker_get_expire_time (locker_t, int*);
extern int mu_locker_get_retries (locker_t, int*);
extern int mu_locker_get_retry_sleep (locker_t, int*);
extern int mu_locker_get_external (locker_t, char**);
extern int mu_locker_lock (locker_t);
extern int mu_locker_touchlock (locker_t);
extern int mu_locker_unlock (locker_t);
extern int mu_locker_remove_lock (locker_t);
#ifdef __cplusplus
}
......
......@@ -34,58 +34,58 @@ const char *mu_folder_directory (void);
int mu_construct_user_mailbox_url (char **pout, const char *name);
/* Constructor/destructor and possible types. */
extern int mailbox_create (mailbox_t *, const char *);
extern void mailbox_destroy (mailbox_t *);
extern int mailbox_create_default (mailbox_t *, const char *);
extern int mailbox_open (mailbox_t, int flag);
extern int mailbox_close (mailbox_t);
extern int mailbox_flush (mailbox_t mbox, int expunge);
extern int mailbox_get_folder (mailbox_t, folder_t *);
extern int mailbox_set_folder (mailbox_t, folder_t);
extern int mailbox_uidvalidity (mailbox_t, unsigned long *);
extern int mailbox_uidnext (mailbox_t, size_t *);
extern int mu_mailbox_create (mailbox_t *, const char *);
extern void mu_mailbox_destroy (mailbox_t *);
extern int mu_mailbox_create_default (mailbox_t *, const char *);
extern int mu_mailbox_open (mailbox_t, int flag);
extern int mu_mailbox_close (mailbox_t);
extern int mu_mailbox_flush (mailbox_t mbox, int expunge);
extern int mu_mailbox_get_folder (mailbox_t, folder_t *);
extern int mu_mailbox_set_folder (mailbox_t, folder_t);
extern int mu_mailbox_uidvalidity (mailbox_t, unsigned long *);
extern int mu_mailbox_uidnext (mailbox_t, size_t *);
/* Messages. */
extern int mailbox_get_message (mailbox_t, size_t msgno, message_t *);
extern int mailbox_append_message (mailbox_t, message_t);
extern int mailbox_messages_count (mailbox_t, size_t *);
extern int mailbox_messages_recent (mailbox_t, size_t *);
extern int mailbox_message_unseen (mailbox_t, size_t *);
extern int mailbox_expunge (mailbox_t);
extern int mailbox_save_attributes (mailbox_t);
extern int mu_mailbox_get_message (mailbox_t, size_t msgno, message_t *);
extern int mu_mailbox_append_message (mailbox_t, message_t);
extern int mu_mailbox_messages_count (mailbox_t, size_t *);
extern int mu_mailbox_messages_recent (mailbox_t, size_t *);
extern int mu_mailbox_message_unseen (mailbox_t, size_t *);
extern int mu_mailbox_expunge (mailbox_t);
extern int mu_mailbox_save_attributes (mailbox_t);
/* Update and scanning. */
extern int mailbox_get_size (mailbox_t, off_t *size);
extern int mailbox_is_updated (mailbox_t);
extern int mailbox_scan (mailbox_t, size_t no, size_t *count);
extern int mu_mailbox_get_size (mailbox_t, off_t *size);
extern int mu_mailbox_is_updated (mailbox_t);
extern int mu_mailbox_scan (mailbox_t, size_t no, size_t *count);
/* Mailbox Stream. */
extern int mailbox_set_stream (mailbox_t, stream_t);
extern int mailbox_get_stream (mailbox_t, stream_t *);
extern int mu_mailbox_set_stream (mailbox_t, stream_t);
extern int mu_mailbox_get_stream (mailbox_t, stream_t *);
/* Lock settings. */
extern int mailbox_get_locker (mailbox_t, locker_t *);
extern int mailbox_set_locker (mailbox_t, locker_t);
extern int mu_mailbox_get_locker (mailbox_t, locker_t *);
extern int mu_mailbox_set_locker (mailbox_t, locker_t);
/* Property. */
extern int mailbox_get_flags (mailbox_t, int *);
extern int mailbox_get_property (mailbox_t, property_t *);
extern int mu_mailbox_get_flags (mailbox_t, int *);
extern int mu_mailbox_get_property (mailbox_t, property_t *);
/* URL. */
extern int mailbox_get_url (mailbox_t, url_t *);
extern int mu_mailbox_get_url (mailbox_t, url_t *);
/* For any debuging */
extern int mailbox_has_debug (mailbox_t);
extern int mailbox_get_debug (mailbox_t, mu_debug_t *);
extern int mailbox_set_debug (mailbox_t, mu_debug_t);
extern int mu_mailbox_has_debug (mailbox_t);
extern int mu_mailbox_get_debug (mailbox_t, mu_debug_t *);
extern int mu_mailbox_set_debug (mailbox_t, mu_debug_t);
/* Events. */
extern int mailbox_get_observable (mailbox_t, observable_t *);
extern int mu_mailbox_get_observable (mailbox_t, observable_t *);
/* Locking */
extern int mailbox_lock (mailbox_t mbox);
extern int mailbox_unlock (mailbox_t mbox);
extern int mu_mailbox_lock (mailbox_t mbox);
extern int mu_mailbox_unlock (mailbox_t mbox);
#ifdef __cplusplus
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004, 2005 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
......@@ -52,7 +52,7 @@ extern int mu_nntp_stls (mu_nntp_t nntp);
extern int mu_nntp_mode_reader (mu_nntp_t nntp);
/* An iterator is return with the multi-line answer. It is the responsibility
of the caller to call iterator_destroy() to dispose of the iterator. */
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_list_extensions (mu_nntp_t nntp, iterator_t *iterator);
extern int mu_nntp_quit (mu_nntp_t nntp);
......@@ -112,7 +112,7 @@ extern int mu_nntp_help (mu_nntp_t nntp, stream_t *stream);
/* An iterator is return with the multi-line answer. It is the responsibility
of the caller to call iterator_destroy() to dispose of the iterator. */
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
unsigned int month, unsigned int day,
unsigned int hour, unsigned int minute,
......@@ -120,7 +120,7 @@ extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
iterator_t *iterator);
/* A iterator is return with the multi-line answer. It is the responsibility
of the caller to call iterator_destroy() to dispose of the iterator. */
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat,
unsigned int year, unsigned int month,
unsigned int day, unsigned int hour,
......@@ -133,7 +133,7 @@ extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid,
/* A iterator is return with the multi-line answer. It is the responsibility
of the caller to call iterator_destroy() to dispose of the iterator. */
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat,
iterator_t *iterator);
extern int mu_nntp_list_active_times (mu_nntp_t nntp,
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2003, 2004,
2005 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
......@@ -50,7 +51,7 @@ extern int mu_pop3_apop (mu_pop3_t pop3, const char *name, const char *
extern int mu_pop3_stls (mu_pop3_t pop3);
/* It is the responsability of the caller to call iterator_destroy() when done
/* It is the responsability of the caller to call mu_iterator_destroy() when done
with the iterator. The items return by the iterator are of type "const char *",
no processing is done on the item except the removal of the trailing newline. */
extern int mu_pop3_capa (mu_pop3_t pop3, iterator_t *iterator);
......@@ -60,7 +61,7 @@ extern int mu_pop3_dele (mu_pop3_t pop3, unsigned int mesgno);
extern int mu_pop3_list (mu_pop3_t pop3, unsigned int mesgno, size_t *mesg_octet);
/* An iterator is return with the multi-line answer. It is the responsability of
the caller to call iterator_destroy() to dispose of the iterator. */
the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_pop3_list_all (mu_pop3_t pop3, iterator_t *piterator);
extern int mu_pop3_noop (mu_pop3_t pop3);
......@@ -85,7 +86,7 @@ extern int mu_pop3_top (mu_pop3_t pop3, unsigned int mesgno, unsigned
to free() the uild when done. */
extern int mu_pop3_uidl (mu_pop3_t pop3, unsigned int mesgno, char **puidl);
/* An iterator is return with the multi-line answer. It is the responsability of
the caller to call iterator_destroy() to dispose of the iterator. */
the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_pop3_uidl_all (mu_pop3_t pop3, iterator_t *piterator);
extern int mu_pop3_user (mu_pop3_t pop3, const char *user);
......
......@@ -32,7 +32,7 @@ struct _body;
struct _debug;
struct _envelope;
struct _filter;
struct _filter_record;
struct mu_filter_record;
struct _folder;
struct _header;
struct _iterator;
......@@ -61,7 +61,7 @@ typedef struct _body *body_t;
typedef struct _debug *mu_debug_t;
typedef struct _envelope *envelope_t;
typedef struct _filter *filter_t;
typedef struct _filter_record *filter_record_t;
typedef struct mu_filter_record *filter_record_t;
typedef struct _folder *folder_t;
typedef struct _header * header_t;
typedef struct _iterator *iterator_t;
......
......@@ -73,7 +73,7 @@ mime_context_fill (struct mime_context *ctx, const char *file,
memset (ctx, 0, sizeof *ctx);
ctx->input = input;
ctx->hdr = hdr;
if (header_aget_value (hdr, MU_HEADER_CONTENT_TYPE,
if (mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE,
&ctx->content_type_buffer))
return 1;
ctx->content_type = strtok_r (ctx->content_type_buffer, ";", &sp);
......@@ -86,24 +86,24 @@ mime_context_fill (struct mime_context *ctx, const char *file,
ctx->flags |= FLAGS_DRY_RUN;
ctx->debug_level = debug_level;
list_create (&ctx->values);
mu_list_create (&ctx->values);
while ((p = strtok_r (NULL, ";", &sp)))
{
while (*p && isspace (*p))
p++;
list_append (ctx->values, p);
mu_list_append (ctx->values, p);
}
if (no_ask)
{
ctx->no_ask_str = xstrdup (no_ask);
list_create (&ctx->no_ask_types);
mu_list_create (&ctx->no_ask_types);
for (p = strtok_r (ctx->no_ask_str, ",", &sp); p;
p = strtok_r (NULL, ",", &sp))
{
while (*p && isspace (*p))
p++;
list_append (ctx->no_ask_types, p);
mu_list_append (ctx->no_ask_types, p);
}
}
return 0;
......@@ -116,9 +116,9 @@ mime_context_release (struct mime_context *ctx)
if (ctx->unlink_temp_file)
unlink (ctx->temp_file);
free (ctx->temp_file);
list_destroy (&ctx->values);
mu_list_destroy (&ctx->values);
free (ctx->no_ask_str);
list_destroy (&ctx->no_ask_types);
mu_list_destroy (&ctx->no_ask_types);
}
static int
......@@ -129,15 +129,15 @@ mime_context_do_not_ask (struct mime_context *ctx)
if (ctx->no_ask_types)
{
iterator_t itr;
list_get_iterator (ctx->no_ask_types, &itr);
for (iterator_first (itr); !rc && !iterator_is_done (itr);
iterator_next (itr))
mu_list_get_iterator (ctx->no_ask_types, &itr);
for (mu_iterator_first (itr); !rc && !mu_iterator_is_done (itr);
mu_iterator_next (itr))
{
char *p;
iterator_current (itr, (void**)&p);
mu_iterator_current (itr, (void**)&p);
rc = fnmatch (p, ctx->content_type, FNM_CASEFOLD) == 0;
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
}
return rc;
}
......@@ -174,12 +174,12 @@ mime_context_get_content_type_value (struct mime_context *ctx,
iterator_t itr = NULL;
int rc = 1;
list_get_iterator (ctx->values, &itr);
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
mu_list_get_iterator (ctx->values, &itr);
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
char *item, *p;
iterator_current (itr, (void**) &item);
mu_iterator_current (itr, (void**) &item);
p = strchr (item, '=');
if (p - item == len && strncasecmp (item, name, len) == 0)
{
......@@ -194,7 +194,7 @@ mime_context_get_content_type_value (struct mime_context *ctx,
break;
}
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
return rc;
}
......@@ -427,7 +427,7 @@ create_filter (char *cmd, int outfd, int *infd)
argv[3] = NULL;
}
else
argcv_get (cmd, "", NULL, &argc, &argv);
mu_argcv_get (cmd, "", NULL, &argc, &argv);
/* Create input channel: */
if (infd)
......@@ -497,12 +497,12 @@ run_test (mu_mailcap_entry_t entry, struct mime_context *ctx)
mu_mailcap_entry_get_test (entry, str, size + 1, NULL);
expand_string (ctx, &str);
argcv_get (str, "", NULL, &argc, &argv);
mu_argcv_get (str, "", NULL, &argc, &argv);
free (str);
if (mu_spawnvp (argv[0], argv, &status))
status = 1;
argcv_free (argc, argv);
mu_argcv_free (argc, argv);
}
return status;
}
......
......@@ -47,13 +47,13 @@ _get_address_part (const char *func_name, address_get_fp fun,
if (length == 0)
return scm_makfrom0str("");
if (address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
return SCM_BOOL_F;
str = malloc (length + 1);
if (!str)
{
address_destroy (&addr);
mu_address_destroy (&addr);
return SCM_BOOL_F;
}
......@@ -61,65 +61,65 @@ _get_address_part (const char *func_name, address_get_fp fun,
ret = scm_makfrom0str (str);
else
ret = SCM_BOOL_F;
address_destroy (&addr);
mu_address_destroy (&addr);
free (str);
return ret;
}
SCM_DEFINE (mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
SCM_DEFINE (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return personal part of an email address.\n")
#define FUNC_NAME s_mu_address_get_personal
#define FUNC_NAME s_scm_mu_address_get_personal
{
return _get_address_part (FUNC_NAME,
address_get_personal, ADDRESS, NUM);
mu_address_get_personal, ADDRESS, NUM);
}
#undef FUNC_NAME
SCM_DEFINE (mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
SCM_DEFINE (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return comment part of an email address.\n")
#define FUNC_NAME s_mu_address_get_comments
#define FUNC_NAME s_scm_mu_address_get_comments
{
return _get_address_part (FUNC_NAME,
address_get_comments, ADDRESS, NUM);
mu_address_get_comments, ADDRESS, NUM);
}
#undef FUNC_NAME
SCM_DEFINE (mu_address_get_email, "mu-address-get-email", 1, 1, 0,
SCM_DEFINE (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return email part of an email address.\n")
#define FUNC_NAME s_mu_address_get_email
#define FUNC_NAME s_scm_mu_address_get_email
{
return _get_address_part (FUNC_NAME,
address_get_email, ADDRESS, NUM);
mu_address_get_email, ADDRESS, NUM);
}
#undef FUNC_NAME
SCM_DEFINE (mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
SCM_DEFINE (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return domain part of an email address.\n")
#define FUNC_NAME s_mu_address_get_domain
#define FUNC_NAME s_scm_mu_address_get_domain
{
return _get_address_part (FUNC_NAME,
address_get_domain, ADDRESS, NUM);
mu_address_get_domain, ADDRESS, NUM);
}
#undef FUNC_NAME
SCM_DEFINE (mu_address_get_local, "mu-address-get-local", 1, 1, 0,
SCM_DEFINE (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
(SCM ADDRESS, SCM NUM),
"Return local part of an email address.\n")
#define FUNC_NAME s_mu_address_get_local
#define FUNC_NAME s_scm_mu_address_get_local
{
return _get_address_part (FUNC_NAME,
address_get_local_part, ADDRESS, NUM);
mu_address_get_local_part, ADDRESS, NUM);
}
#undef FUNC_NAME
SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0,
SCM_DEFINE (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
(SCM ADDRESS),
"Return number of parts in email address.\n")
#define FUNC_NAME s_mu_address_get_count
#define FUNC_NAME s_scm_mu_address_get_count
{
address_t addr;
size_t count = 0;
......@@ -127,20 +127,20 @@ SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0,
SCM_ASSERT (SCM_NIMP (ADDRESS) && SCM_STRINGP (ADDRESS),
ADDRESS, SCM_ARG1, FUNC_NAME);
if (address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
return SCM_MAKINUM(0);
address_get_count (addr, &count);
address_destroy (&addr);
return scm_makenum (count);
mu_address_get_count (addr, &count);
mu_address_destroy (&addr);
return mu_scm_makenum (count);
}
#undef FUNC_NAME
SCM_DEFINE (mu_username_to_email, "mu-username->email", 0, 1, 0,
SCM_DEFINE (scm_mu_username_to_email, "mu-username->email", 0, 1, 0,
(SCM NAME),
"Deduce the email from the username. If NAME is omitted, current username\n"
"is assumed\n")
#define FUNC_NAME s_mu_username_to_email
#define FUNC_NAME s_scm_mu_username_to_email
{
char *name;
char *email;
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2005 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
......@@ -58,10 +58,10 @@ mu_scm_body_print (SCM body_smob, SCM port, scm_print_state * pstate)
size_t b_size = 0, b_lines = 0, len = 0;
char buffer[512];
body_size (mbp->body, &b_size);
body_lines (mbp->body, &b_lines);
mu_body_size (mbp->body, &b_size);
mu_body_lines (mbp->body, &b_lines);
buffer[0] = 0;
body_get_filename (mbp->body, buffer, sizeof (buffer), &len);
mu_body_get_filename (mbp->body, buffer, sizeof (buffer), &len);
scm_puts ("#<body \"", port);
scm_puts (buffer, port);
......@@ -101,10 +101,10 @@ mu_scm_body_create (SCM msg, body_t body)
/* ************************************************************************* */
/* Guile primitives */
SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
(SCM BODY),
"Read next line from the BODY.")
#define FUNC_NAME s_mu_body_read_line
#define FUNC_NAME s_scm_mu_body_read_line
{
struct mu_body *mbp;
int n, nread;
......@@ -114,7 +114,7 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
if (!mbp->stream)
{
if (body_get_stream (mbp->body, &mbp->stream))
if (mu_body_get_stream (mbp->body, &mbp->stream))
return SCM_BOOL_F;
}
......@@ -156,10 +156,10 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0,
SCM_DEFINE (scm_mu_body_write, "mu-body-write", 2, 0, 0,
(SCM BODY, SCM TEXT),
"Append TEXT to message BODY.")
#define FUNC_NAME s_mu_body_write
#define FUNC_NAME s_scm_mu_body_write
{
char *ptr;
size_t len, n;
......@@ -172,7 +172,7 @@ SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0,
if (!mbp->stream)
{
if (body_get_stream (mbp->body, &mbp->stream))
if (mu_body_get_stream (mbp->body, &mbp->stream))
return SCM_BOOL_F;
}
......
......@@ -21,7 +21,7 @@
static void _scheme_main (void *closure, int argc, char **argv);
void
mu_process_mailbox (int argc, char *argv[], guimb_param_t *param)
mu_process_mailbox (int argc, char *argv[], mu_guimb_param_t *param)
{
scm_boot_guile (argc, argv, _scheme_main, param);
}
......@@ -32,14 +32,14 @@ SCM _user_name;
static SCM
catch_body (void *closure)
{
guimb_param_t *param = closure;
mu_guimb_param_t *param = closure;
return param->catch_body (param->data, param->mbox);
}
void
_scheme_main (void *closure, int argc, char **argv)
{
guimb_param_t *param = closure;
mu_guimb_param_t *param = closure;
if (param->debug_guile)
{
......
......@@ -20,10 +20,10 @@
#include <syslog.h>
SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0,
SCM_DEFINE (scm_mu_openlog, "mu-openlog", 3, 0, 0,
(SCM IDENT, SCM OPTION, SCM FACILITY),
"Opens a connection to the system logger for Guile program.")
#define FUNC_NAME s_mu_openlog
#define FUNC_NAME s_scm_mu_openlog
{
char *ident;
int option, facility;
......@@ -56,10 +56,10 @@ SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0,
SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
(SCM PRIO, SCM TEXT),
"Generates a log message to be distributed via syslogd.")
#define FUNC_NAME s_mu_logger
#define FUNC_NAME s_scm_mu_logger
{
int prio;
......@@ -79,10 +79,10 @@ SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_closelog, "mu-closelog", 0, 0, 0,
SCM_DEFINE (scm_mu_closelog, "mu-closelog", 0, 0, 0,
(),
"Closes the channel to the system logger open by mu-openlog.")
#define FUNC_NAME s_mu_closelog
#define FUNC_NAME s_scm_mu_closelog
{
closelog ();
return SCM_UNSPECIFIED;
......
......@@ -38,11 +38,11 @@ static scm_sizet
mu_scm_mailbox_free (SCM mailbox_smob)
{
struct mu_mailbox *mum = (struct mu_mailbox *) SCM_CDR (mailbox_smob);
mailbox_close (mum->mbox);
mailbox_destroy (&mum->mbox);
mu_mailbox_close (mum->mbox);
mu_mailbox_destroy (&mum->mbox);
free (mum);
/* NOTE: Currently there is no way for this function to return the
amount of memory *actually freed* by mailbox_destroy */
amount of memory *actually freed* by mu_mailbox_destroy */
return sizeof (struct mu_mailbox);
}
......@@ -53,8 +53,8 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate)
size_t count = 0;
url_t url = NULL;
mailbox_messages_count (mum->mbox, &count);
mailbox_get_url (mum->mbox, &url);
mu_mailbox_messages_count (mum->mbox, &count);
mu_mailbox_get_url (mum->mbox, &url);
scm_puts ("#<mailbox ", port);
......@@ -134,10 +134,10 @@ SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
SCM_DEFINE (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
(SCM URL, SCM MODE),
"Opens a mailbox specified by URL.")
#define FUNC_NAME s_mu_mailbox_open
#define FUNC_NAME s_scm_mu_mailbox_open
{
mailbox_t mbox = NULL;
char *mode_str;
......@@ -167,12 +167,12 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
if (mode & MU_STREAM_READ && mode & MU_STREAM_WRITE)
mode = (mode & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR;
if (mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0)
if (mu_mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0)
return SCM_BOOL_F;
if (mailbox_open (mbox, mode) != 0)
if (mu_mailbox_open (mbox, mode) != 0)
{
mailbox_destroy (&mbox);
mu_mailbox_destroy (&mbox);
return SCM_BOOL_F;
}
......@@ -180,42 +180,42 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
SCM_DEFINE (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
(SCM MBOX), "Closes mailbox MBOX")
#define FUNC_NAME s_mu_mailbox_close
#define FUNC_NAME s_scm_mu_mailbox_close
{
struct mu_mailbox *mum;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
mailbox_close (mum->mbox);
mailbox_destroy (&mum->mbox);
mu_mailbox_close (mum->mbox);
mu_mailbox_destroy (&mum->mbox);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
(SCM MBOX),
"Returns the URL of the mailbox.")
#define FUNC_NAME s_mu_mailbox_get_url
#define FUNC_NAME s_scm_mu_mailbox_get_url
{
struct mu_mailbox *mum;
url_t url;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
mailbox_get_url (mum->mbox, &url);
mu_mailbox_get_url (mum->mbox, &url);
return scm_makfrom0str (url_to_string (url));
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
(SCM MBOX, SCM MODE),
"Returns a port associated with the contents of the MBOX.\n"
"MODE is a string defining operation mode of the stream. It may\n"
"contain any of the two characters: \"r\" for reading, \"w\" for\n"
"writing.\n")
#define FUNC_NAME s_mu_mailbox_get_port
#define FUNC_NAME s_scm_mu_mailbox_get_port
{
struct mu_mailbox *mum;
stream_t stream;
......@@ -224,16 +224,16 @@ SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
SCM_ASSERT (SCM_NIMP (MODE) && SCM_STRINGP (MODE),
MODE, SCM_ARG2, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
if (mailbox_get_stream (mum->mbox, &stream))
if (mu_mailbox_get_stream (mum->mbox, &stream))
return SCM_BOOL_F;
return mu_port_make_from_stream (MBOX, stream,
scm_mode_bits (SCM_STRING_CHARS (MODE)));
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
SCM_DEFINE (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
(SCM MBOX, SCM MSGNO), "Retrieve from MBOX message # MSGNO.")
#define FUNC_NAME s_mu_mailbox_get_message
#define FUNC_NAME s_scm_mu_mailbox_get_message
{
size_t msgno;
struct mu_mailbox *mum;
......@@ -246,16 +246,16 @@ SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
msgno = SCM_INUM (MSGNO);
if (mailbox_get_message (mum->mbox, msgno, &msg))
if (mu_mailbox_get_message (mum->mbox, msgno, &msg))
return SCM_BOOL_F;
return mu_scm_message_create (MBOX, msg);
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
SCM_DEFINE (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
(SCM MBOX), "Returns number of messages in the mailbox.")
#define FUNC_NAME s_mu_mailbox_messages_count
#define FUNC_NAME s_scm_mu_mailbox_messages_count
{
struct mu_mailbox *mum;
size_t nmesg;
......@@ -263,43 +263,43 @@ SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
if (mailbox_messages_count (mum->mbox, &nmesg))
if (mu_mailbox_messages_count (mum->mbox, &nmesg))
return SCM_BOOL_F;
return scm_makenum (nmesg);
return mu_scm_makenum (nmesg);
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
SCM_DEFINE (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
(SCM MBOX), "Expunges deleted messages from the mailbox.")
#define FUNC_NAME s_mu_mailbox_expunge
#define FUNC_NAME s_scm_mu_mailbox_expunge
{
struct mu_mailbox *mum;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
if (mailbox_expunge (mum->mbox))
if (mu_mailbox_expunge (mum->mbox))
return SCM_BOOL_F;
return SCM_BOOL_T;
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_url, "mu-mailbox-url", 1, 0, 0,
SCM_DEFINE (scm_mu_mailbox_url, "mu-mailbox-url", 1, 0, 0,
(SCM MBOX), "Returns the URL of the mailbox")
#define FUNC_NAME s_mu_mailbox_url
#define FUNC_NAME s_scm_mu_mailbox_url
{
struct mu_mailbox *mum;
url_t url;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
mailbox_get_url (mum->mbox, &url);
mu_mailbox_get_url (mum->mbox, &url);
return scm_makfrom0str (url_to_string (url));
}
#undef FUNC_NAME
SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
SCM_DEFINE (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
(SCM MBOX, SCM MESG), "Appends the message to the mailbox")
#define FUNC_NAME s_mu_mailbox_append_message
#define FUNC_NAME s_scm_mu_mailbox_append_message
{
struct mu_mailbox *mum;
message_t msg;
......@@ -308,7 +308,7 @@ SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME);
mum = (struct mu_mailbox *) SCM_CDR (MBOX);
msg = mu_scm_message_get (MESG);
if (mailbox_append_message (mum->mbox, msg))
if (mu_mailbox_append_message (mum->mbox, msg))
return SCM_BOOL_F;
return SCM_BOOL_T;
}
......
......@@ -88,10 +88,10 @@ mu_scm_is_mime (SCM scm)
/* ************************************************************************* */
/* Guile primitives */
SCM_DEFINE (mu_mime_create, "mu-mime-create", 0, 2, 0,
SCM_DEFINE (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
(SCM FLAGS, SCM MESG),
"Creates a new MIME object.")
#define FUNC_NAME s_mu_mime_create
#define FUNC_NAME s_scm_mu_mime_create
{
message_t msg = NULL;
mime_t mime;
......@@ -122,20 +122,20 @@ SCM_DEFINE (mu_mime_create, "mu-mime-create", 0, 2, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
SCM_DEFINE (scm_mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
(SCM MIME),
"Returns #t if MIME is a multipart object.\n")
#define FUNC_NAME s_mu_mime_multipart_p
#define FUNC_NAME s_scm_mu_mime_multipart_p
{
SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
return mime_is_multipart (mu_scm_mime_get (MIME)) ? SCM_BOOL_T : SCM_BOOL_F;
}
#undef FUNC_NAME
SCM_DEFINE (mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
SCM_DEFINE (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
(SCM MIME),
"Returns number of parts in a MIME object.")
#define FUNC_NAME s_mu_mime_get_num_parts
#define FUNC_NAME s_scm_mu_mime_get_num_parts
{
mime_t mime;
size_t nparts;
......@@ -144,14 +144,14 @@ SCM_DEFINE (mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
mime = mu_scm_mime_get (MIME);
if (mime_get_num_parts (mime, &nparts))
return SCM_BOOL_F;
return scm_makenum (nparts);
return mu_scm_makenum (nparts);
}
#undef FUNC_NAME
SCM_DEFINE (mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
SCM_DEFINE (scm_mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
(SCM MIME, SCM PART),
"Returns part number PART from a MIME object.")
#define FUNC_NAME s_mu_mime_get_part
#define FUNC_NAME s_scm_mu_mime_get_part
{
message_t msg = NULL;
......@@ -165,10 +165,10 @@ SCM_DEFINE (mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
SCM_DEFINE (scm_mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
(SCM MIME, SCM MESG),
"Adds MESG to the MIME object.")
#define FUNC_NAME s_mu_mime_add_part
#define FUNC_NAME s_scm_mu_mime_add_part
{
mime_t mime;
message_t msg;
......@@ -187,10 +187,10 @@ SCM_DEFINE (mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (mu_mime_get_message, "mu-mime-get-message", 1, 0, 0,
SCM_DEFINE (scm_mu_mime_get_message, "mu-mime-get-message", 1, 0, 0,
(SCM MIME),
"Converts MIME object to a message.\n")
#define FUNC_NAME s_mu_mime_get_message
#define FUNC_NAME s_scm_mu_mime_get_message
{
mime_t mime;
message_t msg;
......
......@@ -23,7 +23,7 @@
#endif
SCM
scm_makenum (unsigned long val)
mu_scm_makenum (unsigned long val)
#ifndef HAVE_SCM_LONG2NUM
{
if (SCM_FIXABLE ((long) val))
......@@ -101,7 +101,7 @@ register_format (const char *name)
}
SCM_DEFINE (mu_register_format, "mu-register-format", 0, 0, 1,
SCM_DEFINE (scm_mu_register_format, "mu-register-format", 0, 0, 1,
(SCM REST),
"Registers desired mailutils formats. Takes any number of arguments.\n"
"Allowed arguments are:\n"
......@@ -113,7 +113,7 @@ SCM_DEFINE (mu_register_format, "mu-register-format", 0, 0, 1,
" \"smtp\" smtp mailer\n"
"\n"
"If called without arguments, registers all available formats\n")
#define FUNC_NAME s_mu_register_format
#define FUNC_NAME s_scm_mu_register_format
{
SCM status;
......@@ -163,7 +163,7 @@ mu_scm_init ()
_mu_scm_mailer = scm_makfrom0str ("sendmail:" _PATH_SENDMAIL);
mu_set_variable ("mu-mailer", _mu_scm_mailer);
_mu_scm_debug = scm_makenum(0);
_mu_scm_debug = mu_scm_makenum(0);
mu_set_variable ("mu-debug", _mu_scm_debug);
_mu_scm_package = scm_makfrom0str (PACKAGE);
......
......@@ -18,14 +18,14 @@
#include "mu_scm.h"
SCM_DEFINE (mu_scm_getpwuid, "mu-getpwuid", 1, 0, 0,
SCM_DEFINE (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
(SCM USER),
"Look up an entry in the user database. USER can be an integer,\n"
"or a string, giving the behaviour of mu_get_auth_by_uid or mu_get_auth_by_name\n"
"respectively.\n"
"Returns a vector with fields corresponding to those of the mu_auth_data\n"
"entry in question. If no matching entry was found, returns #f.\n")
#define FUNC_NAME s_mu_scm_getpwuid
#define FUNC_NAME s_scm_mu_getpwuid
{
SCM result;
struct mu_auth_data *entry;
......
## Process this file with GNU Automake to create Makefile.in
## Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
## Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
##
## GNU Mailutils is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
......@@ -58,10 +58,10 @@ EXTRA_DIST = sieve.y sieve.l
sieve-lex.c: $(srcdir)/sieve.l sieve-gram.h
$(YLWRAP) "$(LEX) $(AM_LEXFLAGS) $(LEXFLAGS)" \
$(srcdir)/sieve.l lex.yy.c sieve-lex.c \
-- -yy sieve_yy
-- -yy mu_sieve_yy
sieve-gram.c sieve-gram.h: $(srcdir)/sieve.y
$(YLWRAP) "$(YACC) $(AM_YFLAGS) $(YFLAGS)" $(srcdir)/sieve.y \
y.tab.c sieve-gram.c y.tab.h sieve-gram.h y.output y.output \
-- -yy sieve_yy
-- -yy mu_sieve_yy
......
......@@ -23,8 +23,8 @@
#include <mailutils/argp.h>
#include <string.h>
list_t sieve_include_path = NULL;
list_t sieve_library_path = NULL;
list_t mu_sieve_include_path = NULL;
list_t mu_sieve_library_path = NULL;
static error_t sieve_argp_parser (int key, char *arg, struct argp_state *state);
......@@ -57,22 +57,22 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
switch (key)
{
case 'I':
plist = &sieve_include_path;
plist = &mu_sieve_include_path;
break;
case 'L':
plist = &sieve_library_path;
plist = &mu_sieve_library_path;
break;
case ARGP_KEY_INIT:
#ifdef SIEVE_MODDIR
plist = &sieve_library_path;
plist = &mu_sieve_library_path;
arg = SIEVE_MODDIR;
#endif
break;
case ARGP_KEY_FINI:
sieve_load_add_path (sieve_library_path);
sieve_load_add_path (mu_sieve_library_path);
break;
default:
......@@ -83,7 +83,7 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
{
if (!*plist)
{
int rc = list_create (plist);
int rc = mu_list_create (plist);
if (rc)
{
argp_error (state, "can't create list: %s",
......@@ -91,14 +91,14 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
exit (1);
}
}
list_append (*plist, strdup (arg));
mu_list_append (*plist, strdup (arg));
}
return 0;
}
void
sieve_argp_init ()
mu_sieve_argp_init ()
{
if (mu_register_capa ("sieve", &sieve_argp_child))
{
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2004,
2005 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
......@@ -31,28 +32,28 @@
typedef struct {
const char *name;
int required;
sieve_comparator_t comp[MU_SIEVE_MATCH_LAST];
mu_sieve_comparator_t comp[MU_SIEVE_MATCH_LAST];
} sieve_comparator_record_t;
int
sieve_register_comparator (sieve_machine_t mach,
mu_sieve_register_comparator (mu_sieve_machine_t mach,
const char *name,
int required,
sieve_comparator_t is, sieve_comparator_t contains,
sieve_comparator_t matches,
sieve_comparator_t regex,
sieve_comparator_t eq)
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)
{
sieve_comparator_record_t *rp;
if (!mach->comp_list)
{
int rc = list_create (&mach->comp_list);
int rc = mu_list_create (&mach->comp_list);
if (rc)
return rc;
}
rp = sieve_malloc (mach, sizeof (*rp));
rp = mu_sieve_malloc (mach, sizeof (*rp));
rp->required = required;
rp->name = name;
rp->comp[MU_SIEVE_MATCH_IS] = is;
......@@ -61,7 +62,7 @@ sieve_register_comparator (sieve_machine_t mach,
rp->comp[MU_SIEVE_MATCH_REGEX] = regex;
rp->comp[MU_SIEVE_MATCH_EQ] = eq;
return list_append (mach->comp_list, rp);
return mu_list_append (mach->comp_list, rp);
}
sieve_comparator_record_t *
......@@ -70,28 +71,28 @@ _lookup (list_t list, const char *name)
iterator_t itr;
sieve_comparator_record_t *reg;
if (!list || list_get_iterator (list, &itr))
if (!list || mu_list_get_iterator (list, &itr))
return NULL;
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
iterator_current (itr, (void **)&reg);
mu_iterator_current (itr, (void **)&reg);
if (strcmp (reg->name, name) == 0)
break;
else
reg = NULL;
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
return reg;
}
int
sieve_require_comparator (sieve_machine_t mach, const char *name)
mu_sieve_require_comparator (mu_sieve_machine_t mach, const char *name)
{
sieve_comparator_record_t *reg = _lookup (mach->comp_list, name);
if (!reg)
{
if (!(sieve_load_ext (mach, name) == 0
if (!(mu_sieve_load_ext (mach, name) == 0
&& (reg = _lookup (mach->comp_list, name)) != NULL))
return 1;
}
......@@ -100,8 +101,8 @@ sieve_require_comparator (sieve_machine_t mach, const char *name)
return 0;
}
sieve_comparator_t
sieve_comparator_lookup (sieve_machine_t mach, const char *name, int matchtype)
mu_sieve_comparator_t
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])
......@@ -112,23 +113,23 @@ sieve_comparator_lookup (sieve_machine_t mach, const char *name, int matchtype)
static int
_find_comparator (void *item, void *data)
{
sieve_runtime_tag_t *tag = item;
mu_sieve_runtime_tag_t *tag = item;
if (strcmp (tag->tag, TAG_COMPFUN) == 0)
{
*(sieve_comparator_t*)data = tag->arg->v.ptr;
*(mu_sieve_comparator_t*)data = tag->arg->v.ptr;
return 1;
}
return 0;
}
sieve_comparator_t
sieve_get_comparator (sieve_machine_t mach, list_t tags)
mu_sieve_comparator_t
mu_sieve_get_comparator (mu_sieve_machine_t mach, list_t tags)
{
sieve_comparator_t comp = NULL;
mu_sieve_comparator_t comp = NULL;
list_do (tags, _find_comparator, &comp);
return comp ? comp : sieve_comparator_lookup (mach,
mu_list_do (tags, _find_comparator, &comp);
return comp ? comp : mu_sieve_comparator_lookup (mach,
"i;ascii-casemap",
MU_SIEVE_MATCH_IS);
}
......@@ -157,7 +158,7 @@ _regex_compile (void *item, void *data)
{
struct regex_data *rd = data;
int rc;
regex_t *preg = sieve_malloc (sieve_machine, sizeof (*preg));
regex_t *preg = mu_sieve_malloc (sieve_machine, sizeof (*preg));
rc = regcomp (preg, (char*)item, rd->flags);
if (rc)
......@@ -177,7 +178,7 @@ _regex_compile (void *item, void *data)
return rc;
}
list_append (rd->list, preg);
mu_list_append (rd->list, preg);
return 0;
}
......@@ -193,8 +194,8 @@ static void
_free_reglist (void *data)
{
list_t list = data;
list_do (list, _free_regex, NULL);
list_destroy (&list);
mu_list_do (list, _free_regex, NULL);
mu_list_destroy (&list);
}
static int
......@@ -204,26 +205,26 @@ comp_false (const char *pattern, const char *text)
}
int
sieve_match_part_checker (const char *name, list_t tags, list_t args)
mu_sieve_match_part_checker (const char *name, list_t tags, list_t args)
{
iterator_t itr;
sieve_runtime_tag_t *match = NULL;
sieve_runtime_tag_t *comp = NULL;
sieve_runtime_tag_t *tmp;
sieve_comparator_t compfun = NULL;
mu_sieve_runtime_tag_t *match = NULL;
mu_sieve_runtime_tag_t *comp = NULL;
mu_sieve_runtime_tag_t *tmp;
mu_sieve_comparator_t compfun = NULL;
char *compname = "false";
int matchtype;
int err = 0;
if (!tags || list_get_iterator (tags, &itr))
if (!tags || mu_list_get_iterator (tags, &itr))
return 0;
for (iterator_first (itr); !err && !iterator_is_done (itr);
iterator_next (itr))
for (mu_iterator_first (itr); !err && !mu_iterator_is_done (itr);
mu_iterator_next (itr))
{
sieve_runtime_tag_t *t;
iterator_current (itr, (void **)&t);
mu_sieve_runtime_tag_t *t;
mu_iterator_current (itr, (void **)&t);
if (strcmp (t->tag, "is") == 0
|| strcmp (t->tag, "contains") == 0
......@@ -246,7 +247,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
comp = t;
}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
if (err)
return 1;
......@@ -264,7 +265,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
char *str = match->arg->v.string;
if (strcmp (match->tag, "count") == 0)
{
sieve_value_t *val;
mu_sieve_value_t *val;
char *str;
size_t count;
......@@ -280,18 +281,18 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
matchtype = MU_SIEVE_MATCH_LAST; /* to not leave it undefined */
compfun = comp_false;
val = sieve_value_get (args, 1);
val = mu_sieve_value_get (args, 1);
if (!val)
return 1; /* shouldn't happen */
/* NOTE: Type of v is always SVT_STRING_LIST */
list_count (val->v.list, &count);
mu_list_count (val->v.list, &count);
if (count > 1)
{
sieve_compile_error (sieve_filename, sieve_line_num,
_("second argument must be a list of one element"));
return 1;
}
list_get (val->v.list, 0, (void **) &str);
mu_list_get (val->v.list, 0, (void **) &str);
count = strtoul (str, &str, 10);
if (*str)
{
......@@ -303,7 +304,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
else
matchtype = MU_SIEVE_MATCH_EQ;
if (sieve_str_to_relcmp (str, NULL, NULL))
if (mu_sieve_str_to_relcmp (str, NULL, NULL))
{
sieve_compile_error (sieve_filename, sieve_line_num,
_("invalid relational match `%s' in call to `%s'"),
......@@ -315,7 +316,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
if (!compfun)
{
compname = comp ? comp->arg->v.string : "i;ascii-casemap";
compfun = sieve_comparator_lookup (sieve_machine, compname, matchtype);
compfun = mu_sieve_comparator_lookup (sieve_machine, compname, matchtype);
if (!compfun)
{
sieve_compile_error (sieve_filename, sieve_line_num,
......@@ -325,47 +326,47 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
}
}
tmp = sieve_malloc (sieve_machine, sizeof (*tmp));
tmp = mu_sieve_malloc (sieve_machine, sizeof (*tmp));
tmp->tag = TAG_COMPFUN;
tmp->arg = sieve_value_create (SVT_POINTER, compfun);
list_append (tags, tmp);
tmp->arg = mu_sieve_value_create (SVT_POINTER, compfun);
mu_list_append (tags, tmp);
if (matchtype == MU_SIEVE_MATCH_REGEX)
{
/* To speed up things, compile all patterns at once.
Notice that it is supposed that patterns are in arg 2 */
sieve_value_t *val, *newval;
mu_sieve_value_t *val, *newval;
struct regex_data rd;
int rc;
if (list_get (args, 1, (void**)&val))
if (mu_list_get (args, 1, (void**)&val))
return 0;
rd.flags = REG_EXTENDED;
if (strcmp (compname, "i;ascii-casemap") == 0)
rd.flags |= REG_ICASE;
list_create (&rd.list);
mu_list_create (&rd.list);
rc = sieve_vlist_do (val, _regex_compile, &rd);
rc = mu_sieve_vlist_do (val, _regex_compile, &rd);
sieve_machine_add_destructor (sieve_machine, _free_reglist, rd.list);
mu_sieve_machine_add_destructor (sieve_machine, _free_reglist, rd.list);
if (rc)
return rc;
newval = sieve_value_create (SVT_STRING_LIST, rd.list);
list_replace (args, val, newval);
newval = mu_sieve_value_create (SVT_STRING_LIST, rd.list);
mu_list_replace (args, val, newval);
}
#ifndef FNM_CASEFOLD
else if (matchtype == MU_SIEVE_MATCH_MATCHES
&& strcmp (compname, "i;ascii-casemap") == 0)
{
int rc;
sieve_value_t *val;
mu_sieve_value_t *val;
if (list_get (args, 1, (void**)&val))
if (mu_list_get (args, 1, (void**)&val))
return 0;
rc = sieve_vlist_do (val, _pattern_upcase, NULL);
rc = mu_sieve_vlist_do (val, _pattern_upcase, NULL);
if (rc)
return rc;
}
......@@ -487,9 +488,9 @@ i_ascii_numeric_eq (const char *pattern, const char *text)
}
void
sieve_register_standard_comparators (sieve_machine_t mach)
sieve_register_standard_comparators (mu_sieve_machine_t mach)
{
sieve_register_comparator (mach,
mu_sieve_register_comparator (mach,
"i;octet",
1,
i_octet_is,
......@@ -497,7 +498,7 @@ sieve_register_standard_comparators (sieve_machine_t mach)
i_octet_matches,
i_octet_regex,
i_octet_eq);
sieve_register_comparator (mach,
mu_sieve_register_comparator (mach,
"i;ascii-casemap",
1,
i_ascii_casemap_is,
......@@ -505,7 +506,7 @@ sieve_register_standard_comparators (sieve_machine_t mach)
i_ascii_casemap_matches,
i_ascii_casemap_regex,
i_ascii_casemap_eq);
sieve_register_comparator (mach,
mu_sieve_register_comparator (mach,
"i;ascii-numeric",
0,
i_ascii_numeric_is,
......