From f572827157397e493e5499f115b15d0de992480a Mon Sep 17 00:00:00 2001 From: Adam- Date: Sun, 27 Sep 2009 21:20:56 +0000 Subject: Removed old mod_version system for detecting module versions and replaced with the Module::GetVersion() function git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2521 5417fbe8-f217-4b02-8779-1006273d7864 --- include/modules.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index fc00fafee..45f5bf091 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,6 +19,7 @@ #include #include "timers.h" #include "hashcomp.h" +#include "version.h" /* Cross OS compatibility macros */ #ifdef _WIN32 @@ -295,6 +296,42 @@ class CoreExport Command char *service; /* Service we provide this command for */ Command *next; }; + +class CoreExport Version +{ + private: + unsigned Major; + unsigned Minor; + unsigned Build; + + public: + /** Constructor + * @param vMajor The major version numbber + * @param vMinor The minor version numbber + * @param vBuild The build version numbber + */ + Version(unsigned vMajor, unsigned vMinor, unsigned vBuild); + + /** Destructor + */ + virtual ~Version(); + + /** Get the major version of Anope this was built against + * @return The major version + */ + const unsigned GetMajor(); + + /** Get the minor version of Anope this was built against + * @return The minor version + */ + const unsigned GetMinor(); + + /** Get the build version this was built against + * @return The build version + */ + const unsigned GetBuild(); +}; + /** Every module in Anope is actually a class. */ class CoreExport Module @@ -362,6 +399,12 @@ class CoreExport Module */ void SetAuthor(const std::string &author); + /** Get the version of Anope this module was + * compiled against + * @return The version + */ + virtual Version GetVersion() { return Version(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); } + /** Add output to NickServ Help. * When doing /msg NickServ HELP, this function will be calloed to allow it to send out * a notice witht he code you wish to display -- cgit