2 ** error.c -- main error handling routines
4 ** This code is Copyright (c) 2002, by the authors of nmh. See the
5 ** COPYRIGHT file in the root directory of the nmh distribution for
6 ** complete copyright information.
15 ** print out error message
18 advise(char *what, char *fmt, ...)
23 advertise(what, NULL, fmt, ap);
29 ** print out error message and exit
32 adios(int status, char *what, char *fmt, ...)
37 advertise(what, NULL, fmt, ap);
47 admonish(char *what, char *fmt, ...)
52 advertise(what, "continuing...", fmt, ap);
58 ** main routine for printing error messages.
60 ** Until 2011-11-01, this routine used writev(). In order to remove
61 ** ``sexy'' syscalls, in favor for mainstream programming, I removed
62 ** it. But I want to preserve the following comment:
64 ** Use writev() if available, for slightly better performance.
65 ** Why? Well, there are a couple of reasons. Primarily, it
66 ** gives a smoother output... More importantly though, it's a
69 ** advertise() does *not* use writev() anymore, and that's good so.
70 ** -- meillo@marmaro.de
73 advertise(char *what, char *tail, char *fmt, va_list ap)
78 if (invo_name && *invo_name)
79 fprintf(stderr, "%s: ", invo_name);
80 vfprintf(stderr, fmt, ap);
86 fprintf(stderr, " %s: ", what);
87 if ((s = strerror(eindex)))
88 fprintf(stderr, "%s", s);
90 fprintf(stderr, "Error %d", eindex);
93 fprintf(stderr, ", %s", tail);