Commit 6178304b 6178304b1670d7288d8a37b9165bda5cbc44c180 by Sergey Poznyakoff

Normalize global namespace. Part 1

1 parent ef22616e
Showing 254 changed files with 1088 additions and 978 deletions
1 2005-08-26 Sergey Poznyakoff <gray@gnu.org.ua>
2
3 Normalize global namespace. All exportable symbols begin with mu_.
4 Part 1: Symbols defined in header files address.h, argcv.h,
5 attribute.h, auth.h, body.h, daemon.h, debug.h, envelope.h,
6 errno.h, error.h, filter.h, folder.h, gsasl.h, guile.h, header.h,
7 iterator.h, libsieve.h, list.h, locker.h, mailbox.h.
8
9 Files affected:
10
11 * configure.ac, auth/gsasl.c, auth/radius.c, comsat/action.c,
12 comsat/cfg.c, comsat/comsat.c, dotlock/dotlock.c, examples/addr.c,
13 examples/argcv.c, examples/base64.c, examples/iconv.c,
14 examples/listop.c, examples/mimetest.c, examples/msg-send.c,
15 examples/mta.c, examples/murun.c, examples/nntpclient.c,
16 examples/numaddr.c, examples/pop3client.c, examples/sfrom.c,
17 frm/common.c, frm/frm.c, frm/from.c, guimb/collect.c,
18 guimb/main.c, guimb/util.c, imap4d/append.c, imap4d/auth_gsasl.c,
19 imap4d/authenticate.c, imap4d/bye.c, imap4d/capability.c,
20 imap4d/close.c, imap4d/copy.c, imap4d/expunge.c, imap4d/fetch.c,
21 imap4d/imap4d.c, imap4d/imap4d.h, imap4d/rename.c,
22 imap4d/search.c, imap4d/select.c, imap4d/status.c, imap4d/store.c,
23 imap4d/sync.c, imap4d/util.c, include/mailutils/address.h,
24 include/mailutils/argcv.h, include/mailutils/attribute.h,
25 include/mailutils/auth.h, include/mailutils/body.h,
26 include/mailutils/daemon.h, include/mailutils/envelope.h,
27 include/mailutils/error.h, include/mailutils/filter.h,
28 include/mailutils/folder.h, include/mailutils/gsasl.h,
29 include/mailutils/guile.h, include/mailutils/header.h,
30 include/mailutils/iterator.h, include/mailutils/libsieve.h,
31 include/mailutils/list.h, include/mailutils/locker.h,
32 include/mailutils/mailbox.h, include/mailutils/nntp.h,
33 include/mailutils/pop3.h, include/mailutils/types.h,
34 lib/mailcap.c, libmu_scm/mu_address.c, libmu_scm/mu_body.c,
35 libmu_scm/mu_guimb.c, libmu_scm/mu_logger.c,
36 libmu_scm/mu_mailbox.c, libmu_scm/mu_message.c,
37 libmu_scm/mu_mime.c, libmu_scm/mu_scm.c, libmu_scm/mu_util.c,
38 libsieve/Makefile.am, libsieve/actions.c, libsieve/argp.c,
39 libsieve/comparator.c, libsieve/load.c, libsieve/prog.c,
40 libsieve/register.c, libsieve/relational.c, libsieve/require.c,
41 libsieve/runtime.c, libsieve/sieve.h, libsieve/sieve.l,
42 libsieve/sieve.y, libsieve/tests.c, libsieve/util.c,
43 libsieve/extensions/list.c, libsieve/extensions/spamd.c,
44 libsieve/extensions/timestamp.c, libsieve/extensions/vacation.c,
45 m4/longdouble.m4, m4/signed.m4, m4/size_max.m4, m4/wchar_t.m4,
46 m4/wint_t.m4, m4/xsize.m4, mail/alias.c, mail/copy.c,
47 mail/decode.c, mail/delete.c, mail/escape.c, mail/exit.c,
48 mail/file.c, mail/followup.c, mail/from.c, mail/hold.c,
49 mail/inc.c, mail/mail.c, mail/mailline.c, mail/mbox.c,
50 mail/msgset.y, mail/next.c, mail/page.c, mail/print.c,
51 mail/quit.c, mail/reply.c, mail/retain.c, mail/send.c,
52 mail/shell.c, mail/summary.c, mail/tag.c, mail/touch.c,
53 mail/undelete.c, mail/util.c, mail/write.c, mail.local/main.c,
54 mail.local/script.c, mail.remote/mail.remote.c,
55 mailbox/Makefile.am, mailbox/address.c, mailbox/amd.c,
56 mailbox/argcv.c, mailbox/attachment.c, mailbox/attribute.c,
57 mailbox/auth.c, mailbox/body.c, mailbox/daemon.c,
58 mailbox/envelope.c, mailbox/file_stream.c, mailbox/filter.c,
59 mailbox/filter_iconv.c, mailbox/filter_rfc822.c,
60 mailbox/filter_trans.c, mailbox/folder.c, mailbox/header.c,
61 mailbox/iterator.c, mailbox/list.c, mailbox/locker.c,
62 mailbox/mailbox.c, mailbox/mailer.c, mailbox/mbx_default.c,
63 mailbox/message.c, mailbox/mime.c, mailbox/mu_argp.c,
64 mailbox/mu_auth.c, mailbox/muerror.c, mailbox/mutil.c,
65 mailbox/observer.c, mailbox/parse822.c, mailbox/registrar.c,
66 mailbox/rfc2047.c, mailbox/sendmail.c, mailbox/smtp.c,
67 mailbox/ticket.c, mailbox/wicket.c, mailbox/imap/Makefile.am,
68 mailbox/imap/folder.c, mailbox/imap/mbox.c, mailbox/include/amd.h,
69 mailbox/include/folder0.h, mailbox/include/imap0.h,
70 mailbox/include/list0.h, mailbox/include/mime0.h,
71 mailbox/maildir/Makefile.am, mailbox/maildir/mbox.c,
72 mailbox/mbox/Makefile.am, mailbox/mbox/folder.c,
73 mailbox/mbox/mbox.c, mailbox/mbox/mboxscan.c,
74 mailbox/mh/Makefile.am, mailbox/mh/folder.c, mailbox/mh/mbox.c,
75 mailbox/nntp/Makefile.am, mailbox/nntp/folder.c,
76 mailbox/nntp/mbox.c, mailbox/nntp/nntp_iterator.c,
77 mailbox/nntp/nntp_list_active.c,
78 mailbox/nntp/nntp_list_distribpats.c,
79 mailbox/nntp/nntp_list_distributions.c,
80 mailbox/nntp/nntp_list_extensions.c,
81 mailbox/nntp/nntp_list_newsgroups.c,
82 mailbox/nntp/nntp_list_times.c, mailbox/pop/Makefile.am,
83 mailbox/pop/folder.c, mailbox/pop/mbox.c, mailbox/pop/pop3_capa.c,
84 mailbox/pop/pop3_iterator.c, messages/messages.c, mh/ali.c,
85 mh/anno.c, mh/comp.c, mh/folder.c, mh/forw.c, mh/inc.c, mh/mark.c,
86 mh/mh_alias.y, mh/mh_argp.c, mh/mh_ctx.c, mh/mh_format.c,
87 mh/mh_init.c, mh/mh_list.c, mh/mh_msgset.c, mh/mh_sequence.c,
88 mh/mh_stream.c, mh/mh_whatnow.c, mh/mh_whom.c, mh/mhn.c,
89 mh/mhpath.c, mh/pick.c, mh/pick.y, mh/refile.c, mh/repl.c,
90 mh/rmf.c, mh/rmm.c, mh/scan.c, mh/send.c, mh/sortm.c,
91 mimeview/mimetypes.y, mimeview/mimeview.c, movemail/movemail.c,
92 pop3d/apop.c, pop3d/dele.c, pop3d/expire.c, pop3d/extra.c,
93 pop3d/list.c, pop3d/lock.c, pop3d/pop3d.c, pop3d/popauth.c,
94 pop3d/quit.c, pop3d/retr.c, pop3d/rset.c, pop3d/stat.c,
95 pop3d/top.c, pop3d/uidl.c, pop3d/user.c, readmsg/msglist.c,
96 readmsg/readmsg.c, sieve/sieve.c, sql/odbc.c.
97
1 2005-08-24 Sergey Poznyakoff <gray@gnu.org.ua> 98 2005-08-24 Sergey Poznyakoff <gray@gnu.org.ua>
2 99
3 * scripts/ylwrap: Updated from Radius repository 100 * scripts/ylwrap: Updated from Radius repository
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2003, 2004 Free Software Foundation, Inc. 2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 modify it under the terms of the GNU Lesser General Public
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
36 #include <gsasl.h> 36 #include <gsasl.h>
37 #include <lbuf.h> 37 #include <lbuf.h>
38 38
39 char *gsasl_cram_md5_pwd = SITE_CRAM_MD5_PWD; 39 char *mu_gsasl_cram_md5_pwd = SITE_CRAM_MD5_PWD;
40 40
41 #define ARG_CRAM_PASSWD 1 41 #define ARG_CRAM_PASSWD 1
42 42
...@@ -53,7 +53,7 @@ _gsasl_argp_parser (int key, char *arg, struct argp_state *state) ...@@ -53,7 +53,7 @@ _gsasl_argp_parser (int key, char *arg, struct argp_state *state)
53 switch (key) 53 switch (key)
54 { 54 {
55 case ARG_CRAM_PASSWD: 55 case ARG_CRAM_PASSWD:
56 gsasl_cram_md5_pwd = arg; 56 mu_gsasl_cram_md5_pwd = arg;
57 break; 57 break;
58 58
59 default: 59 default:
...@@ -271,7 +271,7 @@ _gsasl_wait (stream_t stream, int *pflags, struct timeval *tvp) ...@@ -271,7 +271,7 @@ _gsasl_wait (stream_t stream, int *pflags, struct timeval *tvp)
271 } 271 }
272 272
273 int 273 int
274 gsasl_stream_create (stream_t *stream, stream_t transport, 274 mu_gsasl_stream_create (stream_t *stream, stream_t transport,
275 Gsasl_session_ctx *ctx, int flags) 275 Gsasl_session_ctx *ctx, int flags)
276 { 276 {
277 struct _gsasl_stream *s; 277 struct _gsasl_stream *s;
......
...@@ -120,7 +120,7 @@ parse_pairlist (grad_avp_t **plist, const char *input, ...@@ -120,7 +120,7 @@ parse_pairlist (grad_avp_t **plist, const char *input,
120 if (!input) 120 if (!input)
121 return 1; 121 return 1;
122 122
123 if ((rc = argcv_get (input, ",", NULL, &argc, &argv))) 123 if ((rc = mu_argcv_get (input, ",", NULL, &argc, &argv)))
124 argp_error (argp_state, _("Cannot parse input `%s': %s"), 124 argp_error (argp_state, _("Cannot parse input `%s': %s"),
125 input, mu_strerror (rc)); 125 input, mu_strerror (rc));
126 126
...@@ -163,7 +163,7 @@ parse_pairlist (grad_avp_t **plist, const char *input, ...@@ -163,7 +163,7 @@ parse_pairlist (grad_avp_t **plist, const char *input,
163 if (state != state_delim && state != state_delim) 163 if (state != state_delim && state != state_delim)
164 argp_error (argp_state, _("malformed radius A/V list")); 164 argp_error (argp_state, _("malformed radius A/V list"));
165 165
166 argcv_free (argc, argv); 166 mu_argcv_free (argc, argv);
167 return 0; 167 return 0;
168 } 168 }
169 169
......
...@@ -123,7 +123,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk) ...@@ -123,7 +123,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
123 memcpy (namep, start, len); 123 memcpy (namep, start, len);
124 namep[len] = 0; 124 namep[len] = 0;
125 if (message_get_header (msg, &hdr) == 0 125 if (message_get_header (msg, &hdr) == 0
126 && header_aget_value (hdr, namep, &sval) == 0) 126 && mu_header_aget_value (hdr, namep, &sval) == 0)
127 { 127 {
128 len = strlen (sval); 128 len = strlen (sval);
129 obstack_grow (stk, sval, len); 129 obstack_grow (stk, sval, len);
...@@ -148,7 +148,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk) ...@@ -148,7 +148,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
148 if (lncount == 0) 148 if (lncount == 0)
149 lncount = maxlines; 149 lncount = maxlines;
150 if (message_get_body (msg, &body) == 0 150 if (message_get_body (msg, &body) == 0
151 && body_get_stream (body, &stream) == 0) 151 && mu_body_get_stream (body, &stream) == 0)
152 { 152 {
153 size_t nread; 153 size_t nread;
154 char *buf = malloc (size+1); 154 char *buf = malloc (size+1);
...@@ -198,7 +198,7 @@ expand_line (const char *str, message_t msg) ...@@ -198,7 +198,7 @@ expand_line (const char *str, message_t msg)
198 p++; 198 p++;
199 if (*p) 199 if (*p)
200 { 200 {
201 c = argcv_unquote_char (*p); 201 c = mu_argcv_unquote_char (*p);
202 obstack_1grow (&stk, c); 202 obstack_1grow (&stk, c);
203 } 203 }
204 break; 204 break;
...@@ -353,12 +353,12 @@ run_user_action (FILE *tty, const char *cr, message_t msg) ...@@ -353,12 +353,12 @@ run_user_action (FILE *tty, const char *cr, message_t msg)
353 str = expand_line (stmt, msg); 353 str = expand_line (stmt, msg);
354 if (!str) 354 if (!str)
355 continue; 355 continue;
356 if (argcv_get (str, "", NULL, &argc, &argv) 356 if (mu_argcv_get (str, "", NULL, &argc, &argv)
357 || argc == 0 357 || argc == 0
358 || argv[0][0] == '#') 358 || argv[0][0] == '#')
359 { 359 {
360 free (str); 360 free (str);
361 argcv_free (argc, argv); 361 mu_argcv_free (argc, argv);
362 continue; 362 continue;
363 } 363 }
364 364
......
1 /* Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. 1 /* Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
2 2
3 This file is part of GNU Inetutils. 3 This file is part of GNU Inetutils.
4 4
...@@ -160,11 +160,11 @@ read_config (const char *config_file) ...@@ -160,11 +160,11 @@ read_config (const char *config_file)
160 if (!*ptr || *ptr == '#') 160 if (!*ptr || *ptr == '#')
161 continue; 161 continue;
162 162
163 argcv_get (ptr, "", NULL, &argc, &argv); 163 mu_argcv_get (ptr, "", NULL, &argc, &argv);
164 if (argc < 2) 164 if (argc < 2)
165 { 165 {
166 syslog (LOG_ERR, _("%s:%d: too few fields"), config_file, line); 166 syslog (LOG_ERR, _("%s:%d: too few fields"), config_file, line);
167 argcv_free (argc, argv); 167 mu_argcv_free (argc, argv);
168 continue; 168 continue;
169 } 169 }
170 170
...@@ -196,7 +196,7 @@ read_config (const char *config_file) ...@@ -196,7 +196,7 @@ read_config (const char *config_file)
196 else 196 else
197 { 197 {
198 syslog (LOG_ERR, _("%s:%d: unknown keyword"), config_file, line); 198 syslog (LOG_ERR, _("%s:%d: unknown keyword"), config_file, line);
199 argcv_free (argc, argv); 199 mu_argcv_free (argc, argv);
200 continue; 200 continue;
201 } 201 }
202 202
...@@ -217,7 +217,7 @@ read_config (const char *config_file) ...@@ -217,7 +217,7 @@ read_config (const char *config_file)
217 tail = cur; 217 tail = cur;
218 } 218 }
219 219
220 argcv_free (argc, argv); 220 mu_argcv_free (argc, argv);
221 221
222 acl = malloc (sizeof *acl); 222 acl = malloc (sizeof *acl);
223 if (!acl) 223 if (!acl)
......
...@@ -450,15 +450,15 @@ notify_user (const char *user, const char *device, const char *path, off_t offse ...@@ -450,15 +450,15 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
450 return; 450 return;
451 } 451 }
452 452
453 if ((status = mailbox_create (&mbox, path)) != 0 453 if ((status = mu_mailbox_create (&mbox, path)) != 0
454 || (status = mailbox_open (mbox, MU_STREAM_READ)) != 0) 454 || (status = mu_mailbox_open (mbox, MU_STREAM_READ)) != 0)
455 { 455 {
456 syslog (LOG_ERR, _("Cannot open mailbox %s: %s"), 456 syslog (LOG_ERR, _("Cannot open mailbox %s: %s"),
457 path, mu_strerror (status)); 457 path, mu_strerror (status));
458 return; 458 return;
459 } 459 }
460 460
461 if ((status = mailbox_get_stream (mbox, &stream))) 461 if ((status = mu_mailbox_get_stream (mbox, &stream)))
462 { 462 {
463 syslog (LOG_ERR, _("Cannot get stream for mailbox %s: %s"), 463 syslog (LOG_ERR, _("Cannot get stream for mailbox %s: %s"),
464 path, mu_strerror (status)); 464 path, mu_strerror (status));
...@@ -481,8 +481,8 @@ notify_user (const char *user, const char *device, const char *path, off_t offse ...@@ -481,8 +481,8 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
481 stream_read (stream, blurb, size, offset, &n); 481 stream_read (stream, blurb, size, offset, &n);
482 blurb[size] = 0; 482 blurb[size] = 0;
483 483
484 if ((status = mailbox_create (&tmp, "/dev/null")) != 0 484 if ((status = mu_mailbox_create (&tmp, "/dev/null")) != 0
485 || (status = mailbox_open (tmp, MU_STREAM_READ)) != 0) 485 || (status = mu_mailbox_open (tmp, MU_STREAM_READ)) != 0)
486 { 486 {
487 syslog (LOG_ERR, _("Cannot create temporary mailbox: %s"), 487 syslog (LOG_ERR, _("Cannot create temporary mailbox: %s"),
488 mu_strerror (status)); 488 mu_strerror (status));
...@@ -497,9 +497,9 @@ notify_user (const char *user, const char *device, const char *path, off_t offse ...@@ -497,9 +497,9 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
497 } 497 }
498 498
499 stream_write (stream, blurb, size, 0, &count); 499 stream_write (stream, blurb, size, 0, &count);
500 mailbox_set_stream (tmp, stream); 500 mu_mailbox_set_stream (tmp, stream);
501 mailbox_messages_count (tmp, &count); 501 mu_mailbox_messages_count (tmp, &count);
502 mailbox_get_message (tmp, 1, &msg); 502 mu_mailbox_get_message (tmp, 1, &msg);
503 503
504 run_user_action (fp, cr, msg); 504 run_user_action (fp, cr, msg);
505 fclose (fp); 505 fclose (fp);
......
...@@ -26,6 +26,14 @@ gl_USE_SYSTEM_EXTENSIONS ...@@ -26,6 +26,14 @@ gl_USE_SYSTEM_EXTENSIONS
26 26
27 AC_PREREQ(2.59) 27 AC_PREREQ(2.59)
28 28
29 dnl Library versioning
30 VI_CURRENT=0
31 VI_REVISION=0
32 VI_AGE=0
33 AC_SUBST(VI_CURRENT)
34 AC_SUBST(VI_REVISION)
35 AC_SUBST(VI_AGE)
36
29 dnl Check for programs 37 dnl Check for programs
30 AC_PROG_CC 38 AC_PROG_CC
31 AC_PROG_INSTALL 39 AC_PROG_INSTALL
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -143,32 +143,32 @@ main (int argc, char *argv[]) ...@@ -143,32 +143,32 @@ main (int argc, char *argv[])
143 argp_err_exit_status = MU_DL_EX_ERROR; 143 argp_err_exit_status = MU_DL_EX_ERROR;
144 argp_parse (&argp, argc, argv, 0, NULL, NULL); 144 argp_parse (&argp, argc, argv, 0, NULL, NULL);
145 145
146 if ((err = locker_create (&locker, file, flags))) 146 if ((err = mu_locker_create (&locker, file, flags)))
147 { 147 {
148 if (debug) 148 if (debug)
149 fprintf (stderr, _("Creating locker failed: %s\n"), mu_strerror (err)); 149 fprintf (stderr, _("Creating locker failed: %s\n"), mu_strerror (err));
150 return MU_DL_EX_ERROR; 150 return MU_DL_EX_ERROR;
151 } 151 }
152 152
153 locker_set_flags (locker, flags); 153 mu_locker_set_flags (locker, flags);
154 154
155 if (force != 0) 155 if (force != 0)
156 locker_set_expire_time (locker, force); 156 mu_locker_set_expire_time (locker, force);
157 157
158 if (retries != 0) 158 if (retries != 0)
159 locker_set_retries (locker, retries); 159 mu_locker_set_retries (locker, retries);
160 160
161 if (setegid (mailgid) < 0) 161 if (setegid (mailgid) < 0)
162 return MU_DL_EX_ERROR; 162 return MU_DL_EX_ERROR;
163 163
164 if (unlock) 164 if (unlock)
165 err = locker_remove_lock (locker); 165 err = mu_locker_remove_lock (locker);
166 else 166 else
167 err = locker_lock (locker); 167 err = mu_locker_lock (locker);
168 168
169 setegid(usergid); 169 setegid(usergid);
170 170
171 locker_destroy (&locker); 171 mu_locker_destroy (&locker);
172 172
173 if (debug && err) 173 if (debug && err)
174 fprintf (stderr, 174 fprintf (stderr,
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -36,8 +36,8 @@ parse (const char *str) ...@@ -36,8 +36,8 @@ parse (const char *str)
36 address_t address = NULL; 36 address_t address = NULL;
37 37
38 mu_set_user_email_domain ("localhost"); 38 mu_set_user_email_domain ("localhost");
39 status = address_create (&address, str); 39 status = mu_address_create (&address, str);
40 address_get_count (address, &pcount); 40 mu_address_get_count (address, &pcount);
41 41
42 if (status) 42 if (status)
43 { 43 {
...@@ -54,45 +54,45 @@ parse (const char *str) ...@@ -54,45 +54,45 @@ parse (const char *str)
54 size_t got = 0; 54 size_t got = 0;
55 int isgroup; 55 int isgroup;
56 56
57 address_is_group (address, no, &isgroup); 57 mu_address_is_group (address, no, &isgroup);
58 printf ("%lu ", (unsigned long) no); 58 printf ("%lu ", (unsigned long) no);
59 59
60 if (isgroup) 60 if (isgroup)
61 { 61 {
62 address_get_personal (address, no, buf, sizeof (buf), &got); 62 mu_address_get_personal (address, no, buf, sizeof (buf), &got);
63 printf ("group <%s>\n", buf); 63 printf ("group <%s>\n", buf);
64 } 64 }
65 else 65 else
66 { 66 {
67 address_get_email (address, no, buf, sizeof (buf), 0); 67 mu_address_get_email (address, no, buf, sizeof (buf), 0);
68 printf ("email <%s>\n", buf); 68 printf ("email <%s>\n", buf);
69 } 69 }
70 70
71 address_get_personal (address, no, buf, sizeof (buf), &got); 71 mu_address_get_personal (address, no, buf, sizeof (buf), &got);
72 if (got && !isgroup) 72 if (got && !isgroup)
73 printf (" personal <%s>\n", buf); 73 printf (" personal <%s>\n", buf);
74 74
75 address_get_comments (address, no, buf, sizeof (buf), &got); 75 mu_address_get_comments (address, no, buf, sizeof (buf), &got);
76 if (got) 76 if (got)
77 printf (" comments <%s>\n", buf); 77 printf (" comments <%s>\n", buf);
78 78
79 address_get_local_part (address, no, buf, sizeof (buf), &got); 79 mu_address_get_local_part (address, no, buf, sizeof (buf), &got);
80 if (got) 80 if (got)
81 { 81 {
82 printf (" local-part <%s>", buf); 82 printf (" local-part <%s>", buf);
83 83
84 address_get_domain (address, no, buf, sizeof (buf), &got); 84 mu_address_get_domain (address, no, buf, sizeof (buf), &got);
85 if (got) 85 if (got)
86 printf (" domain <%s>", buf); 86 printf (" domain <%s>", buf);
87 87
88 printf ("\n"); 88 printf ("\n");
89 } 89 }
90 90
91 address_get_route (address, no, buf, sizeof (buf), &got); 91 mu_address_get_route (address, no, buf, sizeof (buf), &got);
92 if (got) 92 if (got)
93 printf (" route <%s>\n", buf); 93 printf (" route <%s>\n", buf);
94 } 94 }
95 address_destroy (&address); 95 mu_address_destroy (&address);
96 96
97 printf ("\n"); 97 printf ("\n");
98 return 0; 98 return 0;
......
...@@ -38,13 +38,13 @@ main(int argc, char **argv) ...@@ -38,13 +38,13 @@ main(int argc, char **argv)
38 char **v; 38 char **v;
39 char *s; 39 char *s;
40 40
41 status = argcv_get (buf, delim, comment, &c, &v); 41 status = mu_argcv_get (buf, delim, comment, &c, &v);
42 if (status) 42 if (status)
43 { 43 {
44 fprintf (stderr, "cannot parse: %s\n", mu_strerror (status)); 44 fprintf (stderr, "cannot parse: %s\n", mu_strerror (status));
45 continue; 45 continue;
46 } 46 }
47 status = argcv_string (c, v, &s); 47 status = mu_argcv_string (c, v, &s);
48 if (status) 48 if (status)
49 fprintf (stderr, "cannot create string: %s\n", mu_strerror (status)); 49 fprintf (stderr, "cannot create string: %s\n", mu_strerror (status));
50 else 50 else
...@@ -52,7 +52,7 @@ main(int argc, char **argv) ...@@ -52,7 +52,7 @@ main(int argc, char **argv)
52 printf ("%d: %s\n", c, s); 52 printf ("%d: %s\n", c, s);
53 free (s); 53 free (s);
54 } 54 }
55 argcv_free (c, v); 55 mu_argcv_free (c, v);
56 } 56 }
57 free (buf); 57 free (buf);
58 exit (0); 58 exit (0);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -81,7 +81,7 @@ main (int argc, char * argv []) ...@@ -81,7 +81,7 @@ main (int argc, char * argv [])
81 else 81 else
82 c = stdio_stream_create (&in, stdin, 0); 82 c = stdio_stream_create (&in, stdin, 0);
83 assert (c == 0); 83 assert (c == 0);
84 assert (filter_create (&flt, in, encoding, mode, MU_STREAM_READ) == 0); 84 assert (mu_filter_create (&flt, in, encoding, mode, MU_STREAM_READ) == 0);
85 assert (stream_open (in) == 0); 85 assert (stream_open (in) == 0);
86 86
87 if (output) 87 if (output)
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2004 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -43,7 +43,7 @@ main (int argc, char **argv) ...@@ -43,7 +43,7 @@ main (int argc, char **argv)
43 rc = stdio_stream_create (&in, stdin, 0); 43 rc = stdio_stream_create (&in, stdin, 0);
44 assert (rc == 0); 44 assert (rc == 0);
45 assert (stream_open (in) == 0); 45 assert (stream_open (in) == 0);
46 assert (filter_iconv_create (&cvt, in, argv[1], argv[2], 0, mu_fallback_none) == 0); 46 assert (mu_filter_iconv_create (&cvt, in, argv[1], argv[2], 0, mu_fallback_none) == 0);
47 assert (stream_open (cvt) == 0); 47 assert (stream_open (cvt) == 0);
48 48
49 rc = stdio_stream_create (&out, stdout, 0); 49 rc = stdio_stream_create (&out, stdout, 0);
......
...@@ -42,20 +42,20 @@ print (list_t list) ...@@ -42,20 +42,20 @@ print (list_t list)
42 iterator_t itr; 42 iterator_t itr;
43 int rc; 43 int rc;
44 44
45 rc = list_get_iterator (list, &itr); 45 rc = mu_list_get_iterator (list, &itr);
46 if (rc) 46 if (rc)
47 lperror ("list_get_iterator", rc); 47 lperror ("mu_list_get_iterator", rc);
48 48
49 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 49 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
50 { 50 {
51 char *text; 51 char *text;
52 52
53 rc = iterator_current (itr, (void**) &text); 53 rc = mu_iterator_current (itr, (void**) &text);
54 if (rc) 54 if (rc)
55 lperror ("iterator_current", rc); 55 lperror ("mu_iterator_current", rc);
56 printf ("%s\n", text); 56 printf ("%s\n", text);
57 } 57 }
58 iterator_destroy (&itr); 58 mu_iterator_destroy (&itr);
59 } 59 }
60 60
61 void 61 void
...@@ -66,7 +66,7 @@ next (iterator_t itr, char *arg) ...@@ -66,7 +66,7 @@ next (iterator_t itr, char *arg)
66 if (skip == 0) 66 if (skip == 0)
67 fprintf (stderr, "next arg?\n"); 67 fprintf (stderr, "next arg?\n");
68 while (skip--) 68 while (skip--)
69 iterator_next (itr); 69 mu_iterator_next (itr);
70 } 70 }
71 71
72 void 72 void
...@@ -82,9 +82,9 @@ delete (list_t list, int argc, char **argv) ...@@ -82,9 +82,9 @@ delete (list_t list, int argc, char **argv)
82 82
83 while (--argc) 83 while (--argc)
84 { 84 {
85 rc = list_remove (list, strdup (*++argv)); 85 rc = mu_list_remove (list, strdup (*++argv));
86 if (rc) 86 if (rc)
87 fprintf (stderr, "list_remove(%s): %s\n", *argv, mu_strerror (rc)); 87 fprintf (stderr, "mu_list_remove(%s): %s\n", *argv, mu_strerror (rc));
88 } 88 }
89 } 89 }
90 90
...@@ -101,9 +101,9 @@ add (list_t list, int argc, char **argv) ...@@ -101,9 +101,9 @@ add (list_t list, int argc, char **argv)
101 101
102 while (--argc) 102 while (--argc)
103 { 103 {
104 rc = list_append (list, strdup (*++argv)); 104 rc = mu_list_append (list, strdup (*++argv));
105 if (rc) 105 if (rc)
106 fprintf (stderr, "list_append: %s\n", mu_strerror (rc)); 106 fprintf (stderr, "mu_list_append: %s\n", mu_strerror (rc));
107 } 107 }
108 } 108 }
109 109
...@@ -120,9 +120,9 @@ prep (list_t list, int argc, char **argv) ...@@ -120,9 +120,9 @@ prep (list_t list, int argc, char **argv)
120 120
121 while (--argc) 121 while (--argc)
122 { 122 {
123 rc = list_prepend (list, strdup (*++argv)); 123 rc = mu_list_prepend (list, strdup (*++argv));
124 if (rc) 124 if (rc)
125 fprintf (stderr, "list_append: %s\n", mu_strerror (rc)); 125 fprintf (stderr, "mu_list_append: %s\n", mu_strerror (rc));
126 } 126 }
127 } 127 }
128 128
...@@ -156,9 +156,9 @@ ins (list_t list, int argc, char **argv) ...@@ -156,9 +156,9 @@ ins (list_t list, int argc, char **argv)
156 new_item = argv[2]; 156 new_item = argv[2];
157 } 157 }
158 158
159 rc = list_insert (list, item, strdup (new_item), argc == 4); 159 rc = mu_list_insert (list, item, strdup (new_item), argc == 4);
160 if (rc) 160 if (rc)
161 fprintf (stderr, "list_insert: %s\n", mu_strerror (rc)); 161 fprintf (stderr, "mu_list_insert: %s\n", mu_strerror (rc));
162 } 162 }
163 163
164 164
...@@ -173,9 +173,9 @@ repl (list_t list, int argc, char **argv) ...@@ -173,9 +173,9 @@ repl (list_t list, int argc, char **argv)
173 return; 173 return;
174 } 174 }
175 175
176 rc = list_replace (list, argv[1], strdup (argv[2])); 176 rc = mu_list_replace (list, argv[1], strdup (argv[2]));
177 if (rc) 177 if (rc)
178 fprintf (stderr, "list_replace: %s\n", mu_strerror (rc)); 178 fprintf (stderr, "mu_list_replace: %s\n", mu_strerror (rc));
179 } 179 }
180 180
181 #define NITR 4 181 #define NITR 4
...@@ -211,23 +211,23 @@ find (iterator_t itr, char *arg) ...@@ -211,23 +211,23 @@ find (iterator_t itr, char *arg)
211 return; 211 return;
212 } 212 }
213 213
214 iterator_current (itr, (void**)&text); 214 mu_iterator_current (itr, (void**)&text);
215 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 215 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
216 { 216 {
217 char *item; 217 char *item;
218 218
219 iterator_current (itr, (void**)&item); 219 mu_iterator_current (itr, (void**)&item);
220 if (strcmp (arg, item) == 0) 220 if (strcmp (arg, item) == 0)
221 return; 221 return;
222 } 222 }
223 223
224 fprintf (stderr, "%s not in list\n", arg); 224 fprintf (stderr, "%s not in list\n", arg);
225 225
226 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 226 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
227 { 227 {
228 char *item; 228 char *item;
229 229
230 iterator_current (itr, (void**)&item); 230 mu_iterator_current (itr, (void**)&item);
231 if (strcmp (text, item) == 0) 231 if (strcmp (text, item) == 0)
232 return; 232 return;
233 } 233 }
...@@ -260,10 +260,10 @@ shell (list_t list) ...@@ -260,10 +260,10 @@ shell (list_t list)
260 260
261 for (num = 0; num < NITR; num++) 261 for (num = 0; num < NITR; num++)
262 { 262 {
263 rc = list_get_iterator (list, &itr[num]); 263 rc = mu_list_get_iterator (list, &itr[num]);
264 if (rc) 264 if (rc)
265 lperror ("list_get_iterator", rc); 265 lperror ("mu_list_get_iterator", rc);
266 iterator_first (itr[num]); 266 mu_iterator_first (itr[num]);
267 } 267 }
268 268
269 num = 0; 269 num = 0;
...@@ -274,24 +274,24 @@ shell (list_t list) ...@@ -274,24 +274,24 @@ shell (list_t list)
274 int argc; 274 int argc;
275 char **argv; 275 char **argv;
276 276
277 rc = iterator_current (itr[num], (void**) &text); 277 rc = mu_iterator_current (itr[num], (void**) &text);
278 if (rc) 278 if (rc)
279 lperror ("iterator_current", rc); 279 lperror ("mu_iterator_current", rc);
280 280
281 printf ("%d:(%s)> ", num, text ? text : "NULL"); 281 printf ("%d:(%s)> ", num, text ? text : "NULL");
282 if (fgets (buf, sizeof buf, stdin) == NULL) 282 if (fgets (buf, sizeof buf, stdin) == NULL)
283 return; 283 return;
284 284
285 rc = argcv_get (buf, "", "#", &argc, &argv); 285 rc = mu_argcv_get (buf, "", "#", &argc, &argv);
286 if (rc) 286 if (rc)
287 lperror ("argcv_get", rc); 287 lperror ("mu_argcv_get", rc);
288 288
289 if (argc > 0) 289 if (argc > 0)
290 { 290 {
291 if (strcmp (argv[0], "next") == 0) 291 if (strcmp (argv[0], "next") == 0)
292 next (itr[num], argv[1]); 292 next (itr[num], argv[1]);
293 else if (strcmp (argv[0], "first") == 0) 293 else if (strcmp (argv[0], "first") == 0)
294 iterator_first (itr[num]); 294 mu_iterator_first (itr[num]);
295 else if (strcmp (argv[0], "del") == 0) 295 else if (strcmp (argv[0], "del") == 0)
296 delete (list, argc, argv); 296 delete (list, argc, argv);
297 else if (strcmp (argv[0], "add") == 0) 297 else if (strcmp (argv[0], "add") == 0)
...@@ -320,9 +320,9 @@ shell (list_t list) ...@@ -320,9 +320,9 @@ shell (list_t list)
320 fprintf (stderr, "?\n"); 320 fprintf (stderr, "?\n");
321 else 321 else
322 { 322 {
323 rc = list_get (list, n, (void**) &text); 323 rc = mu_list_get (list, n, (void**) &text);
324 if (rc) 324 if (rc)
325 fprintf (stderr, "list_get: %s\n", mu_strerror (rc)); 325 fprintf (stderr, "mu_list_get: %s\n", mu_strerror (rc));
326 else 326 else
327 printf ("%s\n", text); 327 printf ("%s\n", text);
328 } 328 }
...@@ -330,7 +330,7 @@ shell (list_t list) ...@@ -330,7 +330,7 @@ shell (list_t list)
330 else 330 else
331 fprintf (stderr, "?\n"); 331 fprintf (stderr, "?\n");
332 } 332 }
333 argcv_free (argc, argv); 333 mu_argcv_free (argc, argv);
334 } 334 }
335 } 335 }
336 336
...@@ -359,16 +359,16 @@ main (int argc, char **argv) ...@@ -359,16 +359,16 @@ main (int argc, char **argv)
359 argc -= optind; 359 argc -= optind;
360 argv += optind; 360 argv += optind;
361 361
362 rc = list_create (&list); 362 rc = mu_list_create (&list);
363 if (rc) 363 if (rc)
364 lperror ("list_create", rc); 364 lperror ("mu_list_create", rc);
365 list_set_comparator (list, string_comp); 365 mu_list_set_comparator (list, string_comp);
366 366
367 while (argc--) 367 while (argc--)
368 { 368 {
369 rc = list_append (list, *argv++); 369 rc = mu_list_append (list, *argv++);
370 if (rc) 370 if (rc)
371 lperror ("list_append", rc); 371 lperror ("mu_list_append", rc);
372 } 372 }
373 373
374 shell (list); 374 shell (list);
......
...@@ -86,7 +86,7 @@ main (int argc, char **argv) ...@@ -86,7 +86,7 @@ main (int argc, char **argv)
86 registrar_record (path_record); 86 registrar_record (path_record);
87 registrar_record (pop_record); 87 registrar_record (pop_record);
88 88
89 if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0) 89 if ((ret = mu_mailbox_create_default (&mbox, mailbox_name)) != 0)
90 { 90 {
91 fprintf (stderr, "could not create %s: %s\n", 91 fprintf (stderr, "could not create %s: %s\n",
92 mailbox_name, mu_strerror (ret)); 92 mailbox_name, mu_strerror (ret));
...@@ -97,19 +97,19 @@ main (int argc, char **argv) ...@@ -97,19 +97,19 @@ main (int argc, char **argv)
97 if (debug) 97 if (debug)
98 { 98 {
99 mu_debug_t debug; 99 mu_debug_t debug;
100 mailbox_get_debug (mbox, &debug); 100 mu_mailbox_get_debug (mbox, &debug);
101 mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT); 101 mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
102 } 102 }
103 103
104 /* Open the mailbox for reading only. */ 104 /* Open the mailbox for reading only. */
105 if ((ret = mailbox_open (mbox, MU_STREAM_RDWR)) != 0) 105 if ((ret = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
106 { 106 {
107 fprintf (stderr, "mailbox open - %s\n", mu_strerror (ret)); 107 fprintf (stderr, "mailbox open - %s\n", mu_strerror (ret));
108 exit (2); 108 exit (2);
109 } 109 }
110 110
111 /* Iterate through the entire message set. */ 111 /* Iterate through the entire message set. */
112 mailbox_messages_count (mbox, &count); 112 mu_mailbox_messages_count (mbox, &count);
113 113
114 for (i = 1; i <= count; ++i) 114 for (i = 1; i <= count; ++i)
115 { 115 {
...@@ -118,9 +118,9 @@ main (int argc, char **argv) ...@@ -118,9 +118,9 @@ main (int argc, char **argv)
118 size_t nparts; 118 size_t nparts;
119 size_t msize, nlines; 119 size_t msize, nlines;
120 120
121 if ((ret = mailbox_get_message (mbox, i, &msg)) != 0) 121 if ((ret = mu_mailbox_get_message (mbox, i, &msg)) != 0)
122 { 122 {
123 fprintf (stderr, "mailbox_get_message - %s\n", mu_strerror (ret)); 123 fprintf (stderr, "mu_mailbox_get_message - %s\n", mu_strerror (ret));
124 exit (2); 124 exit (2);
125 } 125 }
126 if ((ret = message_size (msg, &msize)) != 0) 126 if ((ret = message_size (msg, &msize)) != 0)
...@@ -138,8 +138,8 @@ main (int argc, char **argv) ...@@ -138,8 +138,8 @@ main (int argc, char **argv)
138 fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret)); 138 fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
139 exit (2); 139 exit (2);
140 } 140 }
141 header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL); 141 mu_header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
142 header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject), 142 mu_header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
143 NULL); 143 NULL);
144 printf ("Message: %lu\n", (unsigned long) i); 144 printf ("Message: %lu\n", (unsigned long) i);
145 printf ("From: %s\n", from); 145 printf ("From: %s\n", from);
...@@ -156,8 +156,8 @@ main (int argc, char **argv) ...@@ -156,8 +156,8 @@ main (int argc, char **argv)
156 (unsigned long) msize, (unsigned long) nlines); 156 (unsigned long) msize, (unsigned long) nlines);
157 message_display_parts (msg, 0); 157 message_display_parts (msg, 0);
158 } 158 }
159 mailbox_close (mbox); 159 mu_mailbox_close (mbox);
160 mailbox_destroy (&mbox); 160 mu_mailbox_destroy (&mbox);
161 return 0; 161 return 0;
162 } 162 }
163 163
...@@ -209,13 +209,13 @@ message_display_parts (message_t msg, int indent) ...@@ -209,13 +209,13 @@ message_display_parts (message_t msg, int indent)
209 fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret)); 209 fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
210 exit (2); 210 exit (2);
211 } 211 }
212 header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type), 212 mu_header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type),
213 NULL); 213 NULL);
214 printf ("%*.*sType of part %d = %s\n", indent, indent, "", j, type); 214 printf ("%*.*sType of part %d = %s\n", indent, indent, "", j, type);
215 printf ("%*.*sMessage part size - %lu/%lu\n", indent, indent, "", 215 printf ("%*.*sMessage part size - %lu/%lu\n", indent, indent, "",
216 (unsigned long) msize, (unsigned long) nlines); 216 (unsigned long) msize, (unsigned long) nlines);
217 encoding[0] = '\0'; 217 encoding[0] = '\0';
218 header_get_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, encoding, 218 mu_header_get_value (hdr, MU_HEADER_CONTENT_TRANSFER_ENCODING, encoding,
219 sizeof (encoding), NULL); 219 sizeof (encoding), NULL);
220 ismulti = 0; 220 ismulti = 0;
221 if ((type[0] 221 if ((type[0]
...@@ -236,8 +236,8 @@ message_display_parts (message_t msg, int indent) ...@@ -236,8 +236,8 @@ message_display_parts (message_t msg, int indent)
236 mu_strerror (ret)); 236 mu_strerror (ret));
237 exit (2); 237 exit (2);
238 } 238 }
239 header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL); 239 mu_header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
240 header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject), 240 mu_header_get_value (hdr, MU_HEADER_SUBJECT, subject, sizeof (subject),
241 NULL); 241 NULL);
242 printf ("%*.*sEncapsulated message : %s\t%s\n", 242 printf ("%*.*sEncapsulated message : %s\t%s\n",
243 indent, indent, "", from, subject); 243 indent, indent, "", from, subject);
...@@ -260,8 +260,8 @@ message_display_parts (message_t msg, int indent) ...@@ -260,8 +260,8 @@ message_display_parts (message_t msg, int indent)
260 printf ("%*.*sText Message\n", indent, indent, ""); 260 printf ("%*.*sText Message\n", indent, indent, "");
261 printf ("%*.*sBegin\n", indent, indent, ""); 261 printf ("%*.*sBegin\n", indent, indent, "");
262 message_get_body (part, &body); 262 message_get_body (part, &body);
263 body_get_stream (body, &str); 263 mu_body_get_stream (body, &str);
264 filter_create (&str, str, encoding, 0, 0); 264 mu_filter_create (&str, str, encoding, 0, 0);
265 offset = 0; 265 offset = 0;
266 while (stream_readline (str, buf, sizeof (buf), offset, &nbytes) == 266 while (stream_readline (str, buf, sizeof (buf), offset, &nbytes) ==
267 0 && nbytes) 267 0 && nbytes)
......
...@@ -101,14 +101,14 @@ main (int argc, char *argv[]) ...@@ -101,14 +101,14 @@ main (int argc, char *argv[])
101 101
102 if (optfrom) 102 if (optfrom)
103 { 103 {
104 C (address_create (&from, optfrom)); 104 C (mu_address_create (&from, optfrom));
105 } 105 }
106 106
107 if (argv[optind]) 107 if (argv[optind])
108 { 108 {
109 char **av = argv + optind; 109 char **av = argv + optind;
110 110
111 C (address_createv (&to, (const char **) av, -1)); 111 C (mu_address_createv (&to, (const char **) av, -1));
112 } 112 }
113 113
114 C (stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE)); 114 C (stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE));
......
...@@ -262,10 +262,10 @@ add_recipient (const char *name) ...@@ -262,10 +262,10 @@ add_recipient (const char *name)
262 address_t addr; 262 address_t addr;
263 int status; 263 int status;
264 264
265 status = address_create (&addr, name); 265 status = mu_address_create (&addr, name);
266 if (status == 0) 266 if (status == 0)
267 status = address_union (&recipients, addr); 267 status = mu_address_union (&recipients, addr);
268 address_destroy (&addr); 268 mu_address_destroy (&addr);
269 return status; 269 return status;
270 } 270 }
271 271
...@@ -277,12 +277,12 @@ address_email_string (address_t addr) ...@@ -277,12 +277,12 @@ address_email_string (address_t addr)
277 size_t count, i, n, length; 277 size_t count, i, n, length;
278 char *value, *p; 278 char *value, *p;
279 279
280 address_get_email_count (addr, &count); 280 mu_address_get_email_count (addr, &count);
281 length = 0; 281 length = 0;
282 for (i = 1; i <= count; i++) 282 for (i = 1; i <= count; i++)
283 { 283 {
284 char *str; 284 char *str;
285 address_aget_email (recipients, i, &str); 285 mu_address_aget_email (recipients, i, &str);
286 length += strlen (str) + 3; 286 length += strlen (str) + 3;
287 free (str); 287 free (str);
288 } 288 }
...@@ -297,7 +297,7 @@ address_email_string (address_t addr) ...@@ -297,7 +297,7 @@ address_email_string (address_t addr)
297 for (i = 1; i <= count; i++) 297 for (i = 1; i <= count; i++)
298 { 298 {
299 *p++ = '<'; 299 *p++ = '<';
300 address_get_email (recipients, i, p, length - (p - value), &n); 300 mu_address_get_email (recipients, i, p, length - (p - value), &n);
301 p += n; 301 p += n;
302 *p++ = '>'; 302 *p++ = '>';
303 if (i + 1 <= count) 303 if (i + 1 <= count)
...@@ -373,11 +373,11 @@ message_finalize (message_t msg, int warn) ...@@ -373,11 +373,11 @@ message_finalize (message_t msg, int warn)
373 return 1; 373 return 1;
374 } 374 }
375 sprintf (warn, "%s %s", pwd->pw_name, SENDER_WARNING); 375 sprintf (warn, "%s %s", pwd->pw_name, SENDER_WARNING);
376 header_set_value (header, "X-Authentication-Warning", warn, 0); 376 mu_header_set_value (header, "X-Authentication-Warning", warn, 0);
377 free (warn); 377 free (warn);
378 } 378 }
379 379
380 have_to = header_aget_value (header, MU_HEADER_TO, &value) == 0; 380 have_to = mu_header_aget_value (header, MU_HEADER_TO, &value) == 0;
381 381
382 if (read_recipients) 382 if (read_recipients)
383 { 383 {
...@@ -391,7 +391,7 @@ message_finalize (message_t msg, int warn) ...@@ -391,7 +391,7 @@ message_finalize (message_t msg, int warn)
391 free (value); 391 free (value);
392 } 392 }
393 393
394 if (header_aget_value (header, MU_HEADER_CC, &value) == 0) 394 if (mu_header_aget_value (header, MU_HEADER_CC, &value) == 0)
395 { 395 {
396 if (add_recipient (value)) 396 if (add_recipient (value))
397 { 397 {
...@@ -401,7 +401,7 @@ message_finalize (message_t msg, int warn) ...@@ -401,7 +401,7 @@ message_finalize (message_t msg, int warn)
401 free (value); 401 free (value);
402 } 402 }
403 403
404 if (header_aget_value (header, MU_HEADER_BCC, &value) == 0) 404 if (mu_header_aget_value (header, MU_HEADER_BCC, &value) == 0)
405 { 405 {
406 if (add_recipient (value)) 406 if (add_recipient (value))
407 { 407 {
...@@ -409,7 +409,7 @@ message_finalize (message_t msg, int warn) ...@@ -409,7 +409,7 @@ message_finalize (message_t msg, int warn)
409 return 1; 409 return 1;
410 } 410 }
411 free (value); 411 free (value);
412 header_set_value (header, MU_HEADER_BCC, NULL, 1); 412 mu_header_set_value (header, MU_HEADER_BCC, NULL, 1);
413 } 413 }
414 } 414 }
415 415
...@@ -418,10 +418,10 @@ message_finalize (message_t msg, int warn) ...@@ -418,10 +418,10 @@ message_finalize (message_t msg, int warn)
418 size_t n; 418 size_t n;
419 int c; 419 int c;
420 420
421 c = address_to_string (recipients, NULL, 0, &n); 421 c = mu_address_to_string (recipients, NULL, 0, &n);
422 if (c) 422 if (c)
423 { 423 {
424 mu_error ("%s: address_to_string failure: %s", 424 mu_error ("%s: mu_address_to_string failure: %s",
425 progname, mu_strerror (c)); 425 progname, mu_strerror (c));
426 return 1; 426 return 1;
427 } 427 }
...@@ -432,8 +432,8 @@ message_finalize (message_t msg, int warn) ...@@ -432,8 +432,8 @@ message_finalize (message_t msg, int warn)
432 return 1; 432 return 1;
433 } 433 }
434 434
435 address_to_string (recipients, value, n + 1, &n); 435 mu_address_to_string (recipients, value, n + 1, &n);
436 header_set_value (header, MU_HEADER_TO, value, 1); 436 mu_header_set_value (header, MU_HEADER_TO, value, 1);
437 free (value); 437 free (value);
438 } 438 }
439 return 0; 439 return 0;
...@@ -457,7 +457,7 @@ mta_stdin (int argc, char **argv) ...@@ -457,7 +457,7 @@ mta_stdin (int argc, char **argv)
457 } 457 }
458 458
459 make_tmp (stdin, from_person, &tempfile); 459 make_tmp (stdin, from_person, &tempfile);
460 if ((c = mailbox_create_default (&mbox, tempfile)) != 0) 460 if ((c = mu_mailbox_create_default (&mbox, tempfile)) != 0)
461 { 461 {
462 mu_error ("%s: can't create mailbox %s: %s", 462 mu_error ("%s: can't create mailbox %s: %s",
463 progname, tempfile, mu_strerror (c)); 463 progname, tempfile, mu_strerror (c));
...@@ -465,7 +465,7 @@ mta_stdin (int argc, char **argv) ...@@ -465,7 +465,7 @@ mta_stdin (int argc, char **argv)
465 return 1; 465 return 1;
466 } 466 }
467 467
468 if ((c = mailbox_open (mbox, MU_STREAM_RDWR)) != 0) 468 if ((c = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
469 { 469 {
470 mu_error ("%s: can't open mailbox %s: %s", 470 mu_error ("%s: can't open mailbox %s: %s",
471 progname, tempfile, mu_strerror (c)); 471 progname, tempfile, mu_strerror (c));
...@@ -473,7 +473,7 @@ mta_stdin (int argc, char **argv) ...@@ -473,7 +473,7 @@ mta_stdin (int argc, char **argv)
473 return 1; 473 return 1;
474 } 474 }
475 475
476 mailbox_get_message (mbox, 1, &msg); 476 mu_mailbox_get_message (mbox, 1, &msg);
477 if (message_finalize (msg, 1)) 477 if (message_finalize (msg, 1))
478 return 1; 478 return 1;
479 479
...@@ -573,7 +573,7 @@ smtp (int fd) ...@@ -573,7 +573,7 @@ smtp (int fd)
573 len --; 573 len --;
574 buf[len] = 0; 574 buf[len] = 0;
575 575
576 if (argcv_get (buf, "", NULL, &argc, &argv)) 576 if (mu_argcv_get (buf, "", NULL, &argc, &argv))
577 exit (1); 577 exit (1);
578 578
579 kw = smtp_kw (argv[0]); 579 kw = smtp_kw (argv[0]);
...@@ -581,7 +581,7 @@ smtp (int fd) ...@@ -581,7 +581,7 @@ smtp (int fd)
581 { 581 {
582 smtp_reply (221, "Done"); 582 smtp_reply (221, "Done");
583 state = STATE_QUIT; 583 state = STATE_QUIT;
584 argcv_free (argc, argv); 584 mu_argcv_free (argc, argv);
585 continue; 585 continue;
586 } 586 }
587 587
...@@ -668,7 +668,7 @@ smtp (int fd) ...@@ -668,7 +668,7 @@ smtp (int fd)
668 smtp_reply (354, 668 smtp_reply (354,
669 "Enter mail, end with \".\" on a line by itself"); 669 "Enter mail, end with \".\" on a line by itself");
670 make_tmp (in, from_person, &tempfile); 670 make_tmp (in, from_person, &tempfile);
671 if ((c = mailbox_create_default (&mbox, tempfile)) != 0) 671 if ((c = mu_mailbox_create_default (&mbox, tempfile)) != 0)
672 { 672 {
673 mu_error ("%s: can't create mailbox %s: %s", 673 mu_error ("%s: can't create mailbox %s: %s",
674 progname, 674 progname,
...@@ -677,7 +677,7 @@ smtp (int fd) ...@@ -677,7 +677,7 @@ smtp (int fd)
677 exit (1); 677 exit (1);
678 } 678 }
679 679
680 if ((c = mailbox_open (mbox, MU_STREAM_RDWR)) != 0) 680 if ((c = mu_mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
681 { 681 {
682 mu_error ("%s: can't open mailbox %s: %s", 682 mu_error ("%s: can't open mailbox %s: %s",
683 progname, 683 progname,
...@@ -686,14 +686,14 @@ smtp (int fd) ...@@ -686,14 +686,14 @@ smtp (int fd)
686 exit (1); 686 exit (1);
687 } 687 }
688 688
689 mailbox_get_message (mbox, 1, &msg); 689 mu_mailbox_get_message (mbox, 1, &msg);
690 if (message_finalize (msg, 0) == 0) 690 if (message_finalize (msg, 0) == 0)
691 mta_send (msg); 691 mta_send (msg);
692 else 692 else
693 smtp_reply (501, "can't send message"); /*FIXME: code?*/ 693 smtp_reply (501, "can't send message"); /*FIXME: code?*/
694 unlink (tempfile); 694 unlink (tempfile);
695 695
696 address_destroy (&recipients); 696 mu_address_destroy (&recipients);
697 from_person = NULL; 697 from_person = NULL;
698 698
699 smtp_reply (250, "Message accepted for delivery"); 699 smtp_reply (250, "Message accepted for delivery");
...@@ -707,7 +707,7 @@ smtp (int fd) ...@@ -707,7 +707,7 @@ smtp (int fd)
707 break; 707 break;
708 708
709 } 709 }
710 argcv_free (argc, argv); 710 mu_argcv_free (argc, argv);
711 } 711 }
712 712
713 close (fd); 713 close (fd);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2003 Free Software Foundation, Inc. 2 Copyright (C) 2003, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -65,7 +65,7 @@ main (int argc, char *argv[]) ...@@ -65,7 +65,7 @@ main (int argc, char *argv[])
65 exit (1); 65 exit (1);
66 } 66 }
67 67
68 assert (argcv_string (argc - i, &argv[i], &cmdline) == 0); 68 assert (mu_argcv_string (argc - i, &argv[i], &cmdline) == 0);
69 if (read_stdin) 69 if (read_stdin)
70 { 70 {
71 stream_t in; 71 stream_t in;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 GNU Mailutils nntp functions. This application interactively allows users 2 GNU Mailutils nntp functions. This application interactively allows users
3 to contact a nntp server. 3 to contact a nntp server.
4 4
5 Copyright (C) 2003, 2004 Free Software Foundation 5 Copyright (C) 2003, 2004, 2005 Free Software Foundation
6 6
7 GNU Mailutils is free software; you can redistribute it and/or modify 7 GNU Mailutils is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
...@@ -570,14 +570,14 @@ com_list_extensions (char *arg ARG_UNUSED) ...@@ -570,14 +570,14 @@ com_list_extensions (char *arg ARG_UNUSED)
570 if (status == 0) 570 if (status == 0)
571 { 571 {
572 printf ("List Extension:\n"); 572 printf ("List Extension:\n");
573 for (iterator_first (iterator); 573 for (mu_iterator_first (iterator);
574 !iterator_is_done (iterator); iterator_next (iterator)) 574 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
575 { 575 {
576 char *extension = NULL; 576 char *extension = NULL;
577 iterator_current (iterator, (void **) &extension); 577 mu_iterator_current (iterator, (void **) &extension);
578 printf (" %s\n", extension); 578 printf (" %s\n", extension);
579 } 579 }
580 iterator_destroy (&iterator); 580 mu_iterator_destroy (&iterator);
581 } 581 }
582 return status; 582 return status;
583 } 583 }
...@@ -591,15 +591,15 @@ com_list_active (char *arg) ...@@ -591,15 +591,15 @@ com_list_active (char *arg)
591 if (status == 0) 591 if (status == 0)
592 { 592 {
593 printf ("List Active:\n"); 593 printf ("List Active:\n");
594 for (iterator_first (iterator); 594 for (mu_iterator_first (iterator);
595 !iterator_is_done (iterator); iterator_next (iterator)) 595 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
596 { 596 {
597 char *buffer = NULL; 597 char *buffer = NULL;
598 char *group = NULL; 598 char *group = NULL;
599 unsigned long high; 599 unsigned long high;
600 unsigned long low; 600 unsigned long low;
601 char stat; 601 char stat;
602 iterator_current (iterator, (void **) &buffer); 602 mu_iterator_current (iterator, (void **) &buffer);
603 mu_nntp_parse_list_active (buffer, &group, &high, &low, &stat); 603 mu_nntp_parse_list_active (buffer, &group, &high, &low, &stat);
604 if (group) 604 if (group)
605 { 605 {
...@@ -608,7 +608,7 @@ com_list_active (char *arg) ...@@ -608,7 +608,7 @@ com_list_active (char *arg)
608 } 608 }
609 printf (" high(%ld) low(%ld) status(%c)\n", high, low, stat); 609 printf (" high(%ld) low(%ld) status(%c)\n", high, low, stat);
610 } 610 }
611 iterator_destroy (&iterator); 611 mu_iterator_destroy (&iterator);
612 } 612 }
613 return status; 613 return status;
614 } 614 }
...@@ -622,14 +622,14 @@ com_list_active_times (char *arg) ...@@ -622,14 +622,14 @@ com_list_active_times (char *arg)
622 if (status == 0) 622 if (status == 0)
623 { 623 {
624 printf ("List Active.Times:\n"); 624 printf ("List Active.Times:\n");
625 for (iterator_first (iterator); 625 for (mu_iterator_first (iterator);
626 !iterator_is_done (iterator); iterator_next (iterator)) 626 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
627 { 627 {
628 char *buffer = NULL; 628 char *buffer = NULL;
629 char *group = NULL; 629 char *group = NULL;
630 char *creator = NULL; 630 char *creator = NULL;
631 unsigned long time = 0; 631 unsigned long time = 0;
632 iterator_current (iterator, (void **) &buffer); 632 mu_iterator_current (iterator, (void **) &buffer);
633 mu_nntp_parse_list_active_times (buffer, &group, &time, &creator); 633 mu_nntp_parse_list_active_times (buffer, &group, &time, &creator);
634 if (group) 634 if (group)
635 { 635 {
...@@ -655,7 +655,7 @@ com_list_active_times (char *arg) ...@@ -655,7 +655,7 @@ com_list_active_times (char *arg)
655 } 655 }
656 printf ("\n"); 656 printf ("\n");
657 } 657 }
658 iterator_destroy (&iterator); 658 mu_iterator_destroy (&iterator);
659 } 659 }
660 return status; 660 return status;
661 } 661 }
...@@ -669,13 +669,13 @@ com_list_distributions (char *arg ARG_UNUSED) ...@@ -669,13 +669,13 @@ com_list_distributions (char *arg ARG_UNUSED)
669 if (status == 0) 669 if (status == 0)
670 { 670 {
671 printf ("List Distributions:\n"); 671 printf ("List Distributions:\n");
672 for (iterator_first (iterator); 672 for (mu_iterator_first (iterator);
673 !iterator_is_done (iterator); iterator_next (iterator)) 673 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
674 { 674 {
675 char *buffer = NULL; 675 char *buffer = NULL;
676 char *key = NULL; 676 char *key = NULL;
677 char *value = NULL; 677 char *value = NULL;
678 iterator_current (iterator, (void **) &buffer); 678 mu_iterator_current (iterator, (void **) &buffer);
679 mu_nntp_parse_list_distributions (buffer, &key, &value); 679 mu_nntp_parse_list_distributions (buffer, &key, &value);
680 if (key) 680 if (key)
681 { 681 {
...@@ -689,7 +689,7 @@ com_list_distributions (char *arg ARG_UNUSED) ...@@ -689,7 +689,7 @@ com_list_distributions (char *arg ARG_UNUSED)
689 } 689 }
690 printf ("\n"); 690 printf ("\n");
691 } 691 }
692 iterator_destroy (&iterator); 692 mu_iterator_destroy (&iterator);
693 } 693 }
694 return status; 694 return status;
695 } 695 }
...@@ -703,14 +703,14 @@ com_list_distrib_pats (char *arg ARG_UNUSED) ...@@ -703,14 +703,14 @@ com_list_distrib_pats (char *arg ARG_UNUSED)
703 if (status == 0) 703 if (status == 0)
704 { 704 {
705 printf ("List Distrib Pats:\n"); 705 printf ("List Distrib Pats:\n");
706 for (iterator_first (iterator); 706 for (mu_iterator_first (iterator);
707 !iterator_is_done (iterator); iterator_next (iterator)) 707 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
708 { 708 {
709 char *buffer = NULL; 709 char *buffer = NULL;
710 unsigned long weight = 0; 710 unsigned long weight = 0;
711 char *wildmat = NULL; 711 char *wildmat = NULL;
712 char *distrib = NULL; 712 char *distrib = NULL;
713 iterator_current (iterator, (void **) &buffer); 713 mu_iterator_current (iterator, (void **) &buffer);
714 mu_nntp_parse_list_distrib_pats (buffer, &weight, &wildmat, &distrib); 714 mu_nntp_parse_list_distrib_pats (buffer, &weight, &wildmat, &distrib);
715 printf (" weight(%ld)", weight); 715 printf (" weight(%ld)", weight);
716 if (wildmat) 716 if (wildmat)
...@@ -725,7 +725,7 @@ com_list_distrib_pats (char *arg ARG_UNUSED) ...@@ -725,7 +725,7 @@ com_list_distrib_pats (char *arg ARG_UNUSED)
725 } 725 }
726 printf ("\n"); 726 printf ("\n");
727 } 727 }
728 iterator_destroy (&iterator); 728 mu_iterator_destroy (&iterator);
729 } 729 }
730 return status; 730 return status;
731 } 731 }
...@@ -739,13 +739,13 @@ com_list_newsgroups (char *arg) ...@@ -739,13 +739,13 @@ com_list_newsgroups (char *arg)
739 if (status == 0) 739 if (status == 0)
740 { 740 {
741 printf ("Newsgroups:\n"); 741 printf ("Newsgroups:\n");
742 for (iterator_first (iterator); 742 for (mu_iterator_first (iterator);
743 !iterator_is_done (iterator); iterator_next (iterator)) 743 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
744 { 744 {
745 char *buffer = NULL; 745 char *buffer = NULL;
746 char *group = NULL; 746 char *group = NULL;
747 char *desc = NULL; 747 char *desc = NULL;
748 iterator_current (iterator, (void **) &buffer); 748 mu_iterator_current (iterator, (void **) &buffer);
749 mu_nntp_parse_list_newsgroups (buffer, &group, &desc); 749 mu_nntp_parse_list_newsgroups (buffer, &group, &desc);
750 if (group) 750 if (group)
751 { 751 {
...@@ -759,7 +759,7 @@ com_list_newsgroups (char *arg) ...@@ -759,7 +759,7 @@ com_list_newsgroups (char *arg)
759 } 759 }
760 printf ("\n"); 760 printf ("\n");
761 } 761 }
762 iterator_destroy (&iterator); 762 mu_iterator_destroy (&iterator);
763 } 763 }
764 return status; 764 return status;
765 } 765 }
...@@ -827,15 +827,15 @@ com_newgroups (char *arg) ...@@ -827,15 +827,15 @@ com_newgroups (char *arg)
827 if (status == 0) 827 if (status == 0)
828 { 828 {
829 printf ("New Groups:\n"); 829 printf ("New Groups:\n");
830 for (iterator_first (iterator); 830 for (mu_iterator_first (iterator);
831 !iterator_is_done (iterator); iterator_next (iterator)) 831 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
832 { 832 {
833 char *buffer = NULL; 833 char *buffer = NULL;
834 char *group = NULL; 834 char *group = NULL;
835 unsigned long high = 0; 835 unsigned long high = 0;
836 unsigned long low = 0; 836 unsigned long low = 0;
837 char stat = 0; 837 char stat = 0;
838 iterator_current (iterator, (void **) &buffer); 838 mu_iterator_current (iterator, (void **) &buffer);
839 mu_nntp_parse_newgroups (buffer, &group, &high, &low, &stat); 839 mu_nntp_parse_newgroups (buffer, &group, &high, &low, &stat);
840 if (group) 840 if (group)
841 { 841 {
...@@ -844,7 +844,7 @@ com_newgroups (char *arg) ...@@ -844,7 +844,7 @@ com_newgroups (char *arg)
844 } 844 }
845 printf (" hig(%lu) low(%lu) status(%c)\n", high, low, stat); 845 printf (" hig(%lu) low(%lu) status(%c)\n", high, low, stat);
846 } 846 }
847 iterator_destroy (&iterator); 847 mu_iterator_destroy (&iterator);
848 } 848 }
849 return status; 849 return status;
850 } 850 }
...@@ -884,14 +884,14 @@ com_newnews (char *arg) ...@@ -884,14 +884,14 @@ com_newnews (char *arg)
884 if (status == 0) 884 if (status == 0)
885 { 885 {
886 printf ("New News:\n"); 886 printf ("New News:\n");
887 for (iterator_first (iterator); 887 for (mu_iterator_first (iterator);
888 !iterator_is_done (iterator); iterator_next (iterator)) 888 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
889 { 889 {
890 char *mid = NULL; 890 char *mid = NULL;
891 iterator_current (iterator, (void **) &mid); 891 mu_iterator_current (iterator, (void **) &mid);
892 printf (" %s\n", mid); 892 printf (" %s\n", mid);
893 } 893 }
894 iterator_destroy (&iterator); 894 mu_iterator_destroy (&iterator);
895 } 895 }
896 return status; 896 return status;
897 } 897 }
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by 5 it under the terms of the GNU Lesser General Public License as published by
...@@ -64,12 +64,12 @@ _count_items (void *item, void *data) ...@@ -64,12 +64,12 @@ _count_items (void *item, void *data)
64 address_t addr; 64 address_t addr;
65 size_t count = 0; 65 size_t count = 0;
66 66
67 if (header_aget_value (vp->hdr, name, &val)) 67 if (mu_header_aget_value (vp->hdr, name, &val))
68 return 0; 68 return 0;
69 if (address_create (&addr, val) == 0) 69 if (mu_address_create (&addr, val) == 0)
70 { 70 {
71 address_get_count (addr, &count); 71 mu_address_get_count (addr, &count);
72 address_destroy (&addr); 72 mu_address_destroy (&addr);
73 vp->count += count; 73 vp->count += count;
74 } 74 }
75 free (val); 75 free (val);
...@@ -78,48 +78,48 @@ _count_items (void *item, void *data) ...@@ -78,48 +78,48 @@ _count_items (void *item, void *data)
78 78
79 /* Handler for the numaddr test */ 79 /* Handler for the numaddr test */
80 static int 80 static int
81 numaddr_test (sieve_machine_t mach, list_t args, list_t tags) 81 numaddr_test (mu_sieve_machine_t mach, list_t args, list_t tags)
82 { 82 {
83 sieve_value_t *h, *v; 83 mu_sieve_value_t *h, *v;
84 struct val_ctr vc; 84 struct val_ctr vc;
85 int rc; 85 int rc;
86 86
87 if (sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE) 87 if (mu_sieve_get_debug_level (mach) & MU_SIEVE_DEBUG_TRACE)
88 { 88 {
89 sieve_locus_t locus; 89 mu_sieve_locus_t locus;
90 sieve_get_locus (mach, &locus); 90 mu_sieve_get_locus (mach, &locus);
91 sieve_debug (mach, "%s:%lu: NUMADDR\n", 91 mu_sieve_debug (mach, "%s:%lu: NUMADDR\n",
92 locus.source_file, 92 locus.source_file,
93 (unsigned long) locus.source_line); 93 (unsigned long) locus.source_line);
94 } 94 }
95 95
96 /* Retrieve required arguments: */ 96 /* Retrieve required arguments: */
97 /* First argument: list of header names */ 97 /* First argument: list of header names */
98 h = sieve_value_get (args, 0); 98 h = mu_sieve_value_get (args, 0);
99 if (!h) 99 if (!h)
100 { 100 {
101 sieve_error (mach, "numaddr: can't get argument 1"); 101 mu_sieve_error (mach, "numaddr: can't get argument 1");
102 sieve_abort (mach); 102 mu_sieve_abort (mach);
103 } 103 }
104 /* Second argument: Limit on the number of addresses */ 104 /* Second argument: Limit on the number of addresses */
105 v = sieve_value_get (args, 1); 105 v = mu_sieve_value_get (args, 1);
106 if (!v) 106 if (!v)
107 { 107 {
108 sieve_error (mach, "numaddr: can't get argument 2"); 108 mu_sieve_error (mach, "numaddr: can't get argument 2");
109 sieve_abort (mach); 109 mu_sieve_abort (mach);
110 } 110 }
111 111
112 /* Fill in the val_ctr structure */ 112 /* Fill in the val_ctr structure */
113 message_get_header (sieve_get_message (mach), &vc.hdr); 113 message_get_header (mu_sieve_get_message (mach), &vc.hdr);
114 vc.count = 0; 114 vc.count = 0;
115 vc.limit = v->v.number; 115 vc.limit = v->v.number;
116 116
117 /* Count the addresses */ 117 /* Count the addresses */
118 rc = sieve_vlist_do (h, _count_items, &vc); 118 rc = mu_sieve_vlist_do (h, _count_items, &vc);
119 119
120 /* Here rc >= 1 iff the counted number of addresses is greater or equal 120 /* Here rc >= 1 iff the counted number of addresses is greater or equal
121 to vc.limit. If `:under' tag was given we reverse the return value */ 121 to vc.limit. If `:under' tag was given we reverse the return value */
122 if (sieve_tag_lookup (tags, "under", NULL)) 122 if (mu_sieve_tag_lookup (tags, "under", NULL))
123 rc = !rc; 123 rc = !rc;
124 return rc; 124 return rc;
125 } 125 }
...@@ -127,20 +127,20 @@ numaddr_test (sieve_machine_t mach, list_t args, list_t tags) ...@@ -127,20 +127,20 @@ numaddr_test (sieve_machine_t mach, list_t args, list_t tags)
127 /* Syntactic definitions for the numaddr test */ 127 /* Syntactic definitions for the numaddr test */
128 128
129 /* Required arguments: */ 129 /* Required arguments: */
130 static sieve_data_type numaddr_req_args[] = { 130 static mu_sieve_data_type numaddr_req_args[] = {
131 SVT_STRING_LIST, 131 SVT_STRING_LIST,
132 SVT_NUMBER, 132 SVT_NUMBER,
133 SVT_VOID 133 SVT_VOID
134 }; 134 };
135 135
136 /* Tagged arguments: */ 136 /* Tagged arguments: */
137 static sieve_tag_def_t numaddr_tags[] = { 137 static mu_sieve_tag_def_t numaddr_tags[] = {
138 { "over", SVT_VOID }, 138 { "over", SVT_VOID },
139 { "under", SVT_VOID }, 139 { "under", SVT_VOID },
140 { NULL } 140 { NULL }
141 }; 141 };
142 142
143 static sieve_tag_group_t numaddr_tag_groups[] = { 143 static mu_sieve_tag_group_t numaddr_tag_groups[] = {
144 { numaddr_tags, NULL }, 144 { numaddr_tags, NULL },
145 { NULL } 145 { NULL }
146 }; 146 };
...@@ -148,8 +148,8 @@ static sieve_tag_group_t numaddr_tag_groups[] = { ...@@ -148,8 +148,8 @@ static sieve_tag_group_t numaddr_tag_groups[] = {
148 /* Initialization function. It is the only function exported from this 148 /* Initialization function. It is the only function exported from this
149 module. */ 149 module. */
150 int 150 int
151 SIEVE_EXPORT(numaddr,init) (sieve_machine_t mach) 151 SIEVE_EXPORT(numaddr,init) (mu_sieve_machine_t mach)
152 { 152 {
153 return sieve_register_test (mach, "numaddr", numaddr_test, 153 return mu_sieve_register_test (mach, "numaddr", numaddr_test,
154 numaddr_req_args, numaddr_tag_groups, 1); 154 numaddr_req_args, numaddr_tag_groups, 1);
155 } 155 }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 GNU Mailutils pop3 functions. This application interactively allows users 2 GNU Mailutils pop3 functions. This application interactively allows users
3 to contact a pop3 server. 3 to contact a pop3 server.
4 4
5 Copyright (C) 2003, 2004 Free Software Foundation 5 Copyright (C) 2003, 2004, 2005 Free Software Foundation
6 6
7 GNU Mailutils is free software; you can redistribute it and/or modify 7 GNU Mailutils is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
...@@ -406,14 +406,14 @@ com_capa (char *arg ARG_UNUSED) ...@@ -406,14 +406,14 @@ com_capa (char *arg ARG_UNUSED)
406 406
407 if (status == 0) 407 if (status == 0)
408 { 408 {
409 for (iterator_first (iterator); 409 for (mu_iterator_first (iterator);
410 !iterator_is_done (iterator); iterator_next (iterator)) 410 !mu_iterator_is_done (iterator); mu_iterator_next (iterator))
411 { 411 {
412 char *capa = NULL; 412 char *capa = NULL;
413 iterator_current (iterator, (void **) &capa); 413 mu_iterator_current (iterator, (void **) &capa);
414 printf ("Capa: %s\n", (capa) ? capa : ""); 414 printf ("Capa: %s\n", (capa) ? capa : "");
415 } 415 }
416 iterator_destroy (&iterator); 416 mu_iterator_destroy (&iterator);
417 } 417 }
418 return status; 418 return status;
419 } 419 }
...@@ -428,15 +428,15 @@ com_uidl (char *arg) ...@@ -428,15 +428,15 @@ com_uidl (char *arg)
428 status = mu_pop3_uidl_all (pop3, &uidl_iterator); 428 status = mu_pop3_uidl_all (pop3, &uidl_iterator);
429 if (status == 0) 429 if (status == 0)
430 { 430 {
431 for (iterator_first (uidl_iterator); 431 for (mu_iterator_first (uidl_iterator);
432 !iterator_is_done (uidl_iterator); 432 !mu_iterator_is_done (uidl_iterator);
433 iterator_next (uidl_iterator)) 433 mu_iterator_next (uidl_iterator))
434 { 434 {
435 char *uidl = NULL; 435 char *uidl = NULL;
436 iterator_current (uidl_iterator, (void **) &uidl); 436 mu_iterator_current (uidl_iterator, (void **) &uidl);
437 printf ("UIDL: %s\n", (uidl) ? uidl : ""); 437 printf ("UIDL: %s\n", (uidl) ? uidl : "");
438 } 438 }
439 iterator_destroy (&uidl_iterator); 439 mu_iterator_destroy (&uidl_iterator);
440 } 440 }
441 } 441 }
442 else 442 else
...@@ -461,15 +461,15 @@ com_list (char *arg) ...@@ -461,15 +461,15 @@ com_list (char *arg)
461 status = mu_pop3_list_all (pop3, &list_iterator); 461 status = mu_pop3_list_all (pop3, &list_iterator);
462 if (status == 0) 462 if (status == 0)
463 { 463 {
464 for (iterator_first (list_iterator); 464 for (mu_iterator_first (list_iterator);
465 !iterator_is_done (list_iterator); 465 !mu_iterator_is_done (list_iterator);
466 iterator_next (list_iterator)) 466 mu_iterator_next (list_iterator))
467 { 467 {
468 char *list = NULL; 468 char *list = NULL;
469 iterator_current (list_iterator, (void **) &list); 469 mu_iterator_current (list_iterator, (void **) &list);
470 printf ("LIST: %s\n", (list) ? list : ""); 470 printf ("LIST: %s\n", (list) ? list : "");
471 } 471 }
472 iterator_destroy (&list_iterator); 472 mu_iterator_destroy (&list_iterator);
473 } 473 }
474 } 474 }
475 else 475 else
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2 Copyright (C) 1999, 2000, 2001, 2002, 2003,
3 2004 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -36,38 +36,38 @@ main (int argc, const char **argv) ...@@ -36,38 +36,38 @@ main (int argc, const char **argv)
36 /* Register the formats. */ 36 /* Register the formats. */
37 mu_register_all_mbox_formats (); 37 mu_register_all_mbox_formats ();
38 38
39 status = mailbox_create_default (&mbox, argv[1]); 39 status = mu_mailbox_create_default (&mbox, argv[1]);
40 if (status != 0) 40 if (status != 0)
41 { 41 {
42 mu_error ("mailbox_create: %s", mu_strerror (status)); 42 mu_error ("mu_mailbox_create: %s", mu_strerror (status));
43 exit (EXIT_FAILURE); 43 exit (EXIT_FAILURE);
44 } 44 }
45 45
46 status = mailbox_open (mbox, MU_STREAM_READ); 46 status = mu_mailbox_open (mbox, MU_STREAM_READ);
47 if (status != 0) 47 if (status != 0)
48 { 48 {
49 mu_error ("mailbox_open: %s", mu_strerror (status)); 49 mu_error ("mu_mailbox_open: %s", mu_strerror (status));
50 exit (EXIT_FAILURE); 50 exit (EXIT_FAILURE);
51 } 51 }
52 52
53 mailbox_messages_count (mbox, &total); 53 mu_mailbox_messages_count (mbox, &total);
54 54
55 for (msgno = 1; msgno <= total; msgno++) 55 for (msgno = 1; msgno <= total; msgno++)
56 { 56 {
57 message_t msg; 57 message_t msg;
58 header_t hdr; 58 header_t hdr;
59 59
60 if ((status = mailbox_get_message (mbox, msgno, &msg)) != 0 60 if ((status = mu_mailbox_get_message (mbox, msgno, &msg)) != 0
61 || (status = message_get_header (msg, &hdr)) != 0) 61 || (status = message_get_header (msg, &hdr)) != 0)
62 { 62 {
63 mu_error ("Error message: %s", mu_strerror (status)); 63 mu_error ("Error message: %s", mu_strerror (status));
64 exit (EXIT_FAILURE); 64 exit (EXIT_FAILURE);
65 } 65 }
66 66
67 if (header_aget_value (hdr, MU_HEADER_FROM, &from)) 67 if (mu_header_aget_value (hdr, MU_HEADER_FROM, &from))
68 from = strdup ("(NO FROM)"); 68 from = strdup ("(NO FROM)");
69 69
70 if (header_aget_value (hdr, MU_HEADER_SUBJECT, &subject)) 70 if (mu_header_aget_value (hdr, MU_HEADER_SUBJECT, &subject))
71 subject = strdup ("(NO SUBJECT)"); 71 subject = strdup ("(NO SUBJECT)");
72 72
73 printf ("%s\t%s\n", from, subject); 73 printf ("%s\t%s\n", from, subject);
...@@ -75,13 +75,13 @@ main (int argc, const char **argv) ...@@ -75,13 +75,13 @@ main (int argc, const char **argv)
75 free (subject); 75 free (subject);
76 } 76 }
77 77
78 status = mailbox_close (mbox); 78 status = mu_mailbox_close (mbox);
79 if (status != 0) 79 if (status != 0)
80 { 80 {
81 mu_error ("mailbox_close: %s", mu_strerror (status)); 81 mu_error ("mu_mailbox_close: %s", mu_strerror (status));
82 exit (EXIT_FAILURE); 82 exit (EXIT_FAILURE);
83 } 83 }
84 84
85 mailbox_destroy (&mbox); 85 mu_mailbox_destroy (&mbox);
86 return 0; 86 return 0;
87 } 87 }
......
...@@ -386,16 +386,16 @@ get_personal (header_t hdr, const char *field, char **personal) ...@@ -386,16 +386,16 @@ get_personal (header_t hdr, const char *field, char **personal)
386 char *hfield; 386 char *hfield;
387 int status; 387 int status;
388 388
389 status = header_aget_value_unfold (hdr, field, &hfield); 389 status = mu_header_aget_value_unfold (hdr, field, &hfield);
390 if (status == 0) 390 if (status == 0)
391 { 391 {
392 address_t address = NULL; 392 address_t address = NULL;
393 char *s; 393 char *s;
394 394
395 address_create (&address, hfield); 395 mu_address_create (&address, hfield);
396 396
397 address_aget_personal (address, 1, &s); 397 mu_address_aget_personal (address, 1, &s);
398 address_destroy (&address); 398 mu_address_destroy (&address);
399 if (s == NULL) 399 if (s == NULL)
400 s = hfield; 400 s = hfield;
401 else 401 else
...@@ -436,7 +436,7 @@ action (observer_t o, size_t type) ...@@ -436,7 +436,7 @@ action (observer_t o, size_t type)
436 436
437 msg_index++; 437 msg_index++;
438 438
439 mailbox_get_message (mbox, msg_index, &msg); 439 mu_mailbox_get_message (mbox, msg_index, &msg);
440 message_get_attribute (msg, &attr); 440 message_get_attribute (msg, &attr);
441 message_get_header (msg, &hdr); 441 message_get_header (msg, &hdr);
442 442
...@@ -463,7 +463,7 @@ action (observer_t o, size_t type) ...@@ -463,7 +463,7 @@ action (observer_t o, size_t type)
463 if (show_field) /* FIXME: This should be also rfc2047_decode. */ 463 if (show_field) /* FIXME: This should be also rfc2047_decode. */
464 { 464 {
465 char *hfield; 465 char *hfield;
466 status = header_aget_value_unfold (hdr, show_field, &hfield); 466 status = mu_header_aget_value_unfold (hdr, show_field, &hfield);
467 if (status == 0) 467 if (status == 0)
468 { 468 {
469 format_field ("%s", hfield); 469 format_field ("%s", hfield);
...@@ -484,7 +484,7 @@ action (observer_t o, size_t type) ...@@ -484,7 +484,7 @@ action (observer_t o, size_t type)
484 else 484 else
485 format_field (""); 485 format_field ("");
486 486
487 status = header_aget_value_unfold (hdr, MU_HEADER_SUBJECT, 487 status = mu_header_aget_value_unfold (hdr, MU_HEADER_SUBJECT,
488 &tmp); 488 &tmp);
489 if (status == 0) 489 if (status == 0)
490 { 490 {
...@@ -510,7 +510,7 @@ frm_abort (mailbox_t *mbox) ...@@ -510,7 +510,7 @@ frm_abort (mailbox_t *mbox)
510 { 510 {
511 int status; 511 int status;
512 512
513 if ((status = mailbox_close (*mbox)) != 0) 513 if ((status = mu_mailbox_close (*mbox)) != 0)
514 { 514 {
515 url_t url; 515 url_t url;
516 516
...@@ -519,7 +519,7 @@ frm_abort (mailbox_t *mbox) ...@@ -519,7 +519,7 @@ frm_abort (mailbox_t *mbox)
519 exit (3); 519 exit (3);
520 } 520 }
521 521
522 mailbox_destroy (mbox); 522 mu_mailbox_destroy (mbox);
523 exit (3); 523 exit (3);
524 } 524 }
525 525
...@@ -538,7 +538,7 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total) ...@@ -538,7 +538,7 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
538 int status; 538 int status;
539 url_t url; 539 url_t url;
540 540
541 status = mailbox_create_default (&mbox, mailbox_name); 541 status = mu_mailbox_create_default (&mbox, mailbox_name);
542 if (status != 0) 542 if (status != 0)
543 { 543 {
544 if (mailbox_name) 544 if (mailbox_name)
...@@ -553,13 +553,13 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total) ...@@ -553,13 +553,13 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
553 if (frm_debug) 553 if (frm_debug)
554 { 554 {
555 mu_debug_t debug; 555 mu_debug_t debug;
556 mailbox_get_debug (mbox, &debug); 556 mu_mailbox_get_debug (mbox, &debug);
557 mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT); 557 mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
558 } 558 }
559 559
560 mailbox_get_url (mbox, &url); 560 mu_mailbox_get_url (mbox, &url);
561 561
562 status = mailbox_open (mbox, MU_STREAM_READ); 562 status = mu_mailbox_open (mbox, MU_STREAM_READ);
563 if (status == ENOENT) 563 if (status == ENOENT)
564 *total = 0; 564 *total = 0;
565 else if (status != 0) 565 else if (status != 0)
...@@ -578,10 +578,10 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total) ...@@ -578,10 +578,10 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
578 578
579 observer_create (&observer, mbox); 579 observer_create (&observer, mbox);
580 observer_set_action (observer, action, mbox); 580 observer_set_action (observer, action, mbox);
581 mailbox_get_observable (mbox, &observable); 581 mu_mailbox_get_observable (mbox, &observable);
582 observable_attach (observable, MU_EVT_MESSAGE_ADD, observer); 582 observable_attach (observable, MU_EVT_MESSAGE_ADD, observer);
583 583
584 status = mailbox_scan (mbox, 1, total); 584 status = mu_mailbox_scan (mbox, 1, total);
585 if (status != 0) 585 if (status != 0)
586 { 586 {
587 mu_error (_("Could not scan mailbox `%s': %s."), 587 mu_error (_("Could not scan mailbox `%s': %s."),
...@@ -592,12 +592,12 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total) ...@@ -592,12 +592,12 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
592 observable_detach (observable, observer); 592 observable_detach (observable, observer);
593 observer_destroy (&observer, mbox); 593 observer_destroy (&observer, mbox);
594 594
595 if ((status = mailbox_close (mbox)) != 0) 595 if ((status = mu_mailbox_close (mbox)) != 0)
596 { 596 {
597 mu_error (_("Could not close mailbox `%s': %s"), 597 mu_error (_("Could not close mailbox `%s': %s"),
598 url_to_string (url), mu_strerror (status)); 598 url_to_string (url), mu_strerror (status));
599 exit (3); 599 exit (3);
600 } 600 }
601 } 601 }
602 mailbox_destroy (&mbox); 602 mu_mailbox_destroy (&mbox);
603 } 603 }
......
...@@ -244,16 +244,16 @@ frm_select (size_t index, message_t msg) ...@@ -244,16 +244,16 @@ frm_select (size_t index, message_t msg)
244 message_get_attribute (msg, &attr); 244 message_get_attribute (msg, &attr);
245 message_get_header (msg, &hdr); 245 message_get_header (msg, &hdr);
246 246
247 if (attribute_is_read (attr)) 247 if (mu_attribute_is_read (attr))
248 counter.read++; 248 counter.read++;
249 else if (attribute_is_seen (attr)) 249 else if (mu_attribute_is_seen (attr))
250 counter.unread++; 250 counter.unread++;
251 else if (attribute_is_recent (attr)) 251 else if (mu_attribute_is_recent (attr))
252 counter.new++; 252 counter.new++;
253 253
254 if (((select_attribute & IS_READ) && (!attribute_is_read (attr))) 254 if (((select_attribute & IS_READ) && (!mu_attribute_is_read (attr)))
255 || ((select_attribute & IS_NEW) && (!attribute_is_recent (attr))) 255 || ((select_attribute & IS_NEW) && (!mu_attribute_is_recent (attr)))
256 || ((select_attribute & IS_OLD) && (!attribute_is_seen (attr)))) 256 || ((select_attribute & IS_OLD) && (!mu_attribute_is_seen (attr))))
257 return 0; 257 return 0;
258 258
259 if (select_attribute) 259 if (select_attribute)
...@@ -265,7 +265,7 @@ frm_select (size_t index, message_t msg) ...@@ -265,7 +265,7 @@ frm_select (size_t index, message_t msg)
265 265
266 /* This is a clone of the elm program call "frm". It is a good example on 266 /* This is a clone of the elm program call "frm". It is a good example on
267 how to use the observable(callback) of libmailbox. "frm" has to 267 how to use the observable(callback) of libmailbox. "frm" has to
268 be very interactive, it is not possible to call mailbox_messages_count() 268 be very interactive, it is not possible to call mu_mailbox_messages_count()
269 and wait for the scanning to finish before displaying. As soon as the scan 269 and wait for the scanning to finish before displaying. As soon as the scan
270 finds a new message we want to know about it. This is done by registering 270 finds a new message we want to know about it. This is done by registering
271 an observable type MU_MAILBOX_MSG_ADD. The rest is formatting code. */ 271 an observable type MU_MAILBOX_MSG_ADD. The rest is formatting code. */
......
...@@ -92,7 +92,7 @@ from_select (size_t index, message_t msg) ...@@ -92,7 +92,7 @@ from_select (size_t index, message_t msg)
92 char *sender; 92 char *sender;
93 message_get_header (msg, &hdr); 93 message_get_header (msg, &hdr);
94 94
95 if (header_aget_value_unfold (hdr, MU_HEADER_FROM, &sender) == 0) 95 if (mu_header_aget_value_unfold (hdr, MU_HEADER_FROM, &sender) == 0)
96 { 96 {
97 if (strstr (sender, sender_option)) 97 if (strstr (sender, sender_option))
98 rc = 1; 98 rc = 1;
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -37,8 +37,8 @@ collect_open_default () ...@@ -37,8 +37,8 @@ collect_open_default ()
37 exit (1); 37 exit (1);
38 } 38 }
39 } 39 }
40 if (mailbox_create (&mbox, default_mailbox) != 0 40 if (mu_mailbox_create (&mbox, default_mailbox) != 0
41 || mailbox_open (mbox, MU_STREAM_RDWR) != 0) 41 || mu_mailbox_open (mbox, MU_STREAM_RDWR) != 0)
42 { 42 {
43 util_error (_("Cannot open default mailbox %s: %s"), 43 util_error (_("Cannot open default mailbox %s: %s"),
44 default_mailbox, mu_strerror (errno)); 44 default_mailbox, mu_strerror (errno));
...@@ -46,7 +46,7 @@ collect_open_default () ...@@ -46,7 +46,7 @@ collect_open_default ()
46 } 46 }
47 47
48 /* Suck in the messages */ 48 /* Suck in the messages */
49 mailbox_messages_count (mbox, &nmesg); 49 mu_mailbox_messages_count (mbox, &nmesg);
50 } 50 }
51 51
52 /* Open temporary file for collecting incoming messages */ 52 /* Open temporary file for collecting incoming messages */
...@@ -109,8 +109,8 @@ collect_create_mailbox () ...@@ -109,8 +109,8 @@ collect_create_mailbox ()
109 109
110 fclose (temp_file); 110 fclose (temp_file);
111 111
112 if (mailbox_create (&mbox, temp_filename) != 0 112 if (mu_mailbox_create (&mbox, temp_filename) != 0
113 || mailbox_open (mbox, MU_STREAM_READ) != 0) 113 || mu_mailbox_open (mbox, MU_STREAM_READ) != 0)
114 { 114 {
115 util_error (_("Cannot create temp mailbox %s: %s"), 115 util_error (_("Cannot create temp mailbox %s: %s"),
116 temp_filename, strerror (errno)); 116 temp_filename, strerror (errno));
...@@ -119,7 +119,7 @@ collect_create_mailbox () ...@@ -119,7 +119,7 @@ collect_create_mailbox ()
119 } 119 }
120 120
121 /* Suck in the messages */ 121 /* Suck in the messages */
122 mailbox_messages_count (mbox, &nmesg); 122 mu_mailbox_messages_count (mbox, &nmesg);
123 123
124 if (nmesg == 0) 124 if (nmesg == 0)
125 { 125 {
...@@ -137,39 +137,39 @@ collect_output () ...@@ -137,39 +137,39 @@ collect_output ()
137 137
138 if (!temp_filename) 138 if (!temp_filename)
139 { 139 {
140 mailbox_expunge (mbox); 140 mu_mailbox_expunge (mbox);
141 return 0; 141 return 0;
142 } 142 }
143 143
144 if (user_name) 144 if (user_name)
145 saved_umask = umask (077); 145 saved_umask = umask (077);
146 146
147 if (mailbox_create_default (&outbox, default_mailbox) != 0 147 if (mu_mailbox_create_default (&outbox, default_mailbox) != 0
148 || mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0) 148 || mu_mailbox_open (outbox, MU_STREAM_RDWR|MU_STREAM_CREAT) != 0)
149 { 149 {
150 mailbox_destroy (&outbox); 150 mu_mailbox_destroy (&outbox);
151 fprintf (stderr, _("Cannot open output mailbox %s: %s\n"), 151 fprintf (stderr, _("Cannot open output mailbox %s: %s\n"),
152 default_mailbox, strerror (errno)); 152 default_mailbox, strerror (errno));
153 return 1; 153 return 1;
154 } 154 }
155 155
156 mailbox_messages_count (mbox, &count); 156 mu_mailbox_messages_count (mbox, &count);
157 for (i = 1; i <= count; i++) 157 for (i = 1; i <= count; i++)
158 { 158 {
159 message_t msg = NULL; 159 message_t msg = NULL;
160 attribute_t attr = NULL; 160 attribute_t attr = NULL;
161 161
162 mailbox_get_message (mbox, i, &msg); 162 mu_mailbox_get_message (mbox, i, &msg);
163 message_get_attribute (msg, &attr); 163 message_get_attribute (msg, &attr);
164 if (!attribute_is_deleted (attr)) 164 if (!mu_attribute_is_deleted (attr))
165 { 165 {
166 attribute_set_recent (attr); 166 mu_attribute_set_recent (attr);
167 mailbox_append_message (outbox, msg); 167 mu_mailbox_append_message (outbox, msg);
168 } 168 }
169 } 169 }
170 170
171 mailbox_close (outbox); 171 mu_mailbox_close (outbox);
172 mailbox_destroy (&outbox); 172 mu_mailbox_destroy (&outbox);
173 173
174 if (user_name) 174 if (user_name)
175 umask (saved_umask); 175 umask (saved_umask);
...@@ -181,8 +181,8 @@ collect_output () ...@@ -181,8 +181,8 @@ collect_output ()
181 void 181 void
182 collect_drop_mailbox () 182 collect_drop_mailbox ()
183 { 183 {
184 mailbox_close (mbox); 184 mu_mailbox_close (mbox);
185 mailbox_destroy (&mbox); 185 mu_mailbox_destroy (&mbox);
186 if (temp_filename) 186 if (temp_filename)
187 { 187 {
188 unlink (temp_filename); 188 unlink (temp_filename);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2 Copyright (C) 1999, 2000, 2001, 2002, 2003,
3 2004 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -147,7 +147,7 @@ int ...@@ -147,7 +147,7 @@ int
147 main (int argc, char *argv[]) 147 main (int argc, char *argv[])
148 { 148 {
149 int c = argc; 149 int c = argc;
150 guimb_param_t param; 150 mu_guimb_param_t param;
151 struct guimb_data gd; 151 struct guimb_data gd;
152 152
153 /* Native Language Support */ 153 /* Native Language Support */
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -38,29 +38,29 @@ util_get_sender (int msgno) ...@@ -38,29 +38,29 @@ util_get_sender (int msgno)
38 message_t msg = NULL; 38 message_t msg = NULL;
39 char buffer[512]; 39 char buffer[512];
40 40
41 mailbox_get_message (mbox, msgno, &msg); 41 mu_mailbox_get_message (mbox, msgno, &msg);
42 message_get_header (msg, &header); 42 message_get_header (msg, &header);
43 if (header_get_value (header, MU_HEADER_FROM, buffer, sizeof (buffer), NULL) 43 if (mu_header_get_value (header, MU_HEADER_FROM, buffer, sizeof (buffer), NULL)
44 || address_create (&addr, buffer)) 44 || mu_address_create (&addr, buffer))
45 { 45 {
46 envelope_t env = NULL; 46 envelope_t env = NULL;
47 message_get_envelope (msg, &env); 47 message_get_envelope (msg, &env);
48 if (envelope_sender (env, buffer, sizeof (buffer), NULL) 48 if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL)
49 || address_create (&addr, buffer)) 49 || mu_address_create (&addr, buffer))
50 { 50 {
51 util_error (_("Cannot determine sender name (msg %d)"), msgno); 51 util_error (_("Cannot determine sender name (msg %d)"), msgno);
52 return NULL; 52 return NULL;
53 } 53 }
54 } 54 }
55 55
56 if (address_get_email (addr, 1, buffer, sizeof (buffer), NULL)) 56 if (mu_address_get_email (addr, 1, buffer, sizeof (buffer), NULL))
57 { 57 {
58 util_error (_("Cannot determine sender name (msg %d)"), msgno); 58 util_error (_("Cannot determine sender name (msg %d)"), msgno);
59 address_destroy (&addr); 59 mu_address_destroy (&addr);
60 return NULL; 60 return NULL;
61 } 61 }
62 62
63 address_destroy (&addr); 63 mu_address_destroy (&addr);
64 return strdup (buffer); 64 return strdup (buffer);
65 } 65 }
66 66
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -41,17 +41,17 @@ imap4d_append (struct imap4d_command *command, char *arg)
41 if (!mboxname) 41 if (!mboxname)
42 return util_finish (command, RESP_NO, "Couldn't open mailbox"); 42 return util_finish (command, RESP_NO, "Couldn't open mailbox");
43 43
44 status = mailbox_create_default (&dest_mbox, mboxname); 44 status = mu_mailbox_create_default (&dest_mbox, mboxname);
45 if (status == 0) 45 if (status == 0)
46 { 46 {
47 /* It SHOULD NOT automatifcllly create the mailbox. */ 47 /* It SHOULD NOT automatifcllly create the mailbox. */
48 status = mailbox_open (dest_mbox, MU_STREAM_RDWR); 48 status = mu_mailbox_open (dest_mbox, MU_STREAM_RDWR);
49 if (status == 0) 49 if (status == 0)
50 { 50 {
51 status = imap4d_append0 (dest_mbox, flags, sp); 51 status = imap4d_append0 (dest_mbox, flags, sp);
52 mailbox_close (dest_mbox); 52 mu_mailbox_close (dest_mbox);
53 } 53 }
54 mailbox_destroy (&dest_mbox); 54 mu_mailbox_destroy (&dest_mbox);
55 } 55 }
56 56
57 free (mboxname); 57 free (mboxname);
...@@ -64,7 +64,7 @@ imap4d_append (struct imap4d_command *command, char *arg) ...@@ -64,7 +64,7 @@ imap4d_append (struct imap4d_command *command, char *arg)
64 static int 64 static int
65 _append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite) 65 _append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
66 { 66 {
67 message_t msg = envelope_get_owner (envelope); 67 message_t msg = mu_envelope_get_owner (envelope);
68 struct tm **tm = message_get_owner (msg); 68 struct tm **tm = message_get_owner (msg);
69 69
70 strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm); 70 strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm);
...@@ -119,19 +119,19 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text) ...@@ -119,19 +119,19 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text)
119 stream_write (stream, text, strlen (text), len, &len); 119 stream_write (stream, text, strlen (text), len, &len);
120 message_set_stream (msg, stream, &tm); 120 message_set_stream (msg, stream, &tm);
121 121
122 envelope_create (&env, msg); 122 mu_envelope_create (&env, msg);
123 envelope_set_date (env, _append_date, msg); 123 mu_envelope_set_date (env, _append_date, msg);
124 envelope_set_sender (env, _append_sender, msg); 124 mu_envelope_set_sender (env, _append_sender, msg);
125 message_set_envelope (msg, env, &tm); 125 message_set_envelope (msg, env, &tm);
126 rc = mailbox_append_message (mbox, msg); 126 rc = mu_mailbox_append_message (mbox, msg);
127 if (rc == 0 && flags) 127 if (rc == 0 && flags)
128 { 128 {
129 size_t num = 0; 129 size_t num = 0;
130 attribute_t attr = NULL; 130 attribute_t attr = NULL;
131 mailbox_messages_count (mbox, &num); 131 mu_mailbox_messages_count (mbox, &num);
132 mailbox_get_message (mbox, num, &msg); 132 mu_mailbox_get_message (mbox, num, &msg);
133 message_get_attribute (msg, &attr); 133 message_get_attribute (msg, &attr);
134 attribute_set_flags (attr, flags); 134 mu_attribute_set_flags (attr, flags);
135 } 135 }
136 136
137 message_destroy (&msg, &tm); 137 message_destroy (&msg, &tm);
......
...@@ -33,7 +33,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags) ...@@ -33,7 +33,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags)
33 { 33 {
34 int rc; 34 int rc;
35 35
36 rc = gsasl_stream_create (newstr, transport, sess_ctx, flags); 36 rc = mu_gsasl_stream_create (newstr, transport, sess_ctx, flags);
37 if (rc) 37 if (rc)
38 { 38 {
39 syslog (LOG_ERR, _("cannot create SASL stream: %s"), 39 syslog (LOG_ERR, _("cannot create SASL stream: %s"),
...@@ -269,9 +269,9 @@ cb_retrieve (Gsasl_session_ctx *ctx, ...@@ -269,9 +269,9 @@ cb_retrieve (Gsasl_session_ctx *ctx,
269 if (username && *username == 0 && authentication_id) 269 if (username && *username == 0 && authentication_id)
270 *username = strdup (authentication_id); 270 *username = strdup (authentication_id);
271 271
272 if (gsasl_cram_md5_pwd && access (gsasl_cram_md5_pwd, R_OK) == 0) 272 if (mu_gsasl_cram_md5_pwd && access (mu_gsasl_cram_md5_pwd, R_OK) == 0)
273 { 273 {
274 int rc = gsasl_md5pwd_get_password (gsasl_cram_md5_pwd, 274 int rc = gsasl_md5pwd_get_password (mu_gsasl_cram_md5_pwd,
275 authentication_id, 275 authentication_id,
276 key, keylen); 276 key, keylen);
277 if (rc == GSASL_OK) 277 if (rc == GSASL_OK)
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -44,16 +44,16 @@ auth_add (char *name, imap4d_auth_handler_fp handler)
44 p->handler = handler; 44 p->handler = handler;
45 if (!imap_auth_list) 45 if (!imap_auth_list)
46 { 46 {
47 list_create (&imap_auth_list); 47 mu_list_create (&imap_auth_list);
48 list_set_comparator (imap_auth_list, comp); 48 mu_list_set_comparator (imap_auth_list, comp);
49 } 49 }
50 list_append (imap_auth_list, (void*)p); 50 mu_list_append (imap_auth_list, (void*)p);
51 } 51 }
52 52
53 void 53 void
54 auth_remove (char *name) 54 auth_remove (char *name)
55 { 55 {
56 list_remove (imap_auth_list, (void*) name); 56 mu_list_remove (imap_auth_list, (void*) name);
57 } 57 }
58 58
59 static int 59 static int
...@@ -90,7 +90,7 @@ _auth_try (void *item, void *data) ...@@ -90,7 +90,7 @@ _auth_try (void *item, void *data)
90 void 90 void
91 imap4d_auth_capability () 91 imap4d_auth_capability ()
92 { 92 {
93 list_do (imap_auth_list, _auth_capa, NULL); 93 mu_list_do (imap_auth_list, _auth_capa, NULL);
94 } 94 }
95 95
96 int 96 int
...@@ -113,7 +113,7 @@ imap4d_authenticate (struct imap4d_command *command, char *arg) ...@@ -113,7 +113,7 @@ imap4d_authenticate (struct imap4d_command *command, char *arg)
113 adata.arg = sp; 113 adata.arg = sp;
114 adata.username = NULL; 114 adata.username = NULL;
115 115
116 if (list_do (imap_auth_list, _auth_try, &adata) == 0) 116 if (mu_list_do (imap_auth_list, _auth_try, &adata) == 0)
117 return util_finish (command, RESP_NO, 117 return util_finish (command, RESP_NO,
118 "Authentication mechanism not supported"); 118 "Authentication mechanism not supported");
119 119
......
...@@ -31,9 +31,9 @@ imap4d_bye0 (int reason, struct imap4d_command *command) ...@@ -31,9 +31,9 @@ imap4d_bye0 (int reason, struct imap4d_command *command)
31 31
32 if (mbox) 32 if (mbox)
33 { 33 {
34 mailbox_flush (mbox, 0); 34 mu_mailbox_flush (mbox, 0);
35 mailbox_close (mbox); 35 mu_mailbox_close (mbox);
36 mailbox_destroy (&mbox); 36 mu_mailbox_destroy (&mbox);
37 } 37 }
38 38
39 switch (reason) 39 switch (reason)
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
...@@ -31,16 +31,16 @@ imap4d_capability_add (const char *str) ...@@ -31,16 +31,16 @@ imap4d_capability_add (const char *str)
31 { 31 {
32 if (!capa_list) 32 if (!capa_list)
33 { 33 {
34 list_create (&capa_list); 34 mu_list_create (&capa_list);
35 list_set_comparator (capa_list, comp); 35 mu_list_set_comparator (capa_list, comp);
36 } 36 }
37 list_append (capa_list, (void*)str); 37 mu_list_append (capa_list, (void*)str);
38 } 38 }
39 39
40 void 40 void
41 imap4d_capability_remove (const char *str) 41 imap4d_capability_remove (const char *str)
42 { 42 {
43 list_remove (capa_list, (void*)str); 43 mu_list_remove (capa_list, (void*)str);
44 } 44 }
45 45
46 void 46 void
...@@ -71,7 +71,7 @@ imap4d_capability (struct imap4d_command *command, char *arg ARG_UNUSED) ...@@ -71,7 +71,7 @@ imap4d_capability (struct imap4d_command *command, char *arg ARG_UNUSED)
71 { 71 {
72 util_send ("* CAPABILITY"); 72 util_send ("* CAPABILITY");
73 73
74 list_do (capa_list, print_capa, NULL); 74 mu_list_do (capa_list, print_capa, NULL);
75 75
76 imap4d_auth_capability (); 76 imap4d_auth_capability ();
77 util_send ("\r\n"); 77 util_send ("\r\n");
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -30,10 +30,10 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED)
30 const char *msg = NULL; 30 const char *msg = NULL;
31 int status, flags; 31 int status, flags;
32 32
33 mailbox_get_flags (mbox, &flags); 33 mu_mailbox_get_flags (mbox, &flags);
34 if ((flags & MU_STREAM_READ) == 0) 34 if ((flags & MU_STREAM_READ) == 0)
35 { 35 {
36 status = mailbox_flush (mbox, 1); 36 status = mu_mailbox_flush (mbox, 1);
37 if (status) 37 if (status)
38 { 38 {
39 syslog (LOG_ERR, 39 syslog (LOG_ERR,
...@@ -44,13 +44,13 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED) ...@@ -44,13 +44,13 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED)
44 44
45 /* No messages are removed, and no error is given, if the mailbox is 45 /* No messages are removed, and no error is given, if the mailbox is
46 selected by an EXAMINE command or is otherwise selected read-only. */ 46 selected by an EXAMINE command or is otherwise selected read-only. */
47 status = mailbox_close (mbox); 47 status = mu_mailbox_close (mbox);
48 if (status) 48 if (status)
49 { 49 {
50 syslog (LOG_ERR, _("closing mailbox failed: %s"), mu_strerror (status)); 50 syslog (LOG_ERR, _("closing mailbox failed: %s"), mu_strerror (status));
51 msg = "closing mailbox failed"; 51 msg = "closing mailbox failed";
52 } 52 }
53 mailbox_destroy (&mbox); 53 mu_mailbox_destroy (&mbox);
54 54
55 if (msg) 55 if (msg)
56 return util_finish (command, RESP_NO, msg); 56 return util_finish (command, RESP_NO, msg);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -81,11 +81,11 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
81 81
82 /* If the destination mailbox does not exist, a server should return 82 /* If the destination mailbox does not exist, a server should return
83 an error. */ 83 an error. */
84 status = mailbox_create_default (&cmbox, mailbox_name); 84 status = mu_mailbox_create_default (&cmbox, mailbox_name);
85 if (status == 0) 85 if (status == 0)
86 { 86 {
87 /* It SHOULD NOT automatifcllly create the mailbox. */ 87 /* It SHOULD NOT automatifcllly create the mailbox. */
88 status = mailbox_open (cmbox, MU_STREAM_RDWR); 88 status = mu_mailbox_open (cmbox, MU_STREAM_RDWR);
89 if (status == 0) 89 if (status == 0)
90 { 90 {
91 size_t i; 91 size_t i;
...@@ -93,12 +93,12 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen) ...@@ -93,12 +93,12 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
93 { 93 {
94 message_t msg = NULL; 94 message_t msg = NULL;
95 size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; 95 size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
96 if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0) 96 if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0)
97 mailbox_append_message (cmbox, msg); 97 mu_mailbox_append_message (cmbox, msg);
98 } 98 }
99 mailbox_close (cmbox); 99 mu_mailbox_close (cmbox);
100 } 100 }
101 mailbox_destroy (&cmbox); 101 mu_mailbox_destroy (&cmbox);
102 } 102 }
103 free (set); 103 free (set);
104 free (mailbox_name); 104 free (mailbox_name);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -31,7 +31,7 @@ imap4d_expunge (struct imap4d_command *command, char *arg)
31 return util_finish (command, RESP_NO, "Too many args"); 31 return util_finish (command, RESP_NO, "Too many args");
32 32
33 /* FIXME: check for errors. */ 33 /* FIXME: check for errors. */
34 mailbox_expunge (mbox); 34 mu_mailbox_expunge (mbox);
35 35
36 imap4d_sync (); 36 imap4d_sync ();
37 return util_finish (command, RESP_OK, "Completed"); 37 return util_finish (command, RESP_OK, "Completed");
......
...@@ -169,7 +169,7 @@ imap4d_fetch0 (char *arg, int isuid, char *resp, size_t resplen) ...@@ -169,7 +169,7 @@ imap4d_fetch0 (char *arg, int isuid, char *resp, size_t resplen)
169 size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; 169 size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
170 message_t msg = NULL; 170 message_t msg = NULL;
171 171
172 if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0) 172 if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0)
173 { 173 {
174 char item[32]; 174 char item[32];
175 char *items = strdup (sp); 175 char *items = strdup (sp);
...@@ -356,7 +356,7 @@ fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED) ...@@ -356,7 +356,7 @@ fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED)
356 356
357 message_get_envelope (command->msg, &env); 357 message_get_envelope (command->msg, &env);
358 date[0] = '\0'; 358 date[0] = '\0';
359 if (envelope_date (env, date, sizeof (date), NULL) == 0) 359 if (mu_envelope_date (env, date, sizeof (date), NULL) == 0)
360 { 360 {
361 char *p = date; 361 char *p = date;
362 if (mu_parse_ctime_date_time ((const char **) &p, &tm, &tz) == 0) 362 if (mu_parse_ctime_date_time ((const char **) &p, &tm, &tz) == 0)
...@@ -498,10 +498,10 @@ fetch_body (struct fetch_command *command, char **arg) ...@@ -498,10 +498,10 @@ fetch_body (struct fetch_command *command, char **arg)
498 { 498 {
499 attribute_t attr = NULL; 499 attribute_t attr = NULL;
500 message_get_attribute (command->msg, &attr); 500 message_get_attribute (command->msg, &attr);
501 if (!attribute_is_read (attr)) 501 if (!mu_attribute_is_read (attr))
502 { 502 {
503 util_send ("FLAGS (\\Seen) "); 503 util_send ("FLAGS (\\Seen) ");
504 attribute_set_read (attr); 504 mu_attribute_set_read (attr);
505 } 505 }
506 } 506 }
507 else if (strncasecmp (*arg,".PEEK", 5) == 0) 507 else if (strncasecmp (*arg,".PEEK", 5) == 0)
...@@ -534,7 +534,7 @@ fetch_send_header_value (header_t header, const char *name, ...@@ -534,7 +534,7 @@ fetch_send_header_value (header_t header, const char *name,
534 534
535 if (space) 535 if (space)
536 util_send (" "); 536 util_send (" ");
537 if (header_aget_value (header, name, &buffer) == 0) 537 if (mu_header_aget_value (header, name, &buffer) == 0)
538 { 538 {
539 util_send_qstring (buffer); 539 util_send_qstring (buffer);
540 free (buffer); 540 free (buffer);
...@@ -553,7 +553,7 @@ fetch_send_header_list (header_t header, const char *name, ...@@ -553,7 +553,7 @@ fetch_send_header_list (header_t header, const char *name,
553 553
554 if (space) 554 if (space)
555 util_send (" "); 555 util_send (" ");
556 if (header_aget_value (header, name, &buffer) == 0) 556 if (mu_header_aget_value (header, name, &buffer) == 0)
557 { 557 {
558 send_parameter_list (buffer); 558 send_parameter_list (buffer);
559 free (buffer); 559 free (buffer);
...@@ -572,7 +572,7 @@ fetch_send_header_address (header_t header, const char *name, ...@@ -572,7 +572,7 @@ fetch_send_header_address (header_t header, const char *name,
572 572
573 if (space) 573 if (space)
574 util_send (" "); 574 util_send (" ");
575 if (header_aget_value (header, name, &buffer) == 0) 575 if (mu_header_aget_value (header, name, &buffer) == 0)
576 { 576 {
577 fetch_send_address (buffer); 577 fetch_send_address (buffer);
578 free (buffer); 578 free (buffer);
...@@ -603,7 +603,7 @@ fetch_envelope0 (message_t msg) ...@@ -603,7 +603,7 @@ fetch_envelope0 (message_t msg)
603 fetch_send_header_value (header, "Subject", NULL, 1); 603 fetch_send_header_value (header, "Subject", NULL, 1);
604 604
605 /* From: */ 605 /* From: */
606 header_aget_value (header, "From", &from); 606 mu_header_aget_value (header, "From", &from);
607 util_send (" "); 607 util_send (" ");
608 fetch_send_address (from); 608 fetch_send_address (from);
609 609
...@@ -670,13 +670,13 @@ fetch_bodystructure0 (message_t message, int extension) ...@@ -670,13 +670,13 @@ fetch_bodystructure0 (message_t message, int extension)
670 670
671 671
672 /* The subtype. */ 672 /* The subtype. */
673 if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) 673 if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
674 { 674 {
675 int argc = 0; 675 int argc = 0;
676 char **argv; 676 char **argv;
677 char *s; 677 char *s;
678 678
679 argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); 679 mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
680 680
681 s = strchr (argv[0], '/'); 681 s = strchr (argv[0], '/');
682 if (s) 682 if (s)
...@@ -733,7 +733,7 @@ fetch_bodystructure0 (message_t message, int extension) ...@@ -733,7 +733,7 @@ fetch_bodystructure0 (message_t message, int extension)
733 } 733 }
734 else 734 else
735 util_send (" NIL"); 735 util_send (" NIL");
736 argcv_free (argc, argv); 736 mu_argcv_free (argc, argv);
737 free (buffer); 737 free (buffer);
738 } 738 }
739 else 739 else
...@@ -807,13 +807,13 @@ bodystructure (message_t msg, int extension) ...@@ -807,13 +807,13 @@ bodystructure (message_t msg, int extension)
807 807
808 message_get_header (msg, &header); 808 message_get_header (msg, &header);
809 809
810 if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) 810 if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0)
811 { 811 {
812 int argc = 0; 812 int argc = 0;
813 char **argv; 813 char **argv;
814 char *s, *p; 814 char *s, *p;
815 815
816 argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); 816 mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
817 817
818 if (strcasecmp (argv[0], "MESSAGE/RFC822") == 0) 818 if (strcasecmp (argv[0], "MESSAGE/RFC822") == 0)
819 message_rfc822 = 1; 819 message_rfc822 = 1;
...@@ -890,7 +890,7 @@ bodystructure (message_t msg, int extension) ...@@ -890,7 +890,7 @@ bodystructure (message_t msg, int extension)
890 } 890 }
891 else 891 else
892 util_send (" NIL"); 892 util_send (" NIL");
893 argcv_free (argc, argv); 893 mu_argcv_free (argc, argv);
894 free (buffer); 894 free (buffer);
895 } 895 }
896 else 896 else
...@@ -914,8 +914,8 @@ bodystructure (message_t msg, int extension) ...@@ -914,8 +914,8 @@ bodystructure (message_t msg, int extension)
914 size_t size = 0; 914 size_t size = 0;
915 body_t body = NULL; 915 body_t body = NULL;
916 message_get_body (msg, &body); 916 message_get_body (msg, &body);
917 body_size (body, &size); 917 mu_body_size (body, &size);
918 body_lines (body, &blines); 918 mu_body_lines (body, &blines);
919 util_send (" %d", size + blines); 919 util_send (" %d", size + blines);
920 } 920 }
921 921
...@@ -1125,9 +1125,9 @@ fetch_header (message_t msg, unsigned long start, unsigned long end) ...@@ -1125,9 +1125,9 @@ fetch_header (message_t msg, unsigned long start, unsigned long end)
1125 stream_t stream = NULL; 1125 stream_t stream = NULL;
1126 size_t size = 0, lines = 0; 1126 size_t size = 0, lines = 0;
1127 message_get_header (msg, &header); 1127 message_get_header (msg, &header);
1128 header_size (header, &size); 1128 mu_header_size (header, &size);
1129 header_lines (header, &lines); 1129 mu_header_lines (header, &lines);
1130 header_get_stream (header, &stream); 1130 mu_header_get_stream (header, &stream);
1131 return fetch_io (stream, start, end, size + lines); 1131 return fetch_io (stream, start, end, size + lines);
1132 } 1132 }
1133 1133
...@@ -1138,9 +1138,9 @@ fetch_body_content (message_t msg, unsigned long start, unsigned long end) ...@@ -1138,9 +1138,9 @@ fetch_body_content (message_t msg, unsigned long start, unsigned long end)
1138 stream_t stream = NULL; 1138 stream_t stream = NULL;
1139 size_t size = 0, lines = 0; 1139 size_t size = 0, lines = 0;
1140 message_get_body (msg, &body); 1140 message_get_body (msg, &body);
1141 body_size (body, &size); 1141 mu_body_size (body, &size);
1142 body_lines (body, &lines); 1142 mu_body_lines (body, &lines);
1143 body_get_stream (body, &stream); 1143 mu_body_get_stream (body, &stream);
1144 return fetch_io (stream, start, end, size + lines); 1144 return fetch_io (stream, start, end, size + lines);
1145 } 1145 }
1146 1146
...@@ -1152,7 +1152,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end, ...@@ -1152,7 +1152,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end,
1152 size_t n = 0; 1152 size_t n = 0;
1153 off_t offset; 1153 off_t offset;
1154 1154
1155 filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ); 1155 mu_filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ);
1156 1156
1157 if (start == ULONG_MAX || end == ULONG_MAX) 1157 if (start == ULONG_MAX || end == ULONG_MAX)
1158 { 1158 {
...@@ -1254,7 +1254,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, ...@@ -1254,7 +1254,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start,
1254 { 1254 {
1255 char *value = NULL; 1255 char *value = NULL;
1256 size_t n = 0; 1256 size_t n = 0;
1257 if (header_aget_value (header, array[j], &value)) 1257 if (mu_header_aget_value (header, array[j], &value))
1258 continue; 1258 continue;
1259 1259
1260 n = asprintf (&buffer, "%s: %s\n", array[j], value); 1260 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, ...@@ -1349,7 +1349,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
1349 header_t header = NULL; 1349 header_t header = NULL;
1350 size_t count = 0; 1350 size_t count = 0;
1351 message_get_header (msg, &header); 1351 message_get_header (msg, &header);
1352 header_get_field_count (header, &count); 1352 mu_header_get_field_count (header, &count);
1353 for (i = 1; i <= count; i++) 1353 for (i = 1; i <= count; i++)
1354 { 1354 {
1355 char *name = NULL; 1355 char *name = NULL;
...@@ -1358,7 +1358,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, ...@@ -1358,7 +1358,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
1358 size_t ignore = 0; 1358 size_t ignore = 0;
1359 1359
1360 /* Get the field name. */ 1360 /* Get the field name. */
1361 status = header_aget_field_name (header, i, &name); 1361 status = mu_header_aget_field_name (header, i, &name);
1362 if (*name == '\0') 1362 if (*name == '\0')
1363 { 1363 {
1364 free (name); 1364 free (name);
...@@ -1383,7 +1383,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, ...@@ -1383,7 +1383,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start,
1383 } 1383 }
1384 } 1384 }
1385 1385
1386 if (header_aget_field_value (header, i, &value) == 0) 1386 if (mu_header_aget_field_value (header, i, &value) == 0)
1387 { 1387 {
1388 char *nl; 1388 char *nl;
1389 1389
...@@ -1448,8 +1448,8 @@ fetch_send_address (const char *addr) ...@@ -1448,8 +1448,8 @@ fetch_send_address (const char *addr)
1448 return RESP_OK; 1448 return RESP_OK;
1449 } 1449 }
1450 1450
1451 address_create (&address, addr); 1451 mu_address_create (&address, addr);
1452 address_get_count (address, &count); 1452 mu_address_get_count (address, &count);
1453 1453
1454 /* We failed: can't parse. */ 1454 /* We failed: can't parse. */
1455 if (count == 0) 1455 if (count == 0)
...@@ -1466,13 +1466,13 @@ fetch_send_address (const char *addr) ...@@ -1466,13 +1466,13 @@ fetch_send_address (const char *addr)
1466 util_send ("("); 1466 util_send ("(");
1467 1467
1468 *buf = '\0'; 1468 *buf = '\0';
1469 address_get_personal (address, i, buf, sizeof (buf), NULL); 1469 mu_address_get_personal (address, i, buf, sizeof (buf), NULL);
1470 util_send_qstring (buf); 1470 util_send_qstring (buf);
1471 1471
1472 util_send (" "); 1472 util_send (" ");
1473 1473
1474 *buf = '\0'; 1474 *buf = '\0';
1475 address_get_route (address, i, buf, sizeof (buf), NULL); 1475 mu_address_get_route (address, i, buf, sizeof (buf), NULL);
1476 util_send_qstring (buf); 1476 util_send_qstring (buf);
1477 1477
1478 util_send (" "); 1478 util_send (" ");
...@@ -1481,18 +1481,18 @@ fetch_send_address (const char *addr) ...@@ -1481,18 +1481,18 @@ fetch_send_address (const char *addr)
1481 { 1481 {
1482 int is_group = 0; 1482 int is_group = 0;
1483 1483
1484 address_is_group (address, i, &is_group); 1484 mu_address_is_group (address, i, &is_group);
1485 if (is_group) 1485 if (is_group)
1486 address_get_personal (address, i, buf, sizeof (buf), NULL); 1486 mu_address_get_personal (address, i, buf, sizeof (buf), NULL);
1487 else 1487 else
1488 address_get_local_part (address, i, buf, sizeof (buf), NULL); 1488 mu_address_get_local_part (address, i, buf, sizeof (buf), NULL);
1489 } 1489 }
1490 util_send_qstring (buf); 1490 util_send_qstring (buf);
1491 1491
1492 util_send (" "); 1492 util_send (" ");
1493 1493
1494 *buf = '\0'; 1494 *buf = '\0';
1495 address_get_domain (address, i, buf, sizeof (buf), NULL); 1495 mu_address_get_domain (address, i, buf, sizeof (buf), NULL);
1496 util_send_qstring (buf); 1496 util_send_qstring (buf);
1497 1497
1498 util_send (")"); 1498 util_send (")");
...@@ -1514,7 +1514,7 @@ send_parameter_list (const char *buffer) ...@@ -1514,7 +1514,7 @@ send_parameter_list (const char *buffer)
1514 return; 1514 return;
1515 } 1515 }
1516 1516
1517 argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); 1517 mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv);
1518 1518
1519 if (argc == 0) 1519 if (argc == 0)
1520 util_send ("NIL"); 1520 util_send ("NIL");
...@@ -1575,7 +1575,7 @@ send_parameter_list (const char *buffer) ...@@ -1575,7 +1575,7 @@ send_parameter_list (const char *buffer)
1575 util_send (" NIL"); 1575 util_send (" NIL");
1576 util_send (")"); 1576 util_send (")");
1577 } 1577 }
1578 argcv_free (argc, argv); 1578 mu_argcv_free (argc, argv);
1579 } 1579 }
1580 1580
1581 1581
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -218,7 +219,7 @@ main (int argc, char **argv) ...@@ -218,7 +219,7 @@ main (int argc, char **argv)
218 219
219 if (daemon_param.pidfile) 220 if (daemon_param.pidfile)
220 { 221 {
221 daemon_create_pidfile (daemon_param.pidfile); 222 mu_daemon_create_pidfile (daemon_param.pidfile);
222 } 223 }
223 224
224 /* Check TLS environment, i.e. cert and key files */ 225 /* Check TLS environment, i.e. cert and key files */
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
...@@ -291,7 +292,7 @@ void util_set_output (stream_t str); ...@@ -291,7 +292,7 @@ void util_set_output (stream_t str);
291 int util_wait_input (int); 292 int util_wait_input (int);
292 293
293 void util_register_event (int old_state, int new_state, 294 void util_register_event (int old_state, int new_state,
294 list_action_t *action, void *data); 295 mu_list_action_t *action, void *data);
295 void util_event_remove (void *id); 296 void util_event_remove (void *id);
296 void util_run_events (int old_state, int new_state); 297 void util_run_events (int old_state, int new_state);
297 298
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -79,8 +79,8 @@ imap4d_rename (struct imap4d_command *command, char *arg)
79 } 79 }
80 name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1); 80 name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1);
81 sprintf (name, "mbox:%s", newname); 81 sprintf (name, "mbox:%s", newname);
82 if (mailbox_create (&newmbox, newname) != 0 82 if (mu_mailbox_create (&newmbox, newname) != 0
83 || mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0) 83 || mu_mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0)
84 { 84 {
85 free (name); 85 free (name);
86 free (newname); 86 free (newname);
...@@ -89,29 +89,29 @@ imap4d_rename (struct imap4d_command *command, char *arg) ...@@ -89,29 +89,29 @@ imap4d_rename (struct imap4d_command *command, char *arg)
89 free (name); 89 free (name);
90 free (newname); 90 free (newname);
91 91
92 if (mailbox_create_default (&inbox, auth_data->name) == 0 && 92 if (mu_mailbox_create_default (&inbox, auth_data->name) == 0 &&
93 mailbox_open (inbox, MU_STREAM_RDWR) == 0) 93 mu_mailbox_open (inbox, MU_STREAM_RDWR) == 0)
94 { 94 {
95 size_t no; 95 size_t no;
96 size_t total = 0; 96 size_t total = 0;
97 mailbox_messages_count (inbox, &total); 97 mu_mailbox_messages_count (inbox, &total);
98 for (no = 1; no <= total; no++) 98 for (no = 1; no <= total; no++)
99 { 99 {
100 message_t message; 100 message_t message;
101 if (mailbox_get_message (inbox, no, &message) == 0) 101 if (mu_mailbox_get_message (inbox, no, &message) == 0)
102 { 102 {
103 attribute_t attr = NULL; 103 attribute_t attr = NULL;
104 mailbox_append_message (newmbox, message); 104 mu_mailbox_append_message (newmbox, message);
105 message_get_attribute (message, &attr); 105 message_get_attribute (message, &attr);
106 attribute_set_deleted (attr); 106 mu_attribute_set_deleted (attr);
107 } 107 }
108 } 108 }
109 mailbox_expunge (inbox); 109 mu_mailbox_expunge (inbox);
110 mailbox_close (inbox); 110 mu_mailbox_close (inbox);
111 mailbox_destroy (&inbox); 111 mu_mailbox_destroy (&inbox);
112 } 112 }
113 mailbox_close (newmbox); 113 mu_mailbox_close (newmbox);
114 mailbox_destroy (&newmbox); 114 mu_mailbox_destroy (&newmbox);
115 return util_finish (command, RESP_OK, "Already exist"); 115 return util_finish (command, RESP_OK, "Already exist");
116 } 116 }
117 117
......
...@@ -274,12 +274,12 @@ do_search (struct parsebuf *pb) ...@@ -274,12 +274,12 @@ do_search (struct parsebuf *pb)
274 { 274 {
275 size_t count = 0; 275 size_t count = 0;
276 276
277 mailbox_messages_count (mbox, &count); 277 mu_mailbox_messages_count (mbox, &count);
278 278
279 util_send ("* SEARCH"); 279 util_send ("* SEARCH");
280 for (pb->msgno = 1; pb->msgno <= count; pb->msgno++) 280 for (pb->msgno = 1; pb->msgno <= count; pb->msgno++)
281 { 281 {
282 if (mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0 282 if (mu_mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0
283 && search_run (pb)) 283 && search_run (pb))
284 { 284 {
285 if (pb->isuid) 285 if (pb->isuid)
...@@ -665,7 +665,7 @@ _scan_header (struct parsebuf *pb, char *name, char *value) ...@@ -665,7 +665,7 @@ _scan_header (struct parsebuf *pb, char *name, char *value)
665 header_t header = NULL; 665 header_t header = NULL;
666 666
667 message_get_header (pb->msg, &header); 667 message_get_header (pb->msg, &header);
668 if (!header_get_value (header, name, buffer, sizeof(buffer), NULL)) 668 if (!mu_header_get_value (header, name, buffer, sizeof(buffer), NULL))
669 { 669 {
670 return util_strcasestr (buffer, value) != NULL; 670 return util_strcasestr (buffer, value) != NULL;
671 } 671 }
...@@ -680,7 +680,7 @@ _header_date (struct parsebuf *pb, time_t *timep) ...@@ -680,7 +680,7 @@ _header_date (struct parsebuf *pb, time_t *timep)
680 header_t header = NULL; 680 header_t header = NULL;
681 681
682 message_get_header (pb->msg, &header); 682 message_get_header (pb->msg, &header);
683 if (!header_get_value (header, "Date", buffer, sizeof(buffer), NULL) 683 if (!mu_header_get_value (header, "Date", buffer, sizeof(buffer), NULL)
684 && util_parse_822_date (buffer, timep)) 684 && util_parse_822_date (buffer, timep))
685 return 0; 685 return 0;
686 return 1; 686 return 1;
...@@ -696,10 +696,10 @@ _scan_header_all (struct parsebuf *pb, char *text) ...@@ -696,10 +696,10 @@ _scan_header_all (struct parsebuf *pb, char *text)
696 int i, rc; 696 int i, rc;
697 697
698 message_get_header (pb->msg, &header); 698 message_get_header (pb->msg, &header);
699 header_get_field_count (header, &fcount); 699 mu_header_get_field_count (header, &fcount);
700 for (i = rc = 0; i < fcount; i++) 700 for (i = rc = 0; i < fcount; i++)
701 { 701 {
702 if (header_get_field_value (header, i, buffer, sizeof(buffer), NULL)) 702 if (mu_header_get_field_value (header, i, buffer, sizeof(buffer), NULL))
703 rc = util_strcasestr (buffer, text) != NULL; 703 rc = util_strcasestr (buffer, text) != NULL;
704 } 704 }
705 return rc; 705 return rc;
...@@ -718,9 +718,9 @@ _scan_body (struct parsebuf *pb, char *text) ...@@ -718,9 +718,9 @@ _scan_body (struct parsebuf *pb, char *text)
718 int rc; 718 int rc;
719 719
720 message_get_body (pb->msg, &body); 720 message_get_body (pb->msg, &body);
721 body_size (body, &size); 721 mu_body_size (body, &size);
722 body_lines (body, &lines); 722 mu_body_lines (body, &lines);
723 body_get_stream (body, &stream); 723 mu_body_get_stream (body, &stream);
724 rc = 0; 724 rc = 0;
725 while (rc == 0 725 while (rc == 0
726 && stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0 726 && stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0
...@@ -794,7 +794,7 @@ cond_before (struct parsebuf *pb) ...@@ -794,7 +794,7 @@ cond_before (struct parsebuf *pb)
794 envelope_t env; 794 envelope_t env;
795 795
796 message_get_envelope (pb->msg, &env); 796 message_get_envelope (pb->msg, &env);
797 envelope_date (env, buffer, sizeof (buffer), NULL); 797 mu_envelope_date (env, buffer, sizeof (buffer), NULL);
798 util_parse_ctime_date (buffer, &mesg_time); 798 util_parse_ctime_date (buffer, &mesg_time);
799 _search_push (pb, mesg_time < t); 799 _search_push (pb, mesg_time < t);
800 } 800 }
...@@ -820,7 +820,7 @@ cond_from (struct parsebuf *pb) ...@@ -820,7 +820,7 @@ cond_from (struct parsebuf *pb)
820 int rc = 0; 820 int rc = 0;
821 821
822 message_get_envelope (pb->msg, &env); 822 message_get_envelope (pb->msg, &env);
823 if (envelope_sender (env, buffer, sizeof (buffer), NULL) == 0) 823 if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL) == 0)
824 rc = util_strcasestr (buffer, s) != NULL; 824 rc = util_strcasestr (buffer, s) != NULL;
825 _search_push (pb, _scan_header (pb, "from", s)); 825 _search_push (pb, _scan_header (pb, "from", s));
826 } 826 }
...@@ -863,7 +863,7 @@ cond_on (struct parsebuf *pb) ...@@ -863,7 +863,7 @@ cond_on (struct parsebuf *pb)
863 envelope_t env; 863 envelope_t env;
864 864
865 message_get_envelope (pb->msg, &env); 865 message_get_envelope (pb->msg, &env);
866 envelope_date (env, buffer, sizeof (buffer), NULL); 866 mu_envelope_date (env, buffer, sizeof (buffer), NULL);
867 util_parse_ctime_date (buffer, &mesg_time); 867 util_parse_ctime_date (buffer, &mesg_time);
868 _search_push (pb, t <= mesg_time && mesg_time <= t + 86400); 868 _search_push (pb, t <= mesg_time && mesg_time <= t + 86400);
869 } 869 }
...@@ -907,7 +907,7 @@ cond_since (struct parsebuf *pb) ...@@ -907,7 +907,7 @@ cond_since (struct parsebuf *pb)
907 envelope_t env; 907 envelope_t env;
908 908
909 message_get_envelope (pb->msg, &env); 909 message_get_envelope (pb->msg, &env);
910 envelope_date (env, buffer, sizeof (buffer), NULL); 910 mu_envelope_date (env, buffer, sizeof (buffer), NULL);
911 util_parse_ctime_date (buffer, &mesg_time); 911 util_parse_ctime_date (buffer, &mesg_time);
912 _search_push (pb, mesg_time >= t); 912 _search_push (pb, mesg_time >= t);
913 } 913 }
......
...@@ -48,9 +48,9 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags) ...@@ -48,9 +48,9 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
48 currently selected mailbox without doing an expunge. */ 48 currently selected mailbox without doing an expunge. */
49 if (mbox) 49 if (mbox)
50 { 50 {
51 mailbox_save_attributes (mbox); 51 mu_mailbox_save_attributes (mbox);
52 mailbox_close (mbox); 52 mu_mailbox_close (mbox);
53 mailbox_destroy (&mbox); 53 mu_mailbox_destroy (&mbox);
54 /* Destroy the old uid table. */ 54 /* Destroy the old uid table. */
55 imap4d_sync (); 55 imap4d_sync ();
56 } 56 }
...@@ -60,8 +60,8 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags) ...@@ -60,8 +60,8 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
60 if (!mailbox_name) 60 if (!mailbox_name)
61 return util_finish (command, RESP_NO, "Couldn't open mailbox"); 61 return util_finish (command, RESP_NO, "Couldn't open mailbox");
62 62
63 if ((status = mailbox_create (&mbox, mailbox_name)) == 0 63 if ((status = mu_mailbox_create (&mbox, mailbox_name)) == 0
64 && (status = mailbox_open (mbox, flags)) == 0) 64 && (status = mu_mailbox_open (mbox, flags)) == 0)
65 { 65 {
66 select_flags = flags; 66 select_flags = flags;
67 state = STATE_SEL; 67 state = STATE_SEL;
...@@ -97,10 +97,10 @@ imap4d_select_status () ...@@ -97,10 +97,10 @@ imap4d_select_status ()
97 return 0; /* FIXME: this should be something! */ 97 return 0; /* FIXME: this should be something! */
98 98
99 if ((status = util_uidvalidity (mbox, &uidvalidity)) 99 if ((status = util_uidvalidity (mbox, &uidvalidity))
100 || (status = mailbox_uidnext (mbox, &uidnext)) 100 || (status = mu_mailbox_uidnext (mbox, &uidnext))
101 || (status = mailbox_messages_count (mbox, &count)) 101 || (status = mu_mailbox_messages_count (mbox, &count))
102 || (status = mailbox_messages_recent (mbox, &recent)) 102 || (status = mu_mailbox_messages_recent (mbox, &recent))
103 || (status = mailbox_message_unseen (mbox, &unseen))) 103 || (status = mu_mailbox_message_unseen (mbox, &unseen)))
104 return status; 104 return status;
105 105
106 /* This outputs EXISTS and RECENT responses */ 106 /* This outputs EXISTS and RECENT responses */
......
...@@ -75,10 +75,10 @@ imap4d_status (struct imap4d_command *command, char *arg) ...@@ -75,10 +75,10 @@ imap4d_status (struct imap4d_command *command, char *arg)
75 if (!mailbox_name) 75 if (!mailbox_name)
76 return util_finish (command, RESP_NO, "Error opening mailbox"); 76 return util_finish (command, RESP_NO, "Error opening mailbox");
77 77
78 status = mailbox_create_default (&smbox, mailbox_name); 78 status = mu_mailbox_create_default (&smbox, mailbox_name);
79 if (status == 0) 79 if (status == 0)
80 { 80 {
81 status = mailbox_open (smbox, MU_STREAM_READ); 81 status = mu_mailbox_open (smbox, MU_STREAM_READ);
82 if (status == 0) 82 if (status == 0)
83 { 83 {
84 char item[32]; 84 char item[32];
...@@ -110,9 +110,9 @@ imap4d_status (struct imap4d_command *command, char *arg) ...@@ -110,9 +110,9 @@ imap4d_status (struct imap4d_command *command, char *arg)
110 } 110 }
111 if (count > 0) 111 if (count > 0)
112 util_send (")\r\n"); 112 util_send (")\r\n");
113 mailbox_close (smbox); 113 mu_mailbox_close (smbox);
114 } 114 }
115 mailbox_destroy (&smbox); 115 mu_mailbox_destroy (&smbox);
116 } 116 }
117 free (mailbox_name); 117 free (mailbox_name);
118 118
...@@ -132,7 +132,7 @@ static int ...@@ -132,7 +132,7 @@ static int
132 status_messages (mailbox_t smbox) 132 status_messages (mailbox_t smbox)
133 { 133 {
134 size_t total = 0; 134 size_t total = 0;
135 mailbox_messages_count (smbox, &total); 135 mu_mailbox_messages_count (smbox, &total);
136 util_send ("MESSAGES %u", total); 136 util_send ("MESSAGES %u", total);
137 return 0; 137 return 0;
138 } 138 }
...@@ -141,7 +141,7 @@ static int ...@@ -141,7 +141,7 @@ static int
141 status_recent (mailbox_t smbox) 141 status_recent (mailbox_t smbox)
142 { 142 {
143 size_t recent = 0; 143 size_t recent = 0;
144 mailbox_messages_recent (smbox, &recent); 144 mu_mailbox_messages_recent (smbox, &recent);
145 util_send ("RECENT %u", recent); 145 util_send ("RECENT %u", recent);
146 return 0; 146 return 0;
147 } 147 }
...@@ -150,7 +150,7 @@ static int ...@@ -150,7 +150,7 @@ static int
150 status_uidnext (mailbox_t smbox) 150 status_uidnext (mailbox_t smbox)
151 { 151 {
152 size_t uidnext = 1; 152 size_t uidnext = 1;
153 mailbox_uidnext (smbox, &uidnext); 153 mu_mailbox_uidnext (smbox, &uidnext);
154 util_send ("UIDNEXT %u", uidnext); 154 util_send ("UIDNEXT %u", uidnext);
155 return 0; 155 return 0;
156 } 156 }
...@@ -173,14 +173,14 @@ status_unseen (mailbox_t smbox) ...@@ -173,14 +173,14 @@ status_unseen (mailbox_t smbox)
173 size_t total = 0; 173 size_t total = 0;
174 size_t unseen = 0; 174 size_t unseen = 0;
175 size_t i; 175 size_t i;
176 mailbox_messages_count (smbox, &total); 176 mu_mailbox_messages_count (smbox, &total);
177 for (i = 1; i <= total; i++) 177 for (i = 1; i <= total; i++)
178 { 178 {
179 message_t msg = NULL; 179 message_t msg = NULL;
180 attribute_t attr = NULL; 180 attribute_t attr = NULL;
181 mailbox_get_message (smbox, i, &msg); 181 mu_mailbox_get_message (smbox, i, &msg);
182 message_get_attribute (msg, &attr); 182 message_get_attribute (msg, &attr);
183 if (!attribute_is_seen (attr) && !attribute_is_read (attr)) 183 if (!mu_attribute_is_seen (attr) && !mu_attribute_is_read (attr))
184 unseen++; 184 unseen++;
185 } 185 }
186 util_send ("UNSEEN %d", unseen); 186 util_send ("UNSEEN %d", unseen);
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
3 3
4 GNU Mailutils is free software; you can redistribute it and/or modify 4 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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) ...@@ -111,7 +111,7 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
111 msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; 111 msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
112 if (msgno) 112 if (msgno)
113 { 113 {
114 mailbox_get_message (mbox, msgno, &msg); 114 mu_mailbox_get_message (mbox, msgno, &msg);
115 message_get_attribute (msg, &attr); 115 message_get_attribute (msg, &attr);
116 116
117 /* Get the fetch command names. */ 117 /* Get the fetch command names. */
...@@ -123,19 +123,19 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen) ...@@ -123,19 +123,19 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
123 if (!util_attribute_to_type (item, &type)) 123 if (!util_attribute_to_type (item, &type))
124 { 124 {
125 if (how == STORE_ADD ) 125 if (how == STORE_ADD )
126 attribute_set_flags (attr, type); 126 mu_attribute_set_flags (attr, type);
127 else if (how == STORE_UNSET ) 127 else if (how == STORE_UNSET )
128 attribute_unset_flags (attr, type); 128 mu_attribute_unset_flags (attr, type);
129 else if (how == STORE_SET ) 129 else if (how == STORE_SET )
130 { 130 {
131 if (first) 131 if (first)
132 { 132 {
133 attribute_set_flags (attr, 0); 133 mu_attribute_set_flags (attr, 0);
134 first = 0; 134 first = 0;
135 } 135 }
136 attribute_set_flags (attr, type); 136 mu_attribute_set_flags (attr, type);
137 } 137 }
138 attribute_set_flags (attr, MU_ATTRIBUTE_MODIFIED); 138 mu_attribute_set_flags (attr, MU_ATTRIBUTE_MODIFIED);
139 } 139 }
140 } 140 }
141 } 141 }
......
...@@ -53,9 +53,9 @@ notify_flag (size_t msgno, attribute_t oattr) ...@@ -53,9 +53,9 @@ notify_flag (size_t msgno, attribute_t oattr)
53 message_t msg = NULL; 53 message_t msg = NULL;
54 attribute_t nattr = NULL; 54 attribute_t nattr = NULL;
55 int status ; 55 int status ;
56 mailbox_get_message (mbox, msgno, &msg); 56 mu_mailbox_get_message (mbox, msgno, &msg);
57 message_get_attribute (msg, &nattr); 57 message_get_attribute (msg, &nattr);
58 status = attribute_is_equal (oattr, nattr); 58 status = mu_attribute_is_equal (oattr, nattr);
59 59
60 if (status == 0) 60 if (status == 0)
61 { 61 {
...@@ -63,41 +63,41 @@ notify_flag (size_t msgno, attribute_t oattr) ...@@ -63,41 +63,41 @@ notify_flag (size_t msgno, attribute_t oattr)
63 if (!abuf) 63 if (!abuf)
64 imap4d_bye (ERR_NO_MEM); 64 imap4d_bye (ERR_NO_MEM);
65 *abuf = '\0'; 65 *abuf = '\0';
66 if (attribute_is_seen (nattr) && attribute_is_read (nattr)) 66 if (mu_attribute_is_seen (nattr) && mu_attribute_is_read (nattr))
67 if (!attribute_is_seen (oattr) && !attribute_is_read (oattr)) 67 if (!mu_attribute_is_seen (oattr) && !mu_attribute_is_read (oattr))
68 { 68 {
69 attribute_set_seen (oattr); 69 mu_attribute_set_seen (oattr);
70 attribute_set_read (oattr); 70 mu_attribute_set_read (oattr);
71 add_flag (&abuf, "\\Seen"); 71 add_flag (&abuf, "\\Seen");
72 } 72 }
73 if (attribute_is_answered (nattr)) 73 if (mu_attribute_is_answered (nattr))
74 if (!attribute_is_answered (oattr)) 74 if (!mu_attribute_is_answered (oattr))
75 { 75 {
76 attribute_set_answered (oattr); 76 mu_attribute_set_answered (oattr);
77 add_flag (&abuf, "\\Answered"); 77 add_flag (&abuf, "\\Answered");
78 } 78 }
79 if (attribute_is_flagged (nattr)) 79 if (mu_attribute_is_flagged (nattr))
80 if (!attribute_is_flagged (oattr)) 80 if (!mu_attribute_is_flagged (oattr))
81 { 81 {
82 attribute_set_flagged (oattr); 82 mu_attribute_set_flagged (oattr);
83 add_flag (&abuf, "\\Flagged"); 83 add_flag (&abuf, "\\Flagged");
84 } 84 }
85 if (attribute_is_deleted (nattr)) 85 if (mu_attribute_is_deleted (nattr))
86 if (!attribute_is_deleted (oattr)) 86 if (!mu_attribute_is_deleted (oattr))
87 { 87 {
88 attribute_set_deleted (oattr); 88 mu_attribute_set_deleted (oattr);
89 add_flag (&abuf, "\\Deleted"); 89 add_flag (&abuf, "\\Deleted");
90 } 90 }
91 if (attribute_is_draft (nattr)) 91 if (mu_attribute_is_draft (nattr))
92 if (!attribute_is_draft (oattr)) 92 if (!mu_attribute_is_draft (oattr))
93 { 93 {
94 attribute_set_draft (oattr); 94 mu_attribute_set_draft (oattr);
95 add_flag (&abuf, "\\Draft"); 95 add_flag (&abuf, "\\Draft");
96 } 96 }
97 if (attribute_is_recent (nattr)) 97 if (mu_attribute_is_recent (nattr))
98 if (!attribute_is_recent (oattr)) 98 if (!mu_attribute_is_recent (oattr))
99 { 99 {
100 attribute_set_recent (oattr); 100 mu_attribute_set_recent (oattr);
101 add_flag (&abuf, "\\Recent"); 101 add_flag (&abuf, "\\Recent");
102 } 102 }
103 if (*abuf) 103 if (*abuf)
...@@ -158,7 +158,7 @@ free_uids (void) ...@@ -158,7 +158,7 @@ free_uids (void)
158 { 158 {
159 size_t i; 159 size_t i;
160 for (i = 0; i < uid_table_count; i++) 160 for (i = 0; i < uid_table_count; i++)
161 attribute_destroy (&(uid_table[i].attr), NULL); 161 mu_attribute_destroy (&(uid_table[i].attr), NULL);
162 free (uid_table); 162 free (uid_table);
163 uid_table = NULL; 163 uid_table = NULL;
164 } 164 }
...@@ -183,7 +183,7 @@ reset_uids (void) ...@@ -183,7 +183,7 @@ reset_uids (void)
183 183
184 free_uids (); 184 free_uids ();
185 185
186 mailbox_messages_count (mbox, &total); 186 mu_mailbox_messages_count (mbox, &total);
187 for (i = 1; i <= total; i++) 187 for (i = 1; i <= total; i++)
188 { 188 {
189 message_t msg = NULL; 189 message_t msg = NULL;
...@@ -193,14 +193,14 @@ reset_uids (void) ...@@ -193,14 +193,14 @@ reset_uids (void)
193 (uid_table_count + 1)); 193 (uid_table_count + 1));
194 if (!uid_table) 194 if (!uid_table)
195 imap4d_bye (ERR_NO_MEM); 195 imap4d_bye (ERR_NO_MEM);
196 mailbox_get_message (mbox, i, &msg); 196 mu_mailbox_get_message (mbox, i, &msg);
197 message_get_attribute (msg, &attr); 197 message_get_attribute (msg, &attr);
198 message_get_uid (msg, &uid); 198 message_get_uid (msg, &uid);
199 uid_table[uid_table_count].uid = uid; 199 uid_table[uid_table_count].uid = uid;
200 uid_table[uid_table_count].msgno = i; 200 uid_table[uid_table_count].msgno = i;
201 uid_table[uid_table_count].notify = 0; 201 uid_table[uid_table_count].notify = 0;
202 attribute_create (&(uid_table[uid_table_count].attr), NULL); 202 mu_attribute_create (&(uid_table[uid_table_count].attr), NULL);
203 attribute_copy (uid_table[uid_table_count].attr, attr); 203 mu_attribute_copy (uid_table[uid_table_count].attr, attr);
204 uid_table_count++; 204 uid_table_count++;
205 } 205 }
206 uid_table_loaded = 1; 206 uid_table_loaded = 1;
...@@ -213,7 +213,7 @@ notify (void) ...@@ -213,7 +213,7 @@ notify (void)
213 int reset = 0; 213 int reset = 0;
214 size_t recent = 0; 214 size_t recent = 0;
215 215
216 mailbox_messages_count (mbox, &total); 216 mu_mailbox_messages_count (mbox, &total);
217 217
218 if (!uid_table) 218 if (!uid_table)
219 { 219 {
...@@ -229,12 +229,12 @@ notify (void) ...@@ -229,12 +229,12 @@ notify (void)
229 { 229 {
230 message_t msg = NULL; 230 message_t msg = NULL;
231 size_t uid = 0; 231 size_t uid = 0;
232 mailbox_get_message (mbox, i, &msg); 232 mu_mailbox_get_message (mbox, i, &msg);
233 message_get_uid (msg, &uid); 233 message_get_uid (msg, &uid);
234 notify_uid (uid); 234 notify_uid (uid);
235 } 235 }
236 notify_deleted (); 236 notify_deleted ();
237 mailbox_messages_recent (mbox, &recent); 237 mu_mailbox_messages_recent (mbox, &recent);
238 } 238 }
239 239
240 util_out (RESP_NONE, "%d EXISTS", total); 240 util_out (RESP_NONE, "%d EXISTS", total);
...@@ -265,9 +265,9 @@ imap4d_sync_flags (size_t msgno) ...@@ -265,9 +265,9 @@ imap4d_sync_flags (size_t msgno)
265 { 265 {
266 message_t msg = NULL; 266 message_t msg = NULL;
267 attribute_t attr = NULL; 267 attribute_t attr = NULL;
268 mailbox_get_message (mbox, msgno, &msg); 268 mu_mailbox_get_message (mbox, msgno, &msg);
269 message_get_attribute (msg, &attr); 269 message_get_attribute (msg, &attr);
270 attribute_copy (uid_table[i].attr, attr); 270 mu_attribute_copy (uid_table[i].attr, attr);
271 break; 271 break;
272 } 272 }
273 return 0; 273 return 0;
...@@ -299,7 +299,7 @@ imap4d_set_observer (mailbox_t mbox) ...@@ -299,7 +299,7 @@ imap4d_set_observer (mailbox_t mbox)
299 299
300 observer_create (&observer, mbox); 300 observer_create (&observer, mbox);
301 observer_set_action (observer, action, mbox); 301 observer_set_action (observer, action, mbox);
302 mailbox_get_observable (mbox, &observable); 302 mu_mailbox_get_observable (mbox, &observable);
303 observable_attach (observable, MU_EVT_MAILBOX_CORRUPT|MU_EVT_MAILBOX_DESTROY, 303 observable_attach (observable, MU_EVT_MAILBOX_CORRUPT|MU_EVT_MAILBOX_DESTROY,
304 observer); 304 observer);
305 mailbox_corrupt = 0; 305 mailbox_corrupt = 0;
...@@ -313,16 +313,16 @@ imap4d_sync (void) ...@@ -313,16 +313,16 @@ imap4d_sync (void)
313 If it was a close we do not send any notification. */ 313 If it was a close we do not send any notification. */
314 if (mbox == NULL) 314 if (mbox == NULL)
315 free_uids (); 315 free_uids ();
316 else if (!uid_table_loaded || !mailbox_is_updated (mbox)) 316 else if (!uid_table_loaded || !mu_mailbox_is_updated (mbox))
317 { 317 {
318 if (mailbox_corrupt) 318 if (mailbox_corrupt)
319 { 319 {
320 /* Some messages have been deleted from the mailbox by some other 320 /* Some messages have been deleted from the mailbox by some other
321 party */ 321 party */
322 int status = mailbox_close (mbox); 322 int status = mu_mailbox_close (mbox);
323 if (status) 323 if (status)
324 imap4d_bye (ERR_MAILBOX_CORRUPTED); 324 imap4d_bye (ERR_MAILBOX_CORRUPTED);
325 status = mailbox_open (mbox, MU_STREAM_RDWR); 325 status = mu_mailbox_open (mbox, MU_STREAM_RDWR);
326 if (status) 326 if (status)
327 imap4d_bye (ERR_MAILBOX_CORRUPTED); 327 imap4d_bye (ERR_MAILBOX_CORRUPTED);
328 imap4d_set_observer (mbox); 328 imap4d_set_observer (mbox);
...@@ -336,7 +336,7 @@ imap4d_sync (void) ...@@ -336,7 +336,7 @@ imap4d_sync (void)
336 else 336 else
337 { 337 {
338 size_t count = 0; 338 size_t count = 0;
339 mailbox_messages_count (mbox, &count); 339 mu_mailbox_messages_count (mbox, &count);
340 if (count != uid_table_count) 340 if (count != uid_table_count)
341 notify (); 341 notify ();
342 } 342 }
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 GNU Mailutils is free software; you can redistribute it and/or modify 5 GNU Mailutils is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 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) ...@@ -171,14 +172,14 @@ util_msgset (char *s, size_t ** set, int *n, int isuid)
171 unsigned long invalid_uid = 0; /* For UID mode only: have we 172 unsigned long invalid_uid = 0; /* For UID mode only: have we
172 encountered an uid > max uid? */ 173 encountered an uid > max uid? */
173 174
174 status = mailbox_messages_count (mbox, &max); 175 status = mu_mailbox_messages_count (mbox, &max);
175 if (status != 0) 176 if (status != 0)
176 return status; 177 return status;
177 /* If it is a uid sequence, override max with the UID. */ 178 /* If it is a uid sequence, override max with the UID. */
178 if (isuid) 179 if (isuid)
179 { 180 {
180 message_t msg = NULL; 181 message_t msg = NULL;
181 mailbox_get_message (mbox, max, &msg); 182 mu_mailbox_get_message (mbox, max, &msg);
182 message_get_uid (msg, &max); 183 message_get_uid (msg, &max);
183 } 184 }
184 185
...@@ -839,7 +840,7 @@ util_print_flags (attribute_t attr) ...@@ -839,7 +840,7 @@ util_print_flags (attribute_t attr)
839 int flags = 0; 840 int flags = 0;
840 int space = 0; 841 int space = 0;
841 842
842 attribute_get_flags (attr, &flags); 843 mu_attribute_get_flags (attr, &flags);
843 for (i = 0; i < _imap4d_nattr; i++) 844 for (i = 0; i < _imap4d_nattr; i++)
844 if (flags & _imap4d_attrlist[i].flag) 845 if (flags & _imap4d_attrlist[i].flag)
845 { 846 {
...@@ -863,7 +864,7 @@ util_attribute_matches_flag (attribute_t attr, const char *item) ...@@ -863,7 +864,7 @@ util_attribute_matches_flag (attribute_t attr, const char *item)
863 { 864 {
864 int flags = 0, mask = 0; 865 int flags = 0, mask = 0;
865 866
866 attribute_get_flags (attr, &flags); 867 mu_attribute_get_flags (attr, &flags);
867 util_attribute_to_type (item, &mask); 868 util_attribute_to_type (item, &mask);
868 if (mask == MU_ATTRIBUTE_RECENT) 869 if (mask == MU_ATTRIBUTE_RECENT)
869 return MU_ATTRIBUTE_IS_UNSEEN (flags); 870 return MU_ATTRIBUTE_IS_UNSEEN (flags);
...@@ -1088,11 +1089,11 @@ util_uidvalidity (mailbox_t smbox, unsigned long *uidvp) ...@@ -1088,11 +1089,11 @@ util_uidvalidity (mailbox_t smbox, unsigned long *uidvp)
1088 url_t mbox_url = NULL; 1089 url_t mbox_url = NULL;
1089 url_t smbox_url = NULL; 1090 url_t smbox_url = NULL;
1090 1091
1091 mailbox_get_url (mbox, &mbox_url); 1092 mu_mailbox_get_url (mbox, &mbox_url);
1092 mailbox_get_url (smbox, &smbox_url); 1093 mu_mailbox_get_url (smbox, &smbox_url);
1093 if (strcmp (url_to_string (mbox_url), url_to_string (smbox_url)) == 0) 1094 if (strcmp (url_to_string (mbox_url), url_to_string (smbox_url)) == 0)
1094 smbox = mbox; 1095 smbox = mbox;
1095 return mailbox_uidvalidity (smbox, uidvp); 1096 return mu_mailbox_uidvalidity (smbox, uidvp);
1096 } 1097 }
1097 1098
1098 1099
...@@ -1198,8 +1199,8 @@ void ...@@ -1198,8 +1199,8 @@ void
1198 util_atexit (void (*fp) (void)) 1199 util_atexit (void (*fp) (void))
1199 { 1200 {
1200 if (!atexit_list) 1201 if (!atexit_list)
1201 list_create (&atexit_list); 1202 mu_list_create (&atexit_list);
1202 list_append (atexit_list, (void*)fp); 1203 mu_list_append (atexit_list, (void*)fp);
1203 } 1204 }
1204 1205
1205 static int 1206 static int
...@@ -1223,13 +1224,13 @@ util_bye () ...@@ -1223,13 +1224,13 @@ util_bye ()
1223 stream_destroy (&ostream, stream_get_owner (ostream)); 1224 stream_destroy (&ostream, stream_get_owner (ostream));
1224 } 1225 }
1225 1226
1226 list_do (atexit_list, atexit_run, 0); 1227 mu_list_do (atexit_list, atexit_run, 0);
1227 } 1228 }
1228 1229
1229 struct state_event { 1230 struct state_event {
1230 int old_state; 1231 int old_state;
1231 int new_state; 1232 int new_state;
1232 list_action_t *action; 1233 mu_list_action_t *action;
1233 void *data; 1234 void *data;
1234 }; 1235 };
1235 1236
...@@ -1237,7 +1238,7 @@ static list_t event_list; ...@@ -1237,7 +1238,7 @@ static list_t event_list;
1237 1238
1238 void 1239 void
1239 util_register_event (int old_state, int new_state, 1240 util_register_event (int old_state, int new_state,
1240 list_action_t *action, void *data) 1241 mu_list_action_t *action, void *data)
1241 { 1242 {
1242 struct state_event *evp = malloc (sizeof (*evp)); 1243 struct state_event *evp = malloc (sizeof (*evp));
1243 if (!evp) 1244 if (!evp)
...@@ -1247,14 +1248,14 @@ util_register_event (int old_state, int new_state, ...@@ -1247,14 +1248,14 @@ util_register_event (int old_state, int new_state,
1247 evp->action = action; 1248 evp->action = action;
1248 evp->data = data; 1249 evp->data = data;
1249 if (!event_list) 1250 if (!event_list)
1250 list_create (&event_list); 1251 mu_list_create (&event_list);
1251 list_append (event_list, (void*)evp); 1252 mu_list_append (event_list, (void*)evp);
1252 } 1253 }
1253 1254
1254 void 1255 void
1255 util_event_remove (void *id) 1256 util_event_remove (void *id)
1256 { 1257 {
1257 list_remove (event_list, id); 1258 mu_list_remove (event_list, id);
1258 } 1259 }
1259 1260
1260 static int 1261 static int
...@@ -1277,15 +1278,15 @@ util_run_events (int old_state, int new_state) ...@@ -1277,15 +1278,15 @@ util_run_events (int old_state, int new_state)
1277 ev.old_state = old_state; 1278 ev.old_state = old_state;
1278 ev.new_state = new_state; 1279 ev.new_state = new_state;
1279 1280
1280 list_get_iterator (event_list, &itr); 1281 mu_list_get_iterator (event_list, &itr);
1281 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 1282 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
1282 { 1283 {
1283 struct state_event *p; 1284 struct state_event *p;
1284 iterator_current (itr, (void **)&p); 1285 mu_iterator_current (itr, (void **)&p);
1285 if (event_exec (p, &ev)) 1286 if (event_exec (p, &ev))
1286 break; 1287 break;
1287 } 1288 }
1288 iterator_destroy (&itr); 1289 mu_iterator_destroy (&itr);
1289 } 1290 }
1290 } 1291 }
1291 1292
......
...@@ -25,52 +25,52 @@ ...@@ -25,52 +25,52 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int address_create (address_t *, const char *); 28 extern int mu_address_create (address_t *, const char *);
29 extern int address_createv (address_t *, const char *v[], size_t); 29 extern int mu_address_createv (address_t *, const char *v[], size_t);
30 extern void address_destroy (address_t *); 30 extern void mu_address_destroy (address_t *);
31 31
32 extern address_t address_dup (address_t src); 32 extern address_t mu_address_dup (address_t src);
33 33
34 /* Set FROM to null, after adding its addresses to TO. */ 34 /* Set FROM to null, after adding its addresses to TO. */
35 extern int address_concatenate (address_t to, address_t* from); 35 extern int mu_address_concatenate (address_t to, address_t* from);
36 36
37 extern int address_get_nth 37 extern int mu_address_get_nth
38 (address_t addr, size_t no, address_t *pret); 38 (address_t addr, size_t no, address_t *pret);
39 extern int address_get_email 39 extern int mu_address_get_email
40 (address_t, size_t, char *, size_t, size_t *); 40 (address_t, size_t, char *, size_t, size_t *);
41 extern int address_get_local_part 41 extern int mu_address_get_local_part
42 (address_t, size_t, char *, size_t, size_t *); 42 (address_t, size_t, char *, size_t, size_t *);
43 extern int address_get_domain 43 extern int mu_address_get_domain
44 (address_t, size_t, char *, size_t, size_t *); 44 (address_t, size_t, char *, size_t, size_t *);
45 extern int address_get_personal 45 extern int mu_address_get_personal
46 (address_t, size_t, char *, size_t, size_t *); 46 (address_t, size_t, char *, size_t, size_t *);
47 extern int address_get_comments 47 extern int mu_address_get_comments
48 (address_t, size_t, char *, size_t, size_t *); 48 (address_t, size_t, char *, size_t, size_t *);
49 extern int address_get_route 49 extern int mu_address_get_route
50 (address_t, size_t, char *, size_t, size_t *); 50 (address_t, size_t, char *, size_t, size_t *);
51 51
52 extern int address_aget_email 52 extern int mu_address_aget_email
53 (address_t, size_t, char **); 53 (address_t, size_t, char **);
54 extern int address_aget_local_part 54 extern int mu_address_aget_local_part
55 (address_t addr, size_t no, char **buf); 55 (address_t addr, size_t no, char **buf);
56 extern int address_aget_domain 56 extern int mu_address_aget_domain
57 (address_t addr, size_t no, char **buf); 57 (address_t addr, size_t no, char **buf);
58 extern int address_aget_personal 58 extern int mu_address_aget_personal
59 (address_t addr, size_t no, char **buf); 59 (address_t addr, size_t no, char **buf);
60 60
61 extern int address_is_group 61 extern int mu_address_is_group
62 (address_t, size_t, int*); 62 (address_t, size_t, int*);
63 63
64 extern int address_to_string (address_t, char *, size_t, size_t *); 64 extern int mu_address_to_string (address_t, char *, size_t, size_t *);
65 extern int address_get_count (address_t, size_t *); 65 extern int mu_address_get_count (address_t, size_t *);
66 extern int address_get_group_count (address_t, size_t *); 66 extern int mu_address_get_group_count (address_t, size_t *);
67 extern int address_get_email_count (address_t, size_t *); 67 extern int mu_address_get_email_count (address_t, size_t *);
68 extern int address_get_unix_mailbox_count (address_t, size_t *); 68 extern int mu_address_get_unix_mailbox_count (address_t, size_t *);
69 69
70 extern int address_contains_email (address_t addr, const char *email); 70 extern int mu_address_contains_email (address_t addr, const char *email);
71 extern int address_union (address_t *a, address_t b); 71 extern int mu_address_union (address_t *a, address_t b);
72 72
73 extern size_t address_format_string (address_t addr, char *buf, size_t buflen); 73 extern size_t mu_address_format_string (address_t addr, char *buf, size_t buflen);
74 74
75 #ifdef __cplusplus 75 #ifdef __cplusplus
76 } 76 }
......
...@@ -28,20 +28,20 @@ ...@@ -28,20 +28,20 @@
28 extern "C" { 28 extern "C" {
29 #endif 29 #endif
30 30
31 extern int argcv_get (const char *command, const char *delim, 31 extern int mu_argcv_get (const char *command, const char *delim,
32 const char* cmnt, 32 const char* cmnt,
33 int *argc, char ***argv); 33 int *argc, char ***argv);
34 extern int argcv_get_n (const char *command, int len, 34 extern int mu_argcv_get_n (const char *command, int len,
35 const char *delim, const char *cmnt, 35 const char *delim, const char *cmnt,
36 int *argc, char ***argv); 36 int *argc, char ***argv);
37 37
38 extern int argcv_string (int argc, char **argv, char **string); 38 extern int mu_argcv_string (int argc, char **argv, char **string);
39 extern int argcv_free (int argc, char **argv); 39 extern int mu_argcv_free (int argc, char **argv);
40 extern int argcv_unquote_char (int c); 40 extern int mu_argcv_unquote_char (int c);
41 extern int argcv_quote_char (int c); 41 extern int mu_argcv_quote_char (int c);
42 extern size_t argcv_quoted_length (const char *str, int *quote); 42 extern size_t mu_argcv_quoted_length (const char *str, int *quote);
43 extern void argcv_unquote_copy (char *dst, const char *src, size_t n); 43 extern void mu_argcv_unquote_copy (char *dst, const char *src, size_t n);
44 extern void argcv_quote_copy (char *dst, const char *src); 44 extern void mu_argcv_quote_copy (char *dst, const char *src);
45 45
46 #ifdef __cplusplus 46 #ifdef __cplusplus
47 } 47 }
......
...@@ -45,59 +45,59 @@ extern "C" { ...@@ -45,59 +45,59 @@ extern "C" {
45 #define MU_ATTRIBUTE_IS_UNREAD(f) \ 45 #define MU_ATTRIBUTE_IS_UNREAD(f) \
46 ((f) == 0 || ! ((f) & MU_ATTRIBUTE_READ)) 46 ((f) == 0 || ! ((f) & MU_ATTRIBUTE_READ))
47 47
48 extern int attribute_create (attribute_t *, void *); 48 extern int mu_attribute_create (attribute_t *, void *);
49 extern void attribute_destroy (attribute_t *, void *); 49 extern void mu_attribute_destroy (attribute_t *, void *);
50 extern void * attribute_get_owner (attribute_t); 50 extern void * mu_attribute_get_owner (attribute_t);
51 extern int attribute_is_modified (attribute_t); 51 extern int mu_attribute_is_modified (attribute_t);
52 extern int attribute_clear_modified (attribute_t); 52 extern int mu_attribute_clear_modified (attribute_t);
53 extern int attribute_set_modified (attribute_t attr); 53 extern int mu_attribute_set_modified (attribute_t attr);
54 54
55 extern int attribute_is_userflag (attribute_t, int); 55 extern int mu_attribute_is_userflag (attribute_t, int);
56 extern int attribute_is_seen (attribute_t); 56 extern int mu_attribute_is_seen (attribute_t);
57 extern int attribute_is_answered (attribute_t); 57 extern int mu_attribute_is_answered (attribute_t);
58 extern int attribute_is_flagged (attribute_t); 58 extern int mu_attribute_is_flagged (attribute_t);
59 extern int attribute_is_deleted (attribute_t); 59 extern int mu_attribute_is_deleted (attribute_t);
60 extern int attribute_is_draft (attribute_t); 60 extern int mu_attribute_is_draft (attribute_t);
61 extern int attribute_is_recent (attribute_t); 61 extern int mu_attribute_is_recent (attribute_t);
62 extern int attribute_is_read (attribute_t); 62 extern int mu_attribute_is_read (attribute_t);
63 63
64 extern int attribute_set_userflag (attribute_t, int); 64 extern int mu_attribute_set_userflag (attribute_t, int);
65 extern int attribute_set_seen (attribute_t); 65 extern int mu_attribute_set_seen (attribute_t);
66 extern int attribute_set_answered (attribute_t); 66 extern int mu_attribute_set_answered (attribute_t);
67 extern int attribute_set_flagged (attribute_t); 67 extern int mu_attribute_set_flagged (attribute_t);
68 extern int attribute_set_deleted (attribute_t); 68 extern int mu_attribute_set_deleted (attribute_t);
69 extern int attribute_set_draft (attribute_t); 69 extern int mu_attribute_set_draft (attribute_t);
70 extern int attribute_set_recent (attribute_t); 70 extern int mu_attribute_set_recent (attribute_t);
71 extern int attribute_set_read (attribute_t); 71 extern int mu_attribute_set_read (attribute_t);
72 72
73 extern int attribute_unset_userflag (attribute_t, int); 73 extern int mu_attribute_unset_userflag (attribute_t, int);
74 extern int attribute_unset_seen (attribute_t); 74 extern int mu_attribute_unset_seen (attribute_t);
75 extern int attribute_unset_answered (attribute_t); 75 extern int mu_attribute_unset_answered (attribute_t);
76 extern int attribute_unset_flagged (attribute_t); 76 extern int mu_attribute_unset_flagged (attribute_t);
77 extern int attribute_unset_deleted (attribute_t); 77 extern int mu_attribute_unset_deleted (attribute_t);
78 extern int attribute_unset_draft (attribute_t); 78 extern int mu_attribute_unset_draft (attribute_t);
79 extern int attribute_unset_recent (attribute_t); 79 extern int mu_attribute_unset_recent (attribute_t);
80 extern int attribute_unset_read (attribute_t); 80 extern int mu_attribute_unset_read (attribute_t);
81 81
82 extern int attribute_get_flags (attribute_t, int *); 82 extern int mu_attribute_get_flags (attribute_t, int *);
83 extern int attribute_set_flags (attribute_t, int); 83 extern int mu_attribute_set_flags (attribute_t, int);
84 extern int attribute_unset_flags (attribute_t, int); 84 extern int mu_attribute_unset_flags (attribute_t, int);
85 85
86 extern int attribute_set_set_flags (attribute_t, 86 extern int mu_attribute_set_set_flags (attribute_t,
87 int (*_set_flags) (attribute_t, int), 87 int (*_set_flags) (attribute_t, int),
88 void *); 88 void *);
89 extern int attribute_set_unset_flags (attribute_t, 89 extern int mu_attribute_set_unset_flags (attribute_t,
90 int (*_unset_flags) (attribute_t, int), 90 int (*_unset_flags) (attribute_t, int),
91 void *); 91 void *);
92 extern int attribute_set_get_flags (attribute_t, 92 extern int mu_attribute_set_get_flags (attribute_t,
93 int (*_get_flags) (attribute_t, int *), 93 int (*_get_flags) (attribute_t, int *),
94 void *); 94 void *);
95 extern int attribute_is_equal (attribute_t, attribute_t att2); 95 extern int mu_attribute_is_equal (attribute_t, attribute_t att2);
96 96
97 extern int attribute_copy (attribute_t, attribute_t); 97 extern int mu_attribute_copy (attribute_t, attribute_t);
98 98
99 extern int attribute_to_string (attribute_t, char *, size_t, size_t *); 99 extern int mu_attribute_to_string (attribute_t, char *, size_t, size_t *);
100 extern int string_to_flags (const char *, int *); 100 extern int mu_string_to_flags (const char *, int *);
101 101
102 #ifdef __cplusplus 102 #ifdef __cplusplus
103 } 103 }
......
...@@ -25,36 +25,36 @@ ...@@ -25,36 +25,36 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int ticket_create (ticket_t *, void *owner); 28 extern int mu_ticket_create (ticket_t *, void *owner);
29 extern void ticket_destroy (ticket_t *, void *owner); 29 extern void mu_ticket_destroy (ticket_t *, void *owner);
30 extern int ticket_set_destroy (ticket_t, void (*) (ticket_t), void *); 30 extern int mu_ticket_set_destroy (ticket_t, void (*) (ticket_t), void *);
31 extern void *ticket_get_owner (ticket_t); 31 extern void *mu_ticket_get_owner (ticket_t);
32 32
33 extern int ticket_set_pop (ticket_t, 33 extern int mu_ticket_set_pop (ticket_t,
34 int (*_pop) (ticket_t, url_t, const char *, char **), void *); 34 int (*_pop) (ticket_t, url_t, const char *, char **), void *);
35 extern int ticket_pop (ticket_t, url_t, const char *, char **); 35 extern int mu_ticket_pop (ticket_t, url_t, const char *, char **);
36 extern int ticket_set_data (ticket_t, void *, void *owner); 36 extern int mu_ticket_set_data (ticket_t, void *, void *owner);
37 extern int ticket_get_data (ticket_t, void **); 37 extern int mu_ticket_get_data (ticket_t, void **);
38 38
39 extern int authority_create (authority_t *, ticket_t, void *); 39 extern int mu_authority_create (authority_t *, ticket_t, void *);
40 extern void authority_destroy (authority_t *, void *); 40 extern void mu_authority_destroy (authority_t *, void *);
41 extern void *authority_get_owner (authority_t); 41 extern void *mu_authority_get_owner (authority_t);
42 extern int authority_set_ticket (authority_t, ticket_t); 42 extern int mu_authority_set_ticket (authority_t, ticket_t);
43 extern int authority_get_ticket (authority_t, ticket_t *); 43 extern int mu_authority_get_ticket (authority_t, ticket_t *);
44 extern int authority_authenticate (authority_t); 44 extern int mu_authority_authenticate (authority_t);
45 extern int authority_set_authenticate (authority_t, 45 extern int mu_authority_set_authenticate (authority_t,
46 int (*_authenticate) (authority_t), void *); 46 int (*_authenticate) (authority_t), void *);
47 47
48 extern int authority_create_null (authority_t *pauthority, void *owner); 48 extern int mu_authority_create_null (authority_t *pauthority, void *owner);
49 49
50 extern int wicket_create (wicket_t *, const char *); 50 extern int mu_wicket_create (wicket_t *, const char *);
51 extern void wicket_destroy (wicket_t *); 51 extern void mu_wicket_destroy (wicket_t *);
52 extern int wicket_set_filename (wicket_t, const char *); 52 extern int mu_wicket_set_filename (wicket_t, const char *);
53 extern int wicket_get_filename (wicket_t, char *, size_t, size_t *); 53 extern int mu_wicket_get_filename (wicket_t, char *, size_t, size_t *);
54 extern int wicket_set_ticket (wicket_t, 54 extern int mu_wicket_set_ticket (wicket_t,
55 int (*) (wicket_t, const char *, 55 int (*) (wicket_t, const char *,
56 const char *, ticket_t *)); 56 const char *, ticket_t *));
57 extern int wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *); 57 extern int mu_wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *);
58 58
59 #ifdef __cplusplus 59 #ifdef __cplusplus
60 } 60 }
......
...@@ -25,22 +25,22 @@ ...@@ -25,22 +25,22 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int body_create (body_t *, void *owner); 28 extern int mu_body_create (body_t *, void *owner);
29 extern void body_destroy (body_t *, void *owner); 29 extern void mu_body_destroy (body_t *, void *owner);
30 extern void * body_get_owner (body_t); 30 extern void * mu_body_get_owner (body_t);
31 extern int body_is_modified (body_t); 31 extern int mu_body_is_modified (body_t);
32 extern int body_clear_modified (body_t); 32 extern int mu_body_clear_modified (body_t);
33 33
34 extern int body_get_stream (body_t, stream_t *); 34 extern int mu_body_get_stream (body_t, stream_t *);
35 extern int body_set_stream (body_t, stream_t, void *owner); 35 extern int mu_body_set_stream (body_t, stream_t, void *owner);
36 36
37 extern int body_get_filename (body_t, char *, size_t, size_t *); 37 extern int mu_body_get_filename (body_t, char *, size_t, size_t *);
38 38
39 extern int body_size (body_t, size_t*); 39 extern int mu_body_size (body_t, size_t*);
40 extern int body_set_size (body_t, 40 extern int mu_body_set_size (body_t,
41 int (*_size) (body_t, size_t*), void *owner); 41 int (*_size) (body_t, size_t*), void *owner);
42 extern int body_lines (body_t, size_t *); 42 extern int mu_body_lines (body_t, size_t *);
43 extern int body_set_lines (body_t, 43 extern int mu_body_set_lines (body_t,
44 int (*_lines) (body_t, size_t*), void *owner); 44 int (*_lines) (body_t, size_t*), void *owner);
45 45
46 #ifdef __cplusplus 46 #ifdef __cplusplus
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int daemon_create_pidfile (const char *); 28 extern int mu_daemon_create_pidfile (const char *);
29 extern void daemon_remove_pidfile (void); 29 extern void mu_daemon_remove_pidfile (void);
30 30
31 #ifdef __cplusplus 31 #ifdef __cplusplus
32 } 32 }
......
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
25 extern "C" { /*}*/ 25 extern "C" { /*}*/
26 #endif 26 #endif
27 27
28 int envelope_create (envelope_t *, void *); 28 int mu_envelope_create (envelope_t *, void *);
29 void envelope_destroy (envelope_t *, void *); 29 void mu_envelope_destroy (envelope_t *, void *);
30 void * envelope_get_owner (envelope_t); 30 void * mu_envelope_get_owner (envelope_t);
31 int envelope_set_sender (envelope_t, 31 int mu_envelope_set_sender (envelope_t,
32 int (*_sender) (envelope_t, char *, size_t, size_t*), 32 int (*_sender) (envelope_t, char *, size_t, size_t*),
33 void *); 33 void *);
34 int envelope_sender (envelope_t, char *, size_t, size_t *); 34 int mu_envelope_sender (envelope_t, char *, size_t, size_t *);
35 int envelope_set_date (envelope_t, 35 int mu_envelope_set_date (envelope_t,
36 int (*_date) (envelope_t, char *, size_t , size_t *), 36 int (*_date) (envelope_t, char *, size_t , size_t *),
37 void *); 37 void *);
38 int envelope_date (envelope_t, char *, size_t, size_t *); 38 int mu_envelope_date (envelope_t, char *, size_t, size_t *);
39 39
40 #ifdef __cplusplus 40 #ifdef __cplusplus
41 } 41 }
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
27 extern "C" { 27 extern "C" {
28 #endif 28 #endif
29 29
30 typedef int (*error_pfn_t) __PMT ((const char *fmt, va_list ap)); 30 typedef int (*mu_error_pfn_t) (const char *fmt, va_list ap);
31 31
32 extern int mu_verror (const char *fmt, va_list ap); 32 extern int mu_verror (const char *fmt, va_list ap);
33 extern int mu_error (const char *fmt, ...); 33 extern int mu_error (const char *fmt, ...);
34 extern void mu_error_set_print (error_pfn_t); 34 extern void mu_error_set_print (mu_error_pfn_t);
35 35
36 int mu_default_error_printer (const char *fmt, va_list ap); 36 int mu_default_error_printer (const char *fmt, va_list ap);
37 int mu_syslog_error_printer (const char *fmt, va_list ap); 37 int mu_syslog_error_printer (const char *fmt, va_list ap);
......
...@@ -34,29 +34,29 @@ extern "C" { ...@@ -34,29 +34,29 @@ extern "C" {
34 #define MU_FILTER_WRITE MU_STREAM_WRITE 34 #define MU_FILTER_WRITE MU_STREAM_WRITE
35 #define MU_FILTER_RDWR MU_STREAM_RDWR 35 #define MU_FILTER_RDWR MU_STREAM_RDWR
36 36
37 struct _filter_record 37 struct mu_filter_record
38 { 38 {
39 const char *name; 39 const char *name;
40 int (*_filter) __PMT ((filter_t)); 40 int (*_filter) (filter_t);
41 void *data; 41 void *data;
42 42
43 /* Stub function return the fields. */ 43 /* Stub function return the fields. */
44 int (*_is_filter) __PMT ((filter_record_t, const char *)); 44 int (*_is_filter) (filter_record_t, const char *);
45 int (*_get_filter) __PMT ((filter_record_t, int (*(*_filter)) __PMT ((filter_t)))); 45 int (*_get_filter) (filter_record_t, int (*(*_filter)) (filter_t));
46 }; 46 };
47 47
48 48
49 extern int filter_create (stream_t *, stream_t, const char*, int, int); 49 extern int mu_filter_create (stream_t *, stream_t, const char*, int, int);
50 extern int filter_get_list (list_t *); 50 extern int mu_filter_get_list (list_t *);
51 51
52 /* List of defaults. */ 52 /* List of defaults. */
53 extern filter_record_t rfc822_filter; 53 extern filter_record_t mu_rfc822_filter;
54 extern filter_record_t qp_filter; /* quoted-printable. */ 54 extern filter_record_t mu_qp_filter; /* quoted-printable. */
55 extern filter_record_t base64_filter; 55 extern filter_record_t mu_base64_filter;
56 extern filter_record_t binary_filter; 56 extern filter_record_t mu_binary_filter;
57 extern filter_record_t bit8_filter; 57 extern filter_record_t mu_bit8_filter;
58 extern filter_record_t bit7_filter; 58 extern filter_record_t mu_bit7_filter;
59 extern filter_record_t rfc_2047_Q_filter; 59 extern filter_record_t mu_rfc_2047_Q_filter;
60 60
61 enum mu_iconv_fallback_mode { 61 enum mu_iconv_fallback_mode {
62 mu_fallback_none, 62 mu_fallback_none,
...@@ -64,7 +64,7 @@ enum mu_iconv_fallback_mode { ...@@ -64,7 +64,7 @@ enum mu_iconv_fallback_mode {
64 mu_fallback_copy_octal 64 mu_fallback_copy_octal
65 }; 65 };
66 66
67 extern int filter_iconv_create (stream_t *s, stream_t transport, 67 extern int mu_filter_iconv_create (stream_t *s, stream_t transport,
68 const char *fromcode, const char *tocode, 68 const char *fromcode, const char *tocode,
69 int flags, 69 int flags,
70 enum mu_iconv_fallback_mode fallback_mode); 70 enum mu_iconv_fallback_mode fallback_mode);
......
...@@ -25,58 +25,58 @@ ...@@ -25,58 +25,58 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 struct list_response 28 struct mu_list_response
29 { 29 {
30 int type; /* MU_FOLDER_ATTRIBUTE_.* flags */ 30 int type; /* MU_FOLDER_ATTRIBUTE_.* flags */
31 int separator; 31 int separator;
32 char *name; 32 char *name;
33 }; 33 };
34 34
35 struct folder_list 35 struct mu_folder_list
36 { 36 {
37 struct list_response **element; 37 struct mu_list_response **element;
38 size_t num; 38 size_t num;
39 }; 39 };
40 40
41 /* Constructor/destructor and possible types. */ 41 /* Constructor/destructor and possible types. */
42 extern int folder_create (folder_t *, const char *); 42 extern int mu_folder_create (folder_t *, const char *);
43 extern void folder_destroy (folder_t *); 43 extern void mu_folder_destroy (folder_t *);
44 44
45 extern int folder_open (folder_t, int flag); 45 extern int mu_folder_open (folder_t, int flag);
46 extern int folder_close (folder_t); 46 extern int mu_folder_close (folder_t);
47 47
48 extern int folder_delete (folder_t, const char *); 48 extern int mu_folder_delete (folder_t, const char *);
49 extern int folder_rename (folder_t, const char *, const char *); 49 extern int mu_folder_rename (folder_t, const char *, const char *);
50 extern int folder_subscribe (folder_t, const char *); 50 extern int mu_folder_subscribe (folder_t, const char *);
51 extern int folder_unsubscribe (folder_t, const char *); 51 extern int mu_folder_unsubscribe (folder_t, const char *);
52 extern int folder_list (folder_t, const char *, const char *, 52 extern int mu_folder_list (folder_t, const char *, const char *,
53 struct folder_list *); 53 struct mu_folder_list *);
54 extern int folder_lsub (folder_t, const char *, const char *, 54 extern int mu_folder_lsub (folder_t, const char *, const char *,
55 struct folder_list *); 55 struct mu_folder_list *);
56 extern int folder_list_destroy (struct folder_list *); 56 extern int mu_folder_list_destroy (struct mu_folder_list *);
57 57
58 /* Stream settings. */ 58 /* Stream settings. */
59 extern int folder_get_stream (folder_t, stream_t *); 59 extern int mu_folder_get_stream (folder_t, stream_t *);
60 extern int folder_set_stream (folder_t, stream_t); 60 extern int mu_folder_set_stream (folder_t, stream_t);
61 61
62 /* Notifications. */ 62 /* Notifications. */
63 extern int folder_get_observable (folder_t, observable_t *); 63 extern int mu_folder_get_observable (folder_t, observable_t *);
64 64
65 /* Debug. */ 65 /* Debug. */
66 extern int folder_has_debug (folder_t folder); 66 extern int mu_folder_has_debug (folder_t folder);
67 extern int folder_get_debug (folder_t, mu_debug_t *); 67 extern int mu_folder_get_debug (folder_t, mu_debug_t *);
68 extern int folder_set_debug (folder_t, mu_debug_t); 68 extern int mu_folder_set_debug (folder_t, mu_debug_t);
69 69
70 /* Authentication. */ 70 /* Authentication. */
71 extern int folder_get_authority (folder_t, authority_t *); 71 extern int mu_folder_get_authority (folder_t, authority_t *);
72 extern int folder_set_authority (folder_t, authority_t); 72 extern int mu_folder_set_authority (folder_t, authority_t);
73 73
74 /* URL. */ 74 /* URL. */
75 extern int folder_get_url (folder_t, url_t *); 75 extern int mu_folder_get_url (folder_t, url_t *);
76 extern int folder_set_url (folder_t, url_t); 76 extern int mu_folder_set_url (folder_t, url_t);
77 77
78 /* FIXME: not implemented */ 78 /* FIXME: not implemented */
79 extern int folder_decrement (folder_t); 79 extern int mu_folder_decrement (folder_t);
80 80
81 81
82 #ifdef __cplusplus 82 #ifdef __cplusplus
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
21 21
22 #include <gsasl.h> 22 #include <gsasl.h>
23 23
24 int gsasl_stream_create (stream_t *stream, stream_t transport, 24 int mu_gsasl_stream_create (stream_t *stream, stream_t transport,
25 Gsasl_session_ctx *ctx, 25 Gsasl_session_ctx *ctx,
26 int flags); 26 int flags);
27 27
28 void mu_gsasl_init_argp (void); 28 void mu_gsasl_init_argp (void);
29 29
30 extern char *gsasl_cram_md5_pwd; 30 extern char *mu_gsasl_cram_md5_pwd;
31 31
32 #endif /* not _MAILUTILS_GSASL_H */ 32 #endif /* not _MAILUTILS_GSASL_H */
......
...@@ -47,19 +47,19 @@ typedef struct ...@@ -47,19 +47,19 @@ typedef struct
47 int debug_guile; 47 int debug_guile;
48 mailbox_t mbox; 48 mailbox_t mbox;
49 char *user_name; 49 char *user_name;
50 int (*init) __PMT ((void *data)); 50 int (*init) (void *data);
51 SCM (*catch_body) __PMT ((void *data, mailbox_t mbox)); 51 SCM (*catch_body) (void *data, mailbox_t mbox);
52 SCM (*catch_handler) __PMT ((void *data, SCM tag, SCM throw_args)); 52 SCM (*catch_handler) (void *data, SCM tag, SCM throw_args);
53 int (*next) __PMT ((void *data, mailbox_t mbox)); 53 int (*next) (void *data, mailbox_t mbox);
54 int (*exit) __PMT ((void *data, mailbox_t mbox)); 54 int (*exit) (void *data, mailbox_t mbox);
55 void *data; 55 void *data;
56 } guimb_param_t; 56 } mu_guimb_param_t;
57 57
58 #ifdef __cplusplus 58 #ifdef __cplusplus
59 extern "C" { 59 extern "C" {
60 #endif 60 #endif
61 61
62 extern SCM scm_makenum (unsigned long val); 62 extern SCM mu_scm_makenum (unsigned long val);
63 extern void mu_set_variable (const char *name, SCM value); 63 extern void mu_set_variable (const char *name, SCM value);
64 extern void mu_scm_init (void); 64 extern void mu_scm_init (void);
65 65
...@@ -85,7 +85,7 @@ extern SCM mu_port_make_from_stream (SCM msg, stream_t stream, long mode); ...@@ -85,7 +85,7 @@ extern SCM mu_port_make_from_stream (SCM msg, stream_t stream, long mode);
85 extern void mu_scm_mime_init (void); 85 extern void mu_scm_mime_init (void);
86 extern void mu_scm_message_add_owner (SCM MESG, SCM owner); 86 extern void mu_scm_message_add_owner (SCM MESG, SCM owner);
87 87
88 extern void mu_process_mailbox (int argc, char *argv[], guimb_param_t *param); 88 extern void mu_process_mailbox (int argc, char *argv[], mu_guimb_param_t *param);
89 89
90 extern void mu_scm_mutil_init (void); 90 extern void mu_scm_mutil_init (void);
91 91
......
...@@ -72,64 +72,64 @@ extern "C" { ...@@ -72,64 +72,64 @@ extern "C" {
72 72
73 /* Mime support header attribute */ 73 /* Mime support header attribute */
74 74
75 extern int header_create (header_t *, const char *, size_t, void *); 75 extern int mu_header_create (header_t *, const char *, size_t, void *);
76 extern void header_destroy (header_t *, void *); 76 extern void mu_header_destroy (header_t *, void *);
77 extern void *header_get_owner (header_t); 77 extern void *mu_header_get_owner (header_t);
78 78
79 extern int header_is_modified (header_t); 79 extern int mu_header_is_modified (header_t);
80 extern int header_clear_modified (header_t); 80 extern int mu_header_clear_modified (header_t);
81 81
82 /* Set and get field values by field name. */ 82 /* Set and get field values by field name. */
83 extern int header_set_value (header_t, const char *, const char *, int); 83 extern int mu_header_set_value (header_t, const char *, const char *, int);
84 extern int header_get_value (header_t, const char *, char *, size_t, size_t *); 84 extern int mu_header_get_value (header_t, const char *, char *, size_t, size_t *);
85 extern int header_aget_value (header_t, const char *, char **); 85 extern int mu_header_aget_value (header_t, const char *, char **);
86 86
87 /* Get field values as an address_t. */ 87 /* Get field values as an address_t. */
88 extern int header_get_address (header_t, const char *, address_t *); 88 extern int mu_header_get_address (header_t, const char *, address_t *);
89 89
90 /* Set and get field values by field index (1-based). */ 90 /* Set and get field values by field index (1-based). */
91 extern int header_get_field_count (header_t, size_t *count); 91 extern int mu_header_get_field_count (header_t, size_t *count);
92 extern int header_get_field_value (header_t, size_t index, char *, size_t, size_t *); 92 extern int mu_header_get_field_value (header_t, size_t index, char *, size_t, size_t *);
93 extern int header_get_field_name (header_t, size_t index, char *, size_t, size_t *); 93 extern int mu_header_get_field_name (header_t, size_t index, char *, size_t, size_t *);
94 extern int header_aget_field_value (header_t, size_t index, char **); 94 extern int mu_header_aget_field_value (header_t, size_t index, char **);
95 extern int header_aget_field_name (header_t, size_t index, char **); 95 extern int mu_header_aget_field_name (header_t, size_t index, char **);
96 96
97 extern int header_get_value_unfold (header_t header, const char *name, 97 extern int mu_header_get_value_unfold (header_t header, const char *name,
98 char *buffer, size_t buflen, 98 char *buffer, size_t buflen,
99 size_t *pn); 99 size_t *pn);
100 extern int header_aget_value_unfold (header_t header, const char *name, 100 extern int mu_header_aget_value_unfold (header_t header, const char *name,
101 char **pvalue); 101 char **pvalue);
102 extern int header_get_field_value_unfold (header_t header, size_t num, 102 extern int mu_header_get_field_value_unfold (header_t header, size_t num,
103 char *buf, size_t buflen, 103 char *buf, size_t buflen,
104 size_t *nwritten); 104 size_t *nwritten);
105 extern int header_aget_field_value_unfold (header_t header, size_t num, 105 extern int mu_header_aget_field_value_unfold (header_t header, size_t num,
106 char **pvalue); 106 char **pvalue);
107 107
108 extern int header_get_stream (header_t, stream_t *); 108 extern int mu_header_get_stream (header_t, stream_t *);
109 extern int header_set_stream (header_t, stream_t, void *); 109 extern int mu_header_set_stream (header_t, stream_t, void *);
110 110
111 extern int header_size (header_t, size_t *); 111 extern int mu_header_size (header_t, size_t *);
112 extern int header_lines (header_t, size_t *); 112 extern int mu_header_lines (header_t, size_t *);
113 113
114 114
115 extern int header_set_set_value (header_t, 115 extern int mu_header_set_set_value (header_t,
116 int (*_set_value) (header_t, const char *, const char *, int), 116 int (*_set_value) (header_t, const char *, const char *, int),
117 void *); 117 void *);
118 118
119 extern int header_set_get_value (header_t, 119 extern int mu_header_set_get_value (header_t,
120 int (*_get_value) (header_t, const char *, char *, size_t, size_t *), 120 int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
121 void *); 121 void *);
122 extern int header_set_get_fvalue (header_t, 122 extern int mu_header_set_get_fvalue (header_t,
123 int (*_get_value) (header_t, const char *, char *, size_t, size_t *), 123 int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
124 void *); 124 void *);
125 125
126 extern int header_set_size (header_t, 126 extern int mu_header_set_size (header_t,
127 int (*_size) (header_t, size_t *), void *); 127 int (*_size) (header_t, size_t *), void *);
128 128
129 extern int header_set_lines (header_t, 129 extern int mu_header_set_lines (header_t,
130 int (*_lines) (header_t, size_t *), void *); 130 int (*_lines) (header_t, size_t *), void *);
131 131
132 extern int header_set_fill (header_t, 132 extern int mu_header_set_fill (header_t,
133 int (*_fill) (header_t, char *, size_t, off_t, size_t *), void *owner); 133 int (*_fill) (header_t, char *, size_t, off_t, size_t *), void *owner);
134 134
135 135
......
...@@ -25,29 +25,29 @@ ...@@ -25,29 +25,29 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int iterator_create (iterator_t *, void *); 28 extern int mu_iterator_create (iterator_t *, void *);
29 extern int iterator_dup (iterator_t *piterator, iterator_t orig); 29 extern int mu_iterator_dup (iterator_t *piterator, iterator_t orig);
30 extern void iterator_destroy (iterator_t *); 30 extern void mu_iterator_destroy (iterator_t *);
31 extern int iterator_first (iterator_t); 31 extern int mu_iterator_first (iterator_t);
32 extern int iterator_next (iterator_t); 32 extern int mu_iterator_next (iterator_t);
33 extern int iterator_current (iterator_t, void * const *pitem); 33 extern int mu_iterator_current (iterator_t, void * const *pitem);
34 extern int iterator_is_done (iterator_t); 34 extern int mu_iterator_is_done (iterator_t);
35 35
36 extern int iterator_attach (iterator_t *root, iterator_t iterator); 36 extern int mu_iterator_attach (iterator_t *root, iterator_t iterator);
37 extern int iterator_detach (iterator_t *root, iterator_t iterator); 37 extern int mu_iterator_detach (iterator_t *root, iterator_t iterator);
38 extern void iterator_advance (iterator_t iterator, void *e); 38 extern void mu_iterator_advance (iterator_t iterator, void *e);
39 39
40 extern int iterator_set_first (iterator_t, int (*first) (void *)); 40 extern int mu_iterator_set_first (iterator_t, int (*first) (void *));
41 extern int iterator_set_next (iterator_t, int (*next) (void *)); 41 extern int mu_iterator_set_next (iterator_t, int (*next) (void *));
42 extern int iterator_set_getitem (iterator_t, 42 extern int mu_iterator_set_getitem (iterator_t,
43 int (*getitem) (void *, void **)); 43 int (*getitem) (void *, void **));
44 extern int iterator_set_finished_p (iterator_t, 44 extern int mu_iterator_set_finished_p (iterator_t,
45 int (*finished_p) (void *)); 45 int (*finished_p) (void *));
46 extern int iterator_set_dup (iterator_t itr, 46 extern int mu_iterator_set_dup (iterator_t itr,
47 int (dup) (void **ptr, void *data)); 47 int (dup) (void **ptr, void *data));
48 extern int iterator_set_destroy (iterator_t itr, 48 extern int mu_iterator_set_destroy (iterator_t itr,
49 int (destroy) (iterator_t, void *data)); 49 int (destroy) (iterator_t, void *data));
50 extern int iterator_set_curitem_p (iterator_t itr, 50 extern int mu_iterator_set_curitem_p (iterator_t itr,
51 int (*curitem_p) (void *, void *)); 51 int (*curitem_p) (void *, void *));
52 52
53 #ifdef __cplusplus 53 #ifdef __cplusplus
......
...@@ -25,30 +25,30 @@ ...@@ -25,30 +25,30 @@
25 extern "C" { 25 extern "C" {
26 #endif 26 #endif
27 27
28 extern int list_create (list_t *); 28 extern int mu_list_create (list_t *);
29 extern void list_destroy (list_t *); 29 extern void mu_list_destroy (list_t *);
30 extern int list_append (list_t, void *item); 30 extern int mu_list_append (list_t, void *item);
31 extern int list_prepend (list_t, void *item); 31 extern int mu_list_prepend (list_t, void *item);
32 extern int list_insert (list_t list, void *item, void *new_item, 32 extern int mu_list_insert (list_t list, void *item, void *new_item,
33 int insert_before); 33 int insert_before);
34 extern int list_is_empty (list_t); 34 extern int mu_list_is_empty (list_t);
35 extern int list_count (list_t, size_t *pcount); 35 extern int mu_list_count (list_t, size_t *pcount);
36 extern int list_remove (list_t, void *item); 36 extern int mu_list_remove (list_t, void *item);
37 extern int list_replace (list_t list, void *old_item, void *new_item); 37 extern int mu_list_replace (list_t list, void *old_item, void *new_item);
38 extern int list_get (list_t, size_t _index, void **pitem); 38 extern int mu_list_get (list_t, size_t _index, void **pitem);
39 extern int list_to_array (list_t list, void **array, size_t count, size_t *pcount); 39 extern int mu_list_to_array (list_t list, void **array, size_t count, size_t *pcount);
40 extern int list_locate (list_t list, void *item, void **ret_item); 40 extern int mu_list_locate (list_t list, void *item, void **ret_item);
41 extern int list_get_iterator (list_t, iterator_t *); 41 extern int mu_list_get_iterator (list_t, iterator_t *);
42 42
43 typedef int list_action_t (void* item, void* cbdata); 43 typedef int mu_list_action_t (void* item, void* cbdata);
44 44
45 extern int list_do (list_t list, list_action_t * action, void *cbdata); 45 extern int mu_list_do (list_t list, mu_list_action_t * action, void *cbdata);
46 46
47 typedef int (*list_comparator_t) (const void*, const void*); 47 typedef int (*mu_list_comparator_t) (const void*, const void*);
48 48
49 extern list_comparator_t list_set_comparator (list_t, list_comparator_t); 49 extern mu_list_comparator_t mu_list_set_comparator (list_t, mu_list_comparator_t);
50 50
51 extern int list_set_destroy_item (list_t list, void (*destoy_item) (void *)); 51 extern int mu_list_set_destroy_item (list_t list, void (*destoy_item) (void *));
52 52
53 53
54 #ifdef __cplusplus 54 #ifdef __cplusplus
......
...@@ -40,12 +40,12 @@ extern "C" { ...@@ -40,12 +40,12 @@ extern "C" {
40 40
41 enum mu_locker_set_mode 41 enum mu_locker_set_mode
42 { 42 {
43 mu_locker_set_flags, 43 mu_locker_assign,
44 mu_locker_set_bit, 44 mu_locker_set_bit,
45 mu_locker_clear_bit 45 mu_locker_clear_bit
46 }; 46 };
47 47
48 /* locker_create() flags */ 48 /* mu_locker_create() flags */
49 49
50 #define MU_LOCKER_SIMPLE 0x00 50 #define MU_LOCKER_SIMPLE 0x00
51 /* Just try and dotlock the file, not the default because its usually 51 /* Just try and dotlock the file, not the default because its usually
...@@ -80,34 +80,34 @@ enum mu_locker_set_mode ...@@ -80,34 +80,34 @@ enum mu_locker_set_mode
80 * to MU_LOCKER_DEFAULT). A flags of 0 resets the flags back to the 80 * to MU_LOCKER_DEFAULT). A flags of 0 resets the flags back to the
81 * the default. 81 * the default.
82 */ 82 */
83 extern int locker_set_default_flags (int flags, enum mu_locker_set_mode mode); 83 extern int mu_locker_set_default_flags (int flags, enum mu_locker_set_mode mode);
84 extern void locker_set_default_retry_timeout (time_t to); 84 extern void mu_locker_set_default_retry_timeout (time_t to);
85 extern void locker_set_default_retry_count (size_t n); 85 extern void mu_locker_set_default_retry_count (size_t n);
86 extern void locker_set_default_expire_timeout (time_t t); 86 extern void mu_locker_set_default_expire_timeout (time_t t);
87 extern void locker_set_default_external_program (char *path); 87 extern void mu_locker_set_default_external_program (char *path);
88 88
89 /* A flags of 0 means that the default will be used. */ 89 /* A flags of 0 means that the default will be used. */
90 extern int locker_create (locker_t *, const char *filename, int flags); 90 extern int mu_locker_create (locker_t *, const char *filename, int flags);
91 extern void locker_destroy (locker_t *); 91 extern void mu_locker_destroy (locker_t *);
92 92
93 /* Time is measured in seconds. */ 93 /* Time is measured in seconds. */
94 94
95 extern int locker_set_flags (locker_t, int); 95 extern int mu_locker_set_flags (locker_t, int);
96 extern int locker_set_expire_time (locker_t, int); 96 extern int mu_locker_set_expire_time (locker_t, int);
97 extern int locker_set_retries (locker_t, int); 97 extern int mu_locker_set_retries (locker_t, int);
98 extern int locker_set_retry_sleep (locker_t, int); 98 extern int mu_locker_set_retry_sleep (locker_t, int);
99 extern int locker_set_external (locker_t, const char* program); 99 extern int mu_locker_set_external (locker_t, const char* program);
100 100
101 extern int locker_get_flags (locker_t, int*); 101 extern int mu_locker_get_flags (locker_t, int*);
102 extern int locker_get_expire_time (locker_t, int*); 102 extern int mu_locker_get_expire_time (locker_t, int*);
103 extern int locker_get_retries (locker_t, int*); 103 extern int mu_locker_get_retries (locker_t, int*);
104 extern int locker_get_retry_sleep (locker_t, int*); 104 extern int mu_locker_get_retry_sleep (locker_t, int*);
105 extern int locker_get_external (locker_t, char**); 105 extern int mu_locker_get_external (locker_t, char**);
106 106
107 extern int locker_lock (locker_t); 107 extern int mu_locker_lock (locker_t);
108 extern int locker_touchlock (locker_t); 108 extern int mu_locker_touchlock (locker_t);
109 extern int locker_unlock (locker_t); 109 extern int mu_locker_unlock (locker_t);
110 extern int locker_remove_lock (locker_t); 110 extern int mu_locker_remove_lock (locker_t);
111 111
112 #ifdef __cplusplus 112 #ifdef __cplusplus
113 } 113 }
......
...@@ -34,58 +34,58 @@ const char *mu_folder_directory (void); ...@@ -34,58 +34,58 @@ const char *mu_folder_directory (void);
34 int mu_construct_user_mailbox_url (char **pout, const char *name); 34 int mu_construct_user_mailbox_url (char **pout, const char *name);
35 35
36 /* Constructor/destructor and possible types. */ 36 /* Constructor/destructor and possible types. */
37 extern int mailbox_create (mailbox_t *, const char *); 37 extern int mu_mailbox_create (mailbox_t *, const char *);
38 extern void mailbox_destroy (mailbox_t *); 38 extern void mu_mailbox_destroy (mailbox_t *);
39 extern int mailbox_create_default (mailbox_t *, const char *); 39 extern int mu_mailbox_create_default (mailbox_t *, const char *);
40 40
41 extern int mailbox_open (mailbox_t, int flag); 41 extern int mu_mailbox_open (mailbox_t, int flag);
42 extern int mailbox_close (mailbox_t); 42 extern int mu_mailbox_close (mailbox_t);
43 extern int mailbox_flush (mailbox_t mbox, int expunge); 43 extern int mu_mailbox_flush (mailbox_t mbox, int expunge);
44 extern int mailbox_get_folder (mailbox_t, folder_t *); 44 extern int mu_mailbox_get_folder (mailbox_t, folder_t *);
45 extern int mailbox_set_folder (mailbox_t, folder_t); 45 extern int mu_mailbox_set_folder (mailbox_t, folder_t);
46 extern int mailbox_uidvalidity (mailbox_t, unsigned long *); 46 extern int mu_mailbox_uidvalidity (mailbox_t, unsigned long *);
47 extern int mailbox_uidnext (mailbox_t, size_t *); 47 extern int mu_mailbox_uidnext (mailbox_t, size_t *);
48 48
49 /* Messages. */ 49 /* Messages. */
50 extern int mailbox_get_message (mailbox_t, size_t msgno, message_t *); 50 extern int mu_mailbox_get_message (mailbox_t, size_t msgno, message_t *);
51 extern int mailbox_append_message (mailbox_t, message_t); 51 extern int mu_mailbox_append_message (mailbox_t, message_t);
52 extern int mailbox_messages_count (mailbox_t, size_t *); 52 extern int mu_mailbox_messages_count (mailbox_t, size_t *);
53 extern int mailbox_messages_recent (mailbox_t, size_t *); 53 extern int mu_mailbox_messages_recent (mailbox_t, size_t *);
54 extern int mailbox_message_unseen (mailbox_t, size_t *); 54 extern int mu_mailbox_message_unseen (mailbox_t, size_t *);
55 extern int mailbox_expunge (mailbox_t); 55 extern int mu_mailbox_expunge (mailbox_t);
56 extern int mailbox_save_attributes (mailbox_t); 56 extern int mu_mailbox_save_attributes (mailbox_t);
57 57
58 /* Update and scanning. */ 58 /* Update and scanning. */
59 extern int mailbox_get_size (mailbox_t, off_t *size); 59 extern int mu_mailbox_get_size (mailbox_t, off_t *size);
60 extern int mailbox_is_updated (mailbox_t); 60 extern int mu_mailbox_is_updated (mailbox_t);
61 extern int mailbox_scan (mailbox_t, size_t no, size_t *count); 61 extern int mu_mailbox_scan (mailbox_t, size_t no, size_t *count);
62 62
63 /* Mailbox Stream. */ 63 /* Mailbox Stream. */
64 extern int mailbox_set_stream (mailbox_t, stream_t); 64 extern int mu_mailbox_set_stream (mailbox_t, stream_t);
65 extern int mailbox_get_stream (mailbox_t, stream_t *); 65 extern int mu_mailbox_get_stream (mailbox_t, stream_t *);
66 66
67 /* Lock settings. */ 67 /* Lock settings. */
68 extern int mailbox_get_locker (mailbox_t, locker_t *); 68 extern int mu_mailbox_get_locker (mailbox_t, locker_t *);
69 extern int mailbox_set_locker (mailbox_t, locker_t); 69 extern int mu_mailbox_set_locker (mailbox_t, locker_t);
70 70
71 /* Property. */ 71 /* Property. */
72 extern int mailbox_get_flags (mailbox_t, int *); 72 extern int mu_mailbox_get_flags (mailbox_t, int *);
73 extern int mailbox_get_property (mailbox_t, property_t *); 73 extern int mu_mailbox_get_property (mailbox_t, property_t *);
74 74
75 /* URL. */ 75 /* URL. */
76 extern int mailbox_get_url (mailbox_t, url_t *); 76 extern int mu_mailbox_get_url (mailbox_t, url_t *);
77 77
78 /* For any debuging */ 78 /* For any debuging */
79 extern int mailbox_has_debug (mailbox_t); 79 extern int mu_mailbox_has_debug (mailbox_t);
80 extern int mailbox_get_debug (mailbox_t, mu_debug_t *); 80 extern int mu_mailbox_get_debug (mailbox_t, mu_debug_t *);
81 extern int mailbox_set_debug (mailbox_t, mu_debug_t); 81 extern int mu_mailbox_set_debug (mailbox_t, mu_debug_t);
82 82
83 /* Events. */ 83 /* Events. */
84 extern int mailbox_get_observable (mailbox_t, observable_t *); 84 extern int mu_mailbox_get_observable (mailbox_t, observable_t *);
85 85
86 /* Locking */ 86 /* Locking */
87 extern int mailbox_lock (mailbox_t mbox); 87 extern int mu_mailbox_lock (mailbox_t mbox);
88 extern int mailbox_unlock (mailbox_t mbox); 88 extern int mu_mailbox_unlock (mailbox_t mbox);
89 89
90 #ifdef __cplusplus 90 #ifdef __cplusplus
91 } 91 }
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 2004 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 modify it under the terms of the GNU Lesser General Public
...@@ -52,7 +52,7 @@ extern int mu_nntp_stls (mu_nntp_t nntp); ...@@ -52,7 +52,7 @@ extern int mu_nntp_stls (mu_nntp_t nntp);
52 extern int mu_nntp_mode_reader (mu_nntp_t nntp); 52 extern int mu_nntp_mode_reader (mu_nntp_t nntp);
53 53
54 /* An iterator is return with the multi-line answer. It is the responsibility 54 /* An iterator is return with the multi-line answer. It is the responsibility
55 of the caller to call iterator_destroy() to dispose of the iterator. */ 55 of the caller to call mu_iterator_destroy() to dispose of the iterator. */
56 extern int mu_nntp_list_extensions (mu_nntp_t nntp, iterator_t *iterator); 56 extern int mu_nntp_list_extensions (mu_nntp_t nntp, iterator_t *iterator);
57 57
58 extern int mu_nntp_quit (mu_nntp_t nntp); 58 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); ...@@ -112,7 +112,7 @@ extern int mu_nntp_help (mu_nntp_t nntp, stream_t *stream);
112 112
113 113
114 /* An iterator is return with the multi-line answer. It is the responsibility 114 /* An iterator is return with the multi-line answer. It is the responsibility
115 of the caller to call iterator_destroy() to dispose of the iterator. */ 115 of the caller to call mu_iterator_destroy() to dispose of the iterator. */
116 extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year, 116 extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
117 unsigned int month, unsigned int day, 117 unsigned int month, unsigned int day,
118 unsigned int hour, unsigned int minute, 118 unsigned int hour, unsigned int minute,
...@@ -120,7 +120,7 @@ extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year, ...@@ -120,7 +120,7 @@ extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
120 iterator_t *iterator); 120 iterator_t *iterator);
121 121
122 /* A iterator is return with the multi-line answer. It is the responsibility 122 /* A iterator is return with the multi-line answer. It is the responsibility
123 of the caller to call iterator_destroy() to dispose of the iterator. */ 123 of the caller to call mu_iterator_destroy() to dispose of the iterator. */
124 extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat, 124 extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat,
125 unsigned int year, unsigned int month, 125 unsigned int year, unsigned int month,
126 unsigned int day, unsigned int hour, 126 unsigned int day, unsigned int hour,
...@@ -133,7 +133,7 @@ extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid, ...@@ -133,7 +133,7 @@ extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid,
133 133
134 134
135 /* A iterator is return with the multi-line answer. It is the responsibility 135 /* A iterator is return with the multi-line answer. It is the responsibility
136 of the caller to call iterator_destroy() to dispose of the iterator. */ 136 of the caller to call mu_iterator_destroy() to dispose of the iterator. */
137 extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat, 137 extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat,
138 iterator_t *iterator); 138 iterator_t *iterator);
139 extern int mu_nntp_list_active_times (mu_nntp_t nntp, 139 extern int mu_nntp_list_active_times (mu_nntp_t nntp,
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 6 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 * ...@@ -50,7 +51,7 @@ extern int mu_pop3_apop (mu_pop3_t pop3, const char *name, const char *
50 51
51 extern int mu_pop3_stls (mu_pop3_t pop3); 52 extern int mu_pop3_stls (mu_pop3_t pop3);
52 53
53 /* It is the responsability of the caller to call iterator_destroy() when done 54 /* It is the responsability of the caller to call mu_iterator_destroy() when done
54 with the iterator. The items return by the iterator are of type "const char *", 55 with the iterator. The items return by the iterator are of type "const char *",
55 no processing is done on the item except the removal of the trailing newline. */ 56 no processing is done on the item except the removal of the trailing newline. */
56 extern int mu_pop3_capa (mu_pop3_t pop3, iterator_t *iterator); 57 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); ...@@ -60,7 +61,7 @@ extern int mu_pop3_dele (mu_pop3_t pop3, unsigned int mesgno);
60 extern int mu_pop3_list (mu_pop3_t pop3, unsigned int mesgno, size_t *mesg_octet); 61 extern int mu_pop3_list (mu_pop3_t pop3, unsigned int mesgno, size_t *mesg_octet);
61 62
62 /* An iterator is return with the multi-line answer. It is the responsability of 63 /* An iterator is return with the multi-line answer. It is the responsability of
63 the caller to call iterator_destroy() to dispose of the iterator. */ 64 the caller to call mu_iterator_destroy() to dispose of the iterator. */
64 extern int mu_pop3_list_all (mu_pop3_t pop3, iterator_t *piterator); 65 extern int mu_pop3_list_all (mu_pop3_t pop3, iterator_t *piterator);
65 66
66 extern int mu_pop3_noop (mu_pop3_t pop3); 67 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 ...@@ -85,7 +86,7 @@ extern int mu_pop3_top (mu_pop3_t pop3, unsigned int mesgno, unsigned
85 to free() the uild when done. */ 86 to free() the uild when done. */
86 extern int mu_pop3_uidl (mu_pop3_t pop3, unsigned int mesgno, char **puidl); 87 extern int mu_pop3_uidl (mu_pop3_t pop3, unsigned int mesgno, char **puidl);
87 /* An iterator is return with the multi-line answer. It is the responsability of 88 /* An iterator is return with the multi-line answer. It is the responsability of
88 the caller to call iterator_destroy() to dispose of the iterator. */ 89 the caller to call mu_iterator_destroy() to dispose of the iterator. */
89 extern int mu_pop3_uidl_all (mu_pop3_t pop3, iterator_t *piterator); 90 extern int mu_pop3_uidl_all (mu_pop3_t pop3, iterator_t *piterator);
90 91
91 extern int mu_pop3_user (mu_pop3_t pop3, const char *user); 92 extern int mu_pop3_user (mu_pop3_t pop3, const char *user);
......
...@@ -32,7 +32,7 @@ struct _body; ...@@ -32,7 +32,7 @@ struct _body;
32 struct _debug; 32 struct _debug;
33 struct _envelope; 33 struct _envelope;
34 struct _filter; 34 struct _filter;
35 struct _filter_record; 35 struct mu_filter_record;
36 struct _folder; 36 struct _folder;
37 struct _header; 37 struct _header;
38 struct _iterator; 38 struct _iterator;
...@@ -61,7 +61,7 @@ typedef struct _body *body_t; ...@@ -61,7 +61,7 @@ typedef struct _body *body_t;
61 typedef struct _debug *mu_debug_t; 61 typedef struct _debug *mu_debug_t;
62 typedef struct _envelope *envelope_t; 62 typedef struct _envelope *envelope_t;
63 typedef struct _filter *filter_t; 63 typedef struct _filter *filter_t;
64 typedef struct _filter_record *filter_record_t; 64 typedef struct mu_filter_record *filter_record_t;
65 typedef struct _folder *folder_t; 65 typedef struct _folder *folder_t;
66 typedef struct _header * header_t; 66 typedef struct _header * header_t;
67 typedef struct _iterator *iterator_t; 67 typedef struct _iterator *iterator_t;
......
...@@ -73,7 +73,7 @@ mime_context_fill (struct mime_context *ctx, const char *file, ...@@ -73,7 +73,7 @@ mime_context_fill (struct mime_context *ctx, const char *file,
73 memset (ctx, 0, sizeof *ctx); 73 memset (ctx, 0, sizeof *ctx);
74 ctx->input = input; 74 ctx->input = input;
75 ctx->hdr = hdr; 75 ctx->hdr = hdr;
76 if (header_aget_value (hdr, MU_HEADER_CONTENT_TYPE, 76 if (mu_header_aget_value (hdr, MU_HEADER_CONTENT_TYPE,
77 &ctx->content_type_buffer)) 77 &ctx->content_type_buffer))
78 return 1; 78 return 1;
79 ctx->content_type = strtok_r (ctx->content_type_buffer, ";", &sp); 79 ctx->content_type = strtok_r (ctx->content_type_buffer, ";", &sp);
...@@ -86,24 +86,24 @@ mime_context_fill (struct mime_context *ctx, const char *file, ...@@ -86,24 +86,24 @@ mime_context_fill (struct mime_context *ctx, const char *file,
86 ctx->flags |= FLAGS_DRY_RUN; 86 ctx->flags |= FLAGS_DRY_RUN;
87 ctx->debug_level = debug_level; 87 ctx->debug_level = debug_level;
88 88
89 list_create (&ctx->values); 89 mu_list_create (&ctx->values);
90 while ((p = strtok_r (NULL, ";", &sp))) 90 while ((p = strtok_r (NULL, ";", &sp)))
91 { 91 {
92 while (*p && isspace (*p)) 92 while (*p && isspace (*p))
93 p++; 93 p++;
94 list_append (ctx->values, p); 94 mu_list_append (ctx->values, p);
95 } 95 }
96 96
97 if (no_ask) 97 if (no_ask)
98 { 98 {
99 ctx->no_ask_str = xstrdup (no_ask); 99 ctx->no_ask_str = xstrdup (no_ask);
100 list_create (&ctx->no_ask_types); 100 mu_list_create (&ctx->no_ask_types);
101 for (p = strtok_r (ctx->no_ask_str, ",", &sp); p; 101 for (p = strtok_r (ctx->no_ask_str, ",", &sp); p;
102 p = strtok_r (NULL, ",", &sp)) 102 p = strtok_r (NULL, ",", &sp))
103 { 103 {
104 while (*p && isspace (*p)) 104 while (*p && isspace (*p))
105 p++; 105 p++;
106 list_append (ctx->no_ask_types, p); 106 mu_list_append (ctx->no_ask_types, p);
107 } 107 }
108 } 108 }
109 return 0; 109 return 0;
...@@ -116,9 +116,9 @@ mime_context_release (struct mime_context *ctx) ...@@ -116,9 +116,9 @@ mime_context_release (struct mime_context *ctx)
116 if (ctx->unlink_temp_file) 116 if (ctx->unlink_temp_file)
117 unlink (ctx->temp_file); 117 unlink (ctx->temp_file);
118 free (ctx->temp_file); 118 free (ctx->temp_file);
119 list_destroy (&ctx->values); 119 mu_list_destroy (&ctx->values);
120 free (ctx->no_ask_str); 120 free (ctx->no_ask_str);
121 list_destroy (&ctx->no_ask_types); 121 mu_list_destroy (&ctx->no_ask_types);
122 } 122 }
123 123
124 static int 124 static int
...@@ -129,15 +129,15 @@ mime_context_do_not_ask (struct mime_context *ctx) ...@@ -129,15 +129,15 @@ mime_context_do_not_ask (struct mime_context *ctx)
129 if (ctx->no_ask_types) 129 if (ctx->no_ask_types)
130 { 130 {
131 iterator_t itr; 131 iterator_t itr;
132 list_get_iterator (ctx->no_ask_types, &itr); 132 mu_list_get_iterator (ctx->no_ask_types, &itr);
133 for (iterator_first (itr); !rc && !iterator_is_done (itr); 133 for (mu_iterator_first (itr); !rc && !mu_iterator_is_done (itr);
134 iterator_next (itr)) 134 mu_iterator_next (itr))
135 { 135 {
136 char *p; 136 char *p;
137 iterator_current (itr, (void**)&p); 137 mu_iterator_current (itr, (void**)&p);
138 rc = fnmatch (p, ctx->content_type, FNM_CASEFOLD) == 0; 138 rc = fnmatch (p, ctx->content_type, FNM_CASEFOLD) == 0;
139 } 139 }
140 iterator_destroy (&itr); 140 mu_iterator_destroy (&itr);
141 } 141 }
142 return rc; 142 return rc;
143 } 143 }
...@@ -174,12 +174,12 @@ mime_context_get_content_type_value (struct mime_context *ctx, ...@@ -174,12 +174,12 @@ mime_context_get_content_type_value (struct mime_context *ctx,
174 iterator_t itr = NULL; 174 iterator_t itr = NULL;
175 int rc = 1; 175 int rc = 1;
176 176
177 list_get_iterator (ctx->values, &itr); 177 mu_list_get_iterator (ctx->values, &itr);
178 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 178 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
179 { 179 {
180 char *item, *p; 180 char *item, *p;
181 181
182 iterator_current (itr, (void**) &item); 182 mu_iterator_current (itr, (void**) &item);
183 p = strchr (item, '='); 183 p = strchr (item, '=');
184 if (p - item == len && strncasecmp (item, name, len) == 0) 184 if (p - item == len && strncasecmp (item, name, len) == 0)
185 { 185 {
...@@ -194,7 +194,7 @@ mime_context_get_content_type_value (struct mime_context *ctx, ...@@ -194,7 +194,7 @@ mime_context_get_content_type_value (struct mime_context *ctx,
194 break; 194 break;
195 } 195 }
196 } 196 }
197 iterator_destroy (&itr); 197 mu_iterator_destroy (&itr);
198 return rc; 198 return rc;
199 } 199 }
200 200
...@@ -427,7 +427,7 @@ create_filter (char *cmd, int outfd, int *infd) ...@@ -427,7 +427,7 @@ create_filter (char *cmd, int outfd, int *infd)
427 argv[3] = NULL; 427 argv[3] = NULL;
428 } 428 }
429 else 429 else
430 argcv_get (cmd, "", NULL, &argc, &argv); 430 mu_argcv_get (cmd, "", NULL, &argc, &argv);
431 431
432 /* Create input channel: */ 432 /* Create input channel: */
433 if (infd) 433 if (infd)
...@@ -497,12 +497,12 @@ run_test (mu_mailcap_entry_t entry, struct mime_context *ctx) ...@@ -497,12 +497,12 @@ run_test (mu_mailcap_entry_t entry, struct mime_context *ctx)
497 mu_mailcap_entry_get_test (entry, str, size + 1, NULL); 497 mu_mailcap_entry_get_test (entry, str, size + 1, NULL);
498 498
499 expand_string (ctx, &str); 499 expand_string (ctx, &str);
500 argcv_get (str, "", NULL, &argc, &argv); 500 mu_argcv_get (str, "", NULL, &argc, &argv);
501 free (str); 501 free (str);
502 502
503 if (mu_spawnvp (argv[0], argv, &status)) 503 if (mu_spawnvp (argv[0], argv, &status))
504 status = 1; 504 status = 1;
505 argcv_free (argc, argv); 505 mu_argcv_free (argc, argv);
506 } 506 }
507 return status; 507 return status;
508 } 508 }
......
...@@ -47,13 +47,13 @@ _get_address_part (const char *func_name, address_get_fp fun, ...@@ -47,13 +47,13 @@ _get_address_part (const char *func_name, address_get_fp fun,
47 if (length == 0) 47 if (length == 0)
48 return scm_makfrom0str(""); 48 return scm_makfrom0str("");
49 49
50 if (address_create (&addr, SCM_STRING_CHARS (ADDRESS))) 50 if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
51 return SCM_BOOL_F; 51 return SCM_BOOL_F;
52 52
53 str = malloc (length + 1); 53 str = malloc (length + 1);
54 if (!str) 54 if (!str)
55 { 55 {
56 address_destroy (&addr); 56 mu_address_destroy (&addr);
57 return SCM_BOOL_F; 57 return SCM_BOOL_F;
58 } 58 }
59 59
...@@ -61,65 +61,65 @@ _get_address_part (const char *func_name, address_get_fp fun, ...@@ -61,65 +61,65 @@ _get_address_part (const char *func_name, address_get_fp fun,
61 ret = scm_makfrom0str (str); 61 ret = scm_makfrom0str (str);
62 else 62 else
63 ret = SCM_BOOL_F; 63 ret = SCM_BOOL_F;
64 address_destroy (&addr); 64 mu_address_destroy (&addr);
65 free (str); 65 free (str);
66 return ret; 66 return ret;
67 } 67 }
68 68
69 SCM_DEFINE (mu_address_get_personal, "mu-address-get-personal", 1, 1, 0, 69 SCM_DEFINE (scm_mu_address_get_personal, "mu-address-get-personal", 1, 1, 0,
70 (SCM ADDRESS, SCM NUM), 70 (SCM ADDRESS, SCM NUM),
71 "Return personal part of an email address.\n") 71 "Return personal part of an email address.\n")
72 #define FUNC_NAME s_mu_address_get_personal 72 #define FUNC_NAME s_scm_mu_address_get_personal
73 { 73 {
74 return _get_address_part (FUNC_NAME, 74 return _get_address_part (FUNC_NAME,
75 address_get_personal, ADDRESS, NUM); 75 mu_address_get_personal, ADDRESS, NUM);
76 } 76 }
77 #undef FUNC_NAME 77 #undef FUNC_NAME
78 78
79 SCM_DEFINE (mu_address_get_comments, "mu-address-get-comments", 1, 1, 0, 79 SCM_DEFINE (scm_mu_address_get_comments, "mu-address-get-comments", 1, 1, 0,
80 (SCM ADDRESS, SCM NUM), 80 (SCM ADDRESS, SCM NUM),
81 "Return comment part of an email address.\n") 81 "Return comment part of an email address.\n")
82 #define FUNC_NAME s_mu_address_get_comments 82 #define FUNC_NAME s_scm_mu_address_get_comments
83 { 83 {
84 return _get_address_part (FUNC_NAME, 84 return _get_address_part (FUNC_NAME,
85 address_get_comments, ADDRESS, NUM); 85 mu_address_get_comments, ADDRESS, NUM);
86 } 86 }
87 #undef FUNC_NAME 87 #undef FUNC_NAME
88 88
89 SCM_DEFINE (mu_address_get_email, "mu-address-get-email", 1, 1, 0, 89 SCM_DEFINE (scm_mu_address_get_email, "mu-address-get-email", 1, 1, 0,
90 (SCM ADDRESS, SCM NUM), 90 (SCM ADDRESS, SCM NUM),
91 "Return email part of an email address.\n") 91 "Return email part of an email address.\n")
92 #define FUNC_NAME s_mu_address_get_email 92 #define FUNC_NAME s_scm_mu_address_get_email
93 { 93 {
94 return _get_address_part (FUNC_NAME, 94 return _get_address_part (FUNC_NAME,
95 address_get_email, ADDRESS, NUM); 95 mu_address_get_email, ADDRESS, NUM);
96 } 96 }
97 #undef FUNC_NAME 97 #undef FUNC_NAME
98 98
99 SCM_DEFINE (mu_address_get_domain, "mu-address-get-domain", 1, 1, 0, 99 SCM_DEFINE (scm_mu_address_get_domain, "mu-address-get-domain", 1, 1, 0,
100 (SCM ADDRESS, SCM NUM), 100 (SCM ADDRESS, SCM NUM),
101 "Return domain part of an email address.\n") 101 "Return domain part of an email address.\n")
102 #define FUNC_NAME s_mu_address_get_domain 102 #define FUNC_NAME s_scm_mu_address_get_domain
103 { 103 {
104 return _get_address_part (FUNC_NAME, 104 return _get_address_part (FUNC_NAME,
105 address_get_domain, ADDRESS, NUM); 105 mu_address_get_domain, ADDRESS, NUM);
106 } 106 }
107 #undef FUNC_NAME 107 #undef FUNC_NAME
108 108
109 SCM_DEFINE (mu_address_get_local, "mu-address-get-local", 1, 1, 0, 109 SCM_DEFINE (scm_mu_address_get_local, "mu-address-get-local", 1, 1, 0,
110 (SCM ADDRESS, SCM NUM), 110 (SCM ADDRESS, SCM NUM),
111 "Return local part of an email address.\n") 111 "Return local part of an email address.\n")
112 #define FUNC_NAME s_mu_address_get_local 112 #define FUNC_NAME s_scm_mu_address_get_local
113 { 113 {
114 return _get_address_part (FUNC_NAME, 114 return _get_address_part (FUNC_NAME,
115 address_get_local_part, ADDRESS, NUM); 115 mu_address_get_local_part, ADDRESS, NUM);
116 } 116 }
117 #undef FUNC_NAME 117 #undef FUNC_NAME
118 118
119 SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0, 119 SCM_DEFINE (scm_mu_address_get_count, "mu-address-get-count", 1, 0, 0,
120 (SCM ADDRESS), 120 (SCM ADDRESS),
121 "Return number of parts in email address.\n") 121 "Return number of parts in email address.\n")
122 #define FUNC_NAME s_mu_address_get_count 122 #define FUNC_NAME s_scm_mu_address_get_count
123 { 123 {
124 address_t addr; 124 address_t addr;
125 size_t count = 0; 125 size_t count = 0;
...@@ -127,20 +127,20 @@ SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0, ...@@ -127,20 +127,20 @@ SCM_DEFINE (mu_address_get_count, "mu-address-get-count", 1, 0, 0,
127 SCM_ASSERT (SCM_NIMP (ADDRESS) && SCM_STRINGP (ADDRESS), 127 SCM_ASSERT (SCM_NIMP (ADDRESS) && SCM_STRINGP (ADDRESS),
128 ADDRESS, SCM_ARG1, FUNC_NAME); 128 ADDRESS, SCM_ARG1, FUNC_NAME);
129 129
130 if (address_create (&addr, SCM_STRING_CHARS (ADDRESS))) 130 if (mu_address_create (&addr, SCM_STRING_CHARS (ADDRESS)))
131 return SCM_MAKINUM(0); 131 return SCM_MAKINUM(0);
132 132
133 address_get_count (addr, &count); 133 mu_address_get_count (addr, &count);
134 address_destroy (&addr); 134 mu_address_destroy (&addr);
135 return scm_makenum (count); 135 return mu_scm_makenum (count);
136 } 136 }
137 #undef FUNC_NAME 137 #undef FUNC_NAME
138 138
139 SCM_DEFINE (mu_username_to_email, "mu-username->email", 0, 1, 0, 139 SCM_DEFINE (scm_mu_username_to_email, "mu-username->email", 0, 1, 0,
140 (SCM NAME), 140 (SCM NAME),
141 "Deduce the email from the username. If NAME is omitted, current username\n" 141 "Deduce the email from the username. If NAME is omitted, current username\n"
142 "is assumed\n") 142 "is assumed\n")
143 #define FUNC_NAME s_mu_username_to_email 143 #define FUNC_NAME s_scm_mu_username_to_email
144 { 144 {
145 char *name; 145 char *name;
146 char *email; 146 char *email;
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 5 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) ...@@ -58,10 +58,10 @@ mu_scm_body_print (SCM body_smob, SCM port, scm_print_state * pstate)
58 size_t b_size = 0, b_lines = 0, len = 0; 58 size_t b_size = 0, b_lines = 0, len = 0;
59 char buffer[512]; 59 char buffer[512];
60 60
61 body_size (mbp->body, &b_size); 61 mu_body_size (mbp->body, &b_size);
62 body_lines (mbp->body, &b_lines); 62 mu_body_lines (mbp->body, &b_lines);
63 buffer[0] = 0; 63 buffer[0] = 0;
64 body_get_filename (mbp->body, buffer, sizeof (buffer), &len); 64 mu_body_get_filename (mbp->body, buffer, sizeof (buffer), &len);
65 65
66 scm_puts ("#<body \"", port); 66 scm_puts ("#<body \"", port);
67 scm_puts (buffer, port); 67 scm_puts (buffer, port);
...@@ -101,10 +101,10 @@ mu_scm_body_create (SCM msg, body_t body) ...@@ -101,10 +101,10 @@ mu_scm_body_create (SCM msg, body_t body)
101 /* ************************************************************************* */ 101 /* ************************************************************************* */
102 /* Guile primitives */ 102 /* Guile primitives */
103 103
104 SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0, 104 SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
105 (SCM BODY), 105 (SCM BODY),
106 "Read next line from the BODY.") 106 "Read next line from the BODY.")
107 #define FUNC_NAME s_mu_body_read_line 107 #define FUNC_NAME s_scm_mu_body_read_line
108 { 108 {
109 struct mu_body *mbp; 109 struct mu_body *mbp;
110 int n, nread; 110 int n, nread;
...@@ -114,7 +114,7 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0, ...@@ -114,7 +114,7 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
114 114
115 if (!mbp->stream) 115 if (!mbp->stream)
116 { 116 {
117 if (body_get_stream (mbp->body, &mbp->stream)) 117 if (mu_body_get_stream (mbp->body, &mbp->stream))
118 return SCM_BOOL_F; 118 return SCM_BOOL_F;
119 } 119 }
120 120
...@@ -156,10 +156,10 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0, ...@@ -156,10 +156,10 @@ SCM_DEFINE (mu_body_read_line, "mu-body-read-line", 1, 0, 0,
156 } 156 }
157 #undef FUNC_NAME 157 #undef FUNC_NAME
158 158
159 SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0, 159 SCM_DEFINE (scm_mu_body_write, "mu-body-write", 2, 0, 0,
160 (SCM BODY, SCM TEXT), 160 (SCM BODY, SCM TEXT),
161 "Append TEXT to message BODY.") 161 "Append TEXT to message BODY.")
162 #define FUNC_NAME s_mu_body_write 162 #define FUNC_NAME s_scm_mu_body_write
163 { 163 {
164 char *ptr; 164 char *ptr;
165 size_t len, n; 165 size_t len, n;
...@@ -172,7 +172,7 @@ SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0, ...@@ -172,7 +172,7 @@ SCM_DEFINE (mu_body_write, "mu-body-write", 2, 0, 0,
172 172
173 if (!mbp->stream) 173 if (!mbp->stream)
174 { 174 {
175 if (body_get_stream (mbp->body, &mbp->stream)) 175 if (mu_body_get_stream (mbp->body, &mbp->stream))
176 return SCM_BOOL_F; 176 return SCM_BOOL_F;
177 } 177 }
178 178
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 static void _scheme_main (void *closure, int argc, char **argv); 21 static void _scheme_main (void *closure, int argc, char **argv);
22 22
23 void 23 void
24 mu_process_mailbox (int argc, char *argv[], guimb_param_t *param) 24 mu_process_mailbox (int argc, char *argv[], mu_guimb_param_t *param)
25 { 25 {
26 scm_boot_guile (argc, argv, _scheme_main, param); 26 scm_boot_guile (argc, argv, _scheme_main, param);
27 } 27 }
...@@ -32,14 +32,14 @@ SCM _user_name; ...@@ -32,14 +32,14 @@ SCM _user_name;
32 static SCM 32 static SCM
33 catch_body (void *closure) 33 catch_body (void *closure)
34 { 34 {
35 guimb_param_t *param = closure; 35 mu_guimb_param_t *param = closure;
36 return param->catch_body (param->data, param->mbox); 36 return param->catch_body (param->data, param->mbox);
37 } 37 }
38 38
39 void 39 void
40 _scheme_main (void *closure, int argc, char **argv) 40 _scheme_main (void *closure, int argc, char **argv)
41 { 41 {
42 guimb_param_t *param = closure; 42 mu_guimb_param_t *param = closure;
43 43
44 if (param->debug_guile) 44 if (param->debug_guile)
45 { 45 {
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
20 20
21 #include <syslog.h> 21 #include <syslog.h>
22 22
23 SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0, 23 SCM_DEFINE (scm_mu_openlog, "mu-openlog", 3, 0, 0,
24 (SCM IDENT, SCM OPTION, SCM FACILITY), 24 (SCM IDENT, SCM OPTION, SCM FACILITY),
25 "Opens a connection to the system logger for Guile program.") 25 "Opens a connection to the system logger for Guile program.")
26 #define FUNC_NAME s_mu_openlog 26 #define FUNC_NAME s_scm_mu_openlog
27 { 27 {
28 char *ident; 28 char *ident;
29 int option, facility; 29 int option, facility;
...@@ -56,10 +56,10 @@ SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0, ...@@ -56,10 +56,10 @@ SCM_DEFINE(mu_openlog, "mu-openlog", 3, 0, 0,
56 } 56 }
57 #undef FUNC_NAME 57 #undef FUNC_NAME
58 58
59 SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0, 59 SCM_DEFINE (scm_mu_logger, "mu-logger", 2, 0, 0,
60 (SCM PRIO, SCM TEXT), 60 (SCM PRIO, SCM TEXT),
61 "Generates a log message to be distributed via syslogd.") 61 "Generates a log message to be distributed via syslogd.")
62 #define FUNC_NAME s_mu_logger 62 #define FUNC_NAME s_scm_mu_logger
63 { 63 {
64 int prio; 64 int prio;
65 65
...@@ -79,10 +79,10 @@ SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0, ...@@ -79,10 +79,10 @@ SCM_DEFINE (mu_logger, "mu-logger", 2, 0, 0,
79 } 79 }
80 #undef FUNC_NAME 80 #undef FUNC_NAME
81 81
82 SCM_DEFINE (mu_closelog, "mu-closelog", 0, 0, 0, 82 SCM_DEFINE (scm_mu_closelog, "mu-closelog", 0, 0, 0,
83 (), 83 (),
84 "Closes the channel to the system logger open by mu-openlog.") 84 "Closes the channel to the system logger open by mu-openlog.")
85 #define FUNC_NAME s_mu_closelog 85 #define FUNC_NAME s_scm_mu_closelog
86 { 86 {
87 closelog (); 87 closelog ();
88 return SCM_UNSPECIFIED; 88 return SCM_UNSPECIFIED;
......
...@@ -38,11 +38,11 @@ static scm_sizet ...@@ -38,11 +38,11 @@ static scm_sizet
38 mu_scm_mailbox_free (SCM mailbox_smob) 38 mu_scm_mailbox_free (SCM mailbox_smob)
39 { 39 {
40 struct mu_mailbox *mum = (struct mu_mailbox *) SCM_CDR (mailbox_smob); 40 struct mu_mailbox *mum = (struct mu_mailbox *) SCM_CDR (mailbox_smob);
41 mailbox_close (mum->mbox); 41 mu_mailbox_close (mum->mbox);
42 mailbox_destroy (&mum->mbox); 42 mu_mailbox_destroy (&mum->mbox);
43 free (mum); 43 free (mum);
44 /* NOTE: Currently there is no way for this function to return the 44 /* NOTE: Currently there is no way for this function to return the
45 amount of memory *actually freed* by mailbox_destroy */ 45 amount of memory *actually freed* by mu_mailbox_destroy */
46 return sizeof (struct mu_mailbox); 46 return sizeof (struct mu_mailbox);
47 } 47 }
48 48
...@@ -53,8 +53,8 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate) ...@@ -53,8 +53,8 @@ mu_scm_mailbox_print (SCM mailbox_smob, SCM port, scm_print_state * pstate)
53 size_t count = 0; 53 size_t count = 0;
54 url_t url = NULL; 54 url_t url = NULL;
55 55
56 mailbox_messages_count (mum->mbox, &count); 56 mu_mailbox_messages_count (mum->mbox, &count);
57 mailbox_get_url (mum->mbox, &url); 57 mu_mailbox_get_url (mum->mbox, &url);
58 58
59 scm_puts ("#<mailbox ", port); 59 scm_puts ("#<mailbox ", port);
60 60
...@@ -134,10 +134,10 @@ SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0, ...@@ -134,10 +134,10 @@ SCM_DEFINE (scm_mu_folder_directory, "mu-folder-directory", 0, 1, 0,
134 } 134 }
135 #undef FUNC_NAME 135 #undef FUNC_NAME
136 136
137 SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0, 137 SCM_DEFINE (scm_mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
138 (SCM URL, SCM MODE), 138 (SCM URL, SCM MODE),
139 "Opens a mailbox specified by URL.") 139 "Opens a mailbox specified by URL.")
140 #define FUNC_NAME s_mu_mailbox_open 140 #define FUNC_NAME s_scm_mu_mailbox_open
141 { 141 {
142 mailbox_t mbox = NULL; 142 mailbox_t mbox = NULL;
143 char *mode_str; 143 char *mode_str;
...@@ -167,12 +167,12 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0, ...@@ -167,12 +167,12 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
167 if (mode & MU_STREAM_READ && mode & MU_STREAM_WRITE) 167 if (mode & MU_STREAM_READ && mode & MU_STREAM_WRITE)
168 mode = (mode & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR; 168 mode = (mode & ~(MU_STREAM_READ | MU_STREAM_WRITE)) | MU_STREAM_RDWR;
169 169
170 if (mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0) 170 if (mu_mailbox_create_default (&mbox, SCM_STRING_CHARS (URL)) != 0)
171 return SCM_BOOL_F; 171 return SCM_BOOL_F;
172 172
173 if (mailbox_open (mbox, mode) != 0) 173 if (mu_mailbox_open (mbox, mode) != 0)
174 { 174 {
175 mailbox_destroy (&mbox); 175 mu_mailbox_destroy (&mbox);
176 return SCM_BOOL_F; 176 return SCM_BOOL_F;
177 } 177 }
178 178
...@@ -180,42 +180,42 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0, ...@@ -180,42 +180,42 @@ SCM_DEFINE (mu_mailbox_open, "mu-mailbox-open", 2, 0, 0,
180 } 180 }
181 #undef FUNC_NAME 181 #undef FUNC_NAME
182 182
183 SCM_DEFINE (mu_mailbox_close, "mu-mailbox-close", 1, 0, 0, 183 SCM_DEFINE (scm_mu_mailbox_close, "mu-mailbox-close", 1, 0, 0,
184 (SCM MBOX), "Closes mailbox MBOX") 184 (SCM MBOX), "Closes mailbox MBOX")
185 #define FUNC_NAME s_mu_mailbox_close 185 #define FUNC_NAME s_scm_mu_mailbox_close
186 { 186 {
187 struct mu_mailbox *mum; 187 struct mu_mailbox *mum;
188 188
189 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); 189 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
190 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 190 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
191 mailbox_close (mum->mbox); 191 mu_mailbox_close (mum->mbox);
192 mailbox_destroy (&mum->mbox); 192 mu_mailbox_destroy (&mum->mbox);
193 return SCM_UNSPECIFIED; 193 return SCM_UNSPECIFIED;
194 } 194 }
195 #undef FUNC_NAME 195 #undef FUNC_NAME
196 196
197 SCM_DEFINE (mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0, 197 SCM_DEFINE (scm_mu_mailbox_get_url, "mu-mailbox-get-url", 1, 0, 0,
198 (SCM MBOX), 198 (SCM MBOX),
199 "Returns the URL of the mailbox.") 199 "Returns the URL of the mailbox.")
200 #define FUNC_NAME s_mu_mailbox_get_url 200 #define FUNC_NAME s_scm_mu_mailbox_get_url
201 { 201 {
202 struct mu_mailbox *mum; 202 struct mu_mailbox *mum;
203 url_t url; 203 url_t url;
204 204
205 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); 205 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
206 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 206 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
207 mailbox_get_url (mum->mbox, &url); 207 mu_mailbox_get_url (mum->mbox, &url);
208 return scm_makfrom0str (url_to_string (url)); 208 return scm_makfrom0str (url_to_string (url));
209 } 209 }
210 #undef FUNC_NAME 210 #undef FUNC_NAME
211 211
212 SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0, 212 SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
213 (SCM MBOX, SCM MODE), 213 (SCM MBOX, SCM MODE),
214 "Returns a port associated with the contents of the MBOX.\n" 214 "Returns a port associated with the contents of the MBOX.\n"
215 "MODE is a string defining operation mode of the stream. It may\n" 215 "MODE is a string defining operation mode of the stream. It may\n"
216 "contain any of the two characters: \"r\" for reading, \"w\" for\n" 216 "contain any of the two characters: \"r\" for reading, \"w\" for\n"
217 "writing.\n") 217 "writing.\n")
218 #define FUNC_NAME s_mu_mailbox_get_port 218 #define FUNC_NAME s_scm_mu_mailbox_get_port
219 { 219 {
220 struct mu_mailbox *mum; 220 struct mu_mailbox *mum;
221 stream_t stream; 221 stream_t stream;
...@@ -224,16 +224,16 @@ SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0, ...@@ -224,16 +224,16 @@ SCM_DEFINE (mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
224 SCM_ASSERT (SCM_NIMP (MODE) && SCM_STRINGP (MODE), 224 SCM_ASSERT (SCM_NIMP (MODE) && SCM_STRINGP (MODE),
225 MODE, SCM_ARG2, FUNC_NAME); 225 MODE, SCM_ARG2, FUNC_NAME);
226 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 226 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
227 if (mailbox_get_stream (mum->mbox, &stream)) 227 if (mu_mailbox_get_stream (mum->mbox, &stream))
228 return SCM_BOOL_F; 228 return SCM_BOOL_F;
229 return mu_port_make_from_stream (MBOX, stream, 229 return mu_port_make_from_stream (MBOX, stream,
230 scm_mode_bits (SCM_STRING_CHARS (MODE))); 230 scm_mode_bits (SCM_STRING_CHARS (MODE)));
231 } 231 }
232 #undef FUNC_NAME 232 #undef FUNC_NAME
233 233
234 SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0, 234 SCM_DEFINE (scm_mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
235 (SCM MBOX, SCM MSGNO), "Retrieve from MBOX message # MSGNO.") 235 (SCM MBOX, SCM MSGNO), "Retrieve from MBOX message # MSGNO.")
236 #define FUNC_NAME s_mu_mailbox_get_message 236 #define FUNC_NAME s_scm_mu_mailbox_get_message
237 { 237 {
238 size_t msgno; 238 size_t msgno;
239 struct mu_mailbox *mum; 239 struct mu_mailbox *mum;
...@@ -246,16 +246,16 @@ SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0, ...@@ -246,16 +246,16 @@ SCM_DEFINE (mu_mailbox_get_message, "mu-mailbox-get-message", 2, 0, 0,
246 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 246 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
247 msgno = SCM_INUM (MSGNO); 247 msgno = SCM_INUM (MSGNO);
248 248
249 if (mailbox_get_message (mum->mbox, msgno, &msg)) 249 if (mu_mailbox_get_message (mum->mbox, msgno, &msg))
250 return SCM_BOOL_F; 250 return SCM_BOOL_F;
251 251
252 return mu_scm_message_create (MBOX, msg); 252 return mu_scm_message_create (MBOX, msg);
253 } 253 }
254 #undef FUNC_NAME 254 #undef FUNC_NAME
255 255
256 SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0, 256 SCM_DEFINE (scm_mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
257 (SCM MBOX), "Returns number of messages in the mailbox.") 257 (SCM MBOX), "Returns number of messages in the mailbox.")
258 #define FUNC_NAME s_mu_mailbox_messages_count 258 #define FUNC_NAME s_scm_mu_mailbox_messages_count
259 { 259 {
260 struct mu_mailbox *mum; 260 struct mu_mailbox *mum;
261 size_t nmesg; 261 size_t nmesg;
...@@ -263,43 +263,43 @@ SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0, ...@@ -263,43 +263,43 @@ SCM_DEFINE (mu_mailbox_messages_count, "mu-mailbox-messages-count", 1, 0, 0,
263 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); 263 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
264 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 264 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
265 265
266 if (mailbox_messages_count (mum->mbox, &nmesg)) 266 if (mu_mailbox_messages_count (mum->mbox, &nmesg))
267 return SCM_BOOL_F; 267 return SCM_BOOL_F;
268 return scm_makenum (nmesg); 268 return mu_scm_makenum (nmesg);
269 } 269 }
270 #undef FUNC_NAME 270 #undef FUNC_NAME
271 271
272 SCM_DEFINE (mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0, 272 SCM_DEFINE (scm_mu_mailbox_expunge, "mu-mailbox-expunge", 1, 0, 0,
273 (SCM MBOX), "Expunges deleted messages from the mailbox.") 273 (SCM MBOX), "Expunges deleted messages from the mailbox.")
274 #define FUNC_NAME s_mu_mailbox_expunge 274 #define FUNC_NAME s_scm_mu_mailbox_expunge
275 { 275 {
276 struct mu_mailbox *mum; 276 struct mu_mailbox *mum;
277 277
278 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); 278 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
279 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 279 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
280 if (mailbox_expunge (mum->mbox)) 280 if (mu_mailbox_expunge (mum->mbox))
281 return SCM_BOOL_F; 281 return SCM_BOOL_F;
282 return SCM_BOOL_T; 282 return SCM_BOOL_T;
283 } 283 }
284 #undef FUNC_NAME 284 #undef FUNC_NAME
285 285
286 SCM_DEFINE (mu_mailbox_url, "mu-mailbox-url", 1, 0, 0, 286 SCM_DEFINE (scm_mu_mailbox_url, "mu-mailbox-url", 1, 0, 0,
287 (SCM MBOX), "Returns the URL of the mailbox") 287 (SCM MBOX), "Returns the URL of the mailbox")
288 #define FUNC_NAME s_mu_mailbox_url 288 #define FUNC_NAME s_scm_mu_mailbox_url
289 { 289 {
290 struct mu_mailbox *mum; 290 struct mu_mailbox *mum;
291 url_t url; 291 url_t url;
292 292
293 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); 293 SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
294 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 294 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
295 mailbox_get_url (mum->mbox, &url); 295 mu_mailbox_get_url (mum->mbox, &url);
296 return scm_makfrom0str (url_to_string (url)); 296 return scm_makfrom0str (url_to_string (url));
297 } 297 }
298 #undef FUNC_NAME 298 #undef FUNC_NAME
299 299
300 SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0, 300 SCM_DEFINE (scm_mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
301 (SCM MBOX, SCM MESG), "Appends the message to the mailbox") 301 (SCM MBOX, SCM MESG), "Appends the message to the mailbox")
302 #define FUNC_NAME s_mu_mailbox_append_message 302 #define FUNC_NAME s_scm_mu_mailbox_append_message
303 { 303 {
304 struct mu_mailbox *mum; 304 struct mu_mailbox *mum;
305 message_t msg; 305 message_t msg;
...@@ -308,7 +308,7 @@ SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0, ...@@ -308,7 +308,7 @@ SCM_DEFINE (mu_mailbox_append_message, "mu-mailbox-append-message", 2, 0, 0,
308 SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME); 308 SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG2, FUNC_NAME);
309 mum = (struct mu_mailbox *) SCM_CDR (MBOX); 309 mum = (struct mu_mailbox *) SCM_CDR (MBOX);
310 msg = mu_scm_message_get (MESG); 310 msg = mu_scm_message_get (MESG);
311 if (mailbox_append_message (mum->mbox, msg)) 311 if (mu_mailbox_append_message (mum->mbox, msg))
312 return SCM_BOOL_F; 312 return SCM_BOOL_F;
313 return SCM_BOOL_T; 313 return SCM_BOOL_T;
314 } 314 }
......
...@@ -88,10 +88,10 @@ mu_scm_is_mime (SCM scm) ...@@ -88,10 +88,10 @@ mu_scm_is_mime (SCM scm)
88 /* ************************************************************************* */ 88 /* ************************************************************************* */
89 /* Guile primitives */ 89 /* Guile primitives */
90 90
91 SCM_DEFINE (mu_mime_create, "mu-mime-create", 0, 2, 0, 91 SCM_DEFINE (scm_mu_mime_create, "mu-mime-create", 0, 2, 0,
92 (SCM FLAGS, SCM MESG), 92 (SCM FLAGS, SCM MESG),
93 "Creates a new MIME object.") 93 "Creates a new MIME object.")
94 #define FUNC_NAME s_mu_mime_create 94 #define FUNC_NAME s_scm_mu_mime_create
95 { 95 {
96 message_t msg = NULL; 96 message_t msg = NULL;
97 mime_t mime; 97 mime_t mime;
...@@ -122,20 +122,20 @@ SCM_DEFINE (mu_mime_create, "mu-mime-create", 0, 2, 0, ...@@ -122,20 +122,20 @@ SCM_DEFINE (mu_mime_create, "mu-mime-create", 0, 2, 0,
122 } 122 }
123 #undef FUNC_NAME 123 #undef FUNC_NAME
124 124
125 SCM_DEFINE (mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0, 125 SCM_DEFINE (scm_mu_mime_multipart_p, "mu-mime-multipart?", 1, 0, 0,
126 (SCM MIME), 126 (SCM MIME),
127 "Returns #t if MIME is a multipart object.\n") 127 "Returns #t if MIME is a multipart object.\n")
128 #define FUNC_NAME s_mu_mime_multipart_p 128 #define FUNC_NAME s_scm_mu_mime_multipart_p
129 { 129 {
130 SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME); 130 SCM_ASSERT (mu_scm_is_mime (MIME), MIME, SCM_ARG1, FUNC_NAME);
131 return mime_is_multipart (mu_scm_mime_get (MIME)) ? SCM_BOOL_T : SCM_BOOL_F; 131 return mime_is_multipart (mu_scm_mime_get (MIME)) ? SCM_BOOL_T : SCM_BOOL_F;
132 } 132 }
133 #undef FUNC_NAME 133 #undef FUNC_NAME
134 134
135 SCM_DEFINE (mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0, 135 SCM_DEFINE (scm_mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
136 (SCM MIME), 136 (SCM MIME),
137 "Returns number of parts in a MIME object.") 137 "Returns number of parts in a MIME object.")
138 #define FUNC_NAME s_mu_mime_get_num_parts 138 #define FUNC_NAME s_scm_mu_mime_get_num_parts
139 { 139 {
140 mime_t mime; 140 mime_t mime;
141 size_t nparts; 141 size_t nparts;
...@@ -144,14 +144,14 @@ SCM_DEFINE (mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0, ...@@ -144,14 +144,14 @@ SCM_DEFINE (mu_mime_get_num_parts, "mu-mime-get-num-parts", 1, 0, 0,
144 mime = mu_scm_mime_get (MIME); 144 mime = mu_scm_mime_get (MIME);
145 if (mime_get_num_parts (mime, &nparts)) 145 if (mime_get_num_parts (mime, &nparts))
146 return SCM_BOOL_F; 146 return SCM_BOOL_F;
147 return scm_makenum (nparts); 147 return mu_scm_makenum (nparts);
148 } 148 }
149 #undef FUNC_NAME 149 #undef FUNC_NAME
150 150
151 SCM_DEFINE (mu_mime_get_part, "mu-mime-get-part", 2, 0, 0, 151 SCM_DEFINE (scm_mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
152 (SCM MIME, SCM PART), 152 (SCM MIME, SCM PART),
153 "Returns part number PART from a MIME object.") 153 "Returns part number PART from a MIME object.")
154 #define FUNC_NAME s_mu_mime_get_part 154 #define FUNC_NAME s_scm_mu_mime_get_part
155 { 155 {
156 message_t msg = NULL; 156 message_t msg = NULL;
157 157
...@@ -165,10 +165,10 @@ SCM_DEFINE (mu_mime_get_part, "mu-mime-get-part", 2, 0, 0, ...@@ -165,10 +165,10 @@ SCM_DEFINE (mu_mime_get_part, "mu-mime-get-part", 2, 0, 0,
165 } 165 }
166 #undef FUNC_NAME 166 #undef FUNC_NAME
167 167
168 SCM_DEFINE (mu_mime_add_part, "mu-mime-add-part", 2, 0, 0, 168 SCM_DEFINE (scm_mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
169 (SCM MIME, SCM MESG), 169 (SCM MIME, SCM MESG),
170 "Adds MESG to the MIME object.") 170 "Adds MESG to the MIME object.")
171 #define FUNC_NAME s_mu_mime_add_part 171 #define FUNC_NAME s_scm_mu_mime_add_part
172 { 172 {
173 mime_t mime; 173 mime_t mime;
174 message_t msg; 174 message_t msg;
...@@ -187,10 +187,10 @@ SCM_DEFINE (mu_mime_add_part, "mu-mime-add-part", 2, 0, 0, ...@@ -187,10 +187,10 @@ SCM_DEFINE (mu_mime_add_part, "mu-mime-add-part", 2, 0, 0,
187 } 187 }
188 #undef FUNC_NAME 188 #undef FUNC_NAME
189 189
190 SCM_DEFINE (mu_mime_get_message, "mu-mime-get-message", 1, 0, 0, 190 SCM_DEFINE (scm_mu_mime_get_message, "mu-mime-get-message", 1, 0, 0,
191 (SCM MIME), 191 (SCM MIME),
192 "Converts MIME object to a message.\n") 192 "Converts MIME object to a message.\n")
193 #define FUNC_NAME s_mu_mime_get_message 193 #define FUNC_NAME s_scm_mu_mime_get_message
194 { 194 {
195 mime_t mime; 195 mime_t mime;
196 message_t msg; 196 message_t msg;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 #endif 23 #endif
24 24
25 SCM 25 SCM
26 scm_makenum (unsigned long val) 26 mu_scm_makenum (unsigned long val)
27 #ifndef HAVE_SCM_LONG2NUM 27 #ifndef HAVE_SCM_LONG2NUM
28 { 28 {
29 if (SCM_FIXABLE ((long) val)) 29 if (SCM_FIXABLE ((long) val))
...@@ -101,7 +101,7 @@ register_format (const char *name) ...@@ -101,7 +101,7 @@ register_format (const char *name)
101 } 101 }
102 102
103 103
104 SCM_DEFINE (mu_register_format, "mu-register-format", 0, 0, 1, 104 SCM_DEFINE (scm_mu_register_format, "mu-register-format", 0, 0, 1,
105 (SCM REST), 105 (SCM REST),
106 "Registers desired mailutils formats. Takes any number of arguments.\n" 106 "Registers desired mailutils formats. Takes any number of arguments.\n"
107 "Allowed arguments are:\n" 107 "Allowed arguments are:\n"
...@@ -113,7 +113,7 @@ SCM_DEFINE (mu_register_format, "mu-register-format", 0, 0, 1, ...@@ -113,7 +113,7 @@ SCM_DEFINE (mu_register_format, "mu-register-format", 0, 0, 1,
113 " \"smtp\" smtp mailer\n" 113 " \"smtp\" smtp mailer\n"
114 "\n" 114 "\n"
115 "If called without arguments, registers all available formats\n") 115 "If called without arguments, registers all available formats\n")
116 #define FUNC_NAME s_mu_register_format 116 #define FUNC_NAME s_scm_mu_register_format
117 { 117 {
118 SCM status; 118 SCM status;
119 119
...@@ -163,7 +163,7 @@ mu_scm_init () ...@@ -163,7 +163,7 @@ mu_scm_init ()
163 _mu_scm_mailer = scm_makfrom0str ("sendmail:" _PATH_SENDMAIL); 163 _mu_scm_mailer = scm_makfrom0str ("sendmail:" _PATH_SENDMAIL);
164 mu_set_variable ("mu-mailer", _mu_scm_mailer); 164 mu_set_variable ("mu-mailer", _mu_scm_mailer);
165 165
166 _mu_scm_debug = scm_makenum(0); 166 _mu_scm_debug = mu_scm_makenum(0);
167 mu_set_variable ("mu-debug", _mu_scm_debug); 167 mu_set_variable ("mu-debug", _mu_scm_debug);
168 168
169 _mu_scm_package = scm_makfrom0str (PACKAGE); 169 _mu_scm_package = scm_makfrom0str (PACKAGE);
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
18 18
19 #include "mu_scm.h" 19 #include "mu_scm.h"
20 20
21 SCM_DEFINE (mu_scm_getpwuid, "mu-getpwuid", 1, 0, 0, 21 SCM_DEFINE (scm_mu_getpwuid, "mu-getpwuid", 1, 0, 0,
22 (SCM USER), 22 (SCM USER),
23 "Look up an entry in the user database. USER can be an integer,\n" 23 "Look up an entry in the user database. USER can be an integer,\n"
24 "or a string, giving the behaviour of mu_get_auth_by_uid or mu_get_auth_by_name\n" 24 "or a string, giving the behaviour of mu_get_auth_by_uid or mu_get_auth_by_name\n"
25 "respectively.\n" 25 "respectively.\n"
26 "Returns a vector with fields corresponding to those of the mu_auth_data\n" 26 "Returns a vector with fields corresponding to those of the mu_auth_data\n"
27 "entry in question. If no matching entry was found, returns #f.\n") 27 "entry in question. If no matching entry was found, returns #f.\n")
28 #define FUNC_NAME s_mu_scm_getpwuid 28 #define FUNC_NAME s_scm_mu_getpwuid
29 { 29 {
30 SCM result; 30 SCM result;
31 struct mu_auth_data *entry; 31 struct mu_auth_data *entry;
......
1 ## Process this file with GNU Automake to create Makefile.in 1 ## Process this file with GNU Automake to create Makefile.in
2 2
3 ## Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3 ## Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 ## 4 ##
5 ## GNU Mailutils is free software; you can redistribute it and/or 5 ## GNU Mailutils is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License as 6 ## modify it under the terms of the GNU General Public License as
...@@ -58,10 +58,10 @@ EXTRA_DIST = sieve.y sieve.l ...@@ -58,10 +58,10 @@ EXTRA_DIST = sieve.y sieve.l
58 sieve-lex.c: $(srcdir)/sieve.l sieve-gram.h 58 sieve-lex.c: $(srcdir)/sieve.l sieve-gram.h
59 $(YLWRAP) "$(LEX) $(AM_LEXFLAGS) $(LEXFLAGS)" \ 59 $(YLWRAP) "$(LEX) $(AM_LEXFLAGS) $(LEXFLAGS)" \
60 $(srcdir)/sieve.l lex.yy.c sieve-lex.c \ 60 $(srcdir)/sieve.l lex.yy.c sieve-lex.c \
61 -- -yy sieve_yy 61 -- -yy mu_sieve_yy
62 62
63 sieve-gram.c sieve-gram.h: $(srcdir)/sieve.y 63 sieve-gram.c sieve-gram.h: $(srcdir)/sieve.y
64 $(YLWRAP) "$(YACC) $(AM_YFLAGS) $(YFLAGS)" $(srcdir)/sieve.y \ 64 $(YLWRAP) "$(YACC) $(AM_YFLAGS) $(YFLAGS)" $(srcdir)/sieve.y \
65 y.tab.c sieve-gram.c y.tab.h sieve-gram.h y.output y.output \ 65 y.tab.c sieve-gram.c y.tab.h sieve-gram.h y.output y.output \
66 -- -yy sieve_yy 66 -- -yy mu_sieve_yy
67 67
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
23 #include <mailutils/argp.h> 23 #include <mailutils/argp.h>
24 #include <string.h> 24 #include <string.h>
25 25
26 list_t sieve_include_path = NULL; 26 list_t mu_sieve_include_path = NULL;
27 list_t sieve_library_path = NULL; 27 list_t mu_sieve_library_path = NULL;
28 28
29 static error_t sieve_argp_parser (int key, char *arg, struct argp_state *state); 29 static error_t sieve_argp_parser (int key, char *arg, struct argp_state *state);
30 30
...@@ -57,22 +57,22 @@ 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)
57 switch (key) 57 switch (key)
58 { 58 {
59 case 'I': 59 case 'I':
60 plist = &sieve_include_path; 60 plist = &mu_sieve_include_path;
61 break; 61 break;
62 62
63 case 'L': 63 case 'L':
64 plist = &sieve_library_path; 64 plist = &mu_sieve_library_path;
65 break; 65 break;
66 66
67 case ARGP_KEY_INIT: 67 case ARGP_KEY_INIT:
68 #ifdef SIEVE_MODDIR 68 #ifdef SIEVE_MODDIR
69 plist = &sieve_library_path; 69 plist = &mu_sieve_library_path;
70 arg = SIEVE_MODDIR; 70 arg = SIEVE_MODDIR;
71 #endif 71 #endif
72 break; 72 break;
73 73
74 case ARGP_KEY_FINI: 74 case ARGP_KEY_FINI:
75 sieve_load_add_path (sieve_library_path); 75 sieve_load_add_path (mu_sieve_library_path);
76 break; 76 break;
77 77
78 default: 78 default:
...@@ -83,7 +83,7 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state) ...@@ -83,7 +83,7 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
83 { 83 {
84 if (!*plist) 84 if (!*plist)
85 { 85 {
86 int rc = list_create (plist); 86 int rc = mu_list_create (plist);
87 if (rc) 87 if (rc)
88 { 88 {
89 argp_error (state, "can't create list: %s", 89 argp_error (state, "can't create list: %s",
...@@ -91,14 +91,14 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state) ...@@ -91,14 +91,14 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state)
91 exit (1); 91 exit (1);
92 } 92 }
93 } 93 }
94 list_append (*plist, strdup (arg)); 94 mu_list_append (*plist, strdup (arg));
95 } 95 }
96 96
97 return 0; 97 return 0;
98 } 98 }
99 99
100 void 100 void
101 sieve_argp_init () 101 mu_sieve_argp_init ()
102 { 102 {
103 if (mu_register_capa ("sieve", &sieve_argp_child)) 103 if (mu_register_capa ("sieve", &sieve_argp_child))
104 { 104 {
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
...@@ -31,28 +32,28 @@ ...@@ -31,28 +32,28 @@
31 typedef struct { 32 typedef struct {
32 const char *name; 33 const char *name;
33 int required; 34 int required;
34 sieve_comparator_t comp[MU_SIEVE_MATCH_LAST]; 35 mu_sieve_comparator_t comp[MU_SIEVE_MATCH_LAST];
35 } sieve_comparator_record_t; 36 } sieve_comparator_record_t;
36 37
37 int 38 int
38 sieve_register_comparator (sieve_machine_t mach, 39 mu_sieve_register_comparator (mu_sieve_machine_t mach,
39 const char *name, 40 const char *name,
40 int required, 41 int required,
41 sieve_comparator_t is, sieve_comparator_t contains, 42 mu_sieve_comparator_t is, mu_sieve_comparator_t contains,
42 sieve_comparator_t matches, 43 mu_sieve_comparator_t matches,
43 sieve_comparator_t regex, 44 mu_sieve_comparator_t regex,
44 sieve_comparator_t eq) 45 mu_sieve_comparator_t eq)
45 { 46 {
46 sieve_comparator_record_t *rp; 47 sieve_comparator_record_t *rp;
47 48
48 if (!mach->comp_list) 49 if (!mach->comp_list)
49 { 50 {
50 int rc = list_create (&mach->comp_list); 51 int rc = mu_list_create (&mach->comp_list);
51 if (rc) 52 if (rc)
52 return rc; 53 return rc;
53 } 54 }
54 55
55 rp = sieve_malloc (mach, sizeof (*rp)); 56 rp = mu_sieve_malloc (mach, sizeof (*rp));
56 rp->required = required; 57 rp->required = required;
57 rp->name = name; 58 rp->name = name;
58 rp->comp[MU_SIEVE_MATCH_IS] = is; 59 rp->comp[MU_SIEVE_MATCH_IS] = is;
...@@ -61,7 +62,7 @@ sieve_register_comparator (sieve_machine_t mach, ...@@ -61,7 +62,7 @@ sieve_register_comparator (sieve_machine_t mach,
61 rp->comp[MU_SIEVE_MATCH_REGEX] = regex; 62 rp->comp[MU_SIEVE_MATCH_REGEX] = regex;
62 rp->comp[MU_SIEVE_MATCH_EQ] = eq; 63 rp->comp[MU_SIEVE_MATCH_EQ] = eq;
63 64
64 return list_append (mach->comp_list, rp); 65 return mu_list_append (mach->comp_list, rp);
65 } 66 }
66 67
67 sieve_comparator_record_t * 68 sieve_comparator_record_t *
...@@ -70,28 +71,28 @@ _lookup (list_t list, const char *name) ...@@ -70,28 +71,28 @@ _lookup (list_t list, const char *name)
70 iterator_t itr; 71 iterator_t itr;
71 sieve_comparator_record_t *reg; 72 sieve_comparator_record_t *reg;
72 73
73 if (!list || list_get_iterator (list, &itr)) 74 if (!list || mu_list_get_iterator (list, &itr))
74 return NULL; 75 return NULL;
75 76
76 for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) 77 for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
77 { 78 {
78 iterator_current (itr, (void **)&reg); 79 mu_iterator_current (itr, (void **)&reg);
79 if (strcmp (reg->name, name) == 0) 80 if (strcmp (reg->name, name) == 0)
80 break; 81 break;
81 else 82 else
82 reg = NULL; 83 reg = NULL;
83 } 84 }
84 iterator_destroy (&itr); 85 mu_iterator_destroy (&itr);
85 return reg; 86 return reg;
86 } 87 }
87 88
88 int 89 int
89 sieve_require_comparator (sieve_machine_t mach, const char *name) 90 mu_sieve_require_comparator (mu_sieve_machine_t mach, const char *name)
90 { 91 {
91 sieve_comparator_record_t *reg = _lookup (mach->comp_list, name); 92 sieve_comparator_record_t *reg = _lookup (mach->comp_list, name);
92 if (!reg) 93 if (!reg)
93 { 94 {
94 if (!(sieve_load_ext (mach, name) == 0 95 if (!(mu_sieve_load_ext (mach, name) == 0
95 && (reg = _lookup (mach->comp_list, name)) != NULL)) 96 && (reg = _lookup (mach->comp_list, name)) != NULL))
96 return 1; 97 return 1;
97 } 98 }
...@@ -100,8 +101,8 @@ sieve_require_comparator (sieve_machine_t mach, const char *name) ...@@ -100,8 +101,8 @@ sieve_require_comparator (sieve_machine_t mach, const char *name)
100 return 0; 101 return 0;
101 } 102 }
102 103
103 sieve_comparator_t 104 mu_sieve_comparator_t
104 sieve_comparator_lookup (sieve_machine_t mach, const char *name, int matchtype) 105 mu_sieve_comparator_lookup (mu_sieve_machine_t mach, const char *name, int matchtype)
105 { 106 {
106 sieve_comparator_record_t *reg = _lookup (mach->comp_list, name); 107 sieve_comparator_record_t *reg = _lookup (mach->comp_list, name);
107 if (reg && reg->comp[matchtype]) 108 if (reg && reg->comp[matchtype])
...@@ -112,23 +113,23 @@ sieve_comparator_lookup (sieve_machine_t mach, const char *name, int matchtype) ...@@ -112,23 +113,23 @@ sieve_comparator_lookup (sieve_machine_t mach, const char *name, int matchtype)
112 static int 113 static int
113 _find_comparator (void *item, void *data) 114 _find_comparator (void *item, void *data)
114 { 115 {
115 sieve_runtime_tag_t *tag = item; 116 mu_sieve_runtime_tag_t *tag = item;
116 117
117 if (strcmp (tag->tag, TAG_COMPFUN) == 0) 118 if (strcmp (tag->tag, TAG_COMPFUN) == 0)
118 { 119 {
119 *(sieve_comparator_t*)data = tag->arg->v.ptr; 120 *(mu_sieve_comparator_t*)data = tag->arg->v.ptr;
120 return 1; 121 return 1;
121 } 122 }
122 return 0; 123 return 0;
123 } 124 }
124 125
125 sieve_comparator_t 126 mu_sieve_comparator_t
126 sieve_get_comparator (sieve_machine_t mach, list_t tags) 127 mu_sieve_get_comparator (mu_sieve_machine_t mach, list_t tags)
127 { 128 {
128 sieve_comparator_t comp = NULL; 129 mu_sieve_comparator_t comp = NULL;
129 130
130 list_do (tags, _find_comparator, &comp); 131 mu_list_do (tags, _find_comparator, &comp);
131 return comp ? comp : sieve_comparator_lookup (mach, 132 return comp ? comp : mu_sieve_comparator_lookup (mach,
132 "i;ascii-casemap", 133 "i;ascii-casemap",
133 MU_SIEVE_MATCH_IS); 134 MU_SIEVE_MATCH_IS);
134 } 135 }
...@@ -157,7 +158,7 @@ _regex_compile (void *item, void *data) ...@@ -157,7 +158,7 @@ _regex_compile (void *item, void *data)
157 { 158 {
158 struct regex_data *rd = data; 159 struct regex_data *rd = data;
159 int rc; 160 int rc;
160 regex_t *preg = sieve_malloc (sieve_machine, sizeof (*preg)); 161 regex_t *preg = mu_sieve_malloc (sieve_machine, sizeof (*preg));
161 162
162 rc = regcomp (preg, (char*)item, rd->flags); 163 rc = regcomp (preg, (char*)item, rd->flags);
163 if (rc) 164 if (rc)
...@@ -177,7 +178,7 @@ _regex_compile (void *item, void *data) ...@@ -177,7 +178,7 @@ _regex_compile (void *item, void *data)
177 return rc; 178 return rc;
178 } 179 }
179 180
180 list_append (rd->list, preg); 181 mu_list_append (rd->list, preg);
181 182
182 return 0; 183 return 0;
183 } 184 }
...@@ -193,8 +194,8 @@ static void ...@@ -193,8 +194,8 @@ static void
193 _free_reglist (void *data) 194 _free_reglist (void *data)
194 { 195 {
195 list_t list = data; 196 list_t list = data;
196 list_do (list, _free_regex, NULL); 197 mu_list_do (list, _free_regex, NULL);
197 list_destroy (&list); 198 mu_list_destroy (&list);
198 } 199 }
199 200
200 static int 201 static int
...@@ -204,26 +205,26 @@ comp_false (const char *pattern, const char *text) ...@@ -204,26 +205,26 @@ comp_false (const char *pattern, const char *text)
204 } 205 }
205 206
206 int 207 int
207 sieve_match_part_checker (const char *name, list_t tags, list_t args) 208 mu_sieve_match_part_checker (const char *name, list_t tags, list_t args)
208 { 209 {
209 iterator_t itr; 210 iterator_t itr;
210 sieve_runtime_tag_t *match = NULL; 211 mu_sieve_runtime_tag_t *match = NULL;
211 sieve_runtime_tag_t *comp = NULL; 212 mu_sieve_runtime_tag_t *comp = NULL;
212 sieve_runtime_tag_t *tmp; 213 mu_sieve_runtime_tag_t *tmp;
213 sieve_comparator_t compfun = NULL; 214 mu_sieve_comparator_t compfun = NULL;
214 char *compname = "false"; 215 char *compname = "false";
215 216
216 int matchtype; 217 int matchtype;
217 int err = 0; 218 int err = 0;
218 219
219 if (!tags || list_get_iterator (tags, &itr)) 220 if (!tags || mu_list_get_iterator (tags, &itr))
220 return 0; 221 return 0;
221 222
222 for (iterator_first (itr); !err && !iterator_is_done (itr); 223 for (mu_iterator_first (itr); !err && !mu_iterator_is_done (itr);
223 iterator_next (itr)) 224 mu_iterator_next (itr))
224 { 225 {
225 sieve_runtime_tag_t *t; 226 mu_sieve_runtime_tag_t *t;
226 iterator_current (itr, (void **)&t); 227 mu_iterator_current (itr, (void **)&t);
227 228
228 if (strcmp (t->tag, "is") == 0 229 if (strcmp (t->tag, "is") == 0
229 || strcmp (t->tag, "contains") == 0 230 || strcmp (t->tag, "contains") == 0
...@@ -246,7 +247,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args) ...@@ -246,7 +247,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
246 comp = t; 247 comp = t;
247 } 248 }
248 249
249 iterator_destroy (&itr); 250 mu_iterator_destroy (&itr);
250 251
251 if (err) 252 if (err)
252 return 1; 253 return 1;
...@@ -264,7 +265,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args) ...@@ -264,7 +265,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
264 char *str = match->arg->v.string; 265 char *str = match->arg->v.string;
265 if (strcmp (match->tag, "count") == 0) 266 if (strcmp (match->tag, "count") == 0)
266 { 267 {
267 sieve_value_t *val; 268 mu_sieve_value_t *val;
268 char *str; 269 char *str;
269 size_t count; 270 size_t count;
270 271
...@@ -280,18 +281,18 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args) ...@@ -280,18 +281,18 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
280 281
281 matchtype = MU_SIEVE_MATCH_LAST; /* to not leave it undefined */ 282 matchtype = MU_SIEVE_MATCH_LAST; /* to not leave it undefined */
282 compfun = comp_false; 283 compfun = comp_false;
283 val = sieve_value_get (args, 1); 284 val = mu_sieve_value_get (args, 1);
284 if (!val) 285 if (!val)
285 return 1; /* shouldn't happen */ 286 return 1; /* shouldn't happen */
286 /* NOTE: Type of v is always SVT_STRING_LIST */ 287 /* NOTE: Type of v is always SVT_STRING_LIST */
287 list_count (val->v.list, &count); 288 mu_list_count (val->v.list, &count);
288 if (count > 1) 289 if (count > 1)
289 { 290 {
290 sieve_compile_error (sieve_filename, sieve_line_num, 291 sieve_compile_error (sieve_filename, sieve_line_num,
291 _("second argument must be a list of one element")); 292 _("second argument must be a list of one element"));
292 return 1; 293 return 1;
293 } 294 }
294 list_get (val->v.list, 0, (void **) &str); 295 mu_list_get (val->v.list, 0, (void **) &str);
295 count = strtoul (str, &str, 10); 296 count = strtoul (str, &str, 10);
296 if (*str) 297 if (*str)
297 { 298 {
...@@ -303,7 +304,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args) ...@@ -303,7 +304,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
303 else 304 else
304 matchtype = MU_SIEVE_MATCH_EQ; 305 matchtype = MU_SIEVE_MATCH_EQ;
305 306
306 if (sieve_str_to_relcmp (str, NULL, NULL)) 307 if (mu_sieve_str_to_relcmp (str, NULL, NULL))
307 { 308 {
308 sieve_compile_error (sieve_filename, sieve_line_num, 309 sieve_compile_error (sieve_filename, sieve_line_num,
309 _("invalid relational match `%s' in call to `%s'"), 310 _("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) ...@@ -315,7 +316,7 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
315 if (!compfun) 316 if (!compfun)
316 { 317 {
317 compname = comp ? comp->arg->v.string : "i;ascii-casemap"; 318 compname = comp ? comp->arg->v.string : "i;ascii-casemap";
318 compfun = sieve_comparator_lookup (sieve_machine, compname, matchtype); 319 compfun = mu_sieve_comparator_lookup (sieve_machine, compname, matchtype);
319 if (!compfun) 320 if (!compfun)
320 { 321 {
321 sieve_compile_error (sieve_filename, sieve_line_num, 322 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) ...@@ -325,47 +326,47 @@ sieve_match_part_checker (const char *name, list_t tags, list_t args)
325 } 326 }
326 } 327 }
327 328
328 tmp = sieve_malloc (sieve_machine, sizeof (*tmp)); 329 tmp = mu_sieve_malloc (sieve_machine, sizeof (*tmp));
329 tmp->tag = TAG_COMPFUN; 330 tmp->tag = TAG_COMPFUN;
330 tmp->arg = sieve_value_create (SVT_POINTER, compfun); 331 tmp->arg = mu_sieve_value_create (SVT_POINTER, compfun);
331 list_append (tags, tmp); 332 mu_list_append (tags, tmp);
332 333
333 if (matchtype == MU_SIEVE_MATCH_REGEX) 334 if (matchtype == MU_SIEVE_MATCH_REGEX)
334 { 335 {
335 /* To speed up things, compile all patterns at once. 336 /* To speed up things, compile all patterns at once.
336 Notice that it is supposed that patterns are in arg 2 */ 337 Notice that it is supposed that patterns are in arg 2 */
337 sieve_value_t *val, *newval; 338 mu_sieve_value_t *val, *newval;
338 struct regex_data rd; 339 struct regex_data rd;
339 int rc; 340 int rc;
340 341
341 if (list_get (args, 1, (void**)&val)) 342 if (mu_list_get (args, 1, (void**)&val))
342 return 0; 343 return 0;
343 344
344 rd.flags = REG_EXTENDED; 345 rd.flags = REG_EXTENDED;
345 if (strcmp (compname, "i;ascii-casemap") == 0) 346 if (strcmp (compname, "i;ascii-casemap") == 0)
346 rd.flags |= REG_ICASE; 347 rd.flags |= REG_ICASE;
347 348
348 list_create (&rd.list); 349 mu_list_create (&rd.list);
349 350
350 rc = sieve_vlist_do (val, _regex_compile, &rd); 351 rc = mu_sieve_vlist_do (val, _regex_compile, &rd);
351 352
352 sieve_machine_add_destructor (sieve_machine, _free_reglist, rd.list); 353 mu_sieve_machine_add_destructor (sieve_machine, _free_reglist, rd.list);
353 354
354 if (rc) 355 if (rc)
355 return rc; 356 return rc;
356 newval = sieve_value_create (SVT_STRING_LIST, rd.list); 357 newval = mu_sieve_value_create (SVT_STRING_LIST, rd.list);
357 list_replace (args, val, newval); 358 mu_list_replace (args, val, newval);
358 } 359 }
359 #ifndef FNM_CASEFOLD 360 #ifndef FNM_CASEFOLD
360 else if (matchtype == MU_SIEVE_MATCH_MATCHES 361 else if (matchtype == MU_SIEVE_MATCH_MATCHES
361 && strcmp (compname, "i;ascii-casemap") == 0) 362 && strcmp (compname, "i;ascii-casemap") == 0)
362 { 363 {
363 int rc; 364 int rc;
364 sieve_value_t *val; 365 mu_sieve_value_t *val;
365 366
366 if (list_get (args, 1, (void**)&val)) 367 if (mu_list_get (args, 1, (void**)&val))
367 return 0; 368 return 0;
368 rc = sieve_vlist_do (val, _pattern_upcase, NULL); 369 rc = mu_sieve_vlist_do (val, _pattern_upcase, NULL);
369 if (rc) 370 if (rc)
370 return rc; 371 return rc;
371 } 372 }
...@@ -487,9 +488,9 @@ i_ascii_numeric_eq (const char *pattern, const char *text) ...@@ -487,9 +488,9 @@ i_ascii_numeric_eq (const char *pattern, const char *text)
487 } 488 }
488 489
489 void 490 void
490 sieve_register_standard_comparators (sieve_machine_t mach) 491 sieve_register_standard_comparators (mu_sieve_machine_t mach)
491 { 492 {
492 sieve_register_comparator (mach, 493 mu_sieve_register_comparator (mach,
493 "i;octet", 494 "i;octet",
494 1, 495 1,
495 i_octet_is, 496 i_octet_is,
...@@ -497,7 +498,7 @@ sieve_register_standard_comparators (sieve_machine_t mach) ...@@ -497,7 +498,7 @@ sieve_register_standard_comparators (sieve_machine_t mach)
497 i_octet_matches, 498 i_octet_matches,
498 i_octet_regex, 499 i_octet_regex,
499 i_octet_eq); 500 i_octet_eq);
500 sieve_register_comparator (mach, 501 mu_sieve_register_comparator (mach,
501 "i;ascii-casemap", 502 "i;ascii-casemap",
502 1, 503 1,
503 i_ascii_casemap_is, 504 i_ascii_casemap_is,
...@@ -505,7 +506,7 @@ sieve_register_standard_comparators (sieve_machine_t mach) ...@@ -505,7 +506,7 @@ sieve_register_standard_comparators (sieve_machine_t mach)
505 i_ascii_casemap_matches, 506 i_ascii_casemap_matches,
506 i_ascii_casemap_regex, 507 i_ascii_casemap_regex,
507 i_ascii_casemap_eq); 508 i_ascii_casemap_eq);
508 sieve_register_comparator (mach, 509 mu_sieve_register_comparator (mach,
509 "i;ascii-numeric", 510 "i;ascii-numeric",
510 0, 511 0,
511 i_ascii_numeric_is, 512 i_ascii_numeric_is,
......