]> sigrok.org Git - libsigrok.git/blame - src/version.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / version.c
CommitLineData
787c4390 1/*
50985c20 2 * This file is part of the libsigrok project.
787c4390
UH
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
2ea1fdf1 17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
787c4390
UH
18 */
19
6ec6c43b 20#include <config.h>
5bce22ac
GS
21
22/* Request inclusion of the git version suffix in version.h. */
23#define WANT_LIBSIGROK_GIT_VERSION_H
c1aae900 24#include <libsigrok/libsigrok.h>
787c4390 25
393fb9cb
UH
26/**
27 * @file
28 *
c27e5f1e 29 * Version number querying functions, definitions, and macros.
393fb9cb
UH
30 */
31
7b870c38
UH
32/**
33 * @defgroup grp_versions Versions
34 *
c27e5f1e 35 * Version number querying functions, definitions, and macros.
7b870c38 36 *
9fb5f2df
UH
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 *
7b870c38
UH
49 * @{
50 */
51
9fb5f2df
UH
52/**
53 * Get the major libsigrok package version number.
54 *
55 * @return The major package version number.
56 *
57 * @since 0.1.0
58 */
787c4390
UH
59SR_API int sr_package_version_major_get(void)
60{
61 return SR_PACKAGE_VERSION_MAJOR;
62}
63
9fb5f2df
UH
64/**
65 * Get the minor libsigrok package version number.
66 *
67 * @return The minor package version number.
68 *
69 * @since 0.1.0
70 */
787c4390
UH
71SR_API int sr_package_version_minor_get(void)
72{
73 return SR_PACKAGE_VERSION_MINOR;
74}
75
9fb5f2df
UH
76/**
77 * Get the micro libsigrok package version number.
78 *
79 * @return The micro package version number.
80 *
81 * @since 0.1.0
82 */
787c4390
UH
83SR_API int sr_package_version_micro_get(void)
84{
85 return SR_PACKAGE_VERSION_MICRO;
86}
87
9fb5f2df
UH
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 */
787c4390
UH
96SR_API const char *sr_package_version_string_get(void)
97{
98 return SR_PACKAGE_VERSION_STRING;
99}
100
9fb5f2df
UH
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 */
787c4390
UH
108SR_API int sr_lib_version_current_get(void)
109{
110 return SR_LIB_VERSION_CURRENT;
111}
112
9fb5f2df
UH
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 */
787c4390
UH
120SR_API int sr_lib_version_revision_get(void)
121{
122 return SR_LIB_VERSION_REVISION;
123}
124
9fb5f2df
UH
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 */
787c4390
UH
132SR_API int sr_lib_version_age_get(void)
133{
134 return SR_LIB_VERSION_AGE;
135}
136
9fb5f2df
UH
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 */
787c4390
UH
145SR_API const char *sr_lib_version_string_get(void)
146{
147 return SR_LIB_VERSION_STRING;
148}
7b870c38
UH
149
150/** @} */