[asterisk-commits] russell: branch
russell/ast_verbose_threadstorage r38503 - in /team/russell/a...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Jul 29 16:22:47 MST 2006
Author: russell
Date: Sat Jul 29 18:22:47 2006
New Revision: 38503
URL: http://svn.digium.com/view/asterisk?rev=38503&view=rev
Log:
rename some constants to not use the word "build"
Modified:
team/russell/ast_verbose_threadstorage/cli.c
team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h
team/russell/ast_verbose_threadstorage/logger.c
Modified: team/russell/ast_verbose_threadstorage/cli.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/cli.c?rev=38503&r1=38502&r2=38503&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/cli.c (original)
+++ team/russell/ast_verbose_threadstorage/cli.c Sat Jul 29 18:22:47 2006
@@ -70,7 +70,7 @@
res = ast_dynamic_str_thread_printf_va(&buf, 0, &ast_cli_buf, fmt, ap);
va_end(ap);
- if (res > 0)
+ if (res != AST_DYNSTR_PRINTF_FAILED)
ast_carefulwrite(fd, buf->str, strlen(buf->str), 100);
}
Modified: team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h?rev=38503&r1=38502&r2=38503&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h (original)
+++ team/russell/ast_verbose_threadstorage/include/asterisk/threadstorage.h Sat Jul 29 18:22:47 2006
@@ -203,12 +203,12 @@
enum {
/*! An error has occured and the contents of the dynamic string
* are undefined */
- AST_DYNSTR_BUILD_FAILED = -1,
+ AST_DYNSTR_PRINTF_FAILED = -1,
/*! The buffer size for the dynamic string had to be increased, and
* __ast_dynamic_str_thread_printf_va() needs to be called again after
* a va_end() and va_start().
*/
- AST_DYNSTR_BUILD_RETRY = -2
+ AST_DYNSTR_PRINTF_RETRY = -2
};
/*!
@@ -256,13 +256,19 @@
({ \
int __res; \
while ((__res = __ast_dynamic_str_thread_printf_va(buf, max_len, \
- ts, fmt, ap)) == AST_DYNSTR_BUILD_RETRY) { \
+ ts, fmt, ap)) == AST_DYNSTR_PRINTF_RETRY) { \
va_end(ap); \
va_start(ap, fmt); \
} \
(__res); \
})
+/*!
+ * \brief Core functionality of ast_dynamic_str_thread_printf_va
+ *
+ * The arguments to this function are the same as those described for
+ * ast_dynamic_str_thread_printf_va.
+ */
AST_INLINE_API(
int __ast_dynamic_str_thread_printf_va(struct ast_dynamic_str **buf, size_t max_len,
struct ast_threadstorage *ts, const char *fmt, va_list ap),
@@ -277,10 +283,10 @@
else
(*buf)->len = res + 1;
if (!(*buf = ast_realloc(*buf, (*buf)->len + sizeof(*(*buf)))))
- return AST_DYNSTR_BUILD_FAILED;
+ return AST_DYNSTR_PRINTF_FAILED;
if (ts)
pthread_setspecific(ts->key, *buf);
- return AST_DYNSTR_BUILD_RETRY;
+ return AST_DYNSTR_PRINTF_RETRY;
}
return res;
Modified: team/russell/ast_verbose_threadstorage/logger.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/logger.c?rev=38503&r1=38502&r2=38503&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/logger.c (original)
+++ team/russell/ast_verbose_threadstorage/logger.c Sat Jul 29 18:22:47 2006
@@ -754,7 +754,7 @@
va_start(ap, fmt);
res = ast_dynamic_str_thread_printf_va(&buf, BUFSIZ, &log_buf, fmt, ap);
va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED)
+ if (res != AST_DYNSTR_PRINTF_FAILED)
ast_console_puts_mutable(buf->str);
}
/* File channels */
@@ -778,7 +778,7 @@
va_start(ap, fmt);
ast_dynamic_str_thread_printf_va(&buf, BUFSIZ, &log_buf, fmt, ap);
va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
+ if (res != AST_DYNSTR_PRINTF_FAILED) {
term_strip(buf->str, buf->str, buf->len);
fputs(buf->str, chan->fileptr);
fflush(chan->fileptr);
@@ -796,7 +796,7 @@
va_start(ap, fmt);
res = ast_dynamic_str_thread_printf_va(&buf, BUFSIZ, &log_buf, fmt, ap);
va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED)
+ if (res != AST_DYNSTR_PRINTF_FAILED)
fputs(buf->str, stdout);
}
}
@@ -868,7 +868,7 @@
res = ast_dynamic_str_thread_printf_va(&buf, 0, &verbose_buf, fmt, ap);
va_end(ap);
- if (res == AST_DYNSTR_BUILD_FAILED)
+ if (res == AST_DYNSTR_PRINTF_FAILED)
return;
AST_LIST_LOCK(&verbosers);
More information about the asterisk-commits
mailing list