diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-07 22:54:40 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-07 22:54:40 +0300 |
commit | 420212a69bba00b4474b26d8da66ee338b8f771f (patch) | |
tree | 3684c8613b2f4fe8c33cb1f70df4e049d47d0ea2 | |
parent | f08e6e0842bae2dd575b085a8182cdd0f0d55cc5 (diff) | |
download | mailutils-stream-cleanup.tar.gz mailutils-stream-cleanup.tar.bz2 |
Rename XSCRIPT_ macros to MU_XSCRIPT.stream-cleanup
-rw-r--r-- | examples/pop3client.c | 16 | ||||
-rw-r--r-- | imap4d/fetch.c | 2 | ||||
-rw-r--r-- | imap4d/imap4d.c | 3 | ||||
-rw-r--r-- | imap4d/io.c | 4 | ||||
-rw-r--r-- | imap4d/uid.c | 2 | ||||
-rw-r--r-- | imap4d/util.c | 6 | ||||
-rw-r--r-- | include/mailutils/stream.h | 6 | ||||
-rw-r--r-- | libproto/pop/mbox.c | 4 | ||||
-rw-r--r-- | libproto/pop/pop3_pass.c | 6 | ||||
-rw-r--r-- | libproto/pop/pop3_retr.c | 4 | ||||
-rw-r--r-- | libproto/pop/pop3_stream.c | 2 | ||||
-rw-r--r-- | libproto/pop/pop3_top.c | 4 | ||||
-rw-r--r-- | libproto/pop/pop3_trace.c | 2 | ||||
-rw-r--r-- | mailbox/xscript-stream.c | 4 | ||||
-rw-r--r-- | pop3d/extra.c | 6 | ||||
-rw-r--r-- | pop3d/retr.c | 2 | ||||
-rw-r--r-- | pop3d/top.c | 2 | ||||
-rw-r--r-- | pop3d/user.c | 2 |
18 files changed, 39 insertions, 38 deletions
diff --git a/examples/pop3client.c b/examples/pop3client.c index 4450f2243..c9246381e 100644 --- a/examples/pop3client.c +++ b/examples/pop3client.c @@ -516,15 +516,15 @@ find_command (char *name) } static int string_to_xlev (const char *name, int *pv) { if (strcmp (name, "secure") == 0) - *pv = XSCRIPT_SECURE; + *pv = MU_XSCRIPT_SECURE; else if (strcmp (name, "payload") == 0) - *pv = XSCRIPT_PAYLOAD; + *pv = MU_XSCRIPT_PAYLOAD; else return 1; return 0; } static int @@ -565,18 +565,18 @@ set_verbose (mu_pop3_t p) void set_verbose_mask (mu_pop3_t p) { if (p) { - mu_pop3_trace_mask (p, QRY_VERBOSE_MASK (XSCRIPT_SECURE) + mu_pop3_trace_mask (p, QRY_VERBOSE_MASK (MU_XSCRIPT_SECURE) ? MU_POP3_TRACE_SET : MU_POP3_TRACE_CLR, - XSCRIPT_SECURE); - mu_pop3_trace_mask (p, QRY_VERBOSE_MASK (XSCRIPT_PAYLOAD) + MU_XSCRIPT_SECURE); + mu_pop3_trace_mask (p, QRY_VERBOSE_MASK (MU_XSCRIPT_PAYLOAD) ? MU_POP3_TRACE_SET : MU_POP3_TRACE_CLR, - XSCRIPT_PAYLOAD); + MU_XSCRIPT_PAYLOAD); } } int com_verbose (int argc, char **argv) { @@ -586,18 +586,18 @@ com_verbose (int argc, char **argv) { printf ("verbose is on"); if (HAS_VERBOSE_MASK ()) { char *delim = " ("; - if (QRY_VERBOSE_MASK (XSCRIPT_SECURE)) + if (QRY_VERBOSE_MASK (MU_XSCRIPT_SECURE)) { printf("%ssecure", delim); delim = ", "; } - if (QRY_VERBOSE_MASK (XSCRIPT_PAYLOAD)) + if (QRY_VERBOSE_MASK (MU_XSCRIPT_PAYLOAD)) printf("%spayload", delim); printf (")"); } printf ("\n"); } else diff --git a/imap4d/fetch.c b/imap4d/fetch.c index 8f9339d51..04cf8c6dd 100644 --- a/imap4d/fetch.c +++ b/imap4d/fetch.c @@ -1685,11 +1685,11 @@ imap4d_fetch0 (imap4d_tokbuf_t tok, int isuid, char **err_text) or a parenthesized list. */ int imap4d_fetch (struct imap4d_command *command, imap4d_tokbuf_t tok) { int rc; char *err_text = "Completed"; - int xlev = set_xscript_level (XSCRIPT_PAYLOAD); + int xlev = set_xscript_level (MU_XSCRIPT_PAYLOAD); rc = imap4d_fetch0 (tok, 0, &err_text); set_xscript_level (xlev); return io_completion_response (command, rc, "%s", err_text); } diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c index 340c2bb15..a5b29e0ed 100644 --- a/imap4d/imap4d.c +++ b/imap4d/imap4d.c @@ -419,13 +419,14 @@ imap4d_mainloop (int fd, FILE *infile, FILE *outfile) /* Greetings. */ io_untagged_response ((state == STATE_AUTH) ? RESP_PREAUTH : RESP_OK, "%s", text); io_flush (); - set_xscript_level ((state == STATE_AUTH) ? XSCRIPT_NORMAL : XSCRIPT_SECURE); + set_xscript_level ((state == STATE_AUTH) ? + MU_XSCRIPT_NORMAL : MU_XSCRIPT_SECURE); tokp = imap4d_tokbuf_init (); while (1) { imap4d_readline (tokp); /* check for updates */ diff --git a/imap4d/io.c b/imap4d/io.c index fcae10707..726cfaa0d 100644 --- a/imap4d/io.c +++ b/imap4d/io.c @@ -240,13 +240,13 @@ io_format_completion_response (mu_stream_t str, else new_state = STATE_NONE; if (new_state != STATE_NONE) { if (new_state == STATE_AUTH) - set_xscript_level (XSCRIPT_NORMAL); + set_xscript_level (MU_XSCRIPT_NORMAL); state = new_state; } return status; } @@ -571,13 +571,13 @@ imap4d_readline (struct imap4d_tokbuf *tok) { int rc; unsigned long number; char *sp = NULL; char *buf; size_t len; - int xlev = set_xscript_level (XSCRIPT_PAYLOAD); + int xlev = set_xscript_level (MU_XSCRIPT_PAYLOAD); number = strtoul (last_arg + 1, &sp, 10); /* Client can ask for non-synchronised literal, if a '+' is appended to the octet count. */ if (*sp == '}') io_sendf ("+ GO AHEAD\n"); diff --git a/imap4d/uid.c b/imap4d/uid.c index 9d34b4609..e4e58590b 100644 --- a/imap4d/uid.c +++ b/imap4d/uid.c @@ -35,13 +35,13 @@ imap4d_uid (struct imap4d_command *command, imap4d_tokbuf_t tok) return io_completion_response (command, RESP_BAD, "Invalid arguments"); cmd = imap4d_tokbuf_getarg (tok, IMAP4_ARG_1); if (mu_c_strcasecmp (cmd, "FETCH") == 0) { - int xlev = set_xscript_level (XSCRIPT_PAYLOAD); + int xlev = set_xscript_level (MU_XSCRIPT_PAYLOAD); rc = imap4d_fetch0 (tok, 1, &err_text); set_xscript_level (xlev); } else if (mu_c_strcasecmp (cmd, "COPY") == 0) rc = imap4d_copy0 (tok, 1, &err_text); else if (mu_c_strcasecmp (cmd, "STORE") == 0) diff --git a/imap4d/util.c b/imap4d/util.c index af081fecc..73d4031df 100644 --- a/imap4d/util.c +++ b/imap4d/util.c @@ -674,19 +674,19 @@ is_atom (const char *s) int set_xscript_level (int xlev) { if (imap4d_transcript) { - if (xlev != XSCRIPT_NORMAL) + if (xlev != MU_XSCRIPT_NORMAL) { - mu_log_level_t n = xlev == XSCRIPT_SECURE ? + mu_log_level_t n = xlev == MU_XSCRIPT_SECURE ? MU_DEBUG_TRACE6 : MU_DEBUG_TRACE7; if (mu_global_debug_level ("imap4") & MU_DEBUG_LEVEL_MASK (n)) - return XSCRIPT_NORMAL; + return MU_XSCRIPT_NORMAL; } if (mu_stream_ioctl (iostream, MU_IOCTL_LEVEL, &xlev) == 0) return xlev; } return 0; diff --git a/include/mailutils/stream.h b/include/mailutils/stream.h index ab1d9c4d7..0d506025c 100644 --- a/include/mailutils/stream.h +++ b/include/mailutils/stream.h @@ -154,15 +154,15 @@ int mu_tcp_stream_create_with_source_host (mu_stream_t *stream, const char *source_host, int flags); int mu_tcp_stream_create (mu_stream_t *stream, const char *host, int port, int flags); /* Transcript output levels */ -#define XSCRIPT_NORMAL 0 /* Normal transcript */ -#define XSCRIPT_SECURE 1 /* Security-related data are being sent/received */ -#define XSCRIPT_PAYLOAD 2 /* Actual payload (may be copious) */ +#define MU_XSCRIPT_NORMAL 0 /* Normal transcript */ +#define MU_XSCRIPT_SECURE 1 /* Security-related data are being transmitted */ +#define MU_XSCRIPT_PAYLOAD 2 /* Actual payload (may be copious) */ int mu_xscript_stream_create(mu_stream_t *pref, mu_stream_t transport, mu_stream_t logstr, const char *prefix[]); int mu_iostream_create (mu_stream_t *pref, mu_stream_t in, mu_stream_t out); diff --git a/libproto/pop/mbox.c b/libproto/pop/mbox.c index 68e2d93db..f5132957c 100644 --- a/libproto/pop/mbox.c +++ b/libproto/pop/mbox.c @@ -159,15 +159,15 @@ pop_open (mu_mailbox_t mbox, int flags) } mu_pop3_set_carrier (mpd->pop3, stream); if (mu_debug_check_level (mbox->debug, MU_DEBUG_PROT)) mu_pop3_trace (mpd->pop3, MU_POP3_TRACE_SET); if (mu_debug_check_level (mbox->debug, MU_DEBUG_TRACE6)) - mu_pop3_trace_mask (mpd->pop3, MU_POP3_TRACE_SET, XSCRIPT_SECURE); + mu_pop3_trace_mask (mpd->pop3, MU_POP3_TRACE_SET, MU_XSCRIPT_SECURE); if (mu_debug_check_level (mbox->debug, MU_DEBUG_TRACE7)) - mu_pop3_trace_mask (mpd->pop3, MU_POP3_TRACE_SET, XSCRIPT_PAYLOAD); + mu_pop3_trace_mask (mpd->pop3, MU_POP3_TRACE_SET, MU_XSCRIPT_PAYLOAD); do { status = mu_pop3_connect (mpd->pop3); if (status) break; diff --git a/libproto/pop/pop3_pass.c b/libproto/pop/pop3_pass.c index 30f823f96..d72c511f2 100644 --- a/libproto/pop/pop3_pass.c +++ b/libproto/pop/pop3_pass.c @@ -32,16 +32,16 @@ mu_pop3_pass (mu_pop3_t pop3, const char *passwd) if (pop3 == NULL || passwd == NULL) return EINVAL; switch (pop3->state) { case MU_POP3_NO_STATE: - if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, XSCRIPT_SECURE)) - _mu_pop3_xscript_level (pop3, XSCRIPT_SECURE); + if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, MU_XSCRIPT_SECURE)) + _mu_pop3_xscript_level (pop3, MU_XSCRIPT_SECURE); status = mu_pop3_writeline (pop3, "PASS %s\r\n", passwd); - _mu_pop3_xscript_level (pop3, XSCRIPT_NORMAL); + _mu_pop3_xscript_level (pop3, MU_XSCRIPT_NORMAL); MU_POP3_CHECK_ERROR (pop3, status); /* FIXME: how to obscure the passwd in the stream buffer? */ MU_POP3_FCLR (pop3, MU_POP3_ACK); pop3->state = MU_POP3_PASS; case MU_POP3_PASS: diff --git a/libproto/pop/pop3_retr.c b/libproto/pop/pop3_retr.c index fc454da93..aca24da65 100644 --- a/libproto/pop/pop3_retr.c +++ b/libproto/pop/pop3_retr.c @@ -47,14 +47,14 @@ mu_pop3_retr (mu_pop3_t pop3, unsigned int msgno, mu_stream_t *pstream) case MU_POP3_RETR: status = mu_pop3_response (pop3, NULL); MU_POP3_CHECK_EAGAIN (pop3, status); MU_POP3_CHECK_OK (pop3); status = mu_pop3_stream_create (pop3, pstream); MU_POP3_CHECK_ERROR (pop3, status); - if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, XSCRIPT_PAYLOAD)) - _mu_pop3_xscript_level (pop3, XSCRIPT_PAYLOAD); + if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, MU_XSCRIPT_PAYLOAD)) + _mu_pop3_xscript_level (pop3, MU_XSCRIPT_PAYLOAD); pop3->state = MU_POP3_RETR_RX; case MU_POP3_RETR_RX: break; /* They must deal with the error first by reopening. */ diff --git a/libproto/pop/pop3_stream.c b/libproto/pop/pop3_stream.c index bd2bd078f..25fdba691 100644 --- a/libproto/pop/pop3_stream.c +++ b/libproto/pop/pop3_stream.c @@ -182,13 +182,13 @@ _pop3_event_cb (mu_stream_t str, int ev, int flags) { mu_transport_t trans[2]; if (mu_stream_ioctl (str, MU_IOCTL_GET_TRANSPORT, trans) == 0) { struct mu_pop3_stream *sp = (struct mu_pop3_stream *) trans[0]; - _mu_pop3_xscript_level (sp->pop3, XSCRIPT_NORMAL); + _mu_pop3_xscript_level (sp->pop3, MU_XSCRIPT_NORMAL); sp->pop3->state = MU_POP3_NO_STATE; } } } static int diff --git a/libproto/pop/pop3_top.c b/libproto/pop/pop3_top.c index ebea77fb4..c06073606 100644 --- a/libproto/pop/pop3_top.c +++ b/libproto/pop/pop3_top.c @@ -47,14 +47,14 @@ mu_pop3_top (mu_pop3_t pop3, unsigned msgno, unsigned int lines, case MU_POP3_TOP: status = mu_pop3_response (pop3, NULL); MU_POP3_CHECK_EAGAIN (pop3, status); MU_POP3_CHECK_OK (pop3); status = mu_pop3_stream_create (pop3, pstream); MU_POP3_CHECK_ERROR (pop3, status); - if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, XSCRIPT_PAYLOAD)) - _mu_pop3_xscript_level (pop3, XSCRIPT_PAYLOAD); + if (mu_pop3_trace_mask (pop3, MU_POP3_TRACE_QRY, MU_XSCRIPT_PAYLOAD)) + _mu_pop3_xscript_level (pop3, MU_XSCRIPT_PAYLOAD); pop3->state = MU_POP3_TOP_RX; case MU_POP3_TOP_RX: break; /* They must deal with the error first by reopening. */ diff --git a/libproto/pop/pop3_trace.c b/libproto/pop/pop3_trace.c index 514ac3cad..5fa3d95d6 100644 --- a/libproto/pop/pop3_trace.c +++ b/libproto/pop/pop3_trace.c @@ -141,10 +141,10 @@ mu_pop3_trace_mask (mu_pop3_t pop3, int op, int lev) int _mu_pop3_xscript_level (mu_pop3_t pop3, int xlev) { if (mu_stream_ioctl (pop3->carrier, MU_IOCTL_LEVEL, &xlev) == 0) return xlev; - return XSCRIPT_NORMAL; + return MU_XSCRIPT_NORMAL; } diff --git a/mailbox/xscript-stream.c b/mailbox/xscript-stream.c index 054ced12c..41f28ec2e 100644 --- a/mailbox/xscript-stream.c +++ b/mailbox/xscript-stream.c @@ -104,13 +104,13 @@ print_transcript (struct _mu_xscript_stream *str, int flag, str->flags &= ~(flag | TRANS_DISABLED); } if (str->flags & TRANS_DISABLED) return; - if (str->level == XSCRIPT_PAYLOAD) + if (str->level == MU_XSCRIPT_PAYLOAD) { mu_stream_printf (str->logstr, "(data...)\n"); str->flags |= TRANS_DISABLED; return; } @@ -118,13 +118,13 @@ print_transcript (struct _mu_xscript_stream *str, int flag, if (p) { len = p - buf; if (p > buf && p[-1] == '\r') len--; - if (str->level == XSCRIPT_SECURE) + if (str->level == MU_XSCRIPT_SECURE) { size_t i; if (word_match (buf, len, 0, "PASS", &i)) mu_stream_printf (str->logstr, "PASS ***"); else if (word_match (buf, len, 1, "LOGIN", &i)) diff --git a/pop3d/extra.c b/pop3d/extra.c index 461cd529e..380435d3b 100644 --- a/pop3d/extra.c +++ b/pop3d/extra.c @@ -341,19 +341,19 @@ pop3d_undelete_all () int set_xscript_level (int xlev) { if (pop3d_transcript) { - if (xlev != XSCRIPT_NORMAL) + if (xlev != MU_XSCRIPT_NORMAL) { - mu_log_level_t n = xlev == XSCRIPT_SECURE ? + mu_log_level_t n = xlev == MU_XSCRIPT_SECURE ? MU_DEBUG_TRACE6 : MU_DEBUG_TRACE7; if (mu_global_debug_level ("pop3") & MU_DEBUG_LEVEL_MASK (n)) - return XSCRIPT_NORMAL; + return MU_XSCRIPT_NORMAL; } if (mu_stream_ioctl (iostream, MU_IOCTL_LEVEL, &xlev) == 0) return xlev; } return 0; diff --git a/pop3d/retr.c b/pop3d/retr.c index 103b5ef07..0ffcd249d 100644 --- a/pop3d/retr.c +++ b/pop3d/retr.c @@ -44,13 +44,13 @@ pop3d_retr (char *arg) return ERR_MESG_DELE; if (mu_message_get_streamref (msg, &stream)) return ERR_UNKNOWN; pop3d_outf ("+OK\n"); - xscript_level = set_xscript_level (XSCRIPT_PAYLOAD); + xscript_level = set_xscript_level (MU_XSCRIPT_PAYLOAD); mu_stream_copy (iostream, stream, 0, NULL); mu_stream_destroy (&stream); if (!mu_attribute_is_read (attr)) mu_attribute_set_read (attr); diff --git a/pop3d/top.c b/pop3d/top.c index cd069c86b..6e295bb4f 100644 --- a/pop3d/top.c +++ b/pop3d/top.c @@ -60,13 +60,13 @@ pop3d_top (char *arg) /* Header. */ mu_message_get_header (msg, &hdr); if (mu_header_get_streamref (hdr, &stream)) return ERR_UNKNOWN; pop3d_outf ("+OK\n"); - xscript_level = set_xscript_level (XSCRIPT_PAYLOAD); + xscript_level = set_xscript_level (MU_XSCRIPT_PAYLOAD); mu_stream_copy (iostream, stream, 0, NULL); pop3d_outf ("\n"); mu_stream_destroy (&stream); mu_message_get_body (msg, &body); diff --git a/pop3d/user.c b/pop3d/user.c index 414763853..e6801b069 100644 --- a/pop3d/user.c +++ b/pop3d/user.c @@ -99,13 +99,13 @@ pop3d_user (char *arg) if ((strlen (arg) == 0) || (strchr (arg, ' ') != NULL)) return ERR_BAD_ARGS; pop3d_outf ("+OK\n"); pop3d_flush_output (); - xscript_level = set_xscript_level (XSCRIPT_SECURE); + xscript_level = set_xscript_level (MU_XSCRIPT_SECURE); buf = pop3d_readline (buffer, sizeof (buffer)); pop3d_parse_command (buf, &cmd, &pass); set_xscript_level (xscript_level); if (mu_c_strcasecmp (cmd, "PASS") == 0) { |