-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathhh_error.h
55 lines (42 loc) · 1.32 KB
/
hh_error.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* This file is part of Hedgehog LISP.
* Copyright (C) 2003, 2004, 2005 Oliotalo Ltd.
* See file LICENSE.LGPL for pertinent licensing conditions.
*
* Author: Kenneth Oksanen <cessu@iki.fi>
*/
#ifndef HH_INCL_ERROR
#define HH_INCL_ERROR 1
/* Define the enumerated type for the kinds of errors.
*/
typedef enum {
/* Recoverable warnings and notifications come here. */
HH_SYSTEM_WARNING,
HH_PROGRAM_WARNING,
/* The program is not runnable for some reason, but the byte code
interpreter and the operating system are still alive. */
HH_PROGRAM_NORUN,
/* This must be here. */
HH_N_WARNING_KINDS,
/* Irrecoverable fatal errors which require rebooting or something
equally violent come here. */
HH_SYSTEM_FATAL,
HH_PROGRAM_FATAL
} hh_error_kind_t;
/* Define the enumerated type of all error codes.
*/
typedef enum {
HH_OK = 0,
#define ERROR(code, kind, description_string) \
code,
#include "hh_error.def"
#undef ERROR
HH_N_ERRORS,
} hh_error_t;
extern unsigned char hh_error_kind[];
#define HH_ERROR_IS_FATAL(error) (hh_error_kind[error] > HH_N_WARNING_KINDS)
/* HH_PRINT the error message into the given buffer. `aux_info' could
be a `hh_ctx_t *' in case of a run-time error in the byte code
program.
*/
void hh_error_print(hh_error_t error, void *aux_info);
#endif /* !HH_INCL_ERROR */