|
|
1.1 root 1: #ifndef EHAND_H
2: #define EHAND_H
3:
4: /*
5: *-IMPORTS:
6: * <sys/compat.h>
7: * CONST
8: * EXTERN_C_BEGIN
9: * EXTERN_C_END
10: * PROTO ()
11: * <setjmp.h>
12: * jmp_buf
13: * setjmp ()
14: */
15:
16: #include <sys/compat.h>
17: #include <setjmp.h>
18:
19: /*
20: * Structure used for error control.
21: */
22:
23: typedef struct ehandler ehand_t;
24:
25: struct ehandler {
26: ehand_t * eh_next;
27: jmp_buf eh_buf;
28: };
29:
30: extern ehand_t * estack_base;
31:
32: #define PUSH_HANDLER(eh) setjmp (((eh).eh_next = estack_base,\
33: estack_base = & (eh), (eh).eh_buf))
34: #define POP_HANDLER(eh) (estack_base != & (eh) ? \
35: error_error (__FILE__, __LINE__) : \
36: (void) (estack_base = (eh).eh_next))
37: #define CHAIN_ERROR(eh) (chain_error (& (eh)))
38:
39:
40: EXTERN_C_BEGIN
41:
42: NO_RETURN void throw_error PROTO ((CONST char * _fmt, ...));
43: void report_error PROTO ((CONST char * _fmt, ...));
44: void error_error PROTO ((CONST char * _file, int _line));
45: void chain_error PROTO ((ehand_t * _ehand));
46:
47: EXTERN_C_END
48:
49:
50: #endif /* ! define (EHAND_H) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.