home *** CD-ROM | disk | FTP | other *** search
- /* WIDE AREA INFORMATION SERVER SOFTWARE:
- No guarantees or restrictions. See the readme file for the full standard
- disclaimer.
-
- Morris@think.com
- */
-
- /* panic is an error system interface. On the Mac, it will pop
- * up a little window to explain the problem.
- * On a unix box, it will print out the error and call perror()
- */
-
- #include "cdialect.h"
- #include "panic.h"
- //#include "futil.h"
- #include <ctype.h>
- #include <varargs.h>
-
- #ifndef EXIT_FAILURE /* should be in stdlib */
- #define EXIT_FAILURE (-1)
- #endif /* ndef EXIT_FAILURE */
-
- static void exitAction _AP((long error));
-
- static void
- exitAction(error)
- long error;
- {
- abort();
- }
-
- #define PANIC_HEADER "Fatal Error: "
-
- void
- panic(va_alist)
- va_dcl
- {
- va_list ap; /* the variable arguments */
- char* format;
-
- fprintf(stderr,PANIC_HEADER);
- va_start(ap); /* init ap */
- format = va_arg(ap,char*); /* get the format */
- vfprintf(stderr,format,ap); /* print the contents */
- va_end(ap); /* free ap */
-
- fprintf(stderr,"\n");
- fflush(stderr);
-
- exitAction(0);
- }
-