diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-27 16:44:24 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-27 16:45:26 -0700 |
commit | 2c93afb0089a37de798da8d23824a84846ab7d7c (patch) | |
tree | a53be684627948ed96d64e2be7aac1bea83507b8 /src/z-form.hpp | |
parent | d6b913d3ca2e84b75f3675fd6e9f5246c100cf27 (diff) | |
parent | e9d08c617ee73f0636e1f1a1d40582f193c37e81 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'src/z-form.hpp')
-rw-r--r-- | src/z-form.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/z-form.hpp b/src/z-form.hpp new file mode 100644 index 00000000..11d61ae3 --- /dev/null +++ b/src/z-form.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include "h-basic.hpp" + +#include <cstdarg> + +/* + * This file provides functions very similar to "sprintf()", but which + * not only parse some additional "format sequences", but also enforce + * bounds checking, and allow repeated "appends" to the same buffer. + * + * See "z-form.c" for more detailed information about the routines, + * including a list of the legal "format sequences". + * + * This file makes use "z-util.c" + */ + + +/**** Available Functions ****/ + +/* Format arguments into given bounded-length buffer */ +unsigned int vstrnfmt(char *buf, unsigned int max, const char *fmt, va_list vp); + +/* Simple interface to "vstrnfmt()" */ +unsigned int strnfmt(char *buf, unsigned int max, const char *fmt, ...); + +/* Simple interface to "vformat()" */ +char *format(const char *fmt, ...); + +/* Vararg interface to "quit()", using "format()" */ +void quit_fmt(const char *fmt, ...); |