/* mutt_account_match: compare account info (host/port/user/login) */
int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
{
- const char* user = NONULL(MCore.username);
- const char* login = NONULL(MCore.username);
+ const char* user = NONULL(mod_core.username);
+ const char* login = NONULL(mod_core.username);
if (a1->type != a2->type)
return 0;
/* prompt (defaults to unix username), copy into account->user */
else {
snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
- m_strcpy(account->user, sizeof(account->user), NONULL(MCore.username));
+ m_strcpy(account->user, sizeof(account->user), NONULL(mod_core.username));
if (mutt_get_field_unbuffered(prompt, account->user,
sizeof(account->user), 0))
return -1;
if (!addr->mailbox)
return 0;
- if (!ascii_strcasecmp(addr->mailbox, MCore.username)
- || string_is_address(addr->mailbox, MCore.username, MCore.shorthost)
- || string_is_address(addr->mailbox, MCore.username, mutt_fqdn(0))
- || string_is_address(addr->mailbox, MCore.username, mutt_fqdn(1))
+ if (!ascii_strcasecmp(addr->mailbox, mod_core.username)
+ || string_is_address(addr->mailbox, mod_core.username, mod_core.shorthost)
+ || string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(0))
+ || string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(1))
|| (MAlias.from && !ascii_strcasecmp(MAlias.from->mailbox, addr->mailbox)))
{
return 1;
if (pw) {
char namebuf[STRING];
- mutt_gecos_name(namebuf, sizeof(namebuf), pw, MCore.gecos_mask);
+ mutt_gecos_name(namebuf, sizeof(namebuf), pw, mod_core.gecos_mask);
m_strreplace(&pop->personal, namebuf);
}
}
last = address_list_append(last, pop);
}
- if (MCore.use_domain) {
+ if (mod_core.use_domain) {
/* now qualify all local addresses */
rfc822_qualify(head, mutt_fqdn(1));
}
/* Remove headers by copying out data to another file, then
* copying the file back */
fseeko (fp, b->offset, 0);
- tfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ tfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!tfp) {
mutt_perror (_("Failure to open file to strip headers."));
goto bailout;
if (use_pager) {
/* recv case */
- pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(MCore.tmpdir),
+ pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(mod_core.tmpdir),
fp && !use_mailcap ? a->filename : NULL);
}
ifp = NULL;
fpout = NULL;
- newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(MCore.tmpdir), NULL);
+ newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(mod_core.tmpdir), NULL);
if (mutt_decode_save_attachment (fp, a, newfile_fd, M_PRINTING) == 0) {
if ((ifp = fopen(newfile, "r")) == NULL) {
/* try to restore the old values */
m_strcpy(LastDir, sizeof(LastDir), OldLastDir);
if (examine_directory (menu, &state, LastDir, prefix) == -1) {
- m_strcpy(LastDir, sizeof(LastDir), NONULL(MCore.homedir));
+ m_strcpy(LastDir, sizeof(LastDir), NONULL(mod_core.homedir));
goto bail;
}
}
static short BuffyNotify = 0; /* # of unnotified new boxes */
buffy_array Incoming;
-@package Buffy {
+@package mod_buffy {
/*
** .pp
** This variable configures how often (in seconds) Madmutt should look for
return 0;
now = time (NULL);
- if (force == 0 && (now - BuffyTime < Buffy.mail_check)
+ if (force == 0 && (now - BuffyTime < mod_buffy.mail_check)
&& (now - ImapBuffyTime < ImapBuffyTimeout))
return BuffyCount;
last1 = BuffyTime;
- if (force == 1 || now - BuffyTime >= Buffy.mail_check)
+ if (force == 1 || now - BuffyTime >= mod_buffy.mail_check)
BuffyTime = now;
last2 = ImapBuffyTime;
if (force == 1 || now - ImapBuffyTime >= ImapBuffyTimeout)
switch (tmp->magic) {
case M_MBOX:
/* only check on force or $mail_check reached */
- if (force == 1 || (now - last1 >= Buffy.mail_check)) {
+ if (force == 1 || (now - last1 >= mod_buffy.mail_check)) {
if (!count) {
if (STAT_CHECK) {
BuffyCount++;
case M_MAILDIR:
/* only check on force or $mail_check reached */
- if (force == 1 || (now - last1 >= Buffy.mail_check)) {
+ if (force == 1 || (now - last1 >= mod_buffy.mail_check)) {
snprintf (path, sizeof (path), "%s/new", tmp->path);
if ((dirp = opendir (path)) == NULL) {
tmp->magic = 0;
case M_MH:
/* only check on force or $mail_check reached */
- if (force == 1 || (now - last1 >= Buffy.mail_check)) {
+ if (force == 1 || (now - last1 >= mod_buffy.mail_check)) {
if ((tmp->new = mh_buffy (tmp->path)) > 0)
BuffyCount++;
if (count) {
CharsetReplacement = Charset_is_utf8 ? 0xfffd : '?';
}
-@package MCharset {
+@package mod_cset {
/*
** .pp
** This variable is a colon-separated list of character encoding
int mutt_convert_nonmime_string(char **ps)
{
- const char *p = MCharset.assumed_charset;
+ const char *p = mod_cset.assumed_charset;
ssize_t ulen = m_strlen(*ps);
char *u = *ps;
m_strncpy(fromcode, sizeof(fromcode), p, q - p);
p = q;
- if (convert_string(u, ulen, fromcode, MCharset.charset, &s, &slen) >= 0) {
+ if (convert_string(u, ulen, fromcode, mod_cset.charset, &s, &slen) >= 0) {
p_delete(ps);
*ps = s;
return 0;
mutt_parse_mime_message (Context, cur);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
- fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fpout) {
mutt_error _("Could not create temporary file!");
return 0;
buf[0] = 0;
if (mutt_get_field (_("Shell command: "), buf, sizeof (buf), M_CMD) == 0) {
if (!buf[0])
- m_strcpy(buf, sizeof(buf), MCore.shell);
+ m_strcpy(buf, sizeof(buf), mod_core.shell);
if (buf[0]) {
CLEARLINE (LINES - 1);
mutt_endwin (NULL);
case 'h': /* hostname */
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
- snprintf (buf, buflen, fmt, NONULL(MCore.shorthost));
+ snprintf (buf, buflen, fmt, NONULL(mod_core.shorthost));
break;
case 'l': /* approx length of current message in bytes */
fputs ("MIME-Version: 1.0\n", out);
fputs ("Content-Transfer-Encoding: 8bit\n", out);
fputs ("Content-Type: text/plain; charset=", out);
- charset_canonicalize(chsbuf, sizeof (chsbuf), MCharset.charset);
+ charset_canonicalize(chsbuf, sizeof (chsbuf), mod_cset.charset);
rfc822_strcpy(buffer, sizeof(buffer), chsbuf, MimeSpecials);
fputs (buffer, out);
fputc ('\n', out);
char *tstr;
tstr = p_dupstr(buf, len);
- mutt_convert_string(&tstr, "utf-8", MCharset.charset, M_ICONV_HOOK_FROM);
+ mutt_convert_string(&tstr, "utf-8", mod_cset.charset, M_ICONV_HOOK_FROM);
fputs(tstr, fp);
p_delete(&tstr);
}
FILE *fp;
ssize_t nread = 0;
- fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fp) {
mutt_perror (_("Can't create temporary file"));
return NULL;
if (tagged_only && !b->tagged)
return 0;
- tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
unlink (tempfile);
return 0;
unlink (fname);
p_delete(&fname);
- fc = fgetconv_open (fp, charset, MCharset.charset, M_ICONV_HOOK_FROM);
+ fc = fgetconv_open (fp, charset, mod_cset.charset, M_ICONV_HOOK_FROM);
for (complete = 1, armor_header = 1;
fgetconvs (buf, sizeof (buf), fc) != NULL;
int c;
rewind (pgpout);
- fc = fgetconv_open (pgpout, "utf-8", MCharset.charset, 0);
+ fc = fgetconv_open (pgpout, "utf-8", mod_cset.charset, 0);
while ((c = fgetconv (fc)) != EOF) {
state_putc (c, s);
if (c == '\n' && s->prefix)
/* Move forward to the application/pgp-encrypted body. */
a = a->next;
- fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fpout) {
if (s->flags & M_DISPLAY)
state_attach_puts (_("[-- Error: could not create temporary file! "
int rc = 0;
a->warnsig = 0;
- fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fpout) {
if (s->flags & M_DISPLAY)
state_attach_puts (_("[-- Error: could not create temporary file! "
gpgme_key_t k = NULL;
int maxdepth = 100;
- fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fp) {
mutt_perror (_("Can't create temporary file"));
return;
const char *charset = parameter_getval(b->parameter, "charset");
if (!charset)
- charset = charset_getfirst(MCharset.assumed_charset);
- if (charset && MCharset.charset)
- cd = mutt_iconv_open (MCharset.charset, charset, M_ICONV_HOOK_FROM);
+ charset = charset_getfirst(mod_cset.assumed_charset);
+ if (charset && mod_cset.charset)
+ cd = mutt_iconv_open (mod_cset.charset, charset, M_ICONV_HOOK_FROM);
} else {
if (b->file_charset)
- cd = mutt_iconv_open (MCharset.charset, b->file_charset, M_ICONV_HOOK_FROM);
+ cd = mutt_iconv_open (mod_cset.charset, b->file_charset, M_ICONV_HOOK_FROM);
}
}
if (!plaintext) {
/* decode to a tempfile, saving the original destination */
fp = s->fpout;
- s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!s->fpout) {
mutt_error _("Unable to open temporary file!");
goto bail;
struct stat st;
string_list_t *cur, **last = NULL, *tmp;
- ofp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
+ ofp = m_tempfile(path, sizeof(path), NONULL(mod_core.tmpdir), NULL);
if (!ofp) {
mutt_perror (path);
return;
desc = _("<UNKNOWN>");
do {
- f = m_tempfile(tmp, sizeof(tmp), NONULL(MCore.tmpdir), NULL);
+ f = m_tempfile(tmp, sizeof(tmp), NONULL(mod_core.tmpdir), NULL);
if (!f) {
mutt_perror(tmp);
return;
{
lua_State *L = luaM_getruntime();
- lua_getfield(L, LUA_GLOBALSINDEX, "MCore");
+ lua_getfield(L, LUA_GLOBALSINDEX, "mod_core");
lua_getfield(L, -1, "folder_hook");
lua_remove(L, -2);
if (lua_isfunction(L, -1)) {
{
char tmp[_POSIX_PATH_MAX];
- msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(MCore.tmpdir), NULL);
+ msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(mod_core.tmpdir), NULL);
if (!msg->fp) {
mutt_perror(tmp);
return -1;
/* instead of downloading all headers and then parsing them, we parse them
* as they come in. */
- fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!fp) {
mutt_error(_("Could not create temporary file"));
mutt_sleep(2);
mutt_message _("Fetching message...");
cache->uid = HEADER_DATA (h)->uid;
- msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
+ msg->fp = m_tempfile(path, sizeof(path), NONULL(mod_core.tmpdir), NULL);
if (!msg->fp) {
return -1;
}
void imap_utf7_encode (char **s)
{
- if (MCharset.charset) {
+ if (mod_cset.charset) {
char *t = m_strdup(*s);
- if (!mutt_convert_string (&t, MCharset.charset, "utf-8", 0)) {
+ if (!mutt_convert_string (&t, mod_cset.charset, "utf-8", 0)) {
char *u7 = utf8_to_utf7 (t, strlen (t), NULL, 0);
p_delete(s);
*s = u7;
void imap_utf7_decode (char **s)
{
- if (MCharset.charset) {
+ if (mod_cset.charset) {
char *t = utf7_to_utf8 (*s, m_strlen(*s), 0, 0);
- if (t && !mutt_convert_string (&t, "utf-8", MCharset.charset, 0)) {
+ if (t && !mutt_convert_string (&t, "utf-8", mod_cset.charset, 0)) {
p_delete(s);
*s = t;
}
p_clear(&token, 1);
while ((linebuf = mutt_read_line(linebuf, &buflen, f, &line)) != NULL) {
- conv = ConfigCharset && (*ConfigCharset) && MCharset.charset;
+ conv = ConfigCharset && (*ConfigCharset) && mod_cset.charset;
if (conv) {
currentline = m_strdup(linebuf);
if (!currentline)
continue;
- mutt_convert_string (¤tline, ConfigCharset, MCharset.charset, 0);
+ mutt_convert_string (¤tline, ConfigCharset, mod_cset.charset, 0);
}
else
currentline = linebuf;
/* Get some information about the user */
if ((pw = getpwuid (getuid ()))) {
char rnbuf[STRING];
- mutt_gecos_name(rnbuf, sizeof(rnbuf), pw, MCore.gecos_mask);
+ mutt_gecos_name(rnbuf, sizeof(rnbuf), pw, mod_core.gecos_mask);
Realname = m_strdup(rnbuf);
}
if ((p = getenv("MAIL") ?: getenv("MAILDIR"))) {
Spoolfile = m_strdup(p);
} else {
- mutt_concat_path(buffer, sizeof(buffer), NONULL(MCore.homedir), MAILPATH);
+ mutt_concat_path(buffer, sizeof(buffer), NONULL(mod_core.homedir), MAILPATH);
Spoolfile = m_strdup(buffer);
}
mutt_init_history ();
if (!Muttrc) {
- snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL(MCore.homedir));
+ snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL(mod_core.homedir));
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc",
- NONULL(MCore.homedir));
+ NONULL(mod_core.homedir));
default_rc = 1;
Muttrc = m_strdup(buffer);
}
/* LUA {{{ */
- snprintf(buffer, sizeof(buffer), "%s/.madmutt.lua", NONULL(MCore.homedir));
+ snprintf(buffer, sizeof(buffer), "%s/.madmutt.lua", NONULL(mod_core.homedir));
if (access(buffer, F_OK) < 0)
- snprintf(buffer, sizeof(buffer), "%s/.madmutt/cfg.lua", NONULL(MCore.homedir));
+ snprintf(buffer, sizeof(buffer), "%s/.madmutt/cfg.lua", NONULL(mod_core.homedir));
if (!access(buffer, F_OK)) {
need_pause = luaM_wrap(mutt_error, luaM_dofile(buffer));
}
return m_strdup("@");
if (*buffer != '@') {
- int len = m_strlen(buffer) + m_strlen(MCore.shorthost) + 2;
+ int len = m_strlen(buffer) + m_strlen(mod_core.shorthost) + 2;
char *res = p_new(char, len);
- snprintf(res, len, "%s.%s", NONULL(MCore.shorthost), buffer);
+ snprintf(res, len, "%s.%s", NONULL(mod_core.shorthost), buffer);
return res;
}
- return m_strdup(NONULL(MCore.shorthost));
+ return m_strdup(NONULL(mod_core.shorthost));
}
#if defined(HAVE_QDBM)
# define HCACHE_BACKEND NULL
#endif
-@package MCore {
+@package mod_core {
/*
** .pp
** \fIThis is a read-only system property and specifies madmutt's
{LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math},
{LUA_DBLIBNAME, luaopen_debug},
- {"MCore", luaopen_MCore},
+ {"mod_core", luaopen_mod_core},
{"MTransport", luaopen_MTransport},
{"MAlias", luaopen_MAlias},
- {"MCharset", luaopen_MCharset},
- {"Mime", luaopen_Mime},
- {"Buffy", luaopen_Buffy},
+ {"mod_cset", luaopen_mod_cset},
+ {"mod_mime", luaopen_mod_mime},
+ {"mod_buffy", luaopen_mod_buffy},
{"mod_ssl", luaopen_mod_ssl},
{"mod_crypt", luaopen_mod_crypt},
{"mod_score", luaopen_mod_score},
return m_strdup(getenv("MAILCAPS") ?: path);
}
-@package Mime {
+@package mod_mime {
/*
** .pp
** ``$spam_separator'' controls what happens when multiple spam headers
m_strcpy(type, sizeof(type), mtype);
- if (Mime.mailcap_sanitize)
+ if (mod_mime.mailcap_sanitize)
mutt_sanitize_filename(type, 0);
while (command[x] && x < clen && y < ssizeof(buf)) {
m_strcpy(pval, sizeof(pval),
parameter_getval(a->parameter, param));
- if (Mime.mailcap_sanitize)
+ if (mod_mime.mailcap_sanitize)
mutt_sanitize_filename(pval, 0);
y += mutt_quote_filename(buf + y, sizeof(buf) - y, pval);
*/
int rfc1524_mailcap_lookup(BODY *a, char *type, rfc1524_entry *entry, int opt)
{
- const char *p = Mime.mailcap_path;
+ const char *p = mod_mime.mailcap_path;
mutt_check_lookup_list(a, type, STRING);
ssize_t elen;
const char *charsets;
- if (!MCharset.charset || !*pd)
+ if (!mod_cset.charset || !*pd)
return;
- charsets = m_strisempty(MCharset.send_charset) ? "utf-8" : MCharset.send_charset;
+ charsets = m_strisempty(mod_cset.send_charset) ? "utf-8" : mod_cset.send_charset;
rfc2047_encode(*pd, m_strlen(*pd), col,
- MCharset.charset, charsets, &e, &elen,
+ mod_cset.charset, charsets, &e, &elen,
encode_specials ? RFC822Specials : NULL);
p_delete(pd);
*q = '\0';
if (*charset)
- mutt_convert_string(&d0, charset, MCharset.charset, M_ICONV_HOOK_FROM);
+ mutt_convert_string(&d0, charset, mod_cset.charset, M_ICONV_HOOK_FROM);
m_strcpy(d, len, d0);
p_delete(&d0);
return 0;
n -= m, s += m;
}
- if (mime_which_token(MCharset.assumed_charset, -1) == MIME_US_ASCII) {
+ if (mime_which_token(mod_cset.assumed_charset, -1) == MIME_US_ASCII) {
char *t;
t = p_dupstr(s, n);
if (value) {
if (encoded)
- mutt_convert_string (&value, charset, MCharset.charset, M_ICONV_HOOK_FROM);
+ mutt_convert_string (&value, charset, mod_cset.charset, M_ICONV_HOOK_FROM);
*head = parameter_new();
(*head)->attribute = m_strdup(attribute);
(*head)->value = value;
if (p->value && strstr(p->value, "=?")) {
rfc2047_decode(&p->value);
} else {
- if (mime_which_token(MCharset.assumed_charset, -1) == MIME_US_ASCII)
+ if (mime_which_token(mod_cset.assumed_charset, -1) == MIME_US_ASCII)
mutt_convert_nonmime_string(&p->value);
}
s = rfc2231_get_charset (p->value, charset, sizeof (charset));
rfc2231_decode_one (p->value, s);
- mutt_convert_string (&p->value, charset, MCharset.charset, M_ICONV_HOOK_FROM);
+ mutt_convert_string (&p->value, charset, mod_cset.charset, M_ICONV_HOOK_FROM);
*last = p;
last = &p->next;
return 0;
}
- if (MCharset.charset && MCharset.send_charset) {
- charset = mutt_choose_charset(MCharset.charset, MCharset.send_charset,
+ if (mod_cset.charset && mod_cset.send_charset) {
+ charset = mutt_choose_charset(mod_cset.charset, mod_cset.send_charset,
*s, m_strlen(*s), &d, &dlen);
}
if (!charset) {
- charset = m_strdup(MCharset.charset ?: "unknown-8bit");
+ charset = m_strdup(mod_cset.charset ?: "unknown-8bit");
d = *s;
dlen = m_strlen(d);
}
if ((in = safe_fopen (hdr->content->filename, "r")) == NULL)
return;
- out = m_tempfile(tmpf, sizeof(tmpf), NONULL(MCore.tmpdir), NULL);
+ out = m_tempfile(tmpf, sizeof(tmpf), NONULL(mod_core.tmpdir), NULL);
if (!out) {
m_fclose(&in);
return;
pc = parameter_getval(ct->parameter, "charset");
if (!pc) {
parameter_setval(&ct->parameter, "charset",
- charset_getfirst(MCharset.assumed_charset));
+ charset_getfirst(mod_cset.assumed_charset));
}
}
}
{
/* if spam tag already exists, figure out how to amend it */
if (e->spam && *buf) {
- if (Mime.spam_separator) {
- mutt_buffer_addstr(e->spam, Mime.spam_separator);
+ if (mod_mime.spam_separator) {
+ mutt_buffer_addstr(e->spam, mod_mime.spam_separator);
} else {
mutt_buffer_reset(e->spam);
}
ctx->realpath = ctx->path;
/* Uncompress to /tmp */
- tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(MCore.tmpdir), NULL);
+ tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(mod_core.tmpdir), NULL);
/* If we cannot open tempfile, that means the file already exists (!?)
* or we are following a symlink, which is bad and insecure.
*/
ctx->realpath = ctx->path;
/* Uncompress to /tmp */
- fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(MCore.tmpdir), NULL);
+ fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(mod_core.tmpdir), NULL);
m_fclose(&fh);
ctx->path = p_dupstr(tmppath, m_strlen(tmppath));
crc = crc32(crc, "madmutt.2007.05.13", m_strlen("madmutt.2007.05.13"));
#ifdef HAVE_LANGINFO_H
- crc = crc32(crc, MCharset.charset, m_strlen(MCharset.charset));
+ crc = crc32(crc, mod_cset.charset, m_strlen(mod_cset.charset));
#endif
crc = crc32(crc, "USE_POP", m_strlen("USE_POP"));
crc = crc32(crc, "MIXMASTER", m_strlen("MIXMASTER"));
return (-1);
/* Create a temporary file to write the new version of the mailbox in. */
- fp = m_tempfile(tempfile, _POSIX_PATH_MAX, NONULL(MCore.tmpdir), NULL);
+ fp = m_tempfile(tempfile, _POSIX_PATH_MAX, NONULL(mod_core.tmpdir), NULL);
if (fp == NULL) {
mutt_error _("Could not create temporary file!");
mutt_sleep (5);
char savefile[_POSIX_PATH_MAX];
snprintf(savefile, sizeof (savefile), "%s/mutt.%s-%u",
- NONULL(MCore.tmpdir), NONULL(MCore.username), (unsigned int)getpid());
+ NONULL(mod_core.tmpdir), NONULL(mod_core.username), (unsigned int)getpid());
rename (tempfile, savefile);
mutt_unblock_signals ();
mx_fastclose_mailbox (ctx);
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d",
- dest->path, NONULL(MCore.shorthost), (int) getpid (), Counter++);
+ dest->path, NONULL(mod_core.shorthost), (int) getpid (), Counter++);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
if (errno != EEXIST) {
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
dest->path, subdir, (long) time (NULL),
- (unsigned int) getpid (), Counter++, NONULL (MCore.shorthost), suffix);
+ (unsigned int) getpid (), Counter++, NONULL (mod_core.shorthost), suffix);
umask (Umask);
if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) {
for (;;) {
snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
(long) time (NULL), (unsigned int) getpid (), Counter++,
- NONULL (MCore.shorthost), suffix);
+ NONULL (mod_core.shorthost), suffix);
snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
if (safe_rename (msg->path, full) == 0) {
mutt_quote_filename (f, sizeof (f), path);
snprintf(cmd, sizeof(cmd), "%s %s%s%s%s%s%s%s",
- MCore.dotlock,
+ mod_core.dotlock,
flags & DL_FL_TRY ? "-t " : "",
flags & DL_FL_UNLOCK ? "-u " : "",
flags & DL_FL_USEPRIV ? "-p " : "",
p = hdr->env->from;
}
- fprintf (msg->fp, "From %s %s", p ? p->mailbox : NONULL(MCore.username),
+ fprintf (msg->fp, "From %s %s", p ? p->mailbox : NONULL(mod_core.username),
ctime (&msg->received));
}
}
char cmd[LONG_STRING];
mutt_endwin (NULL);
- m_quotefile_fmt(cmd, sizeof (cmd), MCore.editor, data);
+ m_quotefile_fmt(cmd, sizeof (cmd), mod_core.editor, data);
if (mutt_system (cmd) == -1)
mutt_error (_("Error running \"%s\"!"), cmd);
keypad (stdscr, TRUE);
sidebar_draw ();
mutt_message (_("New mail in this mailbox."));
- if (MCore.beep_new)
+ if (mod_core.beep_new)
beep ();
}
else if (check == M_FLAGS)
menu->redraw |= REDRAW_SIDEBAR;
}
if (do_buffy_notify) {
- if (buffy_notify () && MCore.beep_new)
+ if (buffy_notify () && mod_core.beep_new)
beep ();
}
else
break;
}
- if (query_quadoption2(MCore.quit, _("Quit Madmutt?")) == M_YES) {
+ if (query_quadoption2(mod_core.quit, _("Quit Madmutt?")) == M_YES) {
int check;
oldcount = Context ? Context->msgcount : 0;
}
if ((menu->menu == MENU_MAIN)
- && (query_quadoption2(MCore.quit,
+ && (query_quadoption2(mod_core.quit,
_("Exit Madmutt without saving?")) == M_YES))
{
if (Context) {
#define CLEARLINE_WIN(x) move(x,(option(OPTMBOXPANE)?SidebarWidth:0)), clrtoeol()
#define CLEARLINE(x) move(x,0), clrtoeol()
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
-#define BEEP() do { if (MCore.beep) beep(); } while (0)
+#define BEEP() do { if (mod_core.beep) beep(); } while (0)
#if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
#define curs_set(x)
case 'h':
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
- snprintf (buf, buflen, fmt, NONULL (MCore.shorthost));
+ snprintf (buf, buflen, fmt, NONULL (mod_core.shorthost));
break;
case 'f':
/* is the following if still needed? */
- fout = m_tempfile(buf, sizeof(buf), NONULL(MCore.tmpdir), NULL);
+ fout = m_tempfile(buf, sizeof(buf), NONULL(mod_core.tmpdir), NULL);
tempfile = m_strdup(buf);
if (tempfile) {
/* Is this the right function? Interesting effects with some bad identifiers! */
if (idna_to_unicode_8z8z (in, out, 1) != IDNA_SUCCESS)
goto notrans;
- if (mutt_convert_string (out, "utf-8", MCharset.charset, M_ICONV_HOOK_TO) == -1)
+ if (mutt_convert_string (out, "utf-8", mod_cset.charset, M_ICONV_HOOK_TO) == -1)
goto notrans;
/*
char *t2 = NULL;
char *tmp = m_strdup(*out);
- if (mutt_convert_string (&tmp, MCharset.charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
+ if (mutt_convert_string (&tmp, mod_cset.charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
irrev = 1;
if (!irrev && idna_to_ascii_8z (tmp, &t2, 1) != IDNA_SUCCESS)
irrev = 1;
return -1;
}
- if (mutt_convert_string (&tmp, MCharset.charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
+ if (mutt_convert_string (&tmp, mod_cset.charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
rv = -1;
if (!rv && idna_to_ascii_8z (tmp, out, 1) != IDNA_SUCCESS)
rv = -2;
{
int fd;
- fd = m_tempfd(s, l, m_strisempty(dir) ? NONULL(MCore.tmpdir) : dir, s);
+ fd = m_tempfd(s, l, m_strisempty(dir) ? NONULL(mod_core.tmpdir) : dir, s);
if (fd < 0) {
*s = '\0';
} else {
void mutt_mktemp(char *s)
{
- int fd = m_tempfd(s, _POSIX_PATH_MAX, NONULL(MCore.tmpdir), NULL);
+ int fd = m_tempfd(s, _POSIX_PATH_MAX, NONULL(mod_core.tmpdir), NULL);
if (fd < 0) {
*s = '\0';
} else {
switch (*s) {
case '~':
if (s[1] == '/' || s[1] == '\0') {
- m_strcpy(p, sizeof(p), MCore.homedir);
+ m_strcpy(p, sizeof(p), mod_core.homedir);
tail = s + 1;
} else {
struct passwd *pw;
*s++ = '=';
memmove (s, s + len, m_strlen(s + len) + 1);
}
- else if (m_strncmp(s, MCore.homedir, (len = m_strlen(MCore.homedir))) == 0
+ else if (m_strncmp(s, mod_core.homedir, (len = m_strlen(mod_core.homedir))) == 0
&& s[len] == '/') {
*s++ = '~';
memmove (s, s + len - 1, m_strlen(s + len - 1) + 1);
int ret;
HEADER *h = ctx->hdrs[ctx->msgcount];
- f = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ f = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!f)
return -1;
p_delete(&cache->path);
cache->index = ctx->hdrs[msgno]->index;
- msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
+ msg->fp = m_tempfile(path, sizeof(path), NONULL(mod_core.tmpdir), NULL);
if (!msg->fp) {
return -1;
}
p_clear(&s, 1);
s.fpin = msg->fp;
s.flags = M_CHARCONV;
- s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!s.fpout) {
mutt_error(_("Could not create temporary file"));
return (0);
bar.msg = _("Fetching message...");
mutt_progress_bar (&bar, 0);
- msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
+ msg->fp = m_tempfile(path, sizeof(path), NONULL(mod_core.tmpdir), NULL);
if (!msg->fp) {
mutt_error(_("Could not create temporary file"));
mutt_sleep(2);
parameter_delval(&b->parameter, "x-mutt-noconv");
}
- s.fpout = m_tempfile(file, sizeof(file), NONULL(MCore.tmpdir), file);
+ s.fpout = m_tempfile(file, sizeof(file), NONULL(mod_core.tmpdir), file);
if (!s.fpout)
goto bail;
CLEARLINE (LINES - 1);
return;
}
- tempfd = m_tempfd(tfile, sizeof(tfile), NONULL(MCore.tmpdir), NULL);
+ tempfd = m_tempfd(tfile, sizeof(tfile), NONULL(mod_core.tmpdir), NULL);
}
if (mutt_pipe_attachment(fp, body, command, tempfd)) {
FILE *ifp;
int newfile_fd;
- newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(MCore.tmpdir), NULL);
+ newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(mod_core.tmpdir), NULL);
if (mutt_decode_save_attachment (fp, top, newfile_fd, M_PRINTING) == 0) {
if ((ifp = fopen (newfile, "r")) != NULL) {
mutt_copy_stream (ifp, state->fpout);
tmphdr->env = envelope_new();
mutt_make_forward_subject (tmphdr->env, Context, parent);
- tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(mod_core.tmpdir), NULL);
if (!tmpfp) {
mutt_error(_("Could not create temporary file"));
return;
/* no MIME encapsulation */
- tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(mod_core.tmpdir), NULL);
if (!tmpfp) {
mutt_error(_("Could not create temporary file"));
header_delete(&tmphdr);
return;
}
- tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(mod_core.tmpdir), NULL);
if (!tmpfp) {
mutt_error(_("Could not create temporary file"));
header_delete(&tmphdr);
if (MAlias.from)
adr = address_dup(MAlias.from);
- else if (MCore.use_domain) {
+ else if (mod_core.use_domain) {
const char *fqdn = mutt_fqdn (1);
adr = address_new();
- adr->mailbox = p_new(char, m_strlen(MCore.username) + m_strlen(fqdn) + 2);
- sprintf(adr->mailbox, "%s@%s", NONULL(MCore.username), NONULL(fqdn));
+ adr->mailbox = p_new(char, m_strlen(mod_core.username) + m_strlen(fqdn) + 2);
+ sprintf(adr->mailbox, "%s@%s", NONULL(mod_core.username), NONULL(fqdn));
} else {
adr = address_new ();
- adr->mailbox = m_strdup(NONULL(MCore.username));
+ adr->mailbox = m_strdup(NONULL(mod_core.username));
}
return (adr);
int i;
/* Write out the message in MIME form. */
- tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!tempfp)
return -1;
if (!tempfile) {
char buffer[_POSIX_PATH_MAX];
- tempfp = m_tempfile(buffer, sizeof(buffer), NONULL(MCore.tmpdir), NULL);
+ tempfp = m_tempfile(buffer, sizeof(buffer), NONULL(mod_core.tmpdir), NULL);
msg->content->filename = m_strdup(buffer);
} else {
tempfp = safe_fopen(tempfile, "a+");
if (b != NULL && b->type == TYPETEXT && (!b->noconv && !b->force_charset)) {
const char *chs = parameter_getval(b->parameter, "charset");
- char *fchs = b->use_disp && !m_strisempty(MCharset.file_charset)
- ? FileCharset : MCharset.charset;
- if (MCharset.charset && (chs || MCharset.send_charset) &&
- convert_file_from_to (fp, fchs, chs ? chs : MCharset.send_charset,
+ char *fchs = b->use_disp && !m_strisempty(mod_cset.file_charset)
+ ? FileCharset : mod_cset.charset;
+ if (mod_cset.charset && (chs || mod_cset.send_charset) &&
+ convert_file_from_to (fp, fchs, chs ? chs : mod_cset.send_charset,
&fromcode, &tocode, info) != -1) {
if (!chs) {
charset_canonicalize (chsbuf, sizeof (chsbuf), tocode);
if (b != NULL && b->type == TYPETEXT && (!b->noconv && !b->force_charset))
parameter_setval(&b->parameter, "charset",
(!info->hibin ? "us-ascii"
- : MCharset.charset && !charset_is_us_ascii(MCharset.charset)
- ? MCharset.charset : "unknown-8bit"));
+ : mod_cset.charset && !charset_is_us_ascii(mod_cset.charset)
+ ? mod_cset.charset : "unknown-8bit"));
return info;
}
*/
switch (count) {
case 0:
- snprintf(buf, sizeof (buf), "%s/.mime.types", NONULL(MCore.homedir));
+ snprintf(buf, sizeof (buf), "%s/.mime.types", NONULL(mod_core.homedir));
break;
case 1:
m_strcpy(buf, sizeof(buf), SYSCONFDIR "/madmutt-mime.types");
a->length = sb.st_size;
}
- fpout = m_tempfile(temp, sizeof(temp), NONULL(MCore.tmpdir), NULL);
+ fpout = m_tempfile(temp, sizeof(temp), NONULL(mod_core.tmpdir), NULL);
if (!fpout) {
mutt_error(_("Could not create temporary file"));
goto cleanup;
a->noconv = 1;
a->force_charset = 1;
- s.fpout = m_tempfile(buff, sizeof(buff), NONULL(MCore.tmpdir), NULL);
+ s.fpout = m_tempfile(buff, sizeof(buff), NONULL(mod_core.tmpdir), NULL);
if (!s.fpout) {
mutt_error(_("Could not create temporary file"));
return;
(hdr->security & ENCRYPT)) {
}
- fp = m_tempfile(buffer, sizeof(buffer), NONULL(MCore.tmpdir), NULL);
+ fp = m_tempfile(buffer, sizeof(buffer), NONULL(mod_core.tmpdir), NULL);
if (!fp)
return NULL;
}
if (mode == 0 && !privacy && option (OPTXMAILER) && !has_agent) {
- if (MCore.operating_system) {
+ if (mod_core.operating_system) {
fprintf(fp, "User-Agent: %s (%s)\n", mutt_make_version(),
- MCore.operating_system);
+ mod_core.operating_system);
} else {
fprintf(fp, "User-Agent: %s\n", mutt_make_version());
}
{
char *p = NULL, *q;
- if (MCore.hostname && MCore.hostname[0] != '@') {
- p = MCore.hostname;
+ if (mod_core.hostname && mod_core.hostname[0] != '@') {
+ p = mod_core.hostname;
if (may_hide_host && option (OPTHIDDENHOST)) {
- if ((p = strchr(MCore.hostname, '.')))
+ if ((p = strchr(mod_core.hostname, '.')))
p++;
/* sanity check: don't hide the host if
the fqdn is something like detebe.org. */
if (!p || !(q = strchr(p, '.')))
- p = MCore.hostname;
+ p = mod_core.hostname;
}
}
const char *fqdn;
if (!(fqdn = mutt_fqdn(0)))
- fqdn = NONULL(MCore.shorthost);
+ fqdn = NONULL(mod_core.shorthost);
mutt_gen_localpart(localpart, sizeof(localpart), MsgIdFormat);
snprintf(buf, sizeof(buf), "<%s@%s>", localpart, fqdn);
if (!fp)
fp = msg->fp;
- f = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ f = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (f) {
int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
* the message body begins with "From "
*/
if (f.magic == M_MBOX) {
- tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
+ tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL);
if (!tempfp) {
mutt_error(_("Could not create temporary file"));
mx_close_mailbox (&f, NULL);