NHDT->ANH, nethack->anethack, nhdat->anhdat
[aNetHack.git] / sys / vms / vmsmisc.c
blob0b17e6ff6a6032e0b346e0a494e12be6a63d7f94
1 /* aNetHack 0.0.1 vmsmisc.c $ANH-Date: 1432512789 2015/05/25 00:13:09 $ $ANH-Branch: master $:$ANH-Revision: 1.10 $ */
2 /* aNetHack may be freely redistributed. See license for details. */
4 #include "config.h"
5 #undef exit
6 #include <ssdef.h>
7 #include <stsdef.h>
9 int debuggable = 0; /* 1 if we can debug or show a call trace */
11 void FDECL(vms_exit, (int));
12 void NDECL(vms_abort);
14 /* first arg should be unsigned long but <lib$routines.h> has unsigned int */
15 extern void VDECL(lib$signal, (unsigned, ...));
17 /* terminate, converting Unix-style exit code into VMS status code */
18 void
19 vms_exit(status)
20 int status;
22 /* convert non-zero to failure, zero to success */
23 exit(status ? (SS$_ABORT | STS$M_INHIB_MSG) : SS$_NORMAL);
24 /* NOT REACHED */
27 /* put the user into the debugger; used for abort() when in wizard mode */
28 void
29 vms_abort()
31 if (debuggable)
32 lib$signal(SS$_DEBUG);
34 /* we'll get here if the debugger isn't available, or if the user
35 uses GO to resume execution instead of EXIT to quit */
36 vms_exit(2); /* don't return to caller (2==arbitrary non-zero) */
37 /* NOT REACHED */
41 * Caveat: the VERYOLD_VMS configuration hasn't been tested in many years.
43 #ifdef VERYOLD_VMS
44 #include "oldcrtl.c"
45 #endif
47 /*vmsmisc.c*/