aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/astmm.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-04 21:54:09 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-04 21:54:09 +0000
commitb3aeb7784da69aa2b989aa63793cee3c52fecd0e (patch)
tree0db4074bf85b66c9959784a6b85951b548f8d773 /include/asterisk/astmm.h
parent17a14c041a1c4dcc128fc90eb5b05becc145a6c0 (diff)
add memory-pool based string field management for structures
convert chan_sip sip_pvt and sip_registry structures to use string fields add 'const' qualifiers to a few API calls that don't modify their input strings add an asprintf() wrapper to astmm git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7797 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/astmm.h')
-rw-r--r--include/asterisk/astmm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/asterisk/astmm.h b/include/asterisk/astmm.h
index 9e70366fa..9be9ef95c 100644
--- a/include/asterisk/astmm.h
+++ b/include/asterisk/astmm.h
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -38,6 +38,7 @@
#undef realloc
#undef strdup
#undef strndup
+#undef asprintf
#undef vasprintf
void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
@@ -46,6 +47,7 @@ void __ast_free(void *ptr, const char *file, int lineno, const char *func);
void *__ast_realloc(void *ptr, size_t size, const char *file, int lineno, const char *func);
char *__ast_strdup(const char *s, const char *file, int lineno, const char *func);
char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func);
+int __ast_asprintf(const char *file, int lineno, const char *func, char **strp, const char *format, ...);
int __ast_vasprintf(char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func);
void __ast_mm_init(void);
@@ -70,6 +72,9 @@ void __ast_mm_init(void);
#define strndup(a,b) \
__ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define asprintf(a, b, c...) \
+ __ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, b, c)
+
#define vasprintf(a,b,c) \
__ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)