/* vms_link() -- create an additional directory for an existing file */
int
-vms_link(file, new)
-const char *file, *new;
+vms_link(const char *file, const char *new)
{
struct FAB fab;
struct NAM nam;
(because the file won't be deleted, just made inaccessible!).
*/
int
-vms_unlink(file)
-const char *file;
+vms_unlink(const char *file)
{
struct FAB fab;
struct NAM nam;
*/
#undef creat
int
-vms_creat(file, mode)
-const char *file;
-unsigned int mode;
+vms_creat(const char *file, unsigned int mode)
{
char filnambuf[BUFSIZ]; /*(not BUFSZ)*/
*/
#undef open
int
-vms_open(file, flags, mode)
-const char *file;
-int flags;
-unsigned int mode;
+vms_open(const char *file, int flags, unsigned int mode)
{
char filnambuf[BUFSIZ]; /*(not BUFSZ)*/
int fd;
/* do likewise for fopen() */
#undef fopen
FILE *
-vms_fopen(file, mode)
-const char *file, *mode;
+vms_fopen(const char *file, const char *mode)
{
char filnambuf[BUFSIZ]; /*(not BUFSZ)*/
FILE *fp;
the command line). This version doesn't handle Unix-style file specs.
*/
boolean
-same_dir(d1, d2)
-const char *d1, *d2;
+same_dir(const char *d1, const char *d2)
{
if (!d1 || !*d1 || !d2 || !*d2)
return FALSE;
#define CASE2(V, W) CASE1(V) : CASE1(W)
int
-c__translate(code)
-int code;
+c__translate(int code)
{
register int trans;
/* return a copy of the 'base' portion of a filename */
char *
-vms_basename(name)
-const char *name;
+vms_basename(const char *name)
{
unsigned len;
char *base, *base_p;
/* try to decipher and categorize broadcast message text
*/
static struct mail_info *
-parse_brdcst(buf) /* called by parse_next_broadcast() */
-char *buf; /* input: filtered broadcast text */
+parse_brdcst(char *buf) /* called by parse_next_broadcast() */
+ /* input: filtered broadcast text */
{
int typ;
char *txt;
/* filter out non-printable characters and redundant noise
*/
-static void filter_brdcst(buf) /* called by parse_next_broadcast() */
-register char *buf; /* in: original text; out: filtered text */
+static void filter_brdcst(register char *buf) /* called by parse_next_broadcast() */
+ /* in: original text; out: filtered text */
{
register char c, *p, *buf_p;
/* fetch the text of a captured broadcast, then mangle and decipher it
*/
-struct mail_info *parse_next_broadcast() /* called by ckmailstatus(mail.c) */
+struct mail_info *parse_next_broadcast(void) /* called by ckmailstatus(mail.c) */
{
short length, msg_type;
$DESCRIPTOR(message, empty_string); /* string descriptor for buf[] */
/* spit out any pending broadcast messages whenever we leave
*/
-static void flush_broadcasts() /* called from disable_broadcast_trapping() */
+static void flush_broadcasts(void) /* called from disable_broadcast_trapping() */
{
if (broadcasts > 0) {
short len, typ;
*/
/*ARGSUSED*/
static void
-broadcast_ast(dummy) /* called asynchronously by terminal driver */
-int dummy UNUSED;
+broadcast_ast(int dummy UNUSED) /* called asynchronously by terminal driver */
{
broadcasts++;
}
/* initialize the broadcast manipulation code; SMG makes this easy
*/
unsigned long
-init_broadcast_trapping() /* called by setftty() [once only] */
+init_broadcast_trapping(void) /* called by setftty() [once only] */
{
unsigned long sts, preserve_screen_flag = 1;
/* set up the terminal driver to deliver $brkthru data to a mailbox device
*/
unsigned long
-enable_broadcast_trapping() /* called by setftty() */
+enable_broadcast_trapping(void) /* called by setftty() */
{
unsigned long sts = 1;
/* return to 'normal'; $brkthru data goes straight to the terminal
*/
unsigned long
-disable_broadcast_trapping() /* called by settty() */
+disable_broadcast_trapping(void) /* called by settty() */
{
unsigned long sts = 1;
/* simple stubs for non-mail configuration */
unsigned long
-init_broadcast_trapping()
+init_broadcast_trapping(void)
{
return 1;
}
unsigned long
-enable_broadcast_trapping()
+enable_broadcast_trapping(void)
{
return 1;
}
unsigned long
-disable_broadcast_trapping()
+disable_broadcast_trapping(void)
{
return 1;
}
struct mail_info *
-parse_next_broadcast()
+parse_next_broadcast(void)
{
return 0;
}
}
void
-ckmailstatus()
+ckmailstatus(void)
{
struct mail_info *brdcst, *parse_next_broadcast();
}
int
-main()
+main(int argc UNUSED, char *argv[] UNUSED)
{
char dummy[BUFSIZ];
}
void
-panic(s)
-char *s;
+panic(char *s)
{
raw_print(s);
exit(EXIT_FAILURE);
}
void
-raw_print(s)
-char *s;
+raw_print(char *s)
{
puts(s);
fflush(stdout);
}
void
-wait_synch()
+wait_synch(void)
{
char dummy[BUFSIZ];
static boolean wiz_error_flag = FALSE;
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
NHFILE *nhfp;
#ifdef CHDIR
}
static void
-process_options(argc, argv)
-int argc;
-char *argv[];
+process_options(int argc, char *argv[])
{
int i;
#ifdef CHDIR
void
-chdirx(dir, wr)
-const char *dir;
-boolean wr;
+chdirx(const char *dir, boolean wr)
{
#ifndef HACKDIR
static const char *defdir = ".";
#endif /* CHDIR */
static void
-whoami()
+whoami(void)
{
/*
* Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS;
from saving the game after a fatal error has occurred. */
/*ARGSUSED*/
static vms_handler_type /* should be `unsigned long', but the -*/
-vms_handler(sigargs, mechargs) /*+ prototype in <signal.h> is screwed */
-genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */
+vms_handler( /*+ prototype in <signal.h> is screwed */
+genericptr_t sigargs,
+genericptr_t mechargs) /* [0] is argc, [1..argc] are the real args */
{
unsigned long condition = ((unsigned long *) sigargs)[1];
#ifdef PORT_HELP
void
-port_help()
+port_help(void)
{
/*
* Display VMS-specific help. Just show contents of the helpfile
/* validate wizard mode if player has requested access to it */
boolean
-authorize_wizard_mode()
+authorize_wizard_mode(void)
{
if (!strcmpi(nh_getenv("USER"), WIZARD_NAME))
return TRUE;
}
static void
-wd_message()
+wd_message(void)
{
if (wiz_error_flag) {
pline("Only user \"%s\" may access debug (wizard) mode.",
}
unsigned long
-sys_random_seed()
+sys_random_seed(void)
{
unsigned long seed;
unsigned long pid = (unsigned long) getpid();
/* terminate, converting Unix-style exit code into VMS status code */
void
-vms_exit(status)
-int status;
+vms_exit(int status)
{
/* convert non-zero to failure, zero to success */
exit(status ? (SS$_ABORT | STS$M_INHIB_MSG) : SS$_NORMAL);
/* put the user into the debugger; used for abort() when in wizard mode */
void
-vms_abort()
+vms_abort(void)
{
if (debuggable)
lib$signal(SS$_DEBUG);
/* rename the real vms_getchar and interpose this one in front of it */
int
-vms_getchar()
+vms_getchar(void)
{
static int althack = 0, altprefix;
char *nhalthack;
#endif /*DEBUG*/
int
-vms_getchar()
+vms_getchar(void)
{
short key;
#ifdef USE_QIO_INPUT
/* Ultimate return value is (index into smg_keypad_codes[] + 256). */
static short
-parse_function_key(c)
-register int c;
+parse_function_key(register int c)
{
struct _rd_iosb iosb;
unsigned long sts;
#endif /* USE_QIO_INPUT */
static void
-setctty()
+setctty(void)
{
struct _sm_iosb iosb;
unsigned long status;
/* atexit() routine */
static void
-resettty()
+resettty(void)
{
if (settty_needed) {
bombing = TRUE; /* don't clear screen; preserve traceback info */
* (for initial startup and for returning from '!' or ^Z).
*/
void
-gettty()
+gettty(void)
{
static char dev_tty[] = "TT:";
static $DESCRIPTOR(tty_dsc, dev_tty);
/* reset terminal to original state */
void
-settty(s)
-const char *s;
+settty(const char *s)
{
if (!bombing)
end_screen();
/* same as settty, with no clearing of the screen */
void
-shuttty(s)
-const char *s;
+shuttty(const char *s)
{
bombing = TRUE;
settty(s);
}
void
-setftty()
+setftty(void)
{
unsigned long mask = LIB$M_CLI_CTRLT | LIB$M_CLI_CTRLY;
/* enable kbd interupts if enabled when game started */
void
-intron()
+intron(void)
{
intr_char = CTRL('C');
}
/* disable kbd interrupts if required*/
void
-introff()
+introff(void)
{
intr_char = 0;
}
/* sleep for specified number of milliseconds (note: the timer used
generally only has 10-millisecond resolution at the hardware level...) */
void
-msleep(mseconds)
-unsigned mseconds; /* milliseconds */
+msleep(unsigned mseconds) /* milliseconds */
{
long pid = 0L, zero = 0L, msec, qtime[2];
#endif
static int
-veryold(fd)
-int fd;
+veryold(int fd)
{
register int i;
time_t date;
}
void
-getlock()
+getlock(void)
{
register int i = 0, fd;
}
}
-void regularize(s) /* normalize file name */
-register char *s;
+/* normalize file name */
+void regularize(register char *s)
{
register char *lp;
#undef getuid
int
-vms_getuid()
+vms_getuid(void)
{
return ((getgid() << 16) | getuid());
}
#endif
/* check whether the open file specified by `fd' is in stream-lf format */
boolean
-file_is_stmlf(fd)
-int fd;
+file_is_stmlf(int fd)
{
int rfm;
struct stat buf;
/* vms_define() - assign a value to a logical name */
int
-vms_define(name, value, flag)
-const char *name;
-const char *value;
-int flag;
+vms_define(const char *name, const char *value, int flag)
{
struct dsc {
unsigned short len, mbz;
/* vms_putenv() - create or modify an environment value */
int
-vms_putenv(string)
-const char *string;
+vms_putenv(const char *string)
{
char name[ENVSIZ + 1], value[ENVSIZ + 1], *p; /* [255+1] */
Called by verify_termcap() for convenience.
*/
static char *
-verify_term()
+verify_term(void)
{
char *term = getenv("NETHACK_TERM");
if (!term)
#define NETHACK_DEF_TERMCAP "nethackdir:termcap"
#define HACK_DEF_TERMCAP "hackdir:termcap"
-char *verify_termcap() /* called from startup(src/termcap.c) */
+char *verify_termcap(void) /* called from startup(src/termcap.c) */
{
struct stat dummy;
const char *tc = getenv("TERMCAP");
static unsigned long oprv[2];
void
-privoff()
+privoff(void)
{
unsigned long pid = 0, prv[2] = { ~0, ~0 };
unsigned short code = JPI$_PROCPRIV;
}
void
-privon()
+privon(void)
{
(void) sys$setprv(1, oprv, 0, (unsigned long *) 0);
}
#ifdef SYSCF
boolean
-check_user_string(userlist)
-const char *userlist;
+check_user_string(const char *userlist)
{
char usrnambuf[BUFSZ];
const char *sptr, *p, *q;
#if defined(SHELL) || defined(SUSPEND)
static void
-hack_escape(screen_manip, msg_str)
-boolean screen_manip;
-const char *msg_str;
+hack_escape(boolean screen_manip, const char *msg_str)
{
if (screen_manip)
suspend_nhwindows(msg_str); /* clear screen, reset terminal, &c */
}
static void
-hack_resume(screen_manip)
-boolean screen_manip;
+hack_resume(boolean screen_manip)
{
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
if (wizard)
leave any process hanging around) */
int
-dosh()
+dosh(void)
{
#ifdef SYSCF
if (!sysopt.shellers || !sysopt.shellers[0]
* will be piped into oblivion. Used for silent phone call rejection.
*/
int
-vms_doshell(execstring, screenoutput)
-const char *execstring;
-boolean screenoutput;
+vms_doshell(const char *execstring, boolean screenoutput)
{
unsigned long status, new_pid, spawnflags = 0;
struct dsc$descriptor_s comstring, *command, *inoutfile = 0;
* if not, there's nothing we can do.
*/
int
-dosuspend()
+dosuspend(void)
{
static long owner_pid = -1;
unsigned long status;
/* collect a list of character names from all save files for this player */
int
-vms_get_saved_games(savetemplate, outarray)
-const char *savetemplate; /* wildcarded save file name in native VMS format */
-char ***outarray;
+vms_get_saved_games(const char *savetemplate, /* wildcarded save file name in native VMS format */
+ char ***outarray)
{
struct dsc in, out;
unsigned short l;
/* nethack has detected an internal error; try to give a trace of call stack
*/
void
-vms_traceback(how)
-int how; /* 1: exit after traceback; 2: stay in debugger */
+vms_traceback(int how) /* 1: exit after traceback; 2: stay in debugger */
{
/* assumes that a static initializer applies to the first union
field and that no padding will be placed between len and str */
with magic arguments; C run-time library won't be initialized yet */
/*ARGSUSED*/
int
-vmsexeini(inirtn_unused, clirtn_unused, imghdr)
-const void *inirtn_unused, *clirtn_unused;
-const unsigned char *imghdr;
+vmsexeini(const void *inirtn_unused, const void *clirtn_unused,
+ const unsigned char *imghdr)
{
const struct ihd *vax_hdr;
const struct eihd *axp_hdr;