add ast_build_string_va(), which accepts a varargs list directly

ensure the _entire_ manager_event() output is either queued or sent via ast_carefulwrite()


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-10-01 15:41:27 +00:00
parent 270b98d2f4
commit 9835bc4330
3 changed files with 34 additions and 10 deletions

17
utils.c
View File

@@ -522,17 +522,14 @@ char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes)
return s;
}
int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap)
{
va_list ap;
int result;
if (!buffer || !*buffer || !space || !*space)
return -1;
va_start(ap, fmt);
result = vsnprintf(*buffer, *space, fmt, ap);
va_end(ap);
if (result < 0)
return -1;
@@ -544,6 +541,18 @@ int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
return 0;
}
int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
{
va_list ap;
int result;
va_start(ap, fmt);
result = ast_build_string_va(buffer, space, fmt, ap);
va_end(ap);
return result;
}
int ast_true(const char *s)
{
if (!s || ast_strlen_zero(s))