Tagarg Functions

A tagarg function may be called with a varying number of tagged arguments.

The include file <sofia-sip/su_tagarg.h> declares a type ta_list and defines four macros (ta_start(), ta_args(), ta_tags() and ta_end()) for accessing the argument list.

An example of prototype of a a tagarg function is as follows:

 int tag_print(FILE *f, tag_type_t tag, tag_value_t value, ...);

Such a function could be called as follows:

   tag_print(stdout,
             TAG_STRING("a is"), TAG_INT(a),
             TAG_STRING("b is"), URLTAG_URL(b),
             TAG_IF(c, TAG_STRING("and c is true")),
             TAG_END());
Note:
The tagged argument list must be terminated by a TAG_END(), TAG_NULL() or TAG_NEXT().
 All Data Structures Files Functions Variables Typedefs Enumerator Defines

Sofia-SIP 1.12.11 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.