13#include <cjson/cJSON.h>
28#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
37#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
58#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
67#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
68 unsigned __int128 err_u128;
94static inline bool cwist_error_is_ok(
const cwist_error_t *err) {
95 if (!err)
return true;
101#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
102 case CWIST_ERR_INT128:
return err->
error.err_i128 == 0;
108#if (defined(__clang__) || defined(__GNUC__)) && defined(USE_128BIT_ERRCODE)
109 case CWIST_ERR_UINT128:
return err->
error.err_u128 == 0;
113 default:
return false;
149#define CWIST_SUCCESS 0
150#define CWIST_FAILURE -1
151#define CWIST_ERROR_IO -2
152#define CWIST_ERROR_NOMEM -3
153#define CWIST_ERROR_INVALID_PARAM -4
154#define CWIST_ERROR_PROTOCOL -5
155#define CWIST_ERROR_TIMEOUT -6
@ CWIST_ERR_STRING
string types
@ CWIST_ERR_INT16
used when checking common errcodes in Unix/Linux
@ CWIST_ERR_UINT8
mostly used as 'byte'
@ CWIST_ERR_INT8
mostly used to check a char
bool cwist_error_is_ok_extern(const cwist_error_t *err)
Out-of-line cwist_error_is_ok(); see include/cwist/sys/err/cwist_err.h.
struct cwist_error_t cwist_error_t
cwist_error_t make_error(cwist_errtype_t type)
Creates an error object initialized with the specified type.
struct __prim_cwist_error_t __prim_cwist_error_t
Internal union-like structure to store the actual error value.
struct cwist_sstring * err_string
Integrated error structure used throughout the system.
__prim_cwist_error_t error
void cwist_error_dispose(cwist_error_t *err)
Release resources owned by an error value. Currently only CWIST_ERR_JSON owns memory (the cJSON paylo...