changes from mips!dce, most compatibility stuff
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 3 Oct 1987 11:36:58 +0000 (03:36 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 3 Oct 1987 11:36:58 +0000 (03:36 -0800)
SCCS-vsn: usr.bin/window/ww.h 3.42
SCCS-vsn: usr.bin/window/wwprintf.c 3.6
SCCS-vsn: usr.bin/window/tt.h 3.17
SCCS-vsn: usr.bin/window/lcmd.c 3.26
SCCS-vsn: usr.bin/window/lcmd2.c 3.13

usr/src/usr.bin/window/lcmd.c
usr/src/usr.bin/window/lcmd2.c
usr/src/usr.bin/window/tt.h
usr/src/usr.bin/window/ww.h
usr/src/usr.bin/window/wwprintf.c

index 64bc596..46a2afe 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)lcmd.c     3.25 %G%";
+static char sccsid[] = "@(#)lcmd.c     3.26 %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -35,25 +35,25 @@ int l_variable();
 int l_window();
 int l_write();
 
 int l_window();
 int l_write();
 
-struct lcmd_arg arg_alias[];
-struct lcmd_arg arg_cursormodes[];
-struct lcmd_arg arg_debug[];
-struct lcmd_arg arg_echo[];
-struct lcmd_arg arg_escape[];
-struct lcmd_arg arg_foreground[];
-struct lcmd_arg arg_label[];
-struct lcmd_arg arg_nline[];
-struct lcmd_arg arg_close[];
-struct lcmd_arg arg_select[];
-struct lcmd_arg arg_shell[];
-struct lcmd_arg arg_smooth[];
-struct lcmd_arg arg_source[];
-struct lcmd_arg arg_terse[];
-struct lcmd_arg arg_time[];
-struct lcmd_arg arg_unalias[];
-struct lcmd_arg arg_unset[];
-struct lcmd_arg arg_window[];
-struct lcmd_arg arg_write[];
+extern struct lcmd_arg arg_alias[];
+extern struct lcmd_arg arg_cursormodes[];
+extern struct lcmd_arg arg_debug[];
+extern struct lcmd_arg arg_echo[];
+extern struct lcmd_arg arg_escape[];
+extern struct lcmd_arg arg_foreground[];
+extern struct lcmd_arg arg_label[];
+extern struct lcmd_arg arg_nline[];
+extern struct lcmd_arg arg_close[];
+extern struct lcmd_arg arg_select[];
+extern struct lcmd_arg arg_shell[];
+extern struct lcmd_arg arg_smooth[];
+extern struct lcmd_arg arg_source[];
+extern struct lcmd_arg arg_terse[];
+extern struct lcmd_arg arg_time[];
+extern struct lcmd_arg arg_unalias[];
+extern struct lcmd_arg arg_unset[];
+extern struct lcmd_arg arg_window[];
+extern struct lcmd_arg arg_write[];
 struct lcmd_arg arg_null[] = 0;
 
 struct lcmd_tab lcmd_tab[] = {
 struct lcmd_arg arg_null[] = 0;
 
 struct lcmd_tab lcmd_tab[] = {
index 1b50a6d..1b3732c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)lcmd2.c    3.12 %G%";
+static char sccsid[] = "@(#)lcmd2.c    3.13 %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -83,11 +83,11 @@ register struct value *a;
        wwprintf(w, "%-16s", strtime(&timeval));
        wwprintf(w, "%-16s", strtime(&rusage.ru_utime));
        wwprintf(w, "%-16s", strtime(&rusage.ru_stime));
        wwprintf(w, "%-16s", strtime(&timeval));
        wwprintf(w, "%-16s", strtime(&rusage.ru_utime));
        wwprintf(w, "%-16s", strtime(&rusage.ru_stime));
-       wwprintf(w, "%D\t%D\t%D\t%D\n",
+       wwprintf(w, "%ld\t%ld\t%ld\t%ld\n",
                rusage.ru_maxrss, rusage.ru_ixrss,
                rusage.ru_idrss, rusage.ru_isrss);
        wwprintf(w, "minflt\tmajflt\tnswap\tinblk\toublk\tmsgsnd\tmsgrcv\tnsigs\tnvcsw\tnivcsw\n");
                rusage.ru_maxrss, rusage.ru_ixrss,
                rusage.ru_idrss, rusage.ru_isrss);
        wwprintf(w, "minflt\tmajflt\tnswap\tinblk\toublk\tmsgsnd\tmsgrcv\tnsigs\tnvcsw\tnivcsw\n");
-       wwprintf(w, "%D\t%D\t%D\t%D\t%D\t%D\t%D\t%D\t%D\t%D\n",
+       wwprintf(w, "%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\n",
                rusage.ru_minflt, rusage.ru_majflt, rusage.ru_nswap,
                rusage.ru_inblock, rusage.ru_oublock,
                rusage.ru_msgsnd, rusage.ru_msgrcv, rusage.ru_nsignals,
                rusage.ru_minflt, rusage.ru_majflt, rusage.ru_nswap,
                rusage.ru_inblock, rusage.ru_oublock,
                rusage.ru_msgsnd, rusage.ru_msgrcv, rusage.ru_nsignals,
@@ -106,7 +106,7 @@ register struct timeval *t;
        register char *p = buf;
 
        if (t->tv_sec > 60*60) {
        register char *p = buf;
 
        if (t->tv_sec > 60*60) {
-               (void) sprintf(p, "%D:", t->tv_sec / (60*60));
+               (void) sprintf(p, "%ld:", t->tv_sec / (60*60));
                while (*p++)
                        ;
                p--;
                while (*p++)
                        ;
                p--;
@@ -114,14 +114,14 @@ register struct timeval *t;
                fill++;
        }
        if (t->tv_sec > 60) {
                fill++;
        }
        if (t->tv_sec > 60) {
-               (void) sprintf(p, fill ? "%02D:" : "%D:", t->tv_sec / 60);
+               (void) sprintf(p, fill ? "%02ld:" : "%ld:", t->tv_sec / 60);
                while (*p++)
                        ;
                p--;
                t->tv_sec %= 60;
                fill++;
        }
                while (*p++)
                        ;
                p--;
                t->tv_sec %= 60;
                fill++;
        }
-       (void) sprintf(p, fill ? "%02D.%02d" : "%D.%02D",
+       (void) sprintf(p, fill ? "%02ld.%02d" : "%ld.%02ld",
                t->tv_sec, t->tv_usec / 10000);
        return buf;
 }
                t->tv_sec, t->tv_usec / 10000);
        return buf;
 }
index 6565cea..66cdb70 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * @(#)tt.h    3.16 %G%
+ * @(#)tt.h    3.17 %G%
  */
 
 /*
  */
 
 /*
@@ -59,7 +59,7 @@ struct tt_tab {
        int tt_len;
        int (*tt_func)();
 };
        int tt_len;
        int (*tt_func)();
 };
-struct tt_tab tt_tab[];
+extern struct tt_tab tt_tab[];
 
 /*
  * Clean interface to termcap routines.
 
 /*
  * Clean interface to termcap routines.
index 8cf27b7..0e9ad54 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * @(#)ww.h    3.41 %G%        
+ * @(#)ww.h    3.42 %G%        
  */
 
 /*
  */
 
 /*
@@ -182,7 +182,7 @@ char **wwsmap;                      /* the screen map */
 union ww_char **wwos;          /* the old (current) screen */
 union ww_char **wwns;          /* the new (desired) screen */
 char *wwtouched;               /* wwns changed flags */
 union ww_char **wwos;          /* the old (current) screen */
 union ww_char **wwns;          /* the new (desired) screen */
 char *wwtouched;               /* wwns changed flags */
-int wwbaudmap[];               /* maps stty() baud rate code into number */
+extern int wwbaudmap[];                /* maps stty() baud rate code into number */
 int wwbaud;                    /* wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed] */
 int wwcursorrow, wwcursorcol;  /* where we want the cursor to be */
 int wwerrno;                   /* error number */
 int wwbaud;                    /* wwbaudmap[wwoldtty.ww_sgttyb.sg_ospeed] */
 int wwcursorrow, wwcursorcol;  /* where we want the cursor to be */
 int wwerrno;                   /* error number */
index e842e9d..73fec7d 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)wwprintf.c 3.5 %G%";
+static char sccsid[] = "@(#)wwprintf.c 3.6 %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -9,15 +9,18 @@ static char sccsid[] = "@(#)wwprintf.c        3.5 %G%";
  */
 
 #include "ww.h"
  */
 
 #include "ww.h"
+#include <varargs.h>
 
 /*VARARGS2*/
 
 /*VARARGS2*/
-wwprintf(w, fmt, args)
+wwprintf(w, fmt, va_alist)
 struct ww *w;
 char *fmt;
 struct ww *w;
 char *fmt;
+va_dcl
 {
 #include <stdio.h>
        struct _iobuf _wwbuf;
        char buf[1024];
 {
 #include <stdio.h>
        struct _iobuf _wwbuf;
        char buf[1024];
+       va_list ap;
 
        /*
         * A danger is that when buf overflows, _flsbuf() will be
 
        /*
         * A danger is that when buf overflows, _flsbuf() will be
@@ -28,6 +31,8 @@ char *fmt;
        _wwbuf._base = _wwbuf._ptr = buf;
        _wwbuf._cnt = sizeof buf;
        _wwbuf._file = -1;                      /* safe */
        _wwbuf._base = _wwbuf._ptr = buf;
        _wwbuf._cnt = sizeof buf;
        _wwbuf._file = -1;                      /* safe */
-       _doprnt(fmt, &args, &_wwbuf);
+       va_start(ap);
+       _doprnt(fmt, ap, &_wwbuf);
+       va_end(ap);
        (void) wwwrite(w, buf, _wwbuf._ptr - buf);
 }
        (void) wwwrite(w, buf, _wwbuf._ptr - buf);
 }