1: /*
   2:  * except.h
   3:  *
   4:  * Definitions and macros for C exception mechanism
   5:  *
   6:  (c) Jeffrey Mogul	Stanford	18 February 1983
   7:  */
   8: 
   9: #include <setjmp.h>
  10: 
  11: typedef struct _Except_buf_x {
  12:     struct _Except_buf_x *Prev; /* exception chain back-pointer */
  13:     jmp_buf Environ;        /* saved environment */
  14:     char *Message;          /* Human-readable cause */
  15:     int Code;           /* Exception code */
  16: } _Except_Buf;
  17: 
  18: extern _Except_Buf *_Except_Header; /* global exception chain header */
  19: 
  20: /*
  21:  * "syntax":
  22:  *	DURING statement HANDLER statement END_HANDLER
  23:  */
  24: 
  25: #define _E_RESTORE  _Except_Header = Exception.Prev
  26: 
  27: #define DURING {_Except_Buf Exception;\
  28:          Exception.Prev=_Except_Header;\
  29:          _Except_Header= &Exception;\
  30:          if (!setjmp(Exception.Environ)) {
  31: 
  32: #define HANDLER _E_RESTORE;} else
  33: 
  34: #define END_HANDLER }
  35: 
  36: #define E_RETURN(x) {_E_RESTORE; return(x);}
  37: 
  38: #define E_RETURN_VOID {_E_RESTORE; return;}
  39: 
  40: #define RERAISE raise(Exception.Code, Exception.Message)
  41: 
  42: /*
  43:  * Exception modes (combined with ||):
  44:  */
  45: #define EX_MODE_REPORT  1   /* report uncaught errors on stderr */
  46: #define EX_MODE_ABORT   2   /* abort if uncaught error */
  47: 
  48: extern int ExceptMode;

Defined struct's

_Except_buf_x defined in line 11; used 2 times
  • in line 12(2)

Defined typedef's

_Except_Buf defined in line 16; used 4 times

Defined macros

DURING defined in line 27; never used
END_HANDLER defined in line 34; never used
EX_MODE_ABORT defined in line 46; used 1 times
EX_MODE_REPORT defined in line 45; used 1 times
E_RETURN defined in line 36; never used
E_RETURN_VOID defined in line 38; never used
HANDLER defined in line 32; never used
RERAISE defined in line 40; never used
_E_RESTORE defined in line 25; used 3 times

Usage of this include

Last modified: 1986-03-13
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 512
Valid CSS Valid XHTML 1.0 Strict