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
+4 -4
View File
@@ -309,10 +309,10 @@ typedef __mode_t mode_t;
#define ospeed vms_ospeed #define ospeed vms_ospeed
/* used in several files which don't #include "extern.h" */ /* used in several files which don't #include "extern.h" */
extern void FDECL(vms_exit, (int)); extern void vms_exit(int);
extern int FDECL(vms_open, (const char *, int, unsigned)); extern int vms_open(const char *, int, unsigned);
extern FILE *FDECL(vms_fopen, (const char *, const char *)); extern FILE *vms_fopen(const char *, const char *);
char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */ char *vms_basename(const char *); /* vmsfiles.c */
#endif /* VMSCONF_H */ #endif /* VMSCONF_H */
#endif /* VMS */ #endif /* VMS */
+5 -5
View File
@@ -11,11 +11,11 @@
#include <ctype.h> #include <ctype.h>
/* lint supression due to lack of extern.h */ /* lint supression due to lack of extern.h */
int FDECL(vms_link, (const char *, const char *)); int vms_link(const char *, const char *);
int FDECL(vms_unlink, (const char *)); int vms_unlink(const char *);
int FDECL(vms_creat, (const char *, unsigned int)); int vms_creat(const char *, unsigned int);
boolean FDECL(same_dir, (const char *, const char *)); boolean same_dir(const char *, const char *);
int FDECL(c__translate, (int)); int c__translate(int);
#include <rms.h> #include <rms.h>
#if 0 #if 0
+12 -12
View File
@@ -6,10 +6,10 @@
#include "mail.h" #include "mail.h"
/* lint supression due to lack of extern.h */ /* lint supression due to lack of extern.h */
unsigned long NDECL(init_broadcast_trapping); unsigned long init_broadcast_trapping(void);
unsigned long NDECL(enable_broadcast_trapping); unsigned long enable_broadcast_trapping(void);
unsigned long NDECL(disable_broadcast_trapping); unsigned long disable_broadcast_trapping(void);
struct mail_info *NDECL(parse_next_broadcast); struct mail_info *parse_next_broadcast(void);
#ifdef MAIL #ifdef MAIL
#include "wintype.h" #include "wintype.h"
@@ -27,15 +27,15 @@ struct mail_info *NDECL(parse_next_broadcast);
/* #include <string.h> */ /* #include <string.h> */
#define vms_ok(sts) ((sts) & 1) #define vms_ok(sts) ((sts) & 1)
static struct mail_info *FDECL(parse_brdcst, (char *)); static struct mail_info *parse_brdcst(char *);
static void FDECL(filter_brdcst, (char *)); static void filter_brdcst(char *);
static void NDECL(flush_broadcasts); static void flush_broadcasts(void);
static void FDECL(broadcast_ast, (int)); static void broadcast_ast(int);
extern char *FDECL(eos, (char *)); extern char *eos(char *);
extern char *FDECL(strstri, (const char *, const char *)); extern char *strstri(const char *, const char *);
extern int FDECL(strncmpi, (const char *, const char *, int)); 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 #ifndef __DECC
extern int VDECL(sscanf, (const char *, const char *, ...)); extern int VDECL(sscanf, (const char *, const char *, ...));
#endif #endif
+14 -16
View File
@@ -9,22 +9,22 @@
#include <signal.h> #include <signal.h>
static void NDECL(whoami); static void whoami(void);
static void FDECL(process_options, (int, char **)); static void process_options(int, char **);
static void NDECL(byebye); static void byebye(void);
#ifndef SAVE_ON_FATAL_ERROR #ifndef SAVE_ON_FATAL_ERROR
#ifndef __DECC #ifndef __DECC
#define vms_handler_type int #define vms_handler_type int
#else #else
#define vms_handler_type unsigned int #define vms_handler_type unsigned int
#endif #endif
extern void FDECL(VAXC$ESTABLISH, extern void VAXC$ESTABLISH(vms_handler_type (*) (genericptr_t,
(vms_handler_type (*) (genericptr_t, genericptr_t))); genericptr_t));
static vms_handler_type FDECL(vms_handler, (genericptr_t, genericptr_t)); static vms_handler_type vms_handler(genericptr_t, genericptr_t);
#include <ssdef.h> /* system service status codes */ #include <ssdef.h> /* system service status codes */
#endif #endif
static void NDECL(wd_message); static void wd_message(void);
static boolean wiz_error_flag = FALSE; static boolean wiz_error_flag = FALSE;
int int
@@ -390,13 +390,12 @@ whoami()
} }
static void static void
byebye() byebye(void)
{ {
void FDECL((*hup), (int) ); void (*hup)(int) ;
#ifdef SHELL #ifdef SHELL
extern unsigned long dosh_pid, mail_pid; extern unsigned long dosh_pid, mail_pid;
extern unsigned long FDECL(sys$delprc, extern unsigned long sys$delprc(unsigned long *, const genericptr_t);
(unsigned long *, const genericptr_t));
/* clean up any subprocess we've spawned that may still be hanging around /* clean up any subprocess we've spawned that may still be hanging around
*/ */
@@ -407,9 +406,9 @@ byebye()
#endif #endif
/* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */ /* SIGHUP doesn't seem to do anything on VMS, so we fudge it here... */
hup = (void FDECL((*), (int) )) signal(SIGHUP, SIG_IGN); hup = (void (*)(int) ) signal(SIGHUP, SIG_IGN);
if (!g.program_state.exiting++ && hup != (void FDECL((*), (int) )) SIG_DFL if (!g.program_state.exiting++ && hup != (void (*)(int) ) SIG_DFL
&& hup != (void FDECL((*), (int) )) SIG_IGN) { && hup != (void (*)(int) ) SIG_IGN) {
(*hup)(SIGHUP); (*hup)(SIGHUP);
} }
@@ -442,8 +441,7 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */
#endif #endif
void void
sethanguphandler(handler) sethanguphandler(void (*handler)(int))
void FDECL((*handler), (int));
{ {
(void) signal(SIGHUP, (SIG_RET_TYPE) handler); (void) signal(SIGHUP, (SIG_RET_TYPE) handler);
} }
+2 -2
View File
@@ -9,8 +9,8 @@
int debuggable = 0; /* 1 if we can debug or show a call trace */ int debuggable = 0; /* 1 if we can debug or show a call trace */
void FDECL(vms_exit, (int)); void vms_exit(int);
void NDECL(vms_abort); void vms_abort(void);
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */ /* first arg should be unsigned long but <lib$routines.h> has unsigned int */
extern void VDECL(lib$signal, (unsigned, ...)); extern void VDECL(lib$signal, (unsigned, ...));
+7 -7
View File
@@ -38,10 +38,10 @@ unsigned long sys$assign(), sys$dassgn(), sys$qiow();
unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(), unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(),
smg$read_keystroke(), smg$cancel_input(); smg$read_keystroke(), smg$cancel_input();
#else #else
static short FDECL(parse_function_key, (int)); static short parse_function_key(int);
#endif #endif
static void NDECL(setctty); static void setctty(void);
static void NDECL(resettty); static void resettty(void);
#define vms_ok(sts) ((sts) &1) #define vms_ok(sts) ((sts) &1)
#define META(c) ((c) | 0x80) /* 8th bit */ #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; static unsigned long ctrl_mask = 0;
#ifdef DEBUG #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 */ /* rename the real vms_getchar and interpose this one in front of it */
int int
@@ -524,8 +524,8 @@ introff()
#ifdef TIMED_DELAY #ifdef TIMED_DELAY
extern unsigned long FDECL(lib$emul, (const long *, const long *, extern unsigned long lib$emul(const long *, const long *, const long *,
const long *, long *)); long *);
extern unsigned long sys$schdwk(), sys$hiber(); extern unsigned long sys$schdwk(), sys$hiber();
#define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */ #define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */
@@ -567,7 +567,7 @@ VA_DECL(const char *, s)
VA_END(); VA_END();
#ifndef SAVE_ON_FATAL_ERROR #ifndef SAVE_ON_FATAL_ERROR
/* prevent vmsmain's exit handler byebye() from calling hangup() */ /* prevent vmsmain's exit handler byebye() from calling hangup() */
sethanguphandler((void FDECL((*), (int) )) SIG_DFL); sethanguphandler((void (*)(int) )) SIG_DFL;
#endif #endif
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
+13 -16
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; /* 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, 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 */ 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 int veryold(int);
static char *NDECL(verify_term); static char *verify_term(void);
#if defined(SHELL) || defined(SUSPEND) #if defined(SHELL) || defined(SUSPEND)
static void FDECL(hack_escape, (BOOLEAN_P, const char *)); static void hack_escape(boolean, const char *);
static void FDECL(hack_resume, (BOOLEAN_P)); static void hack_resume(boolean);
#endif #endif
static int static int
@@ -565,13 +565,10 @@ dosuspend()
/* this would fit better in vmsfiles.c except that that gets linked /* this would fit better in vmsfiles.c except that that gets linked
with the utility programs and we don't want this code there */ 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 static void
savefile(name, indx, asize, array) savefile(const char *name, int indx, int *asize, char ***array)
const char *name;
int indx, *asize;
char ***array;
{ {
char **newarray; char **newarray;
int i, oldsize; int i, oldsize;
@@ -596,8 +593,8 @@ struct dsc {
char *adr; char *adr;
}; /* descriptor */ }; /* descriptor */
typedef unsigned long vmscond; /* vms condition value */ typedef unsigned long vmscond; /* vms condition value */
vmscond FDECL(lib$find_file, (const struct dsc *, struct dsc *, genericptr *)); vmscond lib$find_file(const struct dsc *, struct dsc *, genericptr *);
vmscond FDECL(lib$find_file_end, (void **)); vmscond lib$find_file_end(void **);
/* collect a list of character names from all save files for this player */ /* collect a list of character names from all save files for this player */
int 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 * It all takes place before nethack even starts, and sets up
* `debuggable' to control possible use of lib$signal(SS$_DEBUG). * `debuggable' to control possible use of lib$signal(SS$_DEBUG).
*/ */
typedef unsigned FDECL((*condition_handler), (unsigned *, unsigned *)); typedef unsigned (*condition_handler)(unsigned *, unsigned *);
extern condition_handler FDECL(lib$establish, (condition_handler)); extern condition_handler lib$establish(condition_handler);
extern unsigned FDECL(lib$sig_to_ret, (unsigned *, unsigned *)); extern unsigned lib$sig_to_ret(unsigned *, unsigned *);
/* SYS$IMGSTA() is not documented: if called at image startup, it controls /* SYS$IMGSTA() is not documented: if called at image startup, it controls
access to the debugger; fortunately, the linker knows now to find it 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). 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 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. */ 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, * These structures are in header files contained in sys$lib_c.tlb,