Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Macros | Functions

Files

file  afw_version.h
 Adaptive Framework Version Information.
 

Macros

#define AFW_VERSION_CHECK   afw_version_check(AFW_VERSION_HEX)
 Version check against the version compiled against. More...
 
#define AFW_VERSION_THROW_ERROR_SUPPLIED_HEX_VERSION_IF_NOT_COMPATIBLE(info, compiled_version, xctx)
 Throw error if AFW core is not compatible with the supplied version. More...
 
#define AFW_VERSION_THROW_ERROR_IF_NOT_COMPATIBLE(id_z, xctx)
 Throw error if AFW core is not compatible with the version compiled against. More...
 
#define AFW_VERSION_ABORT_IF_NOT_COMPATIBLE(id_z)
 Abort if AFW core is not compatible with the version compiled against. More...
 

Functions

unsigned int afw_version ()
 
const afw_utf8_tafw_version_string ()
 
const afw_utf8_z_tafw_version_string_z ()
 
const afw_utf8_z_tafw_version_check (unsigned int version)
 Version check. More...
 

Detailed Description

Adaptive Framework uses the semantic versioning scheme. See http://semver.org/.

AFW_VERSION_THROW_ERROR_IF_NOT_COMPATIBLE() or AFW_VERSION_ABORT_IF_NOT_COMPATIBLE should be executed early in the life of Adaptive Framework extensions and applications to ensure compatibility with Adaptive Framework Core (libafw).

Macro Definition Documentation

◆ AFW_VERSION_ABORT_IF_NOT_COMPATIBLE

#define AFW_VERSION_ABORT_IF_NOT_COMPATIBLE (   id_z)
Value:
do { \
const afw_utf8_z_t *msg_z; \
msg_z = AFW_VERSION_CHECK; \
if (msg_z) { \
fprintf(stderr, "%s %s", id_z, msg_z); \
abort(); \
} \
} while (0)
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
Definition: afw_common.h:523
#define AFW_VERSION_CHECK
Version check against the version compiled against.
Definition: afw_version.h:64

Abort if AFW core is not compatible with the version compiled against.

Parameters
id_zis a afw_utf8_z_t * that will be included in error message.

Use AFW_VERSION_THROW_ERROR_IF_NOT_COMPATIBLE(xctx) instead if xctx is available.

Print error and abort() if this version of Adaptive Framework is not compatible with the version compiled against, as well as if any dependency are not the appropriate level.

Definition at line 119 of file afw_version.h.

◆ AFW_VERSION_CHECK

#define AFW_VERSION_CHECK   afw_version_check(AFW_VERSION_HEX)

Version check against the version compiled against.

Returns
NULL if version is ok or pointer to error string if not.

Definition at line 64 of file afw_version.h.

◆ AFW_VERSION_THROW_ERROR_IF_NOT_COMPATIBLE

#define AFW_VERSION_THROW_ERROR_IF_NOT_COMPATIBLE (   id_z,
  xctx 
)
Value:
do { \
const afw_utf8_z_t *msg_z; \
msg_z = AFW_VERSION_CHECK; \
if (msg_z) { \
AFW_THROW_ERROR_FZ(general, xctx, "%s %s", id_z, msg_z); \
} \
} while (0)

Throw error if AFW core is not compatible with the version compiled against.

Parameters
id_zis a afw_utf8_z_t * that will be included in error message.
xctxof caller.

Throw an error if this version of Adaptive Framework is not compatible with the version compiled against, as well as if any dependency are not the appropriate level.

Definition at line 98 of file afw_version.h.

◆ AFW_VERSION_THROW_ERROR_SUPPLIED_HEX_VERSION_IF_NOT_COMPATIBLE

#define AFW_VERSION_THROW_ERROR_SUPPLIED_HEX_VERSION_IF_NOT_COMPATIBLE (   info,
  compiled_version,
  xctx 
)
Value:
do { \
const afw_utf8_z_t *msg_z; \
msg_z = afw_version_check(compiled_version); \
if (msg_z) { \
AFW_THROW_ERROR_FZ(general, xctx, \
"%" AFW_UTF8_FMT " %s", \
AFW_UTF8_FMT_ARG(info), msg_z); \
} \
} while (0)
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
Definition: afw_common.h:605
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
Definition: afw_common.h:588
const afw_utf8_z_t * afw_version_check(unsigned int version)
Version check.

Throw error if AFW core is not compatible with the supplied version.

Parameters
infowill be included in error message.
compiled_versionis AFW_VERSION_HEX to check against.
xctxof caller.

Throw an error if this version of Adaptive Framework is not compatible with the compiled_version, as well as if any dependency are not the appropriate level.

Definition at line 76 of file afw_version.h.

Function Documentation

◆ afw_version()

unsigned int afw_version ( )

Return AFW_VERSION_HEX.

◆ afw_version_check()

const afw_utf8_z_t* afw_version_check ( unsigned int  version)

Version check.

Parameters
version(see AFW_VERSION_HEX in afw_version.h)
Returns
NULL if version is ok or pointer to error string if not.

Returns an error message if this version of Adaptive Framework is not compatible with the supplied version, as well as if any dependency is not the appropriate level.

◆ afw_version_string()

const afw_utf8_t* afw_version_string ( )

Return Adaptive Framework version string.

◆ afw_version_string_z()

const afw_utf8_z_t* afw_version_string_z ( )

Return Adaptive Framework version string as utf8_z.