Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalerror.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalerror.h
3 CREATOR: eric 09 May 1999
4
5 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7======================================================================*/
8
20
21#ifndef ICALERROR_H
22#define ICALERROR_H
23
24#include "libical_ical_export.h"
25
26#include <stdbool.h>
27
28#ifndef _MSC_VER
29#pragma GCC visibility push(default)
30#endif
41typedef enum icalerrorenum
42{
45
48
51
54
57
60
62 ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */
63
66
69
72
74 ICAL_UNKNOWN_ERROR /* Used for problems in input to icalerror_strerror() */
76#ifndef _MSC_VER
77#pragma GCC visibility pop
78#endif
79
99
112LIBICAL_ICAL_EXPORT icalerrorenum *icalerror_icalerrno(void);
113
130#define icalerrno (*(icalerror_icalerrno()))
131
146LIBICAL_ICAL_EXPORT void icalerror_set_errno(icalerrorenum x);
147
168LIBICAL_ICAL_EXPORT const char *icalerror_strerror(icalerrorenum e);
169
190LIBICAL_ICAL_EXPORT const char *icalerror_perror(void);
191
205LIBICAL_ICAL_EXPORT void icalerror_set_error_state(icalerrorenum error, icalerrorstate state);
206
213
229LIBICAL_ICAL_EXPORT icalerrorenum icalerror_error_from_string(const char *str);
230
243LIBICAL_ICAL_EXPORT void icalerror_set_errors_are_fatal(bool fatal);
244
258LIBICAL_ICAL_EXPORT bool icalerror_get_errors_are_fatal(void);
259
271LIBICAL_ICAL_EXPORT void icalerror_clear_errno(void);
272/* String interfaces to set an error to NONFATAL and restore it to its original value */
273
289LIBICAL_ICAL_EXPORT icalerrorstate icalerror_supress(const char *error);
290
309LIBICAL_ICAL_EXPORT void icalerror_restore(const char *error, icalerrorstate es);
310
322LIBICAL_ICAL_EXPORT void icalerror_backtrace(void);
323
324#endif /* !ICALERROR_H */
void icalerror_set_errors_are_fatal(bool fatal)
Change if errors are fatal.
Definition icalerror.c:31
icalerrorenum * icalerror_icalerrno(void)
Returns the current icalerrno value.
Definition icalerror.c:58
bool icalerror_get_errors_are_fatal(void)
Determine if errors are fatal.
Definition icalerror.c:36
icalerrorstate
Determine if an error is fatal or non-fatal.
Definition icalerror.h:86
@ ICAL_ERROR_UNKNOWN
Definition icalerror.h:97
@ ICAL_ERROR_FATAL
Definition icalerror.h:88
@ ICAL_ERROR_DEFAULT
Definition icalerror.h:94
@ ICAL_ERROR_NONFATAL
Definition icalerror.h:91
const char * icalerror_perror(void)
icalerrorstate icalerror_get_error_state(icalerrorenum error)
Gets the error state (severity) for a given error.
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition icalerror.h:42
@ ICAL_NEWFAILED_ERROR
Definition icalerror.h:50
@ ICAL_BADARG_ERROR
Definition icalerror.h:47
@ ICAL_FILE_ERROR
Definition icalerror.h:65
@ ICAL_ALLOCATION_ERROR
Definition icalerror.h:53
@ ICAL_INTERNAL_ERROR
Definition icalerror.h:62
@ ICAL_NO_ERROR
Definition icalerror.h:44
@ ICAL_MALFORMEDDATA_ERROR
Definition icalerror.h:56
@ ICAL_UNKNOWN_ERROR
Definition icalerror.h:74
@ ICAL_PARSE_ERROR
Definition icalerror.h:59
@ ICAL_UNIMPLEMENTED_ERROR
Definition icalerror.h:71
@ ICAL_USAGE_ERROR
Definition icalerror.h:68
void icalerror_backtrace(void)
Prints backtrace.
Definition icalerror.c:101
void icalerror_set_error_state(icalerrorenum error, icalerrorstate state)
Sets the icalerrorstate for a given icalerrorenum error.
const char * icalerror_strerror(icalerrorenum e)
Finds the description string for error.
void icalerror_set_errno(icalerrorenum x)
Sets the icalerrno to a given error.
Definition icalerror.c:90
void icalerror_restore(const char *error, icalerrorstate es)
icalerrorenum icalerror_error_from_string(const char *str)
Reads an error from a string.
void icalerror_clear_errno(void)
Resets icalerrno to ICAL_NO_ERROR.
Definition icalerror.c:85
icalerrorstate icalerror_supress(const char *error)
Suppresses a given error.