From 730ff30b861c1485b4bedc43328e778d7351921b Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Fri, 30 Jun 2017 15:10:52 -0700 Subject: [PATCH] Create unixfork.h to declare functions defined in unixfork.c Update files that depend on unixfork functions to include unixfork.h Declare as static all functions in unixfork.c that are not needed externally. Add dependencies to makefile-tail. modified: makefile-tail new file: ../inc/unixfork.h modified: ../src/ldeboot.c modified: ../src/main.c modified: ../src/unixfork.c --- bin/makefile-tail | 6 +++--- inc/unixfork.h | 7 +++++++ src/ldeboot.c | 3 ++- src/main.c | 2 ++ src/unixfork.c | 6 ++++-- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 inc/unixfork.h diff --git a/bin/makefile-tail b/bin/makefile-tail index 2cd5511..d7f16c6 100755 --- a/bin/makefile-tail +++ b/bin/makefile-tail @@ -188,7 +188,7 @@ EXTFILES = $(OBJECTDIR)usrsubr.o default : $(OSARCHDIR)lde $(OSARCHDIR)$(LDENAME) $(OSARCHDIR)ldeether \ $(OSARCHDIR)tstsout $(OSARCHDIR)setsout $(OSARCHDIR)keymaker -$(OSARCHDIR)lde: $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c +$(OSARCHDIR)lde: $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c $(INCDIR)unixfork.h $(CC) $(CFLAGS) -I$(INCDIR) $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c \ $(LDELDFLAGS) -o $(OSARCHDIR)lde @@ -235,7 +235,7 @@ $(OBJECTDIR)main.o : $(SRCDIR)main.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ $(INCDIR)emlglob.h $(INCDIR)address.h $(INCDIR)lsptypes.h \ $(INCDIR)adr68k.h $(INCDIR)stack.h $(INCDIR)lspglob.h \ $(INCDIR)lispmap.h $(INCDIR)ifpage.h $(INCDIR)iopage.h \ - $(INCDIR)return.h $(INCDIR)debug.h $(INCDIR)profile.h + $(INCDIR)return.h $(INCDIR)debug.h $(INCDIR)profile.h $(INCDIR)unixfork.h $(CC) $(RFLAGS) $(SRCDIR)main.c $(INLINE) -o $(OBJECTDIR)main$(OEXT) $(OBJECTDIR)dbgtool.o : $(SRCDIR)dbgtool.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ @@ -1034,7 +1034,7 @@ release : $(INSDIR)$(LDENAME).o userfiles $(INSDIR)$(LDENAME) \ userfiles : $(INSDIR)usrsubr.c $(INSDIR)makefile $(INSDIR)ldeether.c -$(INSDIR)lde: $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c +$(INSDIR)lde: $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c $(INCDIR)unixfork.h $(CC) $(CFLAGS) -I$(INCDIR) $(SRCDIR)ldeboot.c $(SRCDIR)unixfork.c \ $(LDELDFLAGS) -o $(INSDIR)lde diff --git a/inc/unixfork.h b/inc/unixfork.h new file mode 100644 index 0000000..becd330 --- /dev/null +++ b/inc/unixfork.h @@ -0,0 +1,7 @@ +int fork_Unix(); +#ifdef FULLSLAVENAME +int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellarg); +#else +int ForkUnixShell(int slot, char ltr, char numb, char *termtype, char *shellarg); +#endif + diff --git a/src/ldeboot.c b/src/ldeboot.c index 50ce7fb..dbb25eb 100644 --- a/src/ldeboot.c +++ b/src/ldeboot.c @@ -40,6 +40,8 @@ static char *id = "$Id: ldeboot.c,v 1.3 1999/01/03 02:07:13 sybalsky Exp $ Copyr #include #include +#include "unixfork.h" + #ifdef XWINDOW #ifndef SYSVONLY #include @@ -49,7 +51,6 @@ static char *id = "$Id: ldeboot.c,v 1.3 1999/01/03 02:07:13 sybalsky Exp $ Copyr #include #include "XVersion.h" #define LDEX "ldex" -extern char *getenv(); #endif /* XWINDOW */ #define LDEMONO "ldesingle" diff --git a/src/main.c b/src/main.c index 5a0b757..f3662bc 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,8 @@ static char *id = "$Id: main.c,v 1.4 2001/12/26 22:17:03 sybalsky Exp $ Copyrigh #include "lispemul.h" #include "dbprint.h" +#include "unixfork.h" + #include #ifndef DOS #include diff --git a/src/unixfork.c b/src/unixfork.c index 35b168f..568af59 100644 --- a/src/unixfork.c +++ b/src/unixfork.c @@ -92,6 +92,8 @@ typedef int clockid_t; #include #endif +#include "unixfork.h" + /* The following globals are used to communicate between Unix subprocesses and LISP */ @@ -127,9 +129,9 @@ loop: /* Creates a PTY connection to a csh */ #ifdef FULLSLAVENAME -ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellarg) +int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellarg) #else -ForkUnixShell(int slot, char ltr, char numb, char *termtype, char *shellarg) +int ForkUnixShell(int slot, char ltr, char numb, char *termtype, char *shellarg) #endif { #ifdef FULLSLAVENAME