stumpless 2.2.0
|
An element of structured data. More...
#include <element.h>
Data Fields | |
char | name [32+1] |
The name of the element. | |
size_t | name_length |
The number of characters in name. | |
struct stumpless_param ** | params |
The parameters this element contains. | |
size_t | param_count |
The number of params in the array. | |
An element of structured data.
Elements must have a name, but may or may not have any parameters. Their components must comply with RFC 5424.
char stumpless_element::name[32+1] |
The name of the element.
As specified in RFC 5424, the '=', ']', '"' characters are not allowed in element names. In addition, the '@' character is only allowed in names that are private. All other characters between '!' and '~', inclusive, are allowed.
According to the standard names must either be private (of the form name<private enterprise number>) or registered with the IANA. This library assumes that you have done your due diligence and does not enforce the registration requirement.
Note that the name will be NULL-terminated as of version 1.6.0. In earlier versions it is not NULL-terminated.
If you need to access the name, use the stumpless_(g|s)et_element_name functions. These will protect you from changes in the struct in future versions.
size_t stumpless_element::name_length |
The number of characters in name.
size_t stumpless_element::param_count |
The number of params in the array.
struct stumpless_param** stumpless_element::params |
The parameters this element contains.
This is an array of pointers to param structures. Use the param_count member to iterate through the array if needed. This may be NULL if there are no params in the element, but not necessarily - the param_count is the only way to tell for sure.