#include "stdinc.h"#include "server.h"Go to the source code of this file.
Functions | |
| char * | GetModErr (int status) |
| void | init_modules () |
| int | load_protocol () |
| int | load_modules () |
| char * | create_mod_temp (char *file) |
| int | module_open (char *filename, int type) |
| int | module_exists (char *fileName) |
| char * | find_module_dir (char *module) |
| void | module_free (Module *m) |
| int | module_close (char *filename) |
| Module * | module_find (char *filename) |
| void | purge_modules () |
| ModuleQEntry * | find_mod_que (char *file) |
| int | addto_mod_que (char *file, int op, int load) |
| int | run_mod_que (int load) |
| int | mod_event_shutdown (int ac, void *args) |
| int | mod_event_rehash (int ac, void *args) |
| int addto_mod_que | ( | char * | file, | |
| int | op, | |||
| int | load | |||
| ) |
Definition at line 620 of file module.c.
References ModuleQEntry::action, dlink_add_tail(), dlink_create(), ModuleQEntry::load, MOD_ERR_MEMORY, MOD_ERR_OK, moduleque, ModuleQEntry::name, and strlcpy().
Referenced by load_modules().
| char* create_mod_temp | ( | char * | file | ) |
Create a temporary module file.
| filename | (string) Path to module file we are copying |
Definition at line 245 of file module.c.
References CfgSettings, format_filename, MAXPATH, MAXREADBUFFER, Conf::network, strlcat(), and TMP_DIR.
Referenced by module_open().
| ModuleQEntry* find_mod_que | ( | char * | file | ) |
Module Que Opporations
Definition at line 605 of file module.c.
References DLINK_FOREACH, moduleque, and ModuleQEntry::name.
| char* find_module_dir | ( | char * | module | ) |
Definition at line 446 of file module.c.
References CLIENT_MOD_DIR, CONTRIB_PATH, CPATH, module_exists(), MPATH, and PPATH.
| char* GetModErr | ( | int | status | ) |
Return a module error string.
| status | Error code we are returning. |
Definition at line 41 of file module.c.
References mod_err_msg, and MOD_ERR_MSG.
Referenced by load_modules(), load_protocol(), and run_mod_que().
| void init_modules | ( | ) |
Definition at line 87 of file module.c.
References AddEvent, load_modules(), load_protocol(), mod_event_rehash(), mod_event_shutdown(), MOD_LOAD_POST, MOD_LOAD_PRE, MOD_LOAD_STD, and run_mod_que().
Referenced by Run().
| int load_modules | ( | ) |
Definition at line 146 of file module.c.
References addto_mod_que(), alog(), CPATH, DLINK_FOREACH, Exit(), get_config_base(), GetModErr(), HASH, HASH_B, ConfBase::map, MOD_ACT_LOAD, MOD_ERR_OK, MOD_LOAD_STD, MOD_TYPE_CORE, MODULE_DIR, module_find(), module_open(), RUNNING, and sync_state.
Referenced by init_modules().
| int load_protocol | ( | ) |
load_protocol() - Load our given protocol if it fails toss a critical error and return
Definition at line 121 of file module.c.
References alog(), CfgSettings, get_config_entry(), GetModErr(), LOG_FATAL, MOD_TYPE_PROTOCOL, module_open(), Conf::protocol, sendto_console(), and strlcpy().
Referenced by init_modules().
| int mod_event_rehash | ( | int | , | |
| void * | ||||
| ) |
Event Hooks
Definition at line 709 of file module.c.
References MOD_LOAD_POST, MOD_LOAD_PRE, MOD_LOAD_STD, and run_mod_que().
Referenced by init_modules().
| int mod_event_shutdown | ( | int | ac, | |
| void * | args | |||
| ) |
Module Loader Event Hooks
Definition at line 703 of file module.c.
References purge_modules().
Referenced by init_modules().
| int module_close | ( | char * | filename | ) |
Definition at line 517 of file module.c.
References alog(), Module::handle, LOG_MODULE, Module::mi, MOD_ERR_NOFILE, MOD_ERR_OK, MOD_ERR_UNLOAD, ModuleInfo::mod_unregister, module_find(), and module_free().
Referenced by run_mod_que().
| int module_exists | ( | char * | fileName | ) |
Definition at line 426 of file module.c.
Referenced by find_module_dir(), and module_free().
| Module* module_find | ( | char * | filename | ) |
Definition at line 540 of file module.c.
References DLINK_FOREACH, modules, and Module::name.
Referenced by load_modules(), module_close(), module_open(), and run_mod_que().
| void module_free | ( | Module * | m | ) |
Definition at line 493 of file module.c.
References dlink_find_delete(), dlink_free(), Module::file, module_exists(), and modules.
Referenced by module_close(), module_open(), and purge_modules().
| int module_open | ( | char * | filename, | |
| int | type | |||
| ) |
module_open() - Load our module file symbols
| filename | The file we are trying to link against. | |
| type | Type of module we are loading.
|
Definition at line 333 of file module.c.
References ABI_VERSION, Module::age, create_mod_temp(), dlink_add_tail(), dlink_create(), Module::file, Module::handle, Module::mi, MOD_ERR_API, MOD_ERR_EXISTS, MOD_ERR_IO, MOD_ERR_MEMORY, MOD_ERR_OK, ModuleInfo::mod_register, module_find(), module_free(), modules, Module::name, throwModErr, and Module::type.
Referenced by load_modules(), load_protocol(), and run_mod_que().
| void purge_modules | ( | ) |
Definition at line 564 of file module.c.
References DLINK_FOREACH_SAFE, Module::handle, Module::mi, MOD_TYPE_PROTOCOL, ModuleInfo::mod_unregister, module_free(), modules, and Module::type.
Referenced by mod_event_shutdown().
| int run_mod_que | ( | int | load | ) |
Definition at line 643 of file module.c.
References ModuleQEntry::action, alog(), dlink_delete(), DLINK_FOREACH_SAFE, dlink_free(), GetModErr(), ModuleQEntry::load, LOG_MODULE, MOD_ACT_LOAD, MOD_ACT_RELOAD, MOD_ACT_UNLOAD, MOD_LOAD_NONE, MOD_TYPE_UNKNOWN, module_close(), module_find(), module_open(), moduleque, ModuleQEntry::name, RUNNING, and sync_state.
Referenced by init_modules(), and mod_event_rehash().
1.6.3