FDECL and NDECL in sys/vms

This commit is contained in:
nhmall
2021-01-31 12:49:22 -05:00
parent fadc5f8a5e
commit b851b28cbe
7 changed files with 57 additions and 62 deletions

View File

@@ -309,10 +309,10 @@ typedef __mode_t mode_t;
#define ospeed vms_ospeed
/* used in several files which don't #include "extern.h" */
extern void FDECL(vms_exit, (int));
extern int FDECL(vms_open, (const char *, int, unsigned));
extern FILE *FDECL(vms_fopen, (const char *, const char *));
char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
extern void vms_exit(int);
extern int vms_open(const char *, int, unsigned);
extern FILE *vms_fopen(const char *, const char *);
char *vms_basename(const char *); /* vmsfiles.c */
#endif /* VMSCONF_H */
#endif /* VMS */

View File

@@ -11,11 +11,11 @@
#include <ctype.h>
/* lint supression due to lack of extern.h */
int FDECL(vms_link, (const char *, const char *));
int FDECL(vms_unlink, (const char *));
int FDECL(vms_creat, (const char *, unsigned int));
boolean FDECL(same_dir, (const char *, const char *));
int FDECL(c__translate, (int));
int vms_link(const char *, const char *);
int vms_unlink(const char *);
int vms_creat(const char *, unsigned int);
boolean same_dir(const char *, const char *);
int c__translate(int);
#include <rms.h>
#if 0

View File

@@ -6,10 +6,10 @@
#include "mail.h"
/* lint supression due to lack of extern.h */
unsigned long NDECL(init_broadcast_trapping);
unsigned long NDECL(enable_broadcast_trapping);
unsigned long NDECL(disable_broadcast_trapping);
struct mail_info *NDECL(parse_next_broadcast);
unsigned long init_broadcast_trapping(void);
unsigned long enable_broadcast_trapping(void);
unsigned long disable_broadcast_trapping(void);
struct mail_info *parse_next_broadcast(void);
#ifdef MAIL
#include "wintype.h"
@@ -27,15 +27,15 @@ struct mail_info *NDECL(parse_next_broadcast);
/* #include <string.h> */
#define vms_ok(sts) ((sts) & 1)
static struct mail_info *FDECL(parse_brdcst, (char *));
static void FDECL(filter_brdcst, (char *));
static void NDECL(flush_broadcasts);
static void FDECL(broadcast_ast, (int));
extern char *FDECL(eos, (char *));
extern char *FDECL(strstri, (const char *, const char *));
extern int FDECL(strncmpi, (const char *, const char *, int));
static struct mail_info *parse_brdcst(char *);
static void filter_brdcst(char *);
static void flush_broadcasts(void);
static void broadcast_ast(int);
extern char *eos(char *);
extern char *strstri(const char *, const char *);
extern int strncmpi(const char *, const char *, int);
extern size_t FDECL(strspn, (const char *, const char *));
extern size_t strspn(const char *, const char *);
#ifndef __DECC
extern int VDECL(sscanf, (const char *, const char *, ...));
#endif

View File

@@ -9,22 +9,22 @@
#include <signal.h>
static void NDECL(whoami);
static void FDECL(process_options, (int, char **));
static void NDECL(byebye);
static void whoami(void);
static void process_options(int, char **);
static void byebye(void);
#ifndef SAVE_ON_FATAL_ERROR
#ifndef __DECC
#define vms_handler_type int
#else
#define vms_handler_type unsigned int
#endif
extern void FDECL(VAXC$ESTABLISH,
(vms_handler_type (*) (genericptr_t, genericptr_t)));
static vms_handler_type FDECL(vms_handler, (genericptr_t, genericptr_t));
extern void VAXC$ESTABLISH(vms_handler_type (*) (genericptr_t,
genericptr_t));
static vms_handler_type vms_handler(genericptr_t, genericptr_t);
#include <ssdef.h> /* system service status codes */
#endif
static void NDECL(wd_message);
static void wd_message(void);
static boolean wiz_error_flag = FALSE;
int
@@ -390,13 +390,12 @@ whoami()
}
static void
byebye()
byebye(void)
{
void FDECL((*hup), (int) );
void (*hup)(int) ;
#ifdef SHELL
extern unsigned long dosh_pid, mail_pid;
extern unsigned long FDECL(sys$delprc,
(unsigned long *, const genericptr_t));
extern unsigned long sys$delprc(unsigned long *, const genericptr_t);
/* clean up any subprocess we've spawned that may still be hanging around
*/
@@ -407,9 +406,9 @@ byebye()
#endif
/* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */
hup = (void FDECL((*), (int) )) signal(SIGHUP, SIG_IGN);
if (!g.program_state.exiting++ && hup != (void FDECL((*), (int) )) SIG_DFL
&& hup != (void FDECL((*), (int) )) SIG_IGN) {
hup = (void (*)(int) ) signal(SIGHUP, SIG_IGN);
if (!g.program_state.exiting++ && hup != (void (*)(int) ) SIG_DFL
&& hup != (void (*)(int) ) SIG_IGN) {
(*hup)(SIGHUP);
}
@@ -442,8 +441,7 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */
#endif
void
sethanguphandler(handler)
void FDECL((*handler), (int));
sethanguphandler(void (*handler)(int))
{
(void) signal(SIGHUP, (SIG_RET_TYPE) handler);
}

View File

@@ -9,8 +9,8 @@
int debuggable = 0; /* 1 if we can debug or show a call trace */
void FDECL(vms_exit, (int));
void NDECL(vms_abort);
void vms_exit(int);
void vms_abort(void);
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
extern void VDECL(lib$signal, (unsigned, ...));

View File

@@ -38,10 +38,10 @@ unsigned long sys$assign(), sys$dassgn(), sys$qiow();
unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(),
smg$read_keystroke(), smg$cancel_input();
#else
static short FDECL(parse_function_key, (int));
static short parse_function_key(int);
#endif
static void NDECL(setctty);
static void NDECL(resettty);
static void setctty(void);
static void resettty(void);
#define vms_ok(sts) ((sts) &1)
#define META(c) ((c) | 0x80) /* 8th bit */
@@ -104,7 +104,7 @@ static unsigned long tt_char_restore = 0, tt_char_active = 0,
static unsigned long ctrl_mask = 0;
#ifdef DEBUG
extern int NDECL(nh_vms_getchar);
extern int nh_vms_getchar(void);
/* rename the real vms_getchar and interpose this one in front of it */
int
@@ -524,8 +524,8 @@ introff()
#ifdef TIMED_DELAY
extern unsigned long FDECL(lib$emul, (const long *, const long *,
const long *, long *));
extern unsigned long lib$emul(const long *, const long *, const long *,
long *);
extern unsigned long sys$schdwk(), sys$hiber();
#define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */
@@ -567,7 +567,7 @@ VA_DECL(const char *, s)
VA_END();
#ifndef SAVE_ON_FATAL_ERROR
/* prevent vmsmain's exit handler byebye() from calling hangup() */
sethanguphandler((void FDECL((*), (int) )) SIG_DFL);
sethanguphandler((void (*)(int) )) SIG_DFL;
#endif
exit(EXIT_FAILURE);
}

View File

@@ -34,13 +34,13 @@ extern unsigned long smg$init_term_table_by_type(), smg$del_term_table();
/* this could be static; it's only used within this file;
it won't be used at all if C_LIB$INTIALIZE gets commented out below,
so make it global so that compiler won't complain that it's not used */
int FDECL(vmsexeini, (const void *, const void *, const unsigned char *));
int vmsexeini(const void *, const void *, const unsigned char *);
static int FDECL(veryold, (int));
static char *NDECL(verify_term);
static int veryold(int);
static char *verify_term(void);
#if defined(SHELL) || defined(SUSPEND)
static void FDECL(hack_escape, (BOOLEAN_P, const char *));
static void FDECL(hack_resume, (BOOLEAN_P));
static void hack_escape(boolean, const char *);
static void hack_resume(boolean);
#endif
static int
@@ -565,13 +565,10 @@ dosuspend()
/* this would fit better in vmsfiles.c except that that gets linked
with the utility programs and we don't want this code there */
static void FDECL(savefile, (const char *, int, int *, char ***));
static void savefile(const char *, int, int *, char ***);
static void
savefile(name, indx, asize, array)
const char *name;
int indx, *asize;
char ***array;
savefile(const char *name, int indx, int *asize, char ***array)
{
char **newarray;
int i, oldsize;
@@ -596,8 +593,8 @@ struct dsc {
char *adr;
}; /* descriptor */
typedef unsigned long vmscond; /* vms condition value */
vmscond FDECL(lib$find_file, (const struct dsc *, struct dsc *, genericptr *));
vmscond FDECL(lib$find_file_end, (void **));
vmscond lib$find_file(const struct dsc *, struct dsc *, genericptr *);
vmscond lib$find_file_end(void **);
/* collect a list of character names from all save files for this player */
int
@@ -713,16 +710,16 @@ int how; /* 1: exit after traceback; 2: stay in debugger */
* It all takes place before nethack even starts, and sets up
* `debuggable' to control possible use of lib$signal(SS$_DEBUG).
*/
typedef unsigned FDECL((*condition_handler), (unsigned *, unsigned *));
extern condition_handler FDECL(lib$establish, (condition_handler));
extern unsigned FDECL(lib$sig_to_ret, (unsigned *, unsigned *));
typedef unsigned (*condition_handler)(unsigned *, unsigned *);
extern condition_handler lib$establish(condition_handler);
extern unsigned lib$sig_to_ret(unsigned *, unsigned *);
/* SYS$IMGSTA() is not documented: if called at image startup, it controls
access to the debugger; fortunately, the linker knows now to find it
without needing to link against sys.stb (VAX) or use LINK/System (Alpha).
We won't be calling it, but we indirectly check whether it has already
been called by checking if nethack.exe has it as a transfer address. */
extern unsigned FDECL(sys$imgsta, ());
extern unsigned sys$imgsta(void);
/*
* These structures are in header files contained in sys$lib_c.tlb,