summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls11
-rw-r--r--generic/tcl.h4
-rw-r--r--generic/tclDecls.h33
-rw-r--r--generic/tclInt.decls5
-rw-r--r--generic/tclIntPlatDecls.h9
-rw-r--r--generic/tclPanic.c21
-rw-r--r--generic/tclStubInit.c11
7 files changed, 37 insertions, 57 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 14c014b..f60a719 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tcl.decls,v 1.48 2001/05/30 08:57:06 dkf Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.49 2001/06/08 20:06:11 dgp Exp $
library tcl
@@ -36,7 +36,7 @@ declare 1 generic {
int exact, ClientData *clientDataPtr )
}
declare 2 generic {
- void Tcl_Panic(char *format, ...)
+ void Tcl_Panic(CONST char *format, ...)
}
declare 3 generic {
char * Tcl_Alloc(unsigned int size)
@@ -967,8 +967,8 @@ declare 276 generic {
declare 277 generic {
Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options)
}
-declare 278 {unix win} {
- void Tcl_PanicVA(char *format, va_list argList)
+declare 278 generic {
+ void Tcl_PanicVA(CONST char *format, va_list argList)
}
declare 279 generic {
void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type)
@@ -1588,8 +1588,7 @@ declare 6 mac {
}
# These are not in MSL 2.1.2, so we need to export them from the
-# Tcl shared library. They are found in the compat directory
-# except the panic routine which is found in tclMacPanic.h.
+# Tcl shared library. They are found in the compat directory.
declare 7 mac {
int strncasecmp(CONST char *s1, CONST char *s2, size_t n)
diff --git a/generic/tcl.h b/generic/tcl.h
index 507f952..3e8a71a 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.90 2001/05/28 22:26:43 hobbs Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.91 2001/06/08 20:06:11 dgp Exp $
*/
#ifndef _TCL
@@ -597,7 +597,7 @@ typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData));
typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[]));
typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
-typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(char *, format));
+typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(CONST char *, format));
typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
Tcl_Channel chan, char *address, int port));
typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index b2a6031..bb600ed 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.50 2001/05/30 08:57:06 dkf Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.51 2001/06/08 20:06:11 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -35,7 +35,7 @@ EXTERN CONST char * Tcl_PkgRequireEx _ANSI_ARGS_((Tcl_Interp * interp,
CONST char * name, CONST char * version,
int exact, ClientData * clientDataPtr));
/* 2 */
-EXTERN void Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(char *,format));
+EXTERN void Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
/* 3 */
EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size));
/* 4 */
@@ -898,16 +898,9 @@ EXTERN int Tcl_VarEvalVA _ANSI_ARGS_((Tcl_Interp * interp,
/* 277 */
EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int * statPtr,
int options));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-/* 278 */
-EXTERN void Tcl_PanicVA _ANSI_ARGS_((char * format,
- va_list argList));
-#endif /* UNIX */
-#ifdef __WIN32__
/* 278 */
-EXTERN void Tcl_PanicVA _ANSI_ARGS_((char * format,
+EXTERN void Tcl_PanicVA _ANSI_ARGS_((CONST char * format,
va_list argList));
-#endif /* __WIN32__ */
/* 279 */
EXTERN void Tcl_GetVersion _ANSI_ARGS_((int * major, int * minor,
int * patchLevel, int * type));
@@ -1388,7 +1381,7 @@ typedef struct TclStubs {
int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* name, CONST char* version, ClientData clientData)); /* 0 */
CONST char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 1 */
- void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(char *,format)); /* 2 */
+ void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 2 */
char * (*tcl_Alloc) _ANSI_ARGS_((unsigned int size)); /* 3 */
void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */
char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 5 */
@@ -1712,15 +1705,7 @@ typedef struct TclStubs {
void (*tcl_SetErrorCodeVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 275 */
int (*tcl_VarEvalVA) _ANSI_ARGS_((Tcl_Interp * interp, va_list argList)); /* 276 */
Tcl_Pid (*tcl_WaitPid) _ANSI_ARGS_((Tcl_Pid pid, int * statPtr, int options)); /* 277 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void (*tcl_PanicVA) _ANSI_ARGS_((char * format, va_list argList)); /* 278 */
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tcl_PanicVA) _ANSI_ARGS_((char * format, va_list argList)); /* 278 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void *reserved278;
-#endif /* MAC_TCL */
+ void (*tcl_PanicVA) _ANSI_ARGS_((CONST char * format, va_list argList)); /* 278 */
void (*tcl_GetVersion) _ANSI_ARGS_((int * major, int * minor, int * patchLevel, int * type)); /* 279 */
void (*tcl_InitMemory) _ANSI_ARGS_((Tcl_Interp * interp)); /* 280 */
Tcl_Channel (*tcl_StackChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_ChannelType * typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan)); /* 281 */
@@ -3034,18 +3019,10 @@ extern TclStubs *tclStubsPtr;
#define Tcl_WaitPid \
(tclStubsPtr->tcl_WaitPid) /* 277 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef Tcl_PanicVA
-#define Tcl_PanicVA \
- (tclStubsPtr->tcl_PanicVA) /* 278 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef Tcl_PanicVA
#define Tcl_PanicVA \
(tclStubsPtr->tcl_PanicVA) /* 278 */
#endif
-#endif /* __WIN32__ */
#ifndef Tcl_GetVersion
#define Tcl_GetVersion \
(tclStubsPtr->tcl_GetVersion) /* 279 */
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 241390d..8835119 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tclInt.decls,v 1.26 2001/05/17 02:13:03 hobbs Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.27 2001/06/08 20:06:11 dgp Exp $
library tcl
@@ -725,6 +725,9 @@ declare 23 mac {
declare 25 mac {
int TclMacChmod(char *path, int mode)
}
+declare 26 mac {
+ void TclMacSetPanic(void)
+}
############################
# Windows specific internals
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index a288b03..ce5e87c 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -9,7 +9,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.9 2000/07/26 01:30:59 davidg Exp $
+ * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.10 2001/06/08 20:06:11 dgp Exp $
*/
#ifndef _TCLINTPLATDECLS
@@ -194,6 +194,8 @@ EXTERN FILE * TclMacFOpenHack _ANSI_ARGS_((CONST char * path,
/* Slot 24 is reserved */
/* 25 */
EXTERN int TclMacChmod _ANSI_ARGS_((char * path, int mode));
+/* 26 */
+EXTERN void TclMacSetPanic _ANSI_ARGS_((void));
#endif /* MAC_TCL */
typedef struct TclIntPlatStubs {
@@ -268,6 +270,7 @@ typedef struct TclIntPlatStubs {
FILE * (*tclMacFOpenHack) _ANSI_ARGS_((CONST char * path, CONST char * mode)); /* 23 */
void *reserved24;
int (*tclMacChmod) _ANSI_ARGS_((char * path, int mode)); /* 25 */
+ void (*tclMacSetPanic) _ANSI_ARGS_((void)); /* 26 */
#endif /* MAC_TCL */
} TclIntPlatStubs;
@@ -521,6 +524,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclMacChmod \
(tclIntPlatStubsPtr->tclMacChmod) /* 25 */
#endif
+#ifndef TclMacSetPanic
+#define TclMacSetPanic \
+ (tclIntPlatStubsPtr->tclMacSetPanic) /* 26 */
+#endif
#endif /* MAC_TCL */
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 87bc177..4e4b06c 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -2,8 +2,8 @@
* tclPanic.c --
*
* Source code for the "Tcl_Panic" library procedure for Tcl;
- * individual applications will probably override this with
- * an application-specific panic procedure.
+ * individual applications will probably call Tcl_SetPanicProc()
+ * to set an application-specific panic procedure.
*
* Copyright (c) 1988-1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPanic.c,v 1.2 1999/03/04 01:01:59 stanton Exp $
+ * RCS: @(#) $Id: tclPanic.c,v 1.3 2001/06/08 20:06:11 dgp Exp $
*/
#include "tclInt.h"
@@ -22,7 +22,8 @@
* specific panic procedure.
*/
-void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL;
+static Tcl_PanicProc *panicProc = NULL;
+
/*
*----------------------------------------------------------------------
@@ -42,7 +43,7 @@ void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL;
void
Tcl_SetPanicProc(proc)
- void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format));
+ Tcl_PanicProc *proc;
{
panicProc = proc;
}
@@ -65,7 +66,7 @@ Tcl_SetPanicProc(proc)
void
Tcl_PanicVA (format, argList)
- char *format; /* Format string, suitable for passing to
+ CONST char *format; /* Format string, suitable for passing to
* fprintf. */
va_list argList; /* Variable argument list. */
{
@@ -97,7 +98,7 @@ Tcl_PanicVA (format, argList)
/*
*----------------------------------------------------------------------
*
- * panic --
+ * Tcl_Panic --
*
* Print an error message and kill the process.
*
@@ -112,12 +113,12 @@ Tcl_PanicVA (format, argList)
/* VARARGS ARGSUSED */
void
-panic TCL_VARARGS_DEF(char *,arg1)
+Tcl_Panic TCL_VARARGS_DEF(CONST char *,arg1)
{
va_list argList;
- char *format;
+ CONST char *format;
- format = TCL_VARARGS_START(char *,arg1,argList);
+ format = TCL_VARARGS_START(CONST char *,arg1,argList);
Tcl_PanicVA(format, argList);
va_end (argList);
}
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index f4a9909..c20a13c 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubInit.c,v 1.50 2001/05/30 08:57:06 dkf Exp $
+ * RCS: @(#) $Id: tclStubInit.c,v 1.51 2001/06/08 20:06:11 dgp Exp $
*/
#include "tclInt.h"
@@ -315,6 +315,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclMacFOpenHack, /* 23 */
NULL, /* 24 */
TclMacChmod, /* 25 */
+ TclMacSetPanic, /* 26 */
#endif /* MAC_TCL */
};
@@ -673,15 +674,7 @@ TclStubs tclStubs = {
Tcl_SetErrorCodeVA, /* 275 */
Tcl_VarEvalVA, /* 276 */
Tcl_WaitPid, /* 277 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- Tcl_PanicVA, /* 278 */
-#endif /* UNIX */
-#ifdef __WIN32__
Tcl_PanicVA, /* 278 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 278 */
-#endif /* MAC_TCL */
Tcl_GetVersion, /* 279 */
Tcl_InitMemory, /* 280 */
Tcl_StackChannel, /* 281 */