OSDN Git Service

v3.0.0 Alpha5 OSDN最終版
[hengband/hengband.git] / src / z-form.h
1 /* File z-form.h */
2
3 /*
4  * Copyright (c) 1997 Ben Harrison
5  *
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.
9  */
10
11 #ifndef INCLUDED_Z_FORM_H
12 #define INCLUDED_Z_FORM_H
13
14 #include "h-basic.h"
15
16 /*
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.
20  *
21  * See "z-form.c" for more detailed information about the routines,
22  * including a list of the legal "format sequences".
23  *
24  * This file makes use of both "z-util.c" and "z-virt.c"
25  */
26
27
28 /**** Available Functions ****/
29
30 /* Format arguments into given bounded-length buffer */
31 extern uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp);
32
33 /* Simple interface to "vstrnfmt()" */
34 extern uint strnfmt(char *buf, uint max, concptr fmt, ...);
35
36 /* Simple interface to "vstrnfmt()", assuming infinite length */
37 extern uint strfmt(char *buf, concptr fmt, ...);
38
39 /* Format arguments into a static resizing buffer */
40 extern char *vformat(concptr fmt, va_list vp);
41
42 /* Simple interface to "vformat()" */
43 extern char *format(concptr fmt, ...);
44
45 /* Vararg interface to "plog()", using "format()" */
46 extern void plog_fmt(concptr fmt, ...);
47
48 /* Vararg interface to "quit()", using "format()" */
49 extern void quit_fmt(concptr fmt, ...);
50
51 /* Vararg interface to "core()", using "format()" */
52 extern void core_fmt(concptr fmt, ...);
53
54
55 #endif