Loading...
Searching...
No Matches
Tag Item Lists

Object-oriented tag routines for Sofia utility library. More...

## Files

file | su_tag.h
| \ Object-oriented tags and tag list interface.
file | su_tag_class.h
| \
file | su_tag_inline.h
| \Inline functions for object tags and tag lists.
file | su_tag_io.h
| \
file | su_tagarg.h
| \ Tagged argument lists

## Macros

#define | va_copy(dst, src)
| \

## Functions

void | tl_print (FILE *f, char const *title, tagi_t const lst[])
| \

## Variables

tag_class_t | null_tag_class [1]
| \

## Detailed Description

Object-oriented tag routines for Sofia utility library.

The <sofia-sip/su_tag.h> defines a interface to object-oriented tag list routines. A tag list is a linear list (array) of tag items, tagi_t structures, terminated by a TAG_END() item. Each tag item has a label, tag, (`t_tag`) and a value (`t_value`). The tag is a pointer (tag_type_t) to a structure defining how the value should be interpreted, in other words, the name and the type of the value. The value or pointer to the actual value is stored as opaque data (tag_value_t). The tag item structure is defined as follows:

typedef struct {
tag_type_t t_tag;
tag_value_t t_value;
} tagi_t;
tagi_t
Tag item.
Definition su_tag.h:63
tag_value_t
intptr_t tag_value_t
Tag item value.
Definition su_tag.h:57
tag_type_t
struct tag_type_s const * tag_type_t
Tag item type.
Definition su_tag.h:55

The tag lists are central concept in the Sofia APIs. The tags lists can be used to a list of named arguments to a tagarg function, to store variable amount of data in a memory area, and passdata between processes and threads.The tagged argument lists can be used like named arguments inhigher-level languages. The argument list consists of tag-value pairs;tags specify the name and type of the value. All the tag items are notnecessarily interpreted by the called function, but it can pass the listto other functions. This feature is used also by the Sofia APIs, thelower-layer settings and options are frequently passed through theupper-layer API in the tag lists.The tagged argument lists are constructed using special macros thatexpand to two function arguments, tag and value. Each tag item macrochecks its arguments type so the tagged argument lists are typesafe ifthe list is correctly constructed.Each function documents the tags it accepts and also the tags it may passto the lower layers (at least in theory).@par Special TagsThere are a new special tags that are used to control and modify the taglist processing itself. These special tags are as follows:- TAG_NULL() or TAG_END() - indicates the end of tag list- TAG_SKIP() - indicates an empty (overwritten) tag item- TAG_NEXT() - contains a pointer to the next tag list.The tag type structures are declared as tag_typedef_t. They can bedefined by the macros found in <sofia-sip/su_tag_class.h>. See nta_tag.c orsu_tag_test.c for an example.

## Function Documentation

## tl_print()

void tl_print | ( | FILE * | f,
|  | char const * | title,
|  | tagi_t const | lst[] )

\

Print tags

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