chiark / gitweb /
admin.c (a_format): New function formats token sequences to strings.
[tripe] / server / admin.c
index 7fa3f0f85b8cbba34c1a0c0b545b7f975c112ec3..e892054773a14a6acce73f951a762ec7428bc604 100644 (file)
@@ -313,6 +313,26 @@ void a_vformat(dstr *d, const char *fmt, va_list ap)
   dstr_destroy(&dd);
 }
 
+/* --- @a_format@ --- *
+ *
+ * Arguments:  @dstr *d@ = where to leave the formatted message
+ *             @const char *fmt@ = pointer to format string
+ *
+ * Returns:    ---
+ *
+ * Use:                Writes a tokenized message into a string, for later
+ *             presentation.
+ */
+
+void a_format(dstr *d, const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start(ap, fmt);
+  a_vformat(d, fmt, ap);
+  va_end(ap);
+}
+
 /* --- @a_write@, @a_vwrite@ --- *
  *
  * Arguments:  @admin *a@ = admin connection to write to