source: HiSusy/trunk/Delphes-3.0.0/external/tcl/panic.c @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 2.4 KB
Line 
1/*
2 * panic.c --
3 *
4 *      Source code for the "panic" library procedure for Tcl;
5 *      individual applications will probably override this with
6 *      an application-specific panic procedure.
7 *
8 * Copyright (c) 1988-1993 The Regents of the University of California.
9 * Copyright (c) 1994 Sun Microsystems, Inc.
10 *
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 *
14 * RCS: @(#) $Id: panic.c,v 1.1 2008-06-04 13:58:02 demin Exp $
15 */
16
17#include <stdio.h>
18#ifdef NO_STDLIB_H
19#   include "../compat/stdlib.h"
20#else
21#   include <stdlib.h>
22#endif
23
24#define panic panicDummy
25#include "tcl.h"
26#undef panic
27
28# undef TCL_STORAGE_CLASS
29# define TCL_STORAGE_CLASS DLLEXPORT
30
31EXTERN void             panic _ANSI_ARGS_((char *format, char *arg1,
32                            char *arg2, char *arg3, char *arg4, char *arg5,
33                            char *arg6, char *arg7, char *arg8));
34
35/*
36 * The panicProc variable contains a pointer to an application
37 * specific panic procedure.
38 */
39
40void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL;
41
42/*
43 *----------------------------------------------------------------------
44 *
45 * Tcl_SetPanicProc --
46 *
47 *      Replace the default panic behavior with the specified functiion.
48 *
49 * Results:
50 *      None.
51 *
52 * Side effects:
53 *      Sets the panicProc variable.
54 *
55 *----------------------------------------------------------------------
56 */
57
58void
59Tcl_SetPanicProc(proc)
60    void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format));
61{
62    panicProc = proc;
63}
64
65/*
66 *----------------------------------------------------------------------
67 *
68 * panic --
69 *
70 *      Print an error message and kill the process.
71 *
72 * Results:
73 *      None.
74 *
75 * Side effects:
76 *      The process dies, entering the debugger if possible.
77 *
78 *----------------------------------------------------------------------
79 */
80
81        /* VARARGS ARGSUSED */
82void
83panic(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
84    char *format;               /* Format string, suitable for passing to
85                                 * fprintf. */
86    char *arg1, *arg2, *arg3;   /* Additional arguments (variable in number)
87                                 * to pass to fprintf. */
88    char *arg4, *arg5, *arg6, *arg7, *arg8;
89{
90    if (panicProc != NULL) {
91        (void) (*panicProc)(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
92    } else {
93        (void) fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6,
94                arg7, arg8);
95        (void) fprintf(stderr, "\n");
96        (void) fflush(stderr);
97        abort();
98    }
99}
Note: See TracBrowser for help on using the repository browser.