From f690920a752fa8e59dc9536dd14194b2141163d2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 24 Apr 2003 21:16:45 +0000 Subject: 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? --- src/include/lib/stringinfo.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/include/lib/stringinfo.h') diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h index c49a73c0eb..8e305ee430 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,16 +80,32 @@ 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. -- cgit v1.2.1