58 lines
1.1 KiB
C
58 lines
1.1 KiB
C
#ifndef _ERROR_H
|
|
#define _ERROR_H
|
|
|
|
|
|
typedef enum {
|
|
EOK=0,
|
|
ECALL, // CALL/CCALL error
|
|
EDATA, // DATA error
|
|
EEXPR, // Expression error
|
|
EEVENT, // Event error
|
|
EHEAP, // Heap error
|
|
EINPUT, // Input error (EWOULDBLOCk...)
|
|
ENOTFOUND,
|
|
EOP, // Instruction error
|
|
EPROC, // Procedure error
|
|
ERANGE, // Array range error
|
|
ERUN, // Run-time error
|
|
ESTACK, // Stack error
|
|
ESYNTAX, // Syntax error
|
|
ETASK, // Task (creation) error
|
|
ETODO, // Not yet implemented
|
|
ETYPE,
|
|
EVAR, // Variable error
|
|
EWOULDBLOCK, // Blocking IO not allowed
|
|
} errors_t;
|
|
|
|
#define ERRORS char *Errors[]={\
|
|
"EOK",\
|
|
"ECALL",\
|
|
"EDATA",\
|
|
"EEXPR",\
|
|
"EEVENT",\
|
|
"EHEAP",\
|
|
"EINPUT",\
|
|
"ENOTFOUND",\
|
|
"EOP",\
|
|
"EPROC",\
|
|
"ERANGE",\
|
|
"ERUN",\
|
|
"ESTACK",\
|
|
"ESYNTAX",\
|
|
"ETASK",\
|
|
"ETODO",\
|
|
"ETYPE",\
|
|
"EVAR",\
|
|
"EWOULDBLOCK",\
|
|
}
|
|
extern char *Errors[];
|
|
|
|
typedef int8_t error_t;
|
|
// void error(reg_t *R,error_t e);
|
|
|
|
#define RETURNERROR(R,e,status) { error(R,e); return status; }
|
|
#define RETURNERROR0(R,e) { error(R,e); return; }
|
|
|
|
|
|
#endif
|