diff options
Diffstat (limited to 'src/include/lib/stringinfo.h')
-rw-r--r-- | src/include/lib/stringinfo.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h index c49a73c0eb1..8e305ee430c 100644 --- a/src/include/lib/stringinfo.h +++ b/src/include/lib/stringinfo.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: stringinfo.h,v 1.25 2003/04/19 00:02:29 tgl Exp $ + * $Id: stringinfo.h,v 1.26 2003/04/24 21:16:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -80,17 +80,33 @@ extern void initStringInfo(StringInfo str); /*------------------------ * appendStringInfo - * Format text data under the control of fmt (an sprintf-like format string) + * Format text data under the control of fmt (an sprintf-style format string) * and append it to whatever is already in str. More space is allocated * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ -extern void -appendStringInfo(StringInfo str, const char *fmt,...) +extern void appendStringInfo(StringInfo str, const char *fmt, ...) /* This extension allows gcc to check the format string */ __attribute__((format(printf, 2, 3))); /*------------------------ + * appendStringInfoVA + * Attempt to format text data under the control of fmt (an sprintf-style + * format string) and append it to whatever is already in str. If successful + * return true; if not (because there's not enough space), return false + * without modifying str. Typically the caller would enlarge str and retry + * on false return --- see appendStringInfo for standard usage pattern. + */ +extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args); + +/*------------------------ + * appendStringInfoString + * Append a null-terminated string to str. + * Like appendStringInfo(str, "%s", s) but faster. + */ +extern void appendStringInfoString(StringInfo str, const char *s); + +/*------------------------ * appendStringInfoChar * Append a single byte to str. * Like appendStringInfo(str, "%c", ch) but much faster. |