This file contains functions to help maintain a stack of modules. More...
Data Structures | |
| struct | module_stack |
| Stack of modules. More... | |
Functions | |
| void | modstack_init (struct module_stack *stack) |
| Init a stack of modules. | |
| int | modstack_config (struct module_stack *stack, const char *module_conf) |
| Read config file module settings and set up the modfunc block. | |
| struct module_func_block * | module_factory (const char **str) |
| Get funcblock for module name. | |
| const char ** | module_list_avail (void) |
| Get list of modules available. | |
| int | modstack_setup (struct module_stack *stack, const char *module_conf, struct module_env *env) |
| Setup modules. | |
| void | modstack_desetup (struct module_stack *stack, struct module_env *env) |
| Desetup the modules, deinit, delete. | |
| int | modstack_find (struct module_stack *stack, const char *name) |
| Find index of module by name. | |
This file contains functions to help maintain a stack of modules.
| void modstack_init | ( | struct module_stack * | stack | ) |
Init a stack of modules.
| stack,: | initialised as empty. |
References module_stack::num, and module_stack::mod.
Referenced by daemon_init(), and ub_ctx_create().
| int modstack_config | ( | struct module_stack * | stack, |
| const char * | module_conf | ||
| ) |
Read config file module settings and set up the modfunc block.
| stack,: | the stack of modules (empty before call). |
| module_conf,: | string what modules to insert. |
References verbose(), VERB_QUERY, module_stack::num, count_modules(), log_err(), MAX_MODULE, module_stack::mod, and module_factory().
Referenced by modstack_setup().
| struct module_func_block* module_factory | ( | const char ** | str | ) | [read] |
Get funcblock for module name.
| str,: | string with module name. Advanced to next value on success. The string is assumed whitespace separated list of module names. |
References module_list_avail(), and module_funcs_avail().
Referenced by modstack_config().
| const char** module_list_avail | ( | void | ) |
Get list of modules available.
Referenced by usage(), and module_factory().
| int modstack_setup | ( | struct module_stack * | stack, |
| const char * | module_conf, | ||
| struct module_env * | env | ||
| ) |
Setup modules.
Assigns ids and calls module_init.
| stack,: | if not empty beforehand, it will be desetup()ed. It is then modstack_configged(). |
| module_conf,: | string what modules to insert. |
| env,: | module environment which is inited by the modules. environment should have a superalloc, cfg, env.need_to_validate is set by the modules. |
References module_stack::num, modstack_desetup(), modstack_config(), module_env::need_to_validate, verbose(), VERB_OPS, module_stack::mod, module_func_block::name, fptr_ok, fptr_whitelist_mod_init(), module_func_block::init, and log_err().
Referenced by daemon_setup_modules(), and context_finalize().
| void modstack_desetup | ( | struct module_stack * | stack, |
| struct module_env * | env | ||
| ) |
Desetup the modules, deinit, delete.
| stack,: | made empty. |
| env,: | module env for module deinit() calls. |
References module_stack::num, fptr_ok, fptr_whitelist_mod_deinit(), module_stack::mod, and module_func_block::deinit.
Referenced by daemon_delete(), ub_ctx_delete(), and modstack_setup().
| int modstack_find | ( | struct module_stack * | stack, |
| const char * | name | ||
| ) |
Find index of module by name.
| stack,: | to look in |
| name,: | the name to look for |
References module_stack::num, module_stack::mod, and module_func_block::name.
Referenced by print_deleg_lookup(), print_mem(), do_list_stubs(), and get_rrset_bogus().