summaryrefslogtreecommitdiffstats
path: root/old/botan/src/utils/version.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'old/botan/src/utils/version.cpp')
-rw-r--r--old/botan/src/utils/version.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/old/botan/src/utils/version.cpp b/old/botan/src/utils/version.cpp
new file mode 100644
index 0000000..d540864
--- /dev/null
+++ b/old/botan/src/utils/version.cpp
@@ -0,0 +1,36 @@
+/*
+* Version Information
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#include <botan/version.h>
+#include <botan/parsing.h>
+
+namespace Botan {
+
+/*
+ These are intentionally compiled rather than inlined, so an
+ application running against a shared library can test the true
+ version they are running against.
+*/
+
+/*
+* Return the version as a string
+*/
+std::string version_string()
+ {
+ return to_string(version_major()) + "." +
+ to_string(version_minor()) + "." +
+ to_string(version_patch());
+ }
+
+/*
+* Return parts of the version as integers
+*/
+u32bit version_major() { return BOTAN_VERSION_MAJOR; }
+u32bit version_minor() { return BOTAN_VERSION_MINOR; }
+u32bit version_patch() { return BOTAN_VERSION_PATCH; }
+
+}