15#include "libical_ical_export.h"
31#define ICAL_SETERROR_ISFUNC
54#pragma GCC visibility push(default)
102#pragma GCC visibility pop
135#define icalerrno (*(icalerrno_return()))
180#define icalerror_warn(message) \
182 icalerrprintf("%s(), %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, message); \
185#define icalerror_warn(message) \
187 icalerrprintf("%s:%d: %s\n", __FILE__, __LINE__, message); \
277LIBICAL_ICAL_EXPORT
void ical_bt(
void);
333#if !defined(ICAL_SETERROR_ISFUNC)
334#define icalerror_set_errno(x) \
336 if (icalerror_get_error_state(x) == ICAL_ERROR_FATAL || \
337 (icalerror_get_error_state(x) == ICAL_ERROR_DEFAULT && \
338 icalerror_get_errors_are_fatal() == 1)) { \
339 icalerror_warn(icalerror_strerror(x)); \
374#if !defined(ICAL_ERRORS_ARE_FATAL)
375#define ICAL_ERRORS_ARE_FATAL 0
378#if ICAL_ERRORS_ARE_FATAL == 1
382#define icalerror_check_value_type(value, type) ;
383#define icalerror_check_property_type(value, type) ;
384#define icalerror_check_parameter_type(value, type) ;
385#define icalerror_check_component_type(value, type) ;
399#if ICAL_ERRORS_ARE_FATAL == 1
402#define icalerror_assert(test, message) \
404 icalerrprintf("%s(), %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, message); \
405 icalerror_stop_here(); \
409#define icalerror_assert(test, message) \
411 icalerrprintf("%s:%d: %s\n", __FILE__, __LINE__, message); \
412 icalerror_stop_here(); \
418#define icalerror_assert(test, message)
439#define icalerror_check_arg(test, arg) \
441 icalerror_set_errno(ICAL_BADARG_ERROR); \
463#define icalerror_check_arg_rv(test, arg) \
465 icalerror_set_errno(ICAL_BADARG_ERROR); \
489#define icalerror_check_arg_rz(test, arg) \
491 icalerror_set_errno(ICAL_BADARG_ERROR); \
516#define icalerror_check_arg_re(test, arg, error) \
518 icalerror_stop_here(); \
544#define icalerror_check_arg_rx(test, arg, x) \
546 icalerror_set_errno(ICAL_BADARG_ERROR); \
icalerrorenum * icalerrno_return(void)
Returns the current icalerrno value.
Definition icalerror.c:42
void icalerror_set_errors_are_fatal(int fatal)
Change if errors are fatal.
Definition icalerror.c:107
void icalerror_crash_here(void)
Triggered to abort the process.
Definition icalerror.c:76
void ical_bt(void)
Prints backtrace.
Definition icalerror.c:258
icalerrorstate
Determine if an error is fatal or non-fatal.
Definition icalerror.h:210
@ ICAL_ERROR_UNKNOWN
Definition icalerror.h:221
@ ICAL_ERROR_FATAL
Definition icalerror.h:212
@ ICAL_ERROR_DEFAULT
Definition icalerror.h:218
@ ICAL_ERROR_NONFATAL
Definition icalerror.h:215
int icalerror_get_errors_are_fatal(void)
Determine if errors are fatal.
Definition icalerror.c:112
const char * icalerror_perror(void)
Returns the description string for the current error in icalerrno.
Definition icalerror.c:207
icalerrorstate icalerror_get_error_state(icalerrorenum error)
Gets the error state (severity) for a given error.
Definition icalerror.c:232
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition icalerror.h:67
@ ICAL_NEWFAILED_ERROR
Definition icalerror.h:75
@ ICAL_BADARG_ERROR
Definition icalerror.h:72
@ ICAL_FILE_ERROR
Definition icalerror.h:90
@ ICAL_ALLOCATION_ERROR
Definition icalerror.h:78
@ ICAL_INTERNAL_ERROR
Definition icalerror.h:87
@ ICAL_NO_ERROR
Definition icalerror.h:69
@ ICAL_MALFORMEDDATA_ERROR
Definition icalerror.h:81
@ ICAL_UNKNOWN_ERROR
Definition icalerror.h:99
@ ICAL_PARSE_ERROR
Definition icalerror.h:84
@ ICAL_UNIMPLEMENTED_ERROR
Definition icalerror.h:96
@ ICAL_USAGE_ERROR
Definition icalerror.h:93
void icalerror_set_error_state(icalerrorenum error, icalerrorstate state)
Sets the icalerrorstate for a given icalerrorenum error.
Definition icalerror.c:221
const char * icalerror_strerror(icalerrorenum e)
Finds the description string for error.
Definition icalerror.c:245
void icalerror_set_errno(icalerrorenum x)
Sets the icalerrno to a given error.
Definition icalerror.c:118
void icalerror_restore(const char *error, icalerrorstate es)
Definition icalerror.c:212
void icalerror_stop_here(void)
Triggered before any error is called.
Definition icalerror.c:71
icalerrorenum icalerror_error_from_string(const char *str)
Reads an error from a string.
Definition icalerror.c:179
void icalerror_clear_errno(void)
Resets icalerrno to ICAL_NO_ERROR.
Definition icalerror.c:96
icalerrorstate icalerror_supress(const char *error)
Suppresses a given error.
Definition icalerror.c:192