3 #ifndef INCLUDED_Z_FORM_H
4 #define INCLUDED_Z_FORM_H
9 * This file provides functions very similar to "sprintf()", but which
10 * not only parse some additional "format sequences", but also enforce
11 * bounds checking, and allow repeated "appends" to the same buffer.
13 * See "z-form.c" for more detailed information about the routines,
14 * including a list of the legal "format sequences".
16 * This file makes use of both "z-util.c" and "z-virt.c"
20 /**** Available Functions ****/
22 /* Format arguments into given bounded-length buffer */
23 extern uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp);
25 /* Simple interface to "vstrnfmt()" */
26 extern uint strnfmt(char *buf, uint max, cptr fmt, ...);
28 /* Simple interface to "vstrnfmt()", assuming infinite length */
29 extern uint strfmt(char *buf, cptr fmt, ...);
31 /* Format arguments into a static resizing buffer */
32 extern char *vformat(cptr fmt, va_list vp);
34 /* Simple interface to "vformat()" */
35 extern char *format(cptr fmt, ...);
37 /* Vararg interface to "plog()", using "format()" */
38 extern void plog_fmt(cptr fmt, ...);
40 /* Vararg interface to "quit()", using "format()" */
41 extern void quit_fmt(cptr fmt, ...);
43 /* Vararg interface to "core()", using "format()" */
44 extern void core_fmt(cptr fmt, ...);