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 :
23 : /** \file
24 : * \brief The version of the event dispatcher at compile time.
25 : *
26 : * This file records the event dispatcher library version at compile time.
27 : *
28 : * The `#define` give you the library version at the time you are compiling.
29 : * The functions allow you to retrieve the version of a dynamically linked
30 : * library.
31 : */
32 :
33 : // self
34 : //
35 : #include "eventdispatcher/version.h"
36 :
37 :
38 : // last include
39 : //
40 : #include <snapdev/poison.h>
41 :
42 :
43 :
44 : namespace ed
45 : {
46 :
47 :
48 :
49 :
50 : /** \brief Get the major version of the library
51 : *
52 : * This function returns the major version of the running library (the
53 : * one you are linked against at runtime).
54 : *
55 : * \return The major version.
56 : */
57 1 : int get_major_version()
58 : {
59 1 : return EVENTDISPATCHER_VERSION_MAJOR;
60 : }
61 :
62 :
63 : /** \brief Get the minor version of the library.
64 : *
65 : * This function returns the minor version of the running library
66 : * (the one you are linked against at runtime).
67 : *
68 : * \return The release version.
69 : */
70 1 : int get_release_version()
71 : {
72 1 : return EVENTDISPATCHER_VERSION_MINOR;
73 : }
74 :
75 :
76 : /** \brief Get the patch version of the library.
77 : *
78 : * This function returns the patch version of the running library
79 : * (the one you are linked against at runtime).
80 : *
81 : * \return The patch version.
82 : */
83 1 : int get_patch_version()
84 : {
85 1 : return EVENTDISPATCHER_VERSION_PATCH;
86 : }
87 :
88 :
89 : /** \brief Get the full version of the library as a string.
90 : *
91 : * This function returns the major, minor, and patch versions of the
92 : * running library (the one you are linked against at runtime) in the
93 : * form of a string.
94 : *
95 : * The build version is not made available. In most cases we change
96 : * the build version only to run a new build, so not code will have
97 : * changed (some documentation and non-code files may changed between
98 : * build versions; but the code will work exactly the same way.)
99 : *
100 : * \return The library version.
101 : */
102 1 : char const * get_version_string()
103 : {
104 1 : return EVENTDISPATCHER_VERSION_STRING;
105 : }
106 :
107 :
108 : } // namespace ed
109 : // vim: ts=4 sw=4 et
|