Libical API Documentation
4.0 STABLE VERSION
[Visit the v3.0 documentation]
Toggle main menu visibility
Loading...
Searching...
No Matches
src
libical
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
#if defined(__GNUC__) || defined(__clang__)
29
#pragma GCC visibility push(default)
30
#endif
41
typedef
enum
icalerrorenum
42
{
44
ICAL_NO_ERROR
= 0,
45
47
ICAL_BADARG_ERROR
,
48
50
ICAL_NEWFAILED_ERROR
,
51
53
ICAL_ALLOCATION_ERROR
,
54
56
ICAL_THREADING_ERROR
,
57
59
ICAL_MALFORMEDDATA_ERROR
,
60
62
ICAL_PARSE_ERROR
,
63
65
ICAL_INTERNAL_ERROR
,
/* Like assert --internal consist. prob */
66
68
ICAL_FILE_ERROR
,
69
71
ICAL_USAGE_ERROR
,
72
74
ICAL_UNIMPLEMENTED_ERROR
,
75
77
ICAL_UNKNOWN_ERROR
/* Used for problems in input to icalerror_strerror() */
78
}
icalerrorenum
;
79
#if defined(__GNUC__) || defined(__clang__)
80
#pragma GCC visibility pop
81
#endif
82
88
typedef
enum
icalerrorstate
89
{
91
ICAL_ERROR_FATAL
,
92
94
ICAL_ERROR_NONFATAL
,
95
97
ICAL_ERROR_DEFAULT
,
98
100
ICAL_ERROR_UNKNOWN
101
}
icalerrorstate
;
102
115
LIBICAL_ICAL_EXPORT
icalerrorenum
*
icalerror_icalerrno
(
void
);
116
133
#define icalerrno (*(icalerror_icalerrno()))
134
149
LIBICAL_ICAL_EXPORT
void
icalerror_set_errno
(
icalerrorenum
x);
150
171
LIBICAL_ICAL_EXPORT
const
char
*
icalerror_strerror
(
icalerrorenum
e);
172
193
LIBICAL_ICAL_EXPORT
const
char
*
icalerror_perror
(
void
);
194
208
LIBICAL_ICAL_EXPORT
void
icalerror_set_error_state
(
icalerrorenum
error,
icalerrorstate
state);
209
215
LIBICAL_ICAL_EXPORT
icalerrorstate
icalerror_get_error_state
(
icalerrorenum
error);
216
232
LIBICAL_ICAL_EXPORT
icalerrorenum
icalerror_error_from_string
(
const
char
*str);
233
246
LIBICAL_ICAL_EXPORT
void
icalerror_set_errors_are_fatal
(
bool
fatal);
247
261
LIBICAL_ICAL_EXPORT
bool
icalerror_get_errors_are_fatal
(
void
);
262
274
LIBICAL_ICAL_EXPORT
void
icalerror_clear_errno
(
void
);
275
/* String interfaces to set an error to NONFATAL and restore it to its original value */
276
292
LIBICAL_ICAL_EXPORT
icalerrorstate
icalerror_supress
(
const
char
*error);
293
312
LIBICAL_ICAL_EXPORT
void
icalerror_restore
(
const
char
*error,
icalerrorstate
es);
313
325
LIBICAL_ICAL_EXPORT
void
icalerror_backtrace
(
void
);
326
327
#endif
/* !ICALERROR_H */
icalerror_set_errors_are_fatal
void icalerror_set_errors_are_fatal(bool fatal)
Change if errors are fatal.
Definition
icalerror.c:31
icalerror_icalerrno
icalerrorenum * icalerror_icalerrno(void)
Returns the current icalerrno value.
Definition
icalerror.c:58
icalerror_get_errors_are_fatal
bool icalerror_get_errors_are_fatal(void)
Determine if errors are fatal.
Definition
icalerror.c:36
icalerror_backtrace
void icalerror_backtrace(void)
Prints backtrace.
Definition
icalerror.c:101
icalerror_set_errno
void icalerror_set_errno(icalerrorenum x)
Sets the icalerrno to a given error.
Definition
icalerror.c:90
icalerror_clear_errno
void icalerror_clear_errno(void)
Resets icalerrno to ICAL_NO_ERROR.
Definition
icalerror.c:85
icalerrorstate
icalerrorstate
Determine if an error is fatal or non-fatal.
Definition
icalerror.h:89
ICAL_ERROR_UNKNOWN
@ ICAL_ERROR_UNKNOWN
Definition
icalerror.h:100
ICAL_ERROR_FATAL
@ ICAL_ERROR_FATAL
Definition
icalerror.h:91
ICAL_ERROR_DEFAULT
@ ICAL_ERROR_DEFAULT
Definition
icalerror.h:97
ICAL_ERROR_NONFATAL
@ ICAL_ERROR_NONFATAL
Definition
icalerror.h:94
icalerror_perror
const char * icalerror_perror(void)
icalerror_get_error_state
icalerrorstate icalerror_get_error_state(icalerrorenum error)
Gets the error state (severity) for a given error.
icalerrorenum
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition
icalerror.h:42
ICAL_NEWFAILED_ERROR
@ ICAL_NEWFAILED_ERROR
Definition
icalerror.h:50
ICAL_BADARG_ERROR
@ ICAL_BADARG_ERROR
Definition
icalerror.h:47
ICAL_FILE_ERROR
@ ICAL_FILE_ERROR
Definition
icalerror.h:68
ICAL_ALLOCATION_ERROR
@ ICAL_ALLOCATION_ERROR
Definition
icalerror.h:53
ICAL_INTERNAL_ERROR
@ ICAL_INTERNAL_ERROR
Definition
icalerror.h:65
ICAL_NO_ERROR
@ ICAL_NO_ERROR
Definition
icalerror.h:44
ICAL_MALFORMEDDATA_ERROR
@ ICAL_MALFORMEDDATA_ERROR
Definition
icalerror.h:59
ICAL_UNKNOWN_ERROR
@ ICAL_UNKNOWN_ERROR
Definition
icalerror.h:77
ICAL_PARSE_ERROR
@ ICAL_PARSE_ERROR
Definition
icalerror.h:62
ICAL_THREADING_ERROR
@ ICAL_THREADING_ERROR
Definition
icalerror.h:56
ICAL_UNIMPLEMENTED_ERROR
@ ICAL_UNIMPLEMENTED_ERROR
Definition
icalerror.h:74
ICAL_USAGE_ERROR
@ ICAL_USAGE_ERROR
Definition
icalerror.h:71
icalerror_set_error_state
void icalerror_set_error_state(icalerrorenum error, icalerrorstate state)
Sets the icalerrorstate for a given icalerrorenum error.
icalerror_strerror
const char * icalerror_strerror(icalerrorenum e)
Finds the description string for error.
icalerror_restore
void icalerror_restore(const char *error, icalerrorstate es)
icalerror_error_from_string
icalerrorenum icalerror_error_from_string(const char *str)
Reads an error from a string.
icalerror_supress
icalerrorstate icalerror_supress(const char *error)
Suppresses a given error.
Generated on
for Libical API Documentation by
1.18.0