From 420212a69bba00b4474b26d8da66ee338b8f771f Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 7 Sep 2010 22:54:40 +0300 Subject: Rename XSCRIPT_ macros to MU_XSCRIPT. --- examples/pop3client.c | 16 ++++++++-------- imap4d/fetch.c | 2 +- imap4d/imap4d.c | 3 ++- imap4d/io.c | 4 ++-- imap4d/uid.c | 2 +- imap4d/util.c | 6 +++--- include/mailutils/stream.h | 6 +++--- libproto/pop/mbox.c | 4 ++-- libproto/pop/pop3_pass.c | 6 +++--- libproto/pop/pop3_retr.c | 4 ++-- libproto/pop/pop3_stream.c | 2 +- libproto/pop/pop3_top.c | 4 ++-- libproto/pop/pop3_trace.c | 2 +- mailbox/xscript-stream.c | 4 ++-- pop3d/extra.c | 6 +++--- pop3d/retr.c | 2 +- pop3d/top.c | 2 +- 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 @@ -519,9 +519,9 @@ 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; @@ -568,12 +568,12 @@ 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); } } @@ -589,12 +589,12 @@ com_verbose (int argc, char **argv) { 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 (")"); } diff --git a/imap4d/fetch.c b/imap4d/fetch.c index 8f9339d51..04cf8c6dd 100644 --- a/imap4d/fetch.c +++ b/imap4d/fetch.c @@ -1688,7 +1688,7 @@ 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 @@ -422,7 +422,8 @@ imap4d_mainloop (int fd, FILE *infile, FILE *outfile) 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) diff --git a/imap4d/io.c b/imap4d/io.c index fcae10707..726cfaa0d 100644 --- a/imap4d/io.c +++ b/imap4d/io.c @@ -243,7 +243,7 @@ io_format_completion_response (mu_stream_t str, if (new_state != STATE_NONE) { if (new_state == STATE_AUTH) - set_xscript_level (XSCRIPT_NORMAL); + set_xscript_level (MU_XSCRIPT_NORMAL); state = new_state; } @@ -574,7 +574,7 @@ imap4d_readline (struct imap4d_tokbuf *tok) 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, diff --git a/imap4d/uid.c b/imap4d/uid.c index 9d34b4609..e4e58590b 100644 --- a/imap4d/uid.c +++ b/imap4d/uid.c @@ -38,7 +38,7 @@ imap4d_uid (struct imap4d_command *command, imap4d_tokbuf_t tok) 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); } diff --git a/imap4d/util.c b/imap4d/util.c index af081fecc..73d4031df 100644 --- a/imap4d/util.c +++ b/imap4d/util.c @@ -677,13 +677,13 @@ 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) 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 @@ -157,9 +157,9 @@ 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, 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 @@ -162,9 +162,9 @@ pop_open (mu_mailbox_t mbox, int flags) 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 { 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 @@ -35,10 +35,10 @@ mu_pop3_pass (mu_pop3_t pop3, const char *passwd) 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); 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 @@ -50,8 +50,8 @@ mu_pop3_retr (mu_pop3_t pop3, unsigned int msgno, mu_stream_t *pstream) 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: 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 @@ -185,7 +185,7 @@ _pop3_event_cb (mu_stream_t str, int ev, int flags) 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; } } 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 @@ -50,8 +50,8 @@ mu_pop3_top (mu_pop3_t pop3, unsigned msgno, unsigned int lines, 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: 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 @@ -144,7 +144,7 @@ _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 @@ -107,7 +107,7 @@ print_transcript (struct _mu_xscript_stream *str, int flag, 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; @@ -121,7 +121,7 @@ print_transcript (struct _mu_xscript_stream *str, int flag, if (p > buf && p[-1] == '\r') len--; - if (str->level == XSCRIPT_SECURE) + if (str->level == MU_XSCRIPT_SECURE) { size_t i; diff --git a/pop3d/extra.c b/pop3d/extra.c index 461cd529e..380435d3b 100644 --- a/pop3d/extra.c +++ b/pop3d/extra.c @@ -344,13 +344,13 @@ 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) diff --git a/pop3d/retr.c b/pop3d/retr.c index 103b5ef07..0ffcd249d 100644 --- a/pop3d/retr.c +++ b/pop3d/retr.c @@ -47,7 +47,7 @@ pop3d_retr (char *arg) 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); diff --git a/pop3d/top.c b/pop3d/top.c index cd069c86b..6e295bb4f 100644 --- a/pop3d/top.c +++ b/pop3d/top.c @@ -63,7 +63,7 @@ pop3d_top (char *arg) 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"); diff --git a/pop3d/user.c b/pop3d/user.c index 414763853..e6801b069 100644 --- a/pop3d/user.c +++ b/pop3d/user.c @@ -102,7 +102,7 @@ pop3d_user (char *arg) 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); -- cgit v1.2.1