Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/csh decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K



details:   https://anonhg.NetBSD.org/src/rev/f8098a17ef19
branches:  trunk
changeset: 486990:f8098a17ef19
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 31 22:48:44 2000 +0000

description:
decouple us from stdio's BUFSIZ and boost BUFSIZE to 4K

diffstat:

 bin/csh/csh.c  |   8 ++++----
 bin/csh/csh.h  |  10 +++++-----
 bin/csh/dol.c  |  34 +++++++++++++++++-----------------
 bin/csh/err.c  |   6 +++---
 bin/csh/file.c |   8 ++++----
 bin/csh/func.c |   6 +++---
 bin/csh/glob.c |  10 +++++-----
 bin/csh/lex.c  |  48 ++++++++++++++++++++++++------------------------
 bin/csh/set.c  |   8 ++++----
 9 files changed, 69 insertions(+), 69 deletions(-)

diffs (truncated from 517 to 300 lines):

diff -r b9164649feab -r f8098a17ef19 bin/csh/csh.c
--- a/bin/csh/csh.c     Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/csh.c     Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: csh.c,v 1.24 1998/07/28 11:41:41 mycroft Exp $ */
+/*     $NetBSD: csh.c,v 1.25 2000/05/31 22:48:44 christos Exp $        */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)csh.c      8.2 (Berkeley) 10/12/93";
 #else
-__RCSID("$NetBSD: csh.c,v 1.24 1998/07/28 11:41:41 mycroft Exp $");
+__RCSID("$NetBSD: csh.c,v 1.25 2000/05/31 22:48:44 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -801,7 +801,7 @@
 void
 rechist()
 {
-    Char    buf[BUFSIZ], hbuf[BUFSIZ], *hfile;
+    Char    buf[BUFSIZE], hbuf[BUFSIZE], *hfile;
     int     fp, ftmp, oldidfds;
     struct  varent *shist;
 
@@ -1148,7 +1148,7 @@
 {
     Char *f;
     bool    hflg = 0;
-    Char    buf[BUFSIZ];
+    Char    buf[BUFSIZE];
 
     v++;
     if (*v && eq(*v, STRmh)) {
diff -r b9164649feab -r f8098a17ef19 bin/csh/csh.h
--- a/bin/csh/csh.h     Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/csh.h     Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: csh.h,v 1.11 1998/07/28 02:47:19 mycroft Exp $ */
+/*     $NetBSD: csh.h,v 1.12 2000/05/31 22:48:45 christos Exp $        */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,12 +38,12 @@
 /*
  * Fundamental definitions which may vary from system to system.
  *
- *     BUFSIZ          The i/o buffering size; also limits word size
+ *     BUFSIZE         The i/o buffering size; also limits word size
  *     MAILINTVL       How often to mailcheck; more often is more expensive
  */
-#ifndef BUFSIZ
-#define        BUFSIZ  1024            /* default buffer size */
-#endif                         /* BUFSIZ */
+#ifndef BUFSIZE
+#define        BUFSIZE 4096            /* default buffer size */
+#endif                         /* BUFSIZE */
 
 #define FORKSLEEP      10      /* delay loop on non-interactive fork failure */
 #define        MAILINTVL       600     /* 10 minutes */
diff -r b9164649feab -r f8098a17ef19 bin/csh/dol.c
--- a/bin/csh/dol.c     Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/dol.c     Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dol.c,v 1.13 1998/08/19 01:31:46 thorpej Exp $ */
+/*     $NetBSD: dol.c,v 1.14 2000/05/31 22:48:45 christos Exp $        */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)dol.c      8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: dol.c,v 1.13 1998/08/19 01:31:46 thorpej Exp $");
+__RCSID("$NetBSD: dol.c,v 1.14 2000/05/31 22:48:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,7 +81,7 @@
  * words within this expansion, the count of remaining words, and the
  * information about any : modifier which is being applied.
  */
-#define MAXWLEN (BUFSIZ - 4)
+#define MAXWLEN (BUFSIZE - 4)
 #define MAXMOD MAXWLEN         /* This cannot overflow */
 static Char *dolp;             /* Remaining chars from this word */
 static Char **dolnxt;          /* Further words */
@@ -226,7 +226,7 @@
 Dword()
 {
     int c, c1;
-    Char    wbuf[BUFSIZ];
+    Char    wbuf[BUFSIZE];
     Char *wp = wbuf;
     int i = MAXWLEN;
     bool dolflg;
@@ -415,7 +415,7 @@
     int     subscr = 0, lwb = 1, upb = 0;
     bool    dimen = 0, bitset = 0;
     char    tnp;
-    Char    wbuf[BUFSIZ];
+    Char    wbuf[BUFSIZE];
     static Char *dolbang = NULL;
 
     dolnmod = dolmcnt = dolwcnt = 0;
@@ -451,7 +451,7 @@
            stderror(ERR_NOTALLOWED, "$?#");
        for (np = wbuf; read(OLDSTD, &tnp, 1) == 1; np++) {
            *np = (unsigned char) tnp;
-           if (np >= &wbuf[BUFSIZ - 1])
+           if (np >= &wbuf[BUFSIZE - 1])
                stderror(ERR_LTOOLONG);
            if (tnp == '\n')
                break;
@@ -847,7 +847,7 @@
 {
     int c;
     Char   *Dv[2];
-    Char    obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ];
+    Char    obuf[BUFSIZE], lbuf[BUFSIZE], mbuf[BUFSIZE];
     int     ocnt, lcnt, mcnt;
     Char   *lbp, *obp, *mbp;
     Char  **vp;
@@ -864,14 +864,14 @@
     trim(Dv);
     rscan(Dv, Dtestq);
     quoted = gflag;
-    ocnt = BUFSIZ;
+    ocnt = BUFSIZE;
     obp = obuf;
     for (;;) {
        /*
         * Read up a line
         */
        lbp = lbuf;
-       lcnt = BUFSIZ - 4;
+       lcnt = BUFSIZE - 4;
        for (;;) {
            c = readc(1);       /* 1 -> Want EOF returns */
            if (c < 0 || c == '\n')
@@ -890,7 +890,7 @@
         * Check for EOF or compare to terminator -- before expansion
         */
        if (c < 0 || eq(lbuf, term)) {
-           (void) write(0, short2str(obuf), (size_t) (BUFSIZ - ocnt));
+           (void) write(0, short2str(obuf), (size_t) (BUFSIZE - ocnt));
            (void) lseek(0, (off_t) 0, SEEK_SET);
            return;
        }
@@ -904,9 +904,9 @@
            for (lbp = lbuf; (c = *lbp++) != '\0';) {
                *obp++ = c;
                if (--ocnt == 0) {
-                   (void) write(0, short2str(obuf), BUFSIZ);
+                   (void) write(0, short2str(obuf), BUFSIZE);
                    obp = obuf;
-                   ocnt = BUFSIZ;
+                   ocnt = BUFSIZE;
                }
            }
            continue;
@@ -919,7 +919,7 @@
        Dcp = lbuf;
        Dvp = Dv + 1;
        mbp = mbuf;
-       mcnt = BUFSIZ - 4;
+       mcnt = BUFSIZE - 4;
        for (;;) {
            c = DgetC(DODOL);
            if (c == DEOF)
@@ -968,16 +968,16 @@
            for (mbp = *vp; *mbp; mbp++) {
                *obp++ = *mbp & TRIM;
                if (--ocnt == 0) {
-                   (void) write(0, short2str(obuf), BUFSIZ);
+                   (void) write(0, short2str(obuf), BUFSIZE);
                    obp = obuf;
-                   ocnt = BUFSIZ;
+                   ocnt = BUFSIZE;
                }
            }
            *obp++ = '\n';
            if (--ocnt == 0) {
-               (void) write(0, short2str(obuf), BUFSIZ);
+               (void) write(0, short2str(obuf), BUFSIZE);
                obp = obuf;
-               ocnt = BUFSIZ;
+               ocnt = BUFSIZE;
            }
        }
        if (pargv)
diff -r b9164649feab -r f8098a17ef19 bin/csh/err.c
--- a/bin/csh/err.c     Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/err.c     Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.13 1998/07/28 11:41:42 mycroft Exp $ */
+/*     $NetBSD: err.c,v 1.14 2000/05/31 22:48:45 christos Exp $        */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)err.c      8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: err.c,v 1.13 1998/07/28 11:41:42 mycroft Exp $");
+__RCSID("$NetBSD: err.c,v 1.14 2000/05/31 22:48:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -302,7 +302,7 @@
 #endif
 {
     if (seterr == 0) {
-       char    berr[BUFSIZ];
+       char    berr[BUFSIZE];
        va_list va;
 
 #if __STDC__
diff -r b9164649feab -r f8098a17ef19 bin/csh/file.c
--- a/bin/csh/file.c    Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/file.c    Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.c,v 1.16 1999/03/23 09:29:51 itohy Exp $  */
+/*     $NetBSD: file.c,v 1.17 2000/05/31 22:48:45 christos Exp $       */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)file.c     8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: file.c,v 1.16 1999/03/23 09:29:51 itohy Exp $");
+__RCSID("$NetBSD: file.c,v 1.17 2000/05/31 22:48:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -680,12 +680,12 @@
     int     inputline_size;
 {
     int numitems, num_read;
-    char    tinputline[BUFSIZ];
+    char    tinputline[BUFSIZE];
 
 
     setup_tty(ON);
 
-    while ((num_read = read(SHIN, tinputline, BUFSIZ)) > 0) {
+    while ((num_read = read(SHIN, tinputline, BUFSIZE)) > 0) {
        int     i;
        static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
        '>', '(', ')', '|', '^', '%', '\0'};
diff -r b9164649feab -r f8098a17ef19 bin/csh/func.c
--- a/bin/csh/func.c    Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/func.c    Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.17 1998/08/19 01:31:46 thorpej Exp $        */
+/*     $NetBSD: func.c,v 1.18 2000/05/31 22:48:45 christos Exp $       */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)func.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: func.c,v 1.17 1998/08/19 01:31:46 thorpej Exp $");
+__RCSID("$NetBSD: func.c,v 1.18 2000/05/31 22:48:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -639,7 +639,7 @@
     int level;
     Char   *goal;
 {
-    Char    wordbuf[BUFSIZ];
+    Char    wordbuf[BUFSIZE];
     Char *aword = wordbuf;
     Char *cp;
 
diff -r b9164649feab -r f8098a17ef19 bin/csh/glob.c
--- a/bin/csh/glob.c    Wed May 31 22:26:58 2000 +0000
+++ b/bin/csh/glob.c    Wed May 31 22:48:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: glob.c,v 1.16 1998/07/28 11:41:44 mycroft Exp $        */
+/*     $NetBSD: glob.c,v 1.17 2000/05/31 22:48:45 christos Exp $       */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)glob.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: glob.c,v 1.16 1998/07/28 11:41:44 mycroft Exp $");
+__RCSID("$NetBSD: glob.c,v 1.17 2000/05/31 22:48:45 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -662,8 +662,8 @@
     struct command faket;



Home | Main Index | Thread Index | Old Index