#include "serialize.h"#include "base.h"#include "modes.h"#include "timers.h"#include "logger.h"#include "extensible.h"

Go to the source code of this file.
| #define FOREACH_MOD | ( | y, | ||
| x | ||||
| ) |
if (true) \ { \ std::vector<Module *>::iterator safei; \ for (std::vector<Module *>::iterator _i = ModuleManager::EventHandlers[y].begin(); _i != ModuleManager::EventHandlers[y].end(); ) \ { \ safei = _i; \ ++safei; \ try \ { \ (*_i)->x ; \ } \ catch (const ModuleException &modexcept) \ { \ Log() << "Exception caught: " << modexcept.GetReason(); \ } \ _i = safei; \ } \ } \ else \ static_cast<void>(0)
This define allows us to call a method in all loaded modules in a readable simple way, e.g.: 'FOREACH_MOD(I_OnConnect,OnConnect(user));'
Definition at line 61 of file modules.h.
Referenced by NickCore::AddAccess(), ChannelInfo::AddBadWord(), NickCore::AddCert(), ModeManager::AddChannelMode(), ModeManager::AddUserMode(), User::ChangeNick(), Channel::ChangeTopic(), Channel::ChangeTopicInternal(), Channel::Channel(), ChannelInfo::ChannelInfo(), BSKick::check_ban(), NickCore::ClearAccess(), NickCore::ClearCert(), Uplink::Connect(), Server::Delete(), Channel::DeleteUser(), XOPBase::DoAdd(), CommandCSAKick::DoAdd(), CommandCSAccess::DoAdd(), CommandBSBot::DoAdd(), CommandBSBot::DoChange(), MyXMLRPCEvent::DoCheckAuthentication(), CommandOSAKill::DoClear(), XOPBase::DoClear(), CommandCSFlags::DoClear(), CommandCSAccess::DoClear(), ExceptionDelCallback::DoDel(), CommandOSAKill::DoDel(), XOPBase::DoDel(), CommandCSAKick::DoDel(), CommandCSAccess::DoDel(), CommandBSBot::DoDel(), CommandCSLevels::DoDisable(), CommandCSFlags::DoModify(), CommandCSLevels::DoReset(), CommandCSLevels::DoSet(), NickCore::EraseAccess(), ChannelInfo::EraseBadWord(), NickCore::EraseCert(), CommandOSReload::Execute(), CommandOSDefcon::Execute(), CommandNSUpdate::Execute(), CommandNSUnSuspend::Execute(), CommandNSSuspend::Execute(), CommandNSRegister::Execute(), CommandNSRecover::Execute(), CommandNSLogout::Execute(), CommandNSInfo::Execute(), CommandNSIdentify::Execute(), CommandNSGroup::Execute(), CommandNSDrop::Execute(), CommandMSDel::Execute(), CommandMSCancel::Execute(), CommandHSSetAll::Execute(), CommandHSSet::Execute(), CommandHSActivate::Execute(), CommandHSDelAll::Execute(), CommandHSDel::Execute(), CommandHelp::Execute(), CommandCSUnSuspend::Execute(), CommandCSSuspend::Execute(), CommandCSRegister::Execute(), CommandCSInfo::Execute(), CommandCSDrop::Execute(), CommandCSClone::Execute(), MemoDelCallback::HandleNumber(), MyManager::HandlePacket(), Anope::HandleSignal(), User::Identify(), BotInfo::Join(), Channel::KickInternal(), ModuleManager::LoadModule(), main(), CommandOSSXLineBase::OnClear(), UplinkSocket::OnConnect(), CommandOSSXLineBase::OnDel(), NickServCore::OnDelCore(), BotServCore::OnPrivmsg(), WebCPanel::Index::OnRequest(), NSGroupRequest::OnSuccess(), Serializable::QueueUpdate(), User::RemoveModeInternal(), Message::SQuit::Run(), Message::Quit::Run(), Message::Privmsg::Run(), Message::Part::Run(), Message::Join::Run(), Message::Away::Run(), IRCDMessageSASL::Run(), IRCDMessageEncap::Run(), IRCDMessageMetadata::Run(), RunCommand(), MyMemoServService::Send(), Serializable::Serializable(), Server::Server(), NickCore::SetDisplay(), User::SetModeInternal(), Message::Join::SJoin(), Server::Sync(), ExpireCallback::Tick(), DefConTimeout::Tick(), ModuleManager::UnloadModule(), User::User(), Channel::~Channel(), ChannelInfo::~ChannelInfo(), Log::~Log(), NickAlias::~NickAlias(), NickCore::~NickCore(), Serializable::~Serializable(), UplinkSocket::~UplinkSocket(), and User::~User().
| #define FOREACH_RESULT | ( | y, | ||
| x | ||||
| ) |
if (true) \ { \ std::vector<Module *>::iterator safei; \ MOD_RESULT = EVENT_CONTINUE; \ for (std::vector<Module *>::iterator _i = ModuleManager::EventHandlers[y].begin(); _i != ModuleManager::EventHandlers[y].end(); ) \ { \ safei = _i; \ ++safei; \ try \ { \ EventReturn res = (*_i)->x ; \ if (res != EVENT_CONTINUE) { \ MOD_RESULT = res; \ break; \ } \ } \ catch (const ModuleException &modexcept) \ { \ Log() << "Exception caught: " << modexcept.GetReason(); \ } \ _i = safei; \ } \ } \ else \ static_cast<void>(0)
This define is similar to the one above but returns a result in MOD_RESULT. The first module to return a nonzero result is the value to be accepted, and any modules after are ignored.
Definition at line 88 of file modules.h.
Referenced by BotInfo::Assign(), ChannelInfo::CheckKick(), Channel::CheckModes(), Anope::Decrypt(), CommandOSException::DoAdd(), CommandOSAKill::DoAdd(), Anope::Encrypt(), CommandHelp::Execute(), CommandCSSetMisc::Execute(), CommandCSSetSuccessor::Execute(), CommandCSSetSignKick::Execute(), CommandCSSetSecureOps::Execute(), CommandCSSetSecureFounder::Execute(), CommandCSSetSecure::Execute(), CommandCSSetRestricted::Execute(), CommandCSSetPrivate::Execute(), CommandCSSetPersist::Execute(), CommandCSSetPeace::Execute(), CommandCSSetKeepTopic::Execute(), CommandCSSetFounder::Execute(), CommandCSSetDescription::Execute(), CommandCSSetChanstats::Execute(), CommandCSSetBanType::Execute(), CommandCSSetAutoOp::Execute(), AccessGroup::HasPriv(), Anope::Init(), User::IsServicesOper(), Channel::Kick(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), BotServCore::OnPrivmsg(), Anope::Process(), ChannelInfo::RemoveMLock(), Channel::RemoveModeInternal(), Message::Privmsg::Run(), CommandNSSetMisc::Run(), CommandNSSetSecure::Run(), CommandNSSetPrivate::Run(), CommandNSSetMessage::Run(), CommandNSSetLanguage::Run(), CommandNSSetKill::Run(), CommandNSSetHide::Run(), CommandNSSetGreet::Run(), CommandNSSetEmail::Run(), CommandNSSetDisplay::Run(), CommandNSSetChanstats::Run(), CommandNSSetAutoOp::Run(), RunCommand(), Anope::SaveDatabases(), ChannelInfo::SetMLock(), Channel::SetModeInternal(), Message::Join::SJoin(), and BotInfo::UnAssign().
| #define MODULE_INIT | ( | x | ) |
extern "C" DllExport Module *AnopeInit(const Anope::string &modname, const Anope::string &creator) \ { \ return new x(modname, creator); \ } \ extern "C" DllExport void AnopeFini(x *m) \ { \ delete m; \ }
This definition is used as shorthand for the various classes and functions needed to make a module loadable by the OS. It defines the class factory and external AnopeInit and AnopeFini functions.
| enum EventReturn |
| enum Implementation |
Implementation-specific flags which may be set in ModuleManager::Attach()
| enum ModType |
| enum ModuleReturn |
1.7.1