The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleManager Class Reference

ModuleManager takes care of all things module-related in the core. More...

#include <modules.h>

Inheritance diagram for ModuleManager:

Inheritance graph
[legend]
Collaboration diagram for ModuleManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleManager (InspIRCd *Ins)
 Simple, bog-standard, boring constructor.
 ~ModuleManager ()
 Destructor.
bool SetPriority (Module *mod, Implementation i, PriorityState s, Module **modules=NULL, size_t sz=1)
 Change the priority of one event in a module.
bool SetPriority (Module *mod, PriorityState s)
 Change the priority of all events in a module.
bool Attach (Implementation i, Module *mod)
 Attach an event to a module.
bool Detach (Implementation i, Module *mod)
 Detatch an event from a module.
void Attach (Implementation *i, Module *mod, size_t sz)
 Attach an array of events to a module.
void DetachAll (Module *mod)
 Detach all events from a module (used on unload).
std::stringLastError ()
 Returns text describing the last module error.
bool Load (const char *filename)
 Load a given module file.
bool Unload (const char *filename)
 Unload a given module file.
void LoadAll ()
 Called by the InspIRCd constructor to load all modules from the config file.
int GetCount ()
 Get the total number of currently loaded modules.
ModuleFind (const std::string &name)
 Find a module by name, and return a Module* to it.
bool PublishFeature (const std::string &FeatureName, Module *Mod)
 Publish a 'feature'.
bool PublishInterface (const std::string &InterfaceName, Module *Mod)
 Publish a module to an 'interface'.
std::pair< int, std::stringGetInterfaceInstanceCount (Module *m)
 Return a pair saying how many other modules are currently using the interfaces provided by module m.
void UseInterface (const std::string &InterfaceName)
 Mark your module as using an interface.
void DoneWithInterface (const std::string &InterfaceName)
 Mark your module as finished with an interface.
bool UnpublishFeature (const std::string &FeatureName)
 Unpublish a 'feature'.
bool UnpublishInterface (const std::string &InterfaceName, Module *Mod)
 Unpublish your module from an interface When your module exits, it must call this method for every interface it is part of so that the interfaces table is cleaned up.
ModuleFindFeature (const std::string &FeatureName)
 Find a 'feature'.
modulelistFindInterface (const std::string &InterfaceName)
 Find an 'interface'.
bool ModuleHasInterface (Module *mod, const std::string &InterfaceName)
 Determine if a module has published the named interface.
const std::stringGetModuleName (Module *m)
 Given a pointer to a Module, return its filename.
const std::vector< std::stringGetAllModuleNames (int filter)
 Return a list of all modules matching the given filter.

Public Attributes

IntModuleList EventHandlers [I_END]
 Event handler hooks.

Private Attributes

std::string LastModuleError
 Holds a string describing the last module error to occur.
featurelist Features
 The feature names published by various modules.
interfacelist Interfaces
 The interface names published by various modules.
int ModCount
 Total number of modules loaded into the ircd.
InspIRCdInstance
 Our pointer to the main insp instance.
std::map< std::string, std::pair<
ircd_module *, Module * > > 
Modules
 List of loaded modules and shared object/dll handles keyed by module name.

Detailed Description

ModuleManager takes care of all things module-related in the core.

Definition at line 1632 of file modules.h.


Constructor & Destructor Documentation

ModuleManager::ModuleManager InspIRCd Ins  ) 
 

Simple, bog-standard, boring constructor.

Definition at line 201 of file modules.cpp.

ModuleManager::~ModuleManager  ) 
 

Destructor.

Definition at line 205 of file modules.cpp.


Member Function Documentation

void ModuleManager::Attach Implementation i,
Module mod,
size_t  sz
 

Attach an array of events to a module.

Parameters:
i Event types (array) to attach
mod Module to attach events to

Definition at line 229 of file modules.cpp.

References Attach().

bool ModuleManager::Attach Implementation  i,
Module mod
 

Attach an event to a module.

You may later detatch the event with ModuleManager::Detach(). If your module is unloaded, all events are automatically detatched.

Parameters:
i Event type to attach
mod Module to attach event to
Returns:
True if the event was attached

Definition at line 209 of file modules.cpp.

References EventHandlers.

Referenced by Attach(), ListModeBase::DoImplements(), FilterBase::FilterBase(), ModuleAbbreviation::ModuleAbbreviation(), ModuleAlias::ModuleAlias(), ModuleAllowInvite::ModuleAllowInvite(), ModuleAntiBear::ModuleAntiBear(), ModuleAntiBottler::ModuleAntiBottler(), ModuleAuditorium::ModuleAuditorium(), ModuleBadChannelExtban::ModuleBadChannelExtban(), ModuleBanException::ModuleBanException(), ModuleBanRedirect::ModuleBanRedirect(), ModuleBlockAmsg::ModuleBlockAmsg(), ModuleBlockCAPS::ModuleBlockCAPS(), ModuleBlockColour::ModuleBlockColour(), ModuleBotMode::ModuleBotMode(), ModuleCallerID::ModuleCallerID(), ModuleCAP::ModuleCAP(), ModuleCBan::ModuleCBan(), ModuleCensor::ModuleCensor(), ModuleCgiIRC::ModuleCgiIRC(), ModuleChanCreate::ModuleChanCreate(), ModuleChanFilter::ModuleChanFilter(), ModuleChanLog::ModuleChanLog(), ModuleChanProtect::ModuleChanProtect(), ModuleChgHost::ModuleChgHost(), ModuleCloaking::ModuleCloaking(), ModuleConnectBan::ModuleConnectBan(), ModuleConnFlood::ModuleConnFlood(), ModuleConnJoin::ModuleConnJoin(), ModuleCustomTitle::ModuleCustomTitle(), ModuleDCCAllow::ModuleDCCAllow(), ModuleDeaf::ModuleDeaf(), ModuleDelayJoin::ModuleDelayJoin(), ModuleDenyChannels::ModuleDenyChannels(), ModuleDNSBL::ModuleDNSBL(), ModuleFoobar::ModuleFoobar(), ModuleGecosBan::ModuleGecosBan(), ModuleGeoIP::ModuleGeoIP(), ModuleHelpop::ModuleHelpop(), ModuleHideChans::ModuleHideChans(), ModuleHideOper::ModuleHideOper(), ModuleHostChange::ModuleHostChange(), ModuleHTTPAccessList::ModuleHTTPAccessList(), ModuleHttpServer::ModuleHttpServer(), ModuleHttpStats::ModuleHttpStats(), ModuleIdent::ModuleIdent(), ModuleInvisible::ModuleInvisible(), ModuleInviteException::ModuleInviteException(), ModuleJoinFlood::ModuleJoinFlood(), ModuleJumpServer::ModuleJumpServer(), ModuleKickNoRejoin::ModuleKickNoRejoin(), ModuleLDAPAuth::ModuleLDAPAuth(), ModuleLockserv::ModuleLockserv(), ModuleMapHide::ModuleMapHide(), ModuleMD5::ModuleMD5(), ModuleModesOnConnect::ModuleModesOnConnect(), ModuleModesOnOper::ModuleModesOnOper(), ModuleMsgFlood::ModuleMsgFlood(), ModuleMsSQL::ModuleMsSQL(), ModuleNamesX::ModuleNamesX(), ModuleNickFlood::ModuleNickFlood(), ModuleNickLock::ModuleNickLock(), ModuleNoCTCP::ModuleNoCTCP(), ModuleNoKicks::ModuleNoKicks(), ModuleNoNickChange::ModuleNoNickChange(), ModuleNoNotice::ModuleNoNotice(), ModuleOperChans::ModuleOperChans(), ModuleOperFlood::ModuleOperFlood(), ModuleOperHash::ModuleOperHash(), ModuleOperjoin::ModuleOperjoin(), ModuleOperLevels::ModuleOperLevels(), ModuleOperLog::ModuleOperLog(), ModuleOpermotd::ModuleOpermotd(), ModuleOperSSLCert::ModuleOperSSLCert(), ModuleOverride::ModuleOverride(), ModulePartMsgBan::ModulePartMsgBan(), ModulePermanentChannels::ModulePermanentChannels(), ModulePgSQL::ModulePgSQL(), ModulePrivacyMode::ModulePrivacyMode(), ModuleQuietBan::ModuleQuietBan(), ModuleRandQuote::ModuleRandQuote(), ModuleRedirect::ModuleRedirect(), ModuleRegexGlob::ModuleRegexGlob(), ModuleRegexPCRE::ModuleRegexPCRE(), ModuleRegexPOSIX::ModuleRegexPOSIX(), ModuleRegexTRE::ModuleRegexTRE(), ModuleRegOnlyCreate::ModuleRegOnlyCreate(), ModuleRemove::ModuleRemove(), ModuleRestrictChans::ModuleRestrictChans(), ModuleRestrictMsg::ModuleRestrictMsg(), ModuleRIPEMD160::ModuleRIPEMD160(), ModuleRLine::ModuleRLine(), ModuleRpcJson::ModuleRpcJson(), ModuleRPCTest::ModuleRPCTest(), ModuleSafeList::ModuleSafeList(), ModuleSASL::ModuleSASL(), ModuleSecureList::ModuleSecureList(), ModuleSeeNicks::ModuleSeeNicks(), ModuleServerBan::ModuleServerBan(), ModuleServicesAccount::ModuleServicesAccount(), ModuleServProtectMode::ModuleServProtectMode(), ModuleSetHost::ModuleSetHost(), ModuleSHA256::ModuleSHA256(), ModuleShowwhois::ModuleShowwhois(), ModuleShun::ModuleShun(), ModuleSilence::ModuleSilence(), ModuleSpanningTree::ModuleSpanningTree(), ModuleSpy::ModuleSpy(), ModuleSQL::ModuleSQL(), ModuleSQLAuth::ModuleSQLAuth(), ModuleSQLite3::ModuleSQLite3(), ModuleSQLLog::ModuleSQLLog(), ModuleSQLOper::ModuleSQLOper(), ModuleSQLutils::ModuleSQLutils(), ModuleSSLDummy::ModuleSSLDummy(), ModuleSSLGnuTLS::ModuleSSLGnuTLS(), ModuleSSLModes::ModuleSSLModes(), ModuleSSLOpenSSL::ModuleSSLOpenSSL(), ModuleStripColor::ModuleStripColor(), ModuleSVSHold::ModuleSVSHold(), ModuleSWhois::ModuleSWhois(), ModuleTaxonomy::ModuleTaxonomy(), ModuleTestClient::ModuleTestClient(), ModuleTimedBans::ModuleTimedBans(), ModuleUHNames::ModuleUHNames(), ModuleUserIP::ModuleUserIP(), ModuleWaitPong::ModuleWaitPong(), Modulewatch::Modulewatch(), ModuleXLineDB::ModuleXLineDB(), and ModuleZLib::ModuleZLib().

bool ModuleManager::Detach Implementation  i,
Module mod
 

Detatch an event from a module.

This is not required when your module unloads, as the core will automatically detatch your module from all events it is attached to.

Parameters:
i Event type to detach
mod Module to detach event from
Detach true if the event was detached

Definition at line 218 of file modules.cpp.

References EventHandlers.

Referenced by DetachAll().

void ModuleManager::DetachAll Module mod  ) 
 

Detach all events from a module (used on unload).

Parameters:
mod Module to detach from

Definition at line 235 of file modules.cpp.

References Detach(), I_BEGIN, and I_END.

Referenced by Load(), and Unload().

void ModuleManager::DoneWithInterface const std::string InterfaceName  ) 
 

Mark your module as finished with an interface.

If you used UseInterface() above, you should use this method when your module is finished with the interface (usually in its destructor) to allow the modules which implement the given interface to be unloaded.

Parameters:
InterfaceName The interface you are finished with using.

Definition at line 681 of file modules.cpp.

References Interfaces.

Referenced by ModuleMsSQL::ModuleMsSQL(), ModuleSQL::ModuleSQL(), ModuleSQLite3::ModuleSQLite3(), FilterBase::~FilterBase(), ModuleCloaking::~ModuleCloaking(), ModuleMsSQL::~ModuleMsSQL(), ModuleOperHash::~ModuleOperHash(), ModulePgSQL::~ModulePgSQL(), ModuleRLine::~ModuleRLine(), ModuleSpanningTree::~ModuleSpanningTree(), ModuleSQL::~ModuleSQL(), ModuleSQLAuth::~ModuleSQLAuth(), ModuleSQLite3::~ModuleSQLite3(), ModuleSQLLog::~ModuleSQLLog(), and ModuleSQLOper::~ModuleSQLOper().

Module * ModuleManager::Find const std::string name  ) 
 

Find a module by name, and return a Module* to it.

This is preferred over iterating the module lists yourself.

Parameters:
name The module name to look up
Returns:
A pointer to the module, or NULL if the module cannot be found

Definition at line 791 of file modules.cpp.

References Modules.

Referenced by TreeSocket::Capab(), ModuleSQLAuth::CheckCredentials(), TreeSocket::ComparePass(), RemoveBase::Handle(), TreeSocket::MakePass(), ModuleCloaking::ModuleCloaking(), TreeSocket::Modules(), ModuleSASL::ModuleSASL(), ModuleSQLAuth::ModuleSQLAuth(), ModuleSQLLog::ModuleSQLLog(), ModuleSQLOper::ModuleSQLOper(), ModuleGecosBan::OnCheckInvite(), ModuleHttpStats::OnEvent(), InvisibleMode::OnModeChange(), ModuleBanRedirect::OnRehash(), ModuleBanRedirect::OnUserPreJoin(), ModuleSSLOpenSSL::Prioritize(), ModuleSSLGnuTLS::Prioritize(), ModuleSpy::Prioritize(), ModuleSecureList::Prioritize(), ModuleHostChange::Prioritize(), ModuleCloaking::Prioritize(), ModuleBanRedirect::Prioritize(), and TreeSocket::SendCapabilities().

Module * ModuleManager::FindFeature const std::string FeatureName  ) 
 

Find a 'feature'.

There are two ways for a module to find another module it depends on. Either by name, using InspIRCd::FindModule, or by feature, using the InspIRCd::PublishFeature method. A feature is an arbitary string which identifies something this module can do. For example, if your module provides SSL support, but other modules provide SSL support too, all the modules supporting SSL should publish an identical 'SSL' feature. To find a module capable of providing the feature you want, simply call this method with the feature name you are looking for.

Parameters:
FeatureName The feature name you wish to obtain the module for
Returns:
A pointer to a valid module class on success, NULL on failure.

Definition at line 604 of file modules.cpp.

References Features.

Referenced by ModuleSQLOper::LookupOper(), ModuleSQLAuth::ModuleSQLAuth(), ModuleSQLLog::ModuleSQLLog(), and ModuleTestClient::OnBackgroundTimer().

modulelist * ModuleManager::FindInterface const std::string InterfaceName  ) 
 

Find an 'interface'.

An interface is a list of modules which all implement the same API.

Parameters:
InterfaceName The Interface you wish to obtain the module list of.
Returns:
A pointer to a deque of Module*, or NULL if the interface does not exist.

Definition at line 651 of file modules.cpp.

References Interfaces.

Referenced by ModuleOperHash::ModuleOperHash(), ModuleSQLOper::ModuleSQLOper(), ModuleRLine::OnRehash(), FilterBase::OnRehash(), and SpanningTreeUtilities::SpanningTreeUtilities().

const std::vector< std::string > ModuleManager::GetAllModuleNames int  filter  ) 
 

Return a list of all modules matching the given filter.

Parameters:
filter This int is a bitmask of flags set in Module::Flags, such as VF_VENDOR or VF_STATIC. If you wish to receive a list of all modules with no filtering, set this to 0.
Returns:
The list of module names

Definition at line 801 of file modules.cpp.

References Modules.

Referenced by InspIRCd::Cleanup(), InitModule(), TreeSocket::Modules(), TreeSocket::MyCapabilities(), and ModuleHttpStats::OnEvent().

int ModuleManager::GetCount  )  [inline]
 

Get the total number of currently loaded modules.

Returns:
The number of loaded modules

Definition at line 1761 of file modules.h.

std::pair< int, std::string > ModuleManager::GetInterfaceInstanceCount Module m  ) 
 

Return a pair saying how many other modules are currently using the interfaces provided by module m.

Parameters:
m The module to count usage for
Returns:
A pair, where the first value is the number of uses of the interface, and the second value is the interface name being used.

Definition at line 688 of file modules.cpp.

References Interfaces.

Referenced by Unload().

const std::string & ModuleManager::GetModuleName Module m  ) 
 

Given a pointer to a Module, return its filename.

Parameters:
m The module pointer to identify
Returns:
The module name or an empty string

Definition at line 703 of file modules.cpp.

References Modules.

std::string & ModuleManager::LastError  ) 
 

Returns text describing the last module error.

Returns:
The last error message to occur

Definition at line 358 of file modules.cpp.

References LastModuleError.

Referenced by CommandGreloadmodule::Handle(), CommandGunloadmodule::Handle(), CommandGloadmodule::Handle(), and ServerConfig::Read().

bool ModuleManager::Load const char *  filename  ) 
 

Load a given module file.

Parameters:
filename The file to load
Returns:
True if the module was found and loaded

Definition at line 363 of file modules.cpp.

References Version::API, API_VERSION, InspIRCd::BuildISupport(), DLLFactory< ReturnType >::CallInit(), InspIRCd::Config, ConvToStr(), DEFAULT, DetachAll(), ServerConfig::DirValid(), ServerConfig::FileExists(), Version::Flags, FOREACH_MOD_I, CoreException::GetReason(), Module::GetVersion(), I_OnLoadModule, Instance, LastModuleError, LogManager::Log(), InspIRCd::Logs, InspIRCd::Match(), MAXBUF, ModCount, ServerConfig::ModPath, Modules, Version::version, and VF_VENDOR.

Referenced by CommandGreloadmodule::Handle(), CommandGloadmodule::Handle(), ServerConfig::Read(), and TestSuite::TestSuite().

void ModuleManager::LoadAll  ) 
 

Called by the InspIRCd constructor to load all modules from the config file.

Definition at line 564 of file modules.cpp.

References InspIRCd::Config, ServerConfig::config_data, ServerConfig::ConfValue(), ServerConfig::ConfValueEnum(), DEFAULT, InspIRCd::Exit(), EXIT_STATUS_MODULE, Instance, LogManager::Log(), InspIRCd::Logs, MAXBUF, ModCount, and printf_c.

Referenced by InspIRCd::InspIRCd().

bool ModuleManager::ModuleHasInterface Module mod,
const std::string InterfaceName
 

Determine if a module has published the named interface.

This could be used in, for example, OnLoadModule to pick up other modules that can be used.

Parameters:
mod The module to check.
InterfaceName the interface you want to check for
Returns:
True if the module provides the interface, false otherwise.

Definition at line 660 of file modules.cpp.

References Interfaces.

Referenced by ModuleSQLOper::OnLoadModule(), ModuleRLine::OnLoadModule(), ModuleOperHash::OnLoadModule(), and FilterBase::OnLoadModule().

bool ModuleManager::PublishFeature const std::string FeatureName,
Module Mod
 

Publish a 'feature'.

There are two ways for a module to find another module it depends on. Either by name, using InspIRCd::FindModule, or by feature, using this function. A feature is an arbitary string which identifies something this module can do. For example, if your module provides SSL support, but other modules provide SSL support too, all the modules supporting SSL should publish an identical 'SSL' feature. This way, any module requiring use of SSL functions can just look up the 'SSL' feature using FindFeature, then use the module pointer they are given.

Parameters:
FeatureName The case sensitive feature name to make available
Mod a pointer to your module class
Returns:
True on success, false if the feature is already published by another module.

Definition at line 583 of file modules.cpp.

References Features.

Referenced by ModuleMsSQL::ModuleMsSQL(), ModulePgSQL::ModulePgSQL(), ModuleSQL::ModuleSQL(), and ModuleSQLite3::ModuleSQLite3().

bool ModuleManager::PublishInterface const std::string InterfaceName,
Module Mod
 

Publish a module to an 'interface'.

Modules which implement the same interface (the same way of communicating with other modules) can publish themselves to an interface, using this method. When they do so, they become part of a list of related or compatible modules, and a third module may then query for that list and know that all modules within that list offer the same API. A prime example of this is the hashing modules, which all accept the same types of Request class. Consider this to be similar to PublishFeature, except for that multiple modules may publish the same 'feature'.

Parameters:
InterfaceName The case sensitive interface name to make available
Mod a pointer to your module class
Returns:
True on success, false on failure (there are currently no failure cases)

Definition at line 614 of file modules.cpp.

References Interfaces.

Referenced by ModuleBanException::ModuleBanException(), ModuleChanFilter::ModuleChanFilter(), ModuleInviteException::ModuleInviteException(), ModuleMD5::ModuleMD5(), ModuleMsSQL::ModuleMsSQL(), ModulePgSQL::ModulePgSQL(), ModuleRegexGlob::ModuleRegexGlob(), ModuleRegexPCRE::ModuleRegexPCRE(), ModuleRegexPOSIX::ModuleRegexPOSIX(), ModuleRegexTRE::ModuleRegexTRE(), ModuleRIPEMD160::ModuleRIPEMD160(), ModuleRpcJson::ModuleRpcJson(), ModuleSHA256::ModuleSHA256(), ModuleSQL::ModuleSQL(), ModuleSQLite3::ModuleSQLite3(), ModuleSQLutils::ModuleSQLutils(), ModuleSSLGnuTLS::ModuleSSLGnuTLS(), ModuleSSLOpenSSL::ModuleSSLOpenSSL(), and ModuleZLib::ModuleZLib().

bool ModuleManager::SetPriority Module mod,
PriorityState  s
 

Change the priority of all events in a module.

Parameters:
mod The module to set the priority of
s The priority of all events in the module. Note that with this method, it is not possible to effectively use PRIO_BEFORE or PRIO_AFTER, you should use the more fine tuned SetPriority method for this, where you may specify other modules to be prioritized against.

Definition at line 241 of file modules.cpp.

References I_BEGIN, I_END, and SetPriority().

bool ModuleManager::SetPriority Module mod,
Implementation  i,
PriorityState  s,
Module **  modules = NULL,
size_t  sz = 1
 

Change the priority of one event in a module.

Each module event has a list of modules which are attached to that event type. If you wish to be called before or after other specific modules, you may use this method (usually within void Module::Prioritize()) to set your events priority. You may use this call in other methods too, however, this is not supported behaviour for a module.

Parameters:
mod The module to change the priority of
i The event to change the priority of
s The state you wish to use for this event. Use one of PRIO_FIRST to set the event to be first called, PRIO_LAST to set it to be the last called, or PRIO_BEFORE and PRIO_AFTER to set it to be before or after one or more other modules.
modules If PRIO_BEFORE or PRIO_AFTER is set in parameter 's', then this contains a list of one or more modules your module must be placed before or after. Your module will be placed before the highest priority module in this list for PRIO_BEFORE, or after the lowest priority module in this list for PRIO_AFTER.
sz The number of modules being passed for PRIO_BEFORE and PRIO_AFTER. Defaults to 1, as most of the time you will only want to prioritize your module to be before or after one other module.

Definition at line 249 of file modules.cpp.

References EventHandlers, PRIO_AFTER, PRIO_BEFORE, PRIO_DONTCARE, PRIO_FIRST, and PRIO_LAST.

Referenced by ModuleAbbreviation::ModuleAbbreviation(), ModuleModesOnConnect::ModuleModesOnConnect(), ModuleSpanningTree::Prioritize(), ModuleSSLOpenSSL::Prioritize(), ModuleSSLGnuTLS::Prioritize(), ModuleSpy::Prioritize(), ModuleSecureList::Prioritize(), ModuleHostChange::Prioritize(), ModuleConnJoin::Prioritize(), ModuleCloaking::Prioritize(), ModuleCgiIRC::Prioritize(), ModuleBanRedirect::Prioritize(), and SetPriority().

bool ModuleManager::Unload const char *  filename  ) 
 

Unload a given module file.

Parameters:
filename The file to unload
Returns:
True if the module was unloaded

Definition at line 507 of file modules.cpp.

References InspIRCd::BuildISupport(), InspIRCd::chanlist, DNS::CleanResolvers(), UserManager::clientlist, ConvToStr(), DEFAULT, DetachAll(), FOREACH_MOD_I, GetInterfaceInstanceCount(), I_OnUnloadModule, Instance, LastModuleError, LogManager::Log(), InspIRCd::Logs, ModCount, Modules, InspIRCd::Parser, CommandParser::RemoveCommands(), InspIRCd::Res, TYPE_CHANNEL, TYPE_USER, InspIRCd::Users, and VF_STATIC.

Referenced by InspIRCd::Cleanup(), CommandGreloadmodule::Handle(), CommandGunloadmodule::Handle(), ServerConfig::Read(), and TestSuite::TestSuite().

bool ModuleManager::UnpublishFeature const std::string FeatureName  ) 
 

Unpublish a 'feature'.

When your module exits, it must call this method for every feature it is providing so that the feature table is cleaned up.

Parameters:
FeatureName the feature to remove

Definition at line 593 of file modules.cpp.

References Features.

Referenced by ModuleMsSQL::~ModuleMsSQL(), ModulePgSQL::~ModulePgSQL(), ModuleSQL::~ModuleSQL(), and ModuleSQLite3::~ModuleSQLite3().

bool ModuleManager::UnpublishInterface const std::string InterfaceName,
Module Mod
 

Unpublish your module from an interface When your module exits, it must call this method for every interface it is part of so that the interfaces table is cleaned up.

Only when the last item is deleted from an interface does the interface get removed.

Parameters:
InterfaceName the interface to be removed from
Mod The module to remove from the interface list

Definition at line 631 of file modules.cpp.

References Interfaces.

Referenced by ModuleBanException::~ModuleBanException(), ModuleChanFilter::~ModuleChanFilter(), ModuleInviteException::~ModuleInviteException(), ModuleMD5::~ModuleMD5(), ModuleMsSQL::~ModuleMsSQL(), ModulePgSQL::~ModulePgSQL(), ModuleRegexGlob::~ModuleRegexGlob(), ModuleRegexPCRE::~ModuleRegexPCRE(), ModuleRegexPOSIX::~ModuleRegexPOSIX(), ModuleRegexTRE::~ModuleRegexTRE(), ModuleRIPEMD160::~ModuleRIPEMD160(), ModuleRpcJson::~ModuleRpcJson(), ModuleSHA256::~ModuleSHA256(), ModuleSQL::~ModuleSQL(), ModuleSQLite3::~ModuleSQLite3(), ModuleSQLutils::~ModuleSQLutils(), ModuleSSLGnuTLS::~ModuleSSLGnuTLS(), ModuleSSLOpenSSL::~ModuleSSLOpenSSL(), and ModuleZLib::~ModuleZLib().

void ModuleManager::UseInterface const std::string InterfaceName  ) 
 

Mark your module as using an interface.

If you mark your module as using an interface, then that interface module may not unload until your module has unloaded first. This can be used to prevent crashes by ensuring code you depend on is always in memory while your module is active.

Parameters:
InterfaceName The interface to use

Definition at line 673 of file modules.cpp.

References Interfaces.

Referenced by FilterBase::FilterBase(), ModuleCloaking::ModuleCloaking(), ModuleMsSQL::ModuleMsSQL(), ModuleOperHash::ModuleOperHash(), ModulePgSQL::ModulePgSQL(), ModuleRLine::ModuleRLine(), ModuleSpanningTree::ModuleSpanningTree(), ModuleSQL::ModuleSQL(), ModuleSQLAuth::ModuleSQLAuth(), ModuleSQLite3::ModuleSQLite3(), ModuleSQLLog::ModuleSQLLog(), ModuleSQLOper::ModuleSQLOper(), ModuleSQLOper::OnLoadModule(), and ModuleOperHash::OnLoadModule().


Member Data Documentation

IntModuleList ModuleManager::EventHandlers[I_END]
 

Event handler hooks.

This needs to be public to be used by FOREACH_MOD and friends.

Definition at line 1665 of file modules.h.

Referenced by InspIRCd::AllModulesReportReady(), Attach(), Detach(), and SetPriority().

featurelist ModuleManager::Features [private]
 

The feature names published by various modules.

Definition at line 1641 of file modules.h.

Referenced by FindFeature(), PublishFeature(), and UnpublishFeature().

InspIRCd* ModuleManager::Instance [private]
 

Our pointer to the main insp instance.

Definition at line 1653 of file modules.h.

Referenced by Load(), LoadAll(), and Unload().

interfacelist ModuleManager::Interfaces [private]
 

The interface names published by various modules.

Definition at line 1645 of file modules.h.

Referenced by DoneWithInterface(), FindInterface(), GetInterfaceInstanceCount(), ModuleHasInterface(), PublishInterface(), UnpublishInterface(), and UseInterface().

std::string ModuleManager::LastModuleError [private]
 

Holds a string describing the last module error to occur.

Definition at line 1637 of file modules.h.

Referenced by LastError(), Load(), and Unload().

int ModuleManager::ModCount [private]
 

Total number of modules loaded into the ircd.

Definition at line 1649 of file modules.h.

Referenced by Load(), LoadAll(), and Unload().

std::map<std::string, std::pair<ircd_module*, Module*> > ModuleManager::Modules [private]
 

List of loaded modules and shared object/dll handles keyed by module name.

Definition at line 1658 of file modules.h.

Referenced by Find(), GetAllModuleNames(), GetModuleName(), Load(), and Unload().


The documentation for this class was generated from the following files: