#include "modules.h"#include "language.h"#include "version.h"
Go to the source code of this file.
Functions | |
| EvtMessage * | find_event (const char *name) |
| EvtHook * | find_eventhook (const char *name) |
| void | send_event (const char *name, int argc,...) |
| void | eventprintf (char *fmt,...) |
| void | event_message_process (char *eventbuf) |
| void | event_process_hook (const char *name, int argc, char **argv) |
| int | displayEventMessage (EvtMessage *evm) |
| int | displayEventHook (EvtHook *evh) |
| int | displayHookFromHash (char *name) |
| int | displayEvtMessageFromHash (char *name) |
| EvtMessage * | createEventHandler (char *name, int(*func)(char *source, int ac, char **av)) |
| EvtHook * | createEventHook (char *name, int(*func)(int argc, char **argv)) |
| EvtMessage * | findEventHandler (EvtMessageHash *msgEvtTable[], const char *name) |
| EvtHook * | findEventHook (EvtHookHash *hookEvtTable[], const char *name) |
| int | addCoreEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm) |
| int | addEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm) |
| int | addEventHook (EvtHookHash *hookEvtTable[], EvtHook *evh) |
| int | addCoreEventHook (EvtHookHash *hookEvtTable[], EvtHook *evh) |
| int | moduleAddEventHandler (EvtMessage *evm) |
| int | moduleAddEventHook (EvtHook *evh) |
| int | moduleEventDelHandler (char *name) |
| int | moduleEventDelHook (const char *name) |
| int | delEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm, char *mod_name) |
| int | delEventHook (EvtHookHash *hookEvtTable[], EvtHook *evh, char *mod_name) |
| int | destroyEventHandler (EvtMessage *evm) |
| int | destroyEventHook (EvtHook *evh) |
Variables | |
| char * | mod_current_evtbuffer = NULL |
| EvtMessageHash * | EVENT [MAX_CMD_HASH] |
| EvtHookHash * | EVENTHOOKS [MAX_CMD_HASH] |
| int addCoreEventHandler | ( | EvtMessageHash * | msgEvtTable[], | |
| EvtMessage * | evm | |||
| ) |
Add the given message (m) to the MessageHash marking it as a core command
| msgTable | the MessageHash we want to add to | |
| m | the Message we are adding |
Definition at line 376 of file events.c.
References addEventHandler(), and EvtMessage_::core.
| int addCoreEventHook | ( | EvtHookHash * | hookEvtTable[], | |
| EvtHook * | evh | |||
| ) |
Add the given message (m) to the MessageHash marking it as a core command
| msgTable | the MessageHash we want to add to | |
| m | the Message we are adding |
Definition at line 483 of file events.c.
References addEventHook(), and EvtHook_::core.
| int addEventHandler | ( | EvtMessageHash * | msgEvtTable[], | |
| EvtMessage * | evm | |||
| ) |
Add a message to the MessageHash.
| msgTable | the MessageHash we want to add a message to | |
| m | the Message we want to add |
Definition at line 391 of file events.c.
References alog(), CMD_HASH, current, debug, EvtMessageHash_::evm, fatal(), EvtMessageHash_::name, EvtMessage_::name, EvtMessage_::next, EvtMessageHash_::next, sstrdup(), and stricmp().
Referenced by addCoreEventHandler(), and moduleAddEventHandler().
| int addEventHook | ( | EvtHookHash * | hookEvtTable[], | |
| EvtHook * | evh | |||
| ) |
Add a message to the MessageHash.
| msgTable | the MessageHash we want to add a message to | |
| m | the Message we want to add |
Definition at line 437 of file events.c.
References alog(), CMD_HASH, current, debug, EvtHookHash_::evh, fatal(), EvtHookHash_::name, EvtHook_::name, EvtHook_::next, EvtHookHash_::next, sstrdup(), and stricmp().
Referenced by addCoreEventHook(), and moduleAddEventHook().
| EvtMessage* createEventHandler | ( | char * | name, | |
| int(*)(char *source, int ac, char **av) | func | |||
| ) |
Create a new Message struct.
| name | the name of the message | |
| func | a pointer to the function to call when we recive this message |
Definition at line 281 of file events.c.
References fatal(), EvtMessage_::func, EvtMessage_::mod_name, EvtMessage_::name, EvtMessage_::next, and sstrdup().
Referenced by AnopeInit().
| EvtHook* createEventHook | ( | char * | name, | |
| int(*)(int argc, char **argv) | func | |||
| ) |
Create a new Message struct.
| name | the name of the message | |
| func | a pointer to the function to call when we recive this message |
Definition at line 305 of file events.c.
References fatal(), EvtHook_::func, EvtHook_::mod_name, EvtHook_::name, EvtHook_::next, and sstrdup().
Referenced by AnopeInit().
| int delEventHandler | ( | EvtMessageHash * | msgEvtTable[], | |
| EvtMessage * | evm, | |||
| char * | mod_name | |||
| ) |
remove the given message from the given message hash, for the given module
| msgTable | which MessageHash we are removing from | |
| m | the Message we want to remove the name of the module we are removing |
Definition at line 609 of file events.c.
References CMD_HASH, current, EvtMessageHash_::evm, EvtMessage_::mod_name, EvtMessageHash_::name, EvtMessage_::name, EvtMessage_::next, EvtMessageHash_::next, and stricmp().
Referenced by moduleEventDelHandler(), and prepForUnload().
| int delEventHook | ( | EvtHookHash * | hookEvtTable[], | |
| EvtHook * | evh, | |||
| char * | mod_name | |||
| ) |
remove the given message from the given message hash, for the given module
| msgTable | which MessageHash we are removing from | |
| m | the Message we want to remove the name of the module we are removing |
Definition at line 682 of file events.c.
References CMD_HASH, current, EvtHookHash_::evh, EvtHook_::mod_name, EvtHookHash_::name, EvtHook_::name, EvtHook_::next, EvtHookHash_::next, and stricmp().
Referenced by moduleEventDelHook(), and prepForUnload().
| int destroyEventHandler | ( | EvtMessage * | evm | ) |
Destory a message, freeing its memory.
| m | the message to be destroyed |
Definition at line 753 of file events.c.
References EvtMessage_::func, EvtMessage_::mod_name, EvtMessage_::name, and EvtMessage_::next.
| int destroyEventHook | ( | EvtHook * | evh | ) |
Destory a message, freeing its memory.
| m | the message to be destroyed |
Definition at line 774 of file events.c.
References EvtHook_::func, EvtHook_::mod_name, EvtHook_::name, and EvtHook_::next.
| int displayEventHook | ( | EvtHook * | evh | ) |
Displays a message list for a given message. Again this is of little use other than debugging.
| m | the message to display |
Definition at line 209 of file events.c.
References alog(), EvtHook_::name, and EvtHook_::next.
Referenced by displayHookFromHash().
| int displayEventMessage | ( | EvtMessage * | evm | ) |
Displays a message list for a given message. Again this is of little use other than debugging.
| m | the message to display |
Definition at line 191 of file events.c.
References alog(), EvtMessage_::name, and EvtMessage_::next.
Referenced by displayEvtMessageFromHash().
| int displayEvtMessageFromHash | ( | char * | name | ) |
Display the message call stak. Prints the call stack for a message based on the message name, again useful for debugging and little lese :)
| name | the name of the message to print info for |
Definition at line 252 of file events.c.
References alog(), CMD_HASH, current, debug, displayEventMessage(), EvtMessageHash_::evm, EvtMessageHash_::name, EvtMessageHash_::next, and stricmp().
Referenced by moduleAddEventHandler(), and moduleEventDelHandler().
| int displayHookFromHash | ( | char * | name | ) |
Display the message call stak. Prints the call stack for a message based on the message name, again useful for debugging and little lese :)
| name | the name of the message to print info for |
Definition at line 227 of file events.c.
References alog(), CMD_HASH, current, debug, displayEventHook(), EvtHookHash_::evh, EvtHookHash_::name, EvtHookHash_::next, and stricmp().
Referenced by moduleAddEventHook(), and moduleEventDelHook().
| void event_message_process | ( | char * | eventbuf | ) |
Definition at line 83 of file events.c.
References current, doCleanBuffer(), find_event(), findModule(), EvtMessage_::func, MOD_CONT, mod_current_module, mod_current_module_name, EvtMessage_::mod_name, EvtMessage_::next, split_buf(), and strscpy().
Referenced by eventprintf().
| void event_process_hook | ( | const char * | name, | |
| int | argc, | |||
| char ** | argv | |||
| ) |
Definition at line 153 of file events.c.
References current, find_eventhook(), findModule(), EvtHook_::func, MOD_CONT, mod_current_evtbuffer, mod_current_module, mod_current_module_name, EvtHook_::mod_name, and EvtHook_::next.
Referenced by send_event().
| void eventprintf | ( | char * | fmt, | |
| ... | ||||
| ) |
Definition at line 66 of file events.c.
References event_message_process(), sstrdup(), and vsnprintf().
Referenced by vsend_cmd().
| EvtMessage* find_event | ( | const char * | name | ) |
Definition at line 23 of file events.c.
References findEventHandler().
Referenced by event_message_process().
| EvtHook* find_eventhook | ( | const char * | name | ) |
Definition at line 30 of file events.c.
References findEventHook().
Referenced by event_process_hook().
| EvtMessage* findEventHandler | ( | EvtMessageHash * | msgEvtTable[], | |
| const char * | name | |||
| ) |
find a message in the given table. Looks up the message <name> in the MessageHash given
| MessageHash | the message table to search for this command, will almost always be IRCD | |
| name | the name of the command were looking for |
Definition at line 328 of file events.c.
References CMD_HASH, current, EvtMessageHash_::evm, EvtMessageHash_::name, EvtMessageHash_::next, and stricmp().
Referenced by find_event(), and moduleEventDelHandler().
| EvtHook* findEventHook | ( | EvtHookHash * | hookEvtTable[], | |
| const char * | name | |||
| ) |
find a message in the given table. Looks up the message <name> in the MessageHash given
| MessageHash | the message table to search for this command, will almost always be IRCD | |
| name | the name of the command were looking for |
Definition at line 353 of file events.c.
References CMD_HASH, current, EvtHookHash_::evh, EvtHookHash_::name, EvtHookHash_::next, and stricmp().
Referenced by find_eventhook(), and moduleEventDelHook().
| int moduleAddEventHandler | ( | EvtMessage * | evm | ) |
Add a module message to the IRCD message hash
| m | the Message to add | |
| pos | the Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE |
Definition at line 498 of file events.c.
References addEventHandler(), EvtMessage_::core, debug, displayEvtMessageFromHash(), mod_current_module, EvtMessage_::mod_name, EvtMessage_::name, Module_::name, and sstrdup().
Referenced by AnopeInit().
| int moduleAddEventHook | ( | EvtHook * | evh | ) |
Add a module message to the IRCD message hash
| m | the Message to add | |
| pos | the Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE |
Definition at line 528 of file events.c.
References addEventHook(), EvtHook_::core, debug, displayHookFromHash(), mod_current_module, EvtHook_::mod_name, EvtHook_::name, Module_::name, and sstrdup().
Referenced by AnopeInit().
| int moduleEventDelHandler | ( | char * | name | ) |
remove the given message from the IRCD message hash
| name | the name of the message to remove |
Definition at line 557 of file events.c.
References debug, delEventHandler(), displayEvtMessageFromHash(), findEventHandler(), mod_current_module, EvtMessage_::name, and Module_::name.
| int moduleEventDelHook | ( | const char * | name | ) |
remove the given message from the IRCD message hash
| name | the name of the message to remove |
Definition at line 582 of file events.c.
References debug, delEventHook(), displayHookFromHash(), findEventHook(), mod_current_module, EvtHook_::name, and Module_::name.
| void send_event | ( | const char * | name, | |
| int | argc, | |||
| ... | ||||
| ) |
Now that the events have seen the message, free it up
Definition at line 37 of file events.c.
References alog(), debug, event_process_hook(), and sstrdup().
Referenced by access_del(), addCommand(), anope_event_tburst(), anope_event_topic(), backup_databases(), bot_join(), bot_kick(), bot_raw_ban(), bot_raw_kick(), botchanmsgs(), change_core_display(), check_ban(), delCommand(), delcore(), delete_user(), do_access(), do_assign(), do_bot(), do_confirm(), do_defcon(), do_drop(), do_forbid(), do_ghost(), do_group(), do_identify(), do_join(), do_kick(), do_logout(), do_nick(), do_part(), do_recover(), do_register(), do_reload(), do_server(), do_sjoin(), do_squit(), do_suspend(), do_topic(), do_unsuspend(), do_xop(), expire_all(), expire_chans(), expire_nicks(), init_secondary(), loadModule(), resetDefCon(), save_databases(), services_restart(), services_shutdown(), sighandler(), unassign(), unloadModule(), and xop_del().
| EvtMessageHash* EVENT[MAX_CMD_HASH] |
| EvtHookHash* EVENTHOOKS[MAX_CMD_HASH] |
| char* mod_current_evtbuffer = NULL |
Definition at line 18 of file events.c.
Referenced by event_process_hook().
1.7.1