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 20250101
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#define A_VERSION_4(major, minor, third, extra) {major, minor, third, extra, {'.', 0, 0, 0}}
55#if defined(__cplusplus)
82A_EXTERN
int a_version_check(
unsigned int major,
unsigned int minor,
unsigned int patch);
83#define A_VERSION_CHECK() a_version_check(A_VERSION_MAJOR, A_VERSION_MINOR, A_VERSION_PATCH)
175#if defined(__cplusplus)
189#if defined(__cplusplus)
190 A_INLINE
void alpha(
char str[5])
const
194 A_INLINE
void set_alpha(
char const *str)
198 A_INLINE
unsigned int parse(
char const *ver)
202 A_INLINE
unsigned int tostr(
void *p,
a_size n)
const
206 A_INLINE
bool operator<(a_version
const &ver)
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
int cmp(a_version
const &ver)
const
int a_version_check(unsigned int major, unsigned int minor, unsigned int patch)
algorithm library version check
a_u32 const a_version_tweak
Definition version.h:70
unsigned int a_version_parse(a_version *ctx, char const *ver)
parse version string to version
unsigned int a_version_tostr(a_version const *ctx, void *pdata, a_size nbyte)
convert version to string
unsigned int const a_version_major
Definition version.h:64
unsigned int const a_version_minor
Definition version.h:66
a_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
int a_version_cmp(a_version const *lhs, a_version const *rhs)
compare the version lhs with the version rhs
a_bool a_version_ge(a_version const *lhs, a_version const *rhs)
version lhs is greater than or equal to version rhs
a_bool a_version_gt(a_version const *lhs, a_version const *rhs)
version lhs is greater than version rhs
void a_version_alpha(a_version const *ctx, char alpha[5])
get alphabet for version
a_bool a_version_ne(a_version const *lhs, a_version const *rhs)
version lhs is not equal to version rhs
a_bool a_version_lt(a_version const *lhs, a_version const *rhs)
version lhs is less than version rhs
unsigned int const a_version_patch
Definition version.h:68
a_bool a_version_le(a_version const *lhs, a_version const *rhs)
version lhs is less than or equal to version rhs
bool a_bool
type, capable of holding one of the two values: 1 and 0
Definition a.h:320
unsigned long a_u32
unsigned integer type with width of exactly 32 bits
Definition a.h:538
size_t a_size
unsigned integer type returned by the sizeof operator
Definition a.h:823
instance structure for version
Definition version.h:183
unsigned int extra
Definition version.h:187
char alpha_[4]
Definition version.h:188
unsigned int minor
Definition version.h:185
unsigned int major
Definition version.h:184
unsigned int third
Definition version.h:186