4 * Copyright (c) 1997 Ben Harrison
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies.
11 #ifndef INCLUDED_Z_FORM_H
12 #define INCLUDED_Z_FORM_H
17 * This file provides functions very similar to "sprintf()", but which
18 * not only parse some additional "format sequences", but also enforce
19 * bounds checking, and allow repeated "appends" to the same buffer.
21 * See "z-form.c" for more detailed information about the routines,
22 * including a list of the legal "format sequences".
24 * This file makes use of both "z-util.c" and "z-virt.c"
28 /**** Available Functions ****/
30 /* Format arguments into given bounded-length buffer */
31 extern uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp);
33 /* Simple interface to "vstrnfmt()" */
34 extern uint strnfmt(char *buf, uint max, concptr fmt, ...);
36 /* Simple interface to "vstrnfmt()", assuming infinite length */
37 extern uint strfmt(char *buf, concptr fmt, ...);
39 /* Format arguments into a static resizing buffer */
40 extern char *vformat(concptr fmt, va_list vp);
42 /* Simple interface to "vformat()" */
43 extern char *format(concptr fmt, ...);
45 /* Vararg interface to "plog()", using "format()" */
46 extern void plog_fmt(concptr fmt, ...);
48 /* Vararg interface to "quit()", using "format()" */
49 extern void quit_fmt(concptr fmt, ...);
51 /* Vararg interface to "core()", using "format()" */
52 extern void core_fmt(concptr fmt, ...);