Debian Codegraph @

src/common/public/oscap_error.h

raw symbols SCIP
1 /*
2 * Copyright 2009 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 /**
21 * @file
22 *
23 * @addtogroup COMMON
24 * @{
25 * @addtogroup ERRORS
26 * @{
27 * Error checking mechanism. Purse of this mechanism is to inform user about problems that occurred
28 * during executaion of library functions. Mechanism is similar to linux errno variable. When the problem
29 * raise, the information about it is stored in library buffer. This information consists of error family,
30 * and textual description. Example of usage:
31 *
32 * @code
33 * syschar = oval_probe_object_eval (pctx, object);
34 * if (syschar == NULL && oscap_err()) {
35 * printf("Error: (%d) %s\n", oscap_err_family(), oscap_err_desc());
36 * }
37 * oscap_clearerr()
38 * @endcode
39 *
40 */
41 #pragma once
42 #ifndef OSCAP_ERROR_H
43 #define OSCAP_ERROR_Hcxx . . $ `src/common/public/oscap_error.h:43:9`!
44
45 #include <stdint.h>
46 #include <stdbool.h>
47
48 #include "oscap_export.h"cxx . . $ `<file>/src/common/public/oscap_export.h`/
49
50 /// Error family type
51 typedef uint16_tcxx . . $ uint16_t# oscap_errfamily_tcxx . . $ oscap_errfamily_t#;
52
53 /**
54 * @name OpenSCAP error families
55 * @{
56 */
57 #define OSCAP_EFAMILY_NONEcxx . . $ `src/common/public/oscap_error.h:57:9`! 0 /**< None */
58 #define OSCAP_EFAMILY_GLIBCcxx . . $ `src/common/public/oscap_error.h:58:9`! 1 /**< Errno errors */
59 #define OSCAP_EFAMILY_XMLcxx . . $ `src/common/public/oscap_error.h:59:9`! 2 /**< Libxml errors */
60 #define OSCAP_EFAMILY_OSCAPcxx . . $ `src/common/public/oscap_error.h:60:9`! 3 /**< OSCAP general errors */
61 #define OSCAP_EFAMILY_OVALcxx . . $ `src/common/public/oscap_error.h:61:9`! 4 /**< OVAL errors (OVAL & probes) */
62 #define OSCAP_EFAMILY_XCCDFcxx . . $ `src/common/public/oscap_error.h:62:9`! 5 /**< XCCDF errors */
63 #define OSCAP_EFAMILY_SCEcxx . . $ `src/common/public/oscap_error.h:63:9`! 6 /**< SCE errors */
64 #define OSCAP_EFAMILY_NETcxx . . $ `src/common/public/oscap_error.h:64:9`! 7 /**< Errors from network communication. Presumably from libcurl. */
65 #define OSCAP_EFAMILY_WINDOWScxx . . $ `src/common/public/oscap_error.h:65:9`! 8 /**< Windows API Errors */
66 /** @} */
67
68 /**
69 * Clear an error.
70 */
71 OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void oscap_clearerrcxx . . $ oscap_clearerr(49f6e7a06ebc5aa8).(void);
72
73 /**
74 * Check for an error.
75 */
76 OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! oscap_errcxx . . $ oscap_err(c9857a73d68e59ba).(void);
77
78 /**
79 * Get last error family.
80 */
81 OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! oscap_errfamily_tcxx . . $ oscap_errfamily_t# oscap_err_familycxx . . $ oscap_err_family(32a7769d58713265).(void);
82
83 /**
84 * Get last error description.
85 */
86 OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! const char *oscap_err_desccxx . . $ oscap_err_desc(33a1f659e94feb42).(void);
87
88 /**
89 * Get the full description for all the errors which has occurred in this
90 * thread since the last call of this function or \ref oscap_clearerr.
91 * This function is destructive. Subsequent call shall return NULL.
92 * @returns zero terminated string describing these errors, which shall
93 * be disposed by caller.
94 * @retval NULL if there are no errors.
95 */
96 OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! char *oscap_err_get_full_errorcxx . . $ oscap_err_get_full_error(41208ce6ca65dd58).(void);
97
98 /// @}
99 /// @}
100 #endif /* OSCAP_ERROR_H */