43 |
int line_num; |
int line_num; |
44 |
}; |
}; |
45 |
|
|
46 |
static LIST /* of struct cfg_memblock */ *cfg_memory_pool; |
static RAD_LIST /* of struct cfg_memblock */ *cfg_memory_pool; |
47 |
|
|
48 |
static LIST *_cfg_vlist_create(cfg_value_t *val); |
static RAD_LIST *_cfg_vlist_create(cfg_value_t *val); |
49 |
static void _cfg_vlist_append(LIST *vlist, cfg_value_t *val); |
static void _cfg_vlist_append(RAD_LIST *vlist, cfg_value_t *val); |
50 |
|
|
51 |
void *cfg_malloc(size_t size, void (*destructor)(void *)); |
void *cfg_malloc(size_t size, void (*destructor)(void *)); |
52 |
|
|
79 |
static void _cfg_push_block(struct cfg_stmt *stmt, cfg_end_fp end, void *data); |
static void _cfg_push_block(struct cfg_stmt *stmt, cfg_end_fp end, void *data); |
80 |
static struct syntax_block *_cfg_pop_block(); |
static struct syntax_block *_cfg_pop_block(); |
81 |
|
|
82 |
int _cfg_make_argv(cfg_value_t **argv, char *keyword, LIST *vlist); |
int _cfg_make_argv(cfg_value_t **argv, char *keyword, RAD_LIST *vlist); |
83 |
void _cfg_free_argv(int argc, cfg_value_t *argv); |
void _cfg_free_argv(int argc, cfg_value_t *argv); |
84 |
|
|
85 |
struct cfg_stmt *_cfg_find_keyword(struct cfg_stmt *stmt, char *str); |
struct cfg_stmt *_cfg_find_keyword(struct cfg_stmt *stmt, char *str); |
99 |
char *string; |
char *string; |
100 |
cfg_value_t value; |
cfg_value_t value; |
101 |
cfg_network_t network; |
cfg_network_t network; |
102 |
LIST *vlist; |
RAD_LIST *vlist; |
103 |
struct cfg_stmt *stmt; |
struct cfg_stmt *stmt; |
104 |
}; |
}; |
105 |
|
|
511 |
} |
} |
512 |
|
|
513 |
int |
int |
514 |
_cfg_make_argv(cfg_value_t **argv, char *keyword, LIST *vlist) |
_cfg_make_argv(cfg_value_t **argv, char *keyword, RAD_LIST *vlist) |
515 |
{ |
{ |
516 |
int argc; |
int argc; |
517 |
|
|
546 |
static void |
static void |
547 |
_cfg_vlist_destroy(void *arg) |
_cfg_vlist_destroy(void *arg) |
548 |
{ |
{ |
549 |
LIST **pl = arg; |
RAD_LIST **pl = arg; |
550 |
list_destroy(pl, NULL, NULL); |
list_destroy(pl, NULL, NULL); |
551 |
} |
} |
552 |
|
|
553 |
void |
void |
554 |
_cfg_vlist_append(LIST *vlist, cfg_value_t *val) |
_cfg_vlist_append(RAD_LIST *vlist, cfg_value_t *val) |
555 |
{ |
{ |
556 |
cfg_value_t *vp = cfg_malloc(sizeof(*vp), NULL); |
cfg_value_t *vp = cfg_malloc(sizeof(*vp), NULL); |
557 |
*vp = *val; |
*vp = *val; |
558 |
list_append(vlist, vp); |
list_append(vlist, vp); |
559 |
} |
} |
560 |
|
|
561 |
LIST * |
RAD_LIST * |
562 |
_cfg_vlist_create(cfg_value_t *val) |
_cfg_vlist_create(cfg_value_t *val) |
563 |
{ |
{ |
564 |
LIST *vlist = list_create(); |
RAD_LIST *vlist = list_create(); |
565 |
LIST **lp = cfg_malloc(sizeof(*lp), _cfg_vlist_destroy); |
RAD_LIST **lp = cfg_malloc(sizeof(*lp), _cfg_vlist_destroy); |
566 |
*lp = vlist; |
*lp = vlist; |
567 |
_cfg_vlist_append(vlist, val); |
_cfg_vlist_append(vlist, val); |
568 |
return vlist; |
return vlist; |