Commit ab4d428e ab4d428ed68026a722481de0b8e44cab50224fa2 by Sergey Poznyakoff

Rename XSCRIPT_ macros to MU_XSCRIPT.

1 parent 08dbbe2a
......@@ -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 (")");
}
......
......@@ -1679,7 +1679,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);
......
......@@ -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)
......
......@@ -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,
......
......@@ -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);
}
......
......@@ -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)
......
......@@ -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,
......
......@@ -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
{
......
......@@ -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);
......
......@@ -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:
......
......@@ -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;
}
}
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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");
......
......@@ -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);
......