simplify the ast_dynamic_str_*.... routines by

renaming them to ast_str ... and putting the
struct ast_threadstorage pointer into the struct ast_str.

This makes the code a lot more readable.

At this point we can use these routines also to
replace ast_build_string().



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-12-15 23:10:42 +00:00
parent 961754d4b1
commit 055abfe9d9
5 changed files with 95 additions and 181 deletions

View File

@@ -59,14 +59,14 @@ AST_THREADSTORAGE(ast_cli_buf);
void ast_cli(int fd, char *fmt, ...)
{
int res;
struct ast_dynamic_str *buf;
struct ast_str *buf;
va_list ap;
if (!(buf = ast_dynamic_str_thread_get(&ast_cli_buf, AST_CLI_INITLEN)))
if (!(buf = ast_str_thread_get(&ast_cli_buf, AST_CLI_INITLEN)))
return;
va_start(ap, fmt);
res = ast_dynamic_str_thread_set_va(&buf, 0, &ast_cli_buf, fmt, ap);
res = ast_str_set_va(&buf, 0, fmt, ap);
va_end(ap);
if (res != AST_DYNSTR_BUILD_FAILED)