summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h43
1 files changed, 43 insertions, 0 deletions
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 <stdio.h>
#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