summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 68859b627..2b5a07296 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -249,6 +249,39 @@ Module* InspIRCd::FindFeature(const std::string &FeatureName)
return iter->second;
}
+bool InspIRCd::PublishInterface(const std::string &InterfaceName, Module* Mod)
+{
+ Interfaces[InterfaceName].push_back(Mod);
+ return true;
+}
+
+bool InspIRCd::UnpublishInterface(const std::string &InterfaceName, Module* Mod)
+{
+ interfacelist::iterator iter = Interfaces.find(InterfaceName);
+
+ if (iter == Interfaces.end())
+ return false;
+
+ for (modulelist::iterator x = iter->second.begin(); x != iter->second.end(); x++)
+ {
+ if (*x == Mod)
+ {
+ iter->second.erase(x);
+ return true;
+ }
+ }
+ return false;
+}
+
+modulelist* InspIRCd::FindInterface(const std::string &InterfaceName)
+{
+ interfacelist::iterator iter = Interfaces.find(InterfaceName);
+ if (iter == Interfaces.end())
+ return NULL;
+ else
+ return &(iter->second);
+}
+
const std::string& InspIRCd::GetModuleName(Module* m)
{
static std::string nothing = ""; /* Prevent compiler warning */