2 * This file is part of the libsigrok project.
4 * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <libsigrok/libsigrok.h>
27 * Version number querying functions, definitions, and macros.
31 * @defgroup grp_versions Versions
33 * Version number querying functions, definitions, and macros.
35 * This set of API calls returns two different version numbers related
36 * to libsigrok. The "package version" is the release version number of the
37 * libsigrok tarball in the usual "major.minor.micro" format, e.g. "0.1.0".
39 * The "library version" is independent of that; it is the libtool version
40 * number in the "current:revision:age" format, e.g. "2:0:0".
41 * See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning for details.
43 * Both version numbers (and/or individual components of them) can be
44 * retrieved via the API calls at runtime, and/or they can be checked at
45 * compile/preprocessor time using the respective macros.
51 * Get the major libsigrok package version number.
53 * @return The major package version number.
57 SR_API int sr_package_version_major_get(void)
59 return SR_PACKAGE_VERSION_MAJOR;
63 * Get the minor libsigrok package version number.
65 * @return The minor package version number.
69 SR_API int sr_package_version_minor_get(void)
71 return SR_PACKAGE_VERSION_MINOR;
75 * Get the micro libsigrok package version number.
77 * @return The micro package version number.
81 SR_API int sr_package_version_micro_get(void)
83 return SR_PACKAGE_VERSION_MICRO;
87 * Get the libsigrok package version number as a string.
89 * @return The package version number string. The returned string is
90 * static and thus should NOT be free'd by the caller.
94 SR_API const char *sr_package_version_string_get(void)
96 return SR_PACKAGE_VERSION_STRING;
100 * Get the "current" part of the libsigrok library version number.
102 * @return The "current" library version number.
106 SR_API int sr_lib_version_current_get(void)
108 return SR_LIB_VERSION_CURRENT;
112 * Get the "revision" part of the libsigrok library version number.
114 * @return The "revision" library version number.
118 SR_API int sr_lib_version_revision_get(void)
120 return SR_LIB_VERSION_REVISION;
124 * Get the "age" part of the libsigrok library version number.
126 * @return The "age" library version number.
130 SR_API int sr_lib_version_age_get(void)
132 return SR_LIB_VERSION_AGE;
136 * Get the libsigrok library version number as a string.
138 * @return The library version number string. The returned string is
139 * static and thus should NOT be free'd by the caller.
143 SR_API const char *sr_lib_version_string_get(void)
145 return SR_LIB_VERSION_STRING;