ubjsc
0.5
Enterprise-grade C library for manipulating UBJSON
|
God-file that includes everything from ubjs and mechanisms to verify version. More...
#include "ubjs_common.h"
#include "ubjs_primitives.h"
#include "ubjs_parser.h"
#include "ubjs_writer.h"
Go to the source code of this file.
Macros | |
#define | UBJS_VERSION 0x000500 |
Library version from the time your project got compiled. More... | |
Functions | |
UBJS_EXPORT void | ubjs_get_version (unsigned long *pversion) |
Gets library runtime version. More... | |
UBJS_EXPORT void | ubjs_is_compatible (unsigned long version, ubjs_bool *pret) |
Compares library runtime version with supplied. More... | |
God-file that includes everything from ubjs and mechanisms to verify version.
#define UBJS_VERSION 0x000500 |
Library version from the time your project got compiled.
This numbering follows the semantic versioning scheme, in this manner:
UBJS_VERSION = dec(MAJOR) << 16 + dec(MINOR) << 8 + dec(PATCH)
For example, if it ever happens here, 0x112233 equals to version 11.22.33.
Referenced by ubjs_get_version(), and ubjs_is_compatible().
UBJS_EXPORT void ubjs_get_version | ( | unsigned long * | pversion | ) |
Gets library runtime version.
Use this to get the version of the library runtime. After this returns, it is guaranteed that (*pversion) gets a value.
pversion | Pointer under which to place library version. |
References UBJS_VERSION.
UBJS_EXPORT void ubjs_is_compatible | ( | unsigned long | version, |
ubjs_bool * | pret | ||
) |
Compares library runtime version with supplied.
Use this to verify whether your project is compatible with current library runtime. In general, ubjs follows semantic versioning scheme.
After this returns, it is guaranteed that (*pret) is equal to either UTRUE/UFALSE, depending on these conditions:
If the minors are 0, and the minors match, UTRUE, else UFALSE.
Aka your code built with version 0.1.0 is compatible with library runtime 0.1.2, but 0.1.0 is not compatible with 0.2.0.
Otherwise if the majors match, UTRUE, else UFALSE.
Aka 1.0.0 and 1.2.0 are good. The newer library probably will have more features than the one used in your project at the time of compilation. But 2.0.0 and 3.0.0 are not compatible. The API changed and you must either fallback to older version, or realign your code to fit the new library.
version | Pointer under which to place library version. |
pret | Pointer under which to place the result. |
References UBJS_VERSION, UFALSE, and UTRUE.