]> sigrok.org Git - libsigrok.git/blob - src/version.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / version.c
1 /*
2  * This file is part of the libsigrok project.
3  *
4  * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
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
17  * along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #include <config.h>
21
22 /* Request inclusion of the git version suffix in version.h. */
23 #define WANT_LIBSIGROK_GIT_VERSION_H
24 #include <libsigrok/libsigrok.h>
25
26 /**
27  * @file
28  *
29  * Version number querying functions, definitions, and macros.
30  */
31
32 /**
33  * @defgroup grp_versions Versions
34  *
35  * Version number querying functions, definitions, and macros.
36  *
37  * This set of API calls returns two different version numbers related
38  * to libsigrok. The "package version" is the release version number of the
39  * libsigrok tarball in the usual "major.minor.micro" format, e.g. "0.1.0".
40  *
41  * The "library version" is independent of that; it is the libtool version
42  * number in the "current:revision:age" format, e.g. "2:0:0".
43  * See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning for details.
44  *
45  * Both version numbers (and/or individual components of them) can be
46  * retrieved via the API calls at runtime, and/or they can be checked at
47  * compile/preprocessor time using the respective macros.
48  *
49  * @{
50  */
51
52 /**
53  * Get the major libsigrok package version number.
54  *
55  * @return The major package version number.
56  *
57  * @since 0.1.0
58  */
59 SR_API int sr_package_version_major_get(void)
60 {
61         return SR_PACKAGE_VERSION_MAJOR;
62 }
63
64 /**
65  * Get the minor libsigrok package version number.
66  *
67  * @return The minor package version number.
68  *
69  * @since 0.1.0
70  */
71 SR_API int sr_package_version_minor_get(void)
72 {
73         return SR_PACKAGE_VERSION_MINOR;
74 }
75
76 /**
77  * Get the micro libsigrok package version number.
78  *
79  * @return The micro package version number.
80  *
81  * @since 0.1.0
82  */
83 SR_API int sr_package_version_micro_get(void)
84 {
85         return SR_PACKAGE_VERSION_MICRO;
86 }
87
88 /**
89  * Get the libsigrok package version number as a string.
90  *
91  * @return The package version number string. The returned string is
92  *         static and thus should NOT be free'd by the caller.
93  *
94  * @since 0.1.0
95  */
96 SR_API const char *sr_package_version_string_get(void)
97 {
98         return SR_PACKAGE_VERSION_STRING;
99 }
100
101 /**
102  * Get the "current" part of the libsigrok library version number.
103  *
104  * @return The "current" library version number.
105  *
106  * @since 0.1.0
107  */
108 SR_API int sr_lib_version_current_get(void)
109 {
110         return SR_LIB_VERSION_CURRENT;
111 }
112
113 /**
114  * Get the "revision" part of the libsigrok library version number.
115  *
116  * @return The "revision" library version number.
117  *
118  * @since 0.1.0
119  */
120 SR_API int sr_lib_version_revision_get(void)
121 {
122         return SR_LIB_VERSION_REVISION;
123 }
124
125 /**
126  * Get the "age" part of the libsigrok library version number.
127  *
128  * @return The "age" library version number.
129  *
130  * @since 0.1.0
131  */
132 SR_API int sr_lib_version_age_get(void)
133 {
134         return SR_LIB_VERSION_AGE;
135 }
136
137 /**
138  * Get the libsigrok library version number as a string.
139  *
140  * @return The library version number string. The returned string is
141  *         static and thus should NOT be free'd by the caller.
142  *
143  * @since 0.1.0
144  */
145 SR_API const char *sr_lib_version_string_get(void)
146 {
147         return SR_LIB_VERSION_STRING;
148 }
149
150 /** @} */