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