Seth Woolley's Man Viewer

panic(3) - Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, panic, panicVA - report fatal error and abort - man 3 panic

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Tcl_Panic(3)                Tcl Library Procedures                Tcl_Panic(3)


       Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, panic, panicVA - report fatal
       error(8,n) and abort(3,7)

       #include <tcl.h>

       Tcl_Panic(format, arg, arg, ...)

       Tcl_PanicVA(format, argList)


       panic(format, arg, arg, ...)

       panicVA(format, argList)

       CONST char*     format       (in(1,8))      A printf-style format string.

                       arg          (in(1,8))      Arguments  matching  the  format

       va_list         argList      (in(1,8))      An  argument  list  of arguments
                                              matching  the   format   string.
                                              Must have been initialized using
                                              TCL_VARARGS_START,  and  cleared
                                              using va_end.

       Tcl_PanicProc   *panicProc   (in(1,8))      Procedure  to report fatal error(8,n)
                                              message and abort.


       When the Tcl library detects that its internal data structures  are  in(1,8)
       an  inconsistent  state, or that its C procedures have been called in(1,8) a
       manner inconsistent with their documentation,  it  calls  Tcl_Panic  to
       display a message describing the error(8,n) and abort(3,7) the process.  The for-
       mat argument is a format string(3,n) describing how to format the  remaining
       arguments  arg  into an error(8,n) message, according to the same formatting
       rules used by the printf(1,3,1 builtins) family  of  functions.   The  same  formatting
       rules are also used by the builtin Tcl command format.

       In  a  freshly loaded Tcl library, Tcl_Panic prints the formatted error(8,n)
       message to the standard error(8,n) file(1,n) of the process, and then calls abort(3,7)
       to terminate the process.  Tcl_Panic does not return.

       Tcl_SetPanicProc  may be used to modify the behavior of Tcl_Panic.  The
       panicProc argument should match the type Tcl_PanicProc:

              typedef void Tcl_PanicProc(
                CONST char *format,
                arg, arg,...);

       After Tcl_SetPanicProc returns, any future calls to Tcl_Panic will call
       panicProc,  passing  along  the  format and arg arguments.  To maintain
       consistency with the callers of Tcl_Panic, panicProc must  not  return;
       it  must  call abort(3,7).  panicProc should avoid making calls into the Tcl
       library, or into other libraries that may call the Tcl  library,  since
       the  original  call  to Tcl_Panic indicates the Tcl library is not in(1,8) a
       state of reliable operation.

       The typical use of Tcl_SetPanicProc arranges for the error(8,n)  message  to
       be  displayed or reported in(1,8) a manner more suitable for the application
       or the platform.  As an example, the  Windows  implementation  of  wish
       calls Tcl_SetPanicProc to force all panic messages to be displayed in(1,8) a
       system dialog(1,3,n) box, rather than to be printed to the standard error(8,n) file(1,n)
       (usually not visible under Windows).

       Although the primary callers of Tcl_Panic are the procedures of the Tcl
       library, Tcl_Panic is a public function and may be called by any exten-
       sion  or  application that wishes to abort(3,7) the process and have a panic
       message displayed the same way that panic messages  from  Tcl  will  be

       Tcl_PanicVA  is  the  same as Tcl_Panic except that instead of taking a
       variable number of arguments it takes an argument list.  The procedures
       panic  and  panicVA  are synonyms (implemented as macros) for Tcl_Panic
       and Tcl_PanicVA, respectively.  They exist to  support  old  code;  new
       code should use direct calls to Tcl_Panic or Tcl_PanicVA.

       abort(3,7)(3), printf(1,3,1 builtins)(3), exec(3,n,1 builtins)(n), format(n)

       abort(3,7), fatal, error(8,n)

Tcl                                   8.4                         Tcl_Panic(3)

References for this manual (incoming links)