/* Purpose: Low level text formatting -BEN- */
#include "z-form.h"
-
#include "z-util.h"
#include "z-virt.h"
* Append the character "c".
* Do not use the "+" or "0" flags.
*
- * Format("%s", cptr s)
+ * Format("%s", concptr s)
* Append the string "s".
* Do not use the "+" or "0" flags.
* Note that a "NULL" value of "s" is converted to the empty string.
/*
* The "type" of the "user defined print routine" pointer
*/
-typedef uint (*vstrnfmt_aux_func)(char *buf, uint max, cptr fmt, vptr arg);
+typedef uint (*vstrnfmt_aux_func)(char *buf, uint max, concptr fmt, vptr arg);
/*
* The "default" user defined print routine. Ignore the "fmt" string.
*/
-static uint vstrnfmt_aux_dflt(char *buf, uint max, cptr fmt, vptr arg)
+static uint vstrnfmt_aux_dflt(char *buf, uint max, concptr fmt, vptr arg)
{
uint len;
char tmp[32];
* the given buffer to a length of zero, and return a "length" of zero.
* The contents of "buf", except for "buf[0]", may then be undefined.
*/
-uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
+uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp)
{
- cptr s;
+ concptr s;
/* The argument is "long" */
bool do_long;
/* Save the character */
buf[n++] = *s++;
-
- /* Continue */
continue;
}
/* Skip the "%" */
s++;
-
- /* Continue */
continue;
}
/* Skip the "n" */
s++;
-
- /* Continue */
continue;
}
/* Skip the "r" */
s++;
-
- /* Continue */
continue;
}
/* String */
case 's':
{
- cptr arg;
+ concptr arg;
char arg2[1024];
/* Access next argument */
- arg = va_arg(vp, cptr);
+ arg = va_arg(vp, concptr);
/* Hack -- convert NULL to EMPTY */
if (!arg) arg = "";
* Do a vstrnfmt (see above) into a (growable) static buffer.
* This buffer is usable for very short term formatting of results.
*/
-char *vformat(cptr fmt, va_list vp)
+char *vformat(concptr fmt, va_list vp)
{
static char *format_buf = NULL;
static huge format_len = 0;
/*
* Do a vstrnfmt (see above) into a buffer of a given size.
*/
-uint strnfmt(char *buf, uint max, cptr fmt, ...)
+uint strnfmt(char *buf, uint max, concptr fmt, ...)
{
uint len;
* Do a vstrnfmt (see above) into a buffer of unknown size.
* Since the buffer size is unknown, the user better verify the args.
*/
-uint strfmt(char *buf, cptr fmt, ...)
+uint strfmt(char *buf, concptr fmt, ...)
{
uint len;
* Note that the buffer is (technically) writable, but only up to
* the length of the string contained inside it.
*/
-char *format(cptr fmt, ...)
+char *format(concptr fmt, ...)
{
char *res;
va_list vp;
/*
* Vararg interface to plog()
*/
-void plog_fmt(cptr fmt, ...)
+void plog_fmt(concptr fmt, ...)
{
char *res;
va_list vp;
/*
* Vararg interface to quit()
*/
-void quit_fmt(cptr fmt, ...)
+void quit_fmt(concptr fmt, ...)
{
char *res;
va_list vp;
/*
* Vararg interface to core()
*/
-void core_fmt(cptr fmt, ...)
+void core_fmt(concptr fmt, ...)
{
char *res;
va_list vp;