summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-06-22 12:14:44 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-06-22 12:14:44 (GMT)
commit4ba3d95fe9bd9bb3b93be60a8ea89e381c5f88c0 (patch) (side-by-side diff)
tree9b6a3550bafa355ad27234953b143e21839db721
parent590669a524a5ee838e1a5056b1fcf6f48b059cbd (diff)
downloadmailutils-master.tar.gz
mailutils-master.tar.bz2
Use defines for internal mail variable namesHEADmaster
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--mail/alias.c2
-rw-r--r--mail/decode.c9
-rw-r--r--mail/delete.c2
-rw-r--r--mail/escape.c12
-rw-r--r--mail/file.c2
-rw-r--r--mail/folders.c2
-rw-r--r--mail/from.c7
-rw-r--r--mail/if.c2
-rw-r--r--mail/mail.c24
-rw-r--r--mail/mail.h77
-rw-r--r--mail/mailline.c2
-rw-r--r--mail/mailvar.c158
-rw-r--r--mail/pipe.c4
-rw-r--r--mail/print.c4
-rw-r--r--mail/quit.c15
-rw-r--r--mail/reply.c6
-rw-r--r--mail/send.c58
-rw-r--r--mail/shell.c7
-rw-r--r--mail/top.c2
-rw-r--r--mail/util.c36
20 files changed, 264 insertions, 167 deletions
diff --git a/mail/alias.c b/mail/alias.c
index e46cc9d..b695ef6 100644
--- a/mail/alias.c
+++ b/mail/alias.c
@@ -147,7 +147,7 @@ alias_expand (const char *name)
mu_list_t al;
mu_list_t list;
- if (mailvar_is_true ("recursivealiases"))
+ if (mailvar_is_true (mailvar_name_recursivealiases))
{
char *s;
mu_list_t origlist;
diff --git a/mail/decode.c b/mail/decode.c
index 15cfd09..869fe2f 100644
--- a/mail/decode.c
+++ b/mail/decode.c
@@ -244,7 +244,7 @@ display_submessage (struct mime_descend_closure *closure, void *data)
{
char *tmp;
- if (mailvar_get (&tmp, "metamail", mailvar_type_string, 0) == 0)
+ if (mailvar_get (&tmp, mailvar_name_metamail, mailvar_type_string, 0) == 0)
{
/* If `metamail' is set to a string, treat it as command line
of external metamail program. */
@@ -280,11 +280,11 @@ display_submessage (struct mime_descend_closure *closure, void *data)
/* If `metamail' is set to true, enable internal mailcap
support */
- if (mailvar_is_true ("metamail"))
+ if (mailvar_is_true (mailvar_name_metamail))
{
char *no_ask = NULL;
- mailvar_get (&no_ask, "mimenoask", mailvar_type_string, 0);
+ mailvar_get (&no_ask, mailvar_name_mimenoask, mailvar_type_string, 0);
builtin_display = display_stream_mailcap (NULL, stream, hdr, no_ask,
interactive, 0,
MU_DEBCAT_APP);
@@ -400,7 +400,8 @@ run_metamail (const char *mailcap_cmd, mu_message_t mesg)
char *no_ask;
setenv ("METAMAIL_PAGER", getenv ("PAGER"), 0);
- if (mailvar_get (&no_ask, "mimenoask", mailvar_type_string, 0))
+ if (mailvar_get (&no_ask, mailvar_name_mimenoask,
+ mailvar_type_string, 0))
setenv ("MM_NOASK", no_ask, 1);
status = mu_message_get_streamref (mesg, &stream);
diff --git a/mail/delete.c b/mail/delete.c
index 1f2192f..3448572 100644
--- a/mail/delete.c
+++ b/mail/delete.c
@@ -37,7 +37,7 @@ mail_delete (int argc, char **argv)
int rc = util_foreach_msg (argc, argv, MSG_NODELETED|MSG_SILENT,
mail_delete_msg, NULL);
- if (mailvar_is_true ("autoprint"))
+ if (mailvar_is_true (mailvar_name_autoprint))
util_do_command("print");
return rc;
diff --git a/mail/escape.c b/mail/escape.c
index 4dffcd5..bb0f7f0 100644
--- a/mail/escape.c
+++ b/mail/escape.c
@@ -69,7 +69,7 @@ escape_check_args (int argc, char **argv, int minargs, int maxargs)
if (argc < minargs)
{
minargs--;
- mailvar_get (&escape, "escape", mailvar_type_string, 0);
+ mailvar_get (&escape, mailvar_name_escape, mailvar_type_string, 0);
mu_error (ngettext ("%c%s requires at least %d argument",
"%c%s requires at least %d arguments",
minargs), escape[0], argv[0], minargs);
@@ -78,7 +78,7 @@ escape_check_args (int argc, char **argv, int minargs, int maxargs)
if (maxargs > 1 && argc > maxargs)
{
maxargs--;
- mailvar_get (&escape, "escape", mailvar_type_string, 0);
+ mailvar_get (&escape, mailvar_name_escape, mailvar_type_string, 0);
mu_error (ngettext ("%c%s accepts at most %d argument",
"%c%s accepts at most %d arguments",
maxargs), escape[0], argv[0], maxargs);
@@ -144,7 +144,9 @@ escape_sign (int argc MU_ARG_UNUSED, char **argv, compose_env_t *env)
{
char *p;
- if (mailvar_get (&p, mu_isupper (argv[0][0]) ? "Sign" : "sign",
+ if (mailvar_get (&p,
+ mu_isupper (argv[0][0])
+ ? mailvar_name_Sign : mailvar_name_sign,
mailvar_type_string, 1) == 0)
{
mu_stream_printf (env->compstr, "-- \n");
@@ -272,7 +274,7 @@ escape_run_editor (char *ed, int argc, char **argv, compose_env_t *env)
}
mu_stream_seek (env->compstr, 0, MU_SEEK_SET, NULL);
- if (mailvar_is_true ("editheaders"))
+ if (mailvar_is_true (mailvar_name_editheaders))
{
dump_headers (tempstream, env);
@@ -407,7 +409,7 @@ quote0 (msgset_t *mspec, mu_message_t mesg, void *data)
mu_printf (_("Interpolating: %lu\n"),
(unsigned long) mspec->msg_part[0]);
- mailvar_get (&prefix, "indentprefix", mailvar_type_string, 0);
+ mailvar_get (&prefix, mailvar_name_indentprefix, mailvar_type_string, 0);
argv[0] = "INLINE-COMMENT";
argv[1] = prefix;
diff --git a/mail/file.c b/mail/file.c
index 98efaca..d7bd41b 100644
--- a/mail/file.c
+++ b/mail/file.c
@@ -141,7 +141,7 @@ mail_file (int argc, char **argv)
mbox = newbox;
mu_mailbox_messages_count (mbox, &total);
set_cursor (1);
- if (mailvar_is_true ("header"))
+ if (mailvar_is_true (mailvar_name_header))
{
util_do_command ("summary");
util_do_command ("headers");
diff --git a/mail/folders.c b/mail/folders.c
index 98ca45c..271eb56 100644
--- a/mail/folders.c
+++ b/mail/folders.c
@@ -25,7 +25,7 @@ mail_folders (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
char *path;
- if (mailvar_get (&path, "folder", mailvar_type_string, 1))
+ if (mailvar_get (&path, mailvar_name_folder, mailvar_type_string, 1))
return 1;
if (path[0] != '/' && path[0] != '~')
diff --git a/mail/from.c b/mail/from.c
index a9ee08f..607d4f0 100644
--- a/mail/from.c
+++ b/mail/from.c
@@ -193,7 +193,7 @@ hdr_date (struct header_call_args *args, void *data)
mu_message_get_header (args->msg, &hdr);
date[0] = 0;
- if (mailvar_is_true ("datefield")
+ if (mailvar_is_true (mailvar_name_datefield)
&& mu_header_get_value (hdr, MU_HEADER_DATE,
date, sizeof (date), NULL) == 0)
{
@@ -224,7 +224,7 @@ sender_string (mu_message_t msg)
{
char *from = NULL;
- if (mailvar_is_true ("fromfield"))
+ if (mailvar_is_true (mailvar_name_fromfield))
{
mu_header_t hdr;
@@ -239,7 +239,8 @@ sender_string (mu_message_t msg)
if (mu_address_sget_email (address, 1, &email) == 0 && email)
{
- if (mailvar_is_true ("showto") && mail_is_my_name (email))
+ if (mailvar_is_true (mailvar_name_showto)
+ && mail_is_my_name (email))
{
char *tmp;
diff --git a/mail/if.c b/mail/if.c
index da6eff9..eaa7746 100644
--- a/mail/if.c
+++ b/mail/if.c
@@ -95,7 +95,7 @@ mail_if (int argc, char **argv)
return 1;
}
- if (mailvar_get (&mode, "mode", mailvar_type_string, 1))
+ if (mailvar_get (&mode, mailvar_name_mode, mailvar_type_string, 1))
exit (EXIT_FAILURE);
if (if_cond() == 0)
diff --git a/mail/mail.c b/mail/mail.c
index 6feb049..b4d8f1d 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -319,7 +319,8 @@ mail_cmdline (void *closure, int cont MU_ARG_UNUSED)
while (1)
{
- if (mailvar_is_true ("autoinc") && !mu_mailbox_is_updated (mbox))
+ if (mailvar_is_true (mailvar_name_autoinc)
+ && !mu_mailbox_is_updated (mbox))
{
mu_mailbox_messages_count (mbox, &total);
page_invalidate (0);
@@ -334,7 +335,7 @@ mail_cmdline (void *closure, int cont MU_ARG_UNUSED)
continue;
}
- if (!rc && mailvar_is_true ("ignoreeof"))
+ if (!rc && mailvar_is_true (mailvar_name_ignoreeof))
{
mu_error (_("Use \"quit\" to quit."));
continue;
@@ -482,7 +483,7 @@ main (int argc, char **argv)
util_do_command ("set columns=%d", util_getcols ());
/* Set the default mailer to sendmail. */
- mailvar_set ("sendmail",
+ mailvar_set (mailvar_name_sendmail,
mu_strdup ("sendmail:" PATH_SENDMAIL), mailvar_type_string,
MOPTF_OVERWRITE);
@@ -537,7 +538,7 @@ main (int argc, char **argv)
/* read system-wide mail.rc and user's .mailrc */
- if (mailvar_is_true ("rc"))
+ if (mailvar_is_true (mailvar_name_rc))
util_do_command ("source %s", SITE_MAIL_RC);
if ((p = getenv ("MAILRC")) && *p)
util_do_command ("source %s", getenv ("MAILRC"));
@@ -566,7 +567,7 @@ main (int argc, char **argv)
}
/* how should we be running? */
- if (mailvar_get (&mode, "mode", mailvar_type_string, 1))
+ if (mailvar_get (&mode, mailvar_name_mode, mailvar_type_string, 1))
exit (EXIT_FAILURE);
/* Interactive mode */
@@ -582,7 +583,7 @@ main (int argc, char **argv)
mu_argcv_string (argc, argv, &buf);
rc = util_do_command ("mail %s", buf);
- return mailvar_is_true ("mailx") ? 0 : rc;
+ return mailvar_is_true (mailvar_name_mailx) ? 0 : rc;
}
/* Or acting as a normal reader */
else
@@ -652,13 +653,14 @@ main (int argc, char **argv)
else if (strcmp (mode, "read"))
{
mu_error (_("Unknown mode `%s'"), mode);
- util_do_command ("quit");
+ util_do_command (mailvar_name_quit);
return 1;
}
}
if (total == 0
- && (strcmp (mode, "read") || !mailvar_is_true ("emptystart")))
+ && (strcmp (mode, "read")
+ || !mailvar_is_true (mailvar_name_emptystart)))
{
if (secondary_url)
mail_summary (0, NULL);
@@ -668,16 +670,16 @@ main (int argc, char **argv)
}
/* initial commands */
- if (mailvar_is_true ("header"))
+ if (mailvar_is_true (mailvar_name_header))
{
util_do_command ("summary");
util_do_command ("headers");
}
- mailvar_get (&prompt, "prompt", mailvar_type_string, 0);
+ mailvar_get (&prompt, mailvar_name_prompt, mailvar_type_string, 0);
mail_mainloop (mail_cmdline, (void*) prompt, 1);
mu_printf ("\n");
- util_do_command ("quit");
+ util_do_command (mailvar_name_quit);
return 0;
}
/* We should never reach this point */
diff --git a/mail/mail.h b/mail/mail.h
index f878e29..081cc37 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -132,7 +132,7 @@ struct mail_escape_entry
const char *synopsis;
int (*escfunc) (int, char **, compose_env_t *);
};
-
+
enum mailvar_type
{
mailvar_type_whatever,
@@ -156,6 +156,81 @@ struct mailvar_variable
union mailvar_value value;
};
+/* Internal variable names */
+#define mailvar_name_allnet "allnet"
+#define mailvar_name_append "append"
+#define mailvar_name_appenddeadletter "appenddeadletter"
+#define mailvar_name_askbcc "askbcc"
+#define mailvar_name_askcc "askcc"
+#define mailvar_name_ask "ask"
+#define mailvar_name_asksub "asksub"
+#define mailvar_name_autoinc "autoinc"
+#define mailvar_name_autoprint "autoprint"
+#define mailvar_name_byname "byname"
+#define mailvar_name_bang "bang"
+#define mailvar_name_charset "charset"
+#define mailvar_name_cmd "cmd"
+#define mailvar_name_columns "columns"
+#define mailvar_name_crt "crt"
+#define mailvar_name_datefield "datefield"
+#define mailvar_name_debug "debug"
+#define mailvar_name_decode_fallback "decode-fallback"
+#define mailvar_name_dot "dot"
+#define mailvar_name_editheaders "editheaders"
+#define mailvar_name_emptystart "emptystart"
+#define mailvar_name_escape "escape"
+#define mailvar_name_flipr "flipr"
+#define mailvar_name_folder "folder"
+#define mailvar_name_fromfield "fromfield"
+#define mailvar_name_gnu_last_command "gnu-last-command"
+#define mailvar_name_header "header"
+#define mailvar_name_headline "headline"
+#define mailvar_name_hold "hold"
+#define mailvar_name_ignore "ignore"
+#define mailvar_name_ignoreeof "ignoreeof"
+#define mailvar_name_indentprefix "indentprefix"
+#define mailvar_name_inplacealiases "inplacealiases"
+#define mailvar_name_keep "keep"
+#define mailvar_name_keepsave "keepsave"
+#define mailvar_name_mailx "mailx"
+#define mailvar_name_metamail "metamail"
+#define mailvar_name_metoo "metoo"
+#define mailvar_name_mimenoask "mimenoask"
+#define mailvar_name_mode "mode"
+#define mailvar_name_nullbody "nullbody"
+#define mailvar_name_nullbodymsg "nullbodymsg"
+#define mailvar_name_outfolder "outfolder"
+#define mailvar_name_page "page"
+#define mailvar_name_prompt "prompt"
+#define mailvar_name_quit "quit"
+#define mailvar_name_rc "rc"
+#define mailvar_name_readonly "readonly"
+#define mailvar_name_record "record"
+#define mailvar_name_recursivealiases "recursivealiases"
+#define mailvar_name_regex "regex"
+#define mailvar_name_replyprefix "replyprefix"
+#define mailvar_name_replyregex "replyregex"
+#define mailvar_name_return_address "return-address"
+#define mailvar_name_save "save"
+#define mailvar_name_screen "screen"
+#define mailvar_name_sendmail "sendmail"
+#define mailvar_name_sendwait "sendwait"
+#define mailvar_name_sign "sign"
+#define mailvar_name_Sign "Sign"
+#define mailvar_name_showenvelope "showenvelope"
+#define mailvar_name_showto "showto"
+#define mailvar_name_toplines "toplines"
+#define mailvar_name_variable_pretty_print "variable-pretty-print"
+#define mailvar_name_varpp "varpp"
+#define mailvar_name_variable_strict "variable-strict"
+#define mailvar_name_varstrict "varstrict"
+#define mailvar_name_verbose "verbose"
+#define mailvar_name_xmailer "xmailer"
+#define mailvar_name_mime "mime"
+#define mailvar_name_onehop "onehop"
+#define mailvar_name_quiet "quiet"
+#define mailvar_name_PID "PID"
+
typedef struct message_set msgset_t;
struct message_set
diff --git a/mail/mailline.c b/mail/mailline.c
index 610fee2..647cb1e 100644
--- a/mail/mailline.c
+++ b/mail/mailline.c
@@ -33,7 +33,7 @@ sig_handler (int signo)
switch (signo)
{
case SIGINT:
- if (mailvar_is_true ("quit"))
+ if (mailvar_is_true (mailvar_name_quit))
exit (0);
_interrupted++;
break;
diff --git a/mail/mailvar.c b/mail/mailvar.c
index f5f1b6d..e39ea72 100644
--- a/mail/mailvar.c
+++ b/mail/mailvar.c
@@ -56,248 +56,251 @@ static int set_headline (enum mailvar_cmd,
struct mailvar_symbol mailvar_tab[] =
{
/* FIXME: */
- { { "allnet", }, MAILVAR_HIDDEN },
+ { { mailvar_name_allnet, }, MAILVAR_HIDDEN },
/* For compatibility with other mailx implementations.
Never used, always true. */
- { { "append", },
+ { { mailvar_name_append, },
MAILVAR_TYPEMASK (mailvar_type_boolean) | MAILVAR_RDONLY,
N_("messages saved in mbox are appended to the end rather than prepended") },
- { { "appenddeadletter", },
+ { { mailvar_name_appenddeadletter, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("append the contents of canceled letter to dead.letter file") },
- { { "askbcc", },
+ { { mailvar_name_askbcc, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("prompt user for bcc before composing the message") },
- { { "askcc", },
+ { { mailvar_name_askcc, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("prompt user for cc before composing the message") },
- { { "ask", },
+ { { mailvar_name_ask, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("prompt user for subject before composing the message") },
- { { "asksub", }, MAILVAR_ALIAS, NULL },
- { { "autoinc", },
+ { { mailvar_name_asksub, }, MAILVAR_ALIAS, NULL },
+ { { mailvar_name_autoinc, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("automatically incorporate newly arrived messages")},
- { { "autoprint", },
+ { { mailvar_name_autoprint, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("delete command behaves like dp") },
- { { "byname" },
+ { { mailvar_name_byname },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("record outgoing messages in a file named after the first recipient; "
"overrides the `record' variable") },
- { { "bang", },
+ { { mailvar_name_bang, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("replace every occurrence of ! in arguments to the shell command"
" with the last executed command") },
- { { "charset", },
+ { { mailvar_name_charset, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("output character set for decoded header fields") },
- { { "cmd", },
+ { { mailvar_name_cmd, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("default shell command for pipe") },
- { { "columns", },
+ { { mailvar_name_columns, },
MAILVAR_TYPEMASK (mailvar_type_number),
N_("number of columns on terminal screen") },
- { { "crt", },
+ { { mailvar_name_crt, },
MAILVAR_TYPEMASK (mailvar_type_number) |
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("if numeric, sets the minimum number of output lines needed "
"to engage paging; if boolean, use the height of the terminal "
"screen to compute the threshold") },
- { { "datefield", },
+ { { mailvar_name_datefield, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("get date from the `Date:' header, instead of the envelope") },
- { { "debug", },
+ { { mailvar_name_debug, },
MAILVAR_TYPEMASK (mailvar_type_string) |
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("set Mailutils debug level"),
set_debug },
- { { "decode-fallback", },
+ { { mailvar_name_decode_fallback, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("how to represent characters that cannot be rendered using the "
"current character set"),
set_decode_fallback },
- { { "dot", },
+ { { mailvar_name_dot, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("input message is terminated with a dot alone on a line") },
- { { "editheaders", },
+ { { mailvar_name_editheaders, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("allow editing message headers while composing") },
- { { "emptystart", },
+ { { mailvar_name_emptystart, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("start interactive mode if the mailbox is empty") },
- { { "escape", },
+ { { mailvar_name_escape, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("character denoting escapes") },
- { { "flipr", },
+ { { mailvar_name_flipr, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("swap the meaning of reply and Reply commands") },
- { { "folder", },
+ { { mailvar_name_folder, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("folder directory name"),
set_folder },
- { { "fromfield", },
+ { { mailvar_name_fromfield, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("get sender address from the `From:' header, instead of "
"the envelope") },
- { { "gnu-last-command", },
+ { { mailvar_name_gnu_last_command, },
MAILVAR_TYPEMASK (mailvar_type_string) | MAILVAR_RDONLY,
N_("last executed command line") },
- { { "header", },
+ { { mailvar_name_header, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("run the `headers' command after entering interactive mode") },
- { { "headline", },
+ { { mailvar_name_headline, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("format string to use for the header summary"),
set_headline },
- { { "hold", },
+ { { mailvar_name_hold, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("hold the read or saved messages in the system mailbox") },
- { { "ignore", },
+ { { mailvar_name_ignore, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("ignore keyboard interrupts when composing messages") },
- { { "ignoreeof", },
+ { { mailvar_name_ignoreeof, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("ignore EOF character") },
- { { "indentprefix", },
+ { { mailvar_name_indentprefix, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("string used by the ~m escape for indenting quoted messages") },
- { { "inplacealiases", },
+ { { mailvar_name_inplacealiases, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("expand aliases in the address header field "
"before starting composing the message") },
/* For compatibility with other mailx implementations.
Never used, always true. */
- { { "keep", },
+ { { mailvar_name_keep, },
MAILVAR_TYPEMASK (mailvar_type_boolean) | MAILVAR_RDONLY,
N_("keep the empty user's system mailbox,"
" instead of removing it") },
- { { "keepsave", },
+ { { mailvar_name_keepsave, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("keep saved messages in system mailbox too") },
- { { "mailx", },
+ { { mailvar_name_mailx, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("enable mailx compatibility mode") },
- { { "metamail", },
+ { { mailvar_name_metamail, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("interpret the content of message parts; if set to a string "
"specifies the name of the external metamail command") },
- { { "metoo", },
+ { { mailvar_name_metoo, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("do not remove sender addresses from the recipient list") },
- { { "mimenoask", },
+ { { mailvar_name_mimenoask, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("a comma-separated list of MIME types for which "
"no confirmation is needed before running metamail interpreter") },
- { { "mode", },
+ { { mailvar_name_mode, },
MAILVAR_TYPEMASK (mailvar_type_string) | MAILVAR_RDONLY,
N_("the name of current operation mode") },
- { { "nullbody", },
+ { { mailvar_name_nullbody, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("accept messages with an empty body") },
- { { "nullbodymsg", },
+ { { mailvar_name_nullbodymsg, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("display this text when sending a message with empty body") },
- { { "outfolder", },
+ { { mailvar_name_outfolder, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("keep created files in this folder") },
- { { "page", },
+ { { mailvar_name_page, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("pipe command terminates each message with a formfeed") },
- { { "prompt", },
+ { { mailvar_name_prompt, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("command prompt sequence") },
- { { "quit", },
+ { { mailvar_name_quit, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("keyboard interrupts terminate the program") },
- { { "rc", },
+ { { mailvar_name_rc, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("read the system-wide configuration file upon startup") },
- { { "readonly", },
+ { { mailvar_name_readonly, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("mailboxes are opened in readonly mode") },
- { { "record", },
+ { { mailvar_name_record, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("save outgoing messages in this file") },
- { { "recursivealiases", },
+ { { mailvar_name_recursivealiases, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("recursively expand aliases") },
- { { "regex", },
+ { { mailvar_name_regex, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("use of regular expressions in search message specifications") },
- { { "replyprefix", },
+ { { mailvar_name_replyprefix, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("prefix for the subject line of a reply message") },
- { { "replyregex", },
+ { { mailvar_name_replyregex, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("regexp for recognizing subject lines of reply messages"),
set_replyregex },
- { { "return-address" },
+ { { mailvar_name_return_address },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("return address for outgoing messages") },
- { { "save", },
+ { { mailvar_name_save, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("store aborted messages in the user's dead.file") },
- { { "screen", },
+ { { mailvar_name_screen, },
MAILVAR_TYPEMASK (mailvar_type_number),
N_("number of lines on terminal screen"),
set_screen },
- { { "sendmail", },
+ { { mailvar_name_sendmail, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("URL of the mail transport agent") },
/* FIXME: Not yet used. */
- { { "sendwait", },
+ { { mailvar_name_sendwait, },
MAILVAR_TYPEMASK (mailvar_type_boolean) | MAILVAR_HIDDEN, NULL },
- { { "sign", },
+ { { mailvar_name_sign, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("signature for use with the ~a command") },
- { { "Sign", },
+ { { mailvar_name_Sign, },
MAILVAR_TYPEMASK (mailvar_type_string),
N_("name of the signature file for use with the ~A command") },
- { { "showenvelope", },
+ { { mailvar_name_showenvelope, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("`print' command includes the SMTP envelope in its output") },
- { { "showto", },
+ { { mailvar_name_showto, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("if the message was sent by me, print its recipient address "
"in the header summary") },
- { { "toplines", },
+ { { mailvar_name_toplines, },
MAILVAR_TYPEMASK (mailvar_type_number),
N_("number of lines to be displayed by `top' or `Top'") },
- { { "variable-pretty-print", },
+ { { mailvar_name_variable_pretty_print, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("print variables with short descriptions") },
- { { "varpp", }, MAILVAR_ALIAS },
- { { "variable-strict", },
+ { { mailvar_name_varpp, }, MAILVAR_ALIAS },
+ { { mailvar_name_variable_strict, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("perform strict checking when setting variables") },
- { { "varstrict", }, MAILVAR_ALIAS },
- { { "verbose", },
+ { { mailvar_name_varstrict, }, MAILVAR_ALIAS },
+ { { mailvar_name_verbose, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("verbosely trace the process of message delivery"),
set_verbose },
- { { "xmailer", },
+ { { mailvar_name_xmailer, },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("add the `X-Mailer' header to the outgoing messages") },
- { { "mime" },
+ { { mailvar_name_mime },
MAILVAR_TYPEMASK (mailvar_type_boolean),
N_("always compose MIME messages") },
/* These will be implemented later */
- { { "onehop", }, MAILVAR_HIDDEN, NULL },
+ { { mailvar_name_onehop, }, MAILVAR_HIDDEN, NULL },
- { { "quiet", }, MAILVAR_TYPEMASK (mailvar_type_boolean) | MAILVAR_HIDDEN,
+ { { mailvar_name_quiet, },
+ MAILVAR_TYPEMASK (mailvar_type_boolean) | MAILVAR_HIDDEN,
N_("suppress the printing of the version when first invoked") },
- { { "PID" }, MAILVAR_TYPEMASK (mailvar_type_string) | MAILVAR_RDONLY,
+ { { mailvar_name_PID },
+ MAILVAR_TYPEMASK (mailvar_type_string) | MAILVAR_RDONLY,
N_("PID of this process") },
{ { NULL }, }
};
-static int mailvar_symbol_count = sizeof (mailvar_tab) / sizeof (mailvar_tab[0]) - 1;
+static int mailvar_symbol_count =
+ sizeof (mailvar_tab) / sizeof (mailvar_tab[0]) - 1;
struct mailvar_symbol *
find_mailvar_symbol (const char *var)
@@ -322,8 +325,7 @@ print_descr (mu_stream_t out, const char *s, int n,
if (!s)
return;
- mu_stream_set_stat (out, MU_STREAM_STAT_MASK (MU_STREAM_STAT_OUT),
- stat);
+ mu_stream_set_stat (out, MU_STREAM_STAT_MASK (MU_STREAM_STAT_OUT), stat);
stat[MU_STREAM_STAT_OUT] = n;
do
{
@@ -508,7 +510,7 @@ mailvar_set (const char *variable, void *value, enum mailvar_type type,
enum mailvar_cmd cmd =
(flags & MOPTF_UNSET) ? mailvar_cmd_unset : mailvar_cmd_set;
- if (!(flags & MOPTF_QUIET) && mailvar_is_true ("variable-strict"))
+ if (!(flags & MOPTF_QUIET) && mailvar_is_true (mailvar_name_variable_strict))
{
if (!sym)
mu_diag_output (MU_DIAG_WARNING, _("setting unknown variable %s"),
@@ -919,7 +921,7 @@ mailvar_print (int set)
varlist = mailvar_list_copy (set);
mu_list_count (varlist, &count);
clos.out = open_pager (count);
- clos.prettyprint = mailvar_is_true ("variable-pretty-print");
+ clos.prettyprint = mailvar_is_true (mailvar_name_variable_pretty_print);
clos.width = util_screen_columns ();
mu_list_foreach (varlist, mailvar_printer, &clos);
diff --git a/mail/pipe.c b/mail/pipe.c
index 708a01e..af8f23d 100644
--- a/mail/pipe.c
+++ b/mail/pipe.c
@@ -31,7 +31,7 @@ mail_pipe (int argc, char **argv)
if (argc > 1)
cmd = argv[--argc];
- else if (mailvar_get (&cmd, "cmd", mailvar_type_string, 1))
+ else if (mailvar_get (&cmd, mailvar_name_cmd, mailvar_type_string, 1))
return 1;
if (msgset_parse (argc, argv, MSG_NODELETED|MSG_SILENT, &list))
@@ -54,7 +54,7 @@ mail_pipe (int argc, char **argv)
mu_message_get_streamref (msg, &stream);
mu_stream_copy (outstr, stream, 0, NULL);
mu_stream_destroy (&stream);
- if (mailvar_is_true ("page"))
+ if (mailvar_is_true (mailvar_name_page))
mu_stream_write (outstr, "\f\n", 2, NULL);
}
util_mark_read (msg);
diff --git a/mail/print.c b/mail/print.c
index 37371c0..e2e97a6 100644
--- a/mail/print.c
+++ b/mail/print.c
@@ -35,7 +35,7 @@ mail_print_msg (msgset_t *mspec, mu_message_t mesg, void *data)
int status;
mu_message_lines (mesg, &lines);
- if (mailvar_is_true ("showenvelope"))
+ if (mailvar_is_true (mailvar_name_showenvelope))
lines++;
/* If it is POP or IMAP the lines number is not known, so try
@@ -56,7 +56,7 @@ mail_print_msg (msgset_t *mspec, mu_message_t mesg, void *data)
out = open_pager (lines);
- if (mailvar_is_true ("showenvelope"))
+ if (mailvar_is_true (mailvar_name_showenvelope))
print_stream_envelope (out, mspec, mesg, "From");
if (*(int *) data) /* print was called with a lowercase 'p' */
diff --git a/mail/quit.c b/mail/quit.c
index 7d964b8..2e8b5a1 100644
--- a/mail/quit.c
+++ b/mail/quit.c
@@ -38,7 +38,7 @@ mail_mbox_close ()
if (!mbox)
return 0;
- if (!mailvar_is_true ("readonly"))
+ if (!mailvar_is_true (mailvar_name_readonly))
{
if (mail_mbox_commit ())
return 1;
@@ -66,8 +66,8 @@ mail_mbox_commit ()
int saved_count = 0;
mu_message_t msg;
mu_attribute_t attr;
- int keepsave = mailvar_is_true ("keepsave");
- int hold = mailvar_is_true ("hold");
+ int keepsave = mailvar_is_true (mailvar_name_keepsave);
+ int hold = mailvar_is_true (mailvar_name_hold);
mu_url_t url;
int is_user_mbox;
@@ -104,8 +104,10 @@ mail_mbox_commit ()
&& ((mu_attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED)
&& keepsave)
|| (!mu_attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED)
- && (mu_attribute_is_userflag (attr, MAIL_ATTRIBUTE_SHOWN)
- || mu_attribute_is_userflag (attr, MAIL_ATTRIBUTE_TOUCHED)))))))
+ && (mu_attribute_is_userflag (attr,
+ MAIL_ATTRIBUTE_SHOWN)
+ || mu_attribute_is_userflag (attr,
+ MAIL_ATTRIBUTE_TOUCHED)))))))
{
int status;
@@ -120,7 +122,8 @@ mail_mbox_commit ()
return 1;
}
if ((status = mu_mailbox_open (dest_mbox,
- MU_STREAM_WRITE | MU_STREAM_CREAT))!=0)
+ MU_STREAM_WRITE | MU_STREAM_CREAT))
+ != 0)
{
mu_error (_("Cannot open mailbox %s: %s"), name,
mu_strerror (status));
diff --git a/mail/reply.c b/mail/reply.c
index 42c876a..80ae4f8 100644
--- a/mail/reply.c
+++ b/mail/reply.c
@@ -82,7 +82,7 @@ reply0 (msgset_t *mspec, mu_message_t msg, void *data)
const char *email;
if (mu_address_sget_email (addr, i, &email) || email == NULL)
continue;
- if (mailvar_is_true ("metoo") || !mail_is_my_name (email))
+ if (mailvar_is_true (mailvar_name_metoo) || !mail_is_my_name (email))
compose_header_set (&env, MU_HEADER_TO,
email,
COMPOSE_SINGLE_LINE);
@@ -119,7 +119,7 @@ reply0 (msgset_t *mspec, mu_message_t msg, void *data)
make_in_reply_to (&env, msg);
make_references (&env, msg);
- status = mail_send0 (&env, mailvar_is_true ("byname"));
+ status = mail_send0 (&env, mailvar_is_true (mailvar_name_byname));
compose_destroy (&env);
return status;
@@ -129,7 +129,7 @@ int
mail_reply (int argc, char **argv)
{
int lower = mu_islower (argv[0][0]);
- if (mailvar_is_true ("flipr"))
+ if (mailvar_is_true (mailvar_name_flipr))
lower = !lower;
return util_foreach_msg (argc, argv, MSG_NODELETED, reply0, &lower);
}
diff --git a/mail/send.c b/mail/send.c
index e33c44b..ae2cbb7 100644
--- a/mail/send.c
+++ b/mail/send.c
@@ -556,7 +556,7 @@ add_attachments (compose_env_t *env, mu_message_t *pmsg)
inmsg = *pmsg;
- if (mailvar_is_true ("mime") && add_body (inmsg, env))
+ if (mailvar_is_true (mailvar_name_mime) && add_body (inmsg, env))
return 1;
if (mu_list_is_empty (env->attlist))
@@ -639,10 +639,10 @@ add_attachments (compose_env_t *env, mu_message_t *pmsg)
static void
read_cc_bcc (compose_env_t *env)
{
- if (mailvar_is_true ("askcc"))
+ if (mailvar_is_true (mailvar_name_askcc))
compose_header_set (env, MU_HEADER_CC,
ml_readline_with_intr ("Cc: "), COMPOSE_REPLACE);
- if (mailvar_is_true ("askbcc"))
+ if (mailvar_is_true (mailvar_name_askbcc))
compose_header_set (env, MU_HEADER_BCC,
ml_readline_with_intr ("Bcc: "), COMPOSE_REPLACE);
}
@@ -675,7 +675,7 @@ mail_send (int argc, char **argv)
if (interactive)
compose_header_set (&env, MU_HEADER_TO, ml_readline_with_intr ("To: "),
COMPOSE_REPLACE);
- else if (mailvar_is_true ("editheaders"))
+ else if (mailvar_is_true (mailvar_name_editheaders))
{
if (parse_headers (mu_strin, &env) != parse_headers_ok)
{
@@ -730,10 +730,10 @@ mail_send (int argc, char **argv)
if (interactive)
{
- if (!mailvar_is_true ("mailx"))
+ if (!mailvar_is_true (mailvar_name_mailx))
read_cc_bcc (&env);
- if (mailvar_is_true ("asksub"))
+ if (mailvar_is_true (mailvar_name_asksub))
compose_header_set (&env, MU_HEADER_SUBJECT,
ml_readline_with_intr ("Subject: "),
COMPOSE_REPLACE);
@@ -879,7 +879,8 @@ compose_header_set (compose_env_t *env, const char *name,
switch (mode)
{
case COMPOSE_REPLACE:
- if (is_address_field (name) && mailvar_is_true ("inplacealiases"))
+ if (is_address_field (name)
+ && mailvar_is_true (mailvar_name_inplacealiases))
{
char *exp = alias_expand (value);
status = mu_header_set_value (env->header, name, exp ? exp : value, 1);
@@ -890,7 +891,8 @@ compose_header_set (compose_env_t *env, const char *name,
break;
case COMPOSE_APPEND:
- if (is_address_field (name) && mailvar_is_true ("inplacealiases"))
+ if (is_address_field (name)
+ && mailvar_is_true (mailvar_name_inplacealiases))
{
char *exp = alias_expand (value);
status = mu_header_append (env->header, name, exp ? exp : value);
@@ -904,7 +906,8 @@ compose_header_set (compose_env_t *env, const char *name,
if (mu_header_aget_value (env->header, name, &old_value) == 0
&& old_value[0])
{
- if (is_address_field (name) && mailvar_is_true ("inplacealiases"))
+ if (is_address_field (name)
+ && mailvar_is_true (mailvar_name_inplacealiases))
{
char *exp = alias_expand (value);
status = util_merge_addresses (&old_value, exp ? exp : value);
@@ -988,10 +991,11 @@ fill_body (mu_message_t msg, mu_stream_t instr)
if (n == 0)
{
- if (mailvar_is_true ("nullbody"))
+ if (mailvar_is_true (mailvar_name_nullbody))
{
char *str;
- if (mailvar_get (&str, "nullbodymsg", mailvar_type_string, 0) == 0)
+ if (mailvar_get (&str, mailvar_name_nullbodymsg,
+ mailvar_type_string, 0) == 0)
mu_error ("%s", _(str));
}
else
@@ -1004,7 +1008,7 @@ fill_body (mu_message_t msg, mu_stream_t instr)
static int
save_dead_message_env (compose_env_t *env)
{
- if (mailvar_is_true ("save"))
+ if (mailvar_is_true (mailvar_name_save))
{
mu_stream_t dead_letter, str;
int rc;
@@ -1022,7 +1026,7 @@ save_dead_message_env (compose_env_t *env)
mu_error (_("Cannot open file %s: %s"), name, strerror (rc));
return 1;
}
- if (mailvar_is_true ("appenddeadletter"))
+ if (mailvar_is_true (mailvar_name_appenddeadletter))
mu_stream_seek (dead_letter, 0, MU_SEEK_END, NULL);
else
mu_stream_truncate (dead_letter, 0);
@@ -1055,7 +1059,7 @@ save_dead_message_env (compose_env_t *env)
static int
save_dead_message (mu_message_t msg)
{
- if (mailvar_is_true ("save"))
+ if (mailvar_is_true (mailvar_name_save))
{
mu_stream_t dead_letter, str;
int rc;
@@ -1073,7 +1077,7 @@ save_dead_message (mu_message_t msg)
mu_error (_("Cannot open file %s: %s"), name, strerror (rc));
return 1;
}
- if (mailvar_is_true ("appenddeadletter"))
+ if (mailvar_is_true (mailvar_name_appenddeadletter))
mu_stream_seek (dead_letter, 0, MU_SEEK_END, NULL);
else
mu_stream_truncate (dead_letter, 0);
@@ -1104,7 +1108,8 @@ send_message (mu_message_t msg)
char *sendmail;
int status;
- if (mailvar_get (&sendmail, "sendmail", mailvar_type_string, 0) == 0)
+ if (mailvar_get (&sendmail, mailvar_name_sendmail,
+ mailvar_type_string, 0) == 0)
{
if (sendmail[0] == '/')
status = msg_to_pipe (sendmail, msg);
@@ -1118,7 +1123,7 @@ send_message (mu_message_t msg)
const char *return_address_str;
mu_address_t return_address = NULL;
- if (mailvar_get (&return_address_str, "return-address",
+ if (mailvar_get (&return_address_str, mailvar_name_return_address,
mailvar_type_string, 0) == 0)
{
status = mu_address_create (&return_address,
@@ -1132,7 +1137,7 @@ send_message (mu_message_t msg)
}
}
- if (mailvar_is_true ("verbose"))
+ if (mailvar_is_true (mailvar_name_verbose))
{
mu_debug_set_category_level (MU_DEBCAT_MAILER,
MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
@@ -1167,7 +1172,7 @@ send_message (mu_message_t msg)
If the variable "record" is set, the outgoing message is
saved after being sent. If "save_to" argument is non-zero,
the name of the save file is derived from "to" argument. Otherwise,
- it is taken from the value of "record" variable.
+ it is taken from the value of the "record" variable.
sendmail
@@ -1203,7 +1208,7 @@ mail_send0 (compose_env_t *env, int save_to)
if (ml_got_interrupt ())
{
- if (mailvar_is_true ("ignore"))
+ if (mailvar_is_true (mailvar_name_ignore))
{
mu_printf ("@\n");
}
@@ -1220,9 +1225,9 @@ mail_send0 (compose_env_t *env, int save_to)
if (!buf)
{
- if (interactive && mailvar_is_true ("ignoreeof"))
+ if (interactive && mailvar_is_true (mailvar_name_ignoreeof))
{
- mu_error (mailvar_is_true ("dot")
+ mu_error (mailvar_is_true (mailvar_name_dot)
? _("Use \".\" to terminate letter.")
: _("Use \"~.\" to terminate letter."));
continue;
@@ -1233,9 +1238,10 @@ mail_send0 (compose_env_t *env, int save_to)
int_cnt = 0;
- if (strcmp (buf, ".") == 0 && mailvar_is_true ("dot"))
+ if (strcmp (buf, ".") == 0 && mailvar_is_true (mailvar_name_dot))
done = 1;
- else if (mailvar_get (&escape, "escape", mailvar_type_string, 0) == 0
+ else if (mailvar_get (&escape, mailvar_name_escape,
+ mailvar_type_string, 0) == 0
&& buf[0] == escape[0])
{
if (buf[1] == buf[0])
@@ -1289,11 +1295,11 @@ mail_send0 (compose_env_t *env, int save_to)
/* In mailx compatibility mode, ask for Cc and Bcc after editing
the body of the message */
- if (mailvar_is_true ("mailx"))
+ if (mailvar_is_true (mailvar_name_mailx))
read_cc_bcc (env);
/* Prepare the header */
- if (mailvar_is_true ("xmailer"))
+ if (mailvar_is_true (mailvar_name_xmailer))
mu_header_set_value (env->header, MU_HEADER_X_MAILER, program_version, 1);
if (util_header_expand (&env->header) == 0)
diff --git a/mail/shell.c b/mail/shell.c
index 14d2dac..997414d 100644
--- a/mail/shell.c
+++ b/mail/shell.c
@@ -77,12 +77,13 @@ mail_execute (int shell, char *progname, int argc, char **argv)
xargv = mu_calloc (xargc + 1, sizeof (xargv[0]));
/* Expand arguments if required */
- if (mailvar_is_true ("bang"))
+ if (mailvar_is_true (mailvar_name_bang))
{
int i;
char *last = NULL;
- mailvar_get (&last, "gnu-last-command", mailvar_type_string, 0);
+ mailvar_get (&last, mailvar_name_gnu_last_command,
+ mailvar_type_string, 0);
expand_bang (xargv, progname, last);
for (i = 1; i < argc; i++)
expand_bang (xargv + i, argv[i], last);
@@ -101,7 +102,7 @@ mail_execute (int shell, char *progname, int argc, char **argv)
Important: use argc (not xargc)!
*/
mu_argcv_string (argc, xargv, &buf);
- mailvar_set ("gnu-last-command", buf, mailvar_type_string,
+ mailvar_set (mailvar_name_gnu_last_command, buf, mailvar_type_string,
MOPTF_QUIET | MOPTF_OVERWRITE);
if (shell)
diff --git a/mail/top.c b/mail/top.c
index 2c7fab6..9ae0f93 100644
--- a/mail/top.c
+++ b/mail/top.c
@@ -28,7 +28,7 @@ top0 (msgset_t *mspec, mu_message_t msg, void *data)
size_t size = 0, n;
int lines;
- if (mailvar_get (&lines, "toplines", mailvar_type_number, 1)
+ if (mailvar_get (&lines, mailvar_name_toplines, mailvar_type_number, 1)
|| lines < 0)
return 1;
diff --git a/mail/util.c b/mail/util.c
index 5611b84..f673f6a 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -89,7 +89,7 @@ util_do_command (const char *fmt, ...)
/* Special case: a number alone implies "print" */
if (argc == 1
&& ((strtoul (argv[0], &p, 10) > 0 && *p == 0)
- || (argv[0][1] == 0 && strchr("^$", argv[0][0]))))
+ || (argv[0][1] == 0 && strchr ("^$", argv[0][0]))))
{
/* Use the extra slot for "print" command */
argc++;
@@ -102,7 +102,7 @@ util_do_command (const char *fmt, ...)
}
}
else
- entry = mail_find_command ("quit");
+ entry = mail_find_command (mailvar_name_quit);
if (!entry)
{
@@ -376,7 +376,7 @@ util_screen_lines ()
int screen;
size_t n;
- if (mailvar_get (&screen, "screen", mailvar_type_number, 0) == 0)
+ if (mailvar_get (&screen, mailvar_name_screen, mailvar_type_number, 0) == 0)
return screen;
n = util_getlines();
util_do_command ("set screen=%lu", (unsigned long) n);
@@ -389,7 +389,7 @@ util_screen_columns ()
int cols;
size_t n;
- if (mailvar_get (&cols, "columns", mailvar_type_number, 0) == 0)
+ if (mailvar_get (&cols, mailvar_name_columns, mailvar_type_number, 0) == 0)
return cols;
n = util_getcols();
util_do_command ("set columns=%lu", (unsigned long) n);
@@ -401,9 +401,9 @@ util_get_crt ()
{
int lines;
- if (mailvar_get (&lines, "crt", mailvar_type_number, 0) == 0)
+ if (mailvar_get (&lines, mailvar_name_crt, mailvar_type_number, 0) == 0)
return lines;
- else if (mailvar_is_true ("crt"))
+ else if (mailvar_is_true (mailvar_name_crt))
return util_getlines ();
return 0;
}
@@ -412,7 +412,7 @@ const char *
util_reply_prefix ()
{
char *prefix = "Re: ";
- mailvar_get (&prefix, "replyprefix", mailvar_type_string, 0);
+ mailvar_get (&prefix, mailvar_name_replyprefix, mailvar_type_string, 0);
return prefix;
}
@@ -469,7 +469,7 @@ util_folder_path (const char *name)
char *folder;
int rc;
- if (mailvar_get (&folder, "folder", mailvar_type_string, 1))
+ if (mailvar_get (&folder, mailvar_name_folder, mailvar_type_string, 1))
return NULL;
if (!name)
@@ -533,7 +533,8 @@ util_slist_print (mu_list_t list, int nl)
if (!list || mu_list_get_iterator (list, &itr))
return;
- for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
+ for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+ mu_iterator_next (itr))
{
mu_iterator_current (itr, (void **)&name);
mu_printf ("%s%c", name, nl ? '\n' : ' ');
@@ -551,7 +552,8 @@ util_slist_lookup (mu_list_t list, const char *str)
if (!list || mu_list_get_iterator (list, &itr))
return 0;
- for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
+ for (mu_iterator_first (itr); !mu_iterator_is_done (itr);
+ mu_iterator_next (itr))
{
mu_iterator_current (itr, (void **)&name);
if (mu_c_strcasecmp (name, str) == 0)
@@ -665,7 +667,8 @@ util_outfolder_name (char *str)
break;
default:
- if (mailvar_get (&outfolder, "outfolder", mailvar_type_string, 0) == 0)
+ if (mailvar_get (&outfolder, mailvar_name_outfolder,
+ mailvar_type_string, 0) == 0)
{
char *s = mu_make_file_name (outfolder, str);
rc = mu_mailbox_expand_name (s, &exp);
@@ -693,7 +696,7 @@ util_save_outgoing (mu_message_t msg, char *savefile)
{
char *record;
- if (mailvar_get (&record, "record", mailvar_type_string, 0) == 0)
+ if (mailvar_get (&record, mailvar_name_record, mailvar_type_string, 0) == 0)
{
int rc;
mu_mailbox_t outbox;
@@ -930,7 +933,7 @@ util_header_expand (mu_header_t *phdr)
mu_address_t new_addr;
char *p = ws.ws_wordv[j];
- if (mailvar_is_true ("inplacealiases"))
+ if (mailvar_is_true (mailvar_name_inplacealiases))
/* If inplacealiases was set, the value was already expanded */
exp = p;
else
@@ -940,7 +943,8 @@ util_header_expand (mu_header_t *phdr)
{
errcnt++;
if (exp)
- mu_error (_("Cannot parse address `%s' (while expanding `%s'): %s"),
+ mu_error (_("Cannot parse address `%s'"
+ " (while expanding `%s'): %s"),
exp, p, mu_strerror (rc));
else
mu_error (_("Cannot parse address `%s': %s"),
@@ -1048,7 +1052,7 @@ util_get_charset (void)
{
char *charset;
- if (mailvar_get (&charset, "charset", mailvar_type_string, 0))
+ if (mailvar_get (&charset, mailvar_name_charset, mailvar_type_string, 0))
return NULL;
if (mu_c_strcasecmp (charset, "auto") == 0)
@@ -1089,7 +1093,7 @@ util_rfc2047_decode (char **value)
if (rc)
{
- if (mailvar_is_true ("verbose"))
+ if (mailvar_is_true (mailvar_name_verbose))
mu_error (_("Cannot decode line `%s': %s"), *value, mu_strerror (rc));
}
else

Return to:

Send suggestions and report system problems to the System administrator.