server: Make a_vformat public.
[tripe] / server / admin.c
index 00288f3..5509de0 100644 (file)
@@ -238,10 +238,28 @@ static void a_flush(int fd, unsigned mode, void *v)
  *
  * Returns:    ---
  *
- * Use:                Main message token formatting driver.
+ * Use:                Main message token formatting driver.  The arguments are
+ *             interleaved formatting tokens and their parameters, finally
+ *             terminated by an entry @A_END@.
+ *
+ *             Tokens recognized:
+ *
+ *               * "*..." ... -- pretokenized @dstr_putf@-like string
+ *
+ *               * "?ADDR" SOCKADDR -- a socket address, to be converted
+ *
+ *               * "?B64" BUFFER SIZE -- binary data to be base64-encoded
+ *
+ *               * "?TOKENS" VECTOR -- null-terminated vector of tokens
+ *
+ *               * "?PEER" PEER -- peer's name
+ *
+ *               * "?ERRNO" ERRNO -- system error code
+ *
+ *               * "[!]..." ... -- @dstr_putf@-like string as single token
  */
 
-static void a_vformat(dstr *d, const char *fmt, va_list ap)
+void a_vformat(dstr *d, const char *fmt, va_list ap)
 {
   dstr dd = DSTR_INIT;