Line data Source code
1 : // Copyright (c) 2013-2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/snaplogger
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 :
20 : /** \file
21 : * \brief The version of the snaplogger at compile time.
22 : *
23 : * This file records the snaplogger library version at compile time.
24 : *
25 : * The `#define` give you the library version at the time you are compiling.
26 : * The functions allow you to retrieve the version of a dynamically linked
27 : * library.
28 : */
29 :
30 : // self
31 : //
32 : #include "snaplogger/version.h"
33 :
34 :
35 : // last include
36 : //
37 : #include <snapdev/poison.h>
38 :
39 :
40 :
41 : namespace snaplogger
42 : {
43 :
44 :
45 :
46 :
47 : /** \brief Get the major version of the library
48 : *
49 : * This function returns the major version of the running library (the
50 : * one you are linked against at runtime).
51 : *
52 : * \return The major version.
53 : */
54 1 : int get_major_version()
55 : {
56 1 : return SNAPLOGGER_VERSION_MAJOR;
57 : }
58 :
59 :
60 : /** \brief Get the minor version of the library.
61 : *
62 : * This function returns the minor version of the running library
63 : * (the one you are linked against at runtime).
64 : *
65 : * \return The release version.
66 : */
67 1 : int get_release_version()
68 : {
69 1 : return SNAPLOGGER_VERSION_MINOR;
70 : }
71 :
72 :
73 : /** \brief Get the patch version of the library.
74 : *
75 : * This function returns the patch version of the running library
76 : * (the one you are linked against at runtime).
77 : *
78 : * \return The patch version.
79 : */
80 1 : int get_patch_version()
81 : {
82 1 : return SNAPLOGGER_VERSION_PATCH;
83 : }
84 :
85 :
86 : /** \brief Get the full version of the library as a string.
87 : *
88 : * This function returns the major, minor, and patch versions of the
89 : * running library (the one you are linked against at runtime) in the
90 : * form of a string.
91 : *
92 : * The build version is not made available. In most cases we change
93 : * the build version only to run a new build, so not code will have
94 : * changed (some documentation and non-code files may changed between
95 : * build versions; but the code will work exactly the same way.)
96 : *
97 : * \return The library version.
98 : */
99 1 : char const * get_version_string()
100 : {
101 1 : return SNAPLOGGER_VERSION_STRING;
102 : }
103 :
104 :
105 : } // snaplogger namespace
106 : // vim: ts=4 sw=4 et
|