mod version

module version

Version of the loaded library, for callers to check against the header they compiled with.

rgpot.h stamps RGPOT_VERSION and RGPOT_VERSION_MAJOR / _MINOR / _PATCH at generation time; these functions report the same numbers from the shared object actually loaded. The C ABI follows semver: a caller built against major M runs on any library of major M whose minor is at least the header’s.

The ABI stamp is separate from the crate version: see rgpot_abi_stamp() and rgpot_abi_compatible().

if (rgpot_version_major() != RGPOT_VERSION_MAJOR ||
    rgpot_version_minor() < RGPOT_VERSION_MINOR) {
  fprintf(stderr, "rgpot %s loaded, built against %s\n",
          rgpot_version(), RGPOT_VERSION);
  abort();
}

Variables

const RGPOT_ABI_LAYOUT_REVISION: u16

Layout revision of this build.

const RGPOT_ABI_VERSION_MAJOR: u16

ABI major of this build.

const RGPOT_ABI_VERSION_MINOR: u16

ABI minor of this build.

Functions

unsafe extern C fn rgpot_abi_compatible(stamp: *const rgpot_abi_stamp_t) -> i32

Return nonzero when the loaded library can serve a caller built with stamp: equal major, equal layout revision, and a library minor at least the caller’s. A null stamp is not compatible.

Safety

stamp must be null or point to a readable rgpot_abi_stamp_t.

extern C fn rgpot_abi_stamp() -> rgpot_abi_stamp_t

Compatibility identity of the loaded library.

Compare it with the RGPOT_ABI_* macros of the header the caller compiled with, or pass the caller’s own stamp to rgpot_abi_compatible.

extern C fn rgpot_source_revision() -> *const c_char

Source revision the loaded library was built from (a git short hash), or an empty string when the build had no revision to record.

The pointer refers to static storage: never free it.

extern C fn rgpot_version() -> *const c_char

Full version string of the loaded library, e.g. "3.5.1".

The pointer refers to static storage: never free it.

extern C fn rgpot_version_major() -> u32

Major version of the loaded library.

extern C fn rgpot_version_minor() -> u32

Minor version of the loaded library.

extern C fn rgpot_version_patch() -> u32

Patch version of the loaded library.

Structs and Unions

struct rgpot_abi_stamp_t

Compatibility identity of the rgpot-core C ABI.

The numbers move with the layout of the exported structs and the signatures of the exported functions, not with the crate version.

abi_major: u16

Incompatible changes increment this value.

abi_minor: u16

Additive compatible changes increment this value.

layout_revision: u16

Struct and function-layout revision for this ABI major.