1 /*-------------------------------------------------------------------------
4 * POSTGRES exception handling definitions.
7 * Copyright (c) 1994, Regents of the University of California
9 * $Id: exc.h,v 1.8 1997/09/07 05:02:28 momjian Exp $
11 *-------------------------------------------------------------------------
20 extern char *ExcFileName;
21 extern Index ExcLineNumber;
24 * ExcMessage and Exception are now defined in c.h
27 typedef jmp_buf ExcContext;
30 typedef sigjmp_buf ExcContext;
34 typedef Exception *ExcId;
35 typedef long ExcDetail;
36 typedef char *ExcData;
38 typedef struct ExcFrame
40 struct ExcFrame *link;
48 extern ExcFrame *ExcCurFrameP;
54 exception.link = ExcCurFrameP; \
55 if (sigsetjmp(exception.context, 1) == 0) { \
56 ExcCurFrameP = &exception; \
60 ExcCurFrameP = exception.link; \
68 #define raise4(x, t, d, message) \
69 ExcRaise(&(x), (ExcDetail)(t), (ExcData)(d), (ExcMessage)(message))
72 raise4(*exception.id,exception.detail,exception.data,exception.message)
74 typedef void ExcProc(Exception *, ExcDetail, ExcData, ExcMessage);
78 * prototypes for functions in exc.c
80 extern void EnableExceptionHandling(bool on);
82 ExcRaise(Exception * excP,
89 * prototypes for functions in excabort.c
92 ExcAbort(const Exception * excP, ExcDetail detail, ExcData data,