18#ifndef A_VERSION_MAJOR
19#define A_VERSION_MAJOR 0
24#ifndef A_VERSION_MINOR
25#define A_VERSION_MINOR 1
30#ifndef A_VERSION_PATCH
31#define A_VERSION_PATCH 15
36#ifndef A_VERSION_TWEAK
37#define A_VERSION_TWEAK 20240930
40#define A_VERSION_TOSTR(X) A_CAST_1(X)
43#define A_VERSION A_VERSION_TOSTR(A_VERSION_MAJOR) "." A_VERSION_TOSTR(A_VERSION_MINOR) "." A_VERSION_TOSTR(A_VERSION_PATCH)
47#define A_VERSION_0() A_VERSION_1(0)
48#define A_VERSION_1(major) A_VERSION_2(major, 0)
49#define A_VERSION_2(major, minor) A_VERSION_3(major, minor, 0)
50#define A_VERSION_3(major, minor, third) A_VERSION_4(major, minor, third, 0)
52#if defined(__cplusplus)
53#define A_VERSION_4(major, minor, third, extra) {major, minor, third, extra, {'.', 0, 0, 0}}
55#define A_VERSION_4(major, minor, third, extra) (a_version){major, minor, third, extra, {'.', 0, 0, 0}}
59#if defined(__cplusplus)
86A_EXTERN
int a_version_check(
unsigned int major,
unsigned int minor,
unsigned int patch);
87#define A_VERSION_CHECK() a_version_check(A_VERSION_MAJOR, A_VERSION_MINOR, A_VERSION_PATCH)
179#if defined(__cplusplus)
193#if defined(__cplusplus)
194 A_INLINE
void alpha(
char str[5])
const
198 A_INLINE
void set_alpha(
char const *str)
202 A_INLINE
unsigned int parse(
char const *ver)
206 A_INLINE
unsigned int tostr(
void *p,
a_size n)
const
210 A_INLINE
bool operator<(
a_version const &ver)
const
214 A_INLINE
bool operator>(
a_version const &ver)
const
218 A_INLINE
bool operator<=(
a_version const &ver)
const
222 A_INLINE
bool operator>=(
a_version const &ver)
const
226 A_INLINE
bool operator==(
a_version const &ver)
const
230 A_INLINE
bool operator!=(
a_version const &ver)
const
234 A_INLINE
int cmp(
a_version const &ver)
const
int a_version_check(unsigned int major, unsigned int minor, unsigned int patch)
algorithm library version check
unsigned int a_version_parse(a_version *ctx, char const *ver)
parse version string to version
unsigned int const a_version_major
Definition version.h:68
unsigned int const a_version_minor
Definition version.h:70
bool a_version_eq(a_version const *lhs, a_version const *rhs)
version lhs is equal to version rhs
void a_version_set_alpha(a_version *ctx, char const *alpha)
set alphabet for version
bool a_version_gt(a_version const *lhs, a_version const *rhs)
version lhs is greater than version rhs
int a_version_cmp(a_version const *lhs, a_version const *rhs)
compare the version lhs with the version rhs
bool a_version_ne(a_version const *lhs, a_version const *rhs)
version lhs is not equal to version rhs
void a_version_alpha(a_version const *ctx, char alpha[5])
get alphabet for version
bool a_version_le(a_version const *lhs, a_version const *rhs)
version lhs is less than or equal to version rhs
unsigned int const a_version_patch
Definition version.h:72
uint32_t const a_version_tweak
Definition version.h:74
bool a_version_lt(a_version const *lhs, a_version const *rhs)
version lhs is less than version rhs
unsigned int a_version_tostr(a_version const *ctx, void *pdata, size_t nbyte)
convert version to string
bool a_version_ge(a_version const *lhs, a_version const *rhs)
version lhs is greater than or equal to version rhs
#define a_size
Definition a.h:610
#define a_bool
Definition a.h:302
#define a_u32
Definition a.h:490
instance structure for version
Definition version.h:187
unsigned int extra
extra number
Definition version.h:191
char alpha_[4]
alphabet
Definition version.h:192
unsigned int minor
minor number
Definition version.h:189
unsigned int major
major number
Definition version.h:188
unsigned int third
third number
Definition version.h:190