xtc_strerror(3)

---

xtc_strerror(3)

return a stable English description of an xtc error code

XTC_STRERROR(3) Library Functions Manual XTC_STRERROR(3)

xtc_strerrorreturn a stable English description of an xtc error code

#include <xtc.h>

const char *
xtc_strerror(int xtc_err);

The () function returns a stable English description of the xtc error code xtc_err.

Recognised values are XTC_OK and the XTC_E_* codes declared in <xtc.h>. For any code outside the recognised set the function returns the string “unknown”; it never returns NULL.

The returned pointer is to static storage and must not be freed. The exact text for each known code is part of the API contract for log-message stability and changes only on a major version bump.

A non-NULL pointer to a NUL-terminated string.

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

void log_rc(int rc) {
        if (rc != XTC_OK)
                fprintf(stderr, "xtc error: %s\n", xtc_strerror(rc));
}

xtc(7), xtc_version_string(3)

First appeared in xtc 0.0.1.

May 25, 2026 Debian

View the mdoc source