Commit df07ce7d df07ce7dc7115193dac0b1f15a1dfa1d338e540d by Sergey Poznyakoff

mail: use mu_strout; remove util_error in favor of mu_error.

1 parent a52aac19
......@@ -36,9 +36,9 @@ alias_free (void *data)
static void
alias_print_group (const char *name, alias_t al)
{
mu_stream_printf (ostream, "%s ", name);
mu_printf ("%s ", name);
util_slist_print (al->list, 0);
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
}
static alias_t
......@@ -75,7 +75,7 @@ alias_print (char *name)
al = alias_lookup (name);
if (!al)
{
util_error (_("\"%s\": not a group"), name);
mu_error (_("\"%s\": not a group"), name);
return;
}
alias_print_group (name, al);
......
......@@ -34,7 +34,7 @@ mail_alt (int argc, char **argv)
if (alternate_names)
{
util_slist_print (alternate_names, 0);
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
}
}
else
......@@ -60,7 +60,7 @@ mail_set_my_name (char *name)
struct passwd *pw = getpwuid (getuid ());
if (!pw)
{
util_error (_("Cannot determine my username"));
mu_error (_("Cannot determine my username"));
exit (1);
}
name = pw->pw_name;
......@@ -69,7 +69,7 @@ mail_set_my_name (char *name)
my_email = mu_get_user_email (name);
if (!my_email)
{
util_error(_("Cannot determine my email address: %s"),
mu_error(_("Cannot determine my email address: %s"),
mu_strerror (errno));
exit (1);
}
......
......@@ -64,7 +64,7 @@ mail_copy0 (int argc, char **argv, int mark)
if ((status = mu_mailbox_create_default (&mbx, filename)) != 0)
{
util_error (_("Cannot create mailbox %s: %s"), filename,
mu_error (_("Cannot create mailbox %s: %s"), filename,
mu_strerror (status));
free (filename);
msgset_free (msglist);
......@@ -72,7 +72,7 @@ mail_copy0 (int argc, char **argv, int mark)
}
if ((status = mu_mailbox_open (mbx, MU_STREAM_WRITE | MU_STREAM_CREAT)) != 0)
{
util_error (_("Cannot open mailbox %s: %s"), filename,
mu_error (_("Cannot open mailbox %s: %s"), filename,
mu_strerror (status));
free (filename);
msgset_free (msglist);
......@@ -88,7 +88,7 @@ mail_copy0 (int argc, char **argv, int mark)
status = mu_mailbox_append_message (mbx, msg);
if (status)
{
util_error (_("Cannot append message: %s"), mu_strerror (status));
mu_error (_("Cannot append message: %s"), mu_strerror (status));
break;
}
......@@ -106,7 +106,7 @@ mail_copy0 (int argc, char **argv, int mark)
}
if (status == 0)
mu_stream_printf (ostream, "\"%s\" %3lu/%-5lu\n", filename,
mu_printf ("\"%s\" %3lu/%-5lu\n", filename,
(unsigned long) total_lines, (unsigned long) total_size);
mu_mailbox_close (mbx);
......
......@@ -275,7 +275,7 @@ display_submessage (struct mime_descend_closure *closure, void *data)
else
stream = b_stream;
display_part_header (ostream,
display_part_header (mu_strout,
closure->msgset,
closure->type, closure->encoding);
......@@ -328,7 +328,7 @@ print_stream (mu_stream_t stream, mu_stream_t out)
{
if (ml_got_interrupt())
{
util_error(_("\nInterrupt"));
mu_error(_("\nInterrupt"));
break;
}
buffer[n] = '\0';
......@@ -368,12 +368,12 @@ run_metamail (const char *mailcap_cmd, mu_message_t mesg)
sigemptyset (&ignore.sa_mask);
if (sigaction (SIGINT, &ignore, &saveintr) < 0)
{
util_error ("sigaction: %s", strerror (errno));
mu_error ("sigaction: %s", strerror (errno));
return;
}
if (sigaction (SIGQUIT, &ignore, &savequit) < 0)
{
util_error ("sigaction: %s", strerror (errno));
mu_error ("sigaction: %s", strerror (errno));
sigaction (SIGINT, &saveintr, NULL);
return;
}
......@@ -391,7 +391,7 @@ run_metamail (const char *mailcap_cmd, mu_message_t mesg)
pid = fork ();
if (pid < 0)
{
util_error ("fork: %s", strerror (errno));
mu_error ("fork: %s", strerror (errno));
}
else if (pid == 0)
{
......
......@@ -50,7 +50,7 @@ echo (char *s)
}
else
{
mu_stream_printf (ostream, "%s", ws.ws_wordv[0]);
mu_printf ("%s", ws.ws_wordv[0]);
mu_wordsplit_free (&ws);
}
return rc;
......@@ -66,9 +66,9 @@ mail_echo (int argc, char **argv)
for (i = 1; i < argc; i++)
{
if (echo (argv[i]))
mu_stream_printf (ostream, " ");
mu_printf (" ");
}
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
}
return 0;
}
......
......@@ -38,8 +38,8 @@ print_envelope (msgset_t *mspec, mu_message_t msg, void *data)
mu_envelope_sget_sender (env, &sender);
mu_envelope_sget_date (env, &date);
if (data)
mu_stream_printf (ostream, "%s ", (char*) data);
mu_stream_printf (ostream, "%s %s", sender, date);
mu_printf ("%s ", (char*) data);
mu_printf ("%s %s", sender, date);
}
return 0;
}
......
......@@ -32,9 +32,9 @@ mail_eq (int argc, char **argv)
case 1:
n = get_cursor ();
if (n == 0)
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
else
mu_stream_printf (ostream, "%lu\n", (unsigned long) n);
mu_printf ("%lu\n", (unsigned long) n);
break;
case 2:
......@@ -43,7 +43,7 @@ mail_eq (int argc, char **argv)
if (list->msg_part[0] <= total)
{
set_cursor (list->msg_part[0]);
mu_stream_printf (ostream, "%lu\n",
mu_printf ("%lu\n",
(unsigned long) list->msg_part[0]);
}
else
......
......@@ -29,7 +29,7 @@ dump_headers (mu_stream_t out, compose_env_t *env)
rc = mu_header_get_streamref (env->header, &stream);
if (rc)
{
util_error ("mu_header_get_streamref: %s",
mu_error ("mu_header_get_streamref: %s",
mu_stream_strerror (stream, rc));
return;
}
......@@ -55,7 +55,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
if ((status = mu_header_create (&header, NULL, 0)) != 0)
{
util_error (_("Cannot create header: %s"), mu_strerror (status));
mu_error (_("Cannot create header: %s"), mu_strerror (status));
return 1;
}
......@@ -91,7 +91,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
}
else
{
util_error (_("%d: not a header line"), line);
mu_error (_("%d: not a header line"), line);
errcnt++;
}
}
......@@ -117,7 +117,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
}
else
{
util_error (_("%d: not a header line"), line);
mu_error (_("%d: not a header line"), line);
errcnt++;
}
}
......@@ -153,7 +153,7 @@ parse_headers (mu_stream_t input, compose_env_t *env)
static void
escape_continue (void)
{
mu_stream_printf (ostream, _("(continue)\n"));
mu_printf (_("(continue)\n"));
}
static int
......@@ -163,7 +163,7 @@ escape_check_args (int argc, char **argv)
{
char *escape = "~";
mailvar_get (&escape, "escape", mailvar_type_string, 0);
util_error (_("%c%s requires an argument"), escape[0], argv[0]);
mu_error (_("%c%s requires an argument"), escape[0], argv[0]);
return 1;
}
return 0;
......@@ -183,7 +183,6 @@ escape_command (int argc, char **argv, compose_env_t *env)
{
const struct mail_command_entry *entry;
int status;
mu_stream_t s;
if (escape_check_args (argc, argv))
return 1;
......@@ -192,20 +191,16 @@ escape_command (int argc, char **argv, compose_env_t *env)
entry = mail_find_command (argv[1]);
if (!entry)
{
util_error (_("Unknown command: %s"), argv[1]);
mu_error (_("Unknown command: %s"), argv[1]);
return 1;
}
if (entry->flags & (EF_FLOW | EF_SEND))
{
util_error (_("Command not allowed in an escape sequence\n"));
mu_error (_("Command not allowed in an escape sequence\n"));
return 1;
}
/* FIXME: Do we need this? */
s = ostream;
ostream = env->compstr;
status = (*entry->func) (argc - 1, argv + 1);
ostream = s;
return status;
}
......@@ -242,10 +237,10 @@ escape_sign (int argc MU_ARG_UNUSED, char **argv, compose_env_t *env)
rc = mu_file_stream_create (&signstr, name, MU_STREAM_READ);
if (rc)
util_error (_("Cannot open %s: %s"), name, mu_strerror (rc));
mu_error (_("Cannot open %s: %s"), name, mu_strerror (rc));
else
{
mu_stream_printf (ostream, _("Reading %s\n"), name);
mu_printf (_("Reading %s\n"), name);
mu_stream_copy (env->compstr, signstr, 0, NULL);
mu_stream_destroy (&signstr);
}
......@@ -297,7 +292,7 @@ verbose_copy (mu_stream_t dest, mu_stream_t src, const char *filename,
}
if (rc)
mu_error (_("error copying data: %s"), mu_strerror (rc));
mu_stream_printf (ostream, "\"%s\" %lu/%lu\n", filename,
mu_printf ("\"%s\" %lu/%lu\n", filename,
(unsigned long) lines, (unsigned long) total);
if (psize)
*psize = total;
......@@ -314,7 +309,7 @@ escape_deadletter (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED,
int rc = mu_file_stream_create (&str, name, MU_STREAM_READ);
if (rc)
{
util_error (_("Cannot open file %s: %s"), name, strerror (rc));
mu_error (_("Cannot open file %s: %s"), name, strerror (rc));
return 1;
}
verbose_copy (env->compstr, str, name, NULL);
......@@ -488,7 +483,7 @@ quote0 (msgset_t *mspec, mu_message_t mesg, void *data)
mu_stream_t flt;
char *argv[3];
mu_stream_printf (ostream, _("Interpolating: %lu\n"),
mu_printf (_("Interpolating: %lu\n"),
(unsigned long) mspec->msg_part[0]);
mailvar_get (&prefix, "indentprefix", mailvar_type_string, 0);
......@@ -534,7 +529,7 @@ quote0 (msgset_t *mspec, mu_message_t mesg, void *data)
if (rc)
{
util_error (_("get_streamref error: %s"), mu_strerror (rc));
mu_error (_("get_streamref error: %s"), mu_strerror (rc));
return rc;
}
......@@ -563,10 +558,10 @@ int
escape_type_input (int argc, char **argv, compose_env_t *env)
{
/* FIXME: Enable paging */
mu_stream_printf (ostream, _("Message contains:\n"));
dump_headers (ostream, env);
mu_printf (_("Message contains:\n"));
dump_headers (mu_strout, env);
mu_stream_seek (env->compstr, 0, MU_SEEK_SET, NULL);
mu_stream_copy (ostream, env->compstr, 0, NULL);
mu_stream_copy (mu_strout, env->compstr, 0, NULL);
escape_continue ();
return 0;
}
......@@ -586,7 +581,7 @@ escape_read (int argc, char **argv, compose_env_t *env MU_ARG_UNUSED)
rc = mu_file_stream_create (&instr, filename, MU_STREAM_READ);
if (rc)
{
util_error (_("Cannot open %s: %s"), filename, mu_strerror (rc));
mu_error (_("Cannot open %s: %s"), filename, mu_strerror (rc));
free (filename);
return 1;
}
......@@ -636,7 +631,7 @@ escape_write (int argc, char **argv, compose_env_t *env)
MU_STREAM_WRITE|MU_STREAM_CREAT);
if (rc)
{
util_error (_("Cannot open %s for writing: %s"),
mu_error (_("Cannot open %s for writing: %s"),
filename, mu_strerror (rc));
free (filename);
return 1;
......@@ -663,7 +658,7 @@ escape_pipe (int argc, char **argv, compose_env_t *env)
if (pipe (p))
{
util_error ("pipe: %s", mu_strerror (errno));
mu_error ("pipe: %s", mu_strerror (errno));
return 1;
}
......@@ -675,7 +670,7 @@ escape_pipe (int argc, char **argv, compose_env_t *env)
close (p[0]);
close (p[1]);
close (fd);
util_error ("fork: %s", mu_strerror (errno));
mu_error ("fork: %s", mu_strerror (errno));
return 1;
}
else if (pid == 0)
......@@ -693,7 +688,7 @@ escape_pipe (int argc, char **argv, compose_env_t *env)
close (fd);
execvp (argv[1], argv + 1);
util_error (_("Cannot execute `%s': %s"), argv[1], mu_strerror (errno));
mu_error (_("Cannot execute `%s': %s"), argv[1], mu_strerror (errno));
_exit (127);
}
......@@ -714,13 +709,13 @@ escape_pipe (int argc, char **argv, compose_env_t *env)
waitpid (pid, &status, 0);
if (!WIFEXITED (status))
util_error (_("Child terminated abnormally: %d"),
mu_error (_("Child terminated abnormally: %d"),
WEXITSTATUS (status));
else
{
struct stat st;
if (fstat (fd, &st))
util_error (_("Cannot stat output file: %s"), mu_strerror (errno));
mu_error (_("Cannot stat output file: %s"), mu_strerror (errno));
else
osize = st.st_size;
}
......@@ -738,7 +733,7 @@ escape_pipe (int argc, char **argv, compose_env_t *env)
MU_STREAM_RDWR | MU_STREAM_SEEK);
if (rc)
{
util_error (_("Cannot open composition stream: %s"),
mu_error (_("Cannot open composition stream: %s"),
mu_strerror (rc));
close (fd);
}
......
......@@ -37,7 +37,7 @@ mail_expand_name (const char *name)
case '#':
if (!prev_name)
{
util_error (_("No previous file"));
mu_error (_("No previous file"));
return NULL;
}
else
......@@ -47,7 +47,7 @@ mail_expand_name (const char *name)
case '&':
name = getenv ("MBOX");
if (!name)
util_error (_("MBOX environment variable not set"));
mu_error (_("MBOX environment variable not set"));
else
name = xstrdup (name);
break;
......@@ -91,7 +91,7 @@ mail_file (int argc, char **argv)
|| (status = mu_mailbox_open (newbox, MU_STREAM_RDWR)) != 0)
{
mu_mailbox_destroy (&newbox);
util_error(_("Cannot open mailbox %s: %s"), name, mu_strerror (status));
mu_error(_("Cannot open mailbox %s: %s"), name, mu_strerror (status));
free (name);
return 1;
}
......@@ -126,7 +126,7 @@ mail_file (int argc, char **argv)
}
else
{
util_error(_("%s takes only one argument"), argv[0]);
mu_error (_("%s takes only one argument"), argv[0]);
}
return 1;
}
......
......@@ -34,7 +34,7 @@ mail_folders (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
char *tmp = alloca (strlen (path) + 3);
if (!tmp)
{
util_error (_("Not enough memory"));
mu_error (_("Not enough memory"));
return 1;
}
......
......@@ -40,7 +40,7 @@ mail_followup (int argc, char **argv)
n = get_cursor ();
if (n == 0)
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
......@@ -77,9 +77,9 @@ mail_followup (int argc, char **argv)
msgset_free (msglist);
mu_stream_printf (ostream, "To: %s\n",
mu_printf ("To: %s\n",
compose_header_get (&env, MU_HEADER_TO, ""));
mu_stream_printf (ostream, "Subject: %s\n\n",
mu_printf ("Subject: %s\n\n",
compose_header_get (&env, MU_HEADER_SUBJECT, ""));
status = mail_send0 (&env, mu_isupper (argv[0][0]));
......
......@@ -72,7 +72,7 @@ static void
format_pad (size_t n)
{
for (; n; n--)
mu_stream_write (ostream, " ", 1, NULL);
mu_stream_write (mu_strout, " ", 1, NULL);
}
static void
......@@ -113,17 +113,17 @@ format_headline (struct header_segm *seg, msgset_t *mspec, mu_message_t msg)
if (seg->align == ALIGN_RIGHT)
{
format_pad (width - len);
mu_stream_printf (ostream, "%*.*s", (int) len, (int) len, p);
mu_printf ("%*.*s", (int) len, (int) len, p);
}
else
{
mu_stream_printf (ostream, "%*.*s", (int) len, (int) len, p);
mu_printf ("%*.*s", (int) len, (int) len, p);
format_pad (width - len);
}
out_cols += width;
}
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
free (args.buf);
}
......
......@@ -52,7 +52,7 @@ _cond_push(int val)
if (!_cond_stack)
{
util_error(_("Not enough memory"));
mu_error(_("Not enough memory"));
exit (EXIT_FAILURE);
}
_cond_stack[_cond_level++] = val;
......@@ -63,7 +63,7 @@ _cond_pop()
{
if (_cond_level == 0)
{
util_error(_("Internal error: condition stack underflow"));
mu_error(_("Internal error: condition stack underflow"));
abort();
}
return _cond_stack[--_cond_level];
......@@ -86,13 +86,13 @@ mail_if (int argc, char **argv)
if (argc != 2)
{
/* TRANSLATORS: 'if' is the function name. Do not translate it */
util_error(_("if requires an argument: s | r | t"));
mu_error(_("if requires an argument: s | r | t"));
return 1;
}
if (argv[1][1] != 0)
{
util_error(_("Valid if arguments are: s | r | t"));
mu_error(_("Valid if arguments are: s | r | t"));
return 1;
}
......@@ -116,7 +116,7 @@ mail_if (int argc, char **argv)
cond = isatty (fileno (stdout));
break;
default:
util_error(_("Valid if arguments are: s | r | t"));
mu_error(_("Valid if arguments are: s | r | t"));
return 1;
}
}
......@@ -133,7 +133,7 @@ mail_else (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
if (_cond_level == 0)
{
/* TRANSLATORS: 'else' and 'if' are function names. Do not translate them */
util_error(_("else without matching if"));
mu_error(_("else without matching if"));
return 1;
}
cond = _cond_pop();
......@@ -149,7 +149,7 @@ mail_endif (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
if (_cond_level == 0)
{
/* TRANSLATORS: 'endif' and 'if' are function names. Do not translate them */
util_error(_("endif without matching if"));
mu_error (_("endif without matching if"));
return 1;
}
_cond_pop();
......
......@@ -27,10 +27,10 @@ mail_inc (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
if (!mu_mailbox_is_updated (mbox))
{
mu_mailbox_messages_count (mbox, &total);
mu_stream_printf (ostream, _("New mail has arrived.\n"));
mu_printf (_("New mail has arrived.\n"));
}
else
mu_stream_printf (ostream, _("No new mail for %s\n"), mail_whoami ());
mu_printf (_("No new mail for %s\n"), mail_whoami ());
return 0;
}
......
......@@ -21,7 +21,6 @@
/* Global variables and constants*/
mu_mailbox_t mbox; /* Mailbox being operated upon */
size_t total; /* Total number of messages in the mailbox */
mu_stream_t ostream; /* Output stream */
int interactive; /* Is the session interactive */
static mu_list_t command_list; /* List of commands to be executed after parsing
......@@ -221,20 +220,20 @@ mail_cmdline (void *closure, int cont MU_ARG_UNUSED)
{
mu_mailbox_messages_count (mbox, &total);
page_invalidate (0);
mu_stream_printf (ostream, _("New mail has arrived.\n"));
mu_printf (_("New mail has arrived.\n"));
}
rc = ml_readline (prompt);
if (ml_got_interrupt ())
{
util_error (_("Interrupt"));
mu_error (_("Interrupt"));
continue;
}
if (!rc && mailvar_get (NULL, "ignoreeof", mailvar_type_boolean, 0) == 0)
{
util_error (_("Use \"quit\" to quit."));
mu_error (_("Use \"quit\" to quit."));
continue;
}
......@@ -325,8 +324,6 @@ main (int argc, char **argv)
int i, rc;
mu_stdstream_setup ();
ostream = mu_strout;
mu_stream_ref (mu_strout);
set_cursor (1);
/* Native Language Support */
......@@ -446,10 +443,10 @@ main (int argc, char **argv)
if ((rc = mu_mailbox_create_default (&mbox, args.file)) != 0)
{
if (args.file)
util_error (_("Cannot create mailbox %s: %s"), args.file,
mu_error (_("Cannot create mailbox %s: %s"), args.file,
mu_strerror (rc));
else
util_error (_("Cannot create mailbox: %s"),
mu_error (_("Cannot create mailbox: %s"),
mu_strerror (rc));
exit (EXIT_FAILURE);
}
......@@ -458,7 +455,7 @@ main (int argc, char **argv)
{
mu_url_t url = NULL;
mu_mailbox_get_url (mbox, &url);
util_error (_("Cannot open mailbox %s: %s"),
mu_error (_("Cannot open mailbox %s: %s"),
mu_url_to_string (url), mu_strerror (rc));
mu_mailbox_destroy (&mbox);
}
......@@ -471,7 +468,7 @@ main (int argc, char **argv)
{
mu_url_t url = NULL;
mu_mailbox_get_url (mbox, &url);
util_error (_("Cannot read mailbox %s: %s"),
mu_error (_("Cannot read mailbox %s: %s"),
mu_url_to_string (url), mu_strerror (rc));
exit (EXIT_FAILURE);
}
......@@ -487,7 +484,7 @@ main (int argc, char **argv)
do_and_quit ("from *");
else if (strcmp (mode, "read"))
{
util_error (_("Unknown mode `%s'"), mode);
mu_error (_("Unknown mode `%s'"), mode);
util_do_command ("quit");
return 1;
}
......@@ -498,9 +495,9 @@ main (int argc, char **argv)
|| mailvar_get (NULL, "emptystart", mailvar_type_boolean, 0)))
{
if (args.file)
mu_stream_printf (ostream, _("%s: 0 messages\n"), args.file);
mu_printf (_("%s: 0 messages\n"), args.file);
else
mu_stream_printf (ostream, _("No mail for %s\n"),
mu_printf (_("No mail for %s\n"),
args.user ? args.user : mail_whoami ());
return 1;
}
......@@ -514,7 +511,7 @@ main (int argc, char **argv)
mailvar_get (&prompt, "prompt", mailvar_type_string, 0);
mail_mainloop (mail_cmdline, (void*) prompt, 1);
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
util_do_command ("quit");
return 0;
}
......@@ -564,11 +561,11 @@ mail_mainloop (char *(*input) (void *, int),
int
mail_warranty (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
mu_stream_printf (ostream,
mu_printf (
_("GNU Mailutils -- a suite of utilities for electronic mail\n"
"Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,\n"
"2007, 2009 Free Software Foundation, Inc.\n\n"));
mu_stream_printf (ostream,
"2007, 2009, 2010 Free Software Foundation, Inc.\n\n"));
mu_printf (
_(" GNU Mailutils is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 3 of the License, or\n"
......
......@@ -172,7 +172,6 @@ typedef int (*msg_handler_t) (msgset_t *mp, mu_message_t mesg, void *data);
/* Global variables and constants*/
extern mu_mailbox_t mbox;
extern size_t total;
extern mu_stream_t ostream;
extern int interactive;
extern const char *program_version;
......@@ -380,7 +379,6 @@ extern char *util_slist_to_string (mu_list_t list, const char *delim);
extern void util_strcat (char **dest, const char *str);
extern char *util_outfolder_name (char *str);
extern void util_save_outgoing (mu_message_t msg, char *savefile);
extern void util_error (const char *format, ...) MU_PRINTFLIKE(1,2);
extern int util_error_range (size_t msgno);
extern void util_noapp (void);
extern int util_tempfile (char **namep);
......
......@@ -151,7 +151,7 @@ ml_readline_with_intr (const char *prompt)
{
char *str = ml_readline (prompt);
if (_interrupted)
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
return str;
}
......@@ -782,7 +782,7 @@ ml_reread (const char *prompt, char **text)
if (!line)
{
util_error (_("Not enough memory to edit the line"));
mu_error (_("Not enough memory to edit the line"));
return -1;
}
......@@ -810,7 +810,7 @@ ml_reread (const char *prompt, char **text)
if ((p = realloc (line, line_size + LINE_INC)) == NULL)
{
fputs ("\n", stdout);
util_error (_("Not enough memory to edit the line"));
mu_error (_("Not enough memory to edit the line"));
break;
}
else
......@@ -857,7 +857,7 @@ ml_reread (const char *prompt, char **text)
if ((p = realloc (line, line_size + LINE_INC)) == NULL)
{
fputs ("\n", stdout);
util_error (_("Not enough memory to edit the line"));
mu_error (_("Not enough memory to edit the line"));
break;
}
else
......@@ -893,7 +893,7 @@ ml_reread (const char *prompt, char **text)
if ((p = realloc (line, line_size + LINE_INC)) == NULL)
{
fputs ("\n", stdout);
util_error (_("Not enough memory to edit the line"));
mu_error (_("Not enough memory to edit the line"));
break;
}
else
......@@ -925,8 +925,8 @@ readline (char *prompt)
{
if (prompt)
{
mu_stream_printf (ostream, "%s", prompt);
mu_stream_flush (ostream);
mu_printf ("%s", prompt);
mu_stream_flush (mu_strout);
}
return ml_readline_internal ();
......
......@@ -416,7 +416,7 @@ mailvar_get (void *ptr, const char *variable, enum mailvar_type type, int warn)
if (!var->set || var->type != type)
{
if (warn)
util_error (_("No value set for \"%s\""), variable);
mu_error (_("No value set for \"%s\""), variable);
return 1;
}
if (ptr)
......
......@@ -727,7 +727,7 @@ check_set (msgset_t **pset)
}
else
{
util_error (_("%lu: Inappropriate message (has been deleted)"),
mu_error (_("%lu: Inappropriate message (has been deleted)"),
(unsigned long) p->msg_part[0]);
/* Delete entire set */
delset = *pset;
......
......@@ -36,7 +36,7 @@ mail_next (int argc, char **argv)
n = get_cursor ();
if (n == 0 || util_get_message (mbox, n, &msg))
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
......@@ -59,7 +59,7 @@ mail_next (int argc, char **argv)
if (rc)
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
}
......@@ -76,7 +76,7 @@ mail_next (int argc, char **argv)
}
else
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
}
......
......@@ -45,7 +45,7 @@ mail_previous (int argc, char **argv)
if (rc)
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
}
......@@ -62,7 +62,7 @@ mail_previous (int argc, char **argv)
}
else
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
}
......
......@@ -102,7 +102,7 @@ mail_print_msg (msgset_t *mspec, mu_message_t mesg, void *data)
/* FIXME:
if (ml_got_interrupt())
{
util_error (_("\nInterrupt"));
mu_error (_("\nInterrupt"));
break;
}
*/
......
......@@ -49,7 +49,7 @@ mail_mbox_close ()
mu_mailbox_get_url (mbox, &url);
mu_mailbox_messages_count (mbox, &held_count);
mu_stream_printf (ostream,
mu_printf (
ngettext ("Held %d message in %s\n",
"Held %d messages in %s\n",
held_count),
......@@ -116,14 +116,14 @@ mail_mbox_commit ()
if ((status = mu_mailbox_create_default (&dest_mbox, name)) != 0)
{
util_error (_("Cannot create mailbox %s: %s"), name,
mu_error (_("Cannot create mailbox %s: %s"), name,
mu_strerror (status));
return 1;
}
if ((status = mu_mailbox_open (dest_mbox,
MU_STREAM_WRITE | MU_STREAM_CREAT))!=0)
{
util_error (_("Cannot open mailbox %s: %s"), name,
mu_error (_("Cannot open mailbox %s: %s"), name,
mu_strerror (status));
return 1;
}
......@@ -131,7 +131,7 @@ mail_mbox_commit ()
status = mu_mailbox_append_message (dest_mbox, msg);
if (status)
util_error (_("Cannot append message: %s"), mu_strerror (status));
mu_error (_("Cannot append message: %s"), mu_strerror (status));
else
{
mu_attribute_set_deleted (attr);
......@@ -153,7 +153,7 @@ mail_mbox_commit ()
mu_url_t u = NULL;
mu_mailbox_get_url (dest_mbox, &u);
mu_stream_printf (ostream,
mu_printf (
ngettext ("Saved %d message in %s\n",
"Saved %d messages in %s\n",
saved_count),
......
......@@ -111,12 +111,12 @@ reply0 (msgset_t *mspec, mu_message_t msg, void *data)
else
compose_header_set (&env, MU_HEADER_SUBJECT, "", COMPOSE_REPLACE);
mu_stream_printf (ostream, "To: %s\n",
mu_printf ("To: %s\n",
compose_header_get (&env, MU_HEADER_TO, ""));
str = compose_header_get (&env, MU_HEADER_CC, NULL);
if (str)
mu_stream_printf (ostream, "Cc: %s\n", str);
mu_stream_printf (ostream, "Subject: %s\n\n",
mu_printf ("Cc: %s\n", str);
mu_printf ("Subject: %s\n\n",
compose_header_get (&env, MU_HEADER_SUBJECT, ""));
make_in_reply_to (&env, msg);
......
......@@ -31,7 +31,7 @@ process_list (int argc, char **argv,
if (argc == 1)
{
if (mu_list_is_empty (*list))
mu_stream_printf (ostream, "%s", _(msg));
mu_printf ("%s", _(msg));
else
util_slist_print (*list, 1);
return 0;
......@@ -125,7 +125,7 @@ mail_nosender (int argc, char **argv)
if (argc == 1)
{
util_slist_destroy (&sender_headers);
mu_stream_printf (ostream,
mu_printf (
_("Sender address is obtained from the envelope\n"));
}
else
......
......@@ -52,7 +52,7 @@ list_headers (void *item, void *data)
if (!name || strcmp (name, hp->name) == 0)
{
mu_stream_printf (ostream, "%s: %s\n", hp->name, hp->value);
mu_printf ("%s: %s\n", hp->name, hp->value);
}
return 0;
}
......@@ -67,7 +67,7 @@ add_header (char *name, char *value, int mode)
int rc = mu_list_create (&add_header_list);
if (rc)
{
util_error (_("Cannot create header list: %s"), mu_strerror (rc));
mu_error (_("Cannot create header list: %s"), mu_strerror (rc));
exit (1);
}
}
......@@ -89,7 +89,7 @@ send_append_header (char *text)
p = strchr (text, ':');
if (!p)
{
util_error (_("Invalid header: %s"), text);
mu_error (_("Invalid header: %s"), text);
return;
}
len = p - text;
......@@ -223,7 +223,7 @@ compose_header_set (compose_env_t * env, const char *name,
if (!env->header
&& (status = mu_header_create (&env->header, NULL, 0)) != 0)
{
util_error (_("Cannot create header: %s"), mu_strerror (status));
mu_error (_("Cannot create header: %s"), mu_strerror (status));
return status;
}
......@@ -333,7 +333,7 @@ fill_body (mu_message_t msg, mu_stream_t instr)
{
char *str;
if (mailvar_get (&str, "nullbodymsg", mailvar_type_string, 0) == 0)
util_error ("%s\n", _(str));
mu_error ("%s\n", _(str));
}
else
return 1;
......@@ -356,7 +356,7 @@ save_dead_message (compose_env_t *env)
rc = mu_file_stream_create (&dead_letter, name, MU_STREAM_WRITE);
if (rc)
{
util_error (_("Cannot open file %s: %s"), name, strerror (rc));
mu_error (_("Cannot open file %s: %s"), name, strerror (rc));
return 1;
}
if (mailvar_get (NULL, "appenddeadletter",
......@@ -401,17 +401,17 @@ send_message (mu_message_t msg)
mu_mailer_close (mailer);
}
else
util_error (_("Cannot open mailer: %s"), mu_strerror (status));
mu_error (_("Cannot open mailer: %s"), mu_strerror (status));
mu_mailer_destroy (&mailer);
}
else
util_error (_("Cannot create mailer: %s"),
mu_error (_("Cannot create mailer: %s"),
mu_strerror (status));
}
}
else
{
util_error (_("Variable sendmail not set: no mailer"));
mu_error (_("Variable sendmail not set: no mailer"));
status = ENOSYS;
}
return status;
......@@ -445,7 +445,7 @@ mail_send0 (compose_env_t *env, int save_to)
rc = mu_temp_file_stream_create (&env->compstr, NULL, 0);
if (rc)
{
util_error (_("Cannot open temporary file: %s"), mu_strerror (rc));
mu_error (_("Cannot open temporary file: %s"), mu_strerror (rc));
return 1;
}
......@@ -460,7 +460,7 @@ mail_send0 (compose_env_t *env, int save_to)
{
if (mailvar_get (NULL, "ignore", mailvar_type_boolean, 0) == 0)
{
mu_stream_printf (ostream, "@\n");
mu_printf ("@\n");
}
else
{
......@@ -468,7 +468,7 @@ mail_send0 (compose_env_t *env, int save_to)
free (buf);
if (++int_cnt == 2)
break;
util_error (_("\n(Interrupt -- one more to kill letter)"));
mu_error (_("\n(Interrupt -- one more to kill letter)"));
}
continue;
}
......@@ -478,7 +478,7 @@ mail_send0 (compose_env_t *env, int save_to)
if (interactive
&& mailvar_get (NULL, "ignoreeof", mailvar_type_boolean, 0) == 0)
{
util_error (mailvar_get (NULL, "dot", mailvar_type_boolean, 0) == 0 ?
mu_error (mailvar_get (NULL, "dot", mailvar_type_boolean, 0) == 0 ?
_("Use \".\" to terminate letter.") :
_("Use \"~.\" to terminate letter."));
continue;
......@@ -520,15 +520,15 @@ mail_send0 (compose_env_t *env, int save_to)
status = (*entry->escfunc) (ws.ws_wordc, ws.ws_wordv,
env);
else
util_error (_("Unknown escape %s"), ws.ws_wordv[0]);
mu_error (_("Unknown escape %s"), ws.ws_wordv[0]);
}
else
util_error (_("Unfinished escape"));
mu_error (_("Unfinished escape"));
mu_wordsplit_free (&ws);
}
else
{
util_error (_("Cannot parse escape sequence: %s"),
mu_error (_("Cannot parse escape sequence: %s"),
mu_wordsplit_strerror (&ws));
}
}
......@@ -614,14 +614,14 @@ mail_send0 (compose_env_t *env, int save_to)
{
status = mu_mailbox_append_message (mbx, msg);
if (status)
util_error (_("Cannot append message: %s"),
mu_error (_("Cannot append message: %s"),
mu_strerror (status));
mu_mailbox_close (mbx);
}
mu_mailbox_destroy (&mbx);
}
if (status)
util_error (_("Cannot create mailbox %s: %s"),
mu_error (_("Cannot create mailbox %s: %s"),
env->outfiles[i],
mu_strerror (status));
}
......@@ -678,7 +678,7 @@ msg_to_pipe (const char *cmd, mu_message_t msg)
status = mu_command_stream_create (&progstream, cmd, MU_STREAM_WRITE);
if (status)
{
util_error (_("Cannot pipe to %s: %s"), cmd, mu_strerror (status));
mu_error (_("Cannot pipe to %s: %s"), cmd, mu_strerror (status));
return status;
}
......@@ -694,7 +694,7 @@ msg_to_pipe (const char *cmd, mu_message_t msg)
if (status)
{
util_error (_("Sending data to %s failed: %s"), cmd,
mu_error (_("Sending data to %s failed: %s"), cmd,
mu_strerror (status));
}
return status;
......
......@@ -29,7 +29,7 @@ mail_setenv (int argc, char **argv)
char **p;
for (p = environ; *p; p++)
mu_stream_printf (ostream, "%s\n", *p);
mu_printf ("%s\n", *p);
}
else
{
......
......@@ -35,7 +35,7 @@ expand_bang (char **pbuf)
if (!last)
{
util_error (_("No previous command"));
mu_error (_("No previous command"));
return;
}
......
......@@ -29,7 +29,7 @@ size0 (msgset_t *mspec, mu_message_t msg, void *data)
mu_message_size (msg, &size);
mu_message_lines (msg, &lines);
mu_stream_printf (ostream, "%c%2lu %3lu/%-5lu\n",
mu_printf ("%c%2lu %3lu/%-5lu\n",
is_current_message (mspec->msg_part[0]) ? '>' : ' ',
(unsigned long) mspec->msg_part[0],
(unsigned long) lines,
......
......@@ -55,7 +55,7 @@ mail_source (int argc, char **argv)
if (argc != 2)
{
/* TRANSLATORS: 'source' is a command name. Do not translate it! */
util_error (_("source requires a single argument"));
mu_error (_("source requires a single argument"));
return 1;
}
......@@ -63,7 +63,7 @@ mail_source (int argc, char **argv)
if (rc)
{
if (rc != ENOENT)
util_error(_("Cannot open `%s': %s"), argv[1], strerror (rc));
mu_error(_("Cannot open `%s': %s"), argv[1], strerror (rc));
return 1;
}
......
......@@ -24,20 +24,20 @@ show_part (struct mime_descend_closure *closure, void *data)
size_t width;
size_t size = 0;
format_msgset (ostream, closure->msgset, &width);
format_msgset (mu_strout, closure->msgset, &width);
for (; width < 5; width++)
mu_stream_write (ostream, " ", 1, NULL);
mu_stream_write (mu_strout, " ", 1, NULL);
mu_stream_printf (ostream, " %-25s", closure->type);
mu_printf (" %-25s", closure->type);
mu_message_size (closure->message, &size);
if (size < 1024)
mu_stream_printf (ostream, " %4lu", (unsigned long) size);
mu_printf (" %4lu", (unsigned long) size);
else if (size < 1024*1024)
mu_stream_printf (ostream, "%4luK", (unsigned long) size / 1024);
mu_printf ("%4luK", (unsigned long) size / 1024);
else
mu_stream_printf (ostream, "%4luM", (unsigned long) size / 1024 / 1024);
mu_stream_printf (ostream, "\n");
mu_printf ("%4luM", (unsigned long) size / 1024 / 1024);
mu_printf ("\n");
return 0;
}
......
......@@ -60,20 +60,20 @@ mail_summary (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
mu_url_t url = NULL;
mu_mailbox_get_url (mbox, &url);
mu_stream_printf (ostream, "\"%s\": ", util_url_to_string (url));
mu_printf ("\"%s\": ", util_url_to_string (url));
}
mu_stream_printf (ostream,
mu_printf (
ngettext ("%d message", "%d messages", count), count);
if (mnew > 0)
mu_stream_printf (ostream, ngettext (" %d new", " %d new", mnew), mnew);
mu_printf (ngettext (" %d new", " %d new", mnew), mnew);
if (mseen > 0)
mu_stream_printf (ostream, ngettext (" %d unread", " %d unread", mseen),
mu_printf (ngettext (" %d unread", " %d unread", mseen),
mseen);
if (mdelete > 0)
mu_stream_printf (ostream,
mu_printf (
ngettext (" %d deleted", " %d deleted", mdelete),
mdelete);
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
/* Set the cursor. */
set_cursor ((first_new == 0) ? ((first_unread == 0) ?
......
......@@ -39,7 +39,7 @@ top0 (msgset_t *mspec, mu_message_t msg, void *data)
int status = mu_stream_getline (stream, &buf, &size, &n);
if (status != 0 || n == 0)
break;
mu_stream_printf (ostream, "%s", buf);
mu_printf ("%s", buf);
}
free (buf);
mu_stream_destroy (&stream);
......
......@@ -27,7 +27,7 @@ mail_unalias (int argc, char **argv)
if (argc == 1)
{
/* TRANSLATORS: 'unalias' is a command name. Do not translate it! */
util_error (_("unalias requires at least one argument"));
mu_error (_("unalias requires at least one argument"));
return 1;
}
while (--argc)
......
......@@ -149,9 +149,9 @@ util_do_command (const char *fmt, ...)
else
{
if (argc)
util_error (_("Unknown command: %s"), argv[0]);
mu_error (_("Unknown command: %s"), argv[0]);
else
util_error (_("Invalid command"));
mu_error (_("Invalid command"));
status = 1;
}
......@@ -218,7 +218,7 @@ util_range_msg (size_t low, size_t high, int flags,
if ((flags & MSG_NODELETED) && util_isdeleted (low))
{
if (!(flags & MSG_SILENT))
util_error (_("%lu: Inappropriate message (has been deleted)"),
mu_error (_("%lu: Inappropriate message (has been deleted)"),
(unsigned long) low);
continue;
}
......@@ -300,11 +300,11 @@ util_help (void *table, size_t nmemb, size_t size, const char *word)
int status = 0;
struct mail_command *cp = util_find_entry (table, nmemb, size, word);
if (cp && cp->synopsis)
mu_stream_printf (ostream, "%s\n", cp->synopsis);
mu_printf ("%s\n", cp->synopsis);
else
{
status = 1;
mu_stream_printf (ostream, _("Unknown command: %s\n"), word);
mu_printf (_("Unknown command: %s\n"), word);
}
return status;
}
......@@ -337,12 +337,12 @@ util_command_list (void *table, size_t nmemb, size_t size)
if (pos >= cols)
{
pos = len + 1;
mu_stream_printf (ostream, "\n%s ", cmd);
mu_printf ("\n%s ", cmd);
}
else
mu_stream_printf (ostream, "%s ", cmd);
mu_printf ("%s ", cmd);
}
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
return 0;
}
......@@ -471,7 +471,7 @@ util_get_homedir ()
if (!homedir)
{
/* Shouldn't happen, but one never knows */
util_error (_("Cannot get homedir"));
mu_error (_("Cannot get homedir"));
exit (EXIT_FAILURE);
}
return homedir;
......@@ -535,14 +535,14 @@ util_get_sender (int msgno, int strip)
if (mu_envelope_sget_sender (env, &buffer)
|| mu_address_create (&addr, buffer))
{
util_error (_("Cannot determine sender name (msg %d)"), msgno);
mu_error (_("Cannot determine sender name (msg %d)"), msgno);
return NULL;
}
}
if (mu_address_aget_email (addr, 1, &buf))
{
util_error (_("Cannot determine sender name (msg %d)"), msgno);
mu_error (_("Cannot determine sender name (msg %d)"), msgno);
mu_address_destroy (&addr);
return NULL;
}
......@@ -570,7 +570,7 @@ util_slist_print (mu_list_t list, int nl)
for (mu_iterator_first (itr); !mu_iterator_is_done (itr); mu_iterator_next (itr))
{
mu_iterator_current (itr, (void **)&name);
mu_stream_printf (ostream, "%s%c", name, nl ? '\n' : ' ');
mu_printf ("%s%c", name, nl ? '\n' : ' ');
}
mu_iterator_destroy (&itr);
}
......@@ -725,7 +725,7 @@ util_save_outgoing (mu_message_t msg, char *savefile)
rc = mu_mailbox_create_default (&outbox, filename);
if (rc)
{
util_error (_("Cannot create output mailbox `%s': %s"),
mu_error (_("Cannot create output mailbox `%s': %s"),
filename, strerror (rc));
free (filename);
return;
......@@ -733,13 +733,13 @@ util_save_outgoing (mu_message_t msg, char *savefile)
rc = mu_mailbox_open (outbox, MU_STREAM_WRITE | MU_STREAM_CREAT);
if (rc)
util_error (_("Cannot open output mailbox `%s': %s"),
mu_error (_("Cannot open output mailbox `%s': %s"),
filename, strerror (rc));
else
{
rc = mu_mailbox_append_message (outbox, msg);
if (rc)
util_error (_("Cannot append message to `%s': %s"),
mu_error (_("Cannot append message to `%s': %s"),
filename, strerror (rc));
}
......@@ -750,19 +750,6 @@ util_save_outgoing (mu_message_t msg, char *savefile)
}
}
void
util_error (const char *format, ...)
{
va_list ap;
va_start (ap, format);
mu_stream_vprintf (mu_strerr, format, ap);
mu_stream_printf (mu_strerr, "\n");
va_end(ap);
}
static int
util_descend_subparts (mu_message_t mesg, msgset_t *msgset, mu_message_t *part)
{
......@@ -781,7 +768,7 @@ util_descend_subparts (mu_message_t mesg, msgset_t *msgset, mu_message_t *part)
{
if (mu_message_unencapsulate (mesg, &submsg, NULL))
{
util_error (_("Cannot unencapsulate message/part"));
mu_error (_("Cannot unencapsulate message/part"));
return 1;
}
mesg = submsg;
......@@ -790,14 +777,14 @@ util_descend_subparts (mu_message_t mesg, msgset_t *msgset, mu_message_t *part)
mu_message_get_num_parts (mesg, &nparts);
if (nparts < msgset->msg_part[i])
{
util_error (_("No such (sub)part in the message: %lu"),
mu_error (_("No such (sub)part in the message: %lu"),
(unsigned long) msgset->msg_part[i]);
return 1;
}
if (mu_message_get_part (mesg, msgset->msg_part[i], &submsg))
{
util_error (_("Cannot get (sub)part from the message: %lu"),
mu_error (_("Cannot get (sub)part from the message: %lu"),
(unsigned long) msgset->msg_part[i]);
return 1;
}
......@@ -925,7 +912,7 @@ util_header_expand (mu_header_t *phdr)
rc = mu_header_create (&hdr, "", 0);
if (rc)
{
util_error (_("Cannot create temporary header: %s"), mu_strerror (rc));
mu_error (_("Cannot create temporary header: %s"), mu_strerror (rc));
return 1;
}
......@@ -977,10 +964,10 @@ util_header_expand (mu_header_t *phdr)
{
errcnt++;
if (exp)
util_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
util_error (_("Cannot parse address `%s': %s"),
mu_error (_("Cannot parse address `%s': %s"),
p, mu_strerror (rc));
}
......@@ -1030,7 +1017,7 @@ util_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *msg)
status = mu_mailbox_get_message (mbox, msgno, msg);
if (status)
{
util_error (_("Cannot get message %lu: %s"),
mu_error (_("Cannot get message %lu: %s"),
(unsigned long) msgno, mu_strerror (status));
return status;
}
......@@ -1041,14 +1028,14 @@ util_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *msg)
int
util_error_range (size_t msgno)
{
util_error (_("%lu: invalid message number"), (unsigned long) msgno);
mu_error (_("%lu: invalid message number"), (unsigned long) msgno);
return 1;
}
void
util_noapp ()
{
util_error (_("No applicable messages"));
mu_error (_("No applicable messages"));
}
void
......@@ -1162,13 +1149,13 @@ open_pager (size_t lines)
{
mu_diag_funcall (MU_DIAG_ERROR, "mu_prog_stream_create",
pager, rc);
str = ostream;
str = mu_strout;
mu_stream_ref (str);
}
}
else
{
str = ostream;
str = mu_strout;
mu_stream_ref (str);
}
return str;
......
......@@ -39,16 +39,16 @@ static const char *with_defs[] =
int
mail_version (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
mu_stream_printf (ostream, "%s", program_version);
mu_printf ("%s", program_version);
if (with_defs[0] != NULL)
{
int i;
mu_stream_printf (ostream, " (");
mu_printf (" (");
for (i = 0; with_defs[i]; i++)
mu_stream_printf (ostream, " %s", with_defs[i]);
mu_stream_printf (ostream, " )");
mu_printf (" %s", with_defs[i]);
mu_printf (" )");
}
mu_stream_printf (ostream, "\n");
mu_printf ("\n");
return 0;
}
......
......@@ -43,7 +43,7 @@ mail_write (int argc, char **argv)
char *p = NULL;
if (n == 0)
{
util_error (_("No applicable message"));
mu_error (_("No applicable message"));
return 1;
}
mu_asprintf (&p, "%lu", (unsigned long) n);
......@@ -72,7 +72,7 @@ mail_write (int argc, char **argv)
MU_STREAM_APPEND|MU_STREAM_CREAT);
if (rc)
{
util_error (_("can't open %s: %s"), filename, mu_strerror (rc));
mu_error (_("can't open %s: %s"), filename, mu_strerror (rc));
free (filename);
msgset_free (msglist);
return 1;
......@@ -114,7 +114,7 @@ mail_write (int argc, char **argv)
mu_stream_close (output);
mu_stream_destroy (&output);
mu_stream_printf (ostream, "\"%s\" %3lu/%-5lu\n", filename,
mu_printf ("\"%s\" %3lu/%-5lu\n", filename,
(unsigned long) total_lines, (unsigned long) total_size);
free (filename);
......
......@@ -61,7 +61,7 @@ z_parse_args(int argc, char **argv,
dir = D_NONE;
break;
default:
util_error (_("Bad arguments for the scrolling command"));
mu_error (_("Bad arguments for the scrolling command"));
return 1;
}
......@@ -76,7 +76,7 @@ z_parse_args(int argc, char **argv,
if (argc > 1)
{
util_error (_("Too many arguments for the scrolling command"));
mu_error (_("Too many arguments for the scrolling command"));
return 1;
}
......@@ -84,13 +84,13 @@ z_parse_args(int argc, char **argv,
{
if (dir == D_NONE)
{
util_error (_("Argument not applicable for z"));
mu_error (_("Argument not applicable for z"));
return 1;
}
if ((mul = strtoul (argp, NULL, 10)) == 0)
{
util_error (_("Bad number of pages"));
mu_error (_("Bad number of pages"));
return 1;
}
}
......@@ -120,7 +120,7 @@ mail_z (int argc, char **argv)
case D_BWD:
if (page_move (-count) == 0)
{
mu_stream_printf (ostream, _("On first screenful of messages\n"));
mu_printf (_("On first screenful of messages\n"));
return 0;
}
break;
......@@ -128,7 +128,7 @@ mail_z (int argc, char **argv)
case D_FWD:
if (page_move (count) == 0)
{
mu_stream_printf (ostream, _("On last screenful of messages\n"));
mu_printf (_("On last screenful of messages\n"));
return 0;
}
break;
......