diff options
author | Wojciech Polak <polak@gnu.org> | 2005-08-27 11:37:43 +0000 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2005-08-27 11:37:43 +0000 |
commit | 755146b443774be9fdff992ede4cb921762b9649 (patch) | |
tree | d92ea93eaf520c557231e7dca1d9051eac00d5be /imap4d | |
parent | 6178304b1670d7288d8a37b9165bda5cbc44c180 (diff) | |
download | mailutils-755146b443774be9fdff992ede4cb921762b9649.tar.gz mailutils-755146b443774be9fdff992ede4cb921762b9649.tar.bz2 |
Normalize global namespace. Part 2
Diffstat (limited to 'imap4d')
-rw-r--r-- | imap4d/append.c | 38 | ||||
-rw-r--r-- | imap4d/auth_gsasl.c | 16 | ||||
-rw-r--r-- | imap4d/authenticate.c | 2 | ||||
-rw-r--r-- | imap4d/capability.c | 2 | ||||
-rw-r--r-- | imap4d/copy.c | 4 | ||||
-rw-r--r-- | imap4d/fetch.c | 156 | ||||
-rw-r--r-- | imap4d/imap4d.c | 2 | ||||
-rw-r--r-- | imap4d/imap4d.h | 22 | ||||
-rw-r--r-- | imap4d/rename.c | 10 | ||||
-rw-r--r-- | imap4d/search.c | 50 | ||||
-rw-r--r-- | imap4d/status.c | 30 | ||||
-rw-r--r-- | imap4d/store.c | 6 | ||||
-rw-r--r-- | imap4d/sync.c | 42 | ||||
-rw-r--r-- | imap4d/util.c | 72 |
14 files changed, 226 insertions, 226 deletions
diff --git a/imap4d/append.c b/imap4d/append.c index d9ad8373a..e4fbef200 100644 --- a/imap4d/append.c +++ b/imap4d/append.c @@ -25,7 +25,7 @@ imap4d_append (struct imap4d_command *command, char *arg) char *sp; char *mboxname; int flags = 0; - mailbox_t dest_mbox = NULL; + mu_mailbox_t dest_mbox = NULL; int status; mboxname = util_getword (arg, &sp); @@ -62,40 +62,40 @@ imap4d_append (struct imap4d_command *command, char *arg) } static int -_append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite) +_append_date (mu_envelope_t envelope, char *buf, size_t len, size_t *pnwrite) { - message_t msg = mu_envelope_get_owner (envelope); - struct tm **tm = message_get_owner (msg); + mu_message_t msg = mu_envelope_get_owner (envelope); + struct tm **tm = mu_message_get_owner (msg); strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm); return 0; } static int -_append_sender (envelope_t envelope, char *buf, size_t len, size_t *pnwrite) +_append_sender (mu_envelope_t envelope, char *buf, size_t len, size_t *pnwrite) { strncpy (buf, "GNU-imap4d", len); return 0; } int -imap4d_append0 (mailbox_t mbox, int flags, char *text) +imap4d_append0 (mu_mailbox_t mbox, int flags, char *text) { - stream_t stream; + mu_stream_t stream; int rc = 0; size_t len = 0; - message_t msg = 0; + mu_message_t msg = 0; struct tm *tm; time_t t; - envelope_t env; + mu_envelope_t env; - if (message_create (&msg, &tm)) + if (mu_message_create (&msg, &tm)) return 1; - if (memory_stream_create (&stream, 0, MU_STREAM_RDWR) - || stream_open (stream)) + if (mu_memory_stream_create (&stream, 0, MU_STREAM_RDWR) + || mu_stream_open (stream)) { - message_destroy (&msg, &tm); + mu_message_destroy (&msg, &tm); return 1; } @@ -116,25 +116,25 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text) } tm = gmtime(&t); - stream_write (stream, text, strlen (text), len, &len); - message_set_stream (msg, stream, &tm); + mu_stream_write (stream, text, strlen (text), len, &len); + mu_message_set_stream (msg, stream, &tm); 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); + mu_message_set_envelope (msg, env, &tm); rc = mu_mailbox_append_message (mbox, msg); if (rc == 0 && flags) { size_t num = 0; - attribute_t attr = NULL; + mu_attribute_t attr = NULL; mu_mailbox_messages_count (mbox, &num); mu_mailbox_get_message (mbox, num, &msg); - message_get_attribute (msg, &attr); + mu_message_get_attribute (msg, &attr); mu_attribute_set_flags (attr, flags); } - message_destroy (&msg, &tm); + mu_message_destroy (&msg, &tm); return rc; } diff --git a/imap4d/auth_gsasl.c b/imap4d/auth_gsasl.c index a84839889..20e0c6ce0 100644 --- a/imap4d/auth_gsasl.c +++ b/imap4d/auth_gsasl.c @@ -29,7 +29,7 @@ static Gsasl_session_ctx *sess_ctx; static void auth_gsasl_capa_init (int disable); static int -create_gsasl_stream (stream_t *newstr, stream_t transport, int flags) +create_gsasl_stream (mu_stream_t *newstr, mu_stream_t transport, int flags) { int rc; @@ -41,10 +41,10 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags) return RESP_NO; } - if ((rc = stream_open (*newstr)) != 0) + if ((rc = mu_stream_open (*newstr)) != 0) { const char *p; - if (stream_strerror (*newstr, &p)) + if (mu_stream_strerror (*newstr, &p)) p = mu_strerror (rc); syslog (LOG_ERR, _("cannot open SASL input stream: %s"), p); return RESP_NO; @@ -56,7 +56,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags) int gsasl_replace_streams (void *self, void *data) { - stream_t *s = data; + mu_stream_t *s = data; util_set_input (s[0]); util_set_output (s[1]); @@ -122,8 +122,8 @@ auth_gsasl (struct imap4d_command *command, if (sess_ctx) { - stream_t tmp, new_in, new_out; - stream_t *s; + mu_stream_t tmp, new_in, new_out; + mu_stream_t *s; util_get_input (&tmp); if (create_gsasl_stream (&new_in, tmp, MU_STREAM_READ)) @@ -131,11 +131,11 @@ auth_gsasl (struct imap4d_command *command, util_get_output (&tmp); if (create_gsasl_stream (&new_out, tmp, MU_STREAM_WRITE)) { - stream_destroy (&new_in, stream_get_owner (new_in)); + mu_stream_destroy (&new_in, mu_stream_get_owner (new_in)); return RESP_NO; } - s = calloc (2, sizeof (stream_t)); + s = calloc (2, sizeof (mu_stream_t)); s[0] = new_in; s[1] = new_out; util_register_event (STATE_NONAUTH, STATE_AUTH, diff --git a/imap4d/authenticate.c b/imap4d/authenticate.c index 7d1366e8f..3dd55bae3 100644 --- a/imap4d/authenticate.c +++ b/imap4d/authenticate.c @@ -23,7 +23,7 @@ struct imap_auth { imap4d_auth_handler_fp handler; }; -static list_t imap_auth_list; +static mu_list_t imap_auth_list; static int comp (const void *item, const void *data) diff --git a/imap4d/capability.c b/imap4d/capability.c index 58be76129..82838402d 100644 --- a/imap4d/capability.c +++ b/imap4d/capability.c @@ -18,7 +18,7 @@ #include "imap4d.h" -static list_t capa_list; +static mu_list_t capa_list; static int comp (const void *item, const void *data) diff --git a/imap4d/copy.c b/imap4d/copy.c index 71166fd44..c4932fb24 100644 --- a/imap4d/copy.c +++ b/imap4d/copy.c @@ -51,7 +51,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen) char *sp = NULL; size_t *set = NULL; int n = 0; - mailbox_t cmbox = NULL; + mu_mailbox_t cmbox = NULL; msgset = util_getword (arg, &sp); name = util_getword (NULL, &sp); @@ -91,7 +91,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen) size_t i; for (i = 0; i < n; i++) { - message_t msg = NULL; + mu_message_t msg = NULL; size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0) mu_mailbox_append_message (cmbox, msg); diff --git a/imap4d/fetch.c b/imap4d/fetch.c index d4a277afe..7298284a0 100644 --- a/imap4d/fetch.c +++ b/imap4d/fetch.c @@ -51,17 +51,17 @@ static int fetch_body (struct fetch_command *, char**); static int fetch_uid (struct fetch_command *, char**); /* Helper functions. */ -static int fetch_envelope0 (message_t); -static int fetch_bodystructure0 (message_t, int); -static int bodystructure (message_t, int); +static int fetch_envelope0 (mu_message_t); +static int fetch_bodystructure0 (mu_message_t, int); +static int bodystructure (mu_message_t, int); static void send_parameter_list (const char *); -static int fetch_operation (message_t, char **, int); -static int fetch_message (message_t, unsigned long, unsigned long); -static int fetch_header (message_t, unsigned long, unsigned long); -static int fetch_body_content (message_t, unsigned long, unsigned long); -static int fetch_io (stream_t, unsigned long, unsigned long, unsigned long); -static int fetch_header_fields (message_t, char **, unsigned long, unsigned long); -static int fetch_header_fields_not (message_t, char **, unsigned long, unsigned long); +static int fetch_operation (mu_message_t, char **, int); +static int fetch_message (mu_message_t, unsigned long, unsigned long); +static int fetch_header (mu_message_t, unsigned long, unsigned long); +static int fetch_body_content (mu_message_t, unsigned long, unsigned long); +static int fetch_io (mu_stream_t, unsigned long, unsigned long, unsigned long); +static int fetch_header_fields (mu_message_t, char **, unsigned long, unsigned long); +static int fetch_header_fields_not (mu_message_t, char **, unsigned long, unsigned long); static int fetch_send_address (const char *); static struct fetch_command* fetch_getcommand (char *, struct fetch_command*); @@ -70,7 +70,7 @@ struct fetch_command { const char *name; int (*func) (struct fetch_command *, char **); - message_t msg; + mu_message_t msg; } fetch_command_table [] = { #define F_ALL 0 @@ -167,7 +167,7 @@ imap4d_fetch0 (char *arg, int isuid, char *resp, size_t resplen) for (i = 0; i < n && rc == RESP_OK; i++) { size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i]; - message_t msg = NULL; + mu_message_t msg = NULL; if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0) { @@ -292,11 +292,11 @@ fetch_envelope (struct fetch_command *command, char **arg ARG_UNUSED) /* FLAGS: The flags that are set for this message. */ /* FIXME: User flags not done. If enable change the PERMANENTFLAGS in SELECT */ void -fetch_flags0 (const char *prefix, message_t msg, int isuid) +fetch_flags0 (const char *prefix, mu_message_t msg, int isuid) { - attribute_t attr = NULL; + mu_attribute_t attr = NULL; - message_get_attribute (msg, &attr); + mu_message_get_attribute (msg, &attr); if (isuid) { struct fetch_command *fcmd = &fetch_command_table[F_UID]; @@ -350,11 +350,11 @@ static int fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED) { char date[128]; - envelope_t env = NULL; + mu_envelope_t env = NULL; struct tm tm, *tmp = NULL; mu_timezone tz; - message_get_envelope (command->msg, &env); + mu_message_get_envelope (command->msg, &env); date[0] = '\0'; if (mu_envelope_date (env, date, sizeof (date), NULL) == 0) { @@ -407,8 +407,8 @@ fetch_rfc822_size (struct fetch_command *command, char **arg ARG_UNUSED) size_t size = 0; size_t lines = 0; - message_size (command->msg, &size); - message_lines (command->msg, &lines); + mu_message_size (command->msg, &size); + mu_message_lines (command->msg, &lines); util_send ("%s %u", command->name, size + lines); return RESP_OK; } @@ -461,7 +461,7 @@ fetch_uid (struct fetch_command *command, char **arg ARG_UNUSED) { size_t uid = 0; - message_get_uid (command->msg, &uid); + mu_message_get_uid (command->msg, &uid); util_send ("%s %d", command->name, uid); return RESP_OK; } @@ -496,8 +496,8 @@ fetch_body (struct fetch_command *command, char **arg) /* It's body section, set the message as seen */ if (**arg == '[') { - attribute_t attr = NULL; - message_get_attribute (command->msg, &attr); + mu_attribute_t attr = NULL; + mu_message_get_attribute (command->msg, &attr); if (!mu_attribute_is_read (attr)) { util_send ("FLAGS (\\Seen) "); @@ -527,7 +527,7 @@ fetch_body (struct fetch_command *command, char **arg) /* Helper Functions: Where the Beef is. */ static void -fetch_send_header_value (header_t header, const char *name, +fetch_send_header_value (mu_header_t header, const char *name, const char *defval, int space) { char *buffer; @@ -546,7 +546,7 @@ fetch_send_header_value (header_t header, const char *name, } static void -fetch_send_header_list (header_t header, const char *name, +fetch_send_header_list (mu_header_t header, const char *name, const char *defval, int space) { char *buffer; @@ -565,7 +565,7 @@ fetch_send_header_list (header_t header, const char *name, } static void -fetch_send_header_address (header_t header, const char *name, +fetch_send_header_address (mu_header_t header, const char *name, const char *defval, int space) { char *buffer; @@ -592,12 +592,12 @@ fetch_send_header_address (header_t header, const char *name, fields are strings. The from, sender, reply-to, to, cc, and bcc fields are parenthesized lists of address structures. */ static int -fetch_envelope0 (message_t msg) +fetch_envelope0 (mu_message_t msg) { char *from = NULL; - header_t header = NULL; + mu_header_t header = NULL; - message_get_header (msg, &header); + mu_message_get_header (msg, &header); fetch_send_header_value (header, "Date", NULL, 0); fetch_send_header_value (header, "Subject", NULL, 1); @@ -642,31 +642,31 @@ fetch_envelope0 (message_t msg) A string or parenthesized list giving the body language value as defined in [LANGUAGE-TAGS]. */ static int -fetch_bodystructure0 (message_t message, int extension) +fetch_bodystructure0 (mu_message_t message, int extension) { size_t nparts = 1; size_t i; int is_multipart = 0; - message_is_multipart (message, &is_multipart); + mu_message_is_multipart (message, &is_multipart); if (is_multipart) { char *buffer = NULL; - header_t header = NULL; + mu_header_t header = NULL; - message_get_num_parts (message, &nparts); + mu_message_get_num_parts (message, &nparts); /* Get all the sub messages. */ for (i = 1; i <= nparts; i++) { - message_t msg = NULL; - message_get_part (message, i, &msg); + mu_message_t msg = NULL; + mu_message_get_part (message, i, &msg); util_send ("("); fetch_bodystructure0 (msg, extension); util_send (")"); } /* for () */ - message_get_header (message, &header); + mu_message_get_header (message, &header); /* The subtype. */ @@ -797,15 +797,15 @@ fetch_bodystructure0 (message_t message, int extension) in [LANGUAGE-TAGS]. */ static int -bodystructure (message_t msg, int extension) +bodystructure (mu_message_t msg, int extension) { - header_t header = NULL; + mu_header_t header = NULL; char *buffer = NULL; size_t blines = 0; int message_rfc822 = 0; int text_plain = 0; - message_get_header (msg, &header); + mu_message_get_header (msg, &header); if (mu_header_aget_value (header, MU_HEADER_CONTENT_TYPE, &buffer) == 0) { @@ -912,8 +912,8 @@ bodystructure (message_t msg, int extension) /* body size RFC822 format. */ { size_t size = 0; - body_t body = NULL; - message_get_body (msg, &body); + mu_body_t body = NULL; + mu_message_get_body (msg, &body); mu_body_size (body, &size); mu_body_lines (body, &blines); util_send (" %d", size + blines); @@ -928,8 +928,8 @@ bodystructure (message_t msg, int extension) else if (message_rfc822) { size_t lines = 0; - message_t emsg = NULL; - message_unencapsulate (msg, &emsg, NULL); + mu_message_t emsg = NULL; + mu_message_unencapsulate (msg, &emsg, NULL); /* Add envelope structure of the encapsulated message. */ util_send (" ("); fetch_envelope0 (emsg); @@ -939,9 +939,9 @@ bodystructure (message_t msg, int extension) bodystructure (emsg, extension); util_send (")"); /* Size in text lines of the encapsulated message. */ - message_lines (emsg, &lines); + mu_message_lines (emsg, &lines); util_send (" %d", lines); - message_destroy (&emsg, NULL); + mu_message_destroy (&emsg, NULL); } if (extension) @@ -959,7 +959,7 @@ bodystructure (message_t msg, int extension) } static int -fetch_operation (message_t msg, char **arg, int silent) +fetch_operation (mu_message_t msg, char **arg, int silent) { unsigned long start = ULONG_MAX; /* No starting offset. */ unsigned long end = ULONG_MAX; /* No limit. */ @@ -997,7 +997,7 @@ fetch_operation (message_t msg, char **arg, int silent) break; /* If the section message did not exist bail out here. */ - status = message_get_part (msg, j, &msg); + status = mu_message_get_part (msg, j, &msg); if (status != 0) { util_send (" \"\""); @@ -1108,23 +1108,23 @@ fetch_operation (message_t msg, char **arg, int silent) } static int -fetch_message (message_t msg, unsigned long start, unsigned long end) +fetch_message (mu_message_t msg, unsigned long start, unsigned long end) { - stream_t stream = NULL; + mu_stream_t stream = NULL; size_t size = 0, lines = 0; - message_get_stream (msg, &stream); - message_size (msg, &size); - message_lines (msg, &lines); + mu_message_get_stream (msg, &stream); + mu_message_size (msg, &size); + mu_message_lines (msg, &lines); return fetch_io (stream, start, end, size + lines); } static int -fetch_header (message_t msg, unsigned long start, unsigned long end) +fetch_header (mu_message_t msg, unsigned long start, unsigned long end) { - header_t header = NULL; - stream_t stream = NULL; + mu_header_t header = NULL; + mu_stream_t stream = NULL; size_t size = 0, lines = 0; - message_get_header (msg, &header); + mu_message_get_header (msg, &header); mu_header_size (header, &size); mu_header_lines (header, &lines); mu_header_get_stream (header, &stream); @@ -1132,12 +1132,12 @@ fetch_header (message_t msg, unsigned long start, unsigned long end) } static int -fetch_body_content (message_t msg, unsigned long start, unsigned long end) +fetch_body_content (mu_message_t msg, unsigned long start, unsigned long end) { - body_t body = NULL; - stream_t stream = NULL; + mu_body_t body = NULL; + mu_stream_t stream = NULL; size_t size = 0, lines = 0; - message_get_body (msg, &body); + mu_message_get_body (msg, &body); mu_body_size (body, &size); mu_body_lines (body, &lines); mu_body_get_stream (body, &stream); @@ -1145,10 +1145,10 @@ fetch_body_content (message_t msg, unsigned long start, unsigned long end) } static int -fetch_io (stream_t stream, unsigned long start, unsigned long end, +fetch_io (mu_stream_t stream, unsigned long start, unsigned long end, unsigned long max) { - stream_t rfc = NULL; + mu_stream_t rfc = NULL; size_t n = 0; off_t offset; @@ -1161,7 +1161,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end, if (max) { util_send (" {%u}\r\n", max); - while (stream_read (rfc, buffer, sizeof (buffer) - 1, offset, + while (mu_stream_read (rfc, buffer, sizeof (buffer) - 1, offset, &n) == 0 && n > 0) { buffer[n] = '\0'; @@ -1183,7 +1183,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end, offset = start; p = buffer = calloc (end + 2, 1); while (end > 0 - && stream_read (rfc, buffer, end + 1, offset, &n) == 0 && n > 0) + && mu_stream_read (rfc, buffer, end + 1, offset, &n) == 0 && n > 0) { offset += n; total += n; @@ -1206,7 +1206,7 @@ fetch_io (stream_t stream, unsigned long start, unsigned long end, } static int -fetch_header_fields (message_t msg, char **arg, unsigned long start, +fetch_header_fields (mu_message_t msg, char **arg, unsigned long start, unsigned long end) { char *buffer = NULL; @@ -1214,10 +1214,10 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, size_t array_len = 0; size_t off = 0; size_t lines = 0; - stream_t stream = NULL; + mu_stream_t stream = NULL; int status; - status = memory_stream_create (&stream, 0, 0); + status = mu_memory_stream_create (&stream, 0, 0); if (status != 0) imap4d_bye (ERR_NO_MEM); @@ -1248,8 +1248,8 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, /* Get the header values. */ { size_t j; - header_t header = NULL; - message_get_header (msg, &header); + mu_header_t header = NULL; + mu_message_get_header (msg, &header); for (j = 0; j < array_len; j++) { char *value = NULL; @@ -1258,7 +1258,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, continue; n = asprintf (&buffer, "%s: %s\n", array[j], value); - status = stream_write (stream, buffer, n, off, &n); + status = mu_stream_write (stream, buffer, n, off, &n); off += n; /* count the lines. */ { @@ -1277,7 +1277,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, } } /* Headers are always sent with the NL separator. */ - stream_write (stream, "\n", 1, off, NULL); + mu_stream_write (stream, "\n", 1, off, NULL); off++; lines++; @@ -1304,7 +1304,7 @@ fetch_header_fields (message_t msg, char **arg, unsigned long start, } static int -fetch_header_fields_not (message_t msg, char **arg, unsigned long start, +fetch_header_fields_not (mu_message_t msg, char **arg, unsigned long start, unsigned long end) { char **array = NULL; @@ -1312,10 +1312,10 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, char *buffer = NULL; size_t off = 0; size_t lines = 0; - stream_t stream = NULL; + mu_stream_t stream = NULL; int status; - status = memory_stream_create (&stream, 0, 0); + status = mu_memory_stream_create (&stream, 0, 0); if (status) imap4d_bye (ERR_NO_MEM); @@ -1346,9 +1346,9 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, /* Build the memory buffer. */ { size_t i; - header_t header = NULL; + mu_header_t header = NULL; size_t count = 0; - message_get_header (msg, &header); + mu_message_get_header (msg, &header); mu_header_get_field_count (header, &count); for (i = 1; i <= count; i++) { @@ -1389,7 +1389,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, /* Save the field. */ n = asprintf (&buffer, "%s: %s\n", name, value); - status = stream_write (stream, buffer, n, off, &n); + status = mu_stream_write (stream, buffer, n, off, &n); off += n; /* count the lines. */ for (nl = buffer;(nl = strchr (nl, '\n')); nl++) @@ -1408,7 +1408,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, } } /* Headers are always sent with a NL separator. */ - stream_write (stream, "\n", 1, off, NULL); + mu_stream_write (stream, "\n", 1, off, NULL); off++; lines++; @@ -1438,7 +1438,7 @@ fetch_header_fields_not (message_t msg, char **arg, unsigned long start, static int fetch_send_address (const char *addr) { - address_t address; + mu_address_t address; size_t i, count = 0; /* Short circuit. */ diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c index 1e543014f..7b31ab771 100644 --- a/imap4d/imap4d.c +++ b/imap4d/imap4d.c @@ -22,7 +22,7 @@ # include <mailutils/gsasl.h> #endif -mailbox_t mbox; +mu_mailbox_t mbox; char *homedir; int state = STATE_NONAUTH; int debug_mode = 0; diff --git a/imap4d/imap4d.h b/imap4d/imap4d.h index 532c929ea..4bd8e01ab 100644 --- a/imap4d/imap4d.h +++ b/imap4d/imap4d.h @@ -154,7 +154,7 @@ struct imap4d_command #define IMAP_CAPA_XTLSREQUIRED "XTLSREQUIRED" extern struct imap4d_command imap4d_command_table[]; -extern mailbox_t mbox; +extern mu_mailbox_t mbox; extern char *homedir; extern char *rootdir; extern int state; @@ -172,7 +172,7 @@ extern char *strtok_r (char *s, const char *delim, char **save_ptr); /* Imap4 commands */ extern int imap4d_append (struct imap4d_command *, char *); -extern int imap4d_append0 (mailbox_t mbox, int flags, char *text); +extern int imap4d_append0 (mu_mailbox_t mbox, int flags, char *text); extern int imap4d_authenticate (struct imap4d_command *, char *); extern void imap4d_auth_capability (void); extern int imap4d_capability (struct imap4d_command *, char *); @@ -212,13 +212,13 @@ extern int imap4d_version (struct imap4d_command *, char *); extern int imap4d_idle (struct imap4d_command *, char *); /* Shared between fetch and store */ -extern void fetch_flags0 (const char *prefix, message_t msg, int isuid); +extern void fetch_flags0 (const char *prefix, mu_message_t msg, int isuid); /* Synchronisation on simultaneous access. */ extern int imap4d_sync (void); extern int imap4d_sync_flags (size_t); extern size_t uid_to_msgno (size_t); -extern void imap4d_set_observer (mailbox_t mbox); +extern void imap4d_set_observer (mu_mailbox_t mbox); /* Signal handling. */ extern RETSIGTYPE imap4d_sigchld (int); @@ -277,18 +277,18 @@ extern char *util_localname (void); extern int util_wcard_match (const char *string, const char *pattern, const char *delim); -void util_print_flags (attribute_t attr); +void util_print_flags (mu_attribute_t attr); int util_attribute_to_type (const char *item, int *type); int util_type_to_attribute (int type, char **attr_str); -int util_attribute_matches_flag (attribute_t attr, const char *item); -int util_uidvalidity (mailbox_t smbox, unsigned long *uidvp); +int util_attribute_matches_flag (mu_attribute_t attr, const char *item); +int util_uidvalidity (mu_mailbox_t smbox, unsigned long *uidvp); void util_setio (FILE*, FILE*); void util_flush_output (void); -void util_get_input (stream_t *pstr); -void util_get_output (stream_t *pstr); -void util_set_input (stream_t str); -void util_set_output (stream_t str); +void util_get_input (mu_stream_t *pstr); +void util_get_output (mu_stream_t *pstr); +void util_set_input (mu_stream_t str); +void util_set_output (mu_stream_t str); int util_wait_input (int); void util_register_event (int old_state, int new_state, diff --git a/imap4d/rename.c b/imap4d/rename.c index f974428d0..dd14c08b9 100644 --- a/imap4d/rename.c +++ b/imap4d/rename.c @@ -68,8 +68,8 @@ imap4d_rename (struct imap4d_command *command, char *arg) leaving INBOX empty. */ if (strcasecmp (oldname, "INBOX") == 0) { - mailbox_t newmbox = NULL; - mailbox_t inbox = NULL; + mu_mailbox_t newmbox = NULL; + mu_mailbox_t inbox = NULL; char *name; if (S_ISDIR(newst.st_mode)) @@ -97,12 +97,12 @@ imap4d_rename (struct imap4d_command *command, char *arg) mu_mailbox_messages_count (inbox, &total); for (no = 1; no <= total; no++) { - message_t message; + mu_message_t message; if (mu_mailbox_get_message (inbox, no, &message) == 0) { - attribute_t attr = NULL; + mu_attribute_t attr = NULL; mu_mailbox_append_message (newmbox, message); - message_get_attribute (message, &attr); + mu_message_get_attribute (message, &attr); mu_attribute_set_deleted (attr); } } diff --git a/imap4d/search.c b/imap4d/search.c index fdba4be25..ec050ab38 100644 --- a/imap4d/search.c +++ b/imap4d/search.c @@ -175,7 +175,7 @@ struct parsebuf /* Execution time only: */ size_t msgno; /* Number of current message */ - message_t msg; /* Current message */ + mu_message_t msg; /* Current message */ }; static void put_code (struct parsebuf *pb, inst_t inst); @@ -285,7 +285,7 @@ do_search (struct parsebuf *pb) if (pb->isuid) { size_t uid; - message_get_uid (pb->msg, &uid); + mu_message_get_uid (pb->msg, &uid); util_send (" %d", uid); } else @@ -662,9 +662,9 @@ static int _scan_header (struct parsebuf *pb, char *name, char *value) { char buffer[512]; - header_t header = NULL; + mu_header_t header = NULL; - message_get_header (pb->msg, &header); + mu_message_get_header (pb->msg, &header); if (!mu_header_get_value (header, name, buffer, sizeof(buffer), NULL)) { return util_strcasestr (buffer, value) != NULL; @@ -677,9 +677,9 @@ static int _header_date (struct parsebuf *pb, time_t *timep) { char buffer[512]; - header_t header = NULL; + mu_header_t header = NULL; - message_get_header (pb->msg, &header); + mu_message_get_header (pb->msg, &header); if (!mu_header_get_value (header, "Date", buffer, sizeof(buffer), NULL) && util_parse_822_date (buffer, timep)) return 0; @@ -691,11 +691,11 @@ static int _scan_header_all (struct parsebuf *pb, char *text) { char buffer[512]; - header_t header = NULL; + mu_header_t header = NULL; size_t fcount = 0; int i, rc; - message_get_header (pb->msg, &header); + mu_message_get_header (pb->msg, &header); mu_header_get_field_count (header, &fcount); for (i = rc = 0; i < fcount; i++) { @@ -709,21 +709,21 @@ _scan_header_all (struct parsebuf *pb, char *text) static int _scan_body (struct parsebuf *pb, char *text) { - body_t body = NULL; - stream_t stream = NULL; + mu_body_t body = NULL; + mu_stream_t stream = NULL; size_t size = 0, lines = 0; char buffer[128]; size_t n = 0; off_t offset = 0; int rc; - message_get_body (pb->msg, &body); + mu_message_get_body (pb->msg, &body); 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 + && mu_stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0 && n > 0) { buffer[n] = 0; @@ -791,9 +791,9 @@ cond_before (struct parsebuf *pb) time_t t = (time_t)_search_arg (pb); time_t mesg_time; char buffer[512]; - envelope_t env; + mu_envelope_t env; - message_get_envelope (pb->msg, &env); + mu_message_get_envelope (pb->msg, &env); mu_envelope_date (env, buffer, sizeof (buffer), NULL); util_parse_ctime_date (buffer, &mesg_time); _search_push (pb, mesg_time < t); @@ -815,11 +815,11 @@ void cond_from (struct parsebuf *pb) { char *s = _search_arg (pb); - envelope_t env; + mu_envelope_t env; char buffer[512]; int rc = 0; - message_get_envelope (pb->msg, &env); + mu_message_get_envelope (pb->msg, &env); if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL) == 0) rc = util_strcasestr (buffer, s) != NULL; _search_push (pb, _scan_header (pb, "from", s)); @@ -838,9 +838,9 @@ void cond_keyword (struct parsebuf *pb) { char *s = _search_arg (pb); - attribute_t attr = NULL; + mu_attribute_t attr = NULL; - message_get_attribute (pb->msg, &attr); + mu_message_get_attribute (pb->msg, &attr); _search_push (pb, util_attribute_matches_flag (attr, s)); } @@ -850,7 +850,7 @@ cond_larger (struct parsebuf *pb) int n = (int) _search_arg (pb); size_t size = 0; - message_size (pb->msg, &size); + mu_message_size (pb->msg, &size); _search_push (pb, size > n); } @@ -860,9 +860,9 @@ cond_on (struct parsebuf *pb) time_t t = (time_t)_search_arg (pb); time_t mesg_time; char buffer[512]; - envelope_t env; + mu_envelope_t env; - message_get_envelope (pb->msg, &env); + mu_message_get_envelope (pb->msg, &env); 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); @@ -904,9 +904,9 @@ cond_since (struct parsebuf *pb) time_t t = (time_t)_search_arg (pb); time_t mesg_time; char buffer[512]; - envelope_t env; + mu_envelope_t env; |