aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/palloc.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2013-10-13 00:09:18 -0400
committerPeter Eisentraut <peter_e@gmx.net>2013-10-13 00:09:18 -0400
commit5b6d08cd2992922b667564a49f19580f11676050 (patch)
tree4104a4255eeb88e78da71477b5f7b129f9a1b599 /src/include/utils/palloc.h
parenta53dee43fe585e673658b01e7354892dcede957e (diff)
downloadpostgresql-5b6d08cd2992922b667564a49f19580f11676050.tar.gz
postgresql-5b6d08cd2992922b667564a49f19580f11676050.zip
Add use of asprintf()
Add asprintf(), pg_asprintf(), and psprintf() to simplify string allocation and composition. Replacement implementations taken from NetBSD. Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by: Asif Naeem <anaeem.it@gmail.com>
Diffstat (limited to 'src/include/utils/palloc.h')
-rw-r--r--src/include/utils/palloc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h
index 01e7db5d4f9..03ef87e2d7f 100644
--- a/src/include/utils/palloc.h
+++ b/src/include/utils/palloc.h
@@ -101,5 +101,7 @@ extern void *palloc(Size size);
extern void *palloc0(Size size);
extern void pfree(void *pointer);
extern void *repalloc(void *pointer, Size size);
+extern char *psprintf(const char *format, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
+extern char *pvsprintf(const char *format, va_list ap) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 0)));
#endif /* PALLOC_H */