Anope IRC Services  Version 1.8
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
modules.h File Reference
#include <time.h>
#include "services.h"
#include <stdio.h>
Include dependency graph for modules.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ModuleLang_
 
struct  Module_
 
struct  ModuleHash_
 
struct  ModuleQueue_
 
struct  Command_
 
struct  CommandHash_
 
struct  Message_
 
struct  MessageHash_
 
struct  ModuleCallBack_
 
struct  EvtMessage_
 
struct  EvtMessageHash_
 
struct  EvtHook_
 
struct  EvtHookHash_
 

Macros

#define ano_modopen(file)   dlopen(file, RTLD_LAZY)
 
#define ano_moderr()   dlerror()
 
#define ano_modsym(file, symbol)   dlsym(file, DL_PREFIX symbol)
 
#define ano_modclose(file)   dlclose(file)
 
#define ano_modclearerr()   dlerror()
 
#define MODULE_EXT   ".so"
 
#define CMD_HASH(x)   (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */
 
#define MAX_CMD_HASH   1024
 
#define MOD_STOP   1
 
#define MOD_CONT   0
 
#define HOSTSERV   HS_cmdTable /* using HOSTSERV etc. looks nicer than HS_cmdTable for modules */
 
#define BOTSERV   BS_cmdTable
 
#define MEMOSERV   MS_cmdTable
 
#define NICKSERV   NS_cmdTable
 
#define CHANSERV   CS_cmdTable
 
#define HELPSERV   HE_cmdTable
 
#define OPERSERV   OS_cmdTable
 
#define IRCD   IRCD_cmdTable
 
#define MODULE_HASH   Module_table
 
#define EVENT   EVENT_cmdTable
 
#define EVENTHOOKS   HOOK_cmdTable
 
#define MOD_ERR_OK   0
 
#define MOD_ERR_MEMORY   1
 
#define MOD_ERR_PARAMS   2
 
#define MOD_ERR_EXISTS   3
 
#define MOD_ERR_NOEXIST   4
 
#define MOD_ERR_NOUSER   5
 
#define MOD_ERR_NOLOAD   6
 
#define MOD_ERR_NOUNLOAD   7
 
#define MOD_ERR_SYNTAX   8
 
#define MOD_ERR_NODELETE   9
 
#define MOD_ERR_UNKNOWN   10
 
#define MOD_ERR_FILE_IO   11
 
#define MOD_ERR_NOSERVICE   12
 
#define MOD_ERR_NO_MOD_NAME   13
 
#define MDE
 

Typedefs

typedef void * ano_module_t
 
typedef struct Command_ Command
 
typedef struct CommandHash_ CommandHash
 
typedef struct Module_ Module
 
typedef struct ModuleLang_ ModuleLang
 
typedef struct ModuleHash_ ModuleHash
 
typedef struct ModuleQueue_ ModuleQueue
 
typedef struct Message_ Message
 
typedef struct MessageHash_ MessageHash
 
typedef struct ModuleCallBack_ ModuleCallBack
 
typedef struct EvtMessage_ EvtMessage
 
typedef struct EvtMessageHash_ EvtMessageHash
 
typedef struct EvtHook_ EvtHook
 
typedef struct EvtHookHash_ EvtHookHash
 

Enumerations

enum  MODType {
  CORE, PROTOCOL, THIRD, SUPPORTED,
  QATESTED, ENCRYPTION
}
 
enum  ModuleOperation { MOD_OP_LOAD, MOD_OP_UNLOAD }
 

Functions

MDE ModulecreateModule (char *filename)
 
int destroyModule (Module *m)
 
int addModule (Module *m)
 
int delModule (Module *m)
 
MDE ModulefindModule (char *name)
 
int loadModule (Module *m, User *u)
 
int encryption_module_init (void)
 
int protocol_module_init (void)
 
int unloadModule (Module *m, User *u)
 
int prepForUnload (Module *m)
 
MDE void moduleAddVersion (const char *version)
 
MDE void moduleAddAuthor (const char *author)
 
void modules_init (void)
 
void modules_delayed_init (void)
 
void moduleCallBackPrepForUnload (char *mod_name)
 
MDE void moduleCallBackDeleteEntry (ModuleCallBack *prev)
 
MDE char * moduleGetLastBuffer (void)
 
MDE void moduleSetHelpHelp (void(*func)(User *u))
 
MDE void moduleDisplayHelp (int service, User *u)
 
MDE void moduleSetHostHelp (void(*func)(User *u))
 
MDE void moduleSetOperHelp (void(*func)(User *u))
 
MDE void moduleSetBotHelp (void(*func)(User *u))
 
MDE void moduleSetMemoHelp (void(*func)(User *u))
 
MDE void moduleSetChanHelp (void(*func)(User *u))
 
MDE void moduleSetNickHelp (void(*func)(User *u))
 
MDE int moduleAddHelp (Command *c, int(*func)(User *u))
 
MDE int moduleAddRegHelp (Command *c, int(*func)(User *u))
 
MDE int moduleAddOperHelp (Command *c, int(*func)(User *u))
 
MDE int moduleAddAdminHelp (Command *c, int(*func)(User *u))
 
MDE int moduleAddRootHelp (Command *c, int(*func)(User *u))
 
MDE void moduleSetType (MODType type)
 
MDE int moduleGetConfigDirective (Directive *h)
 
MDE CommandcreateCommand (const char *name, int(*func)(User *u), int(*has_priv)(User *u), int help_all, int help_reg, int help_oper, int help_admin, int help_root)
 
MDE int destroyCommand (Command *c)
 
MDE int addCoreCommand (CommandHash *cmdTable[], Command *c)
 
MDE int moduleAddCommand (CommandHash *cmdTable[], Command *c, int pos)
 
MDE int addCommand (CommandHash *cmdTable[], Command *c, int pos)
 
MDE int delCommand (CommandHash *cmdTable[], Command *c, char *mod_name)
 
MDE int moduleDelCommand (CommandHash *cmdTable[], char *name)
 
MDE CommandfindCommand (CommandHash *cmdTable[], const char *name)
 
MDE MessagecreateMessage (const char *name, int(*func)(char *source, int ac, char **av))
 
MessagefindMessage (MessageHash *msgTable[], const char *name)
 
MDE int addMessage (MessageHash *msgTable[], Message *m, int pos)
 
MDE int addCoreMessage (MessageHash *msgTable[], Message *m)
 
MDE int moduleAddMessage (Message *m, int pos)
 
int delMessage (MessageHash *msgTable[], Message *m, char *mod_name)
 
MDE int moduleDelMessage (char *name)
 
int destroyMessage (Message *m)
 
MDE EvtMessagecreateEventHandler (char *name, int(*func)(char *source, int ac, char **av))
 
EvtMessagefindEventHandler (EvtMessageHash *msgEvtTable[], const char *name)
 
int addCoreEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm)
 
MDE int moduleAddEventHandler (EvtMessage *evm)
 
MDE int moduleEventDelHandler (char *name)
 
int delEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm, char *mod_name)
 
int destroyEventHandler (EvtMessage *evm)
 
int addEventHandler (EvtMessageHash *msgEvtTable[], EvtMessage *evm)
 
MDE EvtHookcreateEventHook (char *name, int(*func)(int argc, char **argv))
 
EvtHookfindEventHook (EvtHookHash *HookEvtTable[], const char *name)
 
int addCoreEventHook (EvtHookHash *HookEvtTable[], EvtHook *evh)
 
MDE int moduleAddEventHook (EvtHook *evh)
 
MDE int moduleEventDelHook (const char *name)
 
int delEventHook (EvtHookHash *HookEvtTable[], EvtHook *evh, char *mod_name)
 
int destroyEventHook (EvtHook *evh)
 
MDE void moduleInsertLanguage (int langNumber, int ac, char **av)
 
MDE void moduleNoticeLang (char *source, User *u, int number,...)
 
MDE char * moduleGetLangString (User *u, int number)
 
MDE void moduleDeleteLanguage (int langNumber)
 
MDE int moduleAddCallback (char *name, time_t when, int(*func)(int argc, char *argv[]), int argc, char **argv)
 
MDE void moduleDelCallback (char *name)
 
MDE char * moduleGetData (ModuleData **md, char *key)
 
MDE int moduleAddData (ModuleData **md, char *key, char *value)
 
MDE void moduleDelData (ModuleData **md, char *key)
 
MDE void moduleDelAllData (ModuleData **md)
 
void moduleDelAllDataMod (Module *m)
 
int moduleDataDebug (ModuleData **md)
 
MDE boolean moduleMinVersion (int major, int minor, int patch, int build)
 
MDE int queueModuleLoad (char *name, User *u)
 
MDE int queueModuleUnload (char *name, User *u)
 
MDE void handleModuleOperationQueue (void)
 
MDE void updateProtectDetails (char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode)
 

Variables

MDE CommandHashHOSTSERV [MAX_CMD_HASH]
 
MDE CommandHashBOTSERV [MAX_CMD_HASH]
 
MDE CommandHashMEMOSERV [MAX_CMD_HASH]
 
MDE CommandHashNICKSERV [MAX_CMD_HASH]
 
MDE CommandHashCHANSERV [MAX_CMD_HASH]
 
MDE CommandHashHELPSERV [MAX_CMD_HASH]
 
MDE CommandHashOPERSERV [MAX_CMD_HASH]
 
MDE MessageHashIRCD [MAX_CMD_HASH]
 
MDE ModuleHashMODULE_HASH [MAX_CMD_HASH]
 
MDE EvtMessageHashEVENT [MAX_CMD_HASH]
 
MDE EvtHookHashEVENTHOOKS [MAX_CMD_HASH]
 
MDE Modulemod_current_module
 
MDE char * mod_current_module_name
 
MDE char * mod_current_buffer
 
MDE int mod_current_op
 
MDE Usermod_current_user
 
char * mod_current_evtbuffer
 

Macro Definition Documentation

#define ano_modclearerr ( )    dlerror()

Definition at line 43 of file modules.h.

Referenced by loadModule().

#define ano_modclose (   file)    dlclose(file)

Definition at line 37 of file modules.h.

Referenced by loadModule(), modules_unload_all(), and unloadModule().

#define ano_moderr ( )    dlerror()

Definition at line 35 of file modules.h.

Referenced by loadModule(), modules_unload_all(), and unloadModule().

#define ano_modopen (   file)    dlopen(file, RTLD_LAZY)

Definition at line 34 of file modules.h.

Referenced by loadModule().

#define ano_modsym (   file,
  symbol 
)    dlsym(file, DL_PREFIX symbol)

Definition at line 36 of file modules.h.

Referenced by loadModule(), modules_unload_all(), and unloadModule().

#define BOTSERV   BS_cmdTable

Definition at line 57 of file modules.h.

Referenced by AnopeInit(), botserv(), do_help(), and do_modinfo().

#define CHANSERV   CS_cmdTable

Definition at line 60 of file modules.h.

Referenced by AnopeInit(), chanserv(), do_help(), and do_modinfo().

#define CMD_HASH (   x)    (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */
#define EVENT   EVENT_cmdTable

Definition at line 65 of file modules.h.

Referenced by prepForUnload().

#define EVENTHOOKS   HOOK_cmdTable

Definition at line 66 of file modules.h.

Referenced by prepForUnload().

#define HELPSERV   HE_cmdTable

Definition at line 61 of file modules.h.

Referenced by AnopeInit(), do_help(), do_modinfo(), and helpserv().

#define HOSTSERV   HS_cmdTable /* using HOSTSERV etc. looks nicer than HS_cmdTable for modules */

Definition at line 56 of file modules.h.

Referenced by AnopeInit(), do_help(), do_modinfo(), and hostserv().

#define IRCD   IRCD_cmdTable

Definition at line 63 of file modules.h.

Referenced by do_modinfo(), find_message(), moduleAddIRCDMsgs(), and moduleAddMsgs().

#define MAX_CMD_HASH   1024
#define MDE

Definition at line 89 of file modules.h.

#define MEMOSERV   MS_cmdTable

Definition at line 58 of file modules.h.

Referenced by AnopeInit(), do_help(), do_modinfo(), memoserv(), and reload_config().

#define MOD_CONT   0

Definition at line 54 of file modules.h.

Referenced by anope_event_436(), anope_event_482(), anope_event_admin(), anope_event_away(), anope_event_bmask(), anope_event_burst(), anope_event_capab(), anope_event_chghost(), anope_event_chgident(), anope_event_chgname(), anope_event_client(), anope_event_credits(), anope_event_cs(), anope_event_encap(), anope_event_eob(), anope_event_eos(), anope_event_error(), anope_event_euid(), anope_event_fjoin(), anope_event_fmode(), anope_event_ftopic(), anope_event_globops(), anope_event_gnotice(), anope_event_hs(), anope_event_idle(), anope_event_invite(), anope_event_join(), anope_event_kick(), anope_event_kill(), anope_event_luserslock(), anope_event_metadata(), anope_event_mode(), anope_event_motd(), anope_event_ms(), anope_event_myid(), anope_event_netctrl(), anope_event_netglobal(), anope_event_netinfo(), anope_event_newmask(), anope_event_nick(), anope_event_notice(), anope_event_ns(), anope_event_null(), anope_event_opertype(), anope_event_os(), anope_event_part(), anope_event_pass(), anope_event_ping(), anope_event_privmsg(), anope_event_quit(), anope_event_rehash(), anope_event_rsquit(), anope_event_sdesc(), anope_event_server(), anope_event_sethost(), anope_event_setident(), anope_event_setname(), anope_event_sid(), anope_event_sjoin(), anope_event_smo(), anope_event_snetinfo(), anope_event_snick(), anope_event_snotice(), anope_event_sqline(), anope_event_squit(), anope_event_svinfo(), anope_event_svsinfo(), anope_event_swhois(), anope_event_tburst(), anope_event_tctrl(), anope_event_time(), anope_event_tkl(), anope_event_tmode(), anope_event_topic(), anope_event_uid(), anope_event_umode2(), anope_event_vctrl(), anope_event_version(), anope_event_vhost(), anope_event_vs(), anope_event_whois(), AnopeInit(), backup_ignoredb(), charybdis_send_account(), charybdis_send_deaccount(), check_email_limit_reached(), delBan(), do_access(), do_act(), do_admin(), do_akick(), do_akill(), do_alist(), do_assign(), do_badwords(), do_ban(), do_bot(), do_botlist(), do_cancel(), do_chankill(), do_chanlist(), do_clear(), do_clearmodes(), do_confirm(), do_cs_kick(), do_cs_topic(), do_defcon(), do_dehalfop(), do_del(), do_delall(), do_deowner(), do_deprotect(), do_drop(), do_exception(), do_fantasy(), do_forbid(), do_getemail(), do_getkey(), do_getpass(), do_ghost(), do_glist(), do_global(), do_group(), do_halfop(), do_help(), do_help_cmd(), do_hop(), do_hs_sync(), do_identify(), do_ignorelist(), do_ignoreuser(), do_info(), do_invite(), do_jupe(), do_kickcmd(), do_levels(), do_link(), do_list(), do_listlinks(), do_logonnews(), do_logout(), do_memocheck(), do_modinfo(), do_modlist(), do_modload(), do_modunload(), do_moo(), do_nickupdate(), do_noop(), do_off(), do_on(), do_on_id(), do_oper(), do_opernews(), do_operoline(), do_operumodes(), do_os_kick(), do_os_mode(), do_os_quit(), do_owner(), do_protect(), do_randomnews(), do_raw(), do_read(), do_recover(), do_register(), do_release(), do_reload(), do_resend(), do_restart(), do_rsend(), do_run_cmd(), do_saset(), do_saset_autoop(), do_saset_display(), do_saset_email(), do_saset_greet(), do_saset_hide(), do_saset_icq(), do_saset_kill(), do_saset_language(), do_saset_msg(), do_saset_noexpire(), do_saset_password(), do_saset_private(), do_saset_secure(), do_saset_url(), do_say(), do_send(), do_sendall(), do_sendpass(), do_session(), do_set(), do_set_autoop(), do_set_bantype(), do_set_desc(), do_set_display(), do_set_email(), do_set_entrymsg(), do_set_founder(), do_set_greet(), do_set_hide(), do_set_icq(), do_set_keeptopic(), do_set_kill(), do_set_language(), do_set_limit(), do_set_mlock(), do_set_msg(), do_set_noexpire(), do_set_notify(), do_set_opnotice(), do_set_password(), do_set_peace(), do_set_private(), do_set_restricted(), do_set_secure(), do_set_securefounder(), do_set_secureops(), do_set_signkick(), do_set_successor(), do_set_topiclock(), do_set_url(), do_set_xop(), do_setall(), do_setmodes(), do_sgline(), do_shutdown(), do_sqline(), do_staff(), do_stats(), do_status(), do_suspend(), do_svsnick(), do_szline(), do_tban(), do_unassign(), do_unban(), do_unlink(), do_unsuspend(), do_update(), do_userlist(), do_util(), do_xop(), event_message_process(), event_process_hook(), hs_do_activate(), hs_do_list_out(), hs_do_reject(), hs_do_request(), hs_do_waiting(), hs_help_activate(), hs_help_reject(), hs_help_request(), hs_help_waiting(), hsreqevt_db_backup(), hsreqevt_db_saving(), hsreqevt_nick_dropped(), hybrid_event_notice(), listOut(), m_away(), m_kill(), m_motd(), m_nickcoll(), m_privmsg(), m_stats(), m_time(), m_version(), m_whois(), mBackupData(), mChanHelp(), mEventReload(), mLoadConfig(), mNickHelp(), moduleAddAdminHelp(), moduleAddHelp(), moduleAddOperHelp(), moduleAddRegHelp(), moduleAddRootHelp(), mReadConfig(), mShowSetting(), my_cs_appendtopic(), my_cs_enforce(), my_event_addcommand(), my_event_delcommand(), my_event_reload(), my_nick(), my_ns_register(), my_ns_set(), my_privmsg(), my_save(), myAddChanInfo(), myAddNickInfo(), myChanInfo(), myDoSet(), myFullHelp(), myHelpResonse(), myHostServMooAdminHelp(), myHostServMooHelp(), myHostServMooOperHelp(), myHostServMooRegHelp(), myHostServMooRootHelp(), myNickInfo(), process(), ratbox_login(), ratbox_logout(), reload_config(), save_ignoredb(), and test().

#define MOD_ERR_EXISTS   3

Definition at line 74 of file modules.h.

Referenced by addCommand(), addMessage(), addModule(), and loadModule().

#define MOD_ERR_FILE_IO   11

Definition at line 82 of file modules.h.

Referenced by moduleCopyFile().

#define MOD_ERR_MEMORY   1

Definition at line 72 of file modules.h.

Referenced by moduleAddCallback(), and moduleAddData().

#define MOD_ERR_NO_MOD_NAME   13

Definition at line 84 of file modules.h.

Referenced by addCommand().

#define MOD_ERR_NODELETE   9

Definition at line 80 of file modules.h.

#define MOD_ERR_NOEXIST   4
#define MOD_ERR_NOLOAD   6

Definition at line 77 of file modules.h.

Referenced by loadModule().

#define MOD_ERR_NOSERVICE   12

Definition at line 83 of file modules.h.

Referenced by moduleAddCommand().

#define MOD_ERR_NOUNLOAD   7

Definition at line 78 of file modules.h.

Referenced by unloadModule().

#define MOD_ERR_NOUSER   5

Definition at line 76 of file modules.h.

#define MOD_ERR_OK   0
#define MOD_ERR_PARAMS   2
#define MOD_ERR_SYNTAX   8

Definition at line 79 of file modules.h.

#define MOD_ERR_UNKNOWN   10
#define MOD_STOP   1
#define MODULE_EXT   ".so"

Definition at line 44 of file modules.h.

Referenced by loadModule(), and moduleCopyFile().

#define MODULE_HASH   Module_table

Definition at line 64 of file modules.h.

Referenced by do_modlist().

#define NICKSERV   NS_cmdTable
#define OPERSERV   OS_cmdTable

Definition at line 62 of file modules.h.

Referenced by AnopeInit(), do_help(), do_modinfo(), moduleAddOperServCmds(), operserv(), and reload_config().

Typedef Documentation

typedef void* ano_module_t

Definition at line 32 of file modules.h.

typedef struct Command_ Command

Definition at line 105 of file modules.h.

typedef struct CommandHash_ CommandHash

Definition at line 106 of file modules.h.

typedef struct EvtHook_ EvtHook

Definition at line 116 of file modules.h.

typedef struct EvtHookHash_ EvtHookHash

Definition at line 117 of file modules.h.

typedef struct EvtMessage_ EvtMessage

Definition at line 114 of file modules.h.

Definition at line 115 of file modules.h.

typedef struct Message_ Message

Definition at line 111 of file modules.h.

typedef struct MessageHash_ MessageHash

Definition at line 112 of file modules.h.

typedef struct Module_ Module

Definition at line 107 of file modules.h.

Definition at line 113 of file modules.h.

typedef struct ModuleHash_ ModuleHash

Definition at line 109 of file modules.h.

typedef struct ModuleLang_ ModuleLang

Definition at line 108 of file modules.h.

typedef struct ModuleQueue_ ModuleQueue

Definition at line 110 of file modules.h.

Enumeration Type Documentation

enum MODType
Enumerator
CORE 
PROTOCOL 
THIRD 
SUPPORTED 
QATESTED 
ENCRYPTION 

Definition at line 99 of file modules.h.

Enumerator
MOD_OP_LOAD 
MOD_OP_UNLOAD 

Definition at line 100 of file modules.h.

Function Documentation

MDE int addCommand ( CommandHash cmdTable[],
Command c,
int  pos 
)

Add a command to a command table. only add if were unique, pos = 0; if we want it at the "head" of that command, pos = 1 at the tail, pos = 2

Parameters
cmdTablethe table to add the command to
cthe command to add
posthe position in the cmd call stack to add the command
Returns
MOD_ERR_OK will be returned on success.

Definition at line 1293 of file modules.c.

References alog(), c, CommandHash_::c, CMD_HASH, current, debug, EVENT_ADDCOMMAND, fatal(), mod_current_module_name, MOD_ERR_EXISTS, MOD_ERR_NO_MOD_NAME, MOD_ERR_OK, MOD_ERR_PARAMS, Command_::mod_name, Command_::name, CommandHash_::name, Command_::next, CommandHash_::next, send_event(), Command_::service, sstrdup(), and stricmp().

Referenced by addCoreCommand(), and moduleAddCommand().

MDE int addCoreCommand ( CommandHash cmdTable[],
Command c 
)

Add a CORE command ot the given command hash

Parameters
cmdTablethe command table to add the command to
cthe command to add
Returns
MOD_ERR_OK on success

Definition at line 1063 of file modules.c.

References addCommand(), Command_::core, MOD_ERR_PARAMS, and Command_::next.

Referenced by moduleAddOperServCmds().

int addCoreEventHandler ( EvtMessageHash msgEvtTable[],
EvtMessage evm 
)

Add the given message (m) to the MessageHash marking it as a core command

Parameters
msgTablethe MessageHash we want to add to
mthe Message we are adding
Returns
MOD_ERR_OK on a successful add.

Definition at line 376 of file events.c.

References addEventHandler(), EvtMessage_::core, and MOD_ERR_PARAMS.

int addCoreEventHook ( EvtHookHash hookEvtTable[],
EvtHook evh 
)

Add the given message (m) to the MessageHash marking it as a core command

Parameters
msgTablethe MessageHash we want to add to
mthe Message we are adding
Returns
MOD_ERR_OK on a successful add.

Definition at line 483 of file events.c.

References addEventHook(), EvtHook_::core, and MOD_ERR_PARAMS.

MDE int addCoreMessage ( MessageHash msgTable[],
Message m 
)

Add the given message (m) to the MessageHash marking it as a core command

Parameters
msgTablethe MessageHash we want to add to
mthe Message we are adding
Returns
MOD_ERR_OK on a successful add.

Definition at line 1597 of file modules.c.

References addMessage(), Message_::core, and MOD_ERR_PARAMS.

Referenced by moduleAddIRCDMsgs(), and moduleAddMsgs().

int addEventHandler ( EvtMessageHash msgEvtTable[],
EvtMessage evm 
)

Add a message to the MessageHash.

Parameters
msgTablethe MessageHash we want to add a message to
mthe Message we want to add
Returns
MOD_ERR_OK on a successful add.

Definition at line 391 of file events.c.

References alog(), CMD_HASH, current, debug, EvtMessageHash_::evm, fatal(), MOD_ERR_OK, MOD_ERR_PARAMS, EvtMessage_::name, EvtMessageHash_::name, EvtMessage_::next, EvtMessageHash_::next, sstrdup(), and stricmp().

Referenced by addCoreEventHandler(), and moduleAddEventHandler().

MDE int addMessage ( MessageHash msgTable[],
Message m,
int  pos 
)

Add a message to the MessageHash.

Parameters
msgTablethe MessageHash we want to add a message to
mthe Message we want to add
posthe position we want to add the message to, E.G. MOD_HEAD, MOD_TAIL, MOD_UNIQUE
Returns
MOD_ERR_OK on a successful add.

Definition at line 1531 of file modules.c.

References alog(), CMD_HASH, current, debug, fatal(), ircd, MessageHash_::m, MOD_ERR_EXISTS, MOD_ERR_OK, MOD_ERR_PARAMS, Message_::name, MessageHash_::name, Message_::next, MessageHash_::next, sstrdup(), stricmp(), ircdvars_::tokencaseless, and UseTokens.

Referenced by addCoreMessage(), and moduleAddMessage().

int addModule ( Module m)

Add the module to the list of currently loaded modules.

Parameters
mthe currently loaded module
Returns
MOD_ERR_OK on success, anything else on fail

Definition at line 404 of file modules.c.

References CMD_HASH, current, fatal(), ModuleHash_::m, MOD_ERR_EXISTS, MOD_ERR_OK, Module_::name, ModuleHash_::name, ModuleHash_::next, sstrdup(), stricmp(), and Module_::time.

Referenced by loadModule().

MDE Command* createCommand ( const char *  name,
int(*)(User *u)  func,
int(*)(User *u)  has_priv,
int  help_all,
int  help_reg,
int  help_oper,
int  help_admin,
int  help_root 
)

Create a Command struct ready for use in anope.

Parameters
namethe name of the command
funcpointer to the function to execute when command is given
has_privpointer to function to check user priv's
help_allhelp file index for all users
help_reghelp file index for all regustered users
help_operhelp file index for all opers
help_adminhelp file index for all admins
help_roothelp file indenx for all services roots
Returns
a "ready to use" Command struct will be returned

Definition at line 987 of file modules.c.

References Command_::admin_help, Command_::all_help, c, fatal(), Command_::has_priv, Command_::help_param1, Command_::help_param2, Command_::help_param3, Command_::help_param4, Command_::helpmsg_admin, Command_::helpmsg_all, Command_::helpmsg_oper, Command_::helpmsg_reg, Command_::helpmsg_root, Command_::mod_name, Command_::name, Command_::next, Command_::oper_help, Command_::regular_help, Command_::root_help, Command_::routine, Command_::service, and sstrdup().

Referenced by addMessageList(), AnopeInit(), moduleAddOperServCmds(), and my_event_addcommand().

MDE EvtMessage* createEventHandler ( char *  name,
int(*)(char *source, int ac, char **av)  func 
)

Create a new Message struct.

Parameters
namethe name of the message
funca pointer to the function to call when we recive this message
Returns
a new Message object

Definition at line 281 of file events.c.

References fatal(), EvtMessage_::func, EvtMessage_::mod_name, EvtMessage_::name, EvtMessage_::next, and sstrdup().

Referenced by AnopeInit().

MDE EvtHook* createEventHook ( char *  name,
int(*)(int argc, char **argv)  func 
)

Create a new Message struct.

Parameters
namethe name of the message
funca pointer to the function to call when we recive this message
Returns
a new Message object

Definition at line 305 of file events.c.

References fatal(), EvtHook_::func, EvtHook_::mod_name, EvtHook_::name, EvtHook_::next, and sstrdup().

Referenced by AnopeInit().

MDE Message* createMessage ( const char *  name,
int(*)(char *source, int ac, char **av)  func 
)

Create a new Message struct.

Parameters
namethe name of the message
funca pointer to the function to call when we recive this message
Returns
a new Message object

Definition at line 1470 of file modules.c.

References fatal(), Message_::func, Message_::mod_name, Message_::name, Message_::next, and sstrdup().

Referenced by AnopeInit(), moduleAddIRCDMsgs(), and moduleAddMsgs().

MDE Module* createModule ( char *  filename)
MDE int delCommand ( CommandHash cmdTable[],
Command c,
char *  mod_name 
)

Remove a command from the command hash.

Parameters
cmdTablethe command table to remove the command from
cthe command to remove
mod_namethe name of the module who owns the command
Returns
MOD_ERR_OK will be returned on success

Definition at line 1367 of file modules.c.

References CommandHash_::c, CMD_HASH, current, EVENT_DELCOMMAND, MOD_ERR_NOEXIST, MOD_ERR_OK, MOD_ERR_PARAMS, Command_::mod_name, Command_::name, CommandHash_::name, Command_::next, CommandHash_::next, send_event(), and stricmp().

Referenced by moduleDelCommand(), and prepForUnload().

int delEventHandler ( EvtMessageHash msgEvtTable[],
EvtMessage evm,
char *  mod_name 
)

remove the given message from the given message hash, for the given module

Parameters
msgTablewhich MessageHash we are removing from
mthe Message we want to remove the name of the module we are removing
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 611 of file events.c.

References CMD_HASH, current, EvtMessageHash_::evm, MOD_ERR_NOEXIST, MOD_ERR_OK, MOD_ERR_PARAMS, EvtMessage_::mod_name, EvtMessage_::name, EvtMessageHash_::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

Parameters
msgTablewhich MessageHash we are removing from
mthe Message we want to remove the name of the module we are removing
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 686 of file events.c.

References CMD_HASH, current, EvtHookHash_::evh, MOD_ERR_NOEXIST, MOD_ERR_OK, MOD_ERR_PARAMS, EvtHook_::mod_name, EvtHook_::name, EvtHookHash_::name, EvtHook_::next, EvtHookHash_::next, and stricmp().

Referenced by moduleEventDelHook(), and prepForUnload().

int delMessage ( MessageHash msgTable[],
Message m,
char *  mod_name 
)

remove the given message from the given message hash, for the given module

Parameters
msgTablewhich MessageHash we are removing from
mthe Message we want to remove the name of the module we are removing
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 1668 of file modules.c.

References CMD_HASH, current, MessageHash_::m, MOD_ERR_NOEXIST, MOD_ERR_OK, MOD_ERR_PARAMS, Message_::mod_name, Message_::name, MessageHash_::name, Message_::next, MessageHash_::next, and stricmp().

Referenced by moduleDelMessage(), and prepForUnload().

int delModule ( Module m)

Remove the module from the list of loaded modules.

Parameters
mmodule to remove
Returns
MOD_ERR_OK on success anything else on fail

Definition at line 439 of file modules.c.

References CMD_HASH, current, destroyModule(), ModuleHash_::m, MOD_ERR_NOEXIST, MOD_ERR_OK, MOD_ERR_PARAMS, Module_::name, ModuleHash_::name, ModuleHash_::next, and stricmp().

Referenced by modules_unload_all(), and unloadModule().

MDE int destroyCommand ( Command c)

Destroy a command struct freeing any memory.

Parameters
cCommand to destroy
Returns
MOD_ERR_OK on success, anything else on fail

Definition at line 1028 of file modules.c.

References Command_::core, Command_::has_priv, Command_::helpmsg_admin, Command_::helpmsg_all, Command_::helpmsg_oper, Command_::helpmsg_reg, Command_::helpmsg_root, MOD_ERR_OK, MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, Command_::mod_name, Command_::name, Command_::next, Command_::routine, and Command_::service.

Referenced by moduleDelCommand(), and prepForUnload().

int destroyEventHandler ( EvtMessage evm)

Destory a message, freeing its memory.

Parameters
mthe message to be destroyed
Returns
MOD_ERR_SUCCESS on success

Definition at line 759 of file events.c.

References EvtMessage_::func, MOD_ERR_OK, MOD_ERR_PARAMS, EvtMessage_::mod_name, EvtMessage_::name, and EvtMessage_::next.

Referenced by moduleEventDelHandler(), and prepForUnload().

int destroyEventHook ( EvtHook evh)

Destory a message, freeing its memory.

Parameters
mthe message to be destroyed
Returns
MOD_ERR_SUCCESS on success

Definition at line 781 of file events.c.

References EvtHook_::func, MOD_ERR_OK, MOD_ERR_PARAMS, EvtHook_::mod_name, EvtHook_::name, and EvtHook_::next.

Referenced by moduleEventDelHook(), and prepForUnload().

int destroyMessage ( Message m)

Destory a message, freeing its memory.

Parameters
mthe message to be destroyed
Returns
MOD_ERR_SUCCESS on success

Definition at line 1739 of file modules.c.

References Message_::func, MOD_ERR_OK, MOD_ERR_PARAMS, Message_::mod_name, Message_::name, and Message_::next.

Referenced by moduleDelMessage(), and prepForUnload().

int destroyModule ( Module m)

Destory the module. free up all memory used by our module struct.

Parameters
mthe module to free
Returns
MOD_ERR_OK on success, anything else on fail

Definition at line 362 of file modules.c.

References Module_::author, Module_::filename, Module_::handle, mod_current_module_name, MOD_ERR_OK, MOD_ERR_PARAMS, moduleDeleteLanguage(), Module_::name, NUM_LANGS, and Module_::version.

Referenced by delModule(), encryption_module_init(), handleModuleOperationQueue(), modules_core_init(), modules_delayed_init(), modules_init(), and protocol_module_init().

int encryption_module_init ( void  )
MDE Command* findCommand ( CommandHash cmdTable[],
const char *  name 
)

Search the command table gieven for a command.

Parameters
cmdTablethe name of the command table to search
namethe name of the command to look for
Returns
returns a pointer to the found command struct, or NULL

Definition at line 1442 of file modules.c.

References CommandHash_::c, CMD_HASH, current, CommandHash_::name, CommandHash_::next, and stricmp().

Referenced by AnopeInit(), mod_help_cmd(), mod_run_cmd(), moduleDelCommand(), and reload_config().

EvtMessage* findEventHandler ( EvtMessageHash msgEvtTable[],
const char *  name 
)

find a message in the given table. Looks up the message <name> in the MessageHash given

Parameters
MessageHashthe message table to search for this command, will almost always be IRCD
namethe name of the command were looking for
Returns
NULL if we cant find it, or a pointer to the Message if we can

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

Parameters
MessageHashthe message table to search for this command, will almost always be IRCD
namethe name of the command were looking for
Returns
NULL if we cant find it, or a pointer to the Message if we can

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().

Message* findMessage ( MessageHash msgTable[],
const char *  name 
)

find a message in the given table. Looks up the message <name> in the MessageHash given

Parameters
MessageHashthe message table to search for this command, will almost always be IRCD
namethe name of the command were looking for
Returns
NULL if we cant find it, or a pointer to the Message if we can

Definition at line 1494 of file modules.c.

References CMD_HASH, current, ircd, MessageHash_::m, MessageHash_::name, MessageHash_::next, stricmp(), ircdvars_::tokencaseless, and UseTokens.

Referenced by find_message(), and moduleDelMessage().

MDE Module* findModule ( char *  name)
MDE void handleModuleOperationQueue ( void  )
int loadModule ( Module m,
User u 
)
MDE int moduleAddAdminHelp ( Command c,
int(*)(User *u)  func 
)

Add help for Admins.

Parameters
cthe Command to add help for
functhe function to run when this help is asked for

Definition at line 2022 of file modules.c.

References Command_::admin_help, MOD_CONT, and MOD_STOP.

Referenced by AnopeInit().

MDE void moduleAddAuthor ( const char *  author)

Add the modules author info

Parameters
authorthe author of the module

Definition at line 1772 of file modules.c.

References Anope_Free, Module_::author, and sstrdup().

Referenced by AnopeInit().

MDE int moduleAddCallback ( char *  name,
time_t  when,
int(*)(int argc, char *argv[])  func,
int  argc,
char **  argv 
)

Adds a timed callback for the current module. This allows modules to request that anope executes one of there functions at a time in the future, without an event to trigger it

Parameters
namethe name of the callback, this is used for refrence mostly, but is needed it you want to delete this particular callback later on
whenwhen should the function be executed, this is a time in the future, seconds since 00:00:00 1970-01-01 UTC
functhe function to be executed when the callback is ran, its format MUST be int func(int argc, char **argv);
argcthe argument count for the argv paramter
atgva argument list to be passed to the called function.
Returns
MOD_ERR_OK on success, anything else on fail.
See also
moduleDelCallBack

Definition at line 1794 of file modules.c.

References alog(), debug, mod_current_module_name, MOD_ERR_MEMORY, MOD_ERR_OK, moduleCallBackHead, ModuleCallBack_::next, sstrdup(), and ModuleCallBack_::when.

Referenced by addBan(), and AnopeInit().

MDE int moduleAddCommand ( CommandHash cmdTable[],
Command c,
int  pos 
)

Add a module provided command to the given service. e.g. moduleAddCommand(NICKSERV,c,MOD_HEAD);

Parameters
cmdTablethe services to add the command to
cthe command to add
posthe position to add to, MOD_HEAD, MOD_TAIL, MOD_UNIQUE
See also
createCommand
Returns
MOD_ERR_OK on successfully adding the command

Definition at line 1082 of file modules.c.

References addCommand(), alog(), Command_::core, debug, displayCommandFromHash(), MOD_ERR_NOSERVICE, MOD_ERR_OK, MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, Command_::mod_name, Module_::name, Command_::name, s_BotServ, s_ChanServ, s_HelpServ, s_HostServ, s_MemoServ, s_NickServ, s_OperServ, Command_::service, and sstrdup().

Referenced by addMessageList(), AnopeInit(), and my_event_addcommand().

MDE int moduleAddData ( ModuleData **  md,
char *  key,
char *  value 
)

Add module data to a struct. This allows module coders to add data to an existing struct

Parameters
mdThe module data for the struct to be used
keyThe Key for the key/value pair
valueThe value for the key/value pair, this is what will be stored for you
Returns
MOD_ERR_OK will be returned on success

Definition at line 2225 of file modules.c.

References alog(), debug, do_backtrace(), ModuleData_::key, mod_current_module_name, MOD_ERR_MEMORY, MOD_ERR_OK, MOD_ERR_PARAMS, moduleDataDebug(), moduleDelData(), ModuleData_::moduleName, ModuleData_::next, sstrdup(), and ModuleData_::value.

Referenced by mLoadData(), myAddChanInfo(), and myAddNickInfo().

MDE int moduleAddEventHandler ( EvtMessage evm)

Add a module message to the IRCD message hash

Parameters
mthe Message to add
posthe Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 498 of file events.c.

References addEventHandler(), EvtMessage_::core, debug, displayEvtMessageFromHash(), mod_current_module, MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, EvtMessage_::mod_name, Module_::name, EvtMessage_::name, and sstrdup().

Referenced by AnopeInit().

MDE int moduleAddEventHook ( EvtHook evh)

Add a module message to the IRCD message hash

Parameters
mthe Message to add
posthe Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 528 of file events.c.

References addEventHook(), EvtHook_::core, debug, displayHookFromHash(), mod_current_module, MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, EvtHook_::mod_name, Module_::name, EvtHook_::name, and sstrdup().

Referenced by AnopeInit().

MDE int moduleAddHelp ( Command c,
int(*)(User *u)  func 
)

Add help for all users

Parameters
cthe Command to add help for
functhe function to run when this help is asked for

Definition at line 2064 of file modules.c.

References Command_::all_help, MOD_CONT, and MOD_STOP.

Referenced by AnopeInit().

MDE int moduleAddMessage ( Message m,
int  pos 
)

Add a module message to the IRCD message hash

Parameters
mthe Message to add
posthe Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 1612 of file modules.c.

References addMessage(), Message_::core, debug, displayMessageFromHash(), MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, Message_::mod_name, Module_::name, Message_::name, and sstrdup().

Referenced by AnopeInit().

MDE int moduleAddOperHelp ( Command c,
int(*)(User *u)  func 
)

Add help for opers..

Parameters
cthe Command to add help for
functhe function to run when this help is asked for

Definition at line 2036 of file modules.c.

References MOD_CONT, MOD_STOP, and Command_::oper_help.

Referenced by AnopeInit().

MDE int moduleAddRegHelp ( Command c,
int(*)(User *u)  func 
)

Add help for registered users

Parameters
cthe Command to add help for
functhe function to run when this help is asked for

Definition at line 2050 of file modules.c.

References MOD_CONT, MOD_STOP, and Command_::regular_help.

Referenced by AnopeInit().

MDE int moduleAddRootHelp ( Command c,
int(*)(User *u)  func 
)

Add help for Root admins.

Parameters
cthe Command to add help for
functhe function to run when this help is asked for

Definition at line 2008 of file modules.c.

References MOD_CONT, MOD_STOP, and Command_::root_help.

Referenced by AnopeInit().

MDE void moduleAddVersion ( const char *  version)

Add the modules version info.

Parameters
versionthe version of the current module

Definition at line 1760 of file modules.c.

References Anope_Free, sstrdup(), and Module_::version.

Referenced by AnopeInit().

MDE void moduleCallBackDeleteEntry ( ModuleCallBack prev)

Removes a entry from the modules callback list

Parameters
preva pointer to the previous entry in the list, NULL for the head

Definition at line 1870 of file modules.c.

References ModuleCallBack_::argc, ModuleCallBack_::argv, ModuleCallBack_::func, moduleCallBackHead, ModuleCallBack_::name, ModuleCallBack_::next, and ModuleCallBack_::owner_name.

Referenced by moduleCallBackPrepForUnload(), moduleCallBackRun(), and moduleDelCallback().

void moduleCallBackPrepForUnload ( char *  mod_name)

Remove all outstanding module callbacks for the given module. When a module is unloaded, any callbacks it had outstanding must be removed, else when they attempt to execute the func pointer will no longer be valid, and we'll seg.

Parameters
mod_namethe name of the module we are preping for unload

Definition at line 1968 of file modules.c.

References alog(), debug, moduleCallBackDeleteEntry(), and moduleCallBackFindEntry().

Referenced by prepForUnload().

int moduleDataDebug ( ModuleData **  md)

Output module data information into the log file. This is a vwey "debug only" function to dump the whole contents of a moduleData struct into the log files.

Parameters
mdThe module data for the struct to be used
Returns
0 is always returned;

Definition at line 2205 of file modules.c.

References alog(), current, ModuleData_::key, ModuleData_::moduleName, ModuleData_::next, and ModuleData_::value.

Referenced by moduleAddData().

MDE void moduleDelAllData ( ModuleData **  md)

This will remove all data for a particular module from existing structs. Its primary use is modulePrepForUnload() however, based on past expericance with module coders wanting to do just about anything and everything, its safe to use from inside the module.

Parameters
mdThe module data for the struct to be used

Definition at line 2345 of file modules.c.

References alog(), current, debug, do_backtrace(), ModuleData_::key, mod_current_module_name, ModuleData_::moduleName, ModuleData_::next, sstrdup(), stricmp(), and ModuleData_::value.

Referenced by moduleDelAllDataMod().

void moduleDelAllDataMod ( Module m)
MDE void moduleDelCallback ( char *  name)

Allow module coders to delete a callback by name.

Parameters
namethe name of the callback they wish to delete

Definition at line 1927 of file modules.c.

References alog(), current, debug, mod_current_module_name, moduleCallBackDeleteEntry(), moduleCallBackHead, ModuleCallBack_::name, ModuleCallBack_::next, and ModuleCallBack_::owner_name.

Referenced by AnopeInit().

MDE int moduleDelCommand ( CommandHash cmdTable[],
char *  name 
)

Delete a command from the service given.

Parameters
cmdTablethe cmdTable for the services to remove the command from
namethe name of the command to delete from the service
Returns
returns MOD_ERR_OK on success

Definition at line 1161 of file modules.c.

References c, debug, delCommand(), destroyCommand(), displayCommandFromHash(), findCommand(), MOD_ERR_NOEXIST, MOD_ERR_UNKNOWN, Command_::mod_name, Module_::name, Command_::next, and stricmp().

Referenced by my_event_delcommand().

MDE void moduleDelData ( ModuleData **  md,
char *  key 
)

Delete the key/value pair indicated by "key" for the current module. This allows module coders to remove a previously stored key/value pair.

Parameters
mdThe module data for the struct to be used
keyThe key to delete the key/value pair for

Definition at line 2301 of file modules.c.

References alog(), current, debug, do_backtrace(), ModuleData_::key, mod_current_module_name, ModuleData_::moduleName, ModuleData_::next, sstrdup(), stricmp(), and ModuleData_::value.

Referenced by moduleAddData(), myAddChanInfo(), and myAddNickInfo().

MDE void moduleDeleteLanguage ( int  langNumber)

Delete a language from a module

Parameters
langNumberthe language Number to delete

Definition at line 2763 of file modules.c.

References Anope_Free, ModuleLang_::argc, ModuleLang_::argv, findModule(), Module_::lang, mod_current_module_name, and Module_::name.

Referenced by destroyModule(), and moduleInsertLanguage().

MDE int moduleDelMessage ( char *  name)

remove the given message from the IRCD message hash

Parameters
namethe name of the message to remove
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 1640 of file modules.c.

References debug, delMessage(), destroyMessage(), displayMessageFromHash(), findMessage(), MOD_ERR_NOEXIST, MOD_ERR_UNKNOWN, Module_::name, and Message_::name.

MDE void moduleDisplayHelp ( int  service,
User u 
)

Display any extra module help for the given service.

Parameters
serviceswhich services is help being dispalyed for?
uwhich user is requesting the help

Definition at line 2162 of file modules.c.

References Module_::botHelp, Module_::chanHelp, current, Module_::helpHelp, Module_::hostHelp, ModuleHash_::m, MAX_CMD_HASH, Module_::memoHelp, mod_current_module, mod_current_module_name, ModuleHash_::name, ModuleHash_::next, Module_::nickHelp, and Module_::operHelp.

Referenced by do_help().

MDE int moduleEventDelHandler ( char *  name)

remove the given message from the IRCD message hash

Parameters
namethe name of the message to remove
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 557 of file events.c.

References debug, delEventHandler(), destroyEventHandler(), displayEvtMessageFromHash(), findEventHandler(), mod_current_module, MOD_ERR_NOEXIST, MOD_ERR_UNKNOWN, Module_::name, and EvtMessage_::name.

MDE int moduleEventDelHook ( const char *  name)

remove the given message from the IRCD message hash

Parameters
namethe name of the message to remove
Returns
MOD_ERR_OK on success, althing else on fail.

Definition at line 583 of file events.c.

References debug, delEventHook(), destroyEventHook(), displayHookFromHash(), findEventHook(), mod_current_module, MOD_ERR_NOEXIST, MOD_ERR_UNKNOWN, Module_::name, and EvtHook_::name.

MDE int moduleGetConfigDirective ( Directive d)

Deal with modules who want to lookup config directives!

Parameters
hThe Directive to lookup in the config file
Returns
1 on success, 0 on error

Definition at line 2553 of file modules.c.

References alog(), Anope_Free, linenum, MAXPARAMS, myStrGetOnlyToken(), myStrGetTokenRemainder(), Directive::name, normalizeBuffer(), PARAM_NONE, PARAM_STRING, Directive::params, parse_directive(), Directive::ptr, SERVICES_CONF, stricmp(), and Directive::type.

Referenced by load_config(), mLoadConfig(), mReadConfig(), and my_load_config().

MDE char* moduleGetData ( ModuleData **  md,
char *  key 
)

Returns the value from a key/value pair set. This allows module coders to retrive any data they have previuosly stored in any given struct

Parameters
mdThe module data for the struct to be used
keyThe key to find the data for
Returns
the value paired to the given key will be returned, or NULL

Definition at line 2266 of file modules.c.

References alog(), current, debug, do_backtrace(), ModuleData_::key, mod_current_module_name, ModuleData_::moduleName, ModuleData_::next, sstrdup(), stricmp(), and ModuleData_::value.

Referenced by mSaveData(), myChanInfo(), and myNickInfo().

MDE char* moduleGetLangString ( User u,
int  number 
)

Get the text of the given lanugage string in the corrent language, or in english.

Parameters
uThe user to send the message to
numberThe message number

Definition at line 2731 of file modules.c.

References alog(), ModuleLang_::argc, ModuleLang_::argv, findModule(), Module_::lang, LANG_EN_US, nickcore_::language, mod_current_module_name, user_::na, Module_::name, nickalias_::nc, and NSDefLanguage.

MDE char* moduleGetLastBuffer ( void  )

Return a copy of the complete last buffer. This is needed for modules who cant trust the strtok() buffer, as we dont know who will have already messed about with it. a pointer to a copy of the last buffer - DONT mess with this, copy if first if you must do things to it.

Definition at line 1988 of file modules.c.

References mod_current_buffer.

Referenced by do_tban(), hs_do_activate(), hs_do_list_out(), hs_do_reject(), hs_do_request(), my_cs_appendtopic(), my_cs_enforce(), my_ns_register(), my_ns_set(), myAddChanInfo(), myAddNickInfo(), myChanInfo(), and myNickInfo().

MDE void moduleInsertLanguage ( int  langNumber,
int  ac,
char **  av 
)

Allow a module to add a set of language strings to anope

Parameters
langNumberthe language number for the strings
acThe language count for the strings
avThe language sring list.

Definition at line 2650 of file modules.c.

References alog(), ModuleLang_::argc, ModuleLang_::argv, debug, findModule(), Module_::lang, mod_current_module_name, moduleDeleteLanguage(), Module_::name, and sstrdup().

Referenced by m_AddLanguages(), mAddLanguages(), and my_add_languages().

MDE boolean moduleMinVersion ( int  major,
int  minor,
int  patch,
int  build 
)

Check the current version of anope against a given version number Specifiying -1 for minor,patch or build

Parameters
majorThe major version of anope, the first part of the verison number
minorThe minor version of anope, the second part of the version number
patchThe patch version of anope, the third part of the version number
buildThe build revision of anope from SVN
Returns
True if the version newer than the version specified.

Definition at line 2465 of file modules.c.

MDE void moduleNoticeLang ( char *  source,
User u,
int  number,
  ... 
)
void modules_delayed_init ( void  )

Automaticaly load modules at startup, delayed. This function waits until the IRCD link has been made, and then attempts to load the specified modules.

Definition at line 235 of file modules.c.

References alog(), createModule(), destroyModule(), findModule(), loadModule(), mod_current_module_name, MOD_ERR_OK, ModuleGetErrStr(), ModulesDelayedAutoload, ModulesDelayedNumber, Module_::name, and nothird.

Referenced by init_tertiary().

void modules_init ( void  )

Automaticaly load modules at startup. This will load modules at startup before the IRCD link is attempted, this allows admins to have a module relating to ircd support load

Definition at line 91 of file modules.c.

References alog(), createModule(), destroyModule(), findModule(), loadModule(), mod_current_module_name, MOD_ERR_OK, ModuleGetErrStr(), ModulesAutoload, ModulesNumber, Module_::name, and nothird.

Referenced by init_secondary().

MDE void moduleSetBotHelp ( void(*)(User *u)  func)

Add output to botserv help. when doing a /msg botserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2114 of file modules.c.

References Module_::botHelp.

Referenced by AnopeInit().

MDE void moduleSetChanHelp ( void(*)(User *u)  func)

Add output to chanserv help. when doing a /msg chanserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2090 of file modules.c.

References Module_::chanHelp.

Referenced by AnopeInit().

MDE void moduleSetHelpHelp ( void(*)(User *u)  func)

Add output to helpserv help. when doing a /msg helpserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2150 of file modules.c.

References Module_::helpHelp.

MDE void moduleSetHostHelp ( void(*)(User *u)  func)

Add output to hostserv help. when doing a /msg hostserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2138 of file modules.c.

References Module_::hostHelp.

Referenced by AnopeInit().

MDE void moduleSetMemoHelp ( void(*)(User *u)  func)

Add output to memoserv help. when doing a /msg memoserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2102 of file modules.c.

References Module_::memoHelp.

Referenced by AnopeInit().

MDE void moduleSetNickHelp ( void(*)(User *u)  func)

Add output to nickserv help. when doing a /msg nickserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2078 of file modules.c.

References Module_::nickHelp.

Referenced by AnopeInit().

MDE void moduleSetOperHelp ( void(*)(User *u)  func)

Add output to operserv help. when doing a /msg operserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly

Parameters
funca pointer to the function which will display the code

Definition at line 2126 of file modules.c.

References Module_::operHelp.

Referenced by AnopeInit().

MDE void moduleSetType ( MODType  type)

Module setType() Lets the module set a type, CORE,PROTOCOL,3RD etc..

Definition at line 818 of file modules.c.

References Module_::type.

Referenced by AnopeInit(), encryption_module_init(), and protocol_module_init().

int prepForUnload ( Module m)

Prepare a module to be unloaded. Remove all commands and messages this module is providing, and delete any callbacks which are still pending.

Parameters
mthe module to prepare for unload
Returns
MOD_ERR_OK on success

ok, im going to walk every hash looking for commands we own, now, not exactly elegant or efficiant :)

Definition at line 830 of file modules.c.

References c, CommandHash_::c, current, delCommand(), delEventHandler(), delEventHook(), delMessage(), destroyCommand(), destroyEventHandler(), destroyEventHook(), destroyMessage(), EVENT, EVENTHOOKS, EvtHookHash_::evh, EvtMessageHash_::evm, MessageHash_::m, MAX_CMD_HASH, MOD_ERR_OK, MOD_ERR_PARAMS, Command_::mod_name, Message_::mod_name, EvtMessage_::mod_name, EvtHook_::mod_name, moduleCallBackPrepForUnload(), moduleDelAllDataMod(), Module_::name, Command_::next, CommandHash_::next, Message_::next, MessageHash_::next, EvtMessage_::next, EvtMessageHash_::next, EvtHook_::next, EvtHookHash_::next, and stricmp().

Referenced by modules_unload_all(), and unloadModule().

int protocol_module_init ( void  )
MDE int queueModuleLoad ( char *  name,
User u 
)

Enqueue a module to load

Parameters
nameName of the module to load
uUser who requested the load
Returns
1 on success, 0 on error

Definition at line 2801 of file modules.c.

References createModule(), findModule(), MOD_OP_LOAD, and queueModuleOperation().

Referenced by do_modload().

MDE int queueModuleUnload ( char *  name,
User u 
)

Enqueue a module to unload

Parameters
nameName of the module to unload
uUser who requested the unload
Returns
1 on success, 0 on error

Definition at line 2822 of file modules.c.

References findModule(), MOD_OP_UNLOAD, and queueModuleOperation().

Referenced by do_modunload().

int unloadModule ( Module m,
User u 
)

Unload the given module.

Parameters
mthe module to unload
uthe user who unloaded it
Returns
MOD_ERR_OK on success, anything else on fail

Definition at line 747 of file modules.c.

References alog(), ano_modclose, ano_moderr, ano_modsym, anope_cmd_global(), delModule(), ENCRYPTION, EVENT_MODUNLOAD, Module_::handle, mod_current_module_name, MOD_ERR_NOUNLOAD, MOD_ERR_OK, MOD_ERR_PARAMS, MOD_ERR_UNKNOWN, Module_::name, user_::nick, notice_lang(), prepForUnload(), PROTOCOL, s_OperServ, send_event(), and Module_::type.

Referenced by handleModuleOperationQueue(), and loadModule().

MDE void updateProtectDetails ( char *  level_info_protect_word,
char *  level_info_protectme_word,
char *  fant_protect_add,
char *  fant_protect_del,
char *  level_protect_word,
char *  protect_set_mode,
char *  protect_unset_mode 
)

Update the protect deatials, could be either protect or admin etc..

Allow ircd protocol files to update the protect level info tables.

Definition at line 2512 of file modules.c.

References csmodeutil_::bsname, CA_AUTOPROTECT, CA_PROTECT, CA_PROTECTME, csmodeutils, levelinfo, csmodeutil_::mode, csmodeutil_::name, LevelInfo::name, sstrdup(), and LevelInfo::what.

Referenced by moduleAddIRCDMsgs().

Variable Documentation

Definition at line 43 of file modules.c.

Definition at line 46 of file modules.c.

Definition at line 20 of file events.c.

Definition at line 21 of file events.c.

Definition at line 47 of file modules.c.

Declare all the list's we want to use here

Definition at line 42 of file modules.c.

Definition at line 49 of file modules.c.

Definition at line 44 of file modules.c.

MDE char* mod_current_buffer

Definition at line 54 of file modules.c.

Referenced by process().

char* mod_current_evtbuffer

Definition at line 18 of file events.c.

Referenced by event_process_hook().

MDE Module* mod_current_module
MDE char* mod_current_module_name
MDE int mod_current_op
MDE User* mod_current_user

Definition at line 55 of file modules.c.

MDE ModuleHash* MODULE_HASH[MAX_CMD_HASH]

Definition at line 50 of file modules.c.

Definition at line 45 of file modules.c.

Definition at line 48 of file modules.c.