From 90d76525c5cc2f3f4781351a1d99be839dfa2874 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sat, 3 Mar 2007 19:32:55 +0000 Subject: Add resetStringInfo(), which clears the content of a StringInfo, and fixup various places in the tree that were clearing a StringInfo by hand. Making this function a part of the API simplifies client code slightly, and avoids needlessly peeking inside the StringInfo interface. --- src/include/lib/stringinfo.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h index 8658101035..b5a7ebaf89 100644 --- a/src/include/lib/stringinfo.h +++ b/src/include/lib/stringinfo.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/lib/stringinfo.h,v 1.33 2007/01/05 22:19:55 momjian Exp $ + * $PostgreSQL: pgsql/src/include/lib/stringinfo.h,v 1.34 2007/03/03 19:32:55 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -78,6 +78,13 @@ extern StringInfo makeStringInfo(void); */ extern void initStringInfo(StringInfo str); +/*------------------------ + * resetStringInfo + * Clears the current content of the StringInfo, if any. The + * StringInfo remains valid. + */ +extern void resetStringInfo(StringInfo str); + /*------------------------ * appendStringInfo * Format text data under the control of fmt (an sprintf-style format string) -- cgit v1.2.1