Index: src/backend/bootstrap/bootstrap.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/bootstrap/bootstrap.c,v retrieving revision 1.133 diff -c -r1.133 bootstrap.c *** src/backend/bootstrap/bootstrap.c 20 Jul 2002 05:16:56 -0000 1.133 --- src/backend/bootstrap/bootstrap.c 29 Jul 2002 19:14:41 -0000 *************** *** 37,43 **** #include "storage/proc.h" #include "tcop/tcopprot.h" #include "utils/builtins.h" - #include "utils/exc.h" #include "utils/fmgroids.h" #include "utils/guc.h" #include "utils/lsyscache.h" --- 37,42 ---- *************** *** 237,243 **** */ if (!IsUnderPostmaster) { - EnableExceptionHandling(true); MemoryContextInit(); } --- 236,241 ---- Index: src/backend/port/ipc_test.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/port/ipc_test.c,v retrieving revision 1.3 diff -c -r1.3 ipc_test.c *** src/backend/port/ipc_test.c 20 Jun 2002 20:29:33 -0000 1.3 --- src/backend/port/ipc_test.c 29 Jul 2002 19:14:41 -0000 *************** *** 34,40 **** #include "storage/ipc.h" #include "storage/pg_sema.h" #include "storage/pg_shmem.h" - #include "utils/exc.h" /********* stuff needed to satisfy references in shmem/sema code *********/ --- 34,39 ---- *************** *** 56,63 **** bool assert_enabled = true; #endif - Exception FailedAssertion = {"Failed Assertion"}; - #define MAX_ON_EXITS 20 --- 55,60 ---- *************** *** 120,133 **** int ExceptionalCondition(char *conditionName, ! Exception *exceptionP, ! char *detail, char *fileName, int lineNumber) { ! fprintf(stderr, "TRAP: %s(\"%s:%s\", File: \"%s\", Line: %d)\n", ! exceptionP->message, conditionName, ! (detail == NULL ? "" : detail), fileName, lineNumber); abort(); return 0; --- 117,128 ---- int ExceptionalCondition(char *conditionName, ! char *errorType, char *fileName, int lineNumber) { ! fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n", ! errorType, conditionName, fileName, lineNumber); abort(); return 0; Index: src/backend/postmaster/postmaster.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/postmaster/postmaster.c,v retrieving revision 1.281 diff -c -r1.281 postmaster.c *** src/backend/postmaster/postmaster.c 13 Jul 2002 01:02:14 -0000 1.281 --- src/backend/postmaster/postmaster.c 29 Jul 2002 19:14:41 -0000 *************** *** 102,108 **** #include "storage/proc.h" #include "access/xlog.h" #include "tcop/tcopprot.h" - #include "utils/exc.h" #include "utils/guc.h" #include "utils/memutils.h" #include "utils/ps_status.h" --- 102,107 ---- *************** *** 379,387 **** MyProcPid = getpid(); /* ! * Fire up essential subsystems: error and memory management */ - EnableExceptionHandling(true); MemoryContextInit(); /* --- 378,385 ---- MyProcPid = getpid(); /* ! * Fire up essential subsystems: memory management */ MemoryContextInit(); /* Index: src/backend/tcop/postgres.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/tcop/postgres.c,v retrieving revision 1.272 diff -c -r1.272 postgres.c *** src/backend/tcop/postgres.c 18 Jul 2002 23:11:28 -0000 1.272 --- src/backend/tcop/postgres.c 29 Jul 2002 19:14:42 -0000 *************** *** 54,60 **** #include "tcop/pquery.h" #include "tcop/tcopprot.h" #include "tcop/utility.h" - #include "utils/exc.h" #include "utils/guc.h" #include "utils/memutils.h" #include "utils/ps_status.h" --- 54,59 ---- *************** *** 1172,1178 **** */ if (!IsUnderPostmaster) { - EnableExceptionHandling(true); MemoryContextInit(); } --- 1171,1176 ---- *************** *** 2090,2124 **** pfree(str.data); } - - #ifdef NOT_USED - static int - assertEnable(int val) - { - assert_enabled = val; - return val; - } - - #ifdef ASSERT_CHECKING_TEST - int - assertTest(int val) - { - Assert(val == 0); - - if (assert_enabled) - { - /* val != 0 should be trapped by previous Assert */ - elog(DEBUG3, "Assert test successful (val = %d)", val); - } - else - elog(DEBUG3, "Assert checking is disabled (val = %d)", val); - - return val; - } - #endif - - #endif - /* ---------------------------------------------------------------- * CreateCommandTag --- 2088,2093 ---- Index: src/backend/utils/error/Makefile =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/utils/error/Makefile,v retrieving revision 1.9 diff -c -r1.9 Makefile *** src/backend/utils/error/Makefile 31 Aug 2000 16:10:48 -0000 1.9 --- src/backend/utils/error/Makefile 29 Jul 2002 19:14:42 -0000 *************** *** 12,18 **** top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global ! OBJS = assert.o elog.o exc.o excabort.o excid.o format.o all: SUBSYS.o --- 12,18 ---- top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global ! OBJS = assert.o elog.o all: SUBSYS.o Index: src/backend/utils/error/assert.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/utils/error/assert.c,v retrieving revision 1.21 diff -c -r1.21 assert.c *** src/backend/utils/error/assert.c 20 Jun 2002 20:29:39 -0000 1.21 --- src/backend/utils/error/assert.c 29 Jul 2002 19:14:42 -0000 *************** *** 11,72 **** * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/assert.c,v 1.21 2002/06/20 20:29:39 momjian Exp $ * * NOTE ! * This should eventually work with elog(), dlog(), etc. * *------------------------------------------------------------------------- */ #include "postgres.h" - #include #include ! #include "utils/exc.h" ! int ExceptionalCondition(char *conditionName, ! Exception *exceptionP, ! char *detail, char *fileName, int lineNumber) { - ExcFileName = fileName; - ExcLineNumber = lineNumber; - if (!PointerIsValid(conditionName) || !PointerIsValid(fileName) ! || !PointerIsValid(exceptionP)) { fprintf(stderr, "TRAP: ExceptionalCondition: bad arguments\n"); - - ExcAbort(exceptionP, - (ExcDetail) detail, - (ExcData) NULL, - (ExcMessage) NULL); } else { ! fprintf(stderr, "TRAP: %s(\"%s:%s\", File: \"%s\", Line: %d)\n", ! exceptionP->message, conditionName, ! (detail == NULL ? "" : detail), fileName, lineNumber); } - #ifdef ABORT_ON_ASSERT - abort(); - #endif #ifdef SLEEP_ON_ASSERT sleep(1000000); #endif ! /* ! * XXX Depending on the Exception and tracing conditions, you will XXX ! * want to stop here immediately and maybe dump core. XXX This may be ! * especially true for Assert(), etc. ! */ ! ! /* TraceDump(); dump the trace stack */ - /* XXX FIXME: detail is lost */ - ExcRaise(exceptionP, (ExcDetail) 0, (ExcData) NULL, conditionName); return 0; } --- 11,51 ---- * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/assert.c,v 1.21 2002/06/20 20:29:39 momjian Exp $ * * NOTE ! * This should eventually work with elog() * *------------------------------------------------------------------------- */ #include "postgres.h" #include ! /* ! * ExceptionalCondition - Handles the failure of an Assert() ! */ int ExceptionalCondition(char *conditionName, ! char *errorType, char *fileName, int lineNumber) { if (!PointerIsValid(conditionName) || !PointerIsValid(fileName) ! || !PointerIsValid(errorType)) { fprintf(stderr, "TRAP: ExceptionalCondition: bad arguments\n"); } else { ! fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n", ! errorType, conditionName, fileName, lineNumber); } #ifdef SLEEP_ON_ASSERT sleep(1000000); #endif ! abort(); return 0; } Index: src/backend/utils/error/exc.c =================================================================== RCS file: src/backend/utils/error/exc.c diff -N src/backend/utils/error/exc.c *** src/backend/utils/error/exc.c 20 Jun 2002 20:29:39 -0000 1.39 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,198 **** - /*------------------------------------------------------------------------- - * - * exc.c - * POSTGRES exception handling code. - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/exc.c,v 1.39 2002/06/20 20:29:39 momjian Exp $ - * - * NOTE - * XXX this code needs improvement--check for state violations and - * XXX reset after handling an exception. - * XXX Probably should be merged with elog.c. - * - *------------------------------------------------------------------------- - */ - #include "postgres.h" - - #include - - #include "storage/ipc.h" - #include "utils/exc.h" - - extern int errno; - - - static void ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data, - ExcMessage message); - static void ExcPrint(Exception *excP, ExcDetail detail, ExcData data, - ExcMessage message); - - /* - * Global Variables - */ - static bool ExceptionHandlingEnabled = false; - - char *ExcFileName = NULL; - Index ExcLineNumber = 0; - - ExcFrame *ExcCurFrameP = NULL; - - static ExcProc *ExcUnCaughtP = NULL; - - /* - * Exported Functions - */ - - /* - * EnableExceptionHandling - * Enables/disables the exception handling system. - * - * Note: - * This must be called before any exceptions occur. I.e., call this first! - * This routine will not return if an error is detected. - * This does not follow the usual Enable... protocol. - * This should be merged more closely with the error logging and tracing - * packages. - * - * Exceptions: - * none - */ - /* - * Excection handling should be supported by the language, thus there should - * be no need to explicitly enable exception processing. - * - * This function should probably not be called, ever. Currently it does - * almost nothing. If there is a need for this intialization and checking. - * then this function should be converted to the new-style Enable code and - * called by all the other module Enable functions. - */ - void - EnableExceptionHandling(bool on) - { - if (on == ExceptionHandlingEnabled) - { - /* XXX add logging of failed state */ - proc_exit(255); - /* ExitPostgres(FatalExitStatus); */ - } - - if (on) - { /* initialize */ - ; - } - else - { /* cleanup */ - ExcFileName = NULL; - ExcLineNumber = 0; - ExcCurFrameP = NULL; - ExcUnCaughtP = NULL; - } - - ExceptionHandlingEnabled = on; - } - - static void - ExcPrint(Exception *excP, - ExcDetail detail, - ExcData data, - ExcMessage message) - { - /* this buffer is only used if errno has a bogus value: */ - char errorstr_buf[32]; - const char *errorstr; - - #ifdef lint - data = data; - #endif - - /* Save error str before calling any function that might change errno */ - errorstr = strerror(errno); - - /* - * Some strerror()s return an empty string for out-of-range errno. - * This is ANSI C spec compliant, but not exactly useful. - */ - if (errorstr == NULL || *errorstr == '\0') - { - sprintf(errorstr_buf, "error %d", errno); - errorstr = errorstr_buf; - } - - fflush(stdout); /* In case stderr is buffered */ - - if (message != NULL) - fprintf(stderr, "%s", message); - else if (excP->message != NULL) - fprintf(stderr, "%s", excP->message); - else - fprintf(stderr, "UNNAMED EXCEPTION %p", excP); - - fprintf(stderr, " (%ld) [%s]\n", detail, errorstr); - - fflush(stderr); - } - - #ifdef NOT_USED - ExcProc * - ExcGetUnCaught(void) - { - return ExcUnCaughtP; - } - #endif - - #ifdef NOT_USED - ExcProc * - ExcSetUnCaught(ExcProc *newP) - { - ExcProc *oldP = ExcUnCaughtP; - - ExcUnCaughtP = newP; - - return oldP; - } - #endif - - static void - ExcUnCaught(Exception *excP, - ExcDetail detail, - ExcData data, - ExcMessage message) - { - ExcPrint(excP, detail, data, message); - - ExcAbort(excP, detail, data, message); - } - - void - ExcRaise(Exception *excP, - ExcDetail detail, - ExcData data, - ExcMessage message) - { - ExcFrame *efp; - - efp = ExcCurFrameP; - if (efp == NULL) - { - if (ExcUnCaughtP != NULL) - (*ExcUnCaughtP) (excP, detail, data, message); - - ExcUnCaught(excP, detail, data, message); - } - else - { - efp->id = excP; - efp->detail = detail; - efp->data = data; - efp->message = message; - - ExcCurFrameP = efp->link; - - siglongjmp(efp->context, 1); - } - } --- 0 ---- Index: src/backend/utils/error/excabort.c =================================================================== RCS file: src/backend/utils/error/excabort.c diff -N src/backend/utils/error/excabort.c *** src/backend/utils/error/excabort.c 20 Jun 2002 20:29:39 -0000 1.10 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,28 **** - /*------------------------------------------------------------------------- - * - * excabort.c - * Default exception abort code. - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/excabort.c,v 1.10 2002/06/20 20:29:39 momjian Exp $ - * - *------------------------------------------------------------------------- - */ - - #include "postgres.h" - - #include "utils/exc.h" - - void - ExcAbort(const Exception *excP, - ExcDetail detail, - ExcData data, - ExcMessage message) - { - /* dump core */ - abort(); - } --- 0 ---- Index: src/backend/utils/error/excid.c =================================================================== RCS file: src/backend/utils/error/excid.c diff -N src/backend/utils/error/excid.c *** src/backend/utils/error/excid.c 20 Jun 2002 20:29:39 -0000 1.11 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,54 **** - /*------------------------------------------------------------------------- - * - * excid.c - * POSTGRES known exception identifier code. - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/excid.c,v 1.11 2002/06/20 20:29:39 momjian Exp $ - * - *------------------------------------------------------------------------- - */ - - #include "postgres.h" - - /***************************************************************************** - * Generic Recoverable Exceptions * - *****************************************************************************/ - - - /* - * FailedAssertion - * Indicates an Assert(...) failed. - */ - Exception FailedAssertion = {"Failed Assertion"}; - - /* - * BadState - * Indicates a function call request is inconsistent with module state. - */ - Exception BadState = {"Bad State for Function Call"}; - - /* - * BadArg - * Indicates a function call argument or arguments is out-of-bounds. - */ - Exception BadArg = {"Bad Argument to Function Call"}; - - /***************************************************************************** - * Specific Recoverable Exceptions * - *****************************************************************************/ - - /* - * Unimplemented - * Indicates a function call request requires unimplemented code. - */ - Exception Unimplemented = {"Unimplemented Functionality"}; - - Exception CatalogFailure = {"Catalog failure"}; /* XXX inconsistent */ - Exception InternalError = {"Internal Error"}; /* XXX inconsistent */ - Exception SemanticError = {"Semantic Error"}; /* XXX inconsistent */ - Exception SystemError = {"System Error"}; /* XXX inconsistent */ --- 0 ---- Index: src/backend/utils/error/format.c =================================================================== RCS file: src/backend/utils/error/format.c diff -N src/backend/utils/error/format.c *** src/backend/utils/error/format.c 20 Jun 2002 20:29:39 -0000 1.17 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,36 **** - /*------------------------------------------------------------------------- - * - * format.c - * a wrapper around code that does what vsprintf does. - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * $Header: /var/lib/cvs/pgsql/src/backend/utils/error/format.c,v 1.17 2002/06/20 20:29:39 momjian Exp $ - * - *------------------------------------------------------------------------- - */ - #include "postgres.h" - - #define FormMaxSize 1024 - #define FormMinSize (FormMaxSize / 8) - - static char FormBuf[FormMaxSize]; - - - /* ---------------- - * vararg_format - * ---------------- - */ - char * - vararg_format(const char *fmt,...) - { - va_list args; - - va_start(args, fmt); - vsnprintf(FormBuf, FormMaxSize - 1, fmt, args); - va_end(args); - return FormBuf; - } --- 0 ---- Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.30 diff -c -r1.30 mcxt.c *** src/backend/utils/mmgr/mcxt.c 20 Jun 2002 20:29:40 -0000 1.30 --- src/backend/utils/mmgr/mcxt.c 29 Jul 2002 19:14:42 -0000 *************** *** 22,28 **** #include "postgres.h" #include "nodes/memnodes.h" - #include "utils/excid.h" #include "utils/memutils.h" --- 22,27 ---- Index: src/include/postgres.h =================================================================== RCS file: /var/lib/cvs/pgsql/src/include/postgres.h,v retrieving revision 1.58 diff -c -r1.58 postgres.h *** src/include/postgres.h 20 Jun 2002 20:29:42 -0000 1.58 --- src/include/postgres.h 29 Jul 2002 19:14:42 -0000 *************** *** 470,486 **** * ---------------------------------------------------------------- */ - typedef char *ExcMessage; - - typedef struct Exception - { - ExcMessage message; - } Exception; - - extern DLLIMPORT Exception FailedAssertion; - extern DLLIMPORT Exception BadArg; - extern DLLIMPORT Exception BadState; - extern DLLIMPORT bool assert_enabled; /* --- 470,475 ---- *************** *** 495,519 **** * Generates an exception if the given condition is true. * */ ! #define Trap(condition, exception) \ do { \ if ((assert_enabled) && (condition)) \ ! ExceptionalCondition(CppAsString(condition), &(exception), \ ! (char*)NULL, __FILE__, __LINE__); \ } while (0) /* * TrapMacro is the same as Trap but it's intended for use in macros: * ! * #define foo(x) (AssertM(x != 0) && bar(x)) * * Isn't CPP fun? */ ! #define TrapMacro(condition, exception) \ ((bool) ((! assert_enabled) || ! (condition) || \ ! (ExceptionalCondition(CppAsString(condition), \ ! &(exception), \ ! (char*) NULL, __FILE__, __LINE__)))) #ifndef USE_ASSERT_CHECKING #define Assert(condition) --- 484,507 ---- * Generates an exception if the given condition is true. * */ ! #define Trap(condition, errorType) \ do { \ if ((assert_enabled) && (condition)) \ ! ExceptionalCondition(CppAsString(condition), (errorType), \ ! __FILE__, __LINE__); \ } while (0) /* * TrapMacro is the same as Trap but it's intended for use in macros: * ! * #define foo(x) (AssertMacro(x != 0) && bar(x)) * * Isn't CPP fun? */ ! #define TrapMacro(condition, errorType) \ ((bool) ((! assert_enabled) || ! (condition) || \ ! (ExceptionalCondition(CppAsString(condition), (errorType), \ ! __FILE__, __LINE__)))) #ifndef USE_ASSERT_CHECKING #define Assert(condition) *************** *** 523,594 **** #define assert_enabled 0 #else #define Assert(condition) \ ! Trap(!(condition), FailedAssertion) #define AssertMacro(condition) \ ! ((void) TrapMacro(!(condition), FailedAssertion)) #define AssertArg(condition) \ ! Trap(!(condition), BadArg) #define AssertState(condition) \ ! Trap(!(condition), BadState) #endif /* USE_ASSERT_CHECKING */ ! /* ! * LogTrap ! * Generates an exception with a message if the given condition is true. ! * ! */ ! #define LogTrap(condition, exception, printArgs) \ ! do { \ ! if ((assert_enabled) && (condition)) \ ! ExceptionalCondition(CppAsString(condition), &(exception), \ ! vararg_format printArgs, __FILE__, __LINE__); \ ! } while (0) ! ! /* ! * LogTrapMacro is the same as LogTrap but it's intended for use in macros: ! * ! * #define foo(x) (LogAssertMacro(x != 0, "yow!") && bar(x)) ! */ ! #define LogTrapMacro(condition, exception, printArgs) \ ! ((bool) ((! assert_enabled) || ! (condition) || \ ! (ExceptionalCondition(CppAsString(condition), \ ! &(exception), \ ! vararg_format printArgs, __FILE__, __LINE__)))) ! ! extern int ExceptionalCondition(char *conditionName, ! Exception *exceptionP, char *details, char *fileName, int lineNumber); - - extern char * - vararg_format(const char *fmt,...) - /* This lets gcc check the format string for consistency. */ - __attribute__((format(printf, 1, 2))); - - #ifndef USE_ASSERT_CHECKING - #define LogAssert(condition, printArgs) - #define LogAssertMacro(condition, printArgs) true - #define LogAssertArg(condition, printArgs) - #define LogAssertState(condition, printArgs) - #else - #define LogAssert(condition, printArgs) \ - LogTrap(!(condition), FailedAssertion, printArgs) - - #define LogAssertMacro(condition, printArgs) \ - LogTrapMacro(!(condition), FailedAssertion, printArgs) - - #define LogAssertArg(condition, printArgs) \ - LogTrap(!(condition), BadArg, printArgs) - - #define LogAssertState(condition, printArgs) \ - LogTrap(!(condition), BadState, printArgs) - - #ifdef ASSERT_CHECKING_TEST - extern int assertTest(int val); - #endif - #endif /* USE_ASSERT_CHECKING */ /* ---------------------------------------------------------------- * Section 4: genbki macros used by catalog/pg_xxx.h files --- 511,530 ---- #define assert_enabled 0 #else #define Assert(condition) \ ! Trap(!(condition), "FailedAssertion") #define AssertMacro(condition) \ ! ((void) TrapMacro(!(condition), "FailedAssertion")) #define AssertArg(condition) \ ! Trap(!(condition), "BadArgument") #define AssertState(condition) \ ! Trap(!(condition), "BadState") #endif /* USE_ASSERT_CHECKING */ ! extern int ExceptionalCondition(char *conditionName, char *errorType, char *fileName, int lineNumber); /* ---------------------------------------------------------------- * Section 4: genbki macros used by catalog/pg_xxx.h files Index: src/include/utils/exc.h =================================================================== RCS file: src/include/utils/exc.h diff -N src/include/utils/exc.h *** src/include/utils/exc.h 20 Jun 2002 20:29:52 -0000 1.24 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,88 **** - /*------------------------------------------------------------------------- - * - * exc.h - * POSTGRES exception handling definitions. - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: exc.h,v 1.24 2002/06/20 20:29:52 momjian Exp $ - * - *------------------------------------------------------------------------- - */ - #ifndef EXC_H - #define EXC_H - - #include - - extern char *ExcFileName; - extern Index ExcLineNumber; - - typedef sigjmp_buf ExcContext; - - typedef Exception *ExcId; - typedef long ExcDetail; - typedef char *ExcData; - - typedef struct ExcFrame - { - struct ExcFrame *link; - ExcContext context; - ExcId id; - ExcDetail detail; - ExcData data; - ExcMessage message; - } ExcFrame; - - extern ExcFrame *ExcCurFrameP; - - /* These are not used anywhere 1998/6/15 */ - #define ExcBegin() \ - do { \ - ExcFrame exception; \ - \ - exception.link = ExcCurFrameP; \ - if (sigsetjmp(exception.context, 1) == 0) \ - { \ - ExcCurFrameP = &exception; - - #define ExcExcept() \ - } \ - ExcCurFrameP = exception.link; \ - } \ - else \ - { \ - { - - #define ExcEnd() \ - } \ - } \ - } while(0) - - #define raise4(x, t, d, message) \ - ExcRaise(&(x), (ExcDetail)(t), (ExcData)(d), (ExcMessage)(message)) - - #define reraise() \ - raise4(*exception.id,exception.detail,exception.data,exception.message) - - typedef void ExcProc (Exception *, ExcDetail, ExcData, ExcMessage); - - - /* - * prototypes for functions in exc.c - */ - extern void EnableExceptionHandling(bool on); - extern void ExcRaise(Exception *excP, - ExcDetail detail, - ExcData data, - ExcMessage message); - - - /* - * prototypes for functions in excabort.c - */ - extern void ExcAbort(const Exception *excP, ExcDetail detail, ExcData data, - ExcMessage message); - - #endif /* EXC_H */ --- 0 ---- Index: src/include/utils/excid.h =================================================================== RCS file: src/include/utils/excid.h diff -N src/include/utils/excid.h *** src/include/utils/excid.h 20 Jun 2002 20:29:52 -0000 1.14 --- /dev/null 1 Jan 1970 00:00:00 -0000 *************** *** 1,31 **** - /*------------------------------------------------------------------------- - * - * excid.h - * POSTGRES known exception identifier definitions. - * - * - * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: excid.h,v 1.14 2002/06/20 20:29:52 momjian Exp $ - * - *------------------------------------------------------------------------- - */ - #ifndef EXCID_H - #define EXCID_H - - /* note: these first three are also declared in postgres.h */ - extern DLLIMPORT Exception FailedAssertion; - extern DLLIMPORT Exception BadState; - extern DLLIMPORT Exception BadArg; - extern DLLIMPORT Exception Unimplemented; - - extern DLLIMPORT Exception CatalogFailure; /* XXX inconsistent naming - * style */ - extern DLLIMPORT Exception InternalError; /* XXX inconsistent naming - * style */ - extern DLLIMPORT Exception SemanticError; /* XXX inconsistent naming - * style */ - extern DLLIMPORT Exception SystemError; /* XXX inconsistent naming style */ - - #endif /* EXCID_H */ --- 0 ----