ubjsc  0.6
Enterprise-grade C library for manipulating UBJSON
Macros | Functions
ubjs.h File Reference

Enterprise grade-wannabe C library for manipulating data in UBJSON format. 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"
Include dependency graph for ubjs.h:

Go to the source code of this file.

Macros

#define UBJS_VERSION   0x000600
 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...
 

Detailed Description

Enterprise grade-wannabe C library for manipulating data in UBJSON format. God-file that includes everything from ubjs and mechanisms to verify version.

Since
0.2

Macro Definition Documentation

◆ UBJS_VERSION

#define UBJS_VERSION   0x000600

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.

Since
0.2

Referenced by ubjs_get_version(), and ubjs_is_compatible().

Function Documentation

◆ ubjs_get_version()

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.

Parameters
pversionPointer under which to place library version.
Since
0.2

References UBJS_VERSION.

◆ ubjs_is_compatible()

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.

Parameters
versionPointer under which to place library version.
pretPointer under which to place the result.
Since
0.2

References UBJS_VERSION, UFALSE, and UTRUE.