Browse Source

* support for [csocket] section in config parser

master
Alex 'AdUser' Z 4 years ago
parent
commit
3f16390ec9
  1. 7
      src/config.c
  2. 2
      src/config.h

7
src/config.c

@ -126,6 +126,12 @@ f2b_config_section_create(const char *src) {
return section;
}
name = "csocket";
if (strncmp(line, name, strlen(name)) == 0) {
section->type = t_csocket;
return section;
}
name = "defaults";
if (strncmp(line, name, strlen(name)) == 0) {
section->type = t_defaults;
@ -184,6 +190,7 @@ f2b_config_section_append(f2b_config_t *config, f2b_config_section_t *section) {
switch (section->type) {
case t_main: s = &config->main; break;
case t_csocket: s = &config->csocket; break;
case t_defaults: s = &config->defaults; break;
case t_source: s = &config->sources; break;
case t_filter: s = &config->filters; break;

2
src/config.h

@ -32,6 +32,7 @@
typedef enum f2b_section_type {
t_unknown = 0, /**< default value */
t_main, /**< [main] section */
t_csocket, /**< [csocket] section */
t_defaults, /**< [defaults] section */
t_source, /**< [source:*] section */
t_filter, /**< [filter:*] section */
@ -58,6 +59,7 @@ typedef struct f2b_config_section_t {
/** topmost f2b config struct */
typedef struct f2b_config_t {
f2b_config_section_t *main; /**< section [main] */
f2b_config_section_t *csocket; /**< section [csocket] */
f2b_config_section_t *defaults; /**< section [defaults] */
f2b_config_section_t *sources; /**< sections [source:*] */
f2b_config_section_t *filters; /**< sections [filter:*] */

Loading…
Cancel
Save