Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 1 | /* |
Uwe Hermann | 50bd5d2 | 2013-04-23 22:27:20 +0200 | [diff] [blame] | 2 | * This file is part of the libsigrokdecode project. |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 3 | * |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 4 | * Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de> |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 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, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
Uwe Hermann | c1f86f0 | 2013-05-03 14:49:21 +0200 | [diff] [blame] | 21 | #include "libsigrokdecode.h" |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 22 | |
Uwe Hermann | 54fdeee | 2013-02-09 22:10:57 +0100 | [diff] [blame] | 23 | /** |
| 24 | * @file |
| 25 | * |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 26 | * Version number querying functions, definitions, and macros. |
Uwe Hermann | 54fdeee | 2013-02-09 22:10:57 +0100 | [diff] [blame] | 27 | */ |
| 28 | |
Uwe Hermann | 4895418 | 2013-02-09 22:25:15 +0100 | [diff] [blame] | 29 | /** |
| 30 | * @defgroup grp_versions Versions |
| 31 | * |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 32 | * Version number querying functions, definitions, and macros. |
| 33 | * |
| 34 | * This set of API calls returns two different version numbers related |
| 35 | * to libsigrokdecode. The "package version" is the release version number |
| 36 | * of the libsigrokdecode tarball in the usual "major.minor.micro" format, |
| 37 | * e.g. "0.1.0". |
| 38 | * |
| 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. |
| 42 | * |
| 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. |
Uwe Hermann | 4895418 | 2013-02-09 22:25:15 +0100 | [diff] [blame] | 46 | * |
| 47 | * @{ |
| 48 | */ |
| 49 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 50 | /** |
| 51 | * Get the major libsigrokdecode package version number. |
| 52 | * |
| 53 | * @return The major package version number. |
| 54 | * |
| 55 | * @since 0.1.0 |
| 56 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 57 | SRD_API int srd_package_version_major_get(void) |
| 58 | { |
| 59 | return SRD_PACKAGE_VERSION_MAJOR; |
| 60 | } |
| 61 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 62 | /** |
| 63 | * Get the minor libsigrokdecode package version number. |
| 64 | * |
| 65 | * @return The minor package version number. |
| 66 | * |
| 67 | * @since 0.1.0 |
| 68 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 69 | SRD_API int srd_package_version_minor_get(void) |
| 70 | { |
| 71 | return SRD_PACKAGE_VERSION_MINOR; |
| 72 | } |
| 73 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 74 | /** |
| 75 | * Get the micro libsigrokdecode package version number. |
| 76 | * |
| 77 | * @return The micro package version number. |
| 78 | * |
| 79 | * @since 0.1.0 |
| 80 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 81 | SRD_API int srd_package_version_micro_get(void) |
| 82 | { |
| 83 | return SRD_PACKAGE_VERSION_MICRO; |
| 84 | } |
| 85 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 86 | /** |
| 87 | * Get the libsigrokdecode package version number as a string. |
| 88 | * |
| 89 | * @return The package version number string. The returned string is |
| 90 | * static and thus should NOT be free'd by the caller. |
| 91 | * |
| 92 | * @since 0.1.0 |
| 93 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 94 | SRD_API const char *srd_package_version_string_get(void) |
| 95 | { |
| 96 | return SRD_PACKAGE_VERSION_STRING; |
| 97 | } |
| 98 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 99 | /** |
| 100 | * Get the "current" part of the libsigrokdecode library version number. |
| 101 | * |
| 102 | * @return The "current" library version number. |
| 103 | * |
| 104 | * @since 0.1.0 |
| 105 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 106 | SRD_API int srd_lib_version_current_get(void) |
| 107 | { |
| 108 | return SRD_LIB_VERSION_CURRENT; |
| 109 | } |
| 110 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 111 | /** |
| 112 | * Get the "revision" part of the libsigrokdecode library version number. |
| 113 | * |
| 114 | * @return The "revision" library version number. |
| 115 | * |
| 116 | * @since 0.1.0 |
| 117 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 118 | SRD_API int srd_lib_version_revision_get(void) |
| 119 | { |
| 120 | return SRD_LIB_VERSION_REVISION; |
| 121 | } |
| 122 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 123 | /** |
| 124 | * Get the "age" part of the libsigrokdecode library version number. |
| 125 | * |
| 126 | * @return The "age" library version number. |
| 127 | * |
| 128 | * @since 0.1.0 |
| 129 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 130 | SRD_API int srd_lib_version_age_get(void) |
| 131 | { |
| 132 | return SRD_LIB_VERSION_AGE; |
| 133 | } |
| 134 | |
Uwe Hermann | 8c664ca | 2013-05-03 14:45:49 +0200 | [diff] [blame] | 135 | /** |
| 136 | * Get the libsigrokdecode library version number as a string. |
| 137 | * |
| 138 | * @return The library version number string. The returned string is |
| 139 | * static and thus should NOT be free'd by the caller. |
| 140 | * |
| 141 | * @since 0.1.0 |
| 142 | */ |
Uwe Hermann | 0c081c6 | 2012-04-15 20:58:08 +0200 | [diff] [blame] | 143 | SRD_API const char *srd_lib_version_string_get(void) |
| 144 | { |
| 145 | return SRD_LIB_VERSION_STRING; |
| 146 | } |
Uwe Hermann | 4895418 | 2013-02-09 22:25:15 +0100 | [diff] [blame] | 147 | |
| 148 | /** @} */ |