diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-08 11:24:42 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-09 10:05:12 +0100 |
commit | 59075ba325dc91d3fa7760c6b84df0de7854ae7f (patch) | |
tree | 042af231d352182f7abd8ea66b06edc78ab6b790 /toxcore/tox.h | |
parent | 3521898b0cbf398d882496f6382f6c4ea1c23bc1 (diff) |
Use `const` for version numbers.
ApiDSL generates the lowercase function declarations for us and puts them in the
right namespace (TOX_, TOXAV_).
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 3747e228..f0e0b48c 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -158,21 +158,31 @@ typedef struct Tox Tox; | |||
158 | /** | 158 | /** |
159 | * The major version number. Incremented when the API or ABI changes in an | 159 | * The major version number. Incremented when the API or ABI changes in an |
160 | * incompatible way. | 160 | * incompatible way. |
161 | * | ||
162 | * The function variants of these constants return the version number of the | ||
163 | * library. They can be used to display the Tox library version or to check | ||
164 | * whether the client is compatible with the dynamically linked version of Tox. | ||
161 | */ | 165 | */ |
162 | #define TOX_VERSION_MAJOR 0u | 166 | #define TOX_VERSION_MAJOR 0 |
167 | |||
168 | uint32_t tox_version_major(void); | ||
163 | 169 | ||
164 | /** | 170 | /** |
165 | * The minor version number. Incremented when functionality is added without | 171 | * The minor version number. Incremented when functionality is added without |
166 | * breaking the API or ABI. Set to 0 when the major version number is | 172 | * breaking the API or ABI. Set to 0 when the major version number is |
167 | * incremented. | 173 | * incremented. |
168 | */ | 174 | */ |
169 | #define TOX_VERSION_MINOR 0u | 175 | #define TOX_VERSION_MINOR 0 |
176 | |||
177 | uint32_t tox_version_minor(void); | ||
170 | 178 | ||
171 | /** | 179 | /** |
172 | * The patch or revision number. Incremented when bugfixes are applied without | 180 | * The patch or revision number. Incremented when bugfixes are applied without |
173 | * changing any functionality or API or ABI. | 181 | * changing any functionality or API or ABI. |
174 | */ | 182 | */ |
175 | #define TOX_VERSION_PATCH 0u | 183 | #define TOX_VERSION_PATCH 0 |
184 | |||
185 | uint32_t tox_version_patch(void); | ||
176 | 186 | ||
177 | /** | 187 | /** |
178 | * A macro to check at preprocessing time whether the client code is compatible | 188 | * A macro to check at preprocessing time whether the client code is compatible |
@@ -192,23 +202,6 @@ typedef struct Tox Tox; | |||
192 | typedef char tox_required_version[TOX_IS_COMPATIBLE(MAJOR, MINOR, PATCH) ? 1 : -1] | 202 | typedef char tox_required_version[TOX_IS_COMPATIBLE(MAJOR, MINOR, PATCH) ? 1 : -1] |
193 | 203 | ||
194 | /** | 204 | /** |
195 | * Return the major version number of the library. Can be used to display the | ||
196 | * Tox library version or to check whether the client is compatible with the | ||
197 | * dynamically linked version of Tox. | ||
198 | */ | ||
199 | uint32_t tox_version_major(void); | ||
200 | |||
201 | /** | ||
202 | * Return the minor version number of the library. | ||
203 | */ | ||
204 | uint32_t tox_version_minor(void); | ||
205 | |||
206 | /** | ||
207 | * Return the patch number of the library. | ||
208 | */ | ||
209 | uint32_t tox_version_patch(void); | ||
210 | |||
211 | /** | ||
212 | * Return whether the compiled library version is compatible with the passed | 205 | * Return whether the compiled library version is compatible with the passed |
213 | * version numbers. | 206 | * version numbers. |
214 | */ | 207 | */ |