From 9946738a6a1c27a5602a14d1afe2eea2389732b2 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 20 May 2007 14:34:29 +0200 Subject: [PATCH] rename a bunch of modules Signed-off-by: Pierre Habouzit --- account.c | 6 +++--- alias.cpkg | 12 ++++++------ attach.c | 6 +++--- browser.c | 2 +- buffy.cpkg | 12 ++++++------ charset.cpkg | 6 +++--- commands.c | 4 ++-- compose.c | 2 +- copy.c | 2 +- crypt.cpkg | 16 ++++++++-------- handler.c | 10 +++++----- headers.c | 2 +- help.c | 2 +- hook.c | 2 +- imap/imap.c | 2 +- imap/message.c | 4 ++-- imap/utf7.c | 8 ++++---- init.c | 16 ++++++++-------- lib-lua/madmutt.cpkg | 8 ++++---- lib-lua/runtime.c | 8 ++++---- lib-mime/mime.cpkg | 2 +- lib-mime/rfc1524.c | 6 +++--- lib-mime/rfc2047.c | 10 +++++----- lib-mime/rfc2231.c | 12 ++++++------ lib-mime/rfc3676.c | 2 +- lib-mime/rfc822parse.c | 6 +++--- lib-mx/compress.c | 4 ++-- lib-mx/hcache.c | 2 +- lib-mx/mbox.c | 4 ++-- lib-mx/mh.c | 6 +++--- lib-mx/mx.c | 4 ++-- lib-ui/curs_lib.c | 2 +- lib-ui/curs_main.c | 8 ++++---- lib-ui/curses.h | 2 +- lib-ui/status.c | 2 +- main.c | 2 +- mutt_idna.c | 6 +++--- muttlib.c | 8 ++++---- nntp/nntp.c | 4 ++-- pattern.c | 2 +- pop.c | 2 +- postpone.c | 2 +- recvattach.c | 4 ++-- recvcmd.c | 6 +++--- send.c | 12 ++++++------ sendlib.c | 38 +++++++++++++++++++------------------- 46 files changed, 144 insertions(+), 144 deletions(-) diff --git a/account.c b/account.c index 044aa6c..92cbdab 100644 --- a/account.c +++ b/account.c @@ -19,8 +19,8 @@ /* 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; @@ -131,7 +131,7 @@ int mutt_account_getuser (ACCOUNT * account) /* 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; diff --git a/alias.cpkg b/alias.cpkg index c4e739e..7342c31 100644 --- a/alias.cpkg +++ b/alias.cpkg @@ -207,10 +207,10 @@ int mutt_addr_is_user(address_t *addr) 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; @@ -445,7 +445,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) 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); } } @@ -454,7 +454,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) 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)); } diff --git a/attach.c b/attach.c index afae486..c4903b4 100644 --- a/attach.c +++ b/attach.c @@ -138,7 +138,7 @@ int mutt_compose_attachment (BODY * a) /* 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; @@ -437,7 +437,7 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr, 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); } @@ -911,7 +911,7 @@ int mutt_print_attachment (FILE * fp, BODY * a) 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) { diff --git a/browser.c b/browser.c index aa91a60..43608e7 100644 --- a/browser.c +++ b/browser.c @@ -926,7 +926,7 @@ void _mutt_select_file (char *f, ssize_t flen, int flags, char ***files, /* 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; } } diff --git a/buffy.cpkg b/buffy.cpkg index dc5f6c2..65e20bb 100644 --- a/buffy.cpkg +++ b/buffy.cpkg @@ -32,7 +32,7 @@ static short BuffyCount = 0; /* how many boxes with new mail */ 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 @@ -132,12 +132,12 @@ int buffy_check(int force) 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) @@ -174,7 +174,7 @@ int buffy_check(int force) 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++; @@ -204,7 +204,7 @@ int buffy_check(int force) 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; @@ -263,7 +263,7 @@ int buffy_check(int force) 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) { diff --git a/charset.cpkg b/charset.cpkg index 2da4379..89905b8 100644 --- a/charset.cpkg +++ b/charset.cpkg @@ -69,7 +69,7 @@ static void charset_onchange(const char *cset) CharsetReplacement = Charset_is_utf8 ? 0xfffd : '?'; } -@package MCharset { +@package mod_cset { /* ** .pp ** This variable is a colon-separated list of character encoding @@ -383,7 +383,7 @@ static ssize_t convert_string(const char *f, ssize_t flen, 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; @@ -402,7 +402,7 @@ int mutt_convert_nonmime_string(char **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; diff --git a/commands.c b/commands.c index 2617f7a..8be7f8f 100644 --- a/commands.c +++ b/commands.c @@ -55,7 +55,7 @@ int mutt_display_message (HEADER * cur) 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; @@ -470,7 +470,7 @@ void mutt_shell_escape (void) 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); diff --git a/compose.c b/compose.c index c16d5be..e2c2a08 100644 --- a/compose.c +++ b/compose.c @@ -426,7 +426,7 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op, 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 */ diff --git a/copy.c b/copy.c index f79a9d5..37e3ef3 100644 --- a/copy.c +++ b/copy.c @@ -361,7 +361,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, 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); diff --git a/crypt.cpkg b/crypt.cpkg index f482cdb..b22723f 100644 --- a/crypt.cpkg +++ b/crypt.cpkg @@ -219,7 +219,7 @@ static void print_utf8 (FILE * fp, const char *buf, ssize_t len) 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); } @@ -475,7 +475,7 @@ static char *data_object_to_tempfile(gpgme_data_t data, FILE **ret_fp) 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; @@ -1580,7 +1580,7 @@ pgp_check_traditional_one_body(FILE *fp, BODY *b, int tagged_only) 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; @@ -1658,7 +1658,7 @@ static void copy_clearsigned(gpgme_data_t data, STATE * s, char *charset) 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; @@ -1874,7 +1874,7 @@ int crypt_pgp_application_pgp_handler(BODY *m, STATE *s) 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) @@ -1939,7 +1939,7 @@ int crypt_pgp_encrypted_handler (BODY * a, STATE * s) /* 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! " @@ -1999,7 +1999,7 @@ int crypt_smime_application_smime_handler (BODY * a, STATE * s) 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! " @@ -2870,7 +2870,7 @@ static void verify_key (cryptkey_t * key) 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; diff --git a/handler.c b/handler.c index da10849..30434af 100644 --- a/handler.c +++ b/handler.c @@ -1250,12 +1250,12 @@ void mutt_decode_attachment (BODY * b, STATE * s) 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); } } @@ -1383,7 +1383,7 @@ int mutt_body_handler (BODY * b, STATE * s) 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; diff --git a/headers.c b/headers.c index a067025..65c3708 100644 --- a/headers.c +++ b/headers.c @@ -28,7 +28,7 @@ void mutt_edit_headers(const char *body, 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; diff --git a/help.c b/help.c index ea694c3..d54d1ed 100644 --- a/help.c +++ b/help.c @@ -276,7 +276,7 @@ void mutt_help (int menu) desc = _(""); 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; diff --git a/hook.c b/hook.c index a71724c..75ad86d 100644 --- a/hook.c +++ b/hook.c @@ -256,7 +256,7 @@ void mutt_folder_hook (char *path) { 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)) { diff --git a/imap/imap.c b/imap/imap.c index a9f5788..ac9363e 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1569,7 +1569,7 @@ static int imap_open_new_message (MESSAGE * msg, { 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; diff --git a/imap/message.c b/imap/message.c index df604d7..476f43a 100644 --- a/imap/message.c +++ b/imap/message.c @@ -79,7 +79,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) /* 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); @@ -371,7 +371,7 @@ int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) 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; } diff --git a/imap/utf7.c b/imap/utf7.c index ae194e6..ca40c8d 100644 --- a/imap/utf7.c +++ b/imap/utf7.c @@ -208,10 +208,10 @@ bail: 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; @@ -222,10 +222,10 @@ void imap_utf7_encode (char **s) 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; } diff --git a/init.c b/init.c index f318903..19d3b18 100644 --- a/init.c +++ b/init.c @@ -1232,12 +1232,12 @@ static int source_rc (const char *rcfile, BUFFER * err) 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; @@ -1711,7 +1711,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) /* 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); } @@ -1739,7 +1739,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) 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); } @@ -1772,10 +1772,10 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) 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); @@ -1826,9 +1826,9 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) } /* 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)); } diff --git a/lib-lua/madmutt.cpkg b/lib-lua/madmutt.cpkg index 458bdb5..5c2ebe7 100644 --- a/lib-lua/madmutt.cpkg +++ b/lib-lua/madmutt.cpkg @@ -72,13 +72,13 @@ static char *madmutt_init_hostname(void) 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) @@ -91,7 +91,7 @@ static char *madmutt_init_hostname(void) # define HCACHE_BACKEND NULL #endif -@package MCore { +@package mod_core { /* ** .pp ** \fIThis is a read-only system property and specifies madmutt's diff --git a/lib-lua/runtime.c b/lib-lua/runtime.c index 1957a9c..f023277 100644 --- a/lib-lua/runtime.c +++ b/lib-lua/runtime.c @@ -41,12 +41,12 @@ void luaM_initialize(void) {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}, diff --git a/lib-mime/mime.cpkg b/lib-mime/mime.cpkg index 3b71df3..86704dc 100644 --- a/lib-mime/mime.cpkg +++ b/lib-mime/mime.cpkg @@ -65,7 +65,7 @@ static char *mailcap_init(void) return m_strdup(getenv("MAILCAPS") ?: path); } -@package Mime { +@package mod_mime { /* ** .pp ** ``$spam_separator'' controls what happens when multiple spam headers diff --git a/lib-mime/rfc1524.c b/lib-mime/rfc1524.c index 7f6ceb3..422a82d 100644 --- a/lib-mime/rfc1524.c +++ b/lib-mime/rfc1524.c @@ -103,7 +103,7 @@ int rfc1524_expand_command(BODY *a, const char *filename, const char *mtype, 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)) { @@ -128,7 +128,7 @@ int rfc1524_expand_command(BODY *a, const char *filename, const char *mtype, 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); @@ -354,7 +354,7 @@ rfc1524_mailcap_parse(BODY *a, const char *filename, const char *type, */ 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); diff --git a/lib-mime/rfc2047.c b/lib-mime/rfc2047.c index 4aa6ee4..1d42403 100644 --- a/lib-mime/rfc2047.c +++ b/lib-mime/rfc2047.c @@ -561,13 +561,13 @@ static void _rfc2047_encode_string(char **pd, int encode_specials, int col) 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); @@ -667,7 +667,7 @@ rfc2047_decode_word(char *d, size_t len, const char *p, const char *end) *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; @@ -786,7 +786,7 @@ void rfc2047_decode(char **pd) 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); diff --git a/lib-mime/rfc2231.c b/lib-mime/rfc2231.c index da50510..27c9c0e 100644 --- a/lib-mime/rfc2231.c +++ b/lib-mime/rfc2231.c @@ -186,7 +186,7 @@ rfc2231_join_continuations(parameter_t **head, rfc2231_param *par) 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; @@ -236,7 +236,7 @@ void rfc2231_decode_parameters (parameter_t ** headp) 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); } @@ -249,7 +249,7 @@ void rfc2231_decode_parameters (parameter_t ** headp) 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; @@ -313,13 +313,13 @@ int rfc2231_encode_string(char **s) 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); } diff --git a/lib-mime/rfc3676.c b/lib-mime/rfc3676.c index 0ca9ff7..6559cc4 100644 --- a/lib-mime/rfc3676.c +++ b/lib-mime/rfc3676.c @@ -225,7 +225,7 @@ void rfc3676_space_stuff (HEADER* hdr) { 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; diff --git a/lib-mime/rfc822parse.c b/lib-mime/rfc822parse.c index fa0beaa..b1a2d39 100644 --- a/lib-mime/rfc822parse.c +++ b/lib-mime/rfc822parse.c @@ -331,7 +331,7 @@ void mutt_parse_content_type(char *s, BODY *ct) pc = parameter_getval(ct->parameter, "charset"); if (!pc) { parameter_setval(&ct->parameter, "charset", - charset_getfirst(MCharset.assumed_charset)); + charset_getfirst(mod_cset.assumed_charset)); } } } @@ -1034,8 +1034,8 @@ mutt_read_rfc822_header(FILE *f, HEADER *hdr, short user_hdrs, short weed) { /* 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); } diff --git a/lib-mx/compress.c b/lib-mx/compress.c index 62a0815..c28eee6 100644 --- a/lib-mx/compress.c +++ b/lib-mx/compress.c @@ -196,7 +196,7 @@ int mutt_open_read_compressed(CONTEXT * ctx) 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. */ @@ -289,7 +289,7 @@ int mutt_open_append_compressed (CONTEXT * ctx) 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)); diff --git a/lib-mx/hcache.c b/lib-mx/hcache.c index 8748adf..76e4a83 100644 --- a/lib-mx/hcache.c +++ b/lib-mx/hcache.c @@ -56,7 +56,7 @@ static int generate_crc32(void) 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")); diff --git a/lib-mx/mbox.c b/lib-mx/mbox.c index d3c5948..9729c5e 100644 --- a/lib-mx/mbox.c +++ b/lib-mx/mbox.c @@ -422,7 +422,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) 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); @@ -568,7 +568,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) 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); diff --git a/lib-mx/mh.c b/lib-mx/mh.c index f0a1484..0d04ea9 100644 --- a/lib-mx/mh.c +++ b/lib-mx/mh.c @@ -163,7 +163,7 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) 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) { @@ -898,7 +898,7 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr 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) { @@ -971,7 +971,7 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr) 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) { diff --git a/lib-mx/mx.c b/lib-mx/mx.c index d5cf676..5f4b8dd 100644 --- a/lib-mx/mx.c +++ b/lib-mx/mx.c @@ -66,7 +66,7 @@ static int invoke_dotlock (const char *path, int flags, int retry) 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 " : "", @@ -1038,7 +1038,7 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags) 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)); } } diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index aa029ed..936edda 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -142,7 +142,7 @@ void mutt_edit_file(const char *data) 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); diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index ffa670d..d83f1bf 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -475,7 +475,7 @@ int mutt_index_menu (void) sidebar_draw (); mutt_message (_("New mail in this mailbox.")); - if (MCore.beep_new) + if (mod_core.beep_new) beep (); } else if (check == M_FLAGS) @@ -502,7 +502,7 @@ int mutt_index_menu (void) menu->redraw |= REDRAW_SIDEBAR; } if (do_buffy_notify) { - if (buffy_notify () && MCore.beep_new) + if (buffy_notify () && mod_core.beep_new) beep (); } else @@ -970,7 +970,7 @@ int mutt_index_menu (void) 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; @@ -1298,7 +1298,7 @@ int mutt_index_menu (void) } if ((menu->menu == MENU_MAIN) - && (query_quadoption2(MCore.quit, + && (query_quadoption2(mod_core.quit, _("Exit Madmutt without saving?")) == M_YES)) { if (Context) { diff --git a/lib-ui/curses.h b/lib-ui/curses.h index 3537d71..c33a93d 100644 --- a/lib-ui/curses.h +++ b/lib-ui/curses.h @@ -62,7 +62,7 @@ #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) diff --git a/lib-ui/status.c b/lib-ui/status.c index 2ca8f9d..fb61664 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -98,7 +98,7 @@ status_format_str(char *buf, ssize_t buflen, char op, const char *src, 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': diff --git a/main.c b/main.c index e0c00f2..eb309b8 100644 --- a/main.c +++ b/main.c @@ -589,7 +589,7 @@ int main (int argc, char **argv) /* 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) { diff --git a/mutt_idna.c b/mutt_idna.c index 84e470d..4c9dc50 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -33,7 +33,7 @@ static int mutt_idna_to_local (const char *in, char **out, int flags) /* 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; /* @@ -46,7 +46,7 @@ static int mutt_idna_to_local (const char *in, char **out, int flags) 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; @@ -83,7 +83,7 @@ static int mutt_local_to_idna (const char *in, char **out) 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; diff --git a/muttlib.c b/muttlib.c index c595af6..bf59e68 100644 --- a/muttlib.c +++ b/muttlib.c @@ -32,7 +32,7 @@ void mutt_adv_mktemp (const char* dir, char *s, ssize_t l) { 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 { @@ -43,7 +43,7 @@ void mutt_adv_mktemp (const char* dir, char *s, ssize_t l) 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 { @@ -62,7 +62,7 @@ ssize_t _mutt_expand_path(char *buf, ssize_t len, const char *s, int rx) 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; @@ -199,7 +199,7 @@ void mutt_pretty_mailbox (char *s) *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); diff --git a/nntp/nntp.c b/nntp/nntp.c index 1f4462a..745a982 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -437,7 +437,7 @@ static int nntp_read_header (CONTEXT * ctx, const char *msgid, 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; @@ -915,7 +915,7 @@ int nntp_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) 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; } diff --git a/pattern.c b/pattern.c index 9839aa7..b29ad17 100644 --- a/pattern.c +++ b/pattern.c @@ -141,7 +141,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) 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); diff --git a/pop.c b/pop.c index f173d6e..2cc16e7 100644 --- a/pop.c +++ b/pop.c @@ -1393,7 +1393,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) 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); diff --git a/postpone.c b/postpone.c index 74490e4..68857c2 100644 --- a/postpone.c +++ b/postpone.c @@ -591,7 +591,7 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr, 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; diff --git a/recvattach.c b/recvattach.c index 1c2d85b..2a88f4e 100644 --- a/recvattach.c +++ b/recvattach.c @@ -500,7 +500,7 @@ mutt_query_pipe_attachment(char *command, FILE * fp, BODY * body, int afilter) 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)) { @@ -634,7 +634,7 @@ static void print_attachment_list (FILE * fp, int tag, BODY * top, 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); diff --git a/recvcmd.c b/recvcmd.c index e0c8457..28cfc16 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -441,7 +441,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, 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; @@ -603,7 +603,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr __attribute__ ((unused) /* 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); @@ -850,7 +850,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, 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); diff --git a/send.c b/send.c index e40d3da..db26a3d 100644 --- a/send.c +++ b/send.c @@ -990,14 +990,14 @@ address_t *mutt_default_from (void) 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); @@ -1010,7 +1010,7 @@ static int send_message (HEADER * msg) 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; @@ -1208,7 +1208,7 @@ int ci_send_message (int flags, /* send mode */ 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+"); diff --git a/sendlib.c b/sendlib.c index 1926dc6..49d4140 100644 --- a/sendlib.c +++ b/sendlib.c @@ -758,10 +758,10 @@ CONTENT *mutt_get_content_info (const char *fname, BODY * b) 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); @@ -784,8 +784,8 @@ CONTENT *mutt_get_content_info (const char *fname, BODY * b) 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; } @@ -821,7 +821,7 @@ int mutt_lookup_mime_type (BODY * att, const char *path) */ 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"); @@ -917,7 +917,7 @@ void mutt_message_to_7bit (BODY * a, FILE * fp) 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; @@ -982,7 +982,7 @@ static void transform_to_7bit (BODY * a, FILE * fpin) 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; @@ -1104,7 +1104,7 @@ BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg) (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; @@ -1487,9 +1487,9 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach, } 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()); } @@ -1528,18 +1528,18 @@ const char *mutt_fqdn(short may_hide_host) { 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; } } @@ -1642,7 +1642,7 @@ static char *mutt_gen_msgid (void) 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); @@ -2016,7 +2016,7 @@ static int _mutt_bounce_message (FILE * fp, HEADER * h, address_t * to, 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; @@ -2106,7 +2106,7 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, * 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); -- 2.20.1