Remove the ill-advised ast_restrdupa API call and related structures

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-06-28 19:41:18 +00:00
parent daec10d187
commit a952147446
3 changed files with 1 additions and 25 deletions

View File

@@ -244,24 +244,6 @@ void ast_join(char *s, size_t len, char * const w[]);
*/
int ast_get_time_t(const char *src, time_t *dst, time_t _default, int *consumed);
/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
struct ast_realloca {
char *ptr;
int alloclen;
};
#define ast_restrdupa(ra, s) \
({ \
if ((ra)->ptr && strlen(s) + 1 < (ra)->alloclen) { \
strcpy((ra)->ptr, s); \
} else { \
(ra)->ptr = alloca(strlen(s) + 1 - (ra)->alloclen); \
if ((ra)->ptr) (ra)->alloclen = strlen(s) + 1; \
} \
(ra)->ptr; \
})
/*!
* Support for dynamic strings.
*