aboutsummaryrefslogtreecommitdiff
path: root/src/include/lib/stringinfo.h
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-03-03 19:32:55 +0000
committerNeil Conway <neilc@samurai.com>2007-03-03 19:32:55 +0000
commit90d76525c5cc2f3f4781351a1d99be839dfa2874 (patch)
tree75ee2db58298898533663d779d711879c43edb8d /src/include/lib/stringinfo.h
parent053981f4054f6dfcda0ce65566605b49ca366a97 (diff)
downloadpostgresql-90d76525c5cc2f3f4781351a1d99be839dfa2874.tar.gz
postgresql-90d76525c5cc2f3f4781351a1d99be839dfa2874.zip
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.
Diffstat (limited to 'src/include/lib/stringinfo.h')
-rw-r--r--src/include/lib/stringinfo.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h
index 86581010356..b5a7ebaf893 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 $
*
*-------------------------------------------------------------------------
*/
@@ -79,6 +79,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)
* and append it to whatever is already in str. More space is allocated