summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-14 20:28:23 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-14 20:28:23 +0000
commitbb47ab8f4123149a7ee28a0abf6edc1e97bc2be7 (patch)
treecf67e20e199d4dfeab9bf6fef4482a09f6dceeb2 /include/modules.h
parent10dcb3d8a44d741f5a16853016a1118664b75e8a (diff)
Add Module::SetPermanent() and Module::GetPermanent(), used to mark a module as not unloadable.
Used for os_modunload, as unloading it would cause issues. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1679 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h
index 28b3065d7..93e399819 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -136,6 +136,8 @@ struct ModuleLang_ {
*/
CoreExport class Module
{
+ private:
+ bool permanent;
public:
/** The module name (e.g. os_modload)
*/
@@ -177,6 +179,20 @@ CoreExport class Module
*/
void SetType(MODType type);
+ /** Toggles the permanent flag on a module. If a module is permanent,
+ * then it may not be unloaded.
+ *
+ * Naturally, this setting should be used sparingly!
+ *
+ * @param state True if this module should be permanent, false else.
+ */
+ void SetPermanent(bool state);
+
+ /** Retrieves whether or not a given module is permanent.
+ * @return true if the module is permanent, false else.
+ */
+ bool GetPermanent();
+
/** Set the modules version info.
* @param version the version of the module
*/