From: Ralph Corderoy Date: Mon, 17 Apr 2017 09:16:51 +0000 (+0100) Subject: Add inform() to provide an equivalent to advise(NULL, ...). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/1824820f0dcdcf5f96fb4c6ac0c84e86a26d0e63?ds=inline Add inform() to provide an equivalent to advise(NULL, ...). A small step in clearing up the confusing ad... names of the diagnostic routines. `inform' isn't great, but err(3) nabs `warn' already. --- diff --git a/h/prototypes.h b/h/prototypes.h index 51031431..958c8a30 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -18,6 +18,7 @@ char *etcpath(char *); struct msgs_array; void add_profile_entry (const char *, const char *); +void inform(char *fmt, ...); void adios (const char *, const char *, ...) NORETURN; void admonish (char *, char *, ...); void advertise (const char *, char *, const char *, va_list); diff --git a/sbr/error.c b/sbr/error.c index b33eae54..7b2f5064 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -13,6 +13,18 @@ #include +/* inform calls advertise() with no what and no tail. + * Thus the simple "invo_name: fmt\n" results. */ +void inform(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + advertise(NULL, NULL, fmt, ap); + va_end(ap); +} + + /* advise calls advertise() with no tail to print fmt, and perhaps what, * to stderr. */ void