Botan: src/utils/version.h Source File

Botan 1.10.16

version.h
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 #ifndef BOTAN_VERSION_H__
9 #define BOTAN_VERSION_H__
10
11 #include <botan/types.h>
12 #include <string>
13
14 namespace Botan {
15
16 /*
17 * Get information describing the version
18 */
19
20 /**
21 * Get a human-readable string identifying the version of Botan.
22 * No particular format should be assumed.
23 * @return version string
24 */
25 BOTAN_DLL std::string version_string();
26
27 /**
28 * Return the date this version of botan was released, in an integer of
29 * the form YYYYMMDD. For instance a version released on May 21, 2013
30 * would return the integer 20130521. If the currently running version
31 * is not an official release, this function will return 0 instead.
32 *
33 * @return release date, or zero if unreleased
34 */
35 BOTAN_DLL u32bit version_datestamp();
36
37 /**
38 * Get the major version number.
39 * @return major version number
40 */
41 BOTAN_DLL u32bit version_major();
42
43 /**
44 * Get the minor version number.
45 * @return minor version number
46 */
47 BOTAN_DLL u32bit version_minor();
48
49 /**
50 * Get the patch number.
51 * @return patch number
52 */
53 BOTAN_DLL u32bit version_patch();
54
55 /*
56 * Macros for compile-time version checks
57 */
58 #define BOTAN_VERSION_CODE_FOR(a,b,c) ((a << 16) | (b << 8) | (c))
59
60 /**
61 * Compare using BOTAN_VERSION_CODE_FOR, as in
62 * # if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,8,0)
63 * # error "Botan version too old"
64 * # endif
65 */
66 #define BOTAN_VERSION_CODE BOTAN_VERSION_CODE_FOR(BOTAN_VERSION_MAJOR, \
67 BOTAN_VERSION_MINOR, \
68 BOTAN_VERSION_PATCH)
69
70 }
71
72 #endif
Botan::version_major
u32bit version_major()
Definition: version.cpp:49
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