SIP-router core ::Module: SIP-router core. More...
#include "cfg_parser.h"#include "mem/mem.h"#include "mem/shm_mem.h"#include "dprint.h"#include "trim.h"#include "ut.h"#include <string.h>#include <stdlib.h>#include <stdio.h>#include <libgen.h>
Go to the source code of this file.
The states of the lexical scanner.
More...See ConfigEngine
Definition in file cfg_parser.c.
| enum st |
| ST_S |
Begin. |
| ST_A |
Alphanumeric. |
| ST_AE |
Alphanumeric escaped. |
| ST_Q |
Quoted. |
| ST_QE |
Quoted escaped. |
| ST_C |
Comment. |
| ST_CE |
Comment escaped. |
| ST_E |
Escaped. |
Definition at line 169 of file cfg_parser.c.
| int cfg_get_token | ( | struct cfg_token * | token, | |
| struct cfg_parser * | st, | |||
| unsigned int | flags | |||
| ) |
Interface to the lexical scanner
Definition at line 311 of file cfg_parser.c.
References CFG_EXTENDED_ALPHA, cfg_parser::col, cfg_parser::file, IS_ALPHA, IS_DELIM, IS_WHITESPACE, _str::len, cfg_parser::line, PUSH, RETURN, _str::s, ST_A, ST_AE, ST_C, ST_CE, ST_E, ST_Q, ST_QE, ST_S, and cfg_token::val.
Referenced by cfg_parse_section().

| int cfg_parse_section | ( | void * | param, | |
| struct cfg_parser * | st, | |||
| unsigned int | flags | |||
| ) |
The function expects parameter param to be of type (str*). The result string is allocated using pkg_malloc and is zero terminated. To free the memory use pkg_free(((str*)param)->s)
Definition at line 539 of file cfg_parser.c.
References cfg_get_token(), CFG_STR_MALLOC, CFG_STR_PKGMEM, CFG_STR_SHMMEM, cfg_token::col, cfg_parser::col, cfg_parser::file, cfg_token::line, cfg_parser::line, and cfg_token::type.

| cfg_parser_t* cfg_parser_init | ( | str * | basedir, | |
| str * | filename | |||
| ) | [read] |
| basedir | - path to the config file name. If 0 the path (base directory) of the main ser.cfg file will be used, else basedir will be concatenated to the filename. It will be used only if filename is not an absolute path. | |
| filename | - config filename (can include path elements). |
Definition at line 624 of file cfg_parser.c.
References cfg_parser::col, cfg_parser::f, cfg_parser::file, get_abs_pathname(), _str::len, cfg_parser::line, _str::s, and STR_FMT.

1.7.1