summaryrefslogtreecommitdiff
path: root/src/include/common
diff options
context:
space:
mode:
authorPeter Eisentraut2013-10-13 04:09:18 +0000
committerPeter Eisentraut2013-10-13 04:09:18 +0000
commit5b6d08cd2992922b667564a49f19580f11676050 (patch)
tree4104a4255eeb88e78da71477b5f7b129f9a1b599 /src/include/common
parenta53dee43fe585e673658b01e7354892dcede957e (diff)
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/common')
-rw-r--r--src/include/common/fe_memutils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/common/fe_memutils.h b/src/include/common/fe_memutils.h
index 82ed8cd9e64..db4e710b465 100644
--- a/src/include/common/fe_memutils.h
+++ b/src/include/common/fe_memutils.h
@@ -14,6 +14,7 @@ extern void *pg_malloc(size_t size);
extern void *pg_malloc0(size_t size);
extern void *pg_realloc(void *pointer, size_t size);
extern void pg_free(void *pointer);
+extern int pg_asprintf(char **ret, const char *format, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
#include "utils/palloc.h"