diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-24 21:16:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-24 21:16:45 +0000 |
commit | f690920a752fa8e59dc9536dd14194b2141163d2 (patch) | |
tree | 0fdd5e79110455c7857783e04f2d716c2a6a0c52 /src/include/lib/stringinfo.h | |
parent | a91c5be6a47349d87068680c80839aae76304285 (diff) | |
download | postgresql-f690920a752fa8e59dc9536dd14194b2141163d2.tar.gz postgresql-f690920a752fa8e59dc9536dd14194b2141163d2.zip |
Infrastructure for upgraded error reporting mechanism. elog.c is
rewritten and the protocol is changed, but most elog calls are still
elog calls. Also, we need to contemplate mechanisms for controlling
all this functionality --- eg, how much stuff should appear in the
postmaster log? And what API should libpq expose for it?
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. |