diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-08-26 14:23:32 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-08-26 14:23:32 +0000 |
commit | 6178304b1670d7288d8a37b9165bda5cbc44c180 (patch) | |
tree | e17d3bce1e0b2a537937bc331efa240ce382b81e /imap4d | |
parent | ef22616eba2aaa4e05079852ac1fa67c4ceeff08 (diff) | |
download | mailutils-6178304b1670d7288d8a37b9165bda5cbc44c180.tar.gz mailutils-6178304b1670d7288d8a37b9165bda5cbc44c180.tar.bz2 |
Normalize global namespace. Part 1
Diffstat (limited to 'imap4d')
-rw-r--r-- | imap4d/append.c | 26 | ||||
-rw-r--r-- | imap4d/auth_gsasl.c | 6 | ||||
-rw-r--r-- | imap4d/authenticate.c | 14 | ||||
-rw-r--r-- | imap4d/bye.c | 6 | ||||
-rw-r--r-- | imap4d/capability.c | 12 | ||||
-rw-r--r-- | imap4d/close.c | 10 | ||||
-rw-r--r-- | imap4d/copy.c | 14 | ||||
-rw-r--r-- | imap4d/expunge.c | 4 | ||||
-rw-r--r-- | imap4d/fetch.c | 76 | ||||
-rw-r--r-- | imap4d/imap4d.c | 5 | ||||
-rw-r--r-- | imap4d/imap4d.h | 5 | ||||
-rw-r--r-- | imap4d/rename.c | 28 | ||||
-rw-r--r-- | imap4d/search.c | 26 | ||||
-rw-r--r-- | imap4d/select.c | 18 | ||||
-rw-r--r-- | imap4d/status.c | 22 | ||||
-rw-r--r-- | imap4d/store.c | 14 | ||||
-rw-r--r-- | imap4d/sync.c | 72 | ||||
-rw-r--r-- | imap4d/util.c | 41 |
18 files changed, 201 insertions, 198 deletions
diff --git a/imap4d/append.c b/imap4d/append.c index 4afc012d9..d9ad8373a 100644 --- a/imap4d/append.c +++ b/imap4d/append.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,17 +41,17 @@ imap4d_append (struct imap4d_command *command, char *arg) if (!mboxname) return util_finish (command, RESP_NO, "Couldn't open mailbox"); - status = mailbox_create_default (&dest_mbox, mboxname); + status = mu_mailbox_create_default (&dest_mbox, mboxname); if (status == 0) { /* It SHOULD NOT automatifcllly create the mailbox. */ - status = mailbox_open (dest_mbox, MU_STREAM_RDWR); + status = mu_mailbox_open (dest_mbox, MU_STREAM_RDWR); if (status == 0) { status = imap4d_append0 (dest_mbox, flags, sp); - mailbox_close (dest_mbox); + mu_mailbox_close (dest_mbox); } - mailbox_destroy (&dest_mbox); + mu_mailbox_destroy (&dest_mbox); } free (mboxname); @@ -64,7 +64,7 @@ imap4d_append (struct imap4d_command *command, char *arg) static int _append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite) { - message_t msg = envelope_get_owner (envelope); + message_t msg = mu_envelope_get_owner (envelope); struct tm **tm = message_get_owner (msg); strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm); @@ -119,19 +119,19 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text) stream_write (stream, text, strlen (text), len, &len); message_set_stream (msg, stream, &tm); - envelope_create (&env, msg); - envelope_set_date (env, _append_date, msg); - envelope_set_sender (env, _append_sender, msg); + mu_envelope_create (&env, msg); + mu_envelope_set_date (env, _append_date, msg); + mu_envelope_set_sender (env, _append_sender, msg); message_set_envelope (msg, env, &tm); - rc = mailbox_append_message (mbox, msg); + rc = mu_mailbox_append_message (mbox, msg); if (rc == 0 && flags) { size_t num = 0; attribute_t attr = NULL; - mailbox_messages_count (mbox, &num); - mailbox_get_message (mbox, num, &msg); + mu_mailbox_messages_count (mbox, &num); + mu_mailbox_get_message (mbox, num, &msg); message_get_attribute (msg, &attr); - attribute_set_flags (attr, flags); + mu_attribute_set_flags (attr, flags); } message_destroy (&msg, &tm); diff --git a/imap4d/auth_gsasl.c b/imap4d/auth_gsasl.c index 42649d521..a84839889 100644 --- a/imap4d/auth_gsasl.c +++ b/imap4d/auth_gsasl.c @@ -33,7 +33,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags) { int rc; - rc = gsasl_stream_create (newstr, transport, sess_ctx, flags); + rc = mu_gsasl_stream_create (newstr, transport, sess_ctx, flags); if (rc) { syslog (LOG_ERR, _("cannot create SASL stream: %s"), @@ -269,9 +269,9 @@ cb_retrieve (Gsasl_session_ctx *ctx, if (username && *username == 0 && authentication_id) *username = strdup (authentication_id); - if (gsasl_cram_md5_pwd && access (gsasl_cram_md5_pwd, R_OK) == 0) + if (mu_gsasl_cram_md5_pwd && access (mu_gsasl_cram_md5_pwd, R_OK) == 0) { - int rc = gsasl_md5pwd_get_password (gsasl_cram_md5_pwd, + int rc = gsasl_md5pwd_get_password (mu_gsasl_cram_md5_pwd, authentication_id, key, keylen); if (rc == GSASL_OK) diff --git a/imap4d/authenticate.c b/imap4d/authenticate.c index 6da22804f..7d1366e8f 100644 --- a/imap4d/authenticate.c +++ b/imap4d/authenticate.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,16 +44,16 @@ auth_add (char *name, imap4d_auth_handler_fp handler) p->handler = handler; if (!imap_auth_list) { - list_create (&imap_auth_list); - list_set_comparator (imap_auth_list, comp); + mu_list_create (&imap_auth_list); + mu_list_set_comparator (imap_auth_list, comp); } - list_append (imap_auth_list, (void*)p); + mu_list_append (imap_auth_list, (void*)p); } void auth_remove (char *name) { - list_remove (imap_auth_list, (void*) name); + mu_list_remove (imap_auth_list, (void*) name); } static int @@ -90,7 +90,7 @@ _auth_try (void *item, void *data) void imap4d_auth_capability () { - list_do (imap_auth_list, _auth_capa, NULL); + mu_list_do (imap_auth_list, _auth_capa, NULL); } int @@ -113,7 +113,7 @@ imap4d_authenticate (struct imap4d_command *command, char *arg) adata.arg = sp; adata.username = NULL; - if (list_do (imap_auth_list, _auth_try, &adata) == 0) + if (mu_list_do (imap_auth_list, _auth_try, &adata) == 0) return util_finish (command, RESP_NO, "Authentication mechanism not supported"); diff --git a/imap4d/bye.c b/imap4d/bye.c index d527a692a..e6c01fb49 100644 --- a/imap4d/bye.c +++ b/imap4d/bye.c @@ -31,9 +31,9 @@ imap4d_bye0 (int reason, struct imap4d_command *command) if (mbox) { - mailbox_flush (mbox, 0); - mailbox_close (mbox); - mailbox_destroy (&mbox); + mu_mailbox_flush (mbox, 0); + mu_mailbox_close (mbox); + mu_mailbox_destroy (&mbox); } switch (reason) diff --git a/imap4d/capability.c b/imap4d/capability.c index 59761ed80..58be76129 100644 --- a/imap4d/capability.c +++ b/imap4d/capability.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,16 +31,16 @@ imap4d_capability_add (const char *str) { if (!capa_list) { - list_create (&capa_list); - list_set_comparator (capa_list, comp); + mu_list_create (&capa_list); + mu_list_set_comparator (capa_list, comp); } - list_append (capa_list, (void*)str); + mu_list_append (capa_list, (void*)str); } void imap4d_capability_remove (const char *str) { - list_remove (capa_list, (void*)str); + mu_list_remove (capa_list, (void*)str); } void @@ -71,7 +71,7 @@ imap4d_capability (struct imap4d_command *command, char *arg ARG_UNUSED) { util_send ("* CAPABILITY"); - list_do (capa_list, print_capa, NULL); + mu_list_do (capa_list, print_capa, NULL); imap4d_auth_capability (); util_send ("\r\n"); diff --git a/imap4d/close.c b/imap4d/close.c index d6f85c97f..a8610f874 100644 --- a/imap4d/close.c +++ b/imap4d/close.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,10 +30,10 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED) const char *msg = NULL; int status, flags; - mailbox_get_flags (mbox, &flags); + mu_mailbox_get_flags (mbox, &flags); if ((flags & MU_STREAM_READ) == 0) { - status = mailbox_flush (mbox, 1); + status = mu_mailbox_flush (mbox, 1); if (status) { syslog (LOG_ERR, @@ -44,13 +44,13 @@ imap4d_close (struct imap4d_command *command, char *arg ARG_UNUSED) /* No messages are removed, and no error is given, if the mailbox is selected by an EXAMINE command or is otherwise selected read-only. */ - status = mailbox_close (mbox); + status = mu_mailbox_close (mbox); if (status) { syslog (LOG_ERR, _("closing mailbox failed: %s"), mu_strerror (status)); msg = "closing mailbox failed"; } - mailbox_destroy (&mbox); + mu_mailbox_destroy (&mbox); if (msg) return util_finish (command, RESP_NO, msg); diff --git a/imap4d/copy.c b/imap4d/copy.c index 123c6da9a..71166fd44 100644 --- a/imap4d/copy.c +++ b/imap4d/copy.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,11 +81,11 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen) /* If the destination mailbox does not exist, a server should return an error. */ - status = mailbox_create_default (&cmbox, mailbox_name); + status = mu_mailbox_create_default (&cmbox, mailbox_name); if (status == 0) { /* It SHOULD NOT automatifcllly create the mailbox. */ - status = mailbox_open (cmbox, MU_STREAM_RDWR); + status = mu_mailbox_open (cmbox, MU_STREAM_RDWR); if (status == 0) { size_t i; @@ -93,12 +93,12 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen) { message_t msg = NULL; size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; - if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0) - mailbox_append_message (cmbox, msg); + if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0) + mu_mailbox_append_message (cmbox, msg); } - mailbox_close (cmbox); + mu_mailbox_close (cmbox); } - mailbox_destroy (&cmbox); + mu_mailbox_destroy (&cmbox); } free (set); free (mailbox_name); diff --git a/imap4d/expunge.c b/imap4d/expunge.c index 6068759ba..22945ca85 100644 --- a/imap4d/expunge.c +++ b/imap4d/expunge.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ imap4d_expunge (struct imap4d_command *command, char *arg) return util_finish (command, RESP_NO, "Too many args"); /* FIXME: check for errors. */ - mailbox_expunge (mbox); + mu_mailbox_expunge (mbox); imap4d_sync (); return util_finish (command, RESP_OK, "Completed"); diff --git a/imap4d/fetch.c b/imap4d/fetch.c index 2cbb4b0a2..d4a277afe 100644 --- a/imap4d/fetch.c +++ b/imap4d/fetch.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -169,7 +169,7 @@ imap4d_fetch0 (char *arg, int isuid, char *resp, size_t resplen) size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; message_t msg = NULL; - if (msgno && mailbox_get_message (mbox, msgno, &msg) == 0) + if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0) { char item[32]; char *items = strdup (sp); @@ -356,7 +356,7 @@ fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED) message_get_envelope (command->msg, &env); date[0] = '\0'; - if (envelope_date (env, date, sizeof (date), NULL) == 0) + if (mu_envelope_date (env, date, sizeof (date), NULL) == 0) { char *p = date; if (mu_parse_ctime_date_time ((const char **) &p, &tm, &tz) == 0) @@ -498,10 +498,10 @@ fetch_body (struct fetch_command *command, char **arg) { attribute_t attr = NULL; message_get_attribute (command->msg, &attr); - if (!attribute_is_read (attr)) + if (!mu_attribute_is_read (attr)) { util_send ("FLAGS (\\Seen) "); - attribute_set_read (attr); + mu_attribute_set_read (attr); } } else if (strncasecmp (*arg,".PEEK", 5) == 0) @@ -534,7 +534,7 @@ fetch_send_header_value (header_t header, const char *name, if (space) util_send (" "); - if (header_aget_value (header, name, &buffer) == 0) + if (mu_header_aget_value (header, name, &buffer) == 0) { util_send_qstring (buffer); free (buffer); @@ -553,7 +553,7 @@ fetch_send_header_list (header_t header, const char *name, if (space) util_send (" "); - if (header_aget_value (header, name, &buffer) == 0) + if (mu_header_aget_value (header, name, &buffer) == 0) { send_parameter_list (buffer); free (buffer); @@ -572,7 +572,7 @@ fetch_send_header_address (header_t header, const char *name, if (space) util_send (" "); - if (header_aget_value (header, name, &buffer) == 0) + if (mu_header_aget_value (header, name, &buffer) == 0) { fetch_send_address (buffer); free (buffer); @@ -603,7 +603,7 @@ fetch_envelope0 (message_t msg) fetch_send_header_value (header, "Subject", NULL, 1); /* From: */ - header_aget_value (header, "From", &from); + mu_header_aget_value (header, "From", &from); util_send (" "); fetch_send_address (from); @@ -670,13 +670,13 @@ fetch_bodystructure0 (message_t message, int extension) /* The subtype. */ - if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) + if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) { int argc = 0; char **argv; char *s; - argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); + mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); s = strchr (argv[0], '/'); if (s) @@ -733,7 +733,7 @@ fetch_bodystructure0 (message_t message, int extension) } else util_send (" NIL"); - argcv_free (argc, argv); + mu_argcv_free (argc, argv); free (buffer); } else @@ -807,13 +807,13 @@ bodystructure (message_t msg, int extension) message_get_header (msg, &header); - if (header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) + if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) { int argc = 0; char **argv; char *s, *p; - argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); + mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); if (strcasecmp (argv[0], "MESSAGE/RFC822") == 0) message_rfc822 = 1; @@ -890,7 +890,7 @@ bodystructure (message_t msg, int extension) } else util_send (" NIL"); - argcv_free (argc, argv); + mu_argcv_free (argc, argv); free (buffer); } else @@ -914,8 +914,8 @@ bodystructure (message_t msg, int extension) size_t size = 0; body_t body = NULL; message_get_body (msg, &body); - body_size (body, &size); - body_lines (body, &blines); + mu_body_size (body, &size); + mu_body_lines (body, &blines); util_send (" %d", size + blines); } @@ -1125,9 +1125,9 @@ fetch_header (message_t msg, unsigned long start, unsigned long end) stream_t stream = NULL; size_t size = 0, lines = 0; message_get_header (msg, &header); - header_size (header, &size); - header_lines (header, &lines); - header_get_stream (header, &stream); + mu_header_size (header, &size); + mu_header_lines (header, &lines); + mu_header_get_stream (header, &stream); return fetch_io (stream, start, end, size + lines); } @@ -1138,9 +1138,9 @@ fetch_body_content (message_t msg, unsigned long start, unsigned long end) stream_t stream = NULL; size_t size = 0, lines = 0; message_get_body (msg, &body); - body_size (body, &size); - body_lines (body, &lines); - body_get_stream (body, &stream); + mu_body_size (body, &size); + mu_body_lines (body, &lines); + mu_body_get_stream (body, &stream); return fetch_io (stream, start, end, size + lines); } @@ -1152,7 +1152,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end, size_t n = 0; off_t offset; - filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ); + mu_filter_create (&rfc, stream, "rfc822", MU_FILTER_ENCODE, MU_STREAM_READ); if (start == ULONG_MAX || end == ULONG_MAX) { @@ -1254,7 +1254,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, { char *value = NULL; size_t n = 0; - if (header_aget_value (header, array[j], &value)) + if (mu_header_aget_value (header, array[j], &value)) continue; n = asprintf (&buffer, "%s: %s\n", array[j], value); @@ -1349,7 +1349,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, header_t header = NULL; size_t count = 0; message_get_header (msg, &header); - header_get_field_count (header, &count); + mu_header_get_field_count (header, &count); for (i = 1; i <= count; i++) { char *name = NULL; @@ -1358,7 +1358,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, size_t ignore = 0; /* Get the field name. */ - status = header_aget_field_name (header, i, &name); + status = mu_header_aget_field_name (header, i, &name); if (*name == '\0') { free (name); @@ -1383,7 +1383,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, } } - if (header_aget_field_value (header, i, &value) == 0) + if (mu_header_aget_field_value (header, i, &value) == 0) { char *nl; @@ -1448,8 +1448,8 @@ fetch_send_address (const char *addr) return RESP_OK; } - address_create (&address, addr); - address_get_count (address, &count); + mu_address_create (&address, addr); + mu_address_get_count (address, &count); /* We failed: can't parse. */ if (count == 0) @@ -1466,13 +1466,13 @@ fetch_send_address (const char *addr) util_send ("("); *buf = '\0'; - address_get_personal (address, i, buf, sizeof (buf), NULL); + mu_address_get_personal (address, i, buf, sizeof (buf), NULL); util_send_qstring (buf); util_send (" "); *buf = '\0'; - address_get_route (address, i, buf, sizeof (buf), NULL); + mu_address_get_route (address, i, buf, sizeof (buf), NULL); util_send_qstring (buf); util_send (" "); @@ -1481,18 +1481,18 @@ fetch_send_address (const char *addr) { int is_group = 0; - address_is_group (address, i, &is_group); + mu_address_is_group (address, i, &is_group); if (is_group) - address_get_personal (address, i, buf, sizeof (buf), NULL); + mu_address_get_personal (address, i, buf, sizeof (buf), NULL); else - address_get_local_part (address, i, buf, sizeof (buf), NULL); + mu_address_get_local_part (address, i, buf, sizeof (buf), NULL); } util_send_qstring (buf); util_send (" "); *buf = '\0'; - address_get_domain (address, i, buf, sizeof (buf), NULL); + mu_address_get_domain (address, i, buf, sizeof (buf), NULL); util_send_qstring (buf); util_send (")"); @@ -1514,7 +1514,7 @@ send_parameter_list (const char *buffer) return; } - argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); + mu_argcv_get (buffer, " \t\r\n;=", NULL, &argc, &argv); if (argc == 0) util_send ("NIL"); @@ -1575,7 +1575,7 @@ send_parameter_list (const char *buffer) util_send (" NIL"); util_send (")"); } - argcv_free (argc, argv); + mu_argcv_free (argc, argv); } diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c index 0a1de3001..1e543014f 100644 --- a/imap4d/imap4d.c +++ b/imap4d/imap4d.c @@ -1,5 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -218,7 +219,7 @@ main (int argc, char **argv) if (daemon_param.pidfile) { - daemon_create_pidfile (daemon_param.pidfile); + mu_daemon_create_pidfile (daemon_param.pidfile); } /* Check TLS environment, i.e. cert and key files */ diff --git a/imap4d/imap4d.h b/imap4d/imap4d.h index 40ed9c5f8..532c929ea 100644 --- a/imap4d/imap4d.h +++ b/imap4d/imap4d.h @@ -1,5 +1,6 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -291,7 +292,7 @@ void util_set_output (stream_t str); int util_wait_input (int); void util_register_event (int old_state, int new_state, - list_action_t *action, void *data); + mu_list_action_t *action, void *data); void util_event_remove (void *id); void util_run_events (int old_state, int new_state); diff --git a/imap4d/rename.c b/imap4d/rename.c index 571bbe71e..f974428d0 100644 --- a/imap4d/rename.c +++ b/imap4d/rename.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,8 +79,8 @@ imap4d_rename (struct imap4d_command *command, char *arg) } name = calloc (strlen ("mbox:") + strlen (newname) + 1, 1); sprintf (name, "mbox:%s", newname); - if (mailbox_create (&newmbox, newname) != 0 - || mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0) + if (mu_mailbox_create (&newmbox, newname) != 0 + || mu_mailbox_open (newmbox, MU_STREAM_CREAT | MU_STREAM_RDWR) != 0) { free (name); free (newname); @@ -89,29 +89,29 @@ imap4d_rename (struct imap4d_command *command, char *arg) free (name); free (newname); - if (mailbox_create_default (&inbox, auth_data->name) == 0 && - mailbox_open (inbox, MU_STREAM_RDWR) == 0) + if (mu_mailbox_create_default (&inbox, auth_data->name) == 0 && + mu_mailbox_open (inbox, MU_STREAM_RDWR) == 0) { size_t no; size_t total = 0; - mailbox_messages_count (inbox, &total); + mu_mailbox_messages_count (inbox, &total); for (no = 1; no <= total; no++) { message_t message; - if (mailbox_get_message (inbox, no, &message) == 0) + if (mu_mailbox_get_message (inbox, no, &message) == 0) { attribute_t attr = NULL; - mailbox_append_message (newmbox, message); + mu_mailbox_append_message (newmbox, message); message_get_attribute (message, &attr); - attribute_set_deleted (attr); + mu_attribute_set_deleted (attr); } } - mailbox_expunge (inbox); - mailbox_close (inbox); - mailbox_destroy (&inbox); + mu_mailbox_expunge (inbox); + mu_mailbox_close (inbox); + mu_mailbox_destroy (&inbox); } - mailbox_close (newmbox); - mailbox_destroy (&newmbox); + mu_mailbox_close (newmbox); + mu_mailbox_destroy (&newmbox); return util_finish (command, RESP_OK, "Already exist"); } diff --git a/imap4d/search.c b/imap4d/search.c index 8fc60360b..fdba4be25 100644 --- a/imap4d/search.c +++ b/imap4d/search.c @@ -274,12 +274,12 @@ do_search (struct parsebuf *pb) { size_t count = 0; - mailbox_messages_count (mbox, &count); + mu_mailbox_messages_count (mbox, &count); util_send ("* SEARCH"); for (pb->msgno = 1; pb->msgno <= count; pb->msgno++) { - if (mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0 + if (mu_mailbox_get_message (mbox, pb->msgno, &pb->msg) == 0 && search_run (pb)) { if (pb->isuid) @@ -665,7 +665,7 @@ _scan_header (struct parsebuf *pb, char *name, char *value) header_t header = NULL; message_get_header (pb->msg, &header); - if (!header_get_value (header, name, buffer, sizeof(buffer), NULL)) + if (!mu_header_get_value (header, name, buffer, sizeof(buffer), NULL)) { return util_strcasestr (buffer, value) != NULL; } @@ -680,7 +680,7 @@ _header_date (struct parsebuf *pb, time_t *timep) header_t header = NULL; message_get_header (pb->msg, &header); - if (!header_get_value (header, "Date", buffer, sizeof(buffer), NULL) + if (!mu_header_get_value (header, "Date", buffer, sizeof(buffer), NULL) && util_parse_822_date (buffer, timep)) return 0; return 1; @@ -696,10 +696,10 @@ _scan_header_all (struct parsebuf *pb, char *text) int i, rc; message_get_header (pb->msg, &header); - header_get_field_count (header, &fcount); + mu_header_get_field_count (header, &fcount); for (i = rc = 0; i < fcount; i++) { - if (header_get_field_value (header, i, buffer, sizeof(buffer), NULL)) + if (mu_header_get_field_value (header, i, buffer, sizeof(buffer), NULL)) rc = util_strcasestr (buffer, text) != NULL; } return rc; @@ -718,9 +718,9 @@ _scan_body (struct parsebuf *pb, char *text) int rc; message_get_body (pb->msg, &body); - body_size (body, &size); - body_lines (body, &lines); - body_get_stream (body, &stream); + mu_body_size (body, &size); + mu_body_lines (body, &lines); + mu_body_get_stream (body, &stream); rc = 0; while (rc == 0 && stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0 @@ -794,7 +794,7 @@ cond_before (struct parsebuf *pb) envelope_t env; message_get_envelope (pb->msg, &env); - envelope_date (env, buffer, sizeof (buffer), NULL); + mu_envelope_date (env, buffer, sizeof (buffer), NULL); util_parse_ctime_date (buffer, &mesg_time); _search_push (pb, mesg_time < t); } @@ -820,7 +820,7 @@ cond_from (struct parsebuf *pb) int rc = 0; message_get_envelope (pb->msg, &env); - if (envelope_sender (env, buffer, sizeof (buffer), NULL) == 0) + if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL) == 0) rc = util_strcasestr (buffer, s) != NULL; _search_push (pb, _scan_header (pb, "from", s)); } @@ -863,7 +863,7 @@ cond_on (struct parsebuf *pb) envelope_t env; message_get_envelope (pb->msg, &env); - envelope_date (env, buffer, sizeof (buffer), NULL); + mu_envelope_date (env, buffer, sizeof (buffer), NULL); util_parse_ctime_date (buffer, &mesg_time); _search_push (pb, t <= mesg_time && mesg_time <= t + 86400); } @@ -907,7 +907,7 @@ cond_since (struct parsebuf *pb) envelope_t env; message_get_envelope (pb->msg, &env); - envelope_date (env, buffer, sizeof (buffer), NULL); + mu_envelope_date (env, buffer, sizeof (buffer), NULL); util_parse_ctime_date (buffer, &mesg_time); _search_push (pb, mesg_time >= t); } diff --git a/imap4d/select.c b/imap4d/select.c index fd24a346b..a34c2d3ee 100644 --- a/imap4d/select.c +++ b/imap4d/select.c @@ -48,9 +48,9 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags) currently selected mailbox without doing an expunge. */ if (mbox) { - mailbox_save_attributes (mbox); - mailbox_close (mbox); - mailbox_destroy (&mbox); + mu_mailbox_save_attributes (mbox); + mu_mailbox_close (mbox); + mu_mailbox_destroy (&mbox); /* Destroy the old uid table. */ imap4d_sync (); } @@ -60,8 +60,8 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags) if (!mailbox_name) return util_finish (command, RESP_NO, "Couldn't open mailbox"); - if ((status = mailbox_create (&mbox, mailbox_name)) == 0 - && (status = mailbox_open (mbox, flags)) == 0) + if ((status = mu_mailbox_create (&mbox, mailbox_name)) == 0 + && (status = mu_mailbox_open (mbox, flags)) == 0) { select_flags = flags; state = STATE_SEL; @@ -97,10 +97,10 @@ imap4d_select_status () return 0; /* FIXME: this should be something! */ if ((status = util_uidvalidity (mbox, &uidvalidity)) - || (status = mailbox_uidnext (mbox, &uidnext)) - || (status = mailbox_messages_count (mbox, &count)) - || (status = mailbox_messages_recent (mbox, &recent)) - || (status = mailbox_message_unseen (mbox, &unseen))) + || (status = mu_mailbox_uidnext (mbox, &uidnext)) + || (status = mu_mailbox_messages_count (mbox, &count)) + || (status = mu_mailbox_messages_recent (mbox, &recent)) + || (status = mu_mailbox_message_unseen (mbox, &unseen))) return status; /* This outputs EXISTS and RECENT responses */ diff --git a/imap4d/status.c b/imap4d/status.c index 41ecc1ccc..5a2f7d1ca 100644 --- a/imap4d/status.c +++ b/imap4d/status.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,10 +75,10 @@ imap4d_status (struct imap4d_command *command, char *arg) if (!mailbox_name) return util_finish (command, RESP_NO, "Error opening mailbox"); - status = mailbox_create_default (&smbox, mailbox_name); + status = mu_mailbox_create_default (&smbox, mailbox_name); if (status == 0) { - status = mailbox_open (smbox, MU_STREAM_READ); + status = mu_mailbox_open (smbox, MU_STREAM_READ); if (status == 0) { |