Loading...
Searching...
No Matches
ERRORS
Common

Error checking mechanism. More...

Collaboration diagram for ERRORS:

## Typedefs

typedef uint16_t | oscap_errfamily_t
| Error family type.

## Functions

OSCAP_API void | oscap_clearerr (void)
| Clear an error.
OSCAP_API bool | oscap_err (void)
| Check for an error.
OSCAP_API oscap_errfamily_t | oscap_err_family (void)
| Get last error family.
OSCAP_API const char * | oscap_err_desc (void)
| Get last error description.
OSCAP_API char * | oscap_err_get_full_error (void)
| Get the full description for all the errors which has occurred in this thread since the last call of this function or oscap_clearerr.

## OpenSCAP error families

#define | OSCAP_EFAMILY_NONE 0
| None.
#define | OSCAP_EFAMILY_GLIBC 1
| Errno errors.
#define | OSCAP_EFAMILY_XML 2
| Libxml errors.
#define | OSCAP_EFAMILY_OSCAP 3
| OSCAP general errors.
#define | OSCAP_EFAMILY_OVAL 4
| OVAL errors (OVAL & probes).
#define | OSCAP_EFAMILY_XCCDF 5
| XCCDF errors.
#define | OSCAP_EFAMILY_SCE 6
| SCE errors.
#define | OSCAP_EFAMILY_NET 7
| Errors from network communication.
#define | OSCAP_EFAMILY_WINDOWS 8
| Windows API Errors.

## Detailed Description

Error checking mechanism.

Purse of this mechanism is to inform user about problems that occurred during executaion of library functions. Mechanism is similar to linux errno variable. When the problem raise, the information about it is stored in library buffer. This information consists of error family, and textual description. Example of usage:

syschar = oval_probe_object_eval (pctx, object);
if (syschar == NULL && oscap_err()) {
printf("Error: (%d) %s\n", oscap_err_family(), oscap_err_desc());
}
oscap_clearerr()
oscap_clearerr
void oscap_clearerr(void)
Clear an error.
Definition error.c:137
oscap_err_desc
const char * oscap_err_desc(void)
Get last error description.
Definition error.c:173
oscap_err
bool oscap_err(void)
Check for an error.
Definition error.c:150
oscap_err_family
oscap_errfamily_t oscap_err_family(void)
Get last error family.
Definition error.c:159

## Macro Definition Documentation

## OSCAP_EFAMILY_NET

#define OSCAP_EFAMILY_NET 7

Errors from network communication.

Presumably from libcurl.

## Function Documentation

## oscap_err_get_full_error()

OSCAP_API char * oscap_err_get_full_error | ( | void |  | ) |

Get the full description for all the errors which has occurred in this thread since the last call of this function or oscap_clearerr.

This function is destructive. Subsequent call shall return NULL.

Returns
  zero terminated string describing these errors, which shall be disposed by caller.

Return values

  NULL | if there are no errors.