libonion
|
Macros | |
#define | ONION_VERSION_IS_COMPATIBLE() |
Macro to ensure that the version of onion your program is using is ABI compatible with the library one. | |
#define | ONION_VERSION_IS_COMPATIBLE_OR_ABORT() |
Macro to ensure that the version of onion your program is using is ABI compatible with the library one. It aborts if its not compatible. |
Functions | |
const char * | onion_version () |
Current running onion version as a string. | |
int | onion_version_major () |
Current running onion major version. | |
int | onion_version_minor () |
Current running onion minor version. | |
int | onion_version_patch () |
Patch version of the current release. | |
bool | onion_version_is_compatible3 (int major, int minor, int patch) |
Checks a specific set of major.minor.patch and returns if the current using onion is ABI compatible. |
Onion runtime version control
This version control functions can be used to control if current runtime is compatible with the onion library in use.
Normal use is call the macro:
at the begining of your program, which will ensure the current running program was compiled with a compatible onion version to the runtime one, or will call abort()
#define ONION_VERSION_IS_COMPATIBLE | ( | ) |
Macro to ensure that the version of onion your program is using is ABI compatible with the library one.
#define ONION_VERSION_IS_COMPATIBLE_OR_ABORT | ( | ) |
Macro to ensure that the version of onion your program is using is ABI compatible with the library one. It aborts if its not compatible.
const char* onion_version | ( | ) |
Current running onion version as a string.
bool onion_version_is_compatible3 | ( | int | major, |
int | minor, | ||
int | patch | ||
) |
Checks a specific set of major.minor.patch and returns if the current using onion is ABI compatible.
Onion uses SEMVER (http://semver.org/), and with this simple function its possible to check if your compiled code is compatible with the onion version.
It also allows to in the rare case that there is some really bad version of onion to warn the users.
Normally users need just to add a onion_version_is_compatible() check, and if not compatible abort:
if (!onion_version_is_compatible()) abort();
References ONION_DEBUG.
int onion_version_major | ( | ) |
Current running onion major version.
int onion_version_minor | ( | ) |
Current running onion minor version.
int onion_version_patch | ( | ) |
Patch version of the current release.
If on a dirty git version (not tagged), it will return 1000