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

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_config Configuration object.
[out] size If not NULL parameter will receive number of sections in the configuration.
[out] error If not NULL parameter will receive the error code. 0 - Success. EINVAL - Invalid parameter. ENOMEM - No memory.
Returns:
Array of strings.
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_list Array of strings returned by ini_get_section_list() function.
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_config Configuration object.
[in] section Section name.
[out] size If not NULL parameter will receive number of attributes in the section.
[out] error If not NULL parameter will receive the error code. 0 - Success. EINVAL - Invalid parameter. ENOMEM - No memory.
Returns:
Array of strings.
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_list Array of strings returned by ini_get_attribute_list() function.

Generated on 15 Oct 2014 for libini_config by  doxygen 1.6.1