From bb47ab8f4123149a7ee28a0abf6edc1e97bc2be7 Mon Sep 17 00:00:00 2001 From: rburchell Date: Fri, 14 Nov 2008 20:28:23 +0000 Subject: 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 --- include/modules.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') 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 */ -- cgit