summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-07-23 11:54:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-07-23 11:54:49 (GMT)
commit53dc25e532b83e02c84f5991389720106c6d9018 (patch)
tree8a146e7138980fa8eb2f598aa7cc0656c444b602
parent542b57cf21284e1bd707e32f5238422e8c368205 (diff)
downloadtcl-53dc25e532b83e02c84f5991389720106c6d9018.zip
tcl-53dc25e532b83e02c84f5991389720106c6d9018.tar.gz
tcl-53dc25e532b83e02c84f5991389720106c6d9018.tar.bz2
Add documentation
-rw-r--r--doc/Panic.313
-rw-r--r--generic/tclDecls.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/doc/Panic.3 b/doc/Panic.3
index 48aed2b..9013e89 100644
--- a/doc/Panic.3
+++ b/doc/Panic.3
@@ -7,7 +7,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- report fatal error and abort
+Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -21,6 +21,9 @@ void
void
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
+void
+\fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
+.sp
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP "const char*" format in
@@ -54,6 +57,14 @@ message is sent to the debugger in stead. If the windows executable
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
system dialog box is used to display the panic message.
.PP
+If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
+and you want to implicitly use the stderr channel of your
+application's C runtime (in stead of the stderr channel of the
+C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
+with \fBTcl_ConsolePanic\fR as its argument. On platforms which
+only have one C runtime (almost all platforms except Windows
+and Cygwin) \fBTcl_ConsolePanic\fR is equivalent to NULL.
+.PP
\fBTcl_SetPanicProc\fR may be used to modify the behavior of
\fBTcl_Panic\fR. The \fIpanicProc\fR argument should match the
type \fBTcl_PanicProc\fR:
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 1ade6ef..4d40be1 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -3789,6 +3789,7 @@ extern const TclStubs *tclStubsPtr;
# define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp())
# define Tcl_GetStringResult(interp) (tclStubsPtr->tcl_GetStringResult(interp))
# define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp))
+# define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc))
# define Tcl_SetVar(interp, varName, newValue, flags) \
(tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags))
# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \