]> diplodocus.org Git - nmh/commitdiff
Add inform() to provide an equivalent to advise(NULL, ...).
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 17 Apr 2017 09:16:51 +0000 (10:16 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 17 Apr 2017 09:16:51 +0000 (10:16 +0100)
A small step in clearing up the confusing ad... names of the diagnostic
routines.  `inform' isn't great, but err(3) nabs `warn' already.

h/prototypes.h
sbr/error.c

index 5103143..958c8a3 100644 (file)
@@ -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);
index b33eae5..7b2f506 100644 (file)
 #include <sys/uio.h>
 
 
+/* 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