summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-05 20:43:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-05 20:43:41 +0000
commitc3a7fb47d62c2f701782809a987747edd7bc7818 (patch)
tree41847bd18f2d6f45f6377be4ba720fd702d68b01 /include
parent743b5409f88ce65c69c44ebde7ef19c4cf7f0bcf (diff)
Untested, undocumented PublishInterface, UnpublishInterface, FindInterface.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5867 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h10
-rw-r--r--include/modules.h8
2 files changed, 18 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index f0f5a1d1f..321222aab 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -298,6 +298,10 @@ class InspIRCd : public classbase
*/
featurelist Features;
+ /** The interface names published by various modules
+ */
+ interfacelist Interfaces;
+
/** The current time, updated in the mainloop
*/
time_t TIME;
@@ -707,6 +711,8 @@ class InspIRCd : public classbase
*/
bool PublishFeature(const std::string &FeatureName, Module* Mod);
+ bool PublishInterface(const std::string &InterfaceName, Module* Mod);
+
/** 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.
@@ -714,6 +720,8 @@ class InspIRCd : public classbase
*/
bool UnpublishFeature(const std::string &FeatureName);
+ bool UnpublishInterface(const std::string &InterfaceName, Module* Mod);
+
/** 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
@@ -728,6 +736,8 @@ class InspIRCd : public classbase
*/
Module* FindFeature(const std::string &FeatureName);
+ modulelist* FindInterface(const std::string &InterfaceName);
+
/** Given a pointer to a Module, return its filename
* @param m The module pointer to identify
* @return The module name or an empty string
diff --git a/include/modules.h b/include/modules.h
index b3be6ae9f..670d32844 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -101,6 +101,14 @@ typedef file_cache string_list;
*/
typedef std::map<std::string,Module*> featurelist;
+/** Holds a list of modules which implement an interface
+ */
+typedef std::deque<Module*> modulelist;
+
+/** Holds a list of all modules which implement interfaces, by interface name
+ */
+typedef std::map<std::string, modulelist> interfacelist;
+
/**
* This #define allows us to call a method in all
* loaded modules in a readable simple way, e.g.: