1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-20 16:28:12 +00:00

Create a new inc/xxxdefs.h for each src/xxx.c containing appropriate function prototypes.

This also involves removing unnecessary forward declarations, inserting
       includes for all cross-file function references, making some definitions
       static if they are not otherwise used, correcting errors that were exposed
       by having correct prototypes.

	new file:   inc/allocmdsdefs.h
	new file:   inc/arith2defs.h
	new file:   inc/arith3defs.h
	new file:   inc/arith4defs.h
	new file:   inc/array2defs.h
	new file:   inc/array3defs.h
	new file:   inc/array4defs.h
	new file:   inc/array5defs.h
	new file:   inc/array6defs.h
	new file:   inc/arraydefs.h
	new file:   inc/bbtsubdefs.h
	new file:   inc/bindefs.h
	new file:   inc/bindsdefs.h
	new file:   inc/bitbltdefs.h
	new file:   inc/bltdefs.h
	new file:   inc/byteswapdefs.h
	new file:   inc/car-cdrdefs.h
	new file:   inc/chardevdefs.h
	new file:   inc/commondefs.h
	new file:   inc/conspagedefs.h
	new file:   inc/dbgtooldefs.h
	new file:   inc/dirdefs.h
	new file:   inc/drawdefs.h
	new file:   inc/dskdefs.h
	new file:   inc/dspifdefs.h
	new file:   inc/dspsubrsdefs.h
	new file:   inc/eqfdefs.h
	new file:   inc/etherdefs.h
	new file:   inc/findkeydefs.h
	new file:   inc/fpdefs.h
	new file:   inc/fvardefs.h
	new file:   inc/gc2defs.h
	new file:   inc/gcarraydefs.h
	new file:   inc/gccodedefs.h
	new file:   inc/gcdefs.h
	new file:   inc/gcfinaldefs.h
	new file:   inc/gchtfinddefs.h
	new file:   inc/gcmain3defs.h
	new file:   inc/gcoflowdefs.h
	new file:   inc/gcrcelldefs.h
	new file:   inc/gcrdefs.h
	new file:   inc/gcscandefs.h
	new file:   inc/gvar2defs.h
	new file:   inc/hacksdefs.h
	new file:   inc/hardrtndefs.h
	new file:   inc/inetdefs.h
	new file:   inc/initdspdefs.h
	new file:   inc/initkbddefs.h
	new file:   inc/initsoutdefs.h
	modified:   inc/inlineC.h
	new file:   inc/intcalldefs.h
	new file:   inc/kbdsubrsdefs.h
	new file:   inc/keyeventdefs.h
	new file:   inc/keylibdefs.h
	new file:   inc/kprintdefs.h
	new file:   inc/ldsoutdefs.h
	new file:   inc/lineblt8defs.h
	new file:   inc/lisp2cdefs.h
	modified:   inc/lispemul.h
	new file:   inc/llcolordefs.h
	new file:   inc/llstkdefs.h
	modified:   inc/lnk-inlineC.h
	new file:   inc/loopsopsdefs.h
	new file:   inc/lowlev1defs.h
	new file:   inc/lowlev2defs.h
	new file:   inc/lsthandldefs.h
	new file:   inc/maindefs.h
	new file:   inc/misc7defs.h
	new file:   inc/miscndefs.h
	new file:   inc/mkatomdefs.h
	new file:   inc/mkcelldefs.h
	new file:   inc/mvsdefs.h
	new file:   inc/osmsgdefs.h
	new file:   inc/perrnodefs.h
	new file:   inc/returndefs.h
	new file:   inc/rpcdefs.h
	new file:   inc/rplconsdefs.h
	new file:   inc/shiftdefs.h
	new file:   inc/storagedefs.h
	new file:   inc/subr0374defs.h
	new file:   inc/subrdefs.h
	new file:   inc/sxhashdefs.h
	new file:   inc/testtooldefs.h
	new file:   inc/timerdefs.h
	new file:   inc/typeofdefs.h
	new file:   inc/ubf1defs.h
	new file:   inc/ubf2defs.h
	new file:   inc/ubf3defs.h
	new file:   inc/ufsdefs.h
	new file:   inc/unixcommdefs.h
	new file:   inc/unwinddefs.h
	new file:   inc/uraiddefs.h
	new file:   inc/usrsubrdefs.h
	new file:   inc/uutilsdefs.h
	new file:   inc/vars3defs.h
	new file:   inc/vmemsavedefs.h
	new file:   inc/xbbtdefs.h
	new file:   inc/xcdefs.h
	new file:   inc/xcursordefs.h
	new file:   inc/xinitdefs.h
	new file:   inc/xlspwindefs.h
	new file:   inc/xmkicondefs.h
	new file:   inc/xrdoptdefs.h
	new file:   inc/xscrolldefs.h
	new file:   inc/xwinmandefs.h
	new file:   inc/z2defs.h
	modified:   src/allocmds.c
	modified:   src/arith2.c
	modified:   src/arith3.c
	modified:   src/arith4.c
	modified:   src/array.c
	modified:   src/array2.c
	modified:   src/array3.c
	modified:   src/array4.c
	modified:   src/array5.c
	modified:   src/array6.c
	modified:   src/bbtsub.c
	modified:   src/bin.c
	modified:   src/binds.c
	modified:   src/bitblt.c
	modified:   src/blt.c
	modified:   src/byteswap.c
	modified:   src/car-cdr.c
	modified:   src/chardev.c
	modified:   src/common.c
	modified:   src/conspage.c
	modified:   src/dbgtool.c
	modified:   src/dir.c
	modified:   src/draw.c
	modified:   src/dsk.c
	modified:   src/dspif.c
	modified:   src/dspsubrs.c
	modified:   src/eqf.c
	modified:   src/ether.c
	modified:   src/findkey.c
	modified:   src/foreign.c
	modified:   src/fp.c
	modified:   src/fvar.c
	modified:   src/gc.c
	modified:   src/gc2.c
	modified:   src/gcarray.c
	modified:   src/gccode.c
	modified:   src/gcfinal.c
	modified:   src/gchtfind.c
	modified:   src/gcmain3.c
	modified:   src/gcoflow.c
	modified:   src/gcr.c
	modified:   src/gcrcell.c
	modified:   src/gcscan.c
	modified:   src/gvar2.c
	modified:   src/hacks.c
	modified:   src/hardrtn.c
	modified:   src/inet.c
	modified:   src/initdsp.c
	modified:   src/initkbd.c
	modified:   src/initsout.c
	modified:   src/intcall.c
	modified:   src/kbdsubrs.c
	modified:   src/keyevent.c
	modified:   src/keylib.c
	modified:   src/kprint.c
	modified:   src/ldsout.c
	modified:   src/lineblt8.c
	modified:   src/lisp2c.c
	modified:   src/llcolor.c
	modified:   src/llstk.c
	modified:   src/loopsops.c
	modified:   src/lowlev1.c
	modified:   src/lowlev2.c
	modified:   src/lsthandl.c
	modified:   src/main.c
	modified:   src/misc7.c
	modified:   src/miscn.c
	modified:   src/mkatom.c
	modified:   src/mkcell.c
	modified:   src/mvs.c
	modified:   src/osmsg.c
	modified:   src/perrno.c
	modified:   src/return.c
	modified:   src/rpc.c
	modified:   src/rplcons.c
	modified:   src/setsout.c
	modified:   src/shift.c
	modified:   src/storage.c
	modified:   src/subr.c
	modified:   src/subr0374.c
	modified:   src/sxhash.c
	modified:   src/testtool.c
	modified:   src/timer.c
	modified:   src/truecolor.c
	modified:   src/tstsout.c
	modified:   src/typeof.c
	modified:   src/ubf1.c
	modified:   src/ubf2.c
	modified:   src/ubf3.c
	modified:   src/ufn.c
	modified:   src/ufs.c
	modified:   src/unixcomm.c
	modified:   src/unwind.c
	modified:   src/uraid.c
	modified:   src/usrsubr.c
	modified:   src/uutils.c
	modified:   src/vars3.c
	modified:   src/vmemsave.c
	modified:   src/xbbt.c
	modified:   src/xc.c
	modified:   src/xcursor.c
	modified:   src/xinit.c
	modified:   src/xlspwin.c
	modified:   src/xmkicon.c
	modified:   src/xrdopt.c
	modified:   src/xscroll.c
	modified:   src/xwinman.c
	modified:   src/z2.c
This commit is contained in:
Nick Briggs
2020-09-04 18:21:44 -07:00
parent 5fb5d93893
commit 0ad69fc6fe
214 changed files with 1608 additions and 381 deletions

View File

@@ -45,6 +45,7 @@ unsigned long tick_count = 0; /* approx 18 ticks per sec */
#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#ifdef LINUX
#include <linux/fcntl.h>
#else
@@ -108,6 +109,10 @@ extern int ether_fd;
#include "stack.h"
#include "dbprint.h"
#include "timerdefs.h"
#include "commondefs.h"
#include "mkcelldefs.h"
#ifdef XWINDOW
#include "devif.h"
extern DspInterface currentdsp;
@@ -147,23 +152,7 @@ int Event_Req = FALSE;
#define SIGERRCHK(set, str) \
if (set == SIG_ERR) perror(str)
void update_miscstats();
/************************************************************************/
/* */
/* i n i t _ m i s c s t a t s */
/* */
/* Called at initialization time to set miscstats words. */
/* ?? and to periodically update them ?? [JDS 11/22/89] */
/* */
/* */
/************************************************************************/
void init_miscstats() {
MiscStats->starttime = gettime(0);
MiscStats->gctime = 0;
update_miscstats();
}
static int gettime(int casep);
/************************************************************************/
/* */
@@ -221,6 +210,22 @@ void update_miscstats() {
#endif /* DOS */
}
/************************************************************************/
/* */
/* i n i t _ m i s c s t a t s */
/* */
/* Called at initialization time to set miscstats words. */
/* ?? and to periodically update them ?? [JDS 11/22/89] */
/* */
/* */
/************************************************************************/
void init_miscstats() {
MiscStats->starttime = gettime(0);
MiscStats->gctime = 0;
update_miscstats();
}
/************************************************************************/
/* */
/* s u b r _ g e t t i m e */
@@ -265,7 +270,7 @@ LispPTR subr_gettime(LispPTR args[])
/* */
/************************************************************************/
int gettime(int casep)
static int gettime(int casep)
{
#ifndef USETIMEFN
struct timeval timev;
@@ -510,9 +515,9 @@ static struct sigvec timerv;
#endif /* SYSVSIGNALS */
#if (defined(OS4) || defined(SYSVONLY)) || defined(MACOSX) || defined(FREEBSD) || defined(OS5)
void int_timer_service(int sig, int code, struct sigcontext *scp)
static void int_timer_service(int sig, int code, void *scp)
#else
int int_timer_service(int sig, int code, struct sigcontext *scp)
static int int_timer_service(int sig, int code, void *scp)
#endif /* OS4 | SYSVONLY | MACOSX | FREEBSD */
{
/* this may have to do more in the future, like check for nested interrupts,
@@ -553,7 +558,7 @@ int int_timer_service(int sig, int code, struct sigcontext *scp)
/* */
/************************************************************************/
void int_timer_init()
static void int_timer_init()
{
#ifdef DOS
@@ -655,7 +660,7 @@ void int_io_close(int fd)
/* */
/************************************************************************/
void int_io_init() {
static void int_io_init() {
#ifndef SYSVSIGNALS
static struct sigvec timerv;
static struct sigvec poll_timerv;
@@ -912,7 +917,7 @@ void int_fp_init() { /* first set up the signal handler */
/************************************************************************/
jmp_buf jmpbuf;
void timeout_error() {
static void timeout_error() {
/*
* Following printf changes the contents of jmpbuf!
* This would lead to horrible segmentation violation.
@@ -938,7 +943,7 @@ void timeout_error() {
/* */
/************************************************************************/
void int_file_init() {
static void int_file_init() {
#ifndef SYSVSIGNALS
static struct sigvec timerv;
#endif /* SYSVSIGNALS */
@@ -1008,7 +1013,7 @@ void int_file_init() {
struct sigaction * restrict oact);
*/
void panicuraid(int sig, int code, struct sigcontext *scp, void *addr)
void panicuraid(int sig, int code, void *scp, void *addr)
{
static char errormsg[200];
static char *stdmsg =
@@ -1021,35 +1026,35 @@ and do a 'v' before trying anything else.";
switch (sig) {
#ifdef SIGBUS
case SIGBUS:
sprintf(errormsg, "BUS error (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "BUS error (code %d) at address %p.\n%s", code, addr, stdmsg);
break;
#endif /* SIGBUS */
case SIGSEGV:
sprintf(errormsg, "SEGV error (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "SEGV error (code %d) at address %p.\n%s", code, addr, stdmsg);
break;
case SIGILL:
sprintf(errormsg, "Illegal instruction (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "Illegal instruction (code %d) at address %p.\n%s", code, addr, stdmsg);
break;
#ifdef SIGPIPE
case SIGPIPE:
sprintf(errormsg, "Broken PIPE (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "Broken PIPE (code %d) at address %p.\n%s", code, addr, stdmsg);
break;
#endif /* SGPIPE */
#ifdef SIGHUP
case SIGHUP:
sprintf(errormsg, "HANGUP signalled (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "HANGUP signalled (code %d) at address %p.\n%s", code, addr, stdmsg);
/* Assume that a user tried to exit UNIX shell */
#ifdef SYSVONLY
kill(0, SIGKILL);
exit(0);
#else
killpg(getpgrp(0), SIGKILL);
killpg(getpgrp(), SIGKILL);
exit(0);
#endif /* SYSVONLY */
break;
#endif /* SIGHUP */
case SIGFPE:
sprintf(errormsg, "FP error (code %d) at address 0x%x.\n%s", code, addr, stdmsg);
sprintf(errormsg, "FP error (code %d) at address %p.\n%s", code, addr, stdmsg);
break;
default: sprintf(errormsg, "Uncaught SIGNAL %d (code %d).\n%s", sig, code, stdmsg);
}
@@ -1067,7 +1072,7 @@ and do a 'v' before trying anything else.";
/* uraid and get a clue about why you're dying. */
/* */
/************************************************************************/
void int_panic_init() {
static void int_panic_init() {
#ifdef SYSVSIGNALS
#ifdef ISC
sigset(SIGHUP, panicuraid);