Configuration files parsing (headers)
More...
#include <ini_config.h>
Go to the source code of this file.
Functions |
janus_config * | janus_config_parse (const char *config_file) |
| Method to parse an INI configuration file.
|
janus_config * | janus_config_create (const char *name) |
| Method to create a new, empty, configuration.
|
janus_config_category * | janus_config_get_categories (janus_config *config) |
| Get all categories from a parsed configuration.
|
janus_config_category * | janus_config_get_category (janus_config *config, const char *name) |
| Get the category with a specific name from a parsed configuration.
|
janus_config_item * | janus_config_get_items (janus_config_category *category) |
| Get all items from a category of a parsed configuration.
|
janus_config_item * | janus_config_get_item (janus_config_category *category, const char *name) |
| Get the item with a specific name from a category of a parsed configuration.
|
janus_config_item * | janus_config_get_item_drilldown (janus_config *config, const char *category, const char *name) |
| Get the item with a specific name from a category with a specific name from a parsed configuration.
|
janus_config_item * | janus_config_add_item (janus_config *config, const char *category, const char *name, const char *value) |
| Add a new item with the specific name and value to a category, and create the category if it doesn't exist.
|
void | janus_config_print (janus_config *config) |
| Helper method to print a configuration on the standard output.
|
void | janus_config_destroy (janus_config *config) |
| Destroy a configuration container instance.
|
Detailed Description
Configuration files parsing (headers)
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- GNU General Public License v3
Implementation of a parser of INI configuration files (based on libini-config).
Core
Typedef Documentation
Configuration category ([category])
Configuration item (name=value)
Function Documentation
Add a new item with the specific name and value to a category, and create the category if it doesn't exist.
- Note
- If the item already exists in the category, its value is overwritten
- Parameters
-
[in] | config | The configuration container |
[in] | category | The category to add the item to, and to create if it doesn't exist |
[in] | name | The name of the item |
[in] | value | The value of the item |
- Returns
- A pointer to the janus_config_item instance if successful, NULL otherwise
Method to create a new, empty, configuration.
- Parameters
-
[in] | name | Name to give to the configuration |
- Returns
- A pointer to a valid janus_config instance if successful, NULL otherwise
Destroy a configuration container instance.
- Parameters
-
[in] | config | The configuration to destroy |
Get all categories from a parsed configuration.
- Parameters
-
[in] | config | The configuration container |
- Returns
- A pointer to the first janus_config_category instance in the list if successful, NULL otherwise
Get the category with a specific name from a parsed configuration.
- Parameters
-
[in] | config | The configuration container |
[in] | name | The name of the category |
- Returns
- A pointer to the janus_config_category instance if successful, NULL otherwise
Get the item with a specific name from a category of a parsed configuration.
- Parameters
-
[in] | category | The configuration category |
[in] | name | The name of the item |
- Returns
- A pointer to the janus_config_item instance if successful, NULL otherwise
Get the item with a specific name from a category with a specific name from a parsed configuration.
- Note
- This is the same as janus_config_get_item, but it looks for the janus_config_category for you
- Parameters
-
[in] | config | The configuration container |
[in] | category | The name of the configuration category |
[in] | name | The name of the item |
- Returns
- A pointer to the janus_config_item instance if successful, NULL otherwise
Get all items from a category of a parsed configuration.
- Parameters
-
[in] | category | The configuration category |
- Returns
- A pointer to the first janus_config_item instance in the list if successful, NULL otherwise
janus_config* janus_config_parse |
( |
const char * |
config_file | ) |
|
Method to parse an INI configuration file.
- Parameters
-
[in] | config_file | Path to the configuration file |
- Returns
- A pointer to a valid janus_config instance if successful, NULL otherwise
Helper method to print a configuration on the standard output.
- Parameters
-
[in] | config | The configuration to print |