00001 #pragma once
00002 #ifndef OSCAP_ERROR_H
00003 #define OSCAP_ERROR_H
00004
00005 #include <stdint.h>
00006 #include <stdbool.h>
00007
00008 typedef uint16_t oscap_errfamily_t;
00009 typedef uint16_t oscap_errcode_t;
00010
00011
00012
00013
00014 #define OSCAP_ELEVEL_NONE 0
00015 #define OSCAP_ELEVEL_WARNING 1
00016 #define OSCAP_ELEVEL_ERROR 2
00017 #define OSCAP_ELEVEL_FATAL 3
00018
00019
00020
00021 #define OSCAP_EFAMILY_NONE 0
00022 #define OSCAP_EFAMILY_GLIBC 1
00023 #define OSCAP_EFAMILY_XML 2
00024 #define OSCAP_EFAMILY_OSCAP 3
00025
00026
00027
00028
00029 #define OSCAP_ENONE 0
00030 #define OSCAP_EALLOC 1
00031 #define OSCAP_EXMLELEM 2
00032 #define OSCAP_EXMLNODETYPE 3
00033 #define OSCAP_EXMLNOELEMENT 4
00034 #define OSCAP_ECPEINVOP 5
00035 #define OSCAP_EOVALINT 6
00036 #define OSCAP_EREGEXP 7
00037 #define OSCAP_EREGEXPCOMP 8
00038 #define OSCAP_EUNDATATYPE 9
00039 #define OSCAP_EINVARG 10
00040 #define OSCAP_EVARTYPE 11
00041 #define OSCAP_ESEAPINIT 12
00042 #define OSCAP_EUSER1 201
00043 #define OSCAP_EUSER2 202
00044 #define OSCAP_EUNKNOWN 255
00045
00046 #define oscap_seterr(family, code, desc) __oscap_seterr (__FILE__, __LINE__, __PRETTY_FUNCTION__, family, code, desc)
00047
00048 void __oscap_seterr(const char *file, uint32_t line, const char *func,
00049 oscap_errfamily_t family, oscap_errcode_t code, const char *desc);
00050
00051 void oscap_clearerr(void);
00052 bool oscap_err(void);
00053
00054 oscap_errfamily_t oscap_err_family(void);
00055 oscap_errcode_t oscap_err_code(void);
00056 const char *oscap_err_desc(void);
00057
00058 #endif