|
RTS API Documentation
1.10.11
|
Collaboration diagram for Config File Parser:Data Structures | |
| struct | switch_config |
| A simple file handle representing an open configuration file. More... | |
Typedefs | |
| typedef typedefSWITCH_BEGIN_EXTERN_C struct switch_config | switch_config_t |
Functions | |
| int | switch_config_open_file (switch_config_t *cfg, char *file_path) |
| Open a configuration file. More... | |
| void | switch_config_close_file (switch_config_t *cfg) |
| Close a previously opened configuration file. More... | |
| int | switch_config_next_pair (switch_config_t *cfg, char **var, char **val) |
| Retrieve next name/value pair from configuration file. More... | |
This module implements a basic interface and file format parser it may be deprecated in favor of database entries or expanded to tie to external handlers in the future as necessary.
EXAMPLE
[category1] var1 => val1 var2 => val2 # lines that begin with # are comments #var3 => val3
| typedef typedefSWITCH_BEGIN_EXTERN_C struct switch_config switch_config_t |
Definition at line 61 of file switch_config.h.
| void switch_config_close_file | ( | switch_config_t * | cfg | ) |
Close a previously opened configuration file.
| cfg | (switch_config_t *) config handle to use |
Definition at line 91 of file switch_config.c.
References memset().
Referenced by switch_config_open_file().
| int switch_config_next_pair | ( | switch_config_t * | cfg, |
| char ** | var, | ||
| char ** | val | ||
| ) |
Retrieve next name/value pair from configuration file.
| cfg | (switch_config_t *) config handle to use |
| var | pointer to aim at the new variable name |
| val | pointer to aim at the new value |
Definition at line 101 of file switch_config.c.
References switch_copy_string().
Referenced by switch_config_open_file().
| int switch_config_open_file | ( | switch_config_t * | cfg, |
| char * | file_path | ||
| ) |
Open a configuration file.
| cfg | (switch_config_t *) config handle to use |
| file_path | path to the file |
Definition at line 36 of file switch_config.c.
References switch_directories::conf_dir, memset(), path, switch_config_close_file(), switch_config_next_pair(), SWITCH_GLOBAL_dirs, switch_is_file_path(), SWITCH_PATH_SEPARATOR, switch_set_string, and switch_snprintf().
1.8.13