More prototype fixes, Removed TERMIOS define
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sun, 9 Jun 1991 08:09:10 +0000 (00:09 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sun, 9 Jun 1991 08:09:10 +0000 (00:09 -0800)
SCCS-vsn: bin/csh/alloc.c 5.8
SCCS-vsn: bin/csh/csh.c 5.26
SCCS-vsn: bin/csh/dir.c 5.10
SCCS-vsn: bin/csh/dol.c 5.13
SCCS-vsn: bin/csh/err.c 5.10
SCCS-vsn: bin/csh/exec.c 5.16
SCCS-vsn: bin/csh/exp.c 5.11
SCCS-vsn: bin/csh/file.c 5.17
SCCS-vsn: bin/csh/func.c 5.19
SCCS-vsn: bin/csh/glob.c 5.19
SCCS-vsn: bin/csh/hist.c 5.9
SCCS-vsn: bin/csh/init.c 5.11
SCCS-vsn: bin/csh/lex.c 5.16
SCCS-vsn: bin/csh/misc.c 5.12
SCCS-vsn: bin/csh/parse.c 5.11
SCCS-vsn: bin/csh/proc.c 5.20
SCCS-vsn: bin/csh/sem.c 5.16
SCCS-vsn: bin/csh/set.c 5.11
SCCS-vsn: bin/csh/str.c 5.3
SCCS-vsn: bin/csh/time.c 5.14
SCCS-vsn: bin/csh/extern.h 5.4

21 files changed:
usr/src/bin/csh/alloc.c
usr/src/bin/csh/csh.c
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/extern.h
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/init.c
usr/src/bin/csh/lex.c
usr/src/bin/csh/misc.c
usr/src/bin/csh/parse.c
usr/src/bin/csh/proc.c
usr/src/bin/csh/sem.c
usr/src/bin/csh/set.c
usr/src/bin/csh/str.c
usr/src/bin/csh/time.c

index b967345..0417154 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)alloc.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)alloc.c    5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -21,7 +21,17 @@ static char sccsid[] = "@(#)alloc.c  5.7 (Berkeley) %G%";
  * but bombs when it runs out.
  */
 
  * but bombs when it runs out.
  */
 
+#include <sys/types.h>
+#include <unistd.h>
+#include <string.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "csh.h"
+#include "extern.h"
 
 char   *memtop = NULL;         /* PWP: top of current memory */
 char   *membot = NULL;         /* PWP: bottom of allocatable memory */
 
 char   *memtop = NULL;         /* PWP: top of current memory */
 char   *membot = NULL;         /* PWP: bottom of allocatable memory */
@@ -36,11 +46,6 @@ char   *membot = NULL;               /* PWP: bottom of allocatable memory */
 #define        NULL 0
 #endif
 
 #define        NULL 0
 #endif
 
-typedef unsigned char U_char;  /* we don't really have signed chars */
-typedef unsigned int U_int;
-typedef unsigned short U_short;
-static int findbucket();
-static void morecore();
 
 /*
  * The overhead on a block is at least 4 bytes.  When free, this space
 
 /*
  * The overhead on a block is at least 4 bytes.  When free, this space
@@ -52,26 +57,18 @@ static void morecore();
  * plus the range checking words, and the header word MINUS ONE.
  */
 
  * plus the range checking words, and the header word MINUS ONE.
  */
 
-#ifdef SUNOS4
-/*
- * SunOS localtime() overwrites the 9th byte on an 8 byte malloc()....
- * So we align to 16 bytes...
- */
-#define ROUNDUP        15
-#else
 #define ROUNDUP        7
 #define ROUNDUP        7
-#endif
 
 #define ALIGN(a) (((a) + ROUNDUP) & ~ROUNDUP)
 
 union overhead {
     union overhead *ov_next;   /* when free */
     struct {
 
 #define ALIGN(a) (((a) + ROUNDUP) & ~ROUNDUP)
 
 union overhead {
     union overhead *ov_next;   /* when free */
     struct {
-       U_char  ovu_magic;      /* magic number */
-       U_char  ovu_index;      /* bucket # */
+       u_char  ovu_magic;      /* magic number */
+       u_char  ovu_index;      /* bucket # */
 #ifdef RCHECK
 #ifdef RCHECK
-       U_short ovu_size;       /* actual block size */
-       U_int   ovu_rmagic;     /* range magic number */
+       u_short ovu_size;       /* actual block size */
+       u_int   ovu_rmagic;     /* range magic number */
 #endif
     }       ovu;
 #define        ov_magic        ovu.ovu_magic
 #endif
     }       ovu;
 #define        ov_magic        ovu.ovu_magic
@@ -83,7 +80,7 @@ union overhead {
 #define        MAGIC           0xfd    /* magic # on accounting info */
 #define RMAGIC         0x55555555      /* magic # on range info */
 #ifdef RCHECK
 #define        MAGIC           0xfd    /* magic # on accounting info */
 #define RMAGIC         0x55555555      /* magic # on range info */
 #ifdef RCHECK
-#define        RSLOP           sizeof (U_int)
+#define        RSLOP           sizeof (u_int)
 #else
 #define        RSLOP           0
 #endif
 #else
 #define        RSLOP           0
 #endif
@@ -96,16 +93,14 @@ union overhead {
 #define        NBUCKETS 30
 static union overhead *nextf[NBUCKETS];
 
 #define        NBUCKETS 30
 static union overhead *nextf[NBUCKETS];
 
-#ifdef notdef
-extern char *sbrk();
-
-#endif
+static int     findbucket __P((union overhead *, int));
+static void    morecore __P((int));
 
 /*
  * nmalloc[i] is the difference between the number of mallocs and frees
  * for a given block size.
  */
 
 /*
  * nmalloc[i] is the difference between the number of mallocs and frees
  * for a given block size.
  */
-static U_int nmalloc[NBUCKETS];
+static u_int nmalloc[NBUCKETS];
 
 
 #ifdef DEBUG
 
 
 #ifdef DEBUG
@@ -176,7 +171,7 @@ malloc(nbytes)
     if (nbytes <= 0x10000)
        p->ov_size = nbytes - 1;
     p->ov_rmagic = RMAGIC;
     if (nbytes <= 0x10000)
        p->ov_size = nbytes - 1;
     p->ov_rmagic = RMAGIC;
-    *((U_int *) (((caddr_t) p) + nbytes - RSLOP)) = RMAGIC;
+    *((u_int *) (((caddr_t) p) + nbytes - RSLOP)) = RMAGIC;
 #endif
     return ((ptr_t) (((caddr_t) p) + ALIGN(sizeof(union overhead))));
 #else
 #endif
     return ((ptr_t) (((caddr_t) p) + ALIGN(sizeof(union overhead))));
 #else
@@ -193,7 +188,7 @@ malloc(nbytes)
  */
 static void
 morecore(bucket)
  */
 static void
 morecore(bucket)
-    register bucket;
+    register int bucket;
 {
     register union overhead *op;
     register int rnu;          /* 2^rnu bytes will be requested */
 {
     register union overhead *op;
     register int rnu;          /* 2^rnu bytes will be requested */
@@ -230,8 +225,8 @@ morecore(bucket)
      * Round up to minimum allocation size boundary and deduct from block count
      * to reflect.
      */
      * Round up to minimum allocation size boundary and deduct from block count
      * to reflect.
      */
-    if (((U_int) op) & ROUNDUP) {
-       op = (union overhead *) (((U_int) op + (ROUNDUP + 1)) & ~ROUNDUP);
+    if (((u_int) op) & ROUNDUP) {
+       op = (union overhead *) (((u_int) op + (ROUNDUP + 1)) & ~ROUNDUP);
        nblks--;
     }
     /*
        nblks--;
     }
     /*
@@ -269,7 +264,7 @@ free(cp)
 
 #ifdef RCHECK
     if (op->ov_index <= 13)
 
 #ifdef RCHECK
     if (op->ov_index <= 13)
-       CHECK(*(U_int *) ((caddr_t) op + op->ov_size + 1 - RSLOP) != RMAGIC,
+       CHECK(*(u_int *) ((caddr_t) op + op->ov_size + 1 - RSLOP) != RMAGIC,
              "free(%lx) bad range check.", cp);
 #endif
     CHECK(op->ov_index >= NBUCKETS, "free(%lx) bad block index.", cp);
              "free(%lx) bad range check.", cp);
 #endif
     CHECK(op->ov_index >= NBUCKETS, "free(%lx) bad block index.", cp);
@@ -330,7 +325,7 @@ realloc(cp, nbytes)
     size_t  nbytes;
 {
 #ifndef lint
     size_t  nbytes;
 {
 #ifndef lint
-    register U_int onb;
+    register u_int onb;
     union overhead *op;
     char   *res;
     register int i;
     union overhead *op;
     char   *res;
     register int i;
index 5e71778..a874ccf 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)csh.c      5.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)csh.c      5.26 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -25,6 +25,12 @@ static char sccsid[] = "@(#)csh.c    5.25 (Berkeley) %G%";
 #include <string.h>
 #include <locale.h>
 #include <unistd.h>
 #include <string.h>
 #include <locale.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 #include "pathnames.h"
 #include "csh.h"
 #include "extern.h"
 #include "pathnames.h"
index 14f61c4..314bd03 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dir.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c      5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -15,6 +15,11 @@ static char sccsid[] = "@(#)dir.c    5.9 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
 
 #include "csh.h"
 #include "dir.h"
 
 #include "csh.h"
 #include "dir.h"
index d6b987d..6030188 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dol.c      5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)dol.c      5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -15,6 +15,12 @@ static char sccsid[] = "@(#)dol.c    5.12 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 418771b..ddafec2 100644 (file)
@@ -6,21 +6,21 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #include <unistd.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "csh.h"
-#include "extern.h"
-
 #if __STDC__
 #if __STDC__
-#include <stdarg.h>
+# include <stdarg.h>
 #else
 #else
-#include <varargs.h>
+# include <varargs.h>
 #endif
 
 #endif
 
+#include "csh.h"
+#include "extern.h"
+
 char   *seterr = NULL; /* Holds last error if there was one */
 
 #define ERR_FLAGS      0xf0000000
 char   *seterr = NULL; /* Holds last error if there was one */
 
 #define ERR_FLAGS      0xf0000000
index ac7049e..c6dd545 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exec.c     5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)exec.c     5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -16,6 +16,12 @@ static char sccsid[] = "@(#)exec.c   5.15 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif 
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 2d35919..26a6498 100644 (file)
@@ -6,13 +6,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exp.c      5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)exp.c      5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdlib.h>
 #include <unistd.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdlib.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index eb5ff60..62fbf05 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)extern.h    5.3 (Berkeley) %G%
+ *     @(#)extern.h    5.4 (Berkeley) %G%
  */
 
 #include <sys/cdefs.h>
  */
 
 #include <sys/cdefs.h>
@@ -280,58 +280,53 @@ void      tvadd __P((struct timeval *, struct timeval *));
 void   tvsub __P((struct timeval *, struct timeval *, struct timeval *));
 
 /*
 void   tvsub __P((struct timeval *, struct timeval *, struct timeval *));
 
 /*
- * tc.alloc.c
+ * alloc.c
  */
 #ifndef SYSMALLOC
  */
 #ifndef SYSMALLOC
-#ifdef sun
-extern int free();
+void   free __P((ptr_t));
+ptr_t  malloc __P((size_t));
+ptr_t  realloc __P((ptr_t, size_t));
+ptr_t  calloc __P((size_t, size_t));
 #else
 #else
-extern void free();
-#endif
-extern ptr_t malloc();
-extern ptr_t realloc();
-extern ptr_t calloc();
-#else
-extern void Free();
-extern ptr_t Malloc();
-extern ptr_t Realloc();
-extern ptr_t Calloc();
+void   Free __P((ptr_t));
+ptr_t  Malloc __P((size_t));
+ptr_t  Realloc __P((ptr_t, size_t));
+ptr_t  Calloc __P((size_t, size_t));
 #endif                         /* SYSMALLOC */
 #endif                         /* SYSMALLOC */
-extern void showall();
+void   showall __P((void));
 
 /*
 
 /*
- * tc.printf.h
+ * printf.h
  */
  */
-extern void xprintf();
-extern void xsprintf();
-extern void xvprintf();
-extern void xvsprintf();
+void   xprintf __P((char *, ...));
+void   xsprintf __P((char *, char *, ...));
+void   xvprintf __P((char *, va_list));
+void   xvsprintf __P((char *, char *, va_list));
 
 /*
 
 /*
- * tc.str.c:
+ * str.c:
  */
 #ifdef SHORT_STRINGS
  */
 #ifdef SHORT_STRINGS
-extern Char *s_strchr();
-extern Char *s_strrchr();
-extern Char *s_strcat();
+Char    *s_strchr __P((Char *, int));
+Char    *s_strrchr __P((Char *, int));
+Char    *s_strcat __P((Char *, Char *));
 #ifdef NOTUSED
 #ifdef NOTUSED
-extern Char *s_strncat();
+Char    *s_strncat __P((Char *, Char *, size_t));
 #endif
 #endif
-extern Char *s_strcpy();
-extern Char *s_strncpy();
-extern Char *s_strspl();
-extern int s_strlen();
-extern int s_strcmp();
-extern int s_strncmp();
-extern Char *s_strsave();
-extern Char *s_strend();
-extern Char *s_strspl();
+Char    *s_strcpy __P((Char *, Char *));
+Char    *s_strncpy __P((Char *, Char *, size_t));
+Char    *s_strspl __P((Char *, Char *));
+size_t   s_strlen __P((Char *));
+int      s_strcmp __P((Char *, Char *));
+int      s_strncmp __P((Char *, Char *, size_t));
+Char    *s_strsave __P((Char *));
+Char    *s_strend __P((Char *));
 #ifdef NOTUSED
 #ifdef NOTUSED
-extern Char *s_strstr();
+Char    *s_strstr __P((Char *, Char *));
 #endif
 #endif
-extern Char *str2short();
-extern Char **blk2short();
-extern char *short2str();
-extern char *short2qstr();
-extern char **short2blk();
+Char    *str2short __P((char *));
+Char   **blk2short __P((char **));
+char    *short2str __P((Char *));
+char    *short2qstr __P((Char *));
+char   **short2blk __P((Char **));
 #endif
 #endif
index a12af89..ae535d5 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)file.c     5.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)file.c     5.17 (Berkeley) %G%";
 #endif /* not lint */
 
 #ifdef FILEC
 #endif /* not lint */
 
 #ifdef FILEC
@@ -19,6 +19,12 @@ static char sccsid[] = "@(#)file.c   5.16 (Berkeley) %G%";
 #include <pwd.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <pwd.h>
 #include <stdlib.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -75,7 +81,6 @@ static void
 setup_tty(on)
     int     on;
 {
 setup_tty(on)
     int     on;
 {
-#ifdef TERMIOS
     static struct termios tchars;
 
     if (on) {
     static struct termios tchars;
 
     if (on) {
@@ -93,29 +98,6 @@ setup_tty(on)
        tchars.c_cc[VEOL] = _POSIX_VDISABLE;
        (void) tcsetattr(SHIN, TCSANOW, &tchars);
     }
        tchars.c_cc[VEOL] = _POSIX_VDISABLE;
        (void) tcsetattr(SHIN, TCSANOW, &tchars);
     }
-#else
-    struct sgttyb sgtty;
-    static struct tchars tchars;/* INT, QUIT, XON, XOFF, EOF, BRK */
-
-    if (on) {
-       (void) ioctl(SHIN, TIOCGETC, (ioctl_t) & tchars);
-       tchars.t_brkc = ESC;
-       (void) ioctl(SHIN, TIOCSETC, (ioctl_t) & tchars);
-       /*
-        * This must be done after every command: if the tty gets into raw or
-        * cbreak mode the user can't even type 'reset'.
-        */
-       (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & sgtty);
-       if (sgtty.sg_flags & (RAW | CBREAK)) {
-           sgtty.sg_flags &= ~(RAW | CBREAK);
-           (void) ioctl(SHIN, TIOCSETP, (ioctl_t) & sgtty);
-       }
-    }
-    else {
-       tchars.t_brkc = -1;
-       (void) ioctl(SHIN, TIOCSETC, (ioctl_t) & tchars);
-    }
-#endif
 }
 
 /*
 }
 
 /*
@@ -124,7 +106,6 @@ setup_tty(on)
 static void
 back_to_col_1()
 {
 static void
 back_to_col_1()
 {
-#ifdef TERMIOS
     struct termios tty, tty_normal;
     int     omask;
 
     struct termios tty, tty_normal;
     int     omask;
 
@@ -137,19 +118,6 @@ back_to_col_1()
     (void) write(SHOUT, "\r", 1);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
     (void) write(SHOUT, "\r", 1);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
-#else
-    struct sgttyb tty, tty_normal;
-    int     omask;
-
-    omask = sigblock(sigmask(SIGINT));
-    (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & tty);
-    tty_normal = tty;
-    tty.sg_flags &= ~CRMOD;
-    (void) ioctl(SHIN, TIOCSETN, (ioctl_t) & tty);
-    (void) write(SHOUT, "\r", 1);
-    (void) ioctl(SHIN, TIOCSETN, (ioctl_t) & tty_normal);
-    (void) sigsetmask(omask);
-#endif
 }
 
 /*
 }
 
 /*
@@ -159,7 +127,6 @@ static void
 pushback(string)
     Char   *string;
 {
 pushback(string)
     Char   *string;
 {
-#ifdef TERMIOS
     register Char *p;
     struct termios tty, tty_normal;
     int     omask;
     register Char *p;
     struct termios tty, tty_normal;
     int     omask;
@@ -175,23 +142,6 @@ pushback(string)
        (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
        (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
-#else
-    register Char *p;
-    struct sgttyb tty, tty_normal;
-    int     omask;
-    char    c;
-
-    omask = sigblock(sigmask(SIGINT));
-    (void) ioctl(SHOUT, TIOCGETP, (ioctl_t) & tty);
-    tty_normal = tty;
-    tty.sg_flags &= ~ECHO;
-    (void) ioctl(SHOUT, TIOCSETN, (ioctl_t) & tty);
-
-    for (p = string; c = *p; p++)
-       (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
-    (void) ioctl(SHOUT, TIOCSETN, (ioctl_t) & tty_normal);
-    (void) sigsetmask(omask);
-#endif
 }
 
 /*
 }
 
 /*
@@ -336,17 +286,11 @@ tilde(new, old)
 static void
 retype()
 {
 static void
 retype()
 {
-#ifdef TERMIOS
     struct termios tty;
 
     (void) tcgetattr(SHOUT, &tty);
     tty.c_lflag |= PENDIN;
     (void) tcsetattr(SHOUT, TCSANOW, &tty);
     struct termios tty;
 
     (void) tcgetattr(SHOUT, &tty);
     tty.c_lflag |= PENDIN;
     (void) tcsetattr(SHOUT, TCSANOW, &tty);
-#else
-    int     pending_input = LPENDIN;
-
-    (void) ioctl(SHOUT, TIOCLBIS, (ioctl_t) & pending_input);
-#endif
 }
 
 static void
 }
 
 static void
index 9e948b7..7c21b13 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)func.c     5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c     5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -16,6 +16,12 @@ static char sccsid[] = "@(#)func.c   5.18 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 #include "pathnames.h"
 #include "csh.h"
 #include "extern.h"
 #include "pathnames.h"
index c20a80f..3b30c30 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)glob.c     5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)glob.c     5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -15,6 +15,12 @@ static char sccsid[] = "@(#)glob.c   5.18 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index f684ccd..7bdafe2 100644 (file)
@@ -6,11 +6,17 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)hist.c     5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)hist.c     5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index b8e96ed..7c707cf 100644 (file)
@@ -6,9 +6,15 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)init.c     5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)init.c     5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index d632864..400b156 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lex.c      5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c      5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -16,6 +16,12 @@ static char sccsid[] = "@(#)lex.c    5.15 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -1273,20 +1279,11 @@ top:
 reread:
        c = bgetc();
        if (c < 0) {
 reread:
        c = bgetc();
        if (c < 0) {
-#ifdef TERMIOS
            struct termios tty;
            struct termios tty;
-#else
-           struct sgttyb tty;
-#endif
            if (wanteof)
                return (-1);
            /* was isatty but raw with ignoreeof yields problems */
            if (wanteof)
                return (-1);
            /* was isatty but raw with ignoreeof yields problems */
-#ifdef TERMIOS
            if (tcgetattr(SHIN, &tty) == 0 && (tty.c_lflag & ICANON))
            if (tcgetattr(SHIN, &tty) == 0 && (tty.c_lflag & ICANON))
-#else
-           if (ioctl(SHIN, TIOCGETP, (ioctl_t) & tty) == 0 &&
-               (tty.sg_flags & RAW) == 0)
-#endif
            {
                /* was 'short' for FILEC */
                int     ctpgrp;
            {
                /* was 'short' for FILEC */
                int     ctpgrp;
index 269ac5d..b5b09fe 100644 (file)
@@ -6,12 +6,18 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.12 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <stdlib.h>
 #include <unistd.h>
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <stdlib.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 4623561..4724508 100644 (file)
@@ -6,12 +6,18 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parse.c    5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)parse.c    5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #include <string.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #include <string.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index 5dbe4d0..d9e8e4a 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)proc.c     5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc.c     5.20 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -15,6 +15,12 @@ static char sccsid[] = "@(#)proc.c   5.19 (Berkeley) %G%";
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "dir.h"
 #include "proc.h"
 #include "csh.h"
 #include "dir.h"
 #include "proc.h"
index ebfd502..1565447 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)sem.c      5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)sem.c      5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -17,6 +17,12 @@ static char sccsid[] = "@(#)sem.c    5.15 (Berkeley) %G%";
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "proc.h"
 #include "extern.h"
 #include "csh.h"
 #include "proc.h"
 #include "extern.h"
index d3c6678..fad8c7f 100644 (file)
@@ -6,11 +6,17 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)set.c      5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)set.c      5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <stdlib.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
index ef31910..33aa7b8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)str.c      5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)str.c      5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -15,6 +15,12 @@ static char sccsid[] = "@(#)str.c    5.2 (Berkeley) %G%";
  */
 #ifdef SHORT_STRINGS
 
  */
 #ifdef SHORT_STRINGS
 
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"
 
@@ -22,16 +28,16 @@ Char  **
 blk2short(src)
     register char **src;
 {
 blk2short(src)
     register char **src;
 {
-    int     n;
+    size_t     n;
     register Char **sdst, **dst;
 
     /*
      * Count
      */
     register Char **sdst, **dst;
 
     /*
      * Count
      */
-    for (n = 0; src[n] != (char *) 0; n++);
+    for (n = 0; src[n] != NULL; n++);
     sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *)));
 
     sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *)));
 
-    for (; *src != (char *) 0; src++)
+    for (; *src != NULL; src++)
        *dst++ = SAVE(*src);
     *dst = NULL;
     return (sdst);
        *dst++ = SAVE(*src);
     *dst = NULL;
     return (sdst);
@@ -41,18 +47,18 @@ char  **
 short2blk(src)
     register Char **src;
 {
 short2blk(src)
     register Char **src;
 {
-    int     n;
+    size_t     n;
     register char **sdst, **dst;
 
     /*
      * Count
      */
     register char **sdst, **dst;
 
     /*
      * Count
      */
-    for (n = 0; src[n] != (Char *) 0; n++);
+    for (n = 0; src[n] != NULL; n++);
     sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *)));
 
     sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *)));
 
-    for (; *src != (Char *) 0; src++)
+    for (; *src != NULL; src++)
        *dst++ = strsave(short2str(*src));
        *dst++ = strsave(short2str(*src));
-    *dst = (char *) 0;
+    *dst = NULL;
     return (sdst);
 }
 
     return (sdst);
 }
 
@@ -62,13 +68,13 @@ str2short(src)
     register char *src;
 {
     static Char *sdst;
     register char *src;
 {
     static Char *sdst;
-    static int dstsize = 0;
+    static size_t dstsize = 0;
     register Char *dst, *edst;
 
     register Char *dst, *edst;
 
-    if (src == (char *) 0)
-       return ((Char *) 0);
+    if (src == NULL)
+       return (NULL);
 
 
-    if (sdst == (Char *) 0) {
+    if (sdst == (NULL)) {
        dstsize = MALLOC_INCR;
        sdst = (Char *) xmalloc((size_t) dstsize * sizeof(Char));
     }
        dstsize = MALLOC_INCR;
        sdst = (Char *) xmalloc((size_t) dstsize * sizeof(Char));
     }
@@ -93,14 +99,14 @@ char   *
 short2qstr(src)
     register Char *src;
 {
 short2qstr(src)
     register Char *src;
 {
-    static char *sdst = (char *) 0;
-    static int dstsize = 0;
+    static char *sdst = NULL;
+    static size_t dstsize = 0;
     register char *dst, *edst;
 
     register char *dst, *edst;
 
-    if (src == (Char *) 0)
-       return ((char *) 0);
+    if (src == NULL)
+       return (NULL);
 
 
-    if (sdst == (char *) 0) {
+    if (sdst == NULL) {
        dstsize = MALLOC_INCR;
        sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
     }
        dstsize = MALLOC_INCR;
        sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
     }
@@ -133,14 +139,14 @@ char   *
 short2str(src)
     register Char *src;
 {
 short2str(src)
     register Char *src;
 {
-    static char *sdst = (char *) 0;
-    static int dstsize = 0;
+    static char *sdst = NULL;
+    static size_t dstsize = 0;
     register char *dst, *edst;
 
     register char *dst, *edst;
 
-    if (src == (Char *) 0)
-       return ((char *) 0);
+    if (src == NULL)
+       return (NULL);
 
 
-    if (sdst == (char *) 0) {
+    if (sdst == NULL) {
        dstsize = MALLOC_INCR;
        sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
     }
        dstsize = MALLOC_INCR;
        sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
     }
@@ -174,7 +180,7 @@ s_strcpy(dst, src)
 Char   *
 s_strncpy(dst, src, n)
     register Char *dst, *src;
 Char   *
 s_strncpy(dst, src, n)
     register Char *dst, *src;
-    register int n;
+    register size_t n;
 {
     register Char *sdst;
 
 {
     register Char *sdst;
 
@@ -202,7 +208,7 @@ s_strcat(dst, src)
 Char   *
 s_strncat(dst, src, n)
     register Char *dst, *src;
 Char   *
 s_strncat(dst, src, n)
     register Char *dst, *src;
-    register int n;
+    register size_t n;
 {
     register Char *sdst;
 
 {
     register Char *sdst;
 
@@ -219,22 +225,24 @@ s_strncat(dst, src, n)
 
 Char   *
 s_strchr(str, ch)
 
 Char   *
 s_strchr(str, ch)
-    register Char *str, ch;
+    register Char *str;
+    int ch;
 {
     do
        if (*str == ch)
            return (str);
     while (*str++);
 {
     do
        if (*str == ch)
            return (str);
     while (*str++);
-    return ((Char *) 0);
+    return (NULL);
 }
 
 Char   *
 s_strrchr(str, ch)
 }
 
 Char   *
 s_strrchr(str, ch)
-    register short *str, ch;
+    register Char *str;
+    int ch;
 {
     register Char *rstr;
 
 {
     register Char *rstr;
 
-    rstr = (Char *) 0;
+    rstr = NULL;
     do
        if (*str == ch)
            rstr = str;
     do
        if (*str == ch)
            rstr = str;
@@ -242,11 +250,11 @@ s_strrchr(str, ch)
     return (rstr);
 }
 
     return (rstr);
 }
 
-int
+size_t
 s_strlen(str)
     register Char *str;
 {
 s_strlen(str)
     register Char *str;
 {
-    register int n;
+    register size_t n;
 
     for (n = 0; *str++; n++);
     return (n);
 
     for (n = 0; *str++; n++);
     return (n);
@@ -275,7 +283,7 @@ s_strcmp(str1, str2)
 int
 s_strncmp(str1, str2, n)
     register Char *str1, *str2;
 int
 s_strncmp(str1, str2, n)
     register Char *str1, *str2;
-    register int n;
+    register size_t n;
 {
     for (; --n >= 0 && *str1 == *str2; str1++, str2++);
 
 {
     for (; --n >= 0 && *str1 == *str2; str1++, str2++);
 
@@ -356,7 +364,7 @@ s_strstr(s, t)
                return (s);
        while (*ss++ == *tt++);
     } while (*s++ != '\0');
                return (s);
        while (*ss++ == *tt++);
     } while (*s++ != '\0');
-    return ((Char *) 0);
+    return (NULL);
 }
 #endif
 
 }
 #endif
 
index d05fa10..03e9f24 100644 (file)
@@ -6,10 +6,16 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)time.c     5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)time.c     5.14 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
+#if __STDC__
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
 #include "csh.h"
 #include "extern.h"
 
 #include "csh.h"
 #include "extern.h"