su 1.12.11devel
Loading...
Searching...
No Matches
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, ...);
intptr_t tag_value_t
Tag item value.
Definition su_tag.h:57
struct tag_type_s const * tag_type_t
Tag item type.
Definition su_tag.h:55

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());
#define TAG_END()
Initialize a tag item marking the end of list.
Definition su_tag.h:113
#define TAG_IF(condition, item)
Initialize a item if condition is true; otherwise, initialize an empty tag item.
Definition su_tag.h:126
Note
The tagged argument list must be terminated by a TAG_END(), TAG_NULL() or TAG_NEXT().

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