libini_config 0.6.2
Loading...
Searching...
No Matches
Section and attribute management

Functions

char ** ini_get_section_list (struct ini_cfgobj *ini_config, int *size, int *error)
 Get list of sections.
 
void ini_free_section_list (char **section_list)
 Free list of sections.
 
char ** ini_get_attribute_list (struct ini_cfgobj *ini_config, const char *section, int *size, int *error)
 Get list of attributes.
 
void ini_free_attribute_list (char **attr_list)
 Free list of attributes.
 

Detailed Description

Functions in this section allow getting the lists of sections in the configuration file and keys in a section as arrays of strings.

Function Documentation

◆ ini_get_section_list()

char ** ini_get_section_list ( struct ini_cfgobj * ini_config,
int * size,
int * error )

Get list of sections.

Get list of sections from the configuration object as an array of strings. Function allocates memory for the array of the sections. Use ini_free_section_list() to free allocated memory.

Parameters
[in]ini_configConfiguration object.
[out]sizeIf not NULL parameter will receive number of sections in the configuration.
[out]errorIf not NULL parameter will receive the error code. 0 - Success. EINVAL - Invalid parameter. ENOMEM - No memory.
Returns
Array of strings.

◆ ini_free_section_list()

void ini_free_section_list ( char ** section_list)

Free list of sections.

The section array created by ini_get_section_list() should be freed using this function.

Parameters
[in]section_listArray of strings returned by ini_get_section_list() function.

◆ ini_get_attribute_list()

char ** ini_get_attribute_list ( struct ini_cfgobj * ini_config,
const char * section,
int * size,
int * error )

Get list of attributes.

Get list of attributes in a section as an array of strings. Function allocates memory for the array of attributes. Use ini_free_attribute_list() to free allocated memory.

Parameters
[in]ini_configConfiguration object.
[in]sectionSection name.
[out]sizeIf not NULL parameter will receive number of attributes in the section.
[out]errorIf not NULL parameter will receive the error code. 0 - Success. EINVAL - Invalid parameter. ENOMEM - No memory.
Returns
Array of strings.

◆ ini_free_attribute_list()

void ini_free_attribute_list ( char ** attr_list)

Free list of attributes.

The attribute array created by ini_get_attribute_list() should be freed using this function.

Parameters
[in]attr_listArray of strings returned by ini_get_attribute_list() function.