Botan 1.10.17

version.cpp
Go to the documentation of this file.
1 /*
2 * Version Information
3 * (C) 1999-2011 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #include <botan/version.h>
9 #include <botan/parsing.h>
10 #include <sstream>
11
12 namespace Botan {
13
14 /*
15 These are intentionally compiled rather than inlined, so an
16 application running against a shared library can test the true
17 version they are running against.
18 */
19
20 /*
21 * Return the version as a string
22 */
23 std::string version_string()
24 {
25 #define QUOTE(name) #name
26 #define STR(macro) QUOTE(macro)
27
28 return "Botan " STR(BOTAN_VERSION_MAJOR) "."
29 STR(BOTAN_VERSION_MINOR) "."
30 STR(BOTAN_VERSION_PATCH) " ("
31
32 #if (BOTAN_VERSION_DATESTAMP == 0)
33 "unreleased version"
34 #else
35 "released " STR(BOTAN_VERSION_DATESTAMP)
36 #endif
37 ", revision " BOTAN_VERSION_VC_REVISION
38 ", distribution " BOTAN_DISTRIBUTION_INFO ")";
39
40 #undef STR
41 #undef QUOTE
42 }
43
44 u32bit version_datestamp() { return BOTAN_VERSION_DATESTAMP; }
45
46 /*
47 * Return parts of the version as integers
48 */
49 u32bit version_major() { return BOTAN_VERSION_MAJOR; }
50 u32bit version_minor() { return BOTAN_VERSION_MINOR; }
51 u32bit version_patch() { return BOTAN_VERSION_PATCH; }
52
53 }
Botan::version_major
u32bit version_major()
Definition: version.cpp:49
STR
#define STR(macro)
Botan::version_string
std::string version_string()
Definition: version.cpp:23
Botan::version_datestamp
u32bit version_datestamp()
Definition: version.cpp:44
Botan
Definition: algo_base.h:14
Botan::version_patch
u32bit version_patch()
Definition: version.cpp:51
Botan::version_minor
u32bit version_minor()
Definition: version.cpp:50
Botan::u32bit
unsigned int u32bit
Definition: types.h:32