Commit 54e51827 54e5182724214e3644aa010ed6edf827381175b6 by Sergey Poznyakoff

Remove mh_error function, use mu_error instead.

1 parent d490b86d
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -229,7 +229,7 @@ main (int argc, char **argv)
{
if (argc == 0)
{
mh_error ("List of addresses is not given");
mu_error ("List of addresses is not given");
exit (1);
}
else
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -251,7 +251,7 @@ flush_stream (mu_stream_t *pstr, char *buf, size_t size)
&& ((rc = mu_temp_file_stream_create (pstr, NULL)) != 0
|| (rc = mu_stream_open (*pstr))))
{
mh_error (_("Cannot open temporary file: %s"),
mu_error (_("Cannot open temporary file: %s"),
mu_strerror (rc));
exit (1);
}
......@@ -283,7 +283,7 @@ burst_digest (mu_message_t msg)
if (!buf)
{
mh_error (_("cannot burst message: %s"), mu_strerror (ENOMEM));
mu_error (_("cannot burst message: %s"), mu_strerror (ENOMEM));
exit (1);
}
......@@ -408,7 +408,7 @@ burst_or_copy (mu_message_t msg, int recursive, int copy)
rc = mu_mailbox_append_message (tmpbox, msg);
if (rc)
{
mh_error (_("cannot append message: %s"), mu_strerror (rc));
mu_error (_("cannot append message: %s"), mu_strerror (rc));
exit (1);
}
map.count++;
......@@ -438,7 +438,7 @@ burst (mu_mailbox_t mbox, mu_message_t msg, size_t num, void *data)
}
}
else if (!quiet)
mh_error (_("message %s not in digest format"), mu_umaxtostr (0, num));
mu_error (_("message %s not in digest format"), mu_umaxtostr (0, num));
}
......@@ -474,7 +474,7 @@ burst_rename (mh_msgset_t *ms, size_t lastuid)
if (rename (from, to))
{
mh_error (_("error renaming %s to %s: %s"),
mu_error (_("error renaming %s to %s: %s"),
from, to, mu_strerror (errno));
exit (1);
}
......@@ -496,7 +496,7 @@ msg_copy (size_t num, char *file)
MU_STREAM_WRITE|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (ostream)))
{
mh_error (_("Cannot open output file `%s': %s"),
mu_error (_("Cannot open output file `%s': %s"),
file, mu_strerror (rc));
exit (1);
}
......@@ -615,7 +615,7 @@ main (int argc, char **argv)
VERBOSE ((_("changing to `%s'"), dir + 3));
if (chdir (dir+3))
{
mh_error (_("cannot change to `%s': %s"), dir, mu_strerror (errno));
mu_error (_("cannot change to `%s': %s"), dir, mu_strerror (errno));
exit (1);
}
mu_mailbox_close (mbox);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -179,7 +179,7 @@ copy_message (mu_mailbox_t mbox, size_t n, const char *file)
file, MU_STREAM_RDWR|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (out)))
{
mh_error (_("cannot open output file \"%s\": %s"),
mu_error (_("cannot open output file \"%s\": %s"),
file, mu_strerror (rc));
free (buffer);
return 1;
......@@ -191,7 +191,7 @@ copy_message (mu_mailbox_t mbox, size_t n, const char *file)
{
if ((rc = mu_stream_sequential_write (out, buffer, rdsize)) != 0)
{
mh_error (_("error writing to \"%s\": %s"),
mu_error (_("error writing to \"%s\": %s"),
file, mu_strerror (rc));
break;
}
......@@ -245,7 +245,7 @@ main (int argc, char **argv)
mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
if (msgset.count != 1)
{
mh_error (_("only one message at a time!"));
mu_error (_("only one message at a time!"));
return 1;
}
copy_message (mbox, msgset.list[0], wh_env.file);
......
......@@ -56,7 +56,7 @@ mh_comp_draft (char *formfile, char *defformfile, char *draftfile)
MU_STREAM_WRITE|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (stream)))
{
mh_error (_("cannot open output file \"%s\": %s"),
mu_error (_("cannot open output file \"%s\": %s"),
draftfile, mu_strerror (rc));
exit (1);
}
......@@ -69,7 +69,7 @@ mh_comp_draft (char *formfile, char *defformfile, char *draftfile)
if (rc)
{
mh_error (_("error writing to \"%s\": %s"),
mu_error (_("error writing to \"%s\": %s"),
draftfile, mu_strerror (rc));
exit (1);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005,
2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -60,7 +61,7 @@ action_dump ()
{
if (!format_str)
{
mh_error (_("Format string not specified"));
mu_error (_("Format string not specified"));
return 1;
}
mh_format_dump (&format);
......@@ -112,7 +113,7 @@ main (int argc, char **argv)
if (format_str && mh_format_parse (format_str, &format))
{
mh_error (_("Bad format string"));
mu_error (_("Bad format string"));
exit (1);
}
return (*action) ();
......
......@@ -329,7 +329,7 @@ _scan (const char *name, size_t depth)
if (!dir)
{
mh_error (_("Cannot scan folder %s: %s"), name, strerror (errno));
mu_error (_("Cannot scan folder %s: %s"), name, strerror (errno));
return;
}
......@@ -364,7 +364,7 @@ _scan (const char *name, size_t depth)
{
asprintf (&p, "%s/%s", name, entry->d_name);
if (stat (p, &st) < 0)
mh_error (_("Cannot stat %s: %s"), p, strerror (errno));
mu_error (_("Cannot stat %s: %s"), p, strerror (errno));
else if (S_ISDIR (st.st_mode))
{
info.others++;
......@@ -624,7 +624,7 @@ pack_rename (struct pack_tab *tab, int reverse)
if (!dry_run)
{
if ((rc = rename (from, to)))
mh_error (_("cannot rename `%s' to `%s': %s"),
mu_error (_("cannot rename `%s' to `%s': %s"),
from, to, mu_strerror (errno));
}
else
......@@ -661,11 +661,11 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
return;
start = i - 1;
mh_error (_("Rolling back changes..."));
mu_error (_("Rolling back changes..."));
while (--i >= 0)
if (pack_rename (pack_tab + i, 1))
{
mh_error (_("CRITICAL ERROR: Folder `%s' left in an inconsistent state, because an error\n"
mu_error (_("CRITICAL ERROR: Folder `%s' left in an inconsistent state, because an error\n"
"occurred while trying to roll back the changes.\n"
"Message range %s-%s has been renamed to %s-%s."),
folder_name,
......@@ -673,10 +673,10 @@ roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
mu_umaxtostr (1, pack_tab[start].orig),
mu_umaxtostr (2, pack_tab[0].new),
mu_umaxtostr (3, pack_tab[start].new));
mh_error (_("You will have to fix it manually."));
mu_error (_("You will have to fix it manually."));
exit (1);
}
mh_error (_("Folder `%s' restored successfully"), folder_name);
mu_error (_("Folder `%s' restored successfully"), folder_name);
}
struct fixup_data
......@@ -781,7 +781,7 @@ action_pack ()
/* Allocate pack table */
if (mu_mailbox_messages_count (mbox, &count))
{
mh_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
mu_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
return 1;
}
pack_tab = xcalloc (count, sizeof pack_tab[0]); /* Never freed. No use to
......@@ -797,7 +797,7 @@ action_pack ()
status = mu_mailbox_get_message (mbox, i + 1, &msg);
if (status)
{
mh_error (_("%d: cannot get message: %s"), i, mu_strerror (status));
mu_error (_("%d: cannot get message: %s"), i, mu_strerror (status));
return 1;
}
mh_message_number (msg, &pack_tab[i].orig);
......@@ -829,7 +829,7 @@ action_pack ()
status = chdir (folder_dir);
if (status)
{
mh_error (_("cannot change to directory `%s': %s"),
mu_error (_("cannot change to directory `%s': %s"),
folder_dir, mu_strerror (status));
return 1;
}
......@@ -901,7 +901,7 @@ main (int argc, char **argv)
}
else if (argc - index > 1)
{
mh_error (_("Too many arguments"));
mu_error (_("Too many arguments"));
exit (1);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -341,7 +341,7 @@ finish_draft ()
MU_STREAM_WRITE|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (stream)))
{
mh_error (_("Cannot open output file `%s': %s"),
mu_error (_("Cannot open output file `%s': %s"),
wh_env.file, mu_strerror (rc));
exit (1);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -189,7 +189,7 @@ main (int argc, char **argv)
if (!quiet && mh_format_parse (format_str, &format))
{
mh_error (_("Bad format string"));
mu_error (_("Bad format string"));
exit (1);
}
......@@ -198,7 +198,7 @@ main (int argc, char **argv)
{
if ((rc = mu_mailbox_create_default (&input, NULL)) != 0)
{
mh_error (_("Cannot create default mailbox"),
mu_error (_("Cannot create default mailbox"),
mu_strerror (rc));
exit (1);
}
......@@ -207,7 +207,7 @@ main (int argc, char **argv)
}
else if ((rc = mu_mailbox_create_default (&input, input_file)) != 0)
{
mh_error (_("Cannot create mailbox %s: %s"),
mu_error (_("Cannot create mailbox %s: %s"),
input_file, mu_strerror (rc));
exit (1);
}
......@@ -216,7 +216,7 @@ main (int argc, char **argv)
{
mu_url_t url;
mu_mailbox_get_url (input, &url);
mh_error (_("Cannot open mailbox %s: %s"),
mu_error (_("Cannot open mailbox %s: %s"),
mu_url_to_string (url),
mu_strerror (errno));
exit (1);
......@@ -224,14 +224,14 @@ main (int argc, char **argv)
if ((rc = mu_mailbox_messages_count (input, &total)) != 0)
{
mh_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
mu_error (_("Cannot read input mailbox: %s"), mu_strerror (errno));
exit (1);
}
output = mh_open_folder (append_folder, 1);
if ((rc = mu_mailbox_messages_count (output, &lastmsg)) != 0)
{
mh_error (_("Cannot read output mailbox: %s"),
mu_error (_("Cannot read output mailbox: %s"),
mu_strerror (errno));
exit (1);
}
......@@ -252,14 +252,14 @@ main (int argc, char **argv)
if ((rc = mu_mailbox_get_message (input, n, &imsg)) != 0)
{
mh_error (_("%d: cannot get message: %s"),
mu_error (_("%d: cannot get message: %s"),
n, mu_strerror (rc));
continue;
}
if ((rc = mu_mailbox_append_message (output, imsg)) != 0)
{
mh_error (_("%d: error appending message: %s"),
mu_error (_("%d: error appending message: %s"),
n, mu_strerror (rc));
continue;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -70,7 +70,7 @@ add_sequence (char *name)
{
if (!seq_list && mu_list_create (&seq_list))
{
mh_error (_("Cannot create sequence list"));
mu_error (_("Cannot create sequence list"));
exit (1);
}
mu_list_append (seq_list, name);
......@@ -216,7 +216,7 @@ main (int argc, char **argv)
case ARG_ADD:
if (!seq_list)
{
mh_error (_("--add requires at least one --sequence argument"));
mu_error (_("--add requires at least one --sequence argument"));
return 1;
}
mu_list_do (seq_list, action_add, (void *) &msgset);
......@@ -226,7 +226,7 @@ main (int argc, char **argv)
case ARG_DELETE:
if (!seq_list)
{
mh_error (_("--delete requires at least one --sequence argument"));
mu_error (_("--delete requires at least one --sequence argument"));
return 1;
}
mu_list_do (seq_list, action_delete, (void *) &msgset);
......
%{
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -38,9 +38,9 @@ va_ali_parse_error_loc (char *name, size_t line, char *fmt, va_list ap)
vasprintf (&buf, fmt, ap);
if (name)
mh_error ("%s:%lu: %s", name, (unsigned long) line, buf);
mu_error ("%s:%lu: %s", name, (unsigned long) line, buf);
else
mh_error ("%s", buf);
mu_error ("%s", buf);
free (buf);
}
......
......@@ -382,7 +382,7 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
mu_iterator_current (itr, (void **)&item);
if (mu_address_create (&a, item))
{
mh_error (_("Error expanding aliases -- invalid address `%s'"),
mu_error (_("Error expanding aliases -- invalid address `%s'"),
item);
}
else
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002, 2005,
2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -170,7 +171,7 @@ mh_argp_parse (int *pargc, char **pargv[],
*pindex = index;
else if (extra)
{
mh_error (_("Extra arguments"));
mu_error (_("Extra arguments"));
exit (1);
}
mh_init2 ();
......
......@@ -143,7 +143,7 @@ mh_context_write (mh_context_t *ctx)
fp = fopen (ctx->name, "w");
if (!fp)
{
mh_error (_("Cannot open context file %s: %s"),
mu_error (_("Cannot open context file %s: %s"),
ctx->name, strerror (errno));
return MU_ERR_FAILURE;
}
......@@ -193,7 +193,7 @@ mh_context_set_value (mh_context_t *ctx, const char *name, const char *value)
int rc;
if ((rc = mu_header_create (&ctx->header, NULL, 0, NULL)) != 0)
{
mh_error (_("Cannot create context %s: %s"),
mu_error (_("Cannot create context %s: %s"),
ctx->name,
mu_strerror (rc));
return 1;
......
......@@ -206,7 +206,7 @@ function : FUNCTION
else
{
yyerror (_("undefined function"));
mh_error ($1);
mu_error ($1);
YYERROR;
}
}
......@@ -357,9 +357,9 @@ int
yyerror (char *s)
{
int len;
mh_error ("%s: %s", start, s);
mu_error ("%s: %s", start, s);
len = curp - start;
mh_error ("%*.*s^", len, len, "");
mu_error ("%*.*s^", len, len, "");
return 0;
}
......@@ -637,7 +637,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
}
else
{
mh_error (_("Missing argument for %s"), bp->name);
mu_error (_("Missing argument for %s"), bp->name);
return 0;
}
}
......@@ -646,7 +646,7 @@ mh_code_builtin (mh_builtin_t *bp, int argtype)
switch (bp->argtype)
{
case mhtype_none:
mh_error (_("Extra arguments to %s"), bp->name);
mu_error (_("Extra arguments to %s"), bp->name);
return 0;
case mhtype_num:
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -601,7 +601,7 @@ mh_format (mh_format_t *fmt, mu_message_t msg, size_t msgno,
break;
default:
mh_error (_("INTERNAL ERROR: Unknown opcode: %x"), opcode);
mu_error (_("INTERNAL ERROR: Unknown opcode: %x"), opcode);
abort ();
}
}
......@@ -807,7 +807,7 @@ mh_format_dump (mh_format_t *fmt)
break;
default:
mh_error ("Unknown opcode: %x", opcode);
mu_error ("Unknown opcode: %x", opcode);
abort ();
}
printf ("\n");
......@@ -831,7 +831,7 @@ mh_format_free (mh_format_t *fmt)
static void
builtin_not_implemented (char *name)
{
mh_error ("%s is not yet implemented.", name);
mu_error ("%s is not yet implemented.", name);
}
static void
......@@ -944,7 +944,7 @@ builtin_divide (struct mh_machine *mach)
if (!mach->arg_num)
{
/* TRANSLATORS: Do not translate the word 'format'! */
mh_error (_("format: divide by zero"));
mu_error (_("format: divide by zero"));
mach->stop = 1;
}
else
......@@ -956,7 +956,7 @@ builtin_modulo (struct mh_machine *mach)
{
if (!mach->arg_num)
{
mh_error (_("format: divide by zero"));
mu_error (_("format: divide by zero"));
mach->stop = 1;
}
else
......@@ -1091,7 +1091,7 @@ _parse_date (struct mh_machine *mach, struct tm *tm, mu_timezone *tz)
{
time_t t;
/*mh_error ("can't parse date: [%s]", date);*/
/*mu_error ("can't parse date: [%s]", date);*/
time (&t);
*tm = *localtime (&t);
tz->utc_offset = mu_utc_offset ();
......@@ -1873,7 +1873,7 @@ builtin_rcpt (struct mh_machine *mach)
int rc = mh_decode_rcpt_flag (strobj_ptr (&mach->arg_str));
if (rc == RCPT_NONE)
{
mh_error (_("Invalid recipient mask"));
mu_error (_("Invalid recipient mask"));
/* try to continue anyway */
}
mach->arg_num = rc & rcpt_mask;
......
......@@ -39,6 +39,14 @@ char mh_list_format[] =
"%<(zero)%17(friendly{from})%>"
" %{subject}%<{body}<<%{body}>>%>";
static int
mu_error_printer (const char *fmt, va_list ap)
{
fprintf (stderr, "%s: ", program_invocation_short_name);
vfprintf (stderr, fmt, ap);
fprintf (stderr, "\n");
return 0;
}
void
mh_init ()
......@@ -46,6 +54,8 @@ mh_init ()
/* Register all mailbox and mailer formats */
mu_register_all_formats ();
mu_error_set_print (mu_error_printer);
/* Read user's profile */
mh_read_profile ();
}
......@@ -68,14 +78,14 @@ mh_read_formfile (char *name, char **pformat)
if (stat (name, &st))
{
mh_error (_("Cannot stat format file %s: %s"), name, strerror (errno));
mu_error (_("Cannot stat format file %s: %s"), name, strerror (errno));
return -1;
}
fp = fopen (name, "r");
if (!fp)
{
mh_error (_("Cannot open format file %s: %s"), name, strerror (errno));
mu_error (_("Cannot open format file %s: %s"), name, strerror (errno));
return -1;
}
......@@ -110,7 +120,7 @@ mh_read_formfile (char *name, char **pformat)
void
mh_err_memory (int fatal)
{
mh_error (_("Not enough memory"));
mu_error (_("Not enough memory"));
if (fatal)
abort ();
}
......@@ -126,7 +136,7 @@ mh_get_my_name (char *name)
struct passwd *pw = getpwuid (getuid ());
if (!pw)
{
mh_error (_("Cannot determine my username"));
mu_error (_("Cannot determine my username"));
return;
}
name = pw->pw_name;
......@@ -228,12 +238,12 @@ make_dir_hier (const char *p, mode_t perm)
{
if (errno != ENOENT)
{
mh_error (_("Cannot create directory %s: error accessing name component %s: %s"),
mu_error (_("Cannot create directory %s: error accessing name component %s: %s"),
dir, strerror (errno));
rc = 1;
}
else if ((rc = mkdir (dir, perm)))
mh_error (_("Cannot create directory %s: error creating name component %s: %s"),
mu_error (_("Cannot create directory %s: error creating name component %s: %s"),
dir, rc);
}
*q = '/';
......@@ -258,7 +268,7 @@ mh_makedir (char *p)
{
rc = mkdir (p, perm);
if (rc)
mh_error (_("Cannot create directory %s: %s"),
mu_error (_("Cannot create directory %s: %s"),
p, strerror (errno));
}
......@@ -288,7 +298,7 @@ mh_check_folder (char *pathname, int confirm)
}
else
{
mh_error (_("Cannot stat %s: %s"), p, strerror (errno));
mu_error (_("Cannot stat %s: %s"), p, strerror (errno));
return 1;
}
}
......@@ -379,7 +389,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
asprintf (&p, "%s/%s", mu_folder_directory (), namep);
if (!p)
{
mh_error (_("Not enough memory"));
mu_error (_("Not enough memory"));
exit (1);
}
free (namep);
......@@ -389,7 +399,7 @@ mh_audit_open (char *name, mu_mailbox_t mbox)
fp = fopen (namep, "a");
if (!fp)
{
mh_error (_("Cannot open audit file %s: %s"), namep, strerror (errno));
mu_error (_("Cannot open audit file %s: %s"), namep, strerror (errno));
free (namep);
return NULL;
}
......@@ -432,7 +442,7 @@ mh_open_folder (const char *folder, int create)
if (mu_mailbox_create_default (&mbox, name))
{
mh_error (_("Cannot create mailbox %s: %s"),
mu_error (_("Cannot create mailbox %s: %s"),
name, strerror (errno));
exit (1);
}
......@@ -442,7 +452,7 @@ mh_open_folder (const char *folder, int create)
if (mu_mailbox_open (mbox, flags))
{
mh_error (_("Cannot open mailbox %s: %s"), name, strerror (errno));
mu_error (_("Cannot open mailbox %s: %s"), name, strerror (errno));
exit (1);
}
......@@ -518,7 +528,7 @@ mh_iterate (mu_mailbox_t mbox, mh_msgset_t *msgset,
num = msgset->list[i];
if ((rc = mu_mailbox_get_message (mbox, num, &msg)) != 0)
{
mh_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
mu_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
return 1;
}
......@@ -536,7 +546,7 @@ mh_spawnp (const char *prog, const char *file)
if (mu_argcv_get (prog, "", "#", &argc, &argv))
{
mh_error (_("Cannot split line %s"), prog);
mu_error (_("Cannot split line %s"), prog);
mu_argcv_free (argc, argv);
return 1;
}
......@@ -574,7 +584,7 @@ mh_file_copy (const char *from, const char *to)
if (stat (from, &st))
{
mh_error ("mh_copy: %s", mu_strerror (errno));
mu_error ("mh_copy: %s", mu_strerror (errno));
return -1;
}
......@@ -588,7 +598,7 @@ mh_file_copy (const char *from, const char *to)
if ((rc = mu_file_stream_create (&in, from, MU_STREAM_READ)) != 0
|| (rc = mu_stream_open (in)))
{
mh_error (_("Cannot open input file `%s': %s"),
mu_error (_("Cannot open input file `%s': %s"),
from, mu_strerror (rc));
free (buffer);
return 1;
......@@ -597,7 +607,7 @@ mh_file_copy (const char *from, const char *to)
if ((rc = mu_file_stream_create (&out, to, MU_STREAM_RDWR|MU_STREAM_CREAT)) != 0
|| (rc = mu_stream_open (out)))
{
mh_error (_("Cannot open output file `%s': %s"),
mu_error (_("Cannot open output file `%s': %s"),
to, mu_strerror (rc));
free (buffer);
mu_stream_close (in);
......@@ -611,7 +621,7 @@ mh_file_copy (const char *from, const char *to)
{
if ((rc = mu_stream_sequential_write (out, buffer, rdsize)) != 0)
{
mh_error (_("Write error on `%s': %s"),
mu_error (_("Write error on `%s': %s"),
to, mu_strerror (rc));
break;
}
......@@ -640,20 +650,20 @@ mh_file_to_message (const char *folder, char *file_name)
if (stat (file_name, &st) < 0)
{
mh_error (_("Cannot stat file %s: %s"), file_name, strerror (errno));
mu_error (_("Cannot stat file %s: %s"), file_name, strerror (errno));
return NULL;
}
if ((rc = mu_file_stream_create (&instream, file_name, MU_STREAM_READ)))
{
mh_error (_("Cannot create input stream (file %s): %s"),
mu_error (_("Cannot create input stream (file %s): %s"),
file_name, mu_strerror (rc));
return NULL;
}
if ((rc = mu_stream_open (instream)))
{
mh_error (_("Cannot open input stream (file %s): %s"),
mu_error (_("Cannot open input stream (file %s): %s"),
file_name, mu_strerror (rc));
mu_stream_destroy (&instream, mu_stream_get_owner (instream));
return NULL;
......@@ -765,7 +775,7 @@ mh_install (char *name, int automode)
}
else
{
mh_error(_("Cannot stat %s: %s"), name, mu_strerror (errno));
mu_error(_("Cannot stat %s: %s"), name, mu_strerror (errno));
exit (1);
}
}
......@@ -851,7 +861,7 @@ mh_set_reply_regex (const char *str)
char *err;
int rc = mu_unre_set_regex (str, 0, &err);
if (rc)
mh_error ("reply_regex: %s%s%s", mu_strerror (rc),
mu_error ("reply_regex: %s%s%s", mu_strerror (rc),
err ? ": " : "",
err ? err : "");
}
......@@ -1019,14 +1029,3 @@ mh_draft_message (const char *name, const char *msgspec, char **pname)
mu_mailbox_destroy (&mbox);
return rc;
}
void
mh_error(const char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
fprintf (stderr, "%s: ", program_invocation_short_name);
vfprintf (stderr, fmt, ap);
fprintf (stderr, "\n");
va_end (ap);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -136,7 +136,7 @@ parse_component (locus_t *loc, mu_list_t formlist, char *compname, char *str)
stmt->v.component.name = compname;
if (mu_list_create (&stmt->v.component.format))
{
mh_error (_("%s:%d: cannot create list"),
mu_error (_("%s:%d: cannot create list"),
loc->filename,
loc->line);
exit (1); /* FIXME */
......@@ -155,7 +155,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
if (mu_argcv_get (str, ",=", NULL, &argc, &argv))
{
mh_error (_("%s:%d: cannot split string %s"),
mu_error (_("%s:%d: cannot split string %s"),
loc->filename,
loc->line,
str);
......@@ -172,7 +172,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
var = variable_lookup (name);
if (!var)
{
mh_error (_("%s:%d: unknown variable: %s"),
mu_error (_("%s:%d: unknown variable: %s"),
loc->filename,
loc->line,
argv[i]);
......@@ -188,7 +188,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
if ((var->type == dt_flag && value)
|| (var->type != dt_flag && !value))
{
mh_error (_("%s:%d: wrong datatype for %s"),
mu_error (_("%s:%d: wrong datatype for %s"),
loc->filename,
loc->line,
var->name);
......@@ -208,7 +208,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
case dt_format:
if (mh_format_parse (value, &fmt))
{
mh_error (_("%s:%d: bad format string"),
mu_error (_("%s:%d: bad format string"),
loc->filename,
loc->line);
exit (1);
......@@ -227,7 +227,7 @@ parse_variable (locus_t *loc, mu_list_t formlist, char *str)
i++;
if (i < argc && argv[i][0] != ',')
{
mh_error (_("%s:%d: syntax error"), loc->filename, loc->line);
mu_error (_("%s:%d: syntax error"), loc->filename, loc->line);
exit (1);
}
}
......@@ -261,14 +261,14 @@ mhl_format_compile (char *name)
fp = fopen (name, "r");
if (!fp)
{
mh_error (_("Cannot open file %s: %s"), name, mu_strerror (errno));
mu_error (_("Cannot open file %s: %s"), name, mu_strerror (errno));
return NULL;
}
if (mu_list_create (&formlist))
{
fclose (fp);
mh_error (_("Cannot create list"));
mu_error (_("Cannot create list"));
return NULL;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -39,7 +39,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc)
static void
msgset_abort (const char *arg)
{
mh_error (_("Bad message list `%s'"), arg);
mu_error (_("Bad message list `%s'"), arg);
exit (1);
}
......@@ -61,7 +61,7 @@ msgset_last (mu_mailbox_t mbox, size_t *pnum)
rc = mu_mailbox_messages_count (mbox, &count);
if (rc)
{
mh_error (_("Cannot get last message: %s"), mu_strerror (rc));
mu_error (_("Cannot get last message: %s"), mu_strerror (rc));
exit (1);
}
*pnum = count;
......@@ -94,7 +94,7 @@ msgset_cur (mu_mailbox_t mbox, size_t *pnum)
return 0;
}
}
mh_error (_("no cur message"));
mu_error (_("no cur message"));
exit (1);
}
......@@ -105,7 +105,7 @@ msgset_prev (mu_mailbox_t mbox, size_t *pnum)
msgset_cur (mbox, &cur_n);
if (cur_n < 1)
{
mh_error (_("no prev message"));
mu_error (_("no prev message"));
exit (1);
}
*pnum = cur_n - 1;
......@@ -120,7 +120,7 @@ msgset_next (mu_mailbox_t mbox, size_t *pnum)
mu_mailbox_messages_count (mbox, &total);
if (cur_n + 1 > total)
{
mh_error (_("no next message"));
mu_error (_("no next message"));
exit (1);
}
*pnum = cur_n + 1;
......@@ -161,7 +161,7 @@ msgset_preproc_part (mu_mailbox_t mbox, char *arg, char **rest)
rc = mu_mailbox_get_message (mbox, num, &msg);
if (rc)
{
mh_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
mu_error (_("Cannot get message %d: %s"), num, mu_strerror (rc));
exit (1);
}
*rest = arg + strlen (p->name);
......@@ -330,7 +330,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
if (expand_user_seq (mbox, &m, arg))
{
mh_error (_("message set %s does not exist"), arg);
mu_error (_("message set %s does not exist"), arg);
exit (1);
}
_expand (&msgcnt, &msglist, m.count);
......@@ -347,7 +347,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
n = mh_get_message (mbox, start, NULL);
if (!n)
{
mh_error (_("message %d does not exist"), start);
mu_error (_("message %d does not exist"), start);
exit (1);
}
msglist[msgno++] = n;
......@@ -373,7 +373,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
}
if (msgno == msg_first)
{
mh_error (_("no messages in range %s"), argv[i]);
mu_error (_("no messages in range %s"), argv[i]);
exit (1);
}
break;
......@@ -407,7 +407,7 @@ _mh_msgset_parse (mu_mailbox_t mbox, mh_msgset_t *msgset, int argc, char **argv)
}
if (msgno == msg_first)
{
mh_error (_("no messages in range %s"), argv[i]);
mu_error (_("no messages in range %s"), argv[i]);
exit (1);
}
break;
......@@ -601,7 +601,7 @@ mh_msgset_negate (mu_mailbox_t mbox, mh_msgset_t *msgset)
list = realloc (list, sizeof (list[0]) * msgno);
if (!list)
{
mh_error (_("Not enough memory"));
mu_error (_("Not enough memory"));
abort ();
}
mh_msgset_free (msgset);
......
......@@ -34,7 +34,7 @@ mh_stream_to_message (mu_stream_t instream)
rc = mu_stream_to_message (instream, &msg);
if (rc)
{
mh_error (_("cannot open draft message stream: %s"),
mu_error (_("cannot open draft message stream: %s"),
mu_strerror (rc));
return NULL;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -55,7 +55,7 @@ func (struct action_tab *p, const char *name)
return p->fp;
}
mh_error (_("%s is unknown. Hit <CR> for help"), name);
mu_error (_("%s is unknown. Hit <CR> for help"), name);
return NULL;
}
......@@ -195,13 +195,13 @@ display_file (const char *name)
rc = mu_file_stream_create (&stream, name, MU_STREAM_READ);
if (rc)
{
mh_error ("mu_file_stream_create: %s", mu_strerror (rc));
mu_error ("mu_file_stream_create: %s", mu_strerror (rc));
return;
}
rc = mu_stream_open (stream);
if (rc)
{
mh_error ("mu_stream_open: %s", mu_strerror (rc));
mu_error ("mu_stream_open: %s", mu_strerror (rc));
return;
}
......@@ -223,17 +223,17 @@ check_exit_status (char *progname, int status)
{
if (WEXITSTATUS (status))
{
mh_error (_("Command `%s' exited with status %d"),
mu_error (_("Command `%s' exited with status %d"),
progname, WEXITSTATUS(status));
return 1;
}
return 0;
}
else if (WIFSIGNALED (status))
mh_error (_("Command `%s' terminated on signal %d"),
mu_error (_("Command `%s' terminated on signal %d"),
progname, WTERMSIG (status));
else
mh_error (_("Command `%s' terminated abnormally"), progname);
mu_error (_("Command `%s' terminated abnormally"), progname);
return 1;
}
......@@ -371,7 +371,7 @@ static int
display (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
{
if (!wh->msg)
mh_error (_("no alternate message to display"));
mu_error (_("no alternate message to display"));
else
display_file (wh->msg);
return 0;
......@@ -395,7 +395,7 @@ static int
list (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
{
if (!wh->file)
mh_error (_("no draft file to display"));
mu_error (_("no draft file to display"));
else
display_file (wh->file);
return 0;
......@@ -453,7 +453,7 @@ static int
whom (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
{
if (!wh->file)
mh_error (_("no draft file to display"));
mu_error (_("no draft file to display"));
else
mh_whom (wh->file, (argc == 2
&& (strcmp (argv[1], "-check") == 0
......
......@@ -35,7 +35,7 @@ addrcp (mu_list_t *list, char *addr, int isbcc)
p->isbcc = isbcc;
if (!*list && (rc = mu_list_create (list)))
{
mh_error (_("Cannot create list: %s"), mu_strerror (rc));
mu_error (_("Cannot create list: %s"), mu_strerror (rc));
exit (1);
}
mu_list_append (*list, p);
......@@ -106,7 +106,7 @@ mh_alias_expand (char *str, mu_address_t *paddr, int *incl)
int status;
mu_argcv_string (argc, argv, &buf);
if (status = mu_address_create (paddr, buf))
mh_error (_("Bad address `%s': %s"), buf, mu_strerror (status));
mu_error (_("Bad address `%s': %s"), buf, mu_strerror (status));
free (buf);
}
......@@ -141,7 +141,7 @@ scan_addrs (char *str, int isbcc)
rc = mu_address_aget_email (addr, i, &buf);
if (rc)
{
mh_error ("mu_address_aget_email: %s", mu_strerror (rc));
mu_error ("mu_address_aget_email: %s", mu_strerror (rc));
continue;
}
......@@ -227,7 +227,7 @@ mh_whom (char *filename, int check)
ctx = mh_context_create (filename, 1);
if (mh_context_read (ctx))
{
mh_error (_("Malformed message"));
mu_error (_("Malformed message"));
rc = -1;
}
else
......@@ -252,7 +252,7 @@ mh_whom (char *filename, int check)
if (count == 0)
{
mh_error(_("No recipients"));
mu_error(_("No recipients"));
rc = -1;
}
}
......
......@@ -165,13 +165,13 @@ open_output ()
if (rc)
{
mh_error (_("Cannot create output stream: %s"), mu_strerror (rc));
mu_error (_("Cannot create output stream: %s"), mu_strerror (rc));
exit (1);
}
if ((rc = mu_stream_open (output)))
{
mh_error (_("Cannot open output stream: %s"), mu_strerror (rc));
mu_error (_("Cannot open output stream: %s"), mu_strerror (rc));
exit (1);
}
return output;
......@@ -190,13 +190,13 @@ list_message (char *name, mu_stream_t output)
rc = mu_file_stream_create (&input, name, MU_STREAM_READ);
if (rc)
{
mh_error (_("Cannot create input stream: %s"), mu_strerror (rc));
mu_error (_("Cannot create input stream: %s"), mu_strerror (rc));
return;
}
if ((rc = mu_stream_open (input)))
{
mh_error (_("Cannot open input stream: %s"), mu_strerror (rc));
mu_error (_("Cannot open input stream: %s"), mu_strerror (rc));
mu_stream_destroy (&input, mu_stream_get_owner (input));
return;
}
......@@ -204,7 +204,7 @@ list_message (char *name, mu_stream_t output)
msg = mh_stream_to_message (input);
if (!msg)
{
mh_error (_("Input stream %s is not a message (%s)"),
mu_error (_("Input stream %s is not a message (%s)"),
name, mu_strerror (rc));
mu_stream_close (input);
mu_stream_destroy (&input, mu_stream_get_owner (input));
......
......@@ -549,7 +549,7 @@ msg_part_parse (char *str)
str = endp;
break;
default:
mh_error (_("Malformed part specification (near %s)"), endp);
mu_error (_("Malformed part specification (near %s)"), endp);
exit (1);
}
msg_part_incr (p);
......@@ -1262,7 +1262,7 @@ show_internal (mu_message_t msg, msg_part_t part, char *encoding, mu_stream_t ou
if ((rc = mu_message_get_body (msg, &body)))
{
mh_error (_("%s: cannot get message body: %s"),
mu_error (_("%s: cannot get message body: %s"),
mu_umaxtostr (0, msg_part_subpart (part, 0)),
mu_strerror (rc));
return 0;
......@@ -1284,14 +1284,14 @@ mhn_exec (mu_stream_t *str, char *cmd, int flags)
int rc = mu_prog_stream_create (str, cmd, MU_STREAM_WRITE);
if (rc)
{
mh_error (_("Cannot create proc stream (command %s): %s"),
mu_error (_("Cannot create proc stream (command %s): %s"),
cmd, mu_strerror (rc));
}
else
{
rc = mu_stream_open (*str);
if (rc)
mh_error (_("Cannot open proc stream (command %s): %s"),
mu_error (_("Cannot open proc stream (command %s): %s"),
cmd, mu_strerror (rc));
}
return rc;
......@@ -1332,14 +1332,14 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
if (mu_argcv_get (cmd, "", "#", &argc, &argv))
{
mh_error (_("Cannot parse command line `%s'"), cmd);
mu_error (_("Cannot parse command line `%s'"), cmd);
return ENOSYS;
}
rc = mu_file_stream_create (&tmp, tempfile, MU_STREAM_RDWR);
if (rc)
{
mh_error (_("Cannot create temporary stream (file %s): %s"),
mu_error (_("Cannot create temporary stream (file %s): %s"),
tempfile, mu_strerror (rc));
mu_argcv_free (argc, argv);
return rc;
......@@ -1347,7 +1347,7 @@ mhn_run_command (mu_message_t msg, msg_part_t part,
rc = mu_stream_open (tmp);
if (rc)
{
mh_error (_("Cannot open temporary stream (file %s): %s"),
mu_error (_("Cannot open temporary stream (file %s): %s"),
tempfile, mu_strerror (rc));
mu_stream_destroy (&tmp, mu_stream_get_owner (tmp));
mu_argcv_free (argc, argv);
......@@ -1473,13 +1473,13 @@ mhn_show ()
rc = mu_stdio_stream_create (&ostr, stdout, 0);
if (rc)
{
mh_error (_("Cannot create output stream: %s"), mu_strerror (rc));
mu_error (_("Cannot create output stream: %s"), mu_strerror (rc));
exit (1);
}
rc = mu_stream_open (ostr);
if (rc)
{
mh_error (_("Cannot open output stream: %s"), mu_strerror (rc));
mu_error (_("Cannot open output stream: %s"), mu_strerror (rc));
exit (1);
}
......@@ -1688,7 +1688,7 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
rc = mu_file_stream_create (&out, name, MU_STREAM_WRITE|MU_STREAM_CREAT);
if (rc)
{
mh_error (_("Cannot create output stream (file %s): %s"),
mu_error (_("Cannot create output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
return rc;
......@@ -1696,7 +1696,7 @@ store_handler (mu_message_t msg, msg_part_t part, char *type, char *encoding,
rc = mu_stream_open (out);
if (rc)
{
mh_error (_("Cannot open output stream (file %s): %s"),
mu_error (_("Cannot open output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
mu_stream_destroy (&out, mu_stream_get_owner (out));
......@@ -1810,7 +1810,7 @@ parse_brace (char **pval, char **cmd, int c, struct compose_env *env)
if (!sp)
{
mh_error (_("%s:%lu: missing %c"),
mu_error (_("%s:%lu: missing %c"),
input_file,
(unsigned long) mhn_error_loc (env),
c);
......@@ -1845,7 +1845,7 @@ parse_content_type (struct compose_env *env,
case '(':
if (comment)
{
mh_error (_("%s:%lu: comment redefined"),
mu_error (_("%s:%lu: comment redefined"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -1857,7 +1857,7 @@ parse_content_type (struct compose_env *env,
case '[':
if (!descr)
{
mh_error (_("%s:%lu: syntax error"),
mu_error (_("%s:%lu: syntax error"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -1866,7 +1866,7 @@ parse_content_type (struct compose_env *env,
if (*descr)
{
mh_error (_("%s:%lu: description redefined"),
mu_error (_("%s:%lu: description redefined"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -1878,7 +1878,7 @@ parse_content_type (struct compose_env *env,
case '<':
if (*id)
{
mh_error (_("%s:%lu: content id redefined"),
mu_error (_("%s:%lu: content id redefined"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -1897,7 +1897,7 @@ parse_content_type (struct compose_env *env,
skipws (rest);
if (*rest != '=')
{
mh_error (_("%s:%lu: syntax error"),
mu_error (_("%s:%lu: syntax error"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -1960,7 +1960,7 @@ parse_type_command (char **pcmd, struct compose_env *env, mu_header_t hdr)
if (!subtype)
{
mh_error (_("%s:%lu: missing subtype"),
mu_error (_("%s:%lu: missing subtype"),
input_file,
(unsigned long) mhn_error_loc (env));
return 1;
......@@ -2116,7 +2116,7 @@ edit_extern (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
if ((rc = mu_header_create (&hdr2, NULL, 0, NULL)) != 0)
{
mh_error (_("Cannot create header: %s"),
mu_error (_("Cannot create header: %s"),
mu_strerror (rc));
return 1;
}
......@@ -2175,7 +2175,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
case '[':
if (descr)
{
mh_error (_("%s:%lu: description redefined"),
mu_error (_("%s:%lu: description redefined"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -2187,7 +2187,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
case '<':
if (id)
{
mh_error (_("%s:%lu: content id redefined"),
mu_error (_("%s:%lu: content id redefined"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -2208,7 +2208,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
if (mu_argcv_get (cmd, "\n", NULL, &argc, &argv))
{
mh_error (_("%s:%lu: syntax error"),
mu_error (_("%s:%lu: syntax error"),
input_file,
(unsigned long) mhn_error_loc (env));
return 1;
......@@ -2222,7 +2222,7 @@ edit_forw (char *cmd, struct compose_env *env, mu_message_t *pmsg, int level)
mu_message_t input_msg;
if (mh_get_message (mbox, i, &input_msg) == 0)
{
mh_error (_("%s:%lu: no such message: %lu"),
mu_error (_("%s:%lu: no such message: %lu"),
input_file,
(unsigned long) mhn_error_loc (env),
(unsigned long)i);
......@@ -2313,7 +2313,7 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
}
else if (p == cmd)
{
mh_error (_("%s:%lu: missing filename"),
mu_error (_("%s:%lu: missing filename"),
input_file,
(unsigned long) mhn_error_loc (env));
finish_msg (env, msg);
......@@ -2324,14 +2324,14 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
rc = mu_file_stream_create (&in, cmd, MU_STREAM_READ);
if (rc)
{
mh_error (_("Cannot create input stream (file %s): %s"),
mu_error (_("Cannot create input stream (file %s): %s"),
cmd, mu_strerror (rc));
return rc;
}
rc = mu_stream_open (in);
if (rc)
{
mh_error (_("Cannot open input stream (file %s): %s"),
mu_error (_("Cannot open input stream (file %s): %s"),
cmd, mu_strerror (rc));
mu_stream_destroy (&in, mu_stream_get_owner (in));
return rc;
......@@ -2369,7 +2369,7 @@ edit_mime (char *cmd, struct compose_env *env, mu_message_t *msg, int level)
rc = mu_stream_open (fstr);
if (rc)
{
mh_error (_("Cannot open filter stream: %s"),
mu_error (_("Cannot open filter stream: %s"),
mu_strerror (rc));
return rc;
}
......@@ -2505,7 +2505,7 @@ mhn_edit (struct compose_env *env, int level)
{
if (level == 0)
{
mh_error (_("%s:%lu: unmatched #end"),
mu_error (_("%s:%lu: unmatched #end"),
input_file,
(unsigned long) mhn_error_loc (env));
status = 1;
......@@ -2718,7 +2718,7 @@ mhn_compose ()
rc = mu_file_stream_create (&stream, name, MU_STREAM_RDWR|MU_STREAM_CREAT);
if (rc)
{
mh_error (_("Cannot create output stream (file %s): %s"),
mu_error (_("Cannot create output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
return rc;
......@@ -2726,7 +2726,7 @@ mhn_compose ()
rc = mu_stream_open (stream);
if (rc)
{
mh_error (_("Cannot open output stream (file %s): %s"),
mu_error (_("Cannot open output stream (file %s): %s"),
name, mu_strerror (rc));
free (name);
mu_stream_destroy (&stream, mu_stream_get_owner (stream));
......@@ -2773,7 +2773,7 @@ main (int argc, char **argv)
{
if (argc)
{
mh_error (_("extra arguments"));
mu_error (_("extra arguments"));
return 1;
}
message = mh_file_to_message (mu_folder_directory (), input_file);
......@@ -2784,7 +2784,7 @@ main (int argc, char **argv)
{
if (argc > 1)
{
mh_error (_("extra arguments"));
mu_error (_("extra arguments"));
return 1;
}
input_file = argc == 1 ? argv[0] : "draft";
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -138,7 +138,7 @@ add_sequence (char *name)
{
if (!seq_list && mu_list_create (&seq_list))
{
mh_error (_("Cannot create sequence list"));
mu_error (_("Cannot create sequence list"));
exit (1);
}
mu_list_append (seq_list, name);
......@@ -278,7 +278,7 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
{
if (state->next == state->argc)
{
mh_error (_("Invalid option -- %s"), s);
mu_error (_("Invalid option -- %s"), s);
exit (1);
}
p = state->argv[state->next++];
......
%{
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -85,7 +85,7 @@ regex : cflags T_STRING
{
char errbuf[512];
regerror (rc, &$$, errbuf, sizeof (errbuf));
mh_error ("error compiling regex \"%s\": %s",
mu_error ("error compiling regex \"%s\": %s",
$2, errbuf);
YYERROR;
}
......@@ -113,7 +113,7 @@ expr : lbrace exprlist rbrace
time_t t;
if (mu_parse_date ($2, &t, NULL))
{
mh_error (_("bad date format: %s"), $2);
mu_error (_("bad date format: %s"), $2);
exit (1);
}
$$ = pick_node_create (node_before, NULL, NULL);
......@@ -124,7 +124,7 @@ expr : lbrace exprlist rbrace
time_t t;
if (mu_parse_date ($2, &t, NULL))
{
mh_error (_("bad date format: %s"), $2);
mu_error (_("bad date format: %s"), $2);
exit (1);
}
$$ = pick_node_create (node_after, NULL, NULL);
......@@ -227,9 +227,9 @@ yyerror (char *s)
str = tokname (tok);
if (nesting_level)
mh_error (_("%s near %s (missing closing brace?)"), s, str);
mu_error (_("%s near %s (missing closing brace?)"), s, str);
else
mh_error (_("%s near %s"), s, str);
mu_error (_("%s near %s"), s, str);
return 0;
}
......@@ -241,7 +241,7 @@ pick_add_token (mu_list_t *list, int tok, char *val)
if (!*list && (rc = mu_list_create (list)))
{
mh_error(_("cannot create list: %s"), mu_strerror (rc));
mu_error(_("cannot create list: %s"), mu_strerror (rc));
exit (1);
}
tp = xmalloc (sizeof (*tp));
......@@ -430,7 +430,7 @@ set_cflags (char *str)
break;
default:
mh_error (_("Invalid regular expression flag: %c"), *str);
mu_error (_("Invalid regular expression flag: %c"), *str);
exit (1);
}
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002,2003,2004,2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -74,7 +74,7 @@ add_folder (const char *folder)
{
if (!folder_name_list && mu_list_create (&folder_name_list))
{
mh_error (_("Cannot create folder list"));
mu_error (_("Cannot create folder list"));
exit (1);
}
mu_list_append (folder_name_list, strdup (folder));
......@@ -87,19 +87,19 @@ open_folders ()
if (!folder_name_list)
{
mh_error (_("No folder specified"));
mu_error (_("No folder specified"));
exit (1);
}
if (mu_list_create (&folder_mbox_list))
{
mh_error (_("Cannot create folder list"));
mu_error (_("Cannot create folder list"));
exit (1);
}
if (mu_list_get_iterator (folder_name_list, &itr))
{
mh_error (_("Cannot create iterator"));
mu_error (_("Cannot create iterator"));
exit (1);
}
......@@ -124,7 +124,7 @@ enumerate_folders (void (*f) (void *, mu_mailbox_t), void *data)
if (mu_list_get_iterator (folder_mbox_list, &itr))
{
mh_error (_("Cannot create iterator"));
mu_error (_("Cannot create iterator"));
exit (1);
}
......@@ -198,7 +198,7 @@ refile_folder (void *data, mu_mailbox_t mbox)
rc = mu_mailbox_append_message (mbox, msg);
if (rc)
{
mh_error (_("Error appending message: %s"), mu_strerror (rc));
mu_error (_("Error appending message: %s"), mu_strerror (rc));
exit (1);
}
}
......@@ -258,7 +258,7 @@ main (int argc, char **argv)
if (argc > 0)
{
mh_error (_("Both message set and source file given"));
mu_error (_("Both message set and source file given"));
exit (1);
}
msg = mh_file_to_message (mu_folder_directory (), source_file);
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002,2003,2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -130,7 +130,7 @@ decode_cc_flag (const char *opt, const char *arg)
int rc = mh_decode_rcpt_flag (arg);
if (rc == RCPT_NONE)
{
mh_error (_("%s %s is unknown"), opt, arg);
mu_error (_("%s %s is unknown"), opt, arg);
exit (1);
}
return rc;
......@@ -302,7 +302,7 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
rc = mu_mailbox_get_message (mbox, msgset.list[0], &msg);
if (rc)
{
mh_error (_("Cannot read message %s: %s"),
mu_error (_("Cannot read message %s: %s"),
mu_umaxtostr (0, msgset.list[0]),
mu_strerror (rc));
exit (1);
......@@ -323,14 +323,14 @@ make_draft (mu_mailbox_t mbox, int disp, struct mh_whatnow_env *wh)
MU_STREAM_WRITE|MU_STREAM_CREAT);
if (rc)
{
mh_error (_("Cannot create draft file stream %s: %s"),
mu_error (_("Cannot create draft file stream %s: %s"),
wh->file, mu_strerror (rc));
exit (1);
}
if ((rc = mu_stream_open (str)))
{
mh_error (_("Cannot open draft file %s: %s"),
mu_error (_("Cannot open draft file %s: %s"),
wh->file, mu_strerror (rc));
exit (1);
}
......@@ -385,7 +385,7 @@ main (int argc, char **argv)
opt_handler, NULL, &index);
if (mh_format_parse (format_str, &format))
{
mh_error (_("Bad format string"));
mu_error (_("Bad format string"));
exit (1);
}
......@@ -393,7 +393,7 @@ main (int argc, char **argv)
mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
if (msgset.count != 1)
{
mh_error (_("only one message at a time!"));
mu_error (_("only one message at a time!"));
return 1;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -125,7 +125,7 @@ rmf (const char *name)
if (!dir)
{
mh_error (_("Cannot scan folder %s: %s"), name, strerror (errno));
mu_error (_("Cannot scan folder %s: %s"), name, strerror (errno));
return 1;
}
......@@ -144,7 +144,7 @@ rmf (const char *name)
asprintf (&p, "%s/%s", name, entry->d_name);
if (stat (p, &st) < 0)
{
mh_error (_("Cannot stat %s: %s"), p, strerror (errno));
mu_error (_("Cannot stat %s: %s"), p, strerror (errno));
}
else if (S_ISDIR (st.st_mode))
{
......@@ -161,7 +161,7 @@ rmf (const char *name)
{
if (unlink (p))
{
mh_error (_("Cannot unlink %s: %s"), p, strerror (errno));
mu_error (_("Cannot unlink %s: %s"), p, strerror (errno));
failures++;
}
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2003,
2005 Free Software Foundation, Inc.
2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -186,7 +186,7 @@ main (int argc, char **argv)
if (mh_format_parse (format_str, &format))
{
mh_error (_("Bad format string"));
mu_error (_("Bad format string"));
exit (1);
}
......@@ -226,7 +226,7 @@ main (int argc, char **argv)
mu_url_t url = NULL;
mu_mailbox_get_url (mbox, &url);
mh_error (_("no messages in %s"), mu_url_to_string (url));
mu_error (_("no messages in %s"), mu_url_to_string (url));
}
clear_screen ();
......
......@@ -265,7 +265,7 @@ check_file (char *name)
return 1;
if (!mesg_list && mu_list_create (&mesg_list))
{
mh_error (_("Cannot create message list"));
mu_error (_("Cannot create message list"));
return 1;
}
......@@ -333,7 +333,7 @@ open_mailer ()
status = mu_mailer_create (&mailer, url);
if (status)
{
mh_error (_("Cannot create mailer `%s'"), url);
mu_error (_("Cannot create mailer `%s'"), url);
return NULL;
}
......@@ -348,7 +348,7 @@ open_mailer ()
status = mu_mailer_open (mailer, MU_STREAM_RDWR);
if (status)
{
mh_error (_("Cannot open mailer `%s'"), url);
mu_error (_("Cannot open mailer `%s'"), url);
return NULL;
}
return mailer;
......@@ -503,7 +503,7 @@ _action_send (void *item, void *data)
rc = mu_mailer_send_message (mailer, msg, NULL, NULL);
if (rc)
{
mh_error(_("Cannot send message: %s"), mu_strerror (rc));
mu_error(_("Cannot send message: %s"), mu_strerror (rc));
return 1;
}
......@@ -531,7 +531,7 @@ send (int argc, char **argv)
if (background && daemon (0, 0) < 0)
{
mh_error(_("Cannot switch to background: %s"), mu_strerror (errno));
mu_error(_("Cannot switch to background: %s"), mu_strerror (errno));
return 1;
}
......@@ -570,7 +570,7 @@ main (int argc, char **argv)
if (stat (xargv[0], &st))
{
mh_error(_("cannot stat %s: %s"), xargv[0], mu_strerror (errno));
mu_error(_("cannot stat %s: %s"), xargv[0], mu_strerror (errno));
return 1;
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -216,7 +216,7 @@ addop (char *field, compfun comp)
if (!oplist && mu_list_create (&oplist))
{
mh_error (_("can't create operation list"));
mu_error (_("can't create operation list"));
exit (1);
}
op->field = field;
......@@ -554,7 +554,7 @@ main (int argc, char **argv)
if (action == ACTION_LIST && mh_format_parse (format_str, &format))
{
mh_error (_("Bad format string"));
mu_error (_("Bad format string"));
exit (1);
}
......