buf[0] = 0;
rfc822_write_address(buf, sizeof(buf), adr, 1);
-#define extra_space (15 + 7 + 2)
+#define EXTRA_SPACE (15 + 7 + 2)
snprintf(scratch, sizeof(scratch),
(h ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
- if (mutt_strwidth(prompt) > MuttMessageWindow->cols - extra_space)
+ if (mutt_strwidth(prompt) > MuttMessageWindow->cols - EXTRA_SPACE)
{
- mutt_simple_format(prompt, sizeof(prompt), 0, MuttMessageWindow->cols - extra_space,
+ mutt_simple_format(prompt, sizeof(prompt), 0, MuttMessageWindow->cols - EXTRA_SPACE,
FMT_LEFT, 0, scratch, sizeof(scratch), 0);
safe_strcat(prompt, sizeof(prompt), "...?");
}
* A (not so) minimal implementation of RFC1563.
*/
-#define IndentSize (4)
+#define INDENT_SIZE 4
/**
* enum RichAttribs - Rich text attributes
}
extra = stte->wrap_margin - stte->line_len - stte->indent_len -
- (stte->tag_level[RICH_INDENT_RIGHT] * IndentSize);
+ (stte->tag_level[RICH_INDENT_RIGHT] * INDENT_SIZE);
if (extra > 0)
{
if (stte->tag_level[RICH_CENTER])
stte->indent_len = 0;
if (stte->tag_level[RICH_INDENT])
{
- x = stte->tag_level[RICH_INDENT] * IndentSize;
+ x = stte->tag_level[RICH_INDENT] * INDENT_SIZE;
stte->indent_len += x;
while (x)
{
{
if (!stte->tag_level[RICH_NOFILL] &&
(stte->line_len + stte->word_len >
- (stte->wrap_margin - (stte->tag_level[RICH_INDENT_RIGHT] * IndentSize) - stte->indent_len)))
+ (stte->wrap_margin - (stte->tag_level[RICH_INDENT_RIGHT] * INDENT_SIZE) - stte->indent_len)))
enriched_wrap(stte);
if (stte->buff_used)
} *Resize = NULL;
#endif
-#define NumSigLines 4
+#define NUM_SIG_LINES 4
static int check_sig(const char *s, struct Line *info, int n)
{
int count = 0;
- while (n > 0 && count <= NumSigLines)
+ while (n > 0 && count <= NUM_SIG_LINES)
{
if (info[n].type != MT_COLOR_SIGNATURE)
break;
if (count == 0)
return -1;
- if (count > NumSigLines)
+ if (count > NUM_SIG_LINES)
{
/* check for a blank line */
while (*s)
buf[0] = 0;
rfc822_write_address(buf, sizeof(buf), adr, 1);
-#define extra_space (15 + 7 + 2)
+#define EXTRA_SPACE (15 + 7 + 2)
/*
* See commands.c.
*/
snprintf(prompt, sizeof(prompt) - 4,
(p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
- if (mutt_strwidth(prompt) > MuttMessageWindow->cols - extra_space)
+ if (mutt_strwidth(prompt) > MuttMessageWindow->cols - EXTRA_SPACE)
{
- mutt_simple_format(prompt, sizeof(prompt) - 4, 0, MuttMessageWindow->cols - extra_space,
+ mutt_simple_format(prompt, sizeof(prompt) - 4, 0, MuttMessageWindow->cols - EXTRA_SPACE,
FMT_LEFT, 0, prompt, sizeof(prompt), 0);
safe_strcat(prompt, sizeof(prompt), "...?");
}
#endif
#define smtp_success(x) ((x) / 100 == 2)
-#define smtp_ready 334
-#define smtp_continue 354
+#define SMTP_READY 334
+#define SMTP_CONTINUE 354
-#define smtp_err_read -2
-#define smtp_err_write -3
-#define smtp_err_code -4
+#define SMTP_ERR_READ -2
+#define SMTP_ERR_WRITE -3
+#define SMTP_ERR_CODE -4
#define SMTP_PORT 25
#define SMTPS_PORT 465
if (n < 4)
{
/* read error, or no response code */
- return smtp_err_read;
+ return SMTP_ERR_READ;
}
if (ascii_strncasecmp("8BITMIME", buf + 4, 8) == 0)
mutt_bit_set(Capabilities, SMTPUTF8);
if (!valid_smtp_code(buf, n, &n))
- return smtp_err_code;
+ return SMTP_ERR_CODE;
} while (buf[3] == '-');
- if (smtp_success(n) || n == smtp_continue)
+ if (smtp_success(n) || n == SMTP_CONTINUE)
return 0;
mutt_error(_("SMTP session failed: %s"), buf);
else
snprintf(buf, sizeof(buf), "RCPT TO:<%s>\r\n", a->mailbox);
if (mutt_socket_write(conn, buf) == -1)
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
if ((r = smtp_get_resp(conn)))
return r;
a = a->next;
if (mutt_socket_write(conn, buf) == -1)
{
safe_fclose(&fp);
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
}
if ((r = smtp_get_resp(conn)))
{
if (mutt_socket_write_d(conn, ".", -1, MUTT_SOCK_LOG_FULL) == -1)
{
safe_fclose(&fp);
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
}
}
if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) == -1)
{
safe_fclose(&fp);
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
}
mutt_progress_update(&progress, ftell(fp), -1);
}
if (!term && buflen && mutt_socket_write_d(conn, "\r\n", -1, MUTT_SOCK_LOG_FULL) == -1)
{
safe_fclose(&fp);
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
}
safe_fclose(&fp);
/* terminate the message body */
if (mutt_socket_write(conn, ".\r\n") == -1)
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
if ((r = smtp_get_resp(conn)))
return r;
* currently doesn't check for a short write.
*/
if (mutt_socket_write(conn, buf) == -1)
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
return smtp_get_resp(conn);
}
if (!valid_smtp_code(buf, rc, &rc))
goto fail;
- if (rc != smtp_ready)
+ if (rc != SMTP_READY)
break;
if (sasl_decode64(buf + 4, strlen(buf + 4), buf, bufsize - 1, &len) != SASL_OK)
}
}
strfcpy(buf + len, "\r\n", bufsize - len);
- } while (rc == smtp_ready && saslrc != SASL_FAIL);
+ } while (rc == SMTP_READY && saslrc != SASL_FAIL);
if (smtp_success(rc))
{
if (rc == MUTT_YES)
{
if (mutt_socket_write(conn, "STARTTLS\r\n") < 0)
- return smtp_err_write;
+ return SMTP_ERR_WRITE;
if ((rc = smtp_get_resp(conn)))
return rc;
safe_strncat(buf, sizeof(buf), "\r\n", 3);
if (mutt_socket_write(conn, buf) == -1)
{
- ret = smtp_err_write;
+ ret = SMTP_ERR_WRITE;
break;
}
if ((ret = smtp_get_resp(conn)))
if (conn)
mutt_socket_close(conn);
- if (ret == smtp_err_read)
+ if (ret == SMTP_ERR_READ)
mutt_error(_("SMTP session failed: read error"));
- else if (ret == smtp_err_write)
+ else if (ret == SMTP_ERR_WRITE)
mutt_error(_("SMTP session failed: write error"));
- else if (ret == smtp_err_code)
+ else if (ret == SMTP_ERR_CODE)
mutt_error(_("Invalid server response"));
return ret;
#include <stdbool.h>
#include <stdio.h>
-#define per_line 12
+#define PER_LINE 12
static void txt2c(char *sym, FILE *fp)
{
- unsigned char buf[per_line];
+ unsigned char buf[PER_LINE];
int i;
int sz = 0;
printf("unsigned char %s[] = {\n", sym);
while (true)
{
- sz = fread(buf, sizeof(unsigned char), per_line, fp);
+ sz = fread(buf, sizeof(unsigned char), PER_LINE, fp);
if (sz == 0)
break;
printf("\t");