Purpose
Inserts an attribute label and value into a tag string.
Library
The signaling interface library (libsl.a).
C syntax
#include <sltag.h>
...
SL_RET_CODE sl_put_attribute (
char * buffer,
int buffer_len,
char * tag_attr,
char * value
);
Description
Searches buffer for the first occurrence of the tag label in tag_attr. If found, an attribute substring is inserted into the tag
string using the attribute label in tag_attr and value.
If the attribute label already exists in the tag string, the function returns
an error and buffer remains unchanged.
Parameters
- buffer
- A string containing one or more tag strings.
- buffer_len
- The total length of buffer, not just its current contents.
- tag_attr
- A string containing a tag label and an attribute label in the format:
tag.attribute. For example, CLNG.PRESENT.
- value
- A string containing the value of the attribute
Return values
- SLRC_OK
- Successful.
- SLRC_NOT_FOUND
- Could not find tag.
- SLRC_OVERFLOW
- There was not enough room in buffer to add the attribute substring.
- SLRC_INVALID_TAG
- The tag string containing tag is syntactically incorrect, tag
value was not changed.
- SLRC_DUPLICATE
- The specified attribute associated to the specified tag label already
exists in the tag string.
- SLRC_NULL_PTR
- buffer,tag_attr or value is a null pointer