@@@ man wip
[mLib] / utils / gprintf.h
index 8c0f87c..7bb0b04 100644 (file)
@@ -53,38 +53,32 @@ extern const struct gprintf_ops file_printops;
 
 /*----- Functions provided ------------------------------------------------*/
 
-/* --- @vgprintf@ --- *
+/* --- @gprintf@, @vgprintf@ --- *
  *
  * Arguments:  @const struct gprintf_ops *ops@ = output operations
  *             @void *out@ = context for output operations
  *             @const char *p@ = pointer to @printf@-style format string
- *             @va_list *ap@ = argument handle
- *
- * Returns:    The number of characters written to the string.
- *
- * Use:                As for @gprintf@, but takes a reified argument tail.
- */
-
-extern int vgprintf(const struct gprintf_ops */*ops*/, void */*out*/,
-                   const char */*p*/, va_list */*ap*/);
-
-/* --- @gprintf@ --- *
- *
- * Arguments:  @const struct gprintf_ops *ops@ = output operations
- *             @void *out@ = context for output operations
- *             @const char *p@ = pointer to @printf@-style format string
- *             @...@ = argument handle
+ *             @...@ = format arguments
+ *             @va_list *ap@ = captured format-arguments tail
  *
  * Returns:    The number of characters written to the string.
  *
  * Use:                Formats a @printf@-like message and writes the result using
  *             the given output operations.  This is the backend machinery
  *             for @dstr_putf@, for example.
+ *
+ *             The @gprintf@ function receives its format arguments as a
+ *             variable-length argument tail; the @vgprintf@ function
+ *             receives them as %%\emph{a pointer to}%% a captured argument
+ *             tail; it updates @*ap@, leaving it ready to read the next
+ *             unused argument.
  */
 
 extern PRINTF_LIKE(3, 4)
   int gprintf(const struct gprintf_ops */*ops*/, void */*out*/,
              const char */*p*/, ...);
+extern int vgprintf(const struct gprintf_ops */*ops*/, void */*out*/,
+                   const char */*p*/, va_list */*ap*/);
 
 /* --- @gprintf_memputf@ --- *
  *