os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/tclPanic.c
Update contrib.
4 * Source code for the "Tcl_Panic" library procedure for Tcl;
5 * individual applications will probably call Tcl_SetPanicProc()
6 * to set an application-specific panic procedure.
8 * Copyright (c) 1988-1993 The Regents of the University of California.
9 * Copyright (c) 1994 Sun Microsystems, Inc.
10 * Copyright (c) 1998-1999 by Scriptics Corporation.
11 * Portions Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiaries. All rights reserved.
13 * See the file "license.terms" for information on usage and redistribution
14 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16 * RCS: @(#) $Id: tclPanic.c,v 1.4.12.2 2006/03/09 23:11:23 dgp Exp $
23 * The panicProc variable contains a pointer to an application
24 * specific panic procedure.
27 static Tcl_PanicProc *panicProc = NULL;
30 * The platformPanicProc variable contains a pointer to a platform
31 * specific panic procedure, if any. ( TclpPanic may be NULL via
35 static Tcl_PanicProc * CONST platformPanicProc = TclpPanic;
39 *----------------------------------------------------------------------
43 * Replace the default panic behavior with the specified functiion.
49 * Sets the panicProc variable.
51 *----------------------------------------------------------------------
55 Tcl_SetPanicProc(proc)
62 *----------------------------------------------------------------------
66 * Print an error message and kill the process.
72 * The process dies, entering the debugger if possible.
74 *----------------------------------------------------------------------
78 Tcl_PanicVA (format, argList)
79 CONST char *format; /* Format string, suitable for passing to
81 va_list argList; /* Variable argument list. */
83 char *arg1, *arg2, *arg3, *arg4; /* Additional arguments (variable in
84 * number) to pass to fprintf. */
85 char *arg5, *arg6, *arg7, *arg8;
87 arg1 = va_arg(argList, char *);
88 arg2 = va_arg(argList, char *);
89 arg3 = va_arg(argList, char *);
90 arg4 = va_arg(argList, char *);
91 arg5 = va_arg(argList, char *);
92 arg6 = va_arg(argList, char *);
93 arg7 = va_arg(argList, char *);
94 arg8 = va_arg(argList, char *);
96 if (panicProc != NULL) {
97 (void) (*panicProc)(format, arg1, arg2, arg3, arg4,
98 arg5, arg6, arg7, arg8);
99 } else if (platformPanicProc != NULL) {
100 (void) (*platformPanicProc)(format, arg1, arg2, arg3, arg4,
101 arg5, arg6, arg7, arg8);
103 (void) fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6,
105 (void) fprintf(stderr, "\n");
106 (void) fflush(stderr);
112 *----------------------------------------------------------------------
116 * Print an error message and kill the process.
122 * The process dies, entering the debugger if possible.
124 *----------------------------------------------------------------------
127 /* VARARGS ARGSUSED */
129 Tcl_Panic TCL_VARARGS_DEF(CONST char *,arg1)
134 format = TCL_VARARGS_START(CONST char *,arg1,argList);
135 Tcl_PanicVA(format, argList);