xtc_version_components(3)

---

xtc_version_components(3)

decompose the xtc library version into integer components

XTC_VERSION_COMPONENTS(3) Library Functions Manual XTC_VERSION_COMPONENTS(3)

xtc_version_componentsdecompose the xtc library version into integer components

#include <xtc.h>

int
xtc_version_components(int *major, int *minor, int *patch);

The () function writes the SemVer , , and components of the library version into the integers pointed to by major, minor, and patch respectively.

Every output component is a non-negative integer. The components agree with the leading numeric portion of the string returned by xtc_version_string(3).

On success the function returns XTC_OK (0).

If any of major, minor, or patch is NULL, the function returns XTC_E_INVAL without modifying any output parameter.

#include <stdio.h>
#include <xtc.h>

int main(void) {
        int maj, min, pat;
        if (xtc_version_components(&maj, &min, &pat) == XTC_OK)
                printf("xtc %d.%d.%d\n", maj, min, pat);
        return 0;
}

xtc(7), xtc_version_string(3), xtc_strerror(3)

First appeared in xtc 0.0.1.

May 25, 2026 Debian

View the mdoc source