include file pass, csh.h no longer include every .h in the system
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 9 Jun 1991 03:20:40 +0000 (19:20 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 9 Jun 1991 03:20:40 +0000 (19:20 -0800)
rename sigmast_t to sigset_t to match signal.h; minor pointer cleanups

SCCS-vsn: bin/csh/Makefile 5.22
SCCS-vsn: bin/csh/csh.c 5.25
SCCS-vsn: bin/csh/csh.h 5.15
SCCS-vsn: bin/csh/dir.c 5.9
SCCS-vsn: bin/csh/dol.c 5.12
SCCS-vsn: bin/csh/err.c 5.9
SCCS-vsn: bin/csh/exec.c 5.15
SCCS-vsn: bin/csh/exp.c 5.10
SCCS-vsn: bin/csh/file.c 5.16
SCCS-vsn: bin/csh/func.c 5.18
SCCS-vsn: bin/csh/glob.c 5.18
SCCS-vsn: bin/csh/hist.c 5.8
SCCS-vsn: bin/csh/lex.c 5.15
SCCS-vsn: bin/csh/misc.c 5.11
SCCS-vsn: bin/csh/parse.c 5.10
SCCS-vsn: bin/csh/pathnames.h 5.6
SCCS-vsn: bin/csh/proc.c 5.19
SCCS-vsn: bin/csh/sem.c 5.15
SCCS-vsn: bin/csh/set.c 5.10
SCCS-vsn: bin/csh/time.c 5.13

20 files changed:
usr/src/bin/csh/Makefile
usr/src/bin/csh/csh.c
usr/src/bin/csh/csh.h
usr/src/bin/csh/dir.c
usr/src/bin/csh/dol.c
usr/src/bin/csh/err.c
usr/src/bin/csh/exec.c
usr/src/bin/csh/exp.c
usr/src/bin/csh/file.c
usr/src/bin/csh/func.c
usr/src/bin/csh/glob.c
usr/src/bin/csh/hist.c
usr/src/bin/csh/lex.c
usr/src/bin/csh/misc.c
usr/src/bin/csh/parse.c
usr/src/bin/csh/pathnames.h
usr/src/bin/csh/proc.c
usr/src/bin/csh/sem.c
usr/src/bin/csh/set.c
usr/src/bin/csh/time.c

index ce780ae..e4e38a1 100644 (file)
@@ -1,4 +1,4 @@
-#      @(#)Makefile    5.21 (Berkeley) %G%
+#      @(#)Makefile    5.22 (Berkeley) %G%
 #
 # C Shell with process control; VM/UNIX VAX Makefile
 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
 #
 # C Shell with process control; VM/UNIX VAX Makefile
 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
@@ -8,18 +8,19 @@
 PROG=  csh
 CFLAGS+=-fcombine-regs -fstrength-reduce -DFILEC -DNLS -DSHORT_STRINGS \
        -DTERMIOS -I.
 PROG=  csh
 CFLAGS+=-fcombine-regs -fstrength-reduce -DFILEC -DNLS -DSHORT_STRINGS \
        -DTERMIOS -I.
-SRCS=  csh.c char.c dir.c dol.c err.c exec.c exp.c file.c func.c glob.c \
-       hist.c init.c lex.c misc.c parse.c print.c proc.c sem.c set.c \
-       time.c tc.alloc.c tc.printf.c tc.str.c tc.const.c
+SRCS=  alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
+       func.c glob.c hist.c init.c lex.c misc.c parse.c print.c printf.c \
+       proc.c sem.c set.c str.c time.c
+
 .PATH: ${.CURDIR}/../../lib/libc/stdio
 MAN1=  csh.0
 MLINKS=        csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
        csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
        csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
        csh.1 stop.1 csh.1 source.1
 .PATH: ${.CURDIR}/../../lib/libc/stdio
 MAN1=  csh.0
 MLINKS=        csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
        csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
        csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
        csh.1 stop.1 csh.1 source.1
-CLEANFILES+=err.h tc.const.h
+CLEANFILES+=err.h const.h
 
 
-tc.const.h: err.h
+const.h: err.h
 
 err.h: err.c
        @rm -f $@
 
 err.h: err.c
        @rm -f $@
@@ -29,13 +30,13 @@ err.h: err.c
        egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
        @echo '#endif /* _h_sh_err */' >> $@
 
        egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
        @echo '#endif /* _h_sh_err */' >> $@
 
-tc.const.h: tc.const.c
+const.h: const.c
        @rm -f $@
        @echo '/* Do not edit this file, make creates it. */' > $@
        ${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
            sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
            sort >> $@
 
        @rm -f $@
        @echo '/* Do not edit this file, make creates it. */' > $@
        ${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
            sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
            sort >> $@
 
-.depend: err.h tc.const.h
+.depend: err.h const.h
 
 .include <bsd.prog.mk>
 
 .include <bsd.prog.mk>
index 4a69047..5e71778 100644 (file)
@@ -12,12 +12,22 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)csh.c      5.24 (Berkeley) %G%";
+static char sccsid[] = "@(#)csh.c      5.25 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <locale.h>
+#include <unistd.h>
 #include "csh.h"
 #include "csh.h"
-#include "dir.h"
 #include "extern.h"
 #include "extern.h"
+#include "pathnames.h"
 
 extern bool MapsAreInited;
 extern bool NLSMapsAreInited;
 
 extern bool MapsAreInited;
 extern bool NLSMapsAreInited;
@@ -436,7 +446,7 @@ notty:
        /* Will have value(STRhome) here because set fast if don't */
        {
            int     osetintr = setintr;
        /* Will have value(STRhome) here because set fast if don't */
        {
            int     osetintr = setintr;
-           sigmask_t omask = sigblock(sigmask(SIGINT));
+           sigset_t omask = sigblock(sigmask(SIGINT));
 
            setintr = 0;
 #ifdef _PATH_DOTCSHRC
 
            setintr = 0;
 #ifdef _PATH_DOTCSHRC
@@ -596,7 +606,7 @@ srcunit(unit, onlyown, hflg)
     bool    otell = cantell;
 
     struct Bin saveB;
     bool    otell = cantell;
 
     struct Bin saveB;
-    sigmask_t omask;
+    sigset_t omask;
     jmp_buf oldexit;
 
     /* The (few) real local variables */
     jmp_buf oldexit;
 
     /* The (few) real local variables */
@@ -784,9 +794,9 @@ pintr1(wantnl)
     bool    wantnl;
 {
     register Char **v;
     bool    wantnl;
 {
     register Char **v;
-    sigmask_t omask;
+    sigset_t omask;
 
 
-    omask = sigblock((sigmask_t) 0);
+    omask = sigblock((sigset_t) 0);
     if (setintr) {
        (void) sigsetmask(omask & ~sigmask(SIGINT));
        if (pjobs) {
     if (setintr) {
        (void) sigsetmask(omask & ~sigmask(SIGINT));
        if (pjobs) {
@@ -855,7 +865,7 @@ process(catch)
         * Interruptible during interactive reads
         */
        if (setintr)
         * Interruptible during interactive reads
         */
        if (setintr)
-           (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+           (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
 
        /*
         * For the sake of reset()
 
        /*
         * For the sake of reset()
index d870045..5304d0c 100644 (file)
@@ -4,31 +4,9 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)csh.h       5.14 (Berkeley) %G%
+ *     @(#)csh.h       5.15 (Berkeley) %G%
  */
 
  */
 
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#ifdef NLS
-#include <locale.h>
-#endif
-#include <time.h>
-#include <limits.h>
-#include <termios.h>
-#include <errno.h>
-#include <setjmp.h>
-#include <dirent.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include "pathnames.h"
-
 /*
  * Fundamental definitions which may vary from system to system.
  *
 /*
  * Fundamental definitions which may vary from system to system.
  *
@@ -68,11 +46,10 @@ typedef char Char;
 #endif
 
 typedef void *ioctl_t;         /* Third arg of ioctl */
 #endif
 
 typedef void *ioctl_t;         /* Third arg of ioctl */
-typedef long sigmask_t;                /* What a signal mask is */
 
 typedef void *ptr_t;
 
 
 typedef void *ptr_t;
 
-#include "tc.const.h"
+#include "const.h"
 #include "char.h"
 #include "err.h"
 
 #include "char.h"
 #include "err.h"
 
@@ -125,7 +102,6 @@ bool    havhash;            /* path hashing is available */
 
 #ifdef FILEC
 bool    filec;                 /* doing filename expansion */
 
 #ifdef FILEC
 bool    filec;                 /* doing filename expansion */
-
 #endif
 
 /*
 #endif
 
 /*
@@ -138,6 +114,9 @@ Char   *ffile;                      /* Name of shell file for $0 */
 char   *seterr;                        /* Error message from scanner/parser */
 Char   *shtemp;                        /* Temp name for << shell files in /tmp */
 
 char   *seterr;                        /* Error message from scanner/parser */
 Char   *shtemp;                        /* Temp name for << shell files in /tmp */
 
+#include <sys/time.h>
+#include <sys/resource.h>
+
 struct timeval time0;          /* Time at which the shell started */
 struct rusage ru0;
 
 struct timeval time0;          /* Time at which the shell started */
 struct rusage ru0;
 
@@ -193,6 +172,7 @@ short   OLDSTD;                     /* Old standard input (def for cmds) */
  * Because of source commands and .cshrc we need nested error catches.
  */
 
  * Because of source commands and .cshrc we need nested error catches.
  */
 
+#include <setjmp.h>
 jmp_buf reslab;
 
 #define        setexit()       (setjmp(reslab))
 jmp_buf reslab;
 
 #define        setexit()       (setjmp(reslab))
@@ -203,6 +183,7 @@ jmp_buf reslab;
 
 Char   *gointr;                        /* Label for an onintr transfer */
 
 
 Char   *gointr;                        /* Label for an onintr transfer */
 
+#include <signal.h>
 sig_t parintr;                 /* Parents interrupt catch */
 sig_t parterm;                 /* Parents terminate catch */
 
 sig_t parintr;                 /* Parents interrupt catch */
 sig_t parterm;                 /* Parents terminate catch */
 
@@ -522,9 +503,9 @@ Char   *word_chars;
 
 Char   *STR_SHELLPATH;
 
 
 Char   *STR_SHELLPATH;
 
+#include <paths.h>
 #ifdef _PATH_BSHELL
 Char   *STR_BSHELL;
 #ifdef _PATH_BSHELL
 Char   *STR_BSHELL;
-
 #endif
 Char   *STR_WORD_CHARS;
 Char  **STR_environ;
 #endif
 Char   *STR_WORD_CHARS;
 Char  **STR_environ;
index 11ee338..14f61c4 100644 (file)
@@ -6,9 +6,16 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dir.c      5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c      5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "csh.h"
 #include "dir.h"
 #include "extern.h"
 #include "csh.h"
 #include "dir.h"
 #include "extern.h"
index d7948d5..d6b987d 100644 (file)
@@ -6,9 +6,15 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dol.c      5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)dol.c      5.12 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 4982148..418771b 100644 (file)
@@ -6,12 +6,15 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-#define _h_tc_err              /* Don't redefine the errors     */
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 #include "csh.h"
 #include "extern.h"
+
 #if __STDC__
 #include <stdarg.h>
 #else
 #if __STDC__
 #include <stdarg.h>
 #else
index 92fa3fd..ac7049e 100644 (file)
@@ -6,17 +6,24 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exec.c     5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)exec.c     5.15 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 
 /*
 #include "csh.h"
 #include "extern.h"
 
 /*
- * System level search and execute of a command.
- * We look in each directory for the specified command name.
- * If the name contains a '/' then we execute only the full path name.
- * If there is no search path then we execute only full path names.
+ * System level search and execute of a command.  We look in each directory
+ * for the specified command name.  If the name contains a '/' then we
+ * execute only the full path name.  If there is no search path then we
+ * execute only full path names.
  */
 
 /*
  */
 
 /*
@@ -143,7 +150,7 @@ doexec(t)
      * We must do this AFTER any possible forking (like `foo` in glob) so that
      * this shell can still do subprocesses.
      */
      * We must do this AFTER any possible forking (like `foo` in glob) so that
      * this shell can still do subprocesses.
      */
-    (void) sigsetmask((sigmask_t) 0);
+    (void) sigsetmask((sigset_t) 0);
     /*
      * If no path, no words in path, or a / in the filename then restrict the
      * command search.
     /*
      * If no path, no words in path, or a / in the filename then restrict the
      * command search.
index 7ecf45a..2d35919 100644 (file)
@@ -6,11 +6,14 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exp.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)exp.c      5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include "csh.h"
 #include "csh.h"
-#include "dir.h"
 #include "extern.h"
 
 #define IGNORE 1       /* in ignore, it means to ignore value, just parse */
 #include "extern.h"
 
 #define IGNORE 1       /* in ignore, it means to ignore value, just parse */
index 3ce1acc..a12af89 100644 (file)
@@ -6,11 +6,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)file.c     5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)file.c     5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #ifdef FILEC
 
 #endif /* not lint */
 
 #ifdef FILEC
 
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <termios.h>
+#include <dirent.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index a2eca18..9e948b7 100644 (file)
@@ -6,11 +6,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)func.c     5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c     5.18 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <signal.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 #include "csh.h"
 #include "extern.h"
+#include "pathnames.h"
 
 extern char **environ;
 
 
 extern char **environ;
 
@@ -420,7 +428,7 @@ preread()
 {
     whyles->w_end = -1;
     if (setintr)
 {
     whyles->w_end = -1;
     if (setintr)
-       (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+       (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
 
     search(T_BREAK, 0, NULL);          /* read the expression in */
     if (setintr)
 
     search(T_BREAK, 0, NULL);          /* read the expression in */
     if (setintr)
@@ -472,7 +480,7 @@ dorepeat(v, kp)
     struct command *kp;
 {
     register int i;
     struct command *kp;
 {
     register int i;
-    register sigmask_t omask = 0;
+    register sigset_t omask = 0;
 
     i = getn(v[1]);
     if (setintr)
 
     i = getn(v[1]);
     if (setintr)
@@ -785,7 +793,7 @@ xecho(sep, v)
     int     nonl = 0;
 
     if (setintr)
     int     nonl = 0;
 
     if (setintr)
-       (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+       (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
     v++;
     if (*v == 0)
        return;
     v++;
     if (*v == 0)
        return;
@@ -834,7 +842,7 @@ dosetenv(v)
        register Char **ep;
 
        if (setintr)
        register Char **ep;
 
        if (setintr)
-           (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+           (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
        for (ep = STR_environ; *ep; ep++)
            xprintf("%s\n", short2str(*ep));
        return;
        for (ep = STR_environ; *ep; ep++)
            xprintf("%s\n", short2str(*ep));
        return;
index abb939e..c20a80f 100644 (file)
@@ -6,12 +6,17 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)glob.c     5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)glob.c     5.18 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/param.h>
+#include <glob.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 #include "csh.h"
 #include "extern.h"
-#include <glob.h>
 
 static int noglob, nonomatch;
 static int pargsiz, gargsiz;
 
 static int noglob, nonomatch;
 static int pargsiz, gargsiz;
index 8313cde..f684ccd 100644 (file)
@@ -6,9 +6,11 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)hist.c     5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)hist.c     5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <stdlib.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -90,7 +92,7 @@ dohist(vp)
     if (getn(value(STRhistory)) == 0)
        return;
     if (setintr)
     if (getn(value(STRhistory)) == 0)
        return;
     if (setintr)
-       (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+       (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
     while (*++vp && **vp == '-') {
        Char   *vp2 = *vp;
 
     while (*++vp && **vp == '-') {
        Char   *vp2 = *vp;
 
index 32b8475..d632864 100644 (file)
@@ -6,10 +6,16 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lex.c      5.14 (Berkeley) %G%";
-
-#endif                         /* not lint */
-
+static char sccsid[] = "@(#)lex.c      5.15 (Berkeley) %G%";
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -59,16 +65,16 @@ static Char peekc = 0, peekd = 0;
 static Char peekread = 0;
 
 /* (Tail of) current word from ! subst */
 static Char peekread = 0;
 
 /* (Tail of) current word from ! subst */
-static Char *exclp = (Char *) 0;
+static Char *exclp = NULL;
 
 /* The rest of the ! subst words */
 
 /* The rest of the ! subst words */
-static struct wordent *exclnxt = (struct wordent *) 0;
+static struct wordent *exclnxt = NULL;
 
 /* Count of remaining words in ! subst */
 static int exclc = 0;
 
 /* "Globp" for alias resubstitution */
 
 /* Count of remaining words in ! subst */
 static int exclc = 0;
 
 /* "Globp" for alias resubstitution */
-static Char *alvecp = (Char *) 0;
+static Char *alvecp = NULL;
 
 /*
  * Labuf implements a general buffer for lookahead during lexical operations.
 
 /*
  * Labuf implements a general buffer for lookahead during lexical operations.
index 08a35f9..269ac5d 100644 (file)
@@ -6,9 +6,12 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/param.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 5d76fcc..4623561 100644 (file)
@@ -6,9 +6,12 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parse.c    5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)parse.c    5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 90c03a6..3273249 100644 (file)
@@ -4,9 +4,8 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)pathnames.h 5.5 (Berkeley) %G%
+ *     @(#)pathnames.h 5.6 (Berkeley) %G%
  */
  */
-#include <paths.h>
 
 #define        _PATH_BIN               "/bin"
 #define        _PATH_DOTCSHRC          "/etc/csh.cshrc"
 
 #define        _PATH_BIN               "/bin"
 #define        _PATH_DOTCSHRC          "/etc/csh.cshrc"
index c206a84..5dbe4d0 100644 (file)
@@ -6,14 +6,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)proc.c     5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc.c     5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 #include "csh.h"
 #include "dir.h"
 #include "proc.h"
 #include "extern.h"
 #include "csh.h"
 #include "dir.h"
 #include "proc.h"
 #include "extern.h"
-#include <sys/wait.h>
 
 #define BIGINDEX       9       /* largest desirable job index */
 
 
 #define BIGINDEX       9       /* largest desirable job index */
 
@@ -78,7 +83,7 @@ found:
     }
     else {
        if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime))
     }
     else {
        if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime))
-           (void) gettimeofday(&pp->p_etime, (struct timezone *) 0);
+           (void) gettimeofday(&pp->p_etime, NULL);
 
        pp->p_rusage = ru;
        if (WIFSIGNALED(w)) {
 
        pp->p_rusage = ru;
        if (WIFSIGNALED(w)) {
@@ -161,7 +166,7 @@ pnote()
 {
     register struct process *pp;
     int     flags;
 {
     register struct process *pp;
     int     flags;
-    sigmask_t omask;
+    sigset_t omask;
 
     neednote = 0;
     for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) {
 
     neednote = 0;
     for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) {
@@ -184,7 +189,7 @@ void
 pwait()
 {
     register struct process *fp, *pp;
 pwait()
 {
     register struct process *fp, *pp;
-    sigmask_t omask;
+    sigset_t omask;
 
     /*
      * Here's where dead procs get flushed.
 
     /*
      * Here's where dead procs get flushed.
@@ -215,7 +220,7 @@ pjwait(pp)
 {
     register struct process *fp;
     int     jobflags, reason;
 {
     register struct process *fp;
     int     jobflags, reason;
-    sigmask_t omask;
+    sigset_t omask;
 
     while (pp->p_pid != pp->p_jobid)
        pp = pp->p_friends;
 
     while (pp->p_pid != pp->p_jobid)
        pp = pp->p_friends;
@@ -299,7 +304,7 @@ void
 dowait()
 {
     register struct process *pp;
 dowait()
 {
     register struct process *pp;
-    sigmask_t omask;
+    sigset_t omask;
 
     pjobs++;
     omask = sigblock(sigmask(SIGCHLD));
 
     pjobs++;
     omask = sigblock(sigmask(SIGCHLD));
@@ -307,7 +312,7 @@ loop:
     for (pp = proclist.p_next; pp; pp = pp->p_next)
        if (pp->p_pid &&        /* pp->p_pid == pp->p_jobid && */
            pp->p_flags & PRUNNING) {
     for (pp = proclist.p_next; pp; pp = pp->p_next)
        if (pp->p_pid &&        /* pp->p_pid == pp->p_jobid && */
            pp->p_flags & PRUNNING) {
-           (void) sigpause((sigmask_t) 0);
+           (void) sigpause((sigset_t) 0);
            goto loop;
        }
     (void) sigsetmask(omask);
            goto loop;
        }
     (void) sigsetmask(omask);
@@ -456,7 +461,7 @@ palloc(pid, t)
     }
     pp->p_next = proclist.p_next;
     proclist.p_next = pp;
     }
     pp->p_next = proclist.p_next;
     proclist.p_next = pp;
-    (void) gettimeofday(&pp->p_btime, (struct timezone *) 0);
+    (void) gettimeofday(&pp->p_btime, NULL);
 }
 
 static void
 }
 
 static void
@@ -904,7 +909,7 @@ pkill(v, signum)
     register struct process *pp, *np;
     register int jobflags = 0;
     int     pid, err1 = 0;
     register struct process *pp, *np;
     register int jobflags = 0;
     int     pid, err1 = 0;
-    sigmask_t omask;
+    sigset_t omask;
     Char   *cp;
 
     omask = sigmask(SIGCHLD);
     Char   *cp;
 
     omask = sigmask(SIGCHLD);
@@ -986,7 +991,7 @@ pstart(pp, foregnd)
     int     foregnd;
 {
     register struct process *np;
     int     foregnd;
 {
     register struct process *np;
-    sigmask_t omask;
+    sigset_t omask;
     long    jobflags = 0;
 
     omask = sigblock(sigmask(SIGCHLD));
     long    jobflags = 0;
 
     omask = sigblock(sigmask(SIGCHLD));
@@ -1130,7 +1135,7 @@ pfork(t, wanttty)
     register int pid;
     bool    ignint = 0;
     int     pgrp;
     register int pid;
     bool    ignint = 0;
     int     pgrp;
-    sigmask_t omask;
+    sigset_t omask;
 
     /*
      * A child will be uninterruptible only under very special conditions.
 
     /*
      * A child will be uninterruptible only under very special conditions.
@@ -1227,7 +1232,7 @@ void
 pgetty(wanttty, pgrp)
     int     wanttty, pgrp;
 {
 pgetty(wanttty, pgrp)
     int     wanttty, pgrp;
 {
-    sigmask_t omask = 0;
+    sigset_t omask = 0;
 
     /*
      * christos: I am blocking the tty signals till I've set things
 
     /*
      * christos: I am blocking the tty signals till I've set things
index e87d6b4..ebfd502 100644 (file)
@@ -6,11 +6,18 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)sem.c      5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)sem.c      5.15 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "csh.h"
 #include "csh.h"
-#include "dir.h"
 #include "proc.h"
 #include "extern.h"
 
 #include "proc.h"
 #include "extern.h"
 
@@ -28,9 +35,9 @@ execute(t, wanttty, pipein, pipeout)
     int     pid = 0;
     int     pv[2];
 
     int     pid = 0;
     int     pv[2];
 
-    static sigmask_t csigmask;
+    static sigset_t csigmask;
 
 
-    static sigmask_t ocsigmask;
+    static sigset_t ocsigmask;
     static int onosigchld = 0;
     static int nosigchld = 0;
 
     static int onosigchld = 0;
     static int nosigchld = 0;
 
@@ -119,7 +126,7 @@ execute(t, wanttty, pipein, pipeout)
            bifunc = isbfunc(t);
        }
        else {                  /* not a command */
            bifunc = isbfunc(t);
        }
        else {                  /* not a command */
-           bifunc = (struct biltins *) 0;
+           bifunc = NULL;
        }
 
        /*
        }
 
        /*
@@ -165,7 +172,7 @@ execute(t, wanttty, pipein, pipeout)
            else {
                int     ochild, osetintr, ohaderr, odidfds;
                int     oSHIN, oSHOUT, oSHDIAG, oOLDSTD, otpgrp;
            else {
                int     ochild, osetintr, ohaderr, odidfds;
                int     oSHIN, oSHOUT, oSHDIAG, oOLDSTD, otpgrp;
-               sigmask_t omask;
+               sigset_t omask;
 
                /*
                 * Prepare for the vfork by saving everything that the child
 
                /*
                 * Prepare for the vfork by saving everything that the child
@@ -449,7 +456,7 @@ doio(t, pipein, pipeout)
        else {
            (void) close(0);
            (void) dup(OLDSTD);
        else {
            (void) close(0);
            (void) dup(OLDSTD);
-           (void) ioctl(0, FIONCLEX, (char *) 0);
+           (void) ioctl(0, FIONCLEX, NULL);
        }
     }
     if (cp = t->t_drit) {
        }
     }
     if (cp = t->t_drit) {
@@ -489,7 +496,7 @@ doio(t, pipein, pipeout)
     else {
        (void) close(1);
        (void) dup(SHOUT);
     else {
        (void) close(1);
        (void) dup(SHOUT);
-       (void) ioctl(1, FIONCLEX, (char *) 0);
+       (void) ioctl(1, FIONCLEX, NULL);
     }
 
     (void) close(2);
     }
 
     (void) close(2);
@@ -498,7 +505,7 @@ doio(t, pipein, pipeout)
     }
     else {
        (void) dup(SHDIAG);
     }
     else {
        (void) dup(SHDIAG);
-       (void) ioctl(2, FIONCLEX, (char *) 0);
+       (void) ioctl(2, FIONCLEX, NULL);
     }
     didfds = 1;
 }
     }
     didfds = 1;
 }
index 82e7dea..d3c6678 100644 (file)
@@ -6,9 +6,11 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)set.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)set.c      5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
+#include <stdlib.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -765,7 +767,7 @@ plist(p)
     register len;
 
     if (setintr)
     register len;
 
     if (setintr)
-       (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT));
+       (void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
 
     for (;;) {
        while (p->v_left)
 
     for (;;) {
        while (p->v_left)
index aae5ab7..d05fa10 100644 (file)
@@ -6,9 +6,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)time.c     5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)time.c     5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/types.h>
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -22,7 +23,7 @@ settimes()
 {
     struct rusage ruch;
 
 {
     struct rusage ruch;
 
-    (void) gettimeofday(&time0, (struct timezone *) 0);
+    (void) gettimeofday(&time0, NULL);
     (void) getrusage(RUSAGE_SELF, &ru0);
     (void) getrusage(RUSAGE_CHILDREN, &ruch);
     ruadd(&ru0, &ruch);
     (void) getrusage(RUSAGE_SELF, &ru0);
     (void) getrusage(RUSAGE_CHILDREN, &ruch);
     ruadd(&ru0, &ruch);
@@ -41,7 +42,7 @@ dotime()
     (void) getrusage(RUSAGE_SELF, &ru1);
     (void) getrusage(RUSAGE_CHILDREN, &ruch);
     ruadd(&ru1, &ruch);
     (void) getrusage(RUSAGE_SELF, &ru1);
     (void) getrusage(RUSAGE_CHILDREN, &ruch);
     ruadd(&ru1, &ruch);
-    (void) gettimeofday(&timedol, (struct timezone *) 0);
+    (void) gettimeofday(&timedol, NULL);
     prusage(&ru0, &ru1, &timedol, &time0);
 }
 
     prusage(&ru0, &ru1, &timedol, &time0);
 }