Version (version)#

group version

Build provenance, version, and license information.

rcsw/version/build_info.h#

Build environment record.

struct build_info#
#include <rcsw/version/build_info.h>

Snapshot of the build environment captured at compile time.

Populated automatically by the CMake template version.c.in. Fields sourced from the LIBRA build framework are set to "" when not available (e.g. when building outside a git repository).

Public Members

const char *const git_rev#

The git commit hash (short form) at the time of the build, or "" if unavailable.

const char *const git_diff#

"+" if the working tree had uncommitted changes at build time, "" otherwise.

const char *const git_tag#

The git tag pointing at the build commit, or "" if none exists.

const char *const git_branch#

The git branch active at build time, or "" if unavailable.

const char *const compile_flags#

Relevant compiler flags used to build the library or application.

Relevant linker flags used to build the library or application.

const char *const date#

The calendar date of the build, as reported by __DATE__.

const char *const time#

The wall-clock time of the build, as reported by __TIME__.

rcsw/version/license_info.h#

License record.

struct license_info#
#include <rcsw/version/license_info.h>

License information for a project.

Useful to show on application/library load.

Public Members

const char *const abbrev#

Abbreviated license text.

const char *const full#

Full license text.

const char *const copyright#

Copyright text.

rcsw/version/licenses.h#

License notice strings and selection macros.

Defines

Produce a copyright notice string for embedding in license_info.

Parameters:
  • year – The copyright year as an integer token (e.g. 2023).

  • author – The copyright holder as a quoted string literal (e.g. "John Harwell"). Must be a string literal, not a bare token sequence, so that multi-word names are handled correctly.

RCSW_LICENSE_SHORT(license)#

Select the short-form license notice for license.

Expands to the corresponding rcsw_license_short_<license>_text array, suitable for assigning to the abbrev field of license_info.

Parameters:
  • license – License identifier token. Must be one of: gplv3, lgplv3, mit.

RCSW_LICENSE_FULL(license)#

Select the full license notice for license.

Expands to the corresponding rcsw_license_full_<license>_text array, suitable for assigning to the full field of license_info.

Parameters:
  • license – License identifier token. Must be one of: gplv3, lgplv3, mit.

Variables

const char rcsw_license_full_gplv3_text[]#

Full GPLv3+ license notice, suitable for printing at program start.

const char rcsw_license_short_gplv3_text[]#

Short GPLv3+ license notice.

const char rcsw_license_full_lgplv3_text[]#

Full LGPLv3+ license notice, suitable for printing at program start.

const char rcsw_license_short_lgplv3_text[]#

Short LGPLv3+ license notice.

const char rcsw_license_full_mit_text[]#

Full MIT license notice, suitable for printing at program start.

const char rcsw_license_short_mit_text[]#

Short MIT license notice.

rcsw/version/meta_info.h#

The combined version and build record.

struct meta_info#
#include <rcsw/version/meta_info.h>

Complete provenance record for an RCSW-based library or application.

Combines version_info (release version + license) with build_info (git state + compiler flags + timestamps). The single global instance of this struct is g_rcsw_metadata, which is populated at compile time by the CMake template version.c.in. Read it through the accessor functions declared in version.h rather than accessing fields directly, so that your code remains insulated from future layout changes.

Public Members

struct version_info version#

Release version and license notice for the project.

struct build_info build#

Build environment snapshot captured at compile time.

rcsw/version/version.h#

Accessors for RCSW’s version, license, and build information.

Functions

const char *rcsw_version(void)#

Return the release version string (e.g. "v1.2.3").

const char *rcsw_license_abbrev(void)#

Return the abbreviated license notice.

const char *rcsw_license_full(void)#

Return the full license text.

Return the copyright notice string.

const char *rcsw_build_git_rev(void)#

Return the short git commit hash at build time, or "" if unavailable.

const char *rcsw_build_git_diff(void)#

Return "+" if the tree was dirty at build time, "" otherwise.

const char *rcsw_build_git_tag(void)#

Return the git tag at build time, or "" if none.

const char *rcsw_build_git_branch(void)#

Return the git branch at build time, or "" if unavailable.

const char *rcsw_build_compile_flags(void)#

Return the compiler flags used for this build.

Return the linker flags used for this build.

const char *rcsw_build_date(void)#

Return the calendar date of the build (__DATE__ format).

const char *rcsw_build_time(void)#

Return the wall-clock time of the build (__TIME__ format).

Variables

const struct meta_info g_rcsw_metadata#

The single provenance record for this RCSW build.

Populated at compile time by the CMake template version.c.in. Valid as soon as the translation unit that defines it has been loaded (i.e. from program startup for static builds, or from shared-library load for dynamic builds). Do not modify.

Prefer the accessor functions below over direct field access so that call sites remain insulated from future struct layout changes.

rcsw/version/version_info.h#

Release version and license record.

struct version_info#
#include <rcsw/version/version_info.h>

The release version and associated license notice for a project.

The version string is in whatever format the project chooses (semver, date-based, etc.). The license fields hold the pre-formatted text produced by the RCSW_LICENSE_SHORT and RCSW_LICENSE_FULL macros, suitable for printing at program startup.

Public Members

const char *version#

Human-readable version string (e.g. "v1.2.3").

struct license_info license#

License notice for the project.