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) |
NAME
xtc_strerror —
return a stable English description of an xtc error
code
SYNOPSIS
#include
<xtc.h>
const char *
xtc_strerror(int
xtc_err);
DESCRIPTION
The
xtc_strerror()
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.
RETURN VALUES
A non-NULL pointer to a NUL-terminated string.
EXAMPLES
#include <stdio.h>
#include <xtc.h>
void log_rc(int rc) {
if (rc != XTC_OK)
fprintf(stderr, "xtc error: %s\n", xtc_strerror(rc));
}
SEE ALSO
HISTORY
First appeared in xtc 0.0.1.
| May 25, 2026 | Debian |