Ansified usr.bin
authorNick Downing <downing.nick@gmail.com>
Tue, 31 Jan 2017 05:43:42 +0000 (16:43 +1100)
committerNick Downing <downing.nick@gmail.com>
Tue, 31 Jan 2017 05:43:42 +0000 (16:43 +1100)
32 files changed:
usr.bin/ar11.c
usr.bin/basename.c
usr.bin/cal.c
usr.bin/cb.c
usr.bin/checkeq.c
usr.bin/col.c
usr.bin/comm.c
usr.bin/crypt.c
usr.bin/deroff.c
usr.bin/fgrep.c
usr.bin/file.c
usr.bin/iostat.c
usr.bin/join.c
usr.bin/look.c
usr.bin/mesg.c
usr.bin/ptx.c
usr.bin/ranlib.c
usr.bin/rev.c
usr.bin/sleep.c
usr.bin/sort.c
usr.bin/spline.c
usr.bin/split.c
usr.bin/sum.c
usr.bin/tabs.c
usr.bin/tc.c
usr.bin/tk.c
usr.bin/touch.c
usr.bin/tr.c
usr.bin/tsort.c
usr.bin/tty.c
usr.bin/uniq.c
usr.bin/units.c

index 11a351d..169cd65 100644 (file)
@@ -1,10 +1,21 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <time.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)ar11.c      4.3 (Berkeley) 12/6/82";
+#endif
 /* ar11 - archiver for PDP-11 formatted archives */
 
-#include <signal.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 #define        ARMAG ((short)0177545)
 struct ar_hdr {
        char    ar_name[14];
@@ -28,7 +39,7 @@ long  ar_size;
 #define        mklong(sp)      (((sp)[0] << 16) + (sp)[1])
 #define unmklong(sp,l) { sp[0] = l >> 16; sp[1] = l & 0177777; }
 #define fixhdr(hdr)    swaphdr(hdr)
-struct ar_hdr swaphdr();
+/*struct       ar_hdr swaphdr();*/
 #endif
 
 struct stat    stbuf;
@@ -43,13 +54,13 @@ char        *man    = { "mrxtdp" };
 char   *opt    = { "uvnbai" };
 
 int    signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
-int    sigdone();
-int    rcmd();
-int    dcmd();
-int    xcmd();
-int    tcmd();
-int    pcmd();
-int    mcmd();
+/*int  sigdone();*/
+/*int  rcmd();*/
+/*int  dcmd();*/
+/*int  xcmd();*/
+/*int  tcmd();*/
+/*int  pcmd();*/
+/*int  mcmd();*/
 int    (*comfun)();
 char   flg[26];
 char   **namv;
@@ -68,13 +79,51 @@ int tf2;
 int    bastate;
 char   buf[512];
 
-char   *trim();
-char   *mktemp();
-char   *ctime();
+/*char *trim();*/
+/*char *mktemp();*/
+/*char *ctime();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
 
-main(argc, argv)
-char *argv[];
-{
+int main __P((int argc, char *argv[]));
+int setcom __P((int (*fun)(void)));
+int rcmd __P((void));
+int dcmd __P((void));
+int xcmd __P((void));
+int pcmd __P((void));
+int mcmd __P((void));
+int tcmd __P((void));
+int init __P((void));
+int getaf __P((void));
+int usage __P((void));
+int noar __P((void));
+int sigdone __P((void));
+int done __P((int c));
+int notfound __P((void));
+int cleanup __P((void));
+int install __P((void));
+int movefil __P((int f));
+int stats __P((void));
+int copyfil __P((int fi, int fo, int flag));
+int getdir __P((void));
+int match __P((void));
+int bamatch __P((void));
+int phserr __P((void));
+int mesg __P((int c));
+char *trim __P((char *s));
+int longt __P((void));
+int pmode __P((void));
+int select __P((int *pairp));
+int wrerr __P((void));
+struct ar_hdr swaphdr __P((struct ar_hdr hdr));
+
+int main(argc, argv) int argc; char *argv[]; {
        register i;
        register char *cp;
 
@@ -148,9 +197,7 @@ char *argv[];
        done(notfound());
 }
 
-setcom(fun)
-int (*fun)();
-{
+int setcom(fun) int (*fun)(); {
 
        if(comfun != 0) {
                fprintf(stderr, "ar11: only one of [%s] allowed\n", man);
@@ -159,8 +206,7 @@ int (*fun)();
        comfun = fun;
 }
 
-rcmd()
-{
+int rcmd() {
        register f;
 
        init();
@@ -194,8 +240,7 @@ rcmd()
        cleanup();
 }
 
-dcmd()
-{
+int dcmd() {
 
        init();
        if(getaf())
@@ -212,8 +257,7 @@ dcmd()
        install();
 }
 
-xcmd()
-{
+int xcmd() {
        register f;
 
        if(getaf())
@@ -236,8 +280,7 @@ xcmd()
        }
 }
 
-pcmd()
-{
+int pcmd() {
 
        if(getaf())
                noar();
@@ -254,8 +297,7 @@ pcmd()
        }
 }
 
-mcmd()
-{
+int mcmd() {
 
        init();
        if(getaf())
@@ -280,8 +322,7 @@ mcmd()
        install();
 }
 
-tcmd()
-{
+int tcmd() {
 
        if(getaf())
                noar();
@@ -295,8 +336,7 @@ tcmd()
        }
 }
 
-init()
-{
+int init() {
        static short mbuf = fixshort(ARMAG);
 
        tfnam = mktemp("/tmp/vXXXXX");
@@ -310,8 +350,7 @@ init()
                wrerr();
 }
 
-getaf()
-{
+int getaf() {
        short mbuf;
 
        af = open(arnam, 0);
@@ -325,26 +364,22 @@ getaf()
        return(0);
 }
 
-usage()
-{
+int usage() {
        printf("usage: ar11 [%s][%s] archive files ...\n", opt, man);
        done(1);
 }
 
-noar()
-{
+int noar() {
 
        fprintf(stderr, "ar11: %s does not exist\n", arnam);
        done(1);
 }
 
-sigdone()
-{
+int sigdone() {
        done(100);
 }
 
-done(c)
-{
+int done(c) int c; {
 
        if(tfnam)
                unlink(tfnam);
@@ -355,8 +390,7 @@ done(c)
        exit(c);
 }
 
-notfound()
-{
+int notfound() {
        register i, n;
 
        n = 0;
@@ -368,8 +402,7 @@ notfound()
        return(n);
 }
 
-cleanup()
-{
+int cleanup() {
        register i, f;
 
        for(i=0; i<namc; i++) {
@@ -388,8 +421,7 @@ cleanup()
        install();
 }
 
-install()
-{
+int install() {
        register i;
 
        for(i=0; signum[i]; i++)
@@ -422,8 +454,7 @@ install()
  * insert the file 'file'
  * into the temporary file
  */
-movefil(f)
-{
+int movefil(f) int f; {
        register char *cp;
        register i;
 
@@ -442,8 +473,7 @@ movefil(f)
        close(f);
 }
 
-stats()
-{
+int stats() {
        register f;
 
        f = open(file, 0);
@@ -460,8 +490,7 @@ stats()
  * copy next file
  * size given in arbuf
  */
-copyfil(fi, fo, flag)
-{
+int copyfil(fi, fo, flag) int fi; int fo; int flag; {
        register i, o;
        int pe;
 
@@ -495,8 +524,7 @@ copyfil(fi, fo, flag)
                phserr();
 }
 
-getdir()
-{
+int getdir() {
        register i;
 
        i = read(af, (char *)&arbuf, sizeof arbuf);
@@ -517,8 +545,7 @@ getdir()
        return(0);
 }
 
-match()
-{
+int match() {
        register i;
 
        for(i=0; i<namc; i++) {
@@ -533,8 +560,7 @@ match()
        return(0);
 }
 
-bamatch()
-{
+int bamatch() {
        register f;
 
        switch(bastate) {
@@ -560,24 +586,19 @@ bamatch()
        }
 }
 
-phserr()
-{
+int phserr() {
 
        fprintf(stderr, "ar11: phase error on %s\n", file);
 }
 
-mesg(c)
-{
+int mesg(c) int c; {
 
        if(flg['v'-'a'])
                if(c != 'c' || flg['v'-'a'] > 1)
                        printf("%c - %s\n", c, file);
 }
 
-char *
-trim(s)
-char *s;
-{
+char *trim(s) char *s; {
        register char *p1, *p2;
 
        for(p1 = s; *p1; p1++)
@@ -610,8 +631,7 @@ char *s;
 #define        XOTH    01
 #define        STXT    01000
 
-longt()
-{
+int longt() {
        register char *cp;
 
        pmode();
@@ -633,17 +653,14 @@ int       m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
 
 int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
 
-pmode()
-{
+int pmode() {
        register int **mp;
 
        for (mp = &m[0]; mp < &m[9];)
                select(*mp++);
 }
 
-select(pairp)
-int *pairp;
-{
+int select(pairp) int *pairp; {
        register int n, *ap;
 
        ap = pairp;
@@ -653,17 +670,13 @@ int *pairp;
        putchar(*ap);
 }
 
-wrerr()
-{
+int wrerr() {
        perror("ar write error");
        done(1);
 }
 
 #ifdef mc68000
-struct ar_hdr
-swaphdr(hdr)
-       struct ar_hdr hdr;
-{
+struct ar_hdr swaphdr(hdr) struct ar_hdr hdr; {
        hdr.ar_sdate[0] = fixshort(hdr.ar_sdate[0]);
        hdr.ar_sdate[1] = fixshort(hdr.ar_sdate[1]);
        hdr.ar_ssize[0] = fixshort(hdr.ar_ssize[0]);
index 4cc7f14..319758c 100644 (file)
@@ -1,10 +1,12 @@
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)basename.c  4.2 (Berkeley) 10/20/82";
+#endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register char *p1, *p2, *p3;
 
        if (argc < 2) {
index 065ce75..4eb5014 100644 (file)
@@ -1,4 +1,6 @@
-#ifndef lint
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)cal.c      4.3 (Berkeley) 83/08/11";
 #endif
 
@@ -11,9 +13,21 @@ char *smon[]= {
        "September", "October", "November", "December",
 };
 char   string[432];
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int number __P((char *str));
+int pstr __P((char *str, int n));
+int cal __P((int m, int y, char *p, int w));
+int jan1 __P((int yr));
+
+int main(argc, argv) int argc; char *argv[]; {
        register y, i, j;
        int m;
 
@@ -72,9 +86,7 @@ badarg:
        printf("Bad argument\n");
 }
 
-number(str)
-char *str;
-{
+int number(str) char *str; {
        register n, c;
        register char *s;
 
@@ -88,9 +100,7 @@ char *str;
        return(n);
 }
 
-pstr(str, n)
-char *str;
-{
+int pstr(str, n) char *str; int n; {
        register i;
        register char *s;
 
@@ -114,9 +124,7 @@ char        mon[] = {
        30, 31, 30, 31,
 };
 
-cal(m, y, p, w)
-char *p;
-{
+int cal(m, y, p, w) int m; int y; char *p; int w; {
        register d, i;
        register char *s;
 
@@ -174,8 +182,7 @@ char *p;
  *     of jan 1 of given year
  */
 
-jan1(yr)
-{
+int jan1(yr) int yr; {
        register y, d;
 
 /*
index 0cb5380..a36c950 100644 (file)
@@ -1,5 +1,9 @@
-static char *sccsid = "@(#)cb.c        4.3 (Berkeley) 2/17/86";
 #include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)cb.c        4.3 (Berkeley) 2/17/86";
+#endif
+/*#include <stdio.h>*/
 int    slevel[10];
 int    clevel  = 0;
 int    spflg[20][10];
@@ -37,10 +41,26 @@ int peek    = -1;
 int    tabs    = 0;
 int    lastchar;
 int    c;
-int    getstr();
-main(argc,argv) int argc;
-char argv[];
-{
+/*int  getstr();*/
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char argv[]));
+int ptabs __P((void));
+int getch __P((void));
+int _puts __P((void));
+int lookup __P((char *tab[]));
+int getstr __P((void));
+int gotelse __P((void));
+int getnl __P((void));
+int comment __P((void));
+
+int main(argc, argv) int argc; char argv[]; {
        while((c = getch()) != EOF){
                switch(c){
                case ' ':
@@ -253,17 +273,17 @@ cont:
                }
        }
 }
-ptabs(){
+int ptabs() {
        int i;
        for(i=0; i < tabs; i++)printf("\t");
 }
-getch(){
+int getch() {
        if(peek < 0 && lastchar != ' ' && lastchar != '\t')pchar = lastchar;
        lastchar = (peek<0) ? getc(stdin):peek;
        peek = -1;
        return(lastchar);
 }
-_puts(){
+int _puts() {
        if(j > 0){
                if(sflg != 0){
                        ptabs();
@@ -284,9 +304,7 @@ _puts(){
                }
        }
 }
-lookup(tab)
-char *tab[];
-{
+int lookup(tab) char *tab[]; {
        char r;
        int l,kk,k,i;
        if(j < 1)return(0);
@@ -299,7 +317,7 @@ char *tab[];
        }
        return(0);
 }
-getstr(){
+int getstr() {
        char ch;
 beg:
        if((ch = string[j++] = getch()) == '\\'){
@@ -317,13 +335,13 @@ beg:
        }
        else return(ch);
 }
-gotelse(){
+int gotelse() {
        tabs = stabs[clevel][iflev];
        pflg[level] = spflg[clevel][iflev];
        ind[level] = sind[clevel][iflev];
        ifflg = 1;
 }
-getnl(){
+int getnl() {
        while((peek = getch()) == '\t' || peek == ' '){
                string[j++] = peek;
                peek = -1;
@@ -344,7 +362,7 @@ getnl(){
        }
        return(0);
 }
-comment(){
+int comment() {
        int i = j;
 
        while ((c = getch()) != EOF) {
index 086af7a..26d35a3 100644 (file)
@@ -1,9 +1,25 @@
-static char *sccsid = "@(#)checkeq.c   4.2 (Berkeley) 4/29/83";
 #include <stdio.h>
+#include <sys/errno.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)checkeq.c   4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
 FILE   *fin;
 int    delim   = '$';
 
-main(argc, argv) char **argv; {
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int check __P((FILE *f));
+
+int main(argc, argv) int argc; char **argv; {
 
        if (argc <= 1)
                check(stdin);
@@ -19,9 +35,7 @@ main(argc, argv) char **argv; {
                }
 }
 
-check(f)
-FILE   *f;
-{
+int check(f) FILE *f; {
        int start, line, eq, ndel, totdel;
        char in[600], *p;
 
index fdc2313..c7ef15a 100644 (file)
@@ -1,5 +1,11 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)col.c       4.2 (Berkeley) 5/15/84";
-# include <stdio.h>
+#endif
+/*# include <stdio.h>*/
 # define PL 256
 # define ESC '\033'
 # define RLF '\013'
@@ -16,11 +22,25 @@ int cp, lp;
 int ll, llh, mustwr;
 int pcp = 0;
 char *pgmname;
-char   *strcpy();
-
-main (argc, argv)
-       int argc; char **argv;
-{
+/*char *strcpy();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int outc __P((int c));
+int store __P((int lno));
+int fetch __P((int lno));
+int emit __P((char *s, int lineno));
+int incr __P((void));
+int decr __P((void));
+
+int main(argc, argv) int argc; char **argv; {
        int i;
        int greek;
        register int c;
@@ -157,9 +177,7 @@ main (argc, argv)
        exit(0);
 }
 
-outc (c)
-       register char c;
-{
+int outc(c) int c; {
        if (lp > cp) {
                line = lbuff;
                lp = 0;
@@ -203,8 +221,7 @@ outc (c)
        }
 }
 
-store (lno)
-{
+int store(lno) int lno; {
        void *malloc();
 
        lno %= PL;
@@ -218,8 +235,7 @@ store (lno)
        strcpy (page[lno],lbuff);
 }
 
-fetch(lno)
-{
+int fetch(lno) int lno; {
        register char *p;
 
        lno %= PL;
@@ -231,10 +247,7 @@ fetch(lno)
        if (page[lno])
                strcpy (line, page[lno]);
 }
-emit (s, lineno)
-       char *s;
-       int lineno;
-{
+int emit(s, lineno) char *s; int lineno; {
        static int cline = 0;
        register int ncp;
        register char *p;
@@ -285,8 +298,7 @@ emit (s, lineno)
        }
 }
 
-incr()
-{
+int incr() {
        store (ll++);
        if (ll > llh)
                llh = ll;
@@ -299,8 +311,7 @@ incr()
        fetch (ll);
 }
 
-decr()
-{
+int decr() {
        if (ll > mustwr - PL) {
                store (ll--);
                fetch (ll);
index b88871c..e69ba4f 100644 (file)
@@ -1,5 +1,10 @@
-static char *sccsid = "@(#)comm.c      4.2 (Berkeley) 4/29/83";
 #include <stdio.h>
+#include <sys/errno.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)comm.c      4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
 #define LB 256
 int    one;
 int    two;
@@ -9,10 +14,23 @@ char *ldr[3];
 
 FILE *ib1;
 FILE *ib2;
-FILE *openfil();
-main(argc,argv)
-char   *argv[];
-{
+/*FILE *openfil();*/
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int rd __P((FILE *file, char *buf));
+int wr __P((char *str, int n));
+int copy __P((FILE *ibuf, char *lbuf, int n));
+int compare __P((char *a, char *b));
+FILE *openfil __P((char *s));
+
+int main(argc, argv) int argc; char *argv[]; {
        int     l;
        char    lb1[LB],lb2[LB];
 
@@ -58,7 +76,6 @@ char  *argv[];
        ib1 = openfil(argv[1]);
        ib2 = openfil(argv[2]);
 
-
        if(rd(ib1,lb1) < 0) {
                if(rd(ib2,lb2) < 0)     exit(0);
                copy(ib2,lb2,2);
@@ -91,10 +108,7 @@ char        *argv[];
        }
 }
 
-rd(file,buf)
-FILE *file;
-char *buf;
-{
+int rd(file, buf) FILE *file; char *buf; {
 
        register int i, c;
        i = 0;
@@ -110,9 +124,7 @@ char *buf;
        return(-1);
 }
 
-wr(str,n)
-       char    *str;
-{
+int wr(str, n) char *str; int n; {
 
        switch(n) {
 
@@ -130,10 +142,7 @@ wr(str,n)
        printf("%s%s\n",ldr[n-1],str);
 }
 
-copy(ibuf,lbuf,n)
-FILE *ibuf;
-char *lbuf;
-{
+int copy(ibuf, lbuf, n) FILE *ibuf; char *lbuf; int n; {
        do {
                wr(lbuf,n);
        } while(rd(ibuf,lbuf) >= 0);
@@ -141,9 +150,7 @@ char *lbuf;
        exit(0);
 }
 
-compare(a,b)
-       char    *a,*b;
-{
+int compare(a, b) char *a; char *b; {
        register char *ra,*rb;
 
        ra = --a;
@@ -153,9 +160,7 @@ compare(a,b)
        if(*ra < *rb)   return(1);
        return(2);
 }
-FILE *openfil(s)
-char *s;
-{
+FILE *openfil(s) char *s; {
        FILE *b;
        if(s[0]=='-' && s[1]==0)
                b = stdin;
index 6c37df7..fa452ae 100644 (file)
@@ -1,4 +1,15 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/proc.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)crypt.c     4.3 (Berkeley) 1/25/85";
+#endif
 
 /*
  *     A one-rotor machine designed along the lines of Enigma
@@ -6,19 +17,29 @@ static char *sccsid = "@(#)crypt.c   4.3 (Berkeley) 1/25/85";
  */
 
 #define ECHO 010
-#include <stdio.h>
+/*#include <stdio.h>*/
 #define ROTORSZ 256
 #define MASK 0377
 char   t1[ROTORSZ];
 char   t2[ROTORSZ];
 char   t3[ROTORSZ];
 char   deck[ROTORSZ];
-char   *getpass();
+/*char *getpass();*/
 char   buf[13];
 
-setup(pw)
-char *pw;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int setup __P((char *pw));
+int main __P((int argc, char *argv[]));
+int shuffle __P((char deck[]));
+
+int setup(pw) char *pw; {
        int ic, i, k, temp, pf[2];
        int pid, wpid;
        unsigned random;
@@ -72,9 +93,7 @@ char *pw;
                t2[t1[i]&MASK] = i;
 }
 
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        register i, n1, n2, nr1, nr2;
        int secureflg = 0;
 
@@ -115,9 +134,7 @@ char *argv[];
        }
 }
 
-shuffle(deck)
-       char deck[];
-{
+int shuffle(deck) char deck[]; {
        int i, ic, k, temp;
        unsigned random;
        static long seed = 123;
index b318948..0ddc6c8 100644 (file)
@@ -1,8 +1,13 @@
-#ifndef lint
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)deroff.c   4.5     (Berkeley)      84/12/18";
-#endif not lint
+#endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 /*
  *     Deroff command -- strip troff, eqn, and Tbl sequences from
@@ -27,10 +32,10 @@ static char sccsid[] = "@(#)deroff.c        4.5     (Berkeley)      84/12/18";
 #ifdef DEBUG
 #  define C    _Cget()
 #  define C1   _C1get()
-#else not DEBUG
+#else
 #  define C    Cget
 #  define C1   C1get
-#endif not DEBUG
+#endif
 
 #define SKIP while(C != '\n') 
 #define SKIP_TO_COM SKIP; SKIP; pc=c; while(C != '.' || pc != '\n' || C > 'Z')pc=c
@@ -44,7 +49,7 @@ static char sccsid[] = "@(#)deroff.c  4.5     (Berkeley)      84/12/18";
 
 #ifdef DEBUG
 char *mactab[] = {"-ms", "-mm", "-me", "-ma"};
-#endif DEBUG
+#endif
 
 #define        ONE 1
 #define        TWO 2
@@ -75,7 +80,6 @@ int pc;
 int ldelim;
 int rdelim;
 
-
 int argc;
 char **argv;
 
@@ -83,7 +87,7 @@ char fname[50];
 FILE *files[15];
 FILE **filesp;
 FILE *infile;
-FILE   *opn();
+/*FILE *opn();*/
 /*
  *     Flags for matching conditions other than
  *     the macro name
@@ -130,10 +134,71 @@ extern struct     mactab  manmactab[];
  */
 #define        M(cond, c1, c2, func) {cond, tomac(c1, c2), func}
 \f
-main(ac, av)
-int ac;
-char **av;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int ac, char **av));
+int skeqn __P((void));
+FILE *opn __P((register char *p));
+int eof __P((void));
+int getfname __P((void));
+int fatal __P((char *s, char *p));
+int textline __P((char *str, int _const));
+int work __P((void));
+int regline __P((int (*pfunc)(void), int _const));
+int macro __P((void));
+int tbl __P((void));
+int stbl __P((void));
+int eqn __P((void));
+int backsl __P((void));
+char *copys __P((register char *s));
+int sce __P((void));
+int refer __P((int c1));
+int inpic __P((void));
+int _C1get __P((void));
+int _Cget __P((void));
+int msputmac __P((register char *s, int _const));
+int msputwords __P((int macline));
+int meputmac __P((register char *cp, int _const));
+int meputwords __P((int macline));
+int noblock __P((int a1, int a2));
+int EQ __P((void));
+int domacro __P((void));
+int PS __P((void));
+int skip __P((void));
+int intbl __P((void));
+int outtbl __P((void));
+int so __P((void));
+int nx __P((void));
+int skiptocom __P((void));
+int PP __P((pacmac c12));
+int AU __P((void));
+int SH __P((pacmac c12));
+int UX __P((void));
+int MMHU __P((pacmac c12));
+int mesnblock __P((pacmac c12));
+int mssnblock __P((pacmac c12));
+int nf __P((void));
+int ce __P((void));
+int meip __P((pacmac c12));
+int mepp __P((pacmac c12));
+int mesh __P((pacmac c12));
+int mefont __P((pacmac c12));
+int manfont __P((pacmac c12));
+int manpp __P((pacmac c12));
+int defcomline __P((pacmac c12));
+int comline __P((void));
+int macsort __P((struct mactab *p1, struct mactab *p2));
+int sizetab __P((register struct mactab *mp));
+struct mactab *macfill __P((register struct mactab *dst, register struct mactab *src));
+int buildtab __P((struct mactab **r_back, int *r_size));
+
+int main(ac, av) int ac; char **av; {
        register int i;
        int     errflg = 0;
        register        optchar;
@@ -197,7 +262,7 @@ char **av;
 #ifdef DEBUG
        printf("msflag = %d, mac = %s, keepblock = %d, disp = %d\n",
                msflag, mactab[mac], keepblock, disp);
-#endif DEBUG
+#endif
        if (argc == 0){
                infile = stdin;
        } else {
@@ -206,7 +271,6 @@ char **av;
                ++argv;
        }
 
-
        files[0] = infile;
        filesp = &files[0];
 
@@ -225,10 +289,9 @@ char **av;
        chars[':'] = PUNCT;
        work();
 }
-char *calloc();
+/*char *calloc();*/
 
-skeqn()
-{
+int skeqn() {
        while((c = getc(infile)) != rdelim)
                if(c == EOF)
                        c = eof();
@@ -243,9 +306,7 @@ skeqn()
        return(c = ' ');
 }
 
-FILE *opn(p)
-register char *p;
-{
+FILE *opn(p) register char *p; {
        FILE *fd;
 
        if( (fd = fopen(p, "r")) == NULL) {
@@ -257,8 +318,7 @@ register char *p;
        return(fd);
 }
 
-eof()
-{
+int eof() {
        if(infile != stdin)
                fclose(infile);
        if(filesp > files)
@@ -272,8 +332,7 @@ eof()
        return(C);
 }
 
-getfname()
-{
+int getfname() {
        register char *p;
        struct chain { 
                struct chain *nextp; 
@@ -294,8 +353,7 @@ getfname()
        /* see if this name has already been used */
 
        for(q = namechain ; q; q = q->nextp)
-               if( ! strcmp(fname, q->datap))
-               {
+               if( ! strcmp(fname, q->datap)) {
                        fname[0] = '\0';
                        return;
                }
@@ -306,19 +364,14 @@ getfname()
        namechain = q;
 }
 
-fatal(s,p)
-char *s, *p;
-{
+int fatal(s, p) char *s; char *p; {
        fprintf(stderr, "Deroff: ");
        fprintf(stderr, s, p);
        exit(1);
 }
 
 /*ARGSUSED*/
-textline(str, _const)
-       char    *str;
-       int     _const;
-{
+int textline(str, _const) char *str; int _const; {
        if (wordflag) {
                msputwords(0);
                return;
@@ -326,14 +379,12 @@ textline(str, _const)
        puts(str);
 }
 
-work()
-{
-       for( ;; )
-       {
+int work() {
+       for( ;; ) {
                C;
 #ifdef FULLDEBUG
                printf("Starting work with `%c'\n", c);
-#endif FULLDEBUG
+#endif
                if(c == '.'  ||  c == '\'')
                        comline();
                else
@@ -341,14 +392,10 @@ work()
        }
 }
 
-regline(pfunc, _const)
-       int     (*pfunc)();
-       int     _const;
-{
+int regline(pfunc, _const) int (*pfunc)(); int _const; {
        line[0] = c;
        lp = line;
-       for( ; ; )
-       {
+       for( ; ; ) {
                if(c == '\\') {
                        *lp = ' ';
                        backsl();
@@ -372,8 +419,7 @@ regline(pfunc, _const)
                (*pfunc)(line, _const);
 }
 
-macro()
-{
+int macro() {
        if(msflag){
                do { 
                        SKIP; 
@@ -385,14 +431,12 @@ macro()
        inmacro = YES;
 }
 
-tbl()
-{
+int tbl() {
        while(C != '.');
        SKIP;
        intable = YES;
 }
-stbl()
-{
+int stbl() {
        while(C != '.');
        SKIP_TO_COM;
        if(c != 'T' || C != 'E'){
@@ -402,8 +446,7 @@ stbl()
        }
 }
 
-eqn()
-{
+int eqn() {
        register int c1, c2;
        register int dflg;
        char last;
@@ -412,14 +455,11 @@ eqn()
        dflg = 1;
        SKIP;
 
-       for( ;;)
-       {
-               if(C1 == '.'  || c == '\'')
-               {
+       for( ;;) {
+               if(C1 == '.'  || c == '\'') {
                        while(C1==' ' || c=='\t')
                                ;
-                       if(c=='E' && C1=='N')
-                       {
+                       if(c=='E' && C1=='N') {
                                SKIP;
                                if(msflag && dflg){
                                        putchar('x');
@@ -432,15 +472,12 @@ eqn()
                                return;
                        }
                }
-               else if(c == 'd')       /* look for delim */
-               {
+               else if(c == 'd')       /* look for delim */ {
                        if(C1=='e' && C1=='l')
-                               if( C1=='i' && C1=='m')
-                               {
+                               if( C1=='i' && C1=='m') {
                                        while(C1 == ' ');
                                        if((c1=c)=='\n' || (c2=C1)=='\n'
-                                           || (c1=='o' && c2=='f' && C1=='f') )
-                                       {
+                                           || (c1=='o' && c2=='f' && C1=='f') ) {
                                                ldelim = NOCHAR;
                                                rdelim = NOCHAR;
                                        }
@@ -459,13 +496,11 @@ eqn()
        }
 }
 
-backsl()       /* skip over a complete backslash construction */
-{
+int backsl() /* skip over a complete backslash construction */ {
        int bdelim;
 
 sw:  
-       switch(C)
-       {
+       switch(C) {
        case '"':
                SKIP;
                return;
@@ -525,9 +560,7 @@ sw:
        }
 }
 
-char *copys(s)
-register char *s;
-{
+char *copys(s) register char *s; {
        register char *t, *t0;
 
        if( (t0 = t = calloc( (unsigned)(strlen(s)+1), sizeof(*t) ) ) == NULL)
@@ -538,8 +571,7 @@ register char *s;
        return(t0);
 }
 
-sce()
-{
+int sce() {
        register char *ap;
        register int n, i;
        char a[10];
@@ -579,8 +611,7 @@ sce()
        }
 }
 
-refer(c1)
-{
+int refer(c1) int c1; {
        register int c2;
        if(c1 != '\n')
                SKIP;
@@ -600,8 +631,7 @@ refer(c1)
        }
 }
 
-inpic()
-{
+int inpic() {
        register int c1;
        register char *p1;
        SKIP;
@@ -645,23 +675,18 @@ inpic()
 }
 
 #ifdef DEBUG
-_C1get()
-{
+int _C1get() {
        return(C1get);
 }
-_Cget()
-{
+int _Cget() {
        return(Cget);
 }
-#endif DEBUG
+#endif
 \f
 /*
  *     Put out a macro line, using ms and mm conventions.
  */
-msputmac(s, _const)
-       register char *s;
-       int     _const;
-{
+int msputmac(s, _const) register char *s; int _const; {
        register char *t;
        register found;
        int last;
@@ -671,8 +696,7 @@ msputmac(s, _const)
                msputwords(YES);
                return;
        }
-       while(*s)
-       {
+       while(*s) {
                while(*s==' ' || *s=='\t')
                        putchar(*s++);
                for(t = s ; *t!=' ' && *t!='\t' && *t!='\0' ; ++t)
@@ -702,9 +726,7 @@ msputmac(s, _const)
 /*
  *     put out words (for the -w option) with ms and mm conventions
  */
-msputwords(macline)    
-       int macline;    /* is this is a macro line */
-{
+int msputwords(macline) int macline;   /* is this is a macro line */ {
        register char *p, *p1;
        int i, nlet;
 
@@ -738,10 +760,7 @@ msputwords(macline)
 #define SKIPBLANK(cp)  while(*cp == ' ' || *cp == '\t') { cp++; }
 #define SKIPNONBLANK(cp) while(*cp !=' ' && *cp !='\cp' && *cp !='\0') { cp++; }
 
-meputmac(cp, _const)
-       register        char    *cp;
-               int     _const;
-{
+int meputmac(cp, _const) register char *cp; int _const; {
        register        char    *np;
                int     found;
                int     argno;
@@ -795,7 +814,7 @@ meputmac(cp, _const)
                        }
                        printf("]");
                }
-#endif FULLDEBUG
+#endif
                /*
                 *      Determine if the argument merits being printed
                 *
@@ -825,9 +844,7 @@ meputmac(cp, _const)
 /*
  *     put out words (for the -w option) with ms and mm conventions
  */
-meputwords(macline)
-       int     macline;
-{
+int meputwords(macline) int macline; {
        msputwords(macline);
 }
 /*
@@ -850,9 +867,7 @@ meputwords(macline)
  *             ([lqbzcdf]
  */
 
-noblock(a1, a2)
-       char a1, a2;
-{
+int noblock(a1, a2) int a1; int a2; {
        register int c1,c2;
        register int eqnf;
        int lct;
@@ -909,18 +924,15 @@ noblock(a1, a2)
        }
 }
 
-EQ()
-{
+int EQ() {
        eqn();
        return(0);
 }
-domacro()
-{
+int domacro() {
        macro();
        return(0);
 }
-PS()
-{
+int PS() {
        if (!msflag) {
                inpic();
        } else {
@@ -929,14 +941,12 @@ PS()
        return(0);
 }
 
-skip()
-{
+int skip() {
        SKIP;
        return(0);
 }
 
-intbl()
-{
+int intbl() {
        if(msflag){ 
                stbl(); 
        }
@@ -944,17 +954,15 @@ intbl()
        return(0);
 }
 
-outtbl(){ intable = NO; }
+int outtbl() { intable = NO; }
 
-so()
-{
+int so() {
        getfname();
        if( fname[0] )
                infile = *++filesp = opn( fname );
        return(0);
 }
-nx()
-{
+int nx() {
        getfname();
        if(fname[0] == '\0') exit(0);
        if(infile != stdin)
@@ -962,11 +970,9 @@ nx()
        infile = *filesp = opn(fname);
        return(0);
 }
-skiptocom(){ SKIP_TO_COM; return(COMX); }
+int skiptocom() { SKIP_TO_COM; return(COMX); }
 
-PP(c12)
-       pacmac  c12;
-{
+int PP(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
@@ -975,8 +981,7 @@ PP(c12)
        putchar('\n');
        return(0);
 }
-AU()
-{
+int AU() {
        if(mac==MM) {
                return(0);
        } else {
@@ -985,9 +990,7 @@ AU()
        }
 }
 
-SH(c12)
-       pacmac  c12;
-{
+int SH(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
@@ -1012,8 +1015,7 @@ SH(c12)
        }
 }
 
-UX()
-{
+int UX() {
        if(wordflag)
                printf("UNIX\n");
        else
@@ -1021,9 +1023,7 @@ UX()
        return(0);
 }
 
-MMHU(c12)
-       pacmac  c12;
-{
+int MMHU(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
@@ -1037,39 +1037,31 @@ MMHU(c12)
        return(0);
 }
 
-mesnblock(c12)
-       pacmac  c12;
-{
+int mesnblock(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
        noblock(')',c2);
        return(0);
 }
-mssnblock(c12)
-       pacmac  c12;
-{
+int mssnblock(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
        noblock(c1,'E');
        return(0);
 }      
-nf()
-{
+int nf() {
        noblock('f','i');
        return(0);
 }
 
-ce()
-{
+int ce() {
        sce();
        return(0);
 }
 
-meip(c12)
-       pacmac  c12;
-{
+int meip(c12) pacmac c12; {
        if(parag)
                mepp(c12);
        else if (wordflag)      /* save the tag */
@@ -1082,18 +1074,14 @@ meip(c12)
 /*
  *     only called for -me .pp or .sh, when parag is on
  */
-mepp(c12)
-       pacmac  c12;
-{
+int mepp(c12) pacmac c12; {
        PP(c12);                /* eats the line */
        return(0);
 }
 /* 
  *     Start of a section heading; output the section name if doing words
  */
-mesh(c12)
-       pacmac  c12;
-{
+int mesh(c12) pacmac c12; {
        if (parag)
                mepp(c12);
        else if (wordflag)
@@ -1106,28 +1094,20 @@ mesh(c12)
 /*
  *     process a font setting
  */
-mefont(c12)
-       pacmac  c12;
-{
+int mefont(c12) pacmac c12; {
        argconcat = 1;
        defcomline(c12);
        argconcat = 0;
        return(0);
 }
-manfont(c12)
-       pacmac  c12;
-{
+int manfont(c12) pacmac c12; {
        return(mefont(c12));
 }
-manpp(c12)
-       pacmac  c12;
-{
+int manpp(c12) pacmac c12; {
        return(mepp(c12));
 }
 
-defcomline(c12)
-       pacmac  c12;
-{
+int defcomline(c12) pacmac c12; {
        int     c1, c2;
        
        frommac(c12, c1, c2);
@@ -1167,8 +1147,7 @@ defcomline(c12)
        --inmacro;
 }
 
-comline()
-{
+int comline() {
        register        int     c1;
        register        int     c2;
                pacmac  c12;
@@ -1223,7 +1202,7 @@ comx:
                        hit = 1;
 #ifdef FULLDEBUG
                        printf("preliminary hit macro %c%c ", c1, c2);
-#endif FULLDEBUG
+#endif
                        switch(mp->condition){
                        case NONE:      hit = YES;                      break;
                        case FNEST:     hit = (filesp == files);        break;
@@ -1236,7 +1215,7 @@ comx:
                        if (hit) {
 #ifdef FULLDEBUG
                                printf("MATCH\n");
-#endif FULLDEBUG
+#endif
                                switch( (*(mp->func))(c12) ) {
                                default:        return;
                                case COMX:      goto comx;
@@ -1245,22 +1224,18 @@ comx:
                        }
 #ifdef FULLDEBUG
                        printf("FAIL\n");
-#endif FULLDEBUG
+#endif
                        break;
                }
        }
        defcomline(c12);
 }
 
-int macsort(p1, p2)
-       struct  mactab  *p1, *p2;
-{
+int macsort(p1, p2) struct mactab *p1; struct mactab *p2; {
        return(p1->macname - p2->macname);
 }
 
-int sizetab(mp)
-       register        struct  mactab  *mp;
-{
+int sizetab(mp) register struct mactab *mp; {
        register        int     i;
        i = 0;
        if (mp){
@@ -1270,10 +1245,7 @@ int sizetab(mp)
        return(i);
 }
 
-struct mactab *macfill(dst, src)
-       register        struct  mactab  *dst;
-       register        struct  mactab  *src;
-{
+struct mactab *macfill(dst, src) register struct mactab *dst; register struct mactab *src; {
        if (src) {
                while(src->macname){
                        *dst++ = *src++;
@@ -1282,10 +1254,7 @@ struct mactab *macfill(dst, src)
        return(dst);
 }
 
-buildtab(r_back, r_size)
-       struct  mactab  **r_back;
-       int     *r_size;
-{
+int buildtab(r_back, r_size) struct mactab **r_back; int *r_size; {
        int     size;
 
        struct  mactab  *p, *p1, *p2;
@@ -1415,7 +1384,6 @@ struct    mactab  memactab[] = {
        M(NONE,         0,0,            0)
 };
 
-
 struct mactab  manmactab[] = {
        M(PARAG,        'B','I',        manfont),
        M(PARAG,        'B','R',        manfont),
index e6ba439..03124a3 100644 (file)
@@ -1,4 +1,14 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+#include <sys/file.h>
+#include <sys/fs.h>
+/*#include <sys/param.h> gen.h*/
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)fgrep.c     4.3 (Berkeley) 5/30/85";
+#endif
 /*
  * fgrep -- print all lines containing any of a set of keywords
  *
@@ -8,10 +18,10 @@ static char *sccsid = "@(#)fgrep.c   4.3 (Berkeley) 5/30/85";
  *             2 - some error
  */
 
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/param.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
 
 #define BLKSIZE 8192
 #define        MAXSIZ 6000
@@ -36,9 +46,22 @@ long tln;
 FILE   *wordf;
 char   *argptr;
 
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int execute __P((char *file));
+int getargc __P((void));
+int cgotofn __P((void));
+int overflo __P((void));
+int cfail __P((void));
+
+int main(argc, argv) int argc; char **argv; {
        while (--argc > 0 && (++argv)[0][0]=='-')
                switch (argv[0][1]) {
 
@@ -121,9 +144,7 @@ out:
 
 # define ccomp(a,b) (yflag ? lca(a)==lca(b) : a==b)
 # define lca(x) (isupper(x) ? tolower(x) : x)
-execute(file)
-char *file;
-{
+int execute(file) char *file; {
        register struct words *c;
        register ccount;
        register char ch;
@@ -250,8 +271,7 @@ char *file;
        }
 }
 
-getargc()
-{
+int getargc() {
        register c;
        if (wordf)
                return(getc(wordf));
@@ -260,7 +280,7 @@ getargc()
        return(c);
 }
 
-cgotofn() {
+int cgotofn() {
        register c;
        register struct words *s;
 
@@ -323,11 +343,11 @@ nword:    for(;;) {
                goto nword;
 }
 
-overflo() {
+int overflo() {
        fprintf(stderr, "wordlist too large\n");
        exit(2);
 }
-cfail() {
+int cfail() {
        struct words *queue[QSIZE];
        struct words **front, **rear;
        struct words *state;
index 94702df..d89f331 100644 (file)
@@ -1,15 +1,26 @@
-#ifndef lint
+#include <a.out.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/file.h>
+/*#include <sys/param.h> sys/file.h*/
+#include <sys/stat.h>
+/*#include <sys/types.h> stdio.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)file.c     4.12 (Berkeley) 11/17/85";
 #endif
 /*
  * file - determine type of file
  */
 
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <a.out.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <a.out.h>*/
 int    errno;
 int    sys_nerr;
 char   *sys_errlist[];
@@ -35,9 +46,26 @@ char *csh[] = {
        "repeat", "setenv", "source", "path", "home", 0 };
 int    ifile;
 
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int type __P((char *file));
+int oldo __P((char *cp));
+int troffint __P((char *bp, int n));
+int lookup __P((char *tab[]));
+int ccom __P((void));
+int ascom __P((void));
+int english __P((char *bp, int n));
+int shellscript __P((char buf[], struct stat *sb));
+int shell __P((char *bp, int n, char *tab[]));
+
+int main(argc, argv) int argc; char **argv; {
        FILE *fl;
        register char *p;
        char ap[MAXPATHLEN + 1];
@@ -76,9 +104,7 @@ char **argv;
        exit(0);
 }
 
-type(file)
-char *file;
-{
+int type(file) char *file; {
        int j,nl;
        char ch;
        struct stat mbuf;
@@ -332,9 +358,7 @@ outa:
        printf("\n");
 }
 
-oldo(cp)
-char *cp;
-{
+int oldo(cp) char *cp; {
        struct exec ex;
        struct stat stb;
 
@@ -346,12 +370,7 @@ char *cp;
        return (0);
 }
 
-
-
-troffint(bp, n)
-char *bp;
-int n;
-{
+int troffint(bp, n) char *bp; int n; {
        int k;
 
        i = 0;
@@ -367,9 +386,7 @@ int n;
        }
        return(1);
 }
-lookup(tab)
-char *tab[];
-{
+int lookup(tab) char *tab[]; {
        char r;
        int k,j,l;
        while(buf[i] == ' ' || buf[i] == '\t' || buf[i] == '\n')i++;
@@ -385,7 +402,7 @@ char *tab[];
        }
        return(0);
 }
-ccom(){
+int ccom() {
        char cc;
        while((cc = buf[i]) == ' ' || cc == '\t' || cc == '\n')if(i++ >= in)return(0);
        if(buf[i] == '/' && buf[i+1] == '*'){
@@ -400,7 +417,7 @@ ccom(){
        if(buf[i] == '\n')if(ccom() == 0)return(0);
        return(1);
 }
-ascom(){
+int ascom() {
        while(buf[i] == '/'){
                i++;
                while(buf[i++] != '\n')if(i >= in)return(0);
@@ -409,21 +426,17 @@ ascom(){
        return(1);
 }
 
-english (bp, n)
-char *bp;
-{
+int english(bp, n) char *bp; int n; {
 # define NASC 128
        int ct[NASC], j, vow, freq, rare;
        int badpun = 0, punct = 0;
        if (n<50) return(0); /* no point in statistics on squibs */
        for(j=0; j<NASC; j++)
                ct[j]=0;
-       for(j=0; j<n; j++)
-       {
+       for(j=0; j<n; j++) {
                if (bp[j]<NASC)
                        ct[bp[j]|040]++;
-               switch (bp[j])
-               {
+               switch (bp[j]) {
                case '.': 
                case ',': 
                case ')': 
@@ -448,10 +461,7 @@ char *bp;
        return (vow*5 >= n-ct[' '] && freq >= 10*rare);
 }
 
-shellscript(buf, sb)
-       char buf[];
-       struct stat *sb;
-{
+int shellscript(buf, sb) char buf[]; struct stat *sb; {
        register char *tp;
        char *cp, *xp, *index();
 
@@ -480,11 +490,7 @@ shellscript(buf, sb)
        return (1);
 }
 
-shell(bp, n, tab)
-       char *bp;
-       int n;
-       char *tab[];
-{
+int shell(bp, n, tab) char *bp; int n; char *tab[]; {
 
        i = 0;
        do {
index 157f5ad..58786d5 100644 (file)
@@ -1,19 +1,30 @@
-#ifndef lint
+/*#include <a.out.h> gen.h*/
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <sys/dk.h>
+#include <sys/file.h>
+/*#include <sys/signal.h> gen.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <time.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)iostat.c    4.13 (Berkeley) 85/04/25";
 #endif
 
 /*
  * iostat
  */
-#include <stdio.h>
-#include <ctype.h>
-#include <nlist.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <nlist.h>*/
+/*#include <signal.h>*/
 
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/dk.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/buf.h>*/
+/*#include <sys/dk.h>*/
 
 struct nlist nl[] = {
        { "_dk_busy" },
@@ -76,11 +87,23 @@ int hz;
 int    phz;
 double etime;
 int    tohdr = 1;
-int    printhdr();
+/*int  printhdr();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int printhdr __P((void));
+int stats __P((int dn));
+int stat1 __P((int o));
+int read_names __P((void));
 
-main(argc, argv)
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        extern char *ctime();
        register  i;
        int iter, ndrives;
@@ -221,8 +244,7 @@ contin:
        }
 }
 
-printhdr()
-{
+int printhdr() {
        register int i;
 
        printf("      tty");
@@ -238,8 +260,7 @@ printhdr()
        tohdr = 19;
 }
 
-stats(dn)
-{
+int stats(dn) int dn; {
        register i;
        double atime, words, xtime, itime;
 
@@ -262,8 +283,7 @@ stats(dn)
            s.dk_seek[dn] ? itime*1000./s.dk_seek[dn] : 0.0);
 }
 
-stat1(o)
-{
+int stat1(o) int o; {
        register i;
        double time;
 
@@ -282,8 +302,7 @@ stat1(o)
 #include <vaxuba/ubavar.h>
 #include <vaxmba/mbavar.h>
 
-read_names()
-{
+int read_names() {
        struct mba_device mdev;
        register struct mba_device *mp;
        struct mba_driver mdrv;
index 6968bab..e44b531 100644 (file)
@@ -1,8 +1,21 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#ifdef __STDC__
+#include <stdarg.h>
+#define _va_start(argp, arg) va_start(argp, arg)
+#else
+#include <varargs.h>
+#define _va_start(argp, arg) va_start(argp)
+#endif
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)join.c      4.2 (Berkeley) 6/30/83";
+#endif
 /*     join F1 F2 on stuff */
 
-#include       <stdio.h>
-#include       <varargs.h>
+/*#include     <stdio.h>*/
+/*#include     <varargs.h>*/
 #define F1 0
 #define F2 1
 #define        NFLD    20      /* max field per line */
@@ -24,9 +37,21 @@ int  unpub1;
 int    unpub2;
 int    aflg;
 
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int input __P((int n));
+int output __P((int on1, int on2));
+int error __P((char *fmt, ...));
+int cmp __P((char *s1, char *s2));
+
+int main(argc, argv) int argc; char *argv[]; {
        int i;
        int n1, n2;
        long top2, bot2;
@@ -141,8 +166,7 @@ error("usage: join [-an] [-estring] [-j1 x -j2 y] [-o list] [-tc] file1 file2");
        return(0);
 }
 
-input(n)               /* get input line and split into fields */
-{
+int input(n)           /* get input line and split into fields */ int n; /* get input line and split into fields */ {
        register int i, c;
        char *bp;
        char **pp;
@@ -169,9 +193,7 @@ input(n)            /* get input line and split into fields */
        return(i);
 }
 
-output(on1, on2)       /* print items from olist */
-int on1, on2;
-{
+int output(on1, on2)   /* print items from olist */ int on1; int on2; {
        int i;
        char *temp;
 
@@ -200,22 +222,22 @@ int on1, on2;
        }
 }
 
-error(fmt, va_alist)
-char *fmt;
-va_dcl
+#ifdef __STDC__
+int error(char *fmt, ...)
+#else
+int error(fmt, va_alist) char *fmt; va_dcl
+#endif
 {
        va_list argp;
 
        fprintf(stderr, "join: ");
-       va_start(argp);
+       _va_start(argp, fmt);
        vfprintf(stderr, fmt, argp);
        va_end(argp);
        fprintf(stderr, "\n");
        exit(1);
 }
 
-cmp(s1, s2)
-char *s1, *s2;
-{
+int cmp(s1, s2) char *s1; char *s2; {
        return(strcmp(s1, s2));
 }
index c05fe9c..ce64efd 100644 (file)
@@ -1,6 +1,11 @@
-static char *sccsid = "@(#)look.c      4.2 (Berkeley) 7/2/81";
-#include <stdio.h>
 #include <ctype.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)look.c      4.2 (Berkeley) 7/2/81";
+#endif
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 
 FILE *dfile;
 char *filenam  = "/usr/dict/words";
@@ -12,9 +17,20 @@ char entry[250];
 char word[250];
 char key[50];
 
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int compare __P((register char *s, register char *t));
+int getword __P((char *w));
+int canon __P((char *old, char *new));
+
+int main(argc, argv) int argc; char **argv; {
        register c;
        long top,bot,mid;
        while(argc>=2 && *argv[1]=='-') {
@@ -113,9 +129,7 @@ char **argv;
        exit(0);
 }
 
-compare(s,t)
-register char *s,*t;
-{
+int compare(s, t) register char *s; register char *t; {
        for(;*s==*t;s++,t++)
                if(*s==0)
                        return(0);
@@ -125,9 +139,7 @@ register char *s,*t;
                2);
 }
 
-getword(w)
-char *w;
-{
+int getword(w) char *w; {
        register c;
        for(;;) {
                c = getc(dfile);
@@ -141,9 +153,7 @@ char *w;
        return(1);
 }
 
-canon(old,new)
-char *old,*new;
-{
+int canon(old, new) char *old; char *new; {
        register c;
        for(;;) {
                *new = c = *old++;
index 49858f0..d89ec7a 100644 (file)
@@ -1,4 +1,10 @@
+#include <stdio.h>
+#include <sys/stat.h>
+#include <utmp.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)mesg.c      4.3 (Berkeley) 3/13/86";
+#endif
 /*
  * mesg -- set current tty to accept or
  *     forbid write permission.
@@ -8,18 +14,28 @@ static char *sccsid = "@(#)mesg.c    4.3 (Berkeley) 3/13/86";
  *             n forbid messages
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 
 struct stat sbuf;
 
 char *tty;
-char *ttyname();
+/*char *ttyname();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int error __P((char *s));
+int newmode __P((int m));
 
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        int r=0;
        tty = ttyname(2);
        if (tty == 0)
@@ -44,15 +60,12 @@ char *argv[];
        exit(r);
 }
 
-error(s)
-char *s;
-{
+int error(s) char *s; {
        fprintf(stderr,"mesg: %s\n",s);
        exit(-1);
 }
 
-newmode(m)
-{
+int newmode(m) int m; {
        if(chmod(tty,m)<0)
                error("cannot change mode");
 }
index 65369e2..f0f022a 100644 (file)
@@ -1,4 +1,17 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)ptx.c       4.2 (Berkeley) 9/23/85";
+#endif
 #
 
 /*     permuted title index
@@ -17,8 +30,8 @@ static char *sccsid = "@(#)ptx.c      4.2 (Berkeley) 9/23/85";
 \e      make: cc ptx.c -lS
        */
 
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 #include <signal.h>
 #define DEFLTX "/usr/lib/eign"
 #define TILDE 0177
@@ -32,11 +45,10 @@ static char *sccsid = "@(#)ptx.c    4.2 (Berkeley) 9/23/85";
 
 #define isabreak(c) (btable[c])
 
-extern char *calloc(), *mktemp();
-extern char *getline();
+/*extern char *calloc(), *mktemp();*/
+/*extern char *getline();*/
 int status;
 
-
 char *hasht[MAXT];
 char line[LMAX];
 char btable[128];
@@ -67,10 +79,30 @@ FILE *sortptr;
 char *bfile;   /*contains user supplied break chars */
 FILE *bptr;
 
-main(argc,argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int msg __P((char *s, char *arg));
+int diag __P((char *s, char *arg));
+char *getline __P((void));
+int cmpline __P((char *pend));
+int cmpword __P((char *cpp, char *pend, char *hpp));
+int putline __P((char *strt, char *end));
+int getsort __P((void));
+char *rtrim __P((char *a, char *c, int d));
+char *ltrim __P((char *c, char *b, int d));
+int putout __P((char *strt, char *end));
+int onintr __P((void));
+int hash __P((char *strtp, char *endp));
+int storeh __P((int num, char *strtp));
+
+int main(argc, argv) int argc; char **argv; {
        register int c;
        register char *bufp;
        int pid;
@@ -172,7 +204,6 @@ char **argv;
                outfile = 0;
        }
 
-
        /* Default breaks of blank, tab and newline */
        btable[' '] = SET;
        btable['\t'] = SET;
@@ -190,7 +221,6 @@ char **argv;
        and put resulting words in buffer.
        */
 
-
        if((strtbufp = calloc(N,BUFSIZ)) == NULL)
                diag("Out of memory space",empty);
        bufp = strtbufp;
@@ -243,37 +273,28 @@ char **argv;
                while(wait(&status) != pid);
        }
 
-
        getsort();
        if(*sortfile)
                unlink(sortfile);
        exit(0);
 }
 
-msg(s,arg)
-char *s;
-char *arg;
-{
+int msg(s, arg) char *s; char *arg; {
        fprintf(stderr,"%s %s\n",s,arg);
        return;
 }
-diag(s,arg)
-char *s, *arg;
-{
+int diag(s, arg) char *s; char *arg; {
 
        msg(s,arg);
        exit(1);
 }
 
-
-char *getline()
-{
+char *getline() {
 
        register c;
        register char *linep;
        char *endlinep;
 
-
        endlinep= line + mlen;
        linep = line;
        /* Throw away leading white space */
@@ -302,9 +323,7 @@ char *getline()
        return(0);
 }
 
-cmpline(pend)
-char *pend;
-{
+int cmpline(pend) char *pend; {
 
        char *pstrt, *pchar, *cp;
        char **hp;
@@ -349,9 +368,7 @@ char *pend;
        }
 }
 
-cmpword(cpp,pend,hpp)
-char *cpp, *pend, *hpp;
-{
+int cmpword(cpp, pend, hpp) char *cpp; char *pend; char *hpp; {
        char c;
 
        while(*hpp != '\0'){
@@ -363,9 +380,7 @@ char *cpp, *pend, *hpp;
        return(0);
 }
 
-putline(strt, end)
-char *strt, *end;
-{
+int putline(strt, end) char *strt; char *end; {
        char *cp;
 
        for(cp=strt; cp<end; cp++)
@@ -379,8 +394,7 @@ char *strt, *end;
        putc('\n',sortptr);
 }
 
-getsort()
-{
+int getsort() {
        register c;
        register char *tilde, *linep, *ref;
        char *p1a,*p1b,*p2a,*p2b,*p3a,*p3b,*p4a,*p4b;
@@ -459,9 +473,7 @@ getsort()
        }
 }
 
-char *rtrim(a,c,d)
-char *a,*c;
-{
+char *rtrim(a, c, d) char *a; char *c; int d; {
        char *b,*x;
        b = c;
        for(x=a+1; x<=c&&x-a<=d; x++)
@@ -472,9 +484,7 @@ char *a,*c;
        return(b);
 }
 
-char *ltrim(c,b,d)
-char *c,*b;
-{
+char *ltrim(c, b, d) char *c; char *b; int d; {
        char *a,*x;
        a = c;
        for(x=b-1; x>=c&&b-x<=d; x--)
@@ -485,9 +495,7 @@ char *c,*b;
        return(a);
 }
 
-putout(strt,end)
-char *strt, *end;
-{
+int putout(strt, end) char *strt; char *end; {
        char *cp;
 
        cp = strt;
@@ -497,17 +505,14 @@ char *strt, *end;
        }
 }
 
-onintr()
-{
+int onintr() {
 
        if(*sortfile)
                unlink(sortfile);
        exit(1);
 }
 
-hash(strtp,endp)
-char *strtp, *endp;
-{
+int hash(strtp, endp) char *strtp; char *endp; {
        char *cp, c;
        int i, j, k;
 
@@ -532,10 +537,7 @@ char *strtp, *endp;
        return(k);
 }
 
-storeh(num,strtp)
-int num;
-char *strtp;
-{
+int storeh(num, strtp) int num; char *strtp; {
        int i;
 
        for(i=num; i<MAXT; i++) {
index ec3efb7..223ef83 100644 (file)
@@ -1,27 +1,39 @@
+/*#include <a.out.h> gen.h*/
+#include <ar.h>
+#include <gen.h>
+#include <ranlib.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <struct.h>
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/file.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+
 /*
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  */
 
-#ifndef lint
+#if defined(DOCOPYRIGHT) && !defined(lint)
 char copyright[] =
 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
  All rights reserved.\n";
-#endif not lint
+#endif
 
-#ifndef lint
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)ranlib.c   5.3 (Berkeley) 1/22/86";
-#endif not lint
+#endif
 
 /*
  * ranlib - create table of contents for archive; string table version
  */
-#include <sys/types.h>
-#include <ar.h>
-#include <ranlib.h>
-#include <a.out.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <ar.h>*/
+/*#include <ranlib.h>*/
+/*#include <a.out.h>*/
+/*#include <stdio.h>*/
 
 struct ar_hdr  archdr;
 #define        OARMAG 0177545
@@ -29,7 +41,7 @@ long  arsize;
 struct exec    exp;
 FILE   *fi, *fo;
 long   off, oldoff;
-long   atol(), ftell();
+/*long atol(), ftell();*/
 #define TABSZ  3000
 int    tnum;
 #define        STRTABSZ        30000
@@ -39,14 +51,14 @@ int ssiz;
 int    new;
 char   tempnm[] = "__.SYMDEF";
 char   firstname[17];
-void   stash();
-char *malloc(), *calloc();
+/*void stash();*/
+/*char *malloc(), *calloc();*/
 
 /*
  * table segment definitions
  */
-char   *segalloc();
-void   segclean();
+/*char *segalloc();*/
+/*void segclean();*/
 struct tabsegment {
        struct tabsegment       *pnext;
        unsigned                nelem;
@@ -58,9 +70,23 @@ struct       strsegment {
        char                    stab[STRTABSZ];
 } strbase, *pstrseg;
 
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int nextel __P((FILE *af));
+void stash __P((struct nlist *s));
+char *segalloc __P((unsigned size));
+void segclean __P((void));
+int fixsize __P((void));
+int fixdate __P((char *s));
+
+int main(argc, argv) int argc; char **argv; {
        char cmdbuf[BUFSIZ];
        /* magbuf must be an int array so it is aligned on an int-ish
           boundary, so that we may access its first word as an int! */
@@ -211,9 +237,7 @@ char **argv;
        exit(0);
 }
 
-nextel(af)
-FILE *af;
-{
+int nextel(af) FILE *af; {
        register r;
        register char *cp;
 
@@ -232,10 +256,7 @@ FILE *af;
        return(1);
 }
 
-void
-stash(s)
-       struct nlist *s;
-{
+void stash(s) struct nlist *s; {
        register char *cp;
        register char *strtab;
        register strsiz;
@@ -283,10 +304,7 @@ redo:
 }
 
 /* allocate a zero filled segment of size bytes */
-char *
-segalloc(size)
-unsigned size;
-{
+char *segalloc(size) unsigned size; {
        char *pseg = NULL;
 
        pseg = malloc(size);
@@ -298,9 +316,7 @@ unsigned size;
 }
 
 /* free segments */
-void
-segclean()
-{
+void segclean() {
        register struct tabsegment *ptab;
        register struct strsegment *pstr;
 
@@ -335,8 +351,7 @@ segclean()
        pstrseg->nelem = 0;
 }
 
-fixsize()
-{
+int fixsize() {
        int i;
        off_t offdelta;
        register struct tabsegment *ptab;
@@ -363,9 +378,7 @@ fixsize()
 }
 
 /* patch time */
-fixdate(s)
-       char *s;
-{
+int fixdate(s) char *s; {
        long time();
        char buf[24];
        int fd;
index 1ca9571..969afde 100644 (file)
@@ -1,15 +1,17 @@
-static char *sccsid = "@(#)rev.c       4.1 (Berkeley) 10/1/80";
 #include <stdio.h>
 
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)rev.c       4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
+
 /* reverse lines of a file */
 
 #define N 256
 char line[N];
 FILE *input;
 
-main(argc,argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register i,c;
        input = stdin;
        do {
index de04651..e2e7242 100644 (file)
@@ -1,7 +1,10 @@
+#include <stdio.h>
+#include <sys/time.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)sleep.c     4.1 (Berkeley) 10/1/80";
-main(argc, argv)
-char **argv;
-{
+#endif
+int main(argc, argv) int argc; char **argv; {
        int c, n;
        char *s;
 
index 6f918ee..15559e9 100644 (file)
@@ -1,10 +1,21 @@
-static char *sccsid = "@(#)sort.c      4.11 (Berkeley) 6/3/86";
-#include <stdio.h>
 #include <ctype.h>
-#include <signal.h>
-#include <sys/types.h>
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
 #include <sys/stat.h>
 
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)sort.c      4.11 (Berkeley) 6/3/86";
+#endif
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <signal.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+
 #define        L       1024
 #define        N       7
 #define        C       20
@@ -28,10 +39,10 @@ unsigned    nlines;
 unsigned       ntext;
 int    *lspace;
 char   *tspace;
-int    cmp(), cmpa();
+/*int  cmp(), cmpa();*/
 int    (*compare)() = cmpa;
-char   *eol();
-int    term();
+/*char *eol();*/
+/*int  term();*/
 int    mflg;
 int    cflg;
 int    uflg;
@@ -170,15 +181,41 @@ struct field proto = {
 };
 int    nfields;
 int    error = 1;
-char   *setfil();
-char   *sbrk();
-char   *brk();
+/*char *setfil();*/
+/*char *sbrk();*/
+/*char *brk();*/
 
 #define        blank(c)        ((c) == ' ' || (c) == '\t')
 
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int sort __P((void));
+int merge __P((int a, int b));
+int disorder __P((char *s, char *t));
+int newfile __P((void));
+char *setfil __P((int i));
+int oldfile __P((void));
+int safeoutfil __P((void));
+int cant __P((char *f));
+int diag __P((char *s, char *t));
+int term __P((void));
+int cmp __P((char *i, char *j));
+int cmpa __P((register char *pa, register char *pb));
+char *skip __P((char *pp, struct field *fp, int j));
+char *eol __P((register char *p));
+int copyproto __P((void));
+int field __P((char *s, int k));
+int number __P((char **ppa));
+int _qsort __P((char **a, char **l));
+
+int main(argc, argv) int argc; char **argv; {
        register a;
        /*extern char end[1];*/
        char *ep;
@@ -299,8 +336,7 @@ char **argv;
        term();
 }
 
-sort()
-{
+int sort() {
        register char *cp;
        register char **lp;
        register lines, text, len;
@@ -372,14 +408,12 @@ sort()
        } while(done == 0);
 }
 
-struct merg
-{
+struct merg {
        char    l[L];
        FILE    *b;
 } *ibuf[256];
 
-merge(a,b)
-{
+int merge(a, b) int a; int b; {
        struct  merg    *p;
        register char   *cp, *dp;
        register        i;
@@ -476,9 +510,7 @@ merge(a,b)
        fclose(os);
 }
 
-disorder(s,t)
-char *s, *t;
-{
+int disorder(s, t) char *s; char *t; {
        register char *u;
        for(u=t; *u!='\n';u++) ;
        *u = 0;
@@ -486,8 +518,7 @@ char *s, *t;
        term();
 }
 
-newfile()
-{
+int newfile() {
        register char *f;
 
        f = setfil(nfiles);
@@ -498,9 +529,7 @@ newfile()
        nfiles++;
 }
 
-char *
-setfil(i)
-{
+char *setfil(i) int i; {
 
        if(i < eargc)
                if(eargv[i][0] == '-' && eargv[i][1] == '\0')
@@ -513,8 +542,7 @@ setfil(i)
        return(file);
 }
 
-oldfile()
-{
+int oldfile() {
 
        if(outfil) {
                if((os=fopen(outfil, "w")) == NULL) {
@@ -525,8 +553,7 @@ oldfile()
                os = stdout;
 }
 
-safeoutfil()
-{
+int safeoutfil() {
        register int i;
        struct stat obuf,ibuf;
 
@@ -543,25 +570,20 @@ safeoutfil()
        }
 }
 
-cant(f)
-char *f;
-{
+int cant(f) char *f; {
 
        perror(f);
        term();
 }
 
-diag(s,t)
-char *s, *t;
-{
+int diag(s, t) char *s; char *t; {
        fputs("sort: ",stderr);
        fputs(s,stderr);
        fputs(t,stderr);
        fputs("\n",stderr);
 }
 
-term()
-{
+int term() {
        register i;
 
        signal(SIGINT, SIG_IGN);
@@ -575,9 +597,7 @@ term()
        _exit(error);
 }
 
-cmp(i, j)
-char *i, *j;
-{
+int cmp(i, j) char *i; char *j; {
        register char *pa, *pb;
        char *skip();
        char *code, *ignore;
@@ -677,9 +697,7 @@ loop:
        return(cmpa(i, j));
 }
 
-cmpa(pa, pb)
-register char *pa, *pb;
-{
+int cmpa(pa, pb) register char *pa; register char *pb; {
        while(*pa == *pb) {
                if(*pa++ == '\n')
                        return(0);
@@ -693,11 +711,7 @@ register char *pa, *pb;
        );
 }
 
-char *
-skip(pp, fp, j)
-struct field *fp;
-char *pp;
-{
+char *skip(pp, fp, j) char *pp; struct field *fp; int j; {
        register i;
        register char *p;
 
@@ -734,16 +748,12 @@ ret:
        return(p);
 }
 
-char *
-eol(p)
-register char *p;
-{
+char *eol(p) register char *p; {
        while(*p != '\n') p++;
        return(p);
 }
 
-copyproto()
-{
+int copyproto() {
        register i;
        register int *p, *q;
 
@@ -753,9 +763,7 @@ copyproto()
                *q++ = *p++;
 }
 
-field(s,k)
-char *s;
-{
+int field(s, k) char *s; int k; {
        register struct field *p;
        register d;
        p = &fields[nfields];
@@ -815,9 +823,7 @@ char *s;
        }
 }
 
-number(ppa)
-char **ppa;
-{
+int number(ppa) char **ppa; {
        int n;
        register char *pa;
        pa = *ppa;
@@ -832,9 +838,7 @@ char **ppa;
 #define qsexc(p,q) t= *p;*p= *q;*q=t
 #define qstexc(p,q,r) t= *p;*p= *r;*r= *q;*q=t
 
-_qsort(a,l)
-char **a, **l;
-{
+int _qsort(a, l) char **a; char **l; {
        register char **i, **j;
        char **k;
        char **lp, **hp;
@@ -842,19 +846,15 @@ char **a, **l;
        char *t;
        unsigned n;
 
-
-
 start:
        if((n=l-a) <= 1)
                return;
 
-
        n /= 2;
        hp = lp = a+n;
        i = a;
        j = l-1;
 
-
        for(;;) {
                if(i < lp) {
                        if((c = (*compare)(*i, *lp)) == 0) {
@@ -891,7 +891,6 @@ loop:
                        goto loop;
                }
 
-
                if(i == lp) {
                        if(uflg)
                                for(k=lp+1; k<=hp;) **k++ = '\0';
@@ -905,10 +904,8 @@ loop:
                        goto start;
                }
 
-
                --lp;
                qstexc(j, lp, i);
                j = --hp;
        }
 }
-
index 93cfe6c..ebc7ba4 100644 (file)
@@ -1,9 +1,13 @@
-#ifndef lint
+#include <gen.h>
+/*#include <math.h> gen.h*/
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)spline.c    4.3 (Berkeley) 9/21/85";
 #endif
 
-#include <stdio.h>
-#include <math.h>
+/*#include <stdio.h>*/
+/*#include <math.h>*/
 
 #define NP 1000
 #define INF HUGE
@@ -84,7 +88,6 @@ k = 1/2 has been recommended as somehow pleasant.
 
 All that is necessary is to add h1 to a1 and hn+1 to an.
 
-
 Periodic case_____________
 
 To do this, add 1 more row and column thus
@@ -142,8 +145,23 @@ where
        x- = x-xi
 */
 
-float
-rhs(i){
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+float rhs __P((int i));
+int spline __P((void));
+int readin __P((void));
+int getfloat __P((float *p));
+int getlim __P((struct proj *p));
+int main __P((int argc, char *argv[]));
+int numb __P((float *np, int *argcp, char ***argvp));
+
+float rhs(i) int i; {
        int i_;
        double zz;
        i_ = i==n-1?0:i;
@@ -151,7 +169,7 @@ rhs(i){
        return(6*((y.val[i_+1]-y.val[i_])/(x.val[i+1]-x.val[i]) - zz));
 }
 
-spline(){
+int spline() {
        float d,s,u,v,hi,hi1;
        float h;
        float D2yi,D2yi1,D2yn1,x0,x1,yy,a;
@@ -218,14 +236,13 @@ spline(){
                }
        return(1);
        }
-readin() {
+int readin() {
        for(n=0;n<NP;n++){
                if(auta) x.val[n] = n*dx+x.lb;
                else if(!getfloat(&x.val[n])) break;
                if(!getfloat(&y.val[n])) break; } }
 
-getfloat(p)
-       float *p;{
+int getfloat(p) float *p; {
        char buf[30];
        register c;
        int i;
@@ -263,17 +280,14 @@ getfloat(p)
        *p = atof(buf);
        return(1); }
 
-getlim(p)
-       struct proj *p; {
+int getlim(p) struct proj *p; {
        int i;
        for(i=0;i<n;i++) {
                if(!p->lbf && p->lb>(p->val[i])) p->lb = p->val[i];
                if(!p->ubf && p->ub<(p->val[i])) p->ub = p->val[i]; }
        }
 
-
-main(argc,argv)
-       char *argv[];{
+int main(argc, argv) int argc; char *argv[]; {
        extern void *malloc();
        int i;
        x.lbf = x.ubf = y.lbf = y.ubf = 0;
@@ -322,10 +336,7 @@ again:             switch(argv[0][0]) {
                printf("%f ",x.val[i]);
                printf("%f\n",y.val[i]); }
 }
-numb(np,argcp,argvp)
-       int *argcp;
-       float *np;
-       char ***argvp;{
+int numb(np, argcp, argvp) float *np; int *argcp; char ***argvp; {
        double atof();
        char c;
        if(*argcp<=1) return(0);
@@ -335,4 +346,3 @@ numb(np,argcp,argvp)
        (*argcp)--;
        (*argvp)++; 
        return(1); }
-
index 195f421..9e9e2ad 100644 (file)
@@ -1,5 +1,11 @@
-static char *sccsid = "@(#)split.c     4.2 (Berkeley) 4/29/83";
+#include <gen.h>
 #include <stdio.h>
+/*#include <sys/errno.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)split.c     4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
 
 unsigned count = 1000;
 int    fnumber;
@@ -9,9 +15,7 @@ char   *ofil;
 FILE   *is;
 FILE   *os;
 
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        register i, c, f;
        int iflg = 0;
 
index e8f667a..02893e6 100644 (file)
@@ -1,13 +1,15 @@
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)sum.c       4.1 (Berkeley) 10/1/80";
+#endif
 /*
  * Sum bytes in file mod 2^16
  */
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
-main(argc,argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register unsigned sum;
        register i, c;
        register FILE *f;
index c547043..72d5474 100644 (file)
@@ -1,6 +1,15 @@
-static char *sccsid = "@(#)tabs.c      4.1 (Berkeley) 10/1/80";
+#include <gen.h>
 #include <stdio.h>
-#include <sgtty.h>
+/*#include <strings.h> gen.h*/
+#include <sys/ioctl.h>
+/*#include <sys/ttydev.h> sys/ioctl.h*/
+#include <vax/mtpr.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)tabs.c      4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
+/*#include <sgtty.h>*/
 
 #define SP     ' '
 #define TB     '\t'
@@ -44,9 +53,31 @@ struct sysnod tty[] = {
 };
 int    margset = 1;
 
-syslook(w)
-char *w;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int syslook __P((char *w));
+int main __P((int argc, char **argv));
+int clear __P((int n));
+int delay __P((int n));
+int tabs __P((int n));
+int margin __P((int n));
+int escape __P((int c));
+int bs __P((int n));
+int nl __P((void));
+int dasi450 __P((void));
+int tty37 __P((void));
+int dasi300 __P((void));
+int tn300 __P((void));
+int hp2645 __P((void));
+int misc __P((void));
+
+int syslook(w) char *w; {
        register struct sysnod *sp;
 
        for (sp = tty; sp->sysnam!=NULL; sp++)
@@ -55,9 +86,7 @@ char *w;
        return(0);
 }
 
-main(argc,argv)
-int argc; char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        struct sgttyb tb;
        int type;
        char *getenv();
@@ -100,20 +129,17 @@ int argc; char **argv;
        }
 }
 
-clear(n)
-{
+int clear(n) int n; {
        escape(CLR); 
        delay(n);
        putchar(CR); nl();
 }
 
-delay(n)
-{
+int delay(n) int n; {
        while (n--) putchar(DEL);
 }
 
-tabs(n)
-{
+int tabs(n) int n; {
        int i,j;
 
        if(margset) n--;
@@ -126,8 +152,7 @@ tabs(n)
        }
 }
 
-margin(n)
-{
+int margin(n) int n; {
        int i;
 
        if(margset) {
@@ -135,27 +160,21 @@ margin(n)
        }
 }
 
-escape(c)
-{
+int escape(c) int c; {
        putchar(ESC); putchar(c);
 }
 
-bs(n)
-{
+int bs(n) int n; {
        while (n--) putchar(BS);
 }
 
-nl()
-{
+int nl() {
        putchar(NL);
 }
 
-
-
 /* ======== terminal types ======== */
 
-dasi450()
-{
+int dasi450() {
        struct sgttyb t;
        gtty(0,&t);
        t.sg_flags &= ~ALLDELAY;
@@ -164,18 +183,15 @@ dasi450()
        escape(RHM); nl();
 }
 
-tty37()
-{
+int tty37() {
        putchar(SI); clear(40); bs(8); tabs(9); nl();
 }
 
-dasi300()
-{
+int dasi300() {
        clear(8); tabs(15); nl();
 }
 
-tn300()
-{
+int tn300() {
        struct sgttyb t;
        gtty(0,&t);
        t.sg_flags &= ~ALLDELAY;
@@ -184,15 +200,13 @@ tn300()
        clear(8); margin(8); escape(SET); tabs(14); nl();
 }
 
-hp2645()
-{
+int hp2645() {
        escape('3'); /*clr*/
        putchar(CR);
        tabs(10);
        nl();
 }
 
-misc()
-{
+int misc() {
        tabs(14); nl();
 }
index f300e93..cac94d7 100644 (file)
@@ -1,10 +1,19 @@
+#include <stdio.h>
+#include <sys/exec.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)tc.c        4.2 (Berkeley) 7/6/81";
+#endif
 /*
  * Simulate typesetter on 4014
 */
 
-#include <signal.h>
-#include <stdio.h>
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
 
 #define        oput(c) if (pgskip==0) putchar(c); else (c);
 #define MAXY 3071
@@ -55,10 +64,27 @@ int erase = 1;
 int    (*sigint)();
 int    (*sigquit)();
 
-main(argc,argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int lig __P((char *x));
+int init __P((void));
+int ex __P((void));
+int kwait __P((void));
+int callunix __P((char line[]));
+int readch __P((void));
+int sendpt __P((void));
+int _atoi __P((void));
+long tscale __P((int n));
+int getch __P((void));
+
+int main(argc, argv) int argc; char **argv; {
        register i, j;
        register char *k;
        extern ex();
@@ -224,9 +250,7 @@ char **argv;
        }
        ex();
 }
-lig(x)
-char *x;
-{
+int lig(x) char *x; {
        register i, j;
        register char *k;
 
@@ -245,7 +269,7 @@ char *x;
        xx -= j;
        sendpt();
 }
-init(){
+int init() {
 
        fflush(stdout);
        if(erase){
@@ -261,7 +285,7 @@ init(){
        skip = 0;
        sendpt();
 }
-ex(){
+int ex() {
        yy = MAXY;
        xx = 0;
        sendpt();
@@ -271,7 +295,7 @@ ex(){
        fflush(stdout);
        exit(0);
 }
-kwait(){
+int kwait() {
        char buf[128]; char *bptr; char c;
        if(pgskip) return;
 next:
@@ -298,9 +322,7 @@ next:
        else if (c==0) ex();
        else    return;
 }
-callunix(line)
-char line[];
-{
+int callunix(line) char line[]; {
        int rc, status, unixpid;
        if( (unixpid=fork())==0 ) {
                signal(SIGINT,sigint); signal(SIGQUIT,sigquit);
@@ -315,12 +337,12 @@ char line[];
                signal(SIGINT,ex); signal(SIGQUIT,sigquit);
        }
 }
-readch(){
+int readch() {
        char c;
        if (read(2,&c,1)<1) c=0;
        return(c);
 }
-sendpt(){
+int sendpt() {
        int hy,xb,ly,hx,lx;
 
        oput(GS);
@@ -343,8 +365,7 @@ sendpt(){
        alpha = 0;
        return;
 }
-_atoi()
-{
+int _atoi() {
        register i, j, acc;
        int field, digits;
        long dd;
@@ -374,9 +395,7 @@ a1:
        ch = 0;
        return(acc);
 }
-long tscale(n)
-int n;
-{
+long tscale(n) int n; {
        register i, j;
 
        switch(i = getch()){
@@ -401,7 +420,7 @@ int n;
        }
        return((long)n*j);
 }
-getch(){
+int getch() {
        register i;
 
        if(ch){
index 1150154..346ad3c 100644 (file)
@@ -1,10 +1,20 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/exec.h> gen.h*/
+#include <sys/ioctl.h>
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)tk.c        4.2 (Berkeley) 5/15/84";
+#endif
 /*
  * optimize output for Tek 4014
  */
 
-#include <stdio.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
 
 #define MAXY 3071
 #define LINE 47
@@ -34,10 +44,22 @@ int alpha;
 int    ry;
 FILE   *ttyin;
 
-main(argc, argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int init __P((void));
+int ex __P((void));
+int kwait __P((void));
+int execom __P((void));
+int sendpt __P((int a));
+
+int main(argc, argv) int argc; char **argv; {
        register i, j;
        extern ex();
 
@@ -149,8 +171,7 @@ char **argv;
        ex();
 }
 
-init()
-{
+int init() {
        ohx = oxb = olx = ohy = oly = -1;
        if (ncol >= maxcol) {
                ncol = 0;
@@ -167,8 +188,7 @@ init()
        sendpt(0);
 }
 
-ex()
-{
+int ex() {
        yy = MAXY;
        xx = 0;
        fputs("\033;\037", stdout);
@@ -176,8 +196,7 @@ ex()
        exit(0);
 }
 
-kwait()
-{
+int kwait() {
        register c;
 
        fflush(stdout);
@@ -195,8 +214,7 @@ kwait()
        }
 }
 
-execom()
-{
+int execom() {
        int (*si)(), (*sq)();
 
        if (fork() != 0) {
@@ -214,8 +232,7 @@ execom()
        execl("/bin/sh", "sh", "-t", 0);
 }
 
-sendpt(a)
-{
+int sendpt(a) int a; {
        register zz;
        int hy,xb,ly,hx,lx;
 
index 5c4cf7c..3f97b36 100644 (file)
@@ -1,4 +1,9 @@
-#ifndef lint
+#include <stdio.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)touch.c    4.3 (Berkeley) 8/11/83";
 #endif
 
@@ -9,19 +14,28 @@ static       char sccsid[] = "@(#)touch.c    4.3 (Berkeley) 8/11/83";
  *     if the file is read-only, -f forces chmod'ing and touch'ing.
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 
 int    dontcreate;     /* set if -c option */
 int    force;          /* set if -f option */
 
 char *whoami = "touch";
 
-main(argc,argv)
-       int     argc;
-       char    **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int touch __P((char *filename));
+int readwrite __P((char *filename, int size));
+
+int main(argc, argv) int argc; char **argv; {
        char    *argp;
 
        dontcreate = 0;
@@ -47,9 +61,7 @@ main(argc,argv)
        }
 }
 
-touch(filename)
-       char    *filename;
-{
+int touch(filename) char *filename; {
        struct stat     statbuffer;
 
        if (stat(filename,&statbuffer) == -1) {
@@ -89,10 +101,7 @@ touch(filename)
        }
 }
 
-readwrite(filename,size)
-       char    *filename;
-       int     size;
-{
+int readwrite(filename, size) char *filename; int size; {
        int     filedescriptor;
        char    first;
 
index c7f3da3..08eda0e 100644 (file)
@@ -1,6 +1,10 @@
-static char *sccsid = "@(#)tr.c        4.2 (Berkeley) 4/22/85";
 #include <stdio.h>
 
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)tr.c        4.2 (Berkeley) 4/22/85";
+#endif
+/*#include <stdio.h>*/
+
 /* tr - transliterate data stream */
 int    dflag   = 0;
 int    sflag   = 0;
@@ -11,9 +15,19 @@ char squeez[256];
 char   vect[256];
 struct string { int last, max; char *p; } string1, string2;
 
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int next __P((struct string *s));
+int nextc __P((struct string *s));
+
+int main(argc, argv) int argc; char **argv; {
        register i;
        int j;
        register c, d;
@@ -90,9 +104,7 @@ char **argv;
        exit(0);
 }
 
-next(s)
-struct string *s;
-{
+int next(s) struct string *s; {
 
 again:
        if(s->max) {
@@ -116,9 +128,7 @@ again:
        return(s->last = nextc(s));
 }
 
-nextc(s)
-struct string *s;
-{
+int nextc(s) struct string *s; {
        register c, i, n;
 
        c = *s->p++;
index d46f626..cc19c25 100644 (file)
@@ -1,4 +1,9 @@
+#include <gen.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)tsort.c     4.2 (Berkeley) 10/20/82";
+#endif
 /*     topological sort
  *     input is sequence of pairs of items (blank-free strings)
  *     nonidentical pair is a directed edge in graph
@@ -6,7 +11,7 @@ static char *sccsid = "@(#)tsort.c     4.2 (Berkeley) 10/20/82";
  *     output is ordered list of items consistent with
  *     the partial ordering specified by the graph
 */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 /*     the nodelist always has an empty element at the end to
  *     make it easy to grow in natural order
@@ -30,18 +35,34 @@ struct predlist {
        struct nodelist *pred;
 };
 
-struct nodelist *_index();
-struct nodelist *findloop();
-struct nodelist *mark();
-char *malloc();
+/*struct nodelist *_index();*/
+/*struct nodelist *findloop();*/
+/*struct nodelist *mark();*/
+/*char *malloc();*/
 char *empty = "";
 
 /*     the first for loop reads in the graph,
  *     the second prints out the ordering
 */
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int present __P((struct nodelist *i, struct nodelist *j));
+int anypred __P((struct nodelist *i));
+struct nodelist *_index __P((register char *s));
+int cmp __P((register char *s, register char *t));
+int error __P((char *s, char *t));
+int note __P((char *s, char *t));
+struct nodelist *findloop __P((void));
+struct nodelist *mark __P((register struct nodelist *i));
+
+int main(argc, argv) int argc; char **argv; {
        register struct predlist *t;
        FILE *input = stdin;
        register struct nodelist *i, *j;
@@ -87,9 +108,7 @@ char **argv;
 
 /*     is i present on j's predecessor list?
 */
-present(i,j)
-struct nodelist *i, *j;
-{
+int present(i, j) struct nodelist *i; struct nodelist *j; {
        register struct predlist *t;
        for(t=j->inedges; t!=NULL; t=t->nextpred)
                if(t->pred==i)
@@ -99,9 +118,7 @@ struct nodelist *i, *j;
 
 /*     is there any live predecessor for i?
 */
-anypred(i)
-struct nodelist *i;
-{
+int anypred(i) struct nodelist *i; {
        register struct predlist *t;
        for(t=i->inedges; t!=NULL; t=t->nextpred)
                if(t->pred->live==LIVE)
@@ -111,10 +128,7 @@ struct nodelist *i;
 
 /*     turn a string into a node pointer
 */
-struct nodelist *
-_index(s)
-register char *s;
-{
+struct nodelist *_index(s) register char *s; {
        register struct nodelist *i;
        register char *t;
        for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
@@ -134,9 +148,7 @@ register char *s;
        return(i);
 }
 
-cmp(s,t)
-register char *s, *t;
-{
+int cmp(s, t) register char *s; register char *t; {
        while(*s==*t) {
                if(*s==0)
                        return(1);
@@ -146,25 +158,19 @@ register char *s, *t;
        return(0);
 }
 
-error(s,t)
-char *s, *t;
-{
+int error(s, t) char *s; char *t; {
        note(s,t);
        exit(1);
 }
 
-note(s,t)
-char *s,*t;
-{
+int note(s, t) char *s; char *t; {
        fprintf(stderr,"tsort: %s%s\n",s,t);
 }
 
 /*     given that there is a cycle, find some
  *     node in it
 */
-struct nodelist *
-findloop()
-{
+struct nodelist *findloop() {
        register struct nodelist *i, *j;
        for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
                if(i->live==LIVE)
@@ -184,10 +190,7 @@ findloop()
  *     VISITED is a temporary state recording the
  *     visits of the search
 */
-struct nodelist *
-mark(i)
-register struct nodelist *i;
-{
+struct nodelist *mark(i) register struct nodelist *i; {
        register struct nodelist *j;
        register struct predlist *t;
        if(i->live==DEAD)
index 9f2b30d..2b4ca73 100644 (file)
@@ -1,13 +1,17 @@
+#include <stdio.h>
+#include <strings.h>
+#include <utmp.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)tty.c       4.1 (Berkeley) 10/1/80";
+#endif
 /*
  * Type tty name
  */
 
-char   *ttyname();
+/*char *ttyname();*/
 
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register char *p;
 
        p = ttyname(0);
index 948ee73..a6040c6 100644 (file)
@@ -1,20 +1,38 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)uniq.c      4.1 (Berkeley) 10/1/80";
+#endif
 /*
  * Deal with duplicated lines in a file
  */
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 int    fields;
 int    letters;
 int    linec;
 char   mode;
 int    uniq;
-char   *skip();
+/*char *skip();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int gline __P((register char buf[]));
+int pline __P((register char buf[]));
+int equal __P((register char b1[], register char b2[]));
+char *skip __P((register char *s));
+int printe __P((char *p, char *s));
 
-main(argc, argv)
-int argc;
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        static char b1[1000], b2[1000];
 
        while(argc > 1) {
@@ -63,9 +81,7 @@ char *argv[];
        }
 }
 
-gline(buf)
-register char buf[];
-{
+int gline(buf) register char buf[]; {
        register c;
 
        while((c = getchar()) != '\n') {
@@ -77,9 +93,7 @@ register char buf[];
        return(0);
 }
 
-pline(buf)
-register char buf[];
-{
+int pline(buf) register char buf[]; {
 
        switch(mode) {
 
@@ -102,9 +116,7 @@ register char buf[];
        putchar('\n');
 }
 
-equal(b1, b2)
-register char b1[], b2[];
-{
+int equal(b1, b2) register char b1[]; register char b2[]; {
        register char c;
 
        b1 = skip(b1);
@@ -117,10 +129,7 @@ register char b1[], b2[];
        return(1);
 }
 
-char *
-skip(s)
-register char *s;
-{
+char *skip(s) register char *s; {
        register nf, nl;
 
        nf = nl = 0;
@@ -135,9 +144,7 @@ register char *s;
        return(s);
 }
 
-printe(p,s)
-char *p,*s;
-{
+int printe(p, s) char *p; char *s; {
        fprintf(stderr, p, s);
        exit(1);
 }
index 9a9c0a7..259a80e 100644 (file)
@@ -1,32 +1,33 @@
-static char *sccsid = "@(#)units.c     4.1 (Berkeley) 10/1/80";
 #include <stdio.h>
+#include <sys/signal.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)units.c     4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
 
 #define        NDIM    10
 #define        NTAB    601
 char   *dfile  = "/usr/lib/units";
 char   *unames[NDIM];
-double getflt();
-int    fperr();
-struct table   *hash();
-struct unit
-{
+/*double       getflt();*/
+/*int  fperr();*/
+/*struct       table   *hash();*/
+struct unit {
        double  factor;
        char    dim[NDIM];
 };
 
-struct table
-{
+struct table {
        double  factor;
        char    dim[NDIM];
        char    *name;
 } table[NTAB];
 char   names[NTAB*10];
-struct prefix
-{
+struct prefix {
        double  factor;
        char    *pname;
-} prefix[] = 
-{
+} prefix[] =  {
        1e-18,  "atto",
        1e-15,  "femto",
        1e-12,  "pico",
@@ -50,9 +51,27 @@ int  fperrc;
 int    peekc;
 int    dumpflg;
 
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int units __P((struct unit *up));
+int pu __P((int u, int i, int f));
+int convr __P((struct unit *up));
+int lookup __P((char *name, struct unit *up, int den, int c));
+int equal __P((char *s1, char *s2));
+int init __P((void));
+double getflt __P((void));
+int get __P((void));
+struct table *hash __P((char *name));
+int fperr __P((void));
+
+int main(argc, argv) int argc; char *argv[]; {
        register i;
        register char *file;
        struct unit u1, u2;
@@ -107,9 +126,7 @@ fp:
        goto loop;
 }
 
-units(up)
-struct unit *up;
-{
+int units(up) struct unit *up; {
        register struct unit *p;
        register f, i;
 
@@ -127,8 +144,7 @@ struct unit *up;
        putchar('\n');
 }
 
-pu(u, i, f)
-{
+int pu(u, i, f) int u; int i; int f; {
 
        if(u > 0) {
                if(f&2)
@@ -145,9 +161,7 @@ pu(u, i, f)
        return(0);
 }
 
-convr(up)
-struct unit *up;
-{
+int convr(up) struct unit *up; {
        register struct unit *p;
        register c;
        register char *cp;
@@ -196,10 +210,7 @@ loop:
        goto loop;
 }
 
-lookup(name, up, den, c)
-char *name;
-struct unit *up;
-{
+int lookup(name, up, den, c) char *name; struct unit *up; int den; int c; {
        register struct unit *p;
        register struct table *q;
        register i;
@@ -250,9 +261,7 @@ loop:
        return(1);
 }
 
-equal(s1, s2)
-char *s1, *s2;
-{
+int equal(s1, s2) char *s1; char *s2; {
        register char *c1, *c2;
 
        c1 = s1;
@@ -263,8 +272,7 @@ char *s1, *s2;
        return(0);
 }
 
-init()
-{
+int init() {
        register char *cp;
        register struct table *tp, *lp;
        int c, i, f, t;
@@ -356,9 +364,7 @@ redef:
        goto l0;
 }
 
-double
-getflt()
-{
+double getflt() {
        register c, i, dp;
        double d, e;
        int f;
@@ -413,8 +419,7 @@ l1:
        return(d);
 }
 
-get()
-{
+int get() {
        register c;
 
        if(c=peekc) {
@@ -432,10 +437,7 @@ get()
        return(c);
 }
 
-struct table *
-hash(name)
-char *name;
-{
+struct table *hash(name) char *name; {
        register struct table *tp;
        register char *np;
        register unsigned h;
@@ -458,8 +460,7 @@ l0:
        goto l0;
 }
 
-fperr()
-{
+int fperr() {
 
        signal(8, fperr);
        fperrc++;