Update stringfield documentation for removed second va_list in favor of va_copy.

In r320946, the second va_list that was passed to ast_string_field_build_va
and friends, was removed. This patch updates the documentation to reflect that.
........

Merged revisions 357620 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Walter Doekes
2012-02-29 20:41:38 +00:00
parent 62aae50142
commit 41f5a1ab35
2 changed files with 6 additions and 10 deletions

View File

@@ -69,8 +69,7 @@
and assignments are always by value (i.e. strings are copied): and assignments are always by value (i.e. strings are copied):
* ast_string_field_set() stores a simple value; * ast_string_field_set() stores a simple value;
* ast_string_field_build() builds the string using a printf-style format; * ast_string_field_build() builds the string using a printf-style format;
* ast_string_field_build_va() is the varargs version of the above (for * ast_string_field_build_va() is the varargs version of the above;
portability reasons it uses two vararg arguments);
* variants of these function allow passing a pointer to the field * variants of these function allow passing a pointer to the field
as an argument. as an argument.
@@ -82,8 +81,8 @@
ast_string_field_build(x, blah, "%d %s", zipcode, city); ast_string_field_build(x, blah, "%d %s", zipcode, city);
ast_string_field_ptr_build(x, &x->blah, "%d %s", zipcode, city); ast_string_field_ptr_build(x, &x->blah, "%d %s", zipcode, city);
ast_string_field_build_va(x, bar, fmt, args1, args2) ast_string_field_build_va(x, bar, fmt, args)
ast_string_field_ptr_build_va(x, &x->bar, fmt, args1, args2) ast_string_field_ptr_build_va(x, &x->bar, fmt, args)
\endcode \endcode
When the structure instance is no longer needed, the fields When the structure instance is no longer needed, the fields
@@ -206,7 +205,6 @@ void __ast_string_field_ptr_build(struct ast_string_field_mgr *mgr,
\param ptr Pointer to a field within the structure \param ptr Pointer to a field within the structure
\param format printf-style format string \param format printf-style format string
\param args va_list of the args for the format_string \param args va_list of the args for the format_string
\param args_again a copy of the first va_list for the sake of bsd not having a copy routine
\return nothing \return nothing
*/ */
void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr, void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
@@ -370,8 +368,7 @@ void __ast_string_field_release_active(struct ast_string_field_pool *pool_head,
\param x Pointer to a structure containing fields \param x Pointer to a structure containing fields
\param ptr Pointer to a field within the structure \param ptr Pointer to a field within the structure
\param fmt printf-style format string \param fmt printf-style format string
\param args1 Arguments for format string in va_list format \param args Arguments for format string in va_list format
\param args2 a second copy of the va_list for the sake of bsd, with no va_list copy operation
\return nothing \return nothing
*/ */
#define ast_string_field_ptr_build_va(x, ptr, fmt, args) \ #define ast_string_field_ptr_build_va(x, ptr, fmt, args) \
@@ -382,8 +379,7 @@ void __ast_string_field_release_active(struct ast_string_field_pool *pool_head,
\param x Pointer to a structure containing fields \param x Pointer to a structure containing fields
\param field Name of the field to set \param field Name of the field to set
\param fmt printf-style format string \param fmt printf-style format string
\param args1 argument one \param args Arguments for format string in va_list format
\param args2 argument two
\return nothing \return nothing
*/ */
#define ast_string_field_build_va(x, field, fmt, args) \ #define ast_string_field_build_va(x, field, fmt, args) \

View File

@@ -1773,7 +1773,7 @@ void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
return; return;
} }
vsprintf(target, format, ap); vsprintf(target, format, ap);
va_end(ap); va_end(ap); /* XXX va_end without va_start? */
__ast_string_field_release_active(*pool_head, *ptr); __ast_string_field_release_active(*pool_head, *ptr);
*ptr = target; *ptr = target;
} else if (*ptr != target) { } else if (*ptr != target) {