summaryrefslogtreecommitdiff
path: root/src/z-form.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/z-form.hpp')
-rw-r--r--src/z-form.hpp31
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, ...);