Libical API Documentation 4.0 STABLE VERSION Visit the v3.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
79#ifndef _MSC_VER
80#pragma GCC visibility pop
81#endif
82
102
115LIBICAL_ICAL_EXPORT icalerrorenum *icalerror_icalerrno(void);
116
133#define icalerrno (*(icalerror_icalerrno()))
134
149LIBICAL_ICAL_EXPORT void icalerror_set_errno(icalerrorenum x);
150
171LIBICAL_ICAL_EXPORT const char *icalerror_strerror(icalerrorenum e);
172
193LIBICAL_ICAL_EXPORT const char *icalerror_perror(void);
194
208LIBICAL_ICAL_EXPORT void icalerror_set_error_state(icalerrorenum error, icalerrorstate state);
209
216
232LIBICAL_ICAL_EXPORT icalerrorenum icalerror_error_from_string(const char *str);
233
246LIBICAL_ICAL_EXPORT void icalerror_set_errors_are_fatal(bool fatal);
247
261LIBICAL_ICAL_EXPORT bool icalerror_get_errors_are_fatal(void);
262
274LIBICAL_ICAL_EXPORT void icalerror_clear_errno(void);
275/* String interfaces to set an error to NONFATAL and restore it to its original value */
276
292LIBICAL_ICAL_EXPORT icalerrorstate icalerror_supress(const char *error);
293
312LIBICAL_ICAL_EXPORT void icalerror_restore(const char *error, icalerrorstate es);
313
325LIBICAL_ICAL_EXPORT void icalerror_backtrace(void);
326
327#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:89
@ ICAL_ERROR_UNKNOWN
Definition icalerror.h:100
@ ICAL_ERROR_FATAL
Definition icalerror.h:91
@ ICAL_ERROR_DEFAULT
Definition icalerror.h:97
@ ICAL_ERROR_NONFATAL
Definition icalerror.h:94
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:68
@ ICAL_ALLOCATION_ERROR
Definition icalerror.h:53
@ ICAL_INTERNAL_ERROR
Definition icalerror.h:65
@ ICAL_NO_ERROR
Definition icalerror.h:44
@ ICAL_MALFORMEDDATA_ERROR
Definition icalerror.h:59
@ ICAL_UNKNOWN_ERROR
Definition icalerror.h:77
@ ICAL_PARSE_ERROR
Definition icalerror.h:62
@ ICAL_THREADING_ERROR
Definition icalerror.h:56
@ ICAL_UNIMPLEMENTED_ERROR
Definition icalerror.h:74
@ ICAL_USAGE_ERROR
Definition icalerror.h:71
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.