sl_get_attribute_value

Purpose

Obtains the value of a specified attribute in a specified tag string.

Library

The signaling interface library (libsl.a).

C syntax

#include <sltag.h>
...
SL_RET_CODE 	        sl_get_attribute_value (
    char *           buffer,
    char *           tag_attr,
    char *           destination,
    int              destination_len
);

Description

Searches buffer for the tag label in tag_attr, and then searches within the deduced tag string for the attribute label in tag_attr. If found, the attribute value is extracted and written to destination.

Parameters

buffer
A string containing one or more tag strings.
tag_attr
A string containing a tag label and an attribute label in the format: tag.attribute. For example, CLNG.PRESENT.
destination
A string variable to which the attribute value is copied.
destination_len
The total length of destination (the string capacity, in bytes)

Return values

SLRC_OK
Successful.
SLRC_NOT_FOUND
Could not find tag or attribute of tag.
SLRC_OVERFLOW
Insufficient space in destination to store the attribute value
SLRC_INVALID_TAG
The tag string containing tag is syntactically incorrect. Tag value was not changed.
SLRC_NULL_PTR
buffer , tag_attr or destination is a null pointer.

Related information