liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
algorithm library version
Collaboration diagram for algorithm library version:

Data Structures

struct  a_version
 instance structure for version More...
 

Macros

#define A_VERSION_MAJOR   0
 
#define A_VERSION_MINOR   1
 
#define A_VERSION_PATCH   15
 
#define A_VERSION_TWEAK   20240930
 
#define A_VERSION_TOSTR(X)
 
#define A_VERSION   A_VERSION_TOSTR(A_VERSION_MAJOR) "." A_VERSION_TOSTR(A_VERSION_MINOR) "." A_VERSION_TOSTR(A_VERSION_PATCH)
 
#define A_VERSION_0()
 
#define A_VERSION_1(major)
 
#define A_VERSION_2(major, minor)
 
#define A_VERSION_3(major, minor, third)
 
#define A_VERSION_4(major, minor, third, extra)
 
#define A_VERSION_CHECK()
 

Typedefs

typedef struct a_version a_version
 

Functions

int a_version_check (unsigned int major, unsigned int minor, unsigned int patch)
 algorithm library version check
 
unsigned int a_version_tostr (a_version const *ctx, void *pdata, size_t nbyte)
 convert version to string
 
unsigned int a_version_parse (a_version *ctx, char const *ver)
 parse version string to version
 
int a_version_cmp (a_version const *lhs, a_version const *rhs)
 compare the version lhs with the version rhs
 
bool a_version_lt (a_version const *lhs, a_version const *rhs)
 version lhs is less than version rhs
 
bool a_version_gt (a_version const *lhs, a_version const *rhs)
 version lhs is greater than version rhs
 
bool a_version_le (a_version const *lhs, a_version const *rhs)
 version lhs is less than or equal to version rhs
 
bool a_version_ge (a_version const *lhs, a_version const *rhs)
 version lhs is greater than or equal to version rhs
 
bool a_version_eq (a_version const *lhs, a_version const *rhs)
 version lhs is equal to 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_set_alpha (a_version *ctx, char const *alpha)
 set alphabet for version
 
void a_version_alpha (a_version const *ctx, char alpha[5])
 get alphabet for version
 

Variables

unsigned int const a_version_major
 
unsigned int const a_version_minor
 
unsigned int const a_version_patch
 
uint32_t const a_version_tweak
 

Detailed Description

Macro Definition Documentation

◆ A_VERSION

#define A_VERSION   A_VERSION_TOSTR(A_VERSION_MAJOR) "." A_VERSION_TOSTR(A_VERSION_MINOR) "." A_VERSION_TOSTR(A_VERSION_PATCH)

algorithm library version string

◆ A_VERSION_0

#define A_VERSION_0 ( )
Value:
A_VERSION_1(0)

◆ A_VERSION_1

#define A_VERSION_1 ( major)
Value:
A_VERSION_2(major, 0)

◆ A_VERSION_2

#define A_VERSION_2 ( major,
minor )
Value:
A_VERSION_3(major, minor, 0)

◆ A_VERSION_3

#define A_VERSION_3 ( major,
minor,
third )
Value:
A_VERSION_4(major, minor, third, 0)

◆ A_VERSION_4

#define A_VERSION_4 ( major,
minor,
third,
extra )
Value:
{major, minor, third, extra, {'.', 0, 0, 0}}

◆ A_VERSION_CHECK

#define A_VERSION_CHECK ( )
Value:
#define A_VERSION_PATCH
Definition version.h:31
int a_version_check(unsigned int major, unsigned int minor, unsigned int patch)
algorithm library version check
#define A_VERSION_MINOR
Definition version.h:25
#define A_VERSION_MAJOR
Definition version.h:19

◆ A_VERSION_MAJOR

#define A_VERSION_MAJOR   0

algorithm library version major

◆ A_VERSION_MINOR

#define A_VERSION_MINOR   1

algorithm library version minor

◆ A_VERSION_PATCH

#define A_VERSION_PATCH   15

algorithm library version patch

◆ A_VERSION_TOSTR

#define A_VERSION_TOSTR ( X)
Value:
A_CAST_1(X)

◆ A_VERSION_TWEAK

#define A_VERSION_TWEAK   20240930

algorithm library version tweak

Function Documentation

◆ a_version_alpha()

void a_version_alpha ( a_version const * ctx,
char alpha[5] )

get alphabet for version

Parameters
[in]ctxpoints to an instance structure for version
[out]alphastring buffer, >sizeof(ctx->alpha)

◆ a_version_check()

int a_version_check ( unsigned int major,
unsigned int minor,
unsigned int patch )

algorithm library version check

Parameters
[in]majorrequired major number
[in]minorrequired minor number
[in]patchrequired patch number
Returns
result of comparison
Return values
<0library version is higher than required version
>0library version is lower than required version
0library version is equal to required version

◆ a_version_cmp()

int a_version_cmp ( a_version const * lhs,
a_version const * rhs )

compare the version lhs with the version rhs

Parameters
[in]lhsversion structure to be compared
[in]rhsversion structure to be compared
Returns
relationship between the versions
Return values
<0version lhs < version rhs
>0version lhs > version rhs
0version lhs == version rhs

◆ a_version_eq()

bool a_version_eq ( a_version const * lhs,
a_version const * rhs )

version lhs is equal to version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_ge()

bool a_version_ge ( a_version const * lhs,
a_version const * rhs )

version lhs is greater than or equal to version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_gt()

bool a_version_gt ( a_version const * lhs,
a_version const * rhs )

version lhs is greater than version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_le()

bool a_version_le ( a_version const * lhs,
a_version const * rhs )

version lhs is less than or equal to version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_lt()

bool a_version_lt ( a_version const * lhs,
a_version const * rhs )

version lhs is less than version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_ne()

bool a_version_ne ( a_version const * lhs,
a_version const * rhs )

version lhs is not equal to version rhs

Parameters
[in]lhsoperand on the left
[in]rhsoperand on the right
Returns
result of comparison

◆ a_version_parse()

unsigned int a_version_parse ( a_version * ctx,
char const * ver )

parse version string to version

Parameters
[in,out]ctxpoints to an instance structure for version
[in]verversion string to be parsed
Returns
number of parsed characters

◆ a_version_set_alpha()

void a_version_set_alpha ( a_version * ctx,
char const * alpha )

set alphabet for version

Parameters
[in,out]ctxpoints to an instance structure for version
[in]alphanew alphabet

◆ a_version_tostr()

unsigned int a_version_tostr ( a_version const * ctx,
void * pdata,
size_t nbyte )

convert version to string

Parameters
[in]ctxpoints to an instance structure for version
[in]pdatapoints to string buffer
[in]nbytelength of string buffer
Returns
number of used characters

Variable Documentation

◆ a_version_major

unsigned int const a_version_major

algorithm library version major

◆ a_version_minor

unsigned int const a_version_minor

algorithm library version minor

◆ a_version_patch

unsigned int const a_version_patch

algorithm library version patch

◆ a_version_tweak

uint32_t const a_version_tweak

algorithm library version tweak