Ansified bin
authorNick Downing <downing.nick@gmail.com>
Tue, 24 Jan 2017 15:35:03 +0000 (02:35 +1100)
committerNick Downing <downing.nick@gmail.com>
Tue, 24 Jan 2017 15:35:03 +0000 (02:35 +1100)
49 files changed:
bin/ar.c
bin/cat.c
bin/cc.c
bin/chgrp.c
bin/chmod.c
bin/cmp.c
bin/cp.c
bin/date.c
bin/dd.c
bin/df.c
bin/du.c
bin/echo.c
bin/ed.c
bin/grep.c
bin/hostid.c
bin/hostname.c
bin/kill.c
bin/ld.c
bin/ln.c
bin/login.c
bin/ls.c
bin/mail.c
bin/mkdir.c
bin/mt.c
bin/mv.c
bin/nice.c
bin/nm.c
bin/od.c
bin/pagesize.c
bin/passwd.c
bin/pr.c
bin/ps.c
bin/pwd.c
bin/rcp.c
bin/rm.c
bin/rmail.c
bin/rmdir.c
bin/size.c
bin/strip.c
bin/stty.c
bin/su.c
bin/sync.c
bin/tar.c
bin/tee.c
bin/test.c
bin/time.c
bin/wall.c
bin/who.c
bin/write.c

index fc0be87..4d80173 100644 (file)
--- a/bin/ar.c
+++ b/bin/ar.c
@@ -1,28 +1,41 @@
+#include <ar.h>
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+/*#include <time.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(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)ar.c       5.2 (Berkeley) 4/23/85";
-#endif not lint
+#endif
 
-#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
 
 /*
  * ar - portable (ascii) format version
  */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/time.h>*/
 
-#include <stdio.h>
-#include <ar.h>
+/*#include <stdio.h>*/
+/*#include <ar.h>*/
 
 struct stat    stbuf;
 struct ar_hdr  arbuf;
@@ -44,15 +57,15 @@ char        *man    =       { "mrxtdpq" };
 char   *opt    =       { "uvnbailo" };
 
 int    signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
-int    sigdone();
-long   lseek();
-int    rcmd();
-int    dcmd();
-int    xcmd();
-int    tcmd();
-int    pcmd();
-int    mcmd();
-int    qcmd();
+/*int  sigdone();*/
+/*long lseek();*/
+/*int  rcmd();*/
+/*int  dcmd();*/
+/*int  xcmd();*/
+/*int  tcmd();*/
+/*int  pcmd();*/
+/*int  mcmd();*/
+/*int  qcmd();*/
 int    (*comfun)();
 char   flg[26];
 char   **namv;
@@ -76,13 +89,53 @@ int bastate;
 char   buf[MAXBSIZE];
 int    _truncate;                      /* ok to _truncate argument filenames */
 
-char   *trim();
-char   *mktemp();
-char   *ctime();
-
-main(argc, argv)
-char *argv[];
-{
+/*char *trim();*/
+/*char *mktemp();*/
+/*char *ctime();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+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 qcmd __P((void));
+int init __P((void));
+int getaf __P((void));
+int getqf __P((void));
+int usage __P((void));
+int noar __P((void));
+int sigdone __P((void));
+int done __P((int c));
+int notfound __P((void));
+int morefil __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));
+
+int main(argc, argv) int argc; char *argv[]; {
        register i;
        register char *cp;
 
@@ -167,9 +220,7 @@ char *argv[];
        done(notfound());
 }
 
-setcom(fun)
-int (*fun)();
-{
+int setcom(fun) int (*fun)(); {
 
        if(comfun != 0) {
                fprintf(stderr, "ar: only one of [%s] allowed\n", man);
@@ -178,8 +229,7 @@ int (*fun)();
        comfun = fun;
 }
 
-rcmd()
-{
+int rcmd() {
        register f;
 
        init();
@@ -210,8 +260,7 @@ rcmd()
        cleanup();
 }
 
-dcmd()
-{
+int dcmd() {
 
        init();
        if(getaf())
@@ -228,8 +277,7 @@ dcmd()
        install();
 }
 
-xcmd()
-{
+int xcmd() {
        register f;
        struct timeval tv[2];
 
@@ -260,8 +308,7 @@ xcmd()
        }
 }
 
-pcmd()
-{
+int pcmd() {
 
        if(getaf())
                noar();
@@ -278,8 +325,7 @@ pcmd()
        }
 }
 
-mcmd()
-{
+int mcmd() {
 
        init();
        if(getaf())
@@ -304,8 +350,7 @@ mcmd()
        install();
 }
 
-tcmd()
-{
+int tcmd() {
 
        if(getaf())
                noar();
@@ -319,8 +364,7 @@ tcmd()
        }
 }
 
-qcmd()
-{
+int qcmd() {
        register i, f;
 
        if (flg['a'-'a'] || flg['b'-'a']) {
@@ -349,8 +393,7 @@ qcmd()
        }
 }
 
-init()
-{
+int init() {
 
        tfnam = mktemp(tmpnam);
        close(creat(tfnam, 0600));
@@ -363,8 +406,7 @@ init()
                wrerr();
 }
 
-getaf()
-{
+int getaf() {
        char mbuf[SARMAG];
 
        af = open(arnam, 0);
@@ -377,8 +419,7 @@ getaf()
        return(0);
 }
 
-getqf()
-{
+int getqf() {
        char mbuf[SARMAG];
 
        if ((qf = open(arnam, 2)) < 0) {
@@ -397,26 +438,22 @@ getqf()
        }
 }
 
-usage()
-{
+int usage() {
        printf("usage: ar [%s][%s] archive files ...\n", man, opt);
        done(1);
 }
 
-noar()
-{
+int noar() {
 
        fprintf(stderr, "ar: %s does not exist\n", arnam);
        done(1);
 }
 
-sigdone()
-{
+int sigdone() {
        done(100);
 }
 
-done(c)
-{
+int done(c) int c; {
 
        if(tfnam)
                unlink(tfnam);
@@ -427,8 +464,7 @@ done(c)
        exit(c);
 }
 
-notfound()
-{
+int notfound() {
        register i, n;
 
        n = 0;
@@ -440,8 +476,7 @@ notfound()
        return(n);
 }
 
-morefil()
-{
+int morefil() {
        register i, n;
 
        n = 0;
@@ -451,8 +486,7 @@ morefil()
        return(n);
 }
 
-cleanup()
-{
+int cleanup() {
        register i, f;
 
        _truncate++;
@@ -472,8 +506,7 @@ cleanup()
        install();
 }
 
-install()
-{
+int install() {
        register i;
 
        for(i=0; signum[i]; i++)
@@ -511,8 +544,7 @@ install()
  * insert the file 'file'
  * into the temporary file
  */
-movefil(f)
-{
+int movefil(f) int f; {
        char buf[sizeof(arbuf)+1];
 
        sprintf(buf, "%-16s%-12ld%-6u%-6u%-8o%-10ld%-2s",
@@ -529,8 +561,7 @@ movefil(f)
        close(f);
 }
 
-stats()
-{
+int stats() {
        register f;
 
        f = open(file, 0);
@@ -547,8 +578,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;
 
@@ -588,8 +618,7 @@ copyfil(fi, fo, flag)
                phserr();
 }
 
-getdir()
-{
+int getdir() {
        register char *cp;
        register i;
 
@@ -621,8 +650,7 @@ getdir()
        return(0);
 }
 
-match()
-{
+int match() {
        register i;
 
        for(i=0; i<namc; i++) {
@@ -637,8 +665,7 @@ match()
        return(0);
 }
 
-bamatch()
-{
+int bamatch() {
        register f;
 
        switch(bastate) {
@@ -664,24 +691,19 @@ bamatch()
        }
 }
 
-phserr()
-{
+int phserr() {
 
        fprintf(stderr, "ar: 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;
 
        /* Strip trailing slashes */
@@ -730,8 +752,7 @@ char *s;
 #define        XOTH    01
 #define        STXT    01000
 
-longt()
-{
+int longt() {
        register char *cp;
 
        pmode();
@@ -753,17 +774,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;
@@ -773,8 +791,7 @@ int *pairp;
        putchar(*ap);
 }
 
-wrerr()
-{
+int wrerr() {
        perror("ar write error");
        done(1);
 }
index 5f668f1..e456c26 100644 (file)
--- a/bin/cat.c
+++ b/bin/cat.c
@@ -1,29 +1,45 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+#include <sys/stat.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(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)cat.c      5.2 (Berkeley) 12/6/85";
-#endif not lint
+#endif
 
 /*
  * Concatenate files.
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 
 /* #define OPTSIZE BUFSIZ      /* define this only if not 4.2 BSD or beyond */
 
 int    bflg, eflg, nflg, sflg, tflg, uflg, vflg;
 int    spaced, col, lno, inline, ibsize, obsize;
 
-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 copyopt __P((register FILE *f));
+int fastcat __P((register int fd));
+
+int main(argc, argv) int argc; char **argv; {
        int fflg = 0;
        register FILE *fi;
        register c;
@@ -125,9 +141,7 @@ char **argv;
        exit(retval);
 }
 
-copyopt(f)
-       register FILE *f;
-{
+int copyopt(f) register FILE *f; {
        register int c;
 
 top:
@@ -172,9 +186,7 @@ top:
        goto top;
 }
 
-fastcat(fd)
-register int fd;
-{
+int fastcat(fd) register int fd; {
        register int    buffsize, n, nwritten, offset;
        register char   *buff;
        struct stat     statbuff;
index 580eec2..b9f965d 100644 (file)
--- a/bin/cc.c
+++ b/bin/cc.c
@@ -1,12 +1,24 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.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[] = "@(#)cc.c 4.13 9/18/85";
+#endif
 /*
  * cc - front end for C compiler
  */
-#include <sys/param.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <signal.h>*/
+/*#include <sys/dir.h>*/
 
 char   *cpp = "/lib/cpp";
 char   *ccom = "/lib/ccom";
@@ -19,8 +31,8 @@ char  *crt0 = "/lib/crt0.o";
 char   tmp0[30];               /* big enough for /tmp/ctm%05.5d */
 char   *tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
 char   *outfile;
-char   *savestr(), *strspl(), *setsuf();
-int    idexit();
+/*char *savestr(), *strspl(), *setsuf();*/
+/*int  idexit();*/
 char   **av, **clist, **llist, **plist;
 int    cflag, eflag, oflag, pflag, sflag, wflag, Rflag, exflag, proflag;
 int    fflag, gflag, Gflag, Mflag, debug;
@@ -33,9 +45,26 @@ int  nc, nl, np, nxo, na;
 
 #define        cunlink(s)      if (s) unlink(s)
 
-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 idexit __P((void));
+int dexit __P((void));
+int error __P((char *s, char *x));
+int getsuf __P((char as[]));
+char *setsuf __P((char *as, int ch));
+int callsys __P((char *f, char **v));
+int nodup __P((char **l, char *os));
+char *savestr __P((register char *cp));
+char *strspl __P((char *left, char *right));
+
+int main(argc, argv) int argc; char **argv; {
        char *t;
        char *assource;
        int i, j, c;
@@ -297,15 +326,13 @@ nocom:
        dexit();
 }
 
-idexit()
-{
+int idexit() {
 
        eflag = 100;
        dexit();
 }
 
-dexit()
-{
+int dexit() {
 
        if (!pflag) {
                cunlink(tmp1);
@@ -318,9 +345,7 @@ dexit()
        exit(eflag);
 }
 
-error(s, x)
-       char *s, *x;
-{
+int error(s, x) char *s; char *x; {
        FILE *diag = exflag ? stderr : stdout;
 
        fprintf(diag, "cc: ");
@@ -331,9 +356,7 @@ error(s, x)
        eflag++;
 }
 
-getsuf(as)
-char as[];
-{
+int getsuf(as) char as[]; {
        register int c;
        register char *s;
        register int t;
@@ -351,10 +374,7 @@ char as[];
        return (0);
 }
 
-char *
-setsuf(as, ch)
-       char *as;
-{
+char *setsuf(as, ch) char *as; int ch; {
        register char *s, *s1;
 
        s = s1 = savestr(as);
@@ -365,9 +385,7 @@ setsuf(as, ch)
        return (s1);
 }
 
-callsys(f, v)
-       char *f, **v;
-{
+int callsys(f, v) char *f; char **v; {
        int t, status;
        char **cpp;
 
@@ -400,9 +418,7 @@ callsys(f, v)
        return ((status>>8) & 0377);
 }
 
-nodup(l, os)
-       char **l, *os;
-{
+int nodup(l, os) char **l; char *os; {
        register char *t, *s;
        register int c;
 
@@ -424,10 +440,7 @@ nodup(l, os)
 char   *savetab;
 int    saveleft;
 
-char *
-savestr(cp)
-       register char *cp;
-{
+char *savestr(cp) register char *cp; {
        register int len;
 
        len = strlen(cp) + 1;
@@ -448,10 +461,7 @@ savestr(cp)
        return (cp);
 }
 
-char *
-strspl(left, right)
-       char *left, *right;
-{
+char *strspl(left, right) char *left; char *right; {
        char buf[BUFSIZ];
 
        strcpy(buf, left);
index 4dce5df..aa1b50a 100644 (file)
@@ -1,41 +1,73 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+/*#include <grp.h> gen.h*/
+/*#include <pwd.h> gen.h*/
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/proc.h> gen.h*/
+#include <sys/stat.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
+
 /*
  * 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(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)chgrp.c    5.7 (Berkeley) 6/4/86";
-#endif not lint
+#endif
 
 /*
  * chgrp -fR gid file ...
  */
 
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <grp.h>
-#include <pwd.h>
-#include <sys/dir.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <grp.h>*/
+/*#include <pwd.h>*/
+/*#include <sys/dir.h>*/
+/*#include <varargs.h>*/
 
 struct group *gr;
-struct group *getgrnam(), *getgrgid();
-struct passwd *getpwuid();
+/*struct       group *getgrnam(), *getgrgid();*/
+/*struct       passwd *getpwuid();*/
 struct passwd *pwd;
 struct stat stbuf;
 int    gid, uid;
 int    status;
 int    fflag, rflag;
 /* VARARGS */
-int    fprintf();
-
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
+/*int  fprintf();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int isnumber __P((char *s));
+int chownr __P((char *dir, int uid, int gid));
+int verror __P((char *fmt, va_list argp));
+int error __P((char *fmt, ...));
+int fatal __P((int status, char *fmt, ...));
+int Perror __P((char *s));
+
+int main(argc, argv) int argc; char *argv[]; {
        register c, i;
        register char *cp;
 
@@ -107,9 +139,7 @@ ok:
        exit(status);
 }
 
-isnumber(s)
-       char *s;
-{
+int isnumber(s) char *s; {
        register int c;
 
        while (c = *s++)
@@ -118,9 +148,7 @@ isnumber(s)
        return (1);
 }
 
-chownr(dir, uid, gid)
-       char *dir;
-{
+int chownr(dir, uid, gid) char *dir; int uid; int gid; {
        register DIR *dirp;
        register struct direct *dp;
        struct stat st;
@@ -173,10 +201,7 @@ chownr(dir, uid, gid)
        return (ecode);
 }
 
-verror(fmt, argp)
-       char *fmt;
-       va_list argp;
-{
+int verror(fmt, argp) char *fmt; va_list argp; {
        if (!fflag) {
                fprintf(stderr, "chgrp: ");
                vfprintf(stderr, fmt, argp);
@@ -185,36 +210,37 @@ verror(fmt, argp)
        return (!fflag);
 }
 
-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;
        int res;
 
-       va_start(argp);
+       _va_start(argp, fmt);
        res = verror(fmt, argp);
        va_end(argp);
        return res;
 }
 
-fatal(status, fmt, va_alist)
-       int status;
-       char *fmt;
-       va_dcl
+#ifdef __STDC__
+int fatal(int status, char *fmt, ...)
+#else
+int fatal(status, fmt, va_alist) int status; char *fmt; va_dcl
+#endif
 {
        va_list argp;
 
        fflag = 0;
-       va_start(argp);
+       _va_start(argp, fmt);
        (void) verror(fmt, argp);
        va_end(argp);
        exit(status);
 }
 
-Perror(s)
-       char *s;
-{
+int Perror(s) char *s; {
 
        if (!fflag) {
                fprintf(stderr, "chgrp: ");
index 8c5280d..00814e5 100644 (file)
@@ -1,10 +1,23 @@
+#include <stdio.h>
+#include <sys/dir.h>
+#include <sys/errno.h>
+#include <sys/proc.h>
+#include <sys/stat.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
+
 /*
  * 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(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)chmod.c    5.5 (Berkeley) 5/22/86";
 #endif
 
@@ -14,11 +27,11 @@ static char sccsid[] = "@(#)chmod.c 5.5 (Berkeley) 5/22/86";
  *     mode is [ugoa][+-=][rwxXstugo] or an octal number
  *     options are -Rf
  */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
+/*#include <varargs.h>*/
 
 char   *modestring, *ms;
 int    um;
@@ -26,9 +39,27 @@ int  status;
 int    fflag;
 int    rflag;
 
-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 chmodr __P((char *dir, int mode));
+int verror __P((char *fmt, va_list argp));
+int error __P((char *fmt, ...));
+int fatal __P((int status, char *fmt, ...));
+int Perror __P((char *s));
+int newmode __P((unsigned nm));
+int _abs __P((void));
+int who __P((void));
+int what __P((void));
+int where __P((register om));
+
+int main(argc, argv) int argc; char *argv[]; {
        register char *p, *flags;
        register int i;
        struct stat st;
@@ -82,9 +113,7 @@ done:
        exit(status);
 }
 
-chmodr(dir, mode)
-       char *dir;
-{
+int chmodr(dir, mode) char *dir; int mode; {
        register DIR *dirp;
        register struct direct *dp;
        struct stat st;
@@ -134,10 +163,7 @@ chmodr(dir, mode)
        return (ecode);
 }
 
-verror(fmt, argp)
-       char *fmt;
-       va_list argp;
-{
+int verror(fmt, argp) char *fmt; va_list argp; {
        if (!fflag) {
                fprintf(stderr, "chmod: ");
                vfprintf(stderr, fmt, argp);
@@ -146,36 +172,37 @@ verror(fmt, argp)
        return (!fflag);
 }
 
-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;
        int res;
 
-       va_start(argp);
+       _va_start(argp, fmt);
        res = verror(fmt, argp);
        va_end(argp);
        return res;
 }
 
-fatal(status, fmt, va_alist)
-       int status;
-       char *fmt;
-       va_dcl
+#ifdef __STDC__
+int fatal(int status, char *fmt, ...)
+#else
+int fatal(status, fmt, va_alist) int status; char *fmt; va_dcl
+#endif
 {
        va_list argp;
 
        fflag = 0;
-       va_start(argp);
+       _va_start(argp, fmt);
        (void) verror(fmt, argp);
        va_end(argp);
        exit(status);
 }
 
-Perror(s)
-       char *s;
-{
+int Perror(s) char *s; {
 
        if (!fflag) {
                fprintf(stderr, "chmod: ");
@@ -184,9 +211,7 @@ Perror(s)
        return (!fflag);
 }
 
-newmode(nm)
-       unsigned nm;
-{
+int newmode(nm) unsigned nm; {
        register o, m, b;
        int savem;
 
@@ -218,8 +243,7 @@ newmode(nm)
        return (nm);
 }
 
-_abs()
-{
+int _abs() {
        register c, i;
 
        i = 0;
@@ -240,8 +264,7 @@ _abs()
 #define        SETID   06000   /* set[ug]id */
 #define        STICKY  01000   /* sticky bit */
 
-who()
-{
+int who() {
        register m;
 
        m = 0;
@@ -266,8 +289,7 @@ who()
        }
 }
 
-what()
-{
+int what() {
 
        switch (*ms) {
        case '+':
@@ -278,9 +300,7 @@ what()
        return (0);
 }
 
-where(om)
-       register om;
-{
+int where(om) register om; {
        register m;
 
        m = 0;
index 3798b8b..4b2bb23 100644 (file)
--- a/bin/cmp.c
+++ b/bin/cmp.c
@@ -1,6 +1,12 @@
-static char *sccsid = "@(#)cmp.c       4.2 (Berkeley) 4/29/83";
-#include <stdio.h>
 #include <ctype.h>
+#include <stdio.h>
+#include <sys/errno.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)cmp.c       4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 
 FILE   *file1,*file2;
 int    eflg;
@@ -10,11 +16,20 @@ long        chr     = 0;
 long   skip1;
 long   skip2;
 
-long   otoi();
+/*long otoi();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+long otoi __P((char *s));
 
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register c1, c2;
        char *arg;
 
@@ -106,9 +121,7 @@ earg:
        exit(1);
 }
 
-long otoi(s)
-char *s;
-{
+long otoi(s) char *s; {
        long v;
        int base;
 
index 4cfb295..3dfbc24 100644 (file)
--- a/bin/cp.c
+++ b/bin/cp.c
@@ -1,37 +1,58 @@
+#include <stdio.h>
+#include <strings.h>
+#include <sys/dir.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> sys/dir.h*/
+#include <sys/stat.h>
+#include <sys/time.h>
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)cp.c       4.13 (Berkeley) 10/11/85";
-#endif not lint
+#endif
 
 /*
  * cp
  */
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <sys/time.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
+/*#include <sys/time.h>*/
 
 int    iflag;
 int    rflag;
 int    pflag;
-char   *rindex();
-
-main(argc, argv)
-       int argc;
-       char **argv;
-{
+/*char *rindex();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int copy __P((char *from, char *to));
+int rcopy __P((char *from, char *to));
+int setimes __P((char *path, struct stat *statp));
+int Perror __P((char *s));
+
+int main(argc, argv) int argc; char **argv; {
        struct stat stb;
        int rc, i;
 
@@ -75,9 +96,7 @@ usage:
        exit(1);
 }
 
-copy(from, to)
-       char *from, *to;
-{
+int copy(from, to) char *from; char *to; {
        int fold, fnew, n, exists;
        char *last, destname[MAXPATHLEN + 1], buf[MAXBSIZE];
        struct stat stfrom, stto;
@@ -180,9 +199,7 @@ copy(from, to)
        return (0);
 }
 
-rcopy(from, to)
-       char *from, *to;
-{
+int rcopy(from, to) char *from; char *to; {
        DIR *fold = opendir(from);
        struct direct *dp;
        struct stat statb;
@@ -216,11 +233,7 @@ rcopy(from, to)
        }
 }
 
-int
-setimes(path, statp)
-       char *path;
-       struct stat *statp;
-{
+int setimes(path, statp) char *path; struct stat *statp; {
        struct timeval tv[2];
        
        tv[0].tv_sec = statp->st_atime;
@@ -233,9 +246,7 @@ setimes(path, statp)
        return (0);
 }
 
-Perror(s)
-       char *s;
-{
+int Perror(s) char *s; {
 
        fprintf(stderr, "cp: ");
        perror(s);
index 9f24231..5385eda 100644 (file)
@@ -1,30 +1,51 @@
+#include <gen.h>
+#include <net.h>
+/*#include <netdb.h> net.h*/
+#include <netinet/in.h>
+#include <netns/ns.h>
+#include <protocols/timed.h>
+/*#include <stdio.h> net.h*/
+/*#include <strings.h> gen.h*/
+#include <sys.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/select.h> sys.h*/
+/*#include <sys/socket.h> netns/ns.h*/
+/*#include <sys/syslog.h> gen.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+/*#include <time.h> gen.h*/
+/*#include <utmp.h> gen.h*/
+
 /*
  * Copyright (c) 1985 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) 1985 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[] = "@(#)date.c     4.19 (Berkeley) 5/18/86";
-#endif not lint
+#endif
 
 /*
  * Date - print and set date
  */
 
-#include <sys/param.h>
-#include <stdio.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#include <errno.h>
-#include <syslog.h>
-#include <utmp.h>
+/*#include <sys/param.h>*/
+/*#include <stdio.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/file.h>*/
+/*#include <errno.h>*/
+/*#include <syslog.h>*/
+/*#include <utmp.h>*/
 
 #define WTMP   "/usr/adm/wtmp"
 
@@ -34,7 +55,7 @@ char  *ap, *ep, *sp;
 int    uflag, nflag;
 int    retval;
 
-char   *timezone();
+/*char *timezone();*/
 static int dmsize[12] =
     { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
 static char *usage = "usage: date [-n] [-u] [yymmddhhmm[.ss]]\n";
@@ -44,20 +65,30 @@ struct utmp wtmp[2] = {
        { "{", "", "", 0 }
 };
 
-char   *ctime();
-char   *asctime();
-struct tm *localtime();
-struct tm *gmtime();
-char   *strcpy(), *strncpy();
+/*char *ctime();*/
+/*char *asctime();*/
+/*struct       tm *localtime();*/
+/*struct       tm *gmtime();*/
+/*char *strcpy(), *strncpy();*/
 char   *username;
-char   *getlogin();
-long   time();
-uid_t  getuid();
-
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
+/*char *getlogin();*/
+/*long time();*/
+/*uid_t        getuid();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int gtime __P((void));
+int gp __P((int dfault));
+int settime __P((struct timeval tv));
+
+int main(argc, argv) int argc; char *argv[]; {
        register char *tzn;
 
        openlog("date", LOG_ODELAY, LOG_AUTH);
@@ -147,8 +178,7 @@ display:
        exit(retval);
 }
 
-gtime()
-{
+int gtime() {
        register int i, year, month;
        int day, hour, mins, secs;
        struct tm *L;
@@ -206,8 +236,7 @@ gtime()
        return (0);
 }
 
-gp(dfault)
-{
+int gp(dfault) int dfault; {
        register int c, d;
 
        if (*sp == 0)
@@ -219,11 +248,11 @@ gp(dfault)
        return (c+10*d);
 }
 
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <netdb.h>*/
 #define TSPTYPES
-#include <protocols/timed.h>
+/*#include <protocols/timed.h>*/
 
 #define WAITACK                2       /* seconds */
 #define WAITDATEACK    5       /* seconds */
@@ -237,9 +266,7 @@ extern      int errno;
  * notifies the master that a correction is needed.
  * Returns 1 on success, 0 on failure.
  */
-settime(tv)
-       struct timeval tv;
-{
+int settime(tv) struct timeval tv; {
        int s, length, port, timed_ack, found, err;
        long waittime;
        fd_set ready;
index 4ab4f1f..6939748 100644 (file)
--- a/bin/dd.c
+++ b/bin/dd.c
@@ -1,9 +1,15 @@
-#ifndef lint
+#include <stdio.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)dd.c        4.4 (Berkeley) 1/22/85";
 #endif
 
-#include <stdio.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
 
 #define        BIG     2147483647
 #define        LCASE   01
@@ -22,7 +28,7 @@ char  *ifile;
 char   *ofile;
 char   *ibuf;
 char   *obuf;
-char   *sbrk();
+/*char *sbrk();*/
 int    ibs     = 512;
 int    obs     = 512;
 int    bs;
@@ -107,8 +113,7 @@ char        atoe[] = {
        0334,0335,0336,0337,0352,0353,0354,0355,
        0356,0357,0372,0373,0374,0375,0376,0377,
 };
-char   atoibm[] =
-{
+char   atoibm[] = {
        0000,0001,0002,0003,0067,0055,0056,0057,
        0026,0005,0045,0013,0014,0015,0016,0017,
        0020,0021,0022,0023,0074,0075,0062,0046,
@@ -143,11 +148,29 @@ char      atoibm[] =
        0356,0357,0372,0373,0374,0375,0376,0377,
 };
 
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
 
-main(argc, argv)
-int    argc;
-char   **argv;
-{
+int main __P((int argc, char **argv));
+int flsh __P((void));
+int match __P((char *s));
+int number __P((int big));
+int cnull __P((int cc));
+int null __P((int c));
+int ascii __P((int cc));
+int unblock __P((int cc));
+int ebcdic __P((int cc));
+int ibm __P((int cc));
+int block __P((int cc));
+int term __P((void));
+int stats __P((void));
+
+int main(argc, argv) int argc; char **argv; {
        int (*conv)();
        register char *ip;
        register c;
@@ -354,8 +377,7 @@ loop:
        goto loop;
 }
 
-flsh()
-{
+int flsh() {
        register c;
 
        if(obc) {
@@ -371,9 +393,7 @@ flsh()
        }
 }
 
-match(s)
-char *s;
-{
+int match(s) char *s; {
        register char *cs;
 
        cs = string;
@@ -389,8 +409,7 @@ true:
        return(1);
 }
 
-number(big)
-{
+int number(big) int big; {
        register char *cs;
        long n;
 
@@ -428,8 +447,7 @@ number(big)
        /* never gets here */
 }
 
-cnull(cc)
-{
+int cnull(cc) int cc; {
        register c;
 
        c = cc;
@@ -440,8 +458,7 @@ cnull(cc)
        null(c);
 }
 
-null(c)
-{
+int null(c) int c; {
 
        *op = c;
        op++;
@@ -451,8 +468,7 @@ null(c)
        }
 }
 
-ascii(cc)
-{
+int ascii(cc) int cc; {
        register c;
 
        c = etoa[cc] & 0377;
@@ -478,8 +494,7 @@ out:
        }
 }
 
-unblock(cc)
-{
+int unblock(cc) int cc; {
        register c;
 
        c = cc & 0377;
@@ -505,8 +520,7 @@ out:
        }
 }
 
-ebcdic(cc)
-{
+int ebcdic(cc) int cc; {
        register c;
 
        c = cc;
@@ -534,8 +548,7 @@ ebcdic(cc)
                null(c);
 }
 
-ibm(cc)
-{
+int ibm(cc) int cc; {
        register c;
 
        c = cc;
@@ -563,8 +576,7 @@ ibm(cc)
                null(c);
 }
 
-block(cc)
-{
+int block(cc) int cc; {
        register c;
 
        c = cc;
@@ -592,15 +604,13 @@ block(cc)
                null(c);
 }
 
-term()
-{
+int term() {
 
        stats();
        exit(0);
 }
 
-stats()
-{
+int stats() {
 
        fprintf(stderr,"%u+%u records in\n", nifr, nipr);
        fprintf(stderr,"%u+%u records out\n", nofr, nopr);
index bf960cd..80c5933 100644 (file)
--- a/bin/df.c
+++ b/bin/df.c
@@ -1,34 +1,45 @@
+#include <fstab.h>
+#include <mtab.h>
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/fs.h>
+/*#include <sys/param.h> sys/file.h*/
+#include <sys/stat.h>
+/*#include <sys/types.h> stdio.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[] = "@(#)df.c       5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
-#include <sys/param.h>
-#include <sys/fs.h>
-#include <sys/stat.h>
-#include <errno.h>
+/*#include <sys/param.h>*/
+/*#include <sys/fs.h>*/
+/*#include <sys/stat.h>*/
+/*#include <errno.h>*/
 
-#include <stdio.h>
-#include <fstab.h>
-#include <mtab.h>
+/*#include <stdio.h>*/
+/*#include <fstab.h>*/
+/*#include <mtab.h>*/
 
 /*
  * df
  */
 struct mtab mtab[NMOUNT];
 char   root[32];
-char   *mpath();
+/*char *mpath();*/
 
 int    iflag;
 
@@ -39,13 +50,24 @@ union {
 #define sblock sb.iu_fs
 
 int    fi;
-daddr_t        alloc();
-char   *strcpy();
-
-main(argc, argv)
-       int argc;
-       char **argv;
-{
+/*daddr_t      alloc();*/
+/*char *strcpy();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int dfree __P((char *file, int infsent));
+int bread __P((daddr_t bno, char *buf, int cnt));
+char *mpath __P((char *file));
+int eq __P((char *f1, char *f2));
+
+int main(argc, argv) int argc; char **argv; {
        int i;
 
        while (argc > 1 && argv[1][0]=='-') {
@@ -92,10 +114,7 @@ main(argc, argv)
                dfree(argv[i], 0);
 }
 
-dfree(file, infsent)
-       char *file;
-       int infsent;
-{
+int dfree(file, infsent) char *file; int infsent; {
        long totalblks, availblks, avail, free, used;
        struct stat stbuf;
        struct fstab *fsp;
@@ -154,12 +173,9 @@ found:
        (void) close(fi);
 }
 
-long lseek();
+/*long lseek();*/
 
-bread(bno, buf, cnt)
-       daddr_t bno;
-       char *buf;
-{
+int bread(bno, buf, cnt) daddr_t bno; char *buf; int cnt; {
        int n;
        extern errno;
 
@@ -178,10 +194,7 @@ bread(bno, buf, cnt)
 /*
  * Given a name like /dev/rrp0h, returns the mounted path, like /usr.
  */
-char *
-mpath(file)
-       char *file;
-{
+char *mpath(file) char *file; {
        register struct mtab *mp;
 
        if (eq(file, root))
@@ -192,9 +205,7 @@ mpath(file)
        return "";
 }
 
-eq(f1, f2)
-       char *f1, *f2;
-{
+int eq(f1, f2) char *f1; char *f2; {
 
        if (strncmp(f1, "/dev/", 5) == 0)
                f1 += 5;
index 126b157..c2819b2 100644 (file)
--- a/bin/du.c
+++ b/bin/du.c
@@ -1,11 +1,21 @@
-#ifndef lint
+#include <stdio.h>
+#include <strings.h>
+#include <sys/dir.h>
+#include <sys/errno.h>
+/*#include <sys/param.h> sys/dir.h*/
+#include <sys/proc.h>
+#include <sys/stat.h>
+/*#include <sys/types.h> stdio.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)du.c        4.11 (Berkeley) 7/1/83";
 #endif
 
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
 
 char   path[BUFSIZ], name[BUFSIZ];
 int    aflg;
@@ -19,15 +29,23 @@ struct {
 } ml[ML];
 int    mlx;
 
-long   descend();
-char   *index(), *rindex(), *strcpy();
+/*long descend();*/
+/*char *index(), *rindex(), *strcpy();*/
 
 #define        kb(n)   (howmany(dbtob(n), 1024))
 
-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));
+long descend __P((char *base, char *name));
+
+int main(argc, argv) int argc; char **argv; {
        long blocks = 0;
        register char *np;
        int pid;
@@ -82,10 +100,7 @@ again:
 
 DIR    *dirp = NULL;
 
-long
-descend(base, name)
-       char *base, *name;
-{
+long descend(base, name) char *base; char *name; {
        char *ebase0, *ebase;
        struct stat stb;
        int i;
index d1f85b1..360a9f4 100644 (file)
@@ -1,10 +1,11 @@
-static char *sccsid = "@(#)echo.c      4.2 (Berkeley) 5/27/85";
 #include <stdio.h>
 
-main(argc, argv)
-int argc;
-char *argv[];
-{
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)echo.c      4.2 (Berkeley) 5/27/85";
+#endif
+/*#include <stdio.h>*/
+
+int main(argc, argv) int argc; char *argv[]; {
        register int i, nflg;
 
        nflg = 0;
index 5c2f5c4..ef3c260 100644 (file)
--- a/bin/ed.c
+++ b/bin/ed.c
@@ -1,4 +1,17 @@
-#ifndef lint
+#include <gen.h>
+/*#include <setjmp.h> 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/signal.h> gen.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/ttychars.h> sys/ioctl.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)ed.c       4.4 (Berkeley) 4/26/86";
 #endif
 
@@ -6,10 +19,10 @@ static char sccsid[] = "@(#)ed.c     4.4 (Berkeley) 4/26/86";
  * Editor
  */
 
-#include <signal.h>
-#include <sgtty.h>
+/*#include <signal.h>*/
+/*#include <sgtty.h>*/
 #undef CEOF
-#include <setjmp.h>
+/*#include <setjmp.h>*/
 #define        NULL    0
 #define        FNSIZE  64
 #define        LBSIZE  512
@@ -56,7 +69,7 @@ char  *linebp;
 int    ninbuf;
 int    io;
 int    pflag;
-long   lseek();
+/*long lseek();*/
 int    (*oldhup)();
 int    (*oldquit)();
 int    vflag   = 1;
@@ -94,18 +107,75 @@ int        fchange;
 int    wrapp;
 unsigned nlall = 128;
 
-int    *address();
-char   *getline();
-char   *getblock();
-char   *place();
-char   *mktemp();
-void   *malloc();
-char   *realloc();
+/*int  *address();*/
+/*char *getline();*/
+/*char *getblock();*/
+/*char *place();*/
+/*char *mktemp();*/
+/*void *malloc();*/
+/*char *realloc();*/
 jmp_buf        savej;
 
-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 commands __P((void));
+int *address __P((void));
+int setdot __P((void));
+int setall __P((void));
+int setnoaddr __P((void));
+int nonzero __P((void));
+int newline __P((void));
+int filename __P((int comm));
+int exfile __P((void));
+int onintr __P((void));
+int onhup __P((void));
+int error __P((char *s));
+int getchr __P((void));
+int gettty __P((void));
+int getfile __P((void));
+int putfile __P((void));
+int append __P((int (*f)(void), int *a));
+int callunix __P((void));
+int quit __P((void));
+int delete __P((void));
+int rdelete __P((int *ad1, int *ad2));
+int gdelete __P((void));
+char *getline __P((int tl));
+int putline __P((void));
+char *getblock __P((int atl, int iof));
+int blkio __P((int b, char *buf, int (*iofcn)(void)));
+int init __P((void));
+int global __P((int k));
+int join __P((void));
+int substitute __P((int inglob));
+int compsub __P((void));
+int getsub __P((void));
+int dosub __P((void));
+char *place __P((register char *sp, register char *l1, register char *l2));
+int move __P((int cflag));
+int reverse __P((register int *a1, register int *a2));
+int getcopy __P((void));
+int compile __P((int aeof));
+int execute __P((int gf, int *addr));
+int advance __P((register char *lp, register char *ep));
+int backref __P((register i, register char *lp));
+int cclass __P((register char *set, int c, int af));
+int putd __P((void));
+int puts __P((register char *sp));
+int putchr __P((int ac));
+int crblock __P((char *permp, char *buf, int nchar, long startn));
+int getkey __P((void));
+int crinit __P((char *keyp, char *permp));
+int makekey __P((char *a, char *b));
+
+int main(argc, argv) int argc; char **argv; {
        register char *p1, *p2;
        extern int onintr(), quit(), onhup();
        int (*oldintr)();
@@ -159,8 +229,7 @@ char **argv;
        quit();
 }
 
-commands()
-{
+int commands() {
        int getfile(), gettty();
        register *a1, c;
 
@@ -234,7 +303,6 @@ commands()
                append(gettty, addr2-1);
                continue;
 
-
        case 'j':
                if (addr2==0) {
                        addr1 = dot;
@@ -355,7 +423,6 @@ commands()
                kflag = crinit(key, perm);
                continue;
 
-
        case '=':
                setall();
                newline();
@@ -376,9 +443,7 @@ commands()
        }
 }
 
-int *
-address()
-{
+int *address() {
        register *a1, minus, c;
        int n, relerr;
 
@@ -473,16 +538,14 @@ address()
        }
 }
 
-setdot()
-{
+int setdot() {
        if (addr2 == 0)
                addr1 = addr2 = dot;
        if (addr1 > addr2)
                error(Q);
 }
 
-setall()
-{
+int setall() {
        if (addr2==0) {
                addr1 = zero+1;
                addr2 = dol;
@@ -492,20 +555,17 @@ setall()
        setdot();
 }
 
-setnoaddr()
-{
+int setnoaddr() {
        if (addr2)
                error(Q);
 }
 
-nonzero()
-{
+int nonzero() {
        if (addr1<=zero || addr2>dol)
                error(Q);
 }
 
-newline()
-{
+int newline() {
        register c;
 
        if ((c = getchr()) == '\n')
@@ -520,8 +580,7 @@ newline()
        error(Q);
 }
 
-filename(comm)
-{
+int filename(comm) int comm; {
        register char *p1, *p2;
        register c;
 
@@ -557,8 +616,7 @@ filename(comm)
        }
 }
 
-exfile()
-{
+int exfile() {
        close(io);
        io = -1;
        if (vflag) {
@@ -567,16 +625,14 @@ exfile()
        }
 }
 
-onintr()
-{
+int onintr() {
        signal(SIGINT, onintr);
        putchr('\n');
        lastc = '\n';
        error(Q);
 }
 
-onhup()
-{
+int onhup() {
        signal(SIGINT, SIG_IGN);
        signal(SIGHUP, SIG_IGN);
        if (dol > zero) {
@@ -590,9 +646,7 @@ onhup()
        quit();
 }
 
-error(s)
-char *s;
-{
+int error(s) char *s; {
        register c;
 
        wrapp = 0;
@@ -616,8 +670,7 @@ char *s;
        longjmp(savej, 1);
 }
 
-getchr()
-{
+int getchr() {
        char c;
        if (lastc=peekc) {
                peekc = 0;
@@ -635,8 +688,7 @@ getchr()
        return(lastc);
 }
 
-gettty()
-{
+int gettty() {
        register c;
        register char *gf;
        register char *p;
@@ -661,8 +713,7 @@ gettty()
        return(0);
 }
 
-getfile()
-{
+int getfile() {
        register c;
        register char *lp, *fp;
 
@@ -697,8 +748,7 @@ getfile()
        return(0);
 }
 
-putfile()
-{
+int putfile() {
        int *a1, n;
        register char *fp, *lp;
        register nib;
@@ -736,10 +786,7 @@ putfile()
        }
 }
 
-append(f, a)
-int *a;
-int (*f)();
-{
+int append(f, a) int (*f)(); int *a; {
        register *a1, *a2, *rdot;
        int nline, tl;
 
@@ -769,8 +816,7 @@ int (*f)();
        return(nline);
 }
 
-callunix()
-{
+int callunix() {
        register (*savint)(), pid, rpid;
        int retcode;
 
@@ -788,8 +834,7 @@ callunix()
        puts("!");
 }
 
-quit()
-{
+int quit() {
        if (vflag && fchange && dol!=zero) {
                fchange = 0;
                error(Q);
@@ -798,17 +843,14 @@ quit()
        exit(0);
 }
 
-delete()
-{
+int delete() {
        setdot();
        newline();
        nonzero();
        rdelete(addr1, addr2);
 }
 
-rdelete(ad1, ad2)
-int *ad1, *ad2;
-{
+int rdelete(ad1, ad2) int *ad1; int *ad2; {
        register *a1, *a2, *a3;
 
        a1 = ad1;
@@ -825,8 +867,7 @@ int *ad1, *ad2;
        fchange = 1;
 }
 
-gdelete()
-{
+int gdelete() {
        register *a1, *a2, *a3;
 
        a3 = dol;
@@ -846,9 +887,7 @@ gdelete()
        fchange = 1;
 }
 
-char *
-getline(tl)
-{
+char *getline(tl) int tl; {
        register char *bp, *lp;
        register nl;
 
@@ -864,8 +903,7 @@ getline(tl)
        return(linebuf);
 }
 
-putline()
-{
+int putline() {
        register char *bp, *lp;
        register nl;
        int tl;
@@ -892,9 +930,7 @@ putline()
        return(nl);
 }
 
-char *
-getblock(atl, iof)
-{
+char *getblock(atl, iof) int atl; int iof; {
        extern read(), write();
        register bno, off;
        register char *p1, *p2;
@@ -942,18 +978,14 @@ getblock(atl, iof)
        return(obuff+off);
 }
 
-blkio(b, buf, iofcn)
-char *buf;
-int (*iofcn)();
-{
+int blkio(b, buf, iofcn) int b; char *buf; int (*iofcn)(); {
        lseek(tfile, (long)b<<9, 0);
        if ((*iofcn)(tfile, buf, 512) != 512) {
                error(T);
        }
 }
 
-init()
-{
+int init() {
        register *markp;
 
        close(tfile);
@@ -974,8 +1006,7 @@ init()
        dot = dol = zero;
 }
 
-global(k)
-{
+int global(k) int k; {
        register char *gp;
        register c;
        register int *a1;
@@ -1026,8 +1057,7 @@ global(k)
        }
 }
 
-join()
-{
+int join() {
        register char *gp, *lp;
        register *a1;
 
@@ -1048,8 +1078,7 @@ join()
        dot = addr1;
 }
 
-substitute(inglob)
-{
+int substitute(inglob) int inglob; {
        register *markp, *a1, nl;
        int gsubf;
        int getsub();
@@ -1087,8 +1116,7 @@ substitute(inglob)
                error(Q);
 }
 
-compsub()
-{
+int compsub() {
        register seof, c;
        register char *p;
 
@@ -1122,8 +1150,7 @@ compsub()
        return(0);
 }
 
-getsub()
-{
+int getsub() {
        register char *p1, *p2;
 
        p1 = linebuf;
@@ -1135,8 +1162,7 @@ getsub()
        return(0);
 }
 
-dosub()
-{
+int dosub() {
        register char *lp, *sp, *rp;
        int c;
 
@@ -1168,10 +1194,7 @@ dosub()
                ;
 }
 
-char *
-place(sp, l1, l2)
-register char *sp, *l1, *l2;
-{
+char *place(sp, l1, l2) register char *sp; register char *l1; register char *l2; {
 
        while (l1 < l2) {
                *sp++ = *l1++;
@@ -1181,8 +1204,7 @@ register char *sp, *l1, *l2;
        return(sp);
 }
 
-move(cflag)
-{
+int move(cflag) int cflag; {
        register int *adt, *ad1, *ad2;
        int getcopy();
 
@@ -1224,9 +1246,7 @@ move(cflag)
        fchange = 1;
 }
 
-reverse(a1, a2)
-register int *a1, *a2;
-{
+int reverse(a1, a2) register int *a1; register int *a2; {
        register int t;
 
        for (;;) {
@@ -1238,16 +1258,14 @@ register int *a1, *a2;
        }
 }
 
-getcopy()
-{
+int getcopy() {
        if (addr1 > addr2)
                return(EOF);
        getline(*addr1++);
        return(0);
 }
 
-compile(aeof)
-{
+int compile(aeof) int aeof; {
        register eof, c;
        register char *ep;
        char *lastep;
@@ -1375,9 +1393,7 @@ compile(aeof)
        error(Q);
 }
 
-execute(gf, addr)
-int *addr;
-{
+int execute(gf, addr) int gf; int *addr; {
        register char *p1, *p2, c;
 
        for (c=0; c<NBRA; c++) {
@@ -1426,9 +1442,7 @@ int *addr;
        return(0);
 }
 
-advance(lp, ep)
-register char *ep, *lp;
-{
+int advance(lp, ep) register char *lp; register char *ep; {
        register char *curlp;
        int i;
 
@@ -1533,10 +1547,7 @@ register char *ep, *lp;
        }
 }
 
-backref(i, lp)
-register i;
-register char *lp;
-{
+int backref(i, lp) register i; register char *lp; {
        register char *bp;
 
        bp = braslist[i];
@@ -1546,9 +1557,7 @@ register char *lp;
        return(0);
 }
 
-cclass(set, c, af)
-register char *set, c;
-{
+int cclass(set, c, af) register char *set; int c; int af; {
        register n;
 
        if (c==0)
@@ -1560,8 +1569,7 @@ register char *set, c;
        return(!af);
 }
 
-putd()
-{
+int putd() {
        register r;
 
        r = count%10;
@@ -1571,9 +1579,7 @@ putd()
        putchr(r + '0');
 }
 
-puts(sp)
-register char *sp;
-{
+int puts(sp) register char *sp; {
        col = 0;
        while (*sp)
                putchr(*sp++);
@@ -1583,8 +1589,7 @@ register char *sp;
 char   line[70];
 char   *linp   = line;
 
-putchr(ac)
-{
+int putchr(ac) int ac; {
        register char *lp;
        register c;
 
@@ -1626,11 +1631,7 @@ out:
        }
        linp = lp;
 }
-crblock(permp, buf, nchar, startn)
-char *permp;
-char *buf;
-long startn;
-{
+int crblock(permp, buf, nchar, startn) char *permp; char *buf; int nchar; long startn; {
        register char *p1;
        int n1;
        int n2;
@@ -1655,8 +1656,7 @@ long startn;
        }
 }
 
-getkey()
-{
+int getkey() {
        struct sgttyb b;
        int save;
        int (*sig)();
@@ -1686,9 +1686,7 @@ getkey()
  * Besides initializing the encryption machine, this routine
  * returns 0 if the key is null, and 1 if it is non-null.
  */
-crinit(keyp, permp)
-char   *keyp, *permp;
-{
+int crinit(keyp, permp) char *keyp; char *permp; {
        register char *t1, *t2, *t3;
        register i;
        int ic, k, temp, pf[2];
@@ -1749,9 +1747,7 @@ char      *keyp, *permp;
        return(1);
 }
 
-makekey(a, b)
-char *a, *b;
-{
+int makekey(a, b) char *a; char *b; {
        register int i;
        long t;
        char temp[KSIZE + 1];
index 01d59e8..cb1a618 100644 (file)
@@ -1,4 +1,9 @@
-#ifndef lint
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/ttychars.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)grep.c     4.6 (Berkeley) 5/14/84";
 #endif
 
@@ -11,8 +16,8 @@ static char sccsid[] = "@(#)grep.c    4.6 (Berkeley) 5/14/84";
  *             2 - some error
  */
 
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 
 #define        CBRA    1
 #define        CCHR    2
@@ -64,9 +69,23 @@ char bittab[] = {
        128
 };
 
-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 compile __P((char *astr));
+int execute __P((char *file));
+int advance __P((register char *lp, register char *ep));
+int succeed __P((char *f));
+int ecmp __P((char *a, char *b, int count));
+int errexit __P((char *s, char *f));
+
+int main(argc, argv) int argc; char **argv; {
        while (--argc > 0 && (++argv)[0][0]=='-')
                switch (argv[0][1]) {
 
@@ -155,9 +174,7 @@ out:
        exit(retcode != 0 ? retcode : nsucc == 0);
 }
 
-compile(astr)
-char *astr;
-{
+int compile(astr) char *astr; {
        register c;
        register char *ep, *sp;
        char *cstart;
@@ -287,9 +304,7 @@ char *astr;
        errexit("grep: RE error\n", (char *)NULL);
 }
 
-execute(file)
-char *file;
-{
+int execute(file) char *file; {
        register char *p1, *p2;
        register c;
 
@@ -352,9 +367,7 @@ char *file;
        }
 }
 
-advance(lp, ep)
-register char *lp, *ep;
-{
+int advance(lp, ep) register char *lp; register char *ep; {
        register char *curlp;
        char c;
        char *bbeg;
@@ -420,7 +433,6 @@ register char *lp, *ep;
                }
                return(0);
 
-
        case CDOT|STAR:
                curlp = lp;
                while (*lp++);
@@ -481,9 +493,7 @@ register char *lp, *ep;
        }
 }
 
-succeed(f)
-char *f;
-{
+int succeed(f) char *f; {
        nsucc = 1;
        if (sflag)
                return;
@@ -507,18 +517,14 @@ char *f;
        fflush(stdout);
 }
 
-ecmp(a, b, count)
-char   *a, *b;
-{
+int ecmp(a, b, count) char *a; char *b; int count; {
        register cc = count;
        while(cc--)
                if(*a++ != *b++)        return(0);
        return(1);
 }
 
-errexit(s, f)
-char *s, *f;
-{
+int errexit(s, f) char *s; char *f; {
        fprintf(stderr, s, f);
        exit(2);
 }
index 82a59c2..94b294d 100644 (file)
@@ -1,32 +1,37 @@
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <stdio.h>
+/*#include <strings.h> sys.h*/
+#include <sys.h>
+/*#include <sys/errno.h> sys.h*/
+/*#include <sys/types.h> arpa/inet.h*/
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)hostid.c   5.4 (Berkeley) 5/19/86";
-#endif not lint
+#endif
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <netdb.h>
+/*#include <sys/types.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <netdb.h>*/
 
-extern char *index();
-extern unsigned long inet_addr();
-extern long gethostid();
+/*extern       char *index();*/
+/*extern       unsigned long inet_addr();*/
+/*extern       long gethostid();*/
 
-main(argc, argv)
-       int argc;
-       char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register char *id;
        u_long addr;
        long hostid;
index c41da8f..0d1311d 100644 (file)
@@ -1,30 +1,33 @@
+#include <stdio.h>
+/*#include <strings.h> sys.h*/
+#include <sys.h>
+/*#include <sys/errno.h> sys.h*/
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)hostname.c 5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
 /*
  * hostname -- get (or set hostname)
  */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 char hostname[32];
 extern int errno;
 
-main(argc,argv)
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        int     myerrno;
 
        argc--;
index e9991bd..0511041 100644 (file)
@@ -1,10 +1,18 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)kill.c      4.4 (Berkeley) 4/20/86";
+#endif
 /*
  * kill - send signal to process
  */
 
-#include <signal.h>
-#include <ctype.h>
+/*#include <signal.h>*/
+/*#include <ctype.h>*/
 
 char *signm[] = { 0,
 "HUP", "INT", "QUIT", "ILL", "TRAP", "IOT", "EMT", "FPE",      /* 1-8 */
@@ -13,9 +21,7 @@ char *signm[] = { 0,
 "XFSZ", "VTALRM", "PROF", "WINCH", 0, "USR1", "USR2", 0,       /* 25-31 */
 };
 
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register signo, pid, res;
        int errlev;
        extern char *sys_errlist[];
index 95edb47..52d75d6 100644 (file)
--- a/bin/ld.c
+++ b/bin/ld.c
@@ -1,32 +1,48 @@
+/*#include <a.out.h> gen.h*/
+#include <ar.h>
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <ranlib.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <sys.h>
+/*#include <sys/exec.h> a.out.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+/*#include <sys/stat.h> sys.h*/
+#include <sys/trace.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[] = "@(#)ld.c       5.4 (Berkeley) 11/26/85";
-#endif not lint
+#endif
 
 /*
  * ld - string table version for VAX
  */
 
-#include <sys/param.h>
-#include <signal.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <ar.h>
-#include <a.out.h>
-#include <ranlib.h>
-#include <sys/stat.h>
-#include <sys/file.h>
+/*#include <sys/param.h>*/
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <ar.h>*/
+/*#include <a.out.h>*/
+/*#include <ranlib.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/file.h>*/
 
 /*
  * Basic strategy:
@@ -121,7 +137,7 @@ struct      nlist *addsym;          /* first sym defined during incr load */
 int    nsym;                   /* pass2: number of local symbols in a.out */
 /* nsym + symx(nextsym) is the symbol table size during pass2 */
 
-struct nlist **lookup(), **slookup();
+/*struct       nlist **lookup(), **slookup();*/
 struct nlist *p_etext, *p_edata, *p_end, *entrypt;
 
 /*
@@ -340,14 +356,64 @@ char      *curstr;
  */
 int    pagesize;
 
-char   get();
-int    delexit();
-char   *savestr();
-void   *malloc();
-
-main(argc, argv)
-char **argv;
-{
+/*char         get();*/
+/*int  delexit();*/
+/*char *savestr();*/
+/*void *malloc();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int htoi __P((register char *p));
+int delexit __P((void));
+int endload __P((int argc, char **argv));
+int load1arg __P((register char *cp));
+int step __P((off_t nloc));
+int nextlibp __P((off_t val));
+int ldrand __P((void));
+int load1 __P((int libflg, off_t loc));
+int middle __P((void));
+int fixspec __P((struct nlist *sym, long offset));
+int ldrsym __P((register struct nlist *sp, long val, int type));
+int setupout __P((void));
+int outb __P((register struct biobuf **bp, int inc, int bufsize));
+int load2arg __P((char *acp));
+int load2 __P((long loc));
+int tracesym __P((void));
+int load2td __P((long creloc, int position, struct biobuf *b1, struct biobuf *b2));
+int finishout __P((void));
+int mkfsym __P((char *s));
+int getarhdr __P((void));
+int mget __P((register char *loc, int n, register STREAM *sp));
+int symwrite __P((struct nlist *sp, struct biobuf *bp));
+int dseek __P((register STREAM *sp, long loc, long s));
+char get __P((STREAM *asp));
+int getfile __P((char *acp));
+int libopen __P((char *name, int oflags));
+struct nlist **lookup __P((void));
+int symfree __P((struct nlist *saved));
+struct nlist **slookup __P((char *s));
+int enter __P((register struct nlist **hp));
+int symx __P((struct nlist *sp));
+int symreloc __P((void));
+int error __P((int n, char *s));
+int readhdr __P((off_t loc));
+int round __P((int v, u_long r));
+char *savestr __P((register char *cp));
+int bopen __P((register struct biobuf *bp, int off, int bufsize));
+int bwrite __P((register char *p, register int cnt, register struct biobuf *bp));
+int bflush __P((void));
+int bflush1 __P((register struct biobuf *bp));
+int bflushc __P((register struct biobuf *bp, int c));
+int bseek __P((register struct biobuf *bp, register off_t off));
+
+int main(argc, argv) int argc; char **argv; {
        register int c, i; 
        int num;
        register char *ap, **p;
@@ -522,9 +588,7 @@ next:
  * Convert a ascii string which is a hex number.
  * Used by -T and -D options.
  */
-htoi(p)
-       register char *p;
-{
+int htoi(p) register char *p; {
        register int c, n;
 
        n = 0;
@@ -542,8 +606,7 @@ htoi(p)
        return (n);
 }
 
-delexit()
-{
+int delexit() {
        struct stat stbuf;
        long size;
        char c = 0;
@@ -570,10 +633,7 @@ delexit()
        exit (delarg);
 }
 
-endload(argc, argv)
-       int argc; 
-       char **argv;
-{
+int endload(argc, argv) int argc; char **argv; {
        register int c, i; 
        long dnum;
        register char *ap, **p;
@@ -632,9 +692,7 @@ next:
 /*
  * Scan file to find defined symbols.
  */
-load1arg(cp)
-       register char *cp;
-{
+int load1arg(cp) register char *cp; {
        register struct ranlib *tp;
        off_t nloc;
        int kind;
@@ -727,9 +785,7 @@ load1arg(cp)
  * is useful, record its location in the liblist structure
  * for use in pass2.  Mark the end of the archive in libilst with a -1.
  */
-step(nloc)
-       off_t nloc;
-{
+int step(nloc) off_t nloc; {
 
        dseek(&text, nloc, (long) sizeof archdr);
        if (text.size <= 0) {
@@ -747,9 +803,7 @@ step(nloc)
  * Recording -1 marks the end of files from an archive.
  * The liblist data structure is dynamically extended here.
  */
-nextlibp(val)
-       off_t val;
-{
+int nextlibp(val) off_t val; {
 
        if (clibseg->li_used == NROUT) {
                if (++clibseg == &libseg[NSEG])
@@ -770,8 +824,7 @@ nextlibp(val)
  * that define a symbol which is currently externally undefined).
  * Indicate to our caller whether this process netted any more symbols.
  */
-ldrand()
-{
+int ldrand() {
        register struct nlist *sp, **hp;
        register struct ranlib *tp, *tplast;
        off_t loc;
@@ -795,9 +848,7 @@ ldrand()
 /*
  * Examine a single file or archive member on pass 1.
  */
-load1(libflg, loc)
-       off_t loc;
-{
+int load1(libflg, loc) int libflg; off_t loc; {
        register struct nlist *sp;
        struct nlist *savnext;
        int ndef, nlocal, type, size, nsymt;
@@ -889,8 +940,7 @@ load1(libflg, loc)
        return(0);
 }
 
-middle()
-{
+int middle() {
        register struct nlist *sp;
        long csize, t, corigin, ocsize;
        int nund, rnd;
@@ -1012,19 +1062,13 @@ middle()
        }
 }
 
-fixspec(sym,offset)
-       struct nlist *sym;
-       long offset;
-{
+int fixspec(sym, offset) struct nlist *sym; long offset; {
 
        if(symx(sym) < symx(addsym) && sym!=0)
                sym->n_value += offset;
 }
 
-ldrsym(sp, val, type)
-       register struct nlist *sp;
-       long val;
-{
+int ldrsym(sp, val, type) register struct nlist *sp; long val; int type; {
 
        if (sp == 0)
                return;
@@ -1040,8 +1084,7 @@ ldrsym(sp, val, type)
 off_t  wroff;
 struct biobuf toutb;
 
-setupout()
-{
+int setupout() {
        int bss;
        struct stat stbuf;
        extern char *sys_errlist[];
@@ -1097,9 +1140,7 @@ setupout()
        }
 }
 
-outb(bp, inc, bufsize)
-       register struct biobuf **bp;
-{
+int outb(bp, inc, bufsize) register struct biobuf **bp; int inc; int bufsize; {
 
        *bp = (struct biobuf *)malloc(sizeof (struct biobuf));
        if (*bp == 0)
@@ -1108,9 +1149,7 @@ outb(bp, inc, bufsize)
        wroff += inc;
 }
 
-load2arg(acp)
-char *acp;
-{
+int load2arg(acp) char *acp; {
        register char *cp;
        off_t loc;
 
@@ -1140,9 +1179,7 @@ char *acp;
        close(infil);
 }
 
-load2(loc)
-long loc;
-{
+int load2(loc) long loc; {
        int size;
        register struct nlist *sp;
        register struct local *lp;
@@ -1285,8 +1322,7 @@ struct tynames {
        0,      0,
 };
 
-tracesym()
-{
+int tracesym() {
        register struct tynames *tp;
 
        if (cursym.n_type & N_STAB)
@@ -1324,10 +1360,7 @@ tracesym()
  * If we are saving the relocation information, then we increase
  * each relocation datum address by our base position in the new segment.
  */
-load2td(creloc, position, b1, b2)
-       long creloc, offset;
-       struct biobuf *b1, *b2;
-{
+int load2td(creloc, position, b1, b2) long creloc; int position; struct biobuf *b1; struct biobuf *b2; {
        register struct nlist *sp;
        register struct local *lp;
        long tw;
@@ -1463,8 +1496,7 @@ load2td(creloc, position, b1, b2)
        free(codep);
 }
 
-finishout()
-{
+int finishout() {
        register int i;
        int nsymt;
 
@@ -1484,9 +1516,7 @@ finishout()
        delexit();
 }
 
-mkfsym(s)
-char *s;
-{
+int mkfsym(s) char *s; {
 
        if (sflag || xflag)
                return;
@@ -1496,8 +1526,7 @@ char *s;
        symwrite(&cursym, sout);
 }
 
-getarhdr()
-{
+int getarhdr() {
        register char *cp;
 
        mget((char *)&archdr, sizeof archdr, &text);
@@ -1508,10 +1537,7 @@ getarhdr()
                }
 }
 
-mget(loc, n, sp)
-register STREAM *sp;
-register char *loc;
-{
+int mget(loc, n, sp) register char *loc; int n; register STREAM *sp; {
        register char *p;
        register int take;
 
@@ -1552,10 +1578,7 @@ top:
        goto top;
 }
 
-symwrite(sp, bp)
-       struct nlist *sp;
-       struct biobuf *bp;
-{
+int symwrite(sp, bp) struct nlist *sp; struct biobuf *bp; {
        register int len;
        register char *str;
 
@@ -1570,10 +1593,7 @@ symwrite(sp, bp)
        sp->n_un.n_name = str;
 }
 
-dseek(sp, loc, s)
-register STREAM *sp;
-long loc, s;
-{
+int dseek(sp, loc, s) register STREAM *sp; long loc; long s; {
        register PAGE *p;
        register b, o;
        int n;
@@ -1604,10 +1624,7 @@ long loc, s;
                sp->size = 0;
 }
 
-char
-get(asp)
-STREAM *asp;
-{
+char get(asp) STREAM *asp; {
        register STREAM *sp;
 
        sp = asp;
@@ -1626,9 +1643,7 @@ STREAM *asp;
        return(*sp->ptr++);
 }
 
-getfile(acp)
-char *acp;
-{
+int getfile(acp) char *acp; {
        register int c;
        char arcmag[SARMAG+1];
        struct stat stb;
@@ -1687,10 +1702,7 @@ char *acp;
  * Search for a library with given name
  * using the directory search array.
  */
-libopen(name, oflags)
-       char *name;
-       int oflags;
-{
+int libopen(name, oflags) char *name; int oflags; {
        register char *p, *cp;
        register int i;
        static char buf[MAXPATHLEN+1];
@@ -1717,9 +1729,7 @@ libopen(name, oflags)
        return (fd);
 }
 
-struct nlist **
-lookup()
-{
+struct nlist **lookup() {
        register int sh; 
        register struct nlist **hp;
        register char *cp, *cp1;
@@ -1767,9 +1777,7 @@ lookup()
        /*NOTREACHED*/
 }
 
-symfree(saved)
-       struct nlist *saved;
-{
+int symfree(saved) struct nlist *saved; {
        register struct symseg *gp;
        register struct nlist *sp;
 
@@ -1793,10 +1801,7 @@ symfree(saved)
        error(1, "symfree botch");
 }
 
-struct nlist **
-slookup(s)
-       char *s;
-{
+struct nlist **slookup(s) char *s; {
 
        cursym.n_un.n_name = s;
        cursym.n_type = N_EXT+N_UNDF;
@@ -1804,9 +1809,7 @@ slookup(s)
        return (lookup());
 }
 
-enter(hp)
-register struct nlist **hp;
-{
+int enter(hp) register struct nlist **hp; {
        register struct nlist *sp;
 
        if (*hp==0) {
@@ -1826,9 +1829,7 @@ register struct nlist **hp;
        }
 }
 
-symx(sp)
-       struct nlist *sp;
-{
+int symx(sp) struct nlist *sp; {
        register struct symseg *gp;
 
        if (sp == 0)
@@ -1841,8 +1842,7 @@ symx(sp)
        /*NOTREACHED*/
 }
 
-symreloc()
-{
+int symreloc() {
        if(funding) return;
        switch (cursym.n_type & 017) {
 
@@ -1871,9 +1871,7 @@ symreloc()
        }
 }
 
-error(n, s)
-char *s;
-{
+int error(n, s) int n; char *s; {
 
        if (errlev==0)
                printf("ld:");
@@ -1891,9 +1889,7 @@ char *s;
        errlev = 2;
 }
 
-readhdr(loc)
-off_t loc;
-{
+int readhdr(loc) off_t loc; {
 
        dseek(&text, loc, (long)sizeof(filhdr));
        mget((short *)&filhdr, sizeof(filhdr), &text);
@@ -1914,10 +1910,7 @@ off_t loc;
                error(1, "bad format");
 }
 
-round(v, r)
-       int v;
-       u_long r;
-{
+int round(v, r) int v; u_long r; {
 
        r--;
        v += r;
@@ -1929,10 +1922,7 @@ round(v, r)
 char   *savetab;
 int    saveleft;
 
-char *
-savestr(cp)
-       register char *cp;
-{
+char *savestr(cp) register char *cp; {
        register int len;
 
        len = strlen(cp) + 1;
@@ -1951,9 +1941,7 @@ savestr(cp)
        return (cp);
 }
 
-bopen(bp, off, bufsize)
-       register struct biobuf *bp;
-{
+int bopen(bp, off, bufsize) register struct biobuf *bp; int off; int bufsize; {
 
        bp->b_ptr = bp->b_buf = malloc(bufsize);
        if (bp->b_ptr == (char *)0)
@@ -1967,11 +1955,7 @@ bopen(bp, off, bufsize)
 
 int    bwrerror;
 
-bwrite(p, cnt, bp)
-       register char *p;
-       register int cnt;
-       register struct biobuf *bp;
-{
+int bwrite(p, cnt, bp) register char *p; register int cnt; register struct biobuf *bp; {
        register int put;
        register char *to;
 
@@ -2010,8 +1994,7 @@ top:
        goto top;
 }
 
-bflush()
-{
+int bflush() {
        register struct biobuf *bp;
 
        if (bwrerror)
@@ -2020,9 +2003,7 @@ bflush()
                bflush1(bp);
 }
 
-bflush1(bp)
-       register struct biobuf *bp;
-{
+int bflush1(bp) register struct biobuf *bp; {
        register int cnt = bp->b_ptr - bp->b_buf;
 
        if (cnt == 0)
@@ -2039,18 +2020,13 @@ bflush1(bp)
        bp->b_nleft = bp->b_bufsize;
 }
 
-bflushc(bp, c)
-       register struct biobuf *bp;
-{
+int bflushc(bp, c) register struct biobuf *bp; int c; {
 
        bflush1(bp);
        bputc(c, bp);
 }
 
-bseek(bp, off)
-       register struct biobuf *bp;
-       register off_t off;
-{
+int bseek(bp, off) register struct biobuf *bp; register off_t off; {
        bflush1(bp);
        
        bp->b_nleft = bp->b_bufsize - (off % bp->b_bufsize);
index 8e0d6ba..bf763e0 100644 (file)
--- a/bin/ln.c
+++ b/bin/ln.c
@@ -1,23 +1,39 @@
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)ln.c 4.6 11/15/85";
+#endif
 /*
  * ln
  */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <errno.h>*/
 
 struct stat stb;
 int    fflag;          /* force flag set? */
 int    sflag;
 char   name[BUFSIZ];
-char   *rindex();
+/*char *rindex();*/
 extern int errno;
 
-main(argc, argv)
-       int argc;
-       register char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, register char **argv));
+int linkit __P((char *from, char *to));
+
+int main(argc, argv) int argc; register char **argv; {
        register int i, r;
 
        argc--, argv++;
@@ -53,11 +69,9 @@ usage:
        exit(1);
 }
 
-int    link(), symlink();
+/*int  link(), symlink();*/
 
-linkit(from, to)
-       char *from, *to;
-{
+int linkit(from, to) char *from; char *to; {
        char *tail;
        int (*linkf)() = sflag ? symlink : link;
 
index c9deb1b..66e5571 100644 (file)
@@ -1,18 +1,42 @@
+#include <gen.h>
+/*#include <grp.h> gen.h*/
+#include <lastlog.h>
+#include <net.h>
+/*#include <pwd.h> gen.h*/
+/*#include <stdio.h> net.h*/
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.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/quota.h>
+#include <sys/resource.h>
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/syslog.h> gen.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/ttychars.h> sys/ioctl.h*/
+/*#include <sys/types.h> gen.h*/
+/*#include <time.h> gen.h*/
+/*#include <ttyent.h> gen.h*/
+/*#include <utmp.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[] = "@(#)login.c    5.15 (Berkeley) 4/12/86";
-#endif not lint
+#endif
 
 /*
  * login [ name ]
@@ -20,23 +44,23 @@ static char sccsid[] = "@(#)login.c 5.15 (Berkeley) 4/12/86";
  * login -h hostname (for telnetd, etc.)
  */
 
-#include <sys/param.h>
-#include <sys/quota.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/file.h>
-
-#include <sgtty.h>
-#include <utmp.h>
-#include <signal.h>
-#include <pwd.h>
-#include <stdio.h>
-#include <lastlog.h>
-#include <errno.h>
-#include <ttyent.h>
-#include <syslog.h>
-#include <grp.h>
+/*#include <sys/param.h>*/
+/*#include <sys/quota.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/file.h>*/
+
+/*#include <sgtty.h>*/
+/*#include <utmp.h>*/
+/*#include <signal.h>*/
+/*#include <pwd.h>*/
+/*#include <stdio.h>*/
+/*#include <lastlog.h>*/
+/*#include <errno.h>*/
+/*#include <ttyent.h>*/
+/*#include <syslog.h>*/
+/*#include <grp.h>*/
 
 #define TTYGRPNAME     "tty"           /* name of group to own ttys */
 #define TTYGID(gid)    tty_gid(gid)    /* gid that owns all ttys */
@@ -68,13 +92,13 @@ int timeout = 60;
 char   term[64];
 
 struct passwd *pwd;
-char   *strcat(), *rindex(), *index();
-void   *malloc(), *realloc();
-int    timedout();
-char   *ttyname();
-char   *crypt();
-char   *getpass();
-char   *stypeof();
+/*char *strcat(), *rindex(), *index();*/
+/*void *malloc(), *realloc();*/
+/*int  timedout();*/
+/*char *ttyname();*/
+/*char *crypt();*/
+/*char *getpass();*/
+/*char *stypeof();*/
 extern char **environ;
 extern int errno;
 
@@ -94,9 +118,28 @@ char        rpassword[NMAX+1];
 char   name[NMAX+1];
 char   *rhost;
 
-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 getloginname __P((register struct utmp *up));
+int timedout __P((void));
+int catch __P((void));
+int rootterm __P((char *tty));
+int showmotd __P((void));
+char *stypeof __P((char *ttyid));
+int doremotelogin __P((char *host));
+int getstr __P((char *buf, int cnt, char *err));
+int doremoteterm __P((char *term, struct sgttyb *tp));
+int setenv __P((char *var, char *value, int clobber));
+int tty_gid __P((int default_gid));
+
+int main(argc, argv) int argc; char *argv[]; {
        register char *namep;
        int pflag = 0, hflag = 0, t, f, c;
        int invalid, quietlog;
@@ -393,9 +436,7 @@ main(argc, argv)
        exit(0);
 }
 
-getloginname(up)
-       register struct utmp *up;
-{
+int getloginname(up) register struct utmp *up; {
        register char *namep;
        char c;
 
@@ -417,24 +458,20 @@ getloginname(up)
                pwd = &nouser;
 }
 
-timedout()
-{
+int timedout() {
 
        printf("Login timed out after %d seconds\n", timeout);
        exit(0);
 }
 
 int    stopmotd;
-catch()
-{
+int catch() {
 
        signal(SIGINT, SIG_IGN);
        stopmotd++;
 }
 
-rootterm(tty)
-       char *tty;
-{
+int rootterm(tty) char *tty; {
        register struct ttyent *t;
 
        if ((t = getttynam(tty)) != NULL) {
@@ -444,8 +481,7 @@ rootterm(tty)
        return (0);
 }
 
-showmotd()
-{
+int showmotd() {
        FILE *mf;
        register c;
 
@@ -461,10 +497,7 @@ showmotd()
 #undef UNKNOWN
 #define UNKNOWN "su"
 
-char *
-stypeof(ttyid)
-       char *ttyid;
-{
+char *stypeof(ttyid) char *ttyid; {
        register struct ttyent *t;
 
        if (ttyid == NULL || (t = getttynam(ttyid)) == NULL)
@@ -472,9 +505,7 @@ stypeof(ttyid)
        return (t->ty_type);
 }
 
-doremotelogin(host)
-       char *host;
-{
+int doremotelogin(host) char *host; {
        getstr(rusername, sizeof (rusername), "remuser");
        getstr(lusername, sizeof (lusername), "locuser");
        getstr(term, sizeof(term), "Terminal type");
@@ -490,11 +521,7 @@ doremotelogin(host)
        return(ruserok(host, (pwd->pw_uid == 0), rusername, lusername));
 }
 
-getstr(buf, cnt, err)
-       char *buf;
-       int cnt;
-       char *err;
-{
+int getstr(buf, cnt, err) char *buf; int cnt; char *err; {
        char c;
 
        do {
@@ -513,10 +540,7 @@ char       *speeds[] =
       "600", "1200", "1800", "2400", "4800", "9600", "19200", "38400" };
 #define        NSPEEDS (sizeof (speeds) / sizeof (speeds[0]))
 
-doremoteterm(term, tp)
-       char *term;
-       struct sgttyb *tp;
-{
+int doremoteterm(term, tp) char *term; struct sgttyb *tp; {
        register char *cp = index(term, '/'), **cpp;
        char *speed;
 
@@ -542,9 +566,7 @@ doremoteterm(term, tp)
  * This procedure assumes the memory for the first level of environ
  * was allocated using malloc.
  */
-setenv(var, value, clobber)
-       char *var, *value;
-{
+int setenv(var, value, clobber) char *var; char *value; int clobber; {
        extern char **environ;
        int index = 0;
        int varlen = strlen(var);
@@ -572,9 +594,7 @@ setenv(var, value, clobber)
        environ[++index] = NULL;
 }
 
-tty_gid(default_gid)
-       int default_gid;
-{
+int tty_gid(default_gid) int default_gid; {
        struct group *getgrnam(), *gr;
        int gid = default_gid;
 
index 62b0d62..eb7417e 100644 (file)
--- a/bin/ls.c
+++ b/bin/ls.c
@@ -1,18 +1,34 @@
+#include <gen.h>
+/*#include <grp.h> gen.h*/
+/*#include <pwd.h> gen.h*/
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.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/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+/*#include <time.h> gen.h*/
+/*#include <utmp.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[] = "@(#)ls.c       5.6 (Berkeley) 5/12/86";
-#endif not lint
+#endif
 
 /*
  * ls
@@ -20,11 +36,11 @@ static char sccsid[] = "@(#)ls.c    5.6 (Berkeley) 5/12/86";
  * 4.2bsd version for symbolic links, variable length
  * directory entries, block size in the inode, etc.
  */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <stdio.h>
-#include <sgtty.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
+/*#include <stdio.h>*/
+/*#include <sgtty.h>*/
 
 #define        kbytes(size)    (((size) + 1023) / 1024)
 
@@ -61,20 +77,41 @@ char        *dotp = ".";
 struct winsize win;
 int    twidth;
 
-struct afile *gstat();
-int    fcmp();
-char   *cat(), *savestr();
-char   *fmtentry();
-char   *getname(), *getgroup();
-
-char   *ctime();
-void   *malloc(), *calloc(), *realloc();
-char   *strcpy(), *strcat();
-
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
+/*struct       afile *gstat();*/
+/*int  fcmp();*/
+/*char *cat(), *savestr();*/
+/*char *fmtentry();*/
+/*char *getname(), *getgroup();*/
+
+/*char *ctime();*/
+/*void *malloc(), *calloc(), *realloc();*/
+/*char *strcpy(), *strcat();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int formatd __P((char *name, int title));
+int getdir __P((char *dir, struct afile **pfp0, struct afile **pfplast));
+struct afile *gstat __P((register struct afile *fp, char *file, int statarg, int *pnb));
+int formatf __P((struct afile *fp0, struct afile *fplast));
+int fcmp __P((register struct afile *f1, register struct afile *f2));
+char *cat __P((char *dir, char *file));
+char *savestr __P((char *str));
+char *fmtentry __P((register struct afile *fp));
+char *fmtinum __P((register struct afile *p));
+char *fmtsize __P((register struct afile *p));
+char *fmtlstuff __P((register struct afile *p));
+char *fmtmode __P((char *lp, int flags));
+char *getname __P((int uid));
+char *getgroup __P((int gid));
+
+int main(argc, argv) int argc; char *argv[]; {
        int i;
        struct afile *fp0, *fplast;
        register struct afile *fp;
@@ -195,10 +232,7 @@ main(argc, argv)
        exit(0);
 }
 
-formatd(name, title)
-       char *name;
-       int title;
-{
+int formatd(name, title) char *name; int title; {
        register struct afile *fp;
        register struct subdirs *dp;
        struct afile *dfp0, *dfplast;
@@ -233,10 +267,7 @@ formatd(name, title)
        cfree((char *)dfp0);
 }
 
-getdir(dir, pfp0, pfplast)
-       char *dir;
-       struct afile **pfp0, **pfplast;
-{
+int getdir(dir, pfp0, pfplast) char *dir; struct afile **pfp0; struct afile **pfplast; {
        register struct afile *fp;
        DIR *dirp;
        register struct direct *dp;
@@ -280,14 +311,9 @@ getdir(dir, pfp0, pfplast)
        return (kbytes(dbtob(nb)));
 }
 
-int    stat(), lstat();
+/*int  stat(), lstat();*/
 
-struct afile *
-gstat(fp, file, statarg, pnb)
-       register struct afile *fp;
-       char *file;
-       int statarg, *pnb;
-{
+struct afile *gstat(fp, file, statarg, pnb) register struct afile *fp; char *file; int statarg; int *pnb; {
        int (*statf)() = Lflg ? stat : lstat;
        char buf[BUFSIZ]; int cc;
        static struct afile azerofile;
@@ -354,9 +380,7 @@ gstat(fp, file, statarg, pnb)
        return (fp);
 }
 
-formatf(fp0, fplast)
-       struct afile *fp0, *fplast;
-{
+int formatf(fp0, fplast) struct afile *fp0; struct afile *fplast; {
        register struct afile *fp;
        int width = 0, w, nentry = fplast - fp0;
        int i, j, columns, lines;
@@ -404,9 +428,7 @@ formatf(fp0, fplast)
        }
 }
 
-fcmp(f1, f2)
-       register struct afile *f1, *f2;
-{
+int fcmp(f1, f2) register struct afile *f1; register struct afile *f2; {
 
        if (dflg == 0 && fflg == 0) {
                if ((f1->fflags&ISARG) && f1->ftype == 'd') {
@@ -427,10 +449,7 @@ fcmp(f1, f2)
        return (rflg * strcmp(f1->fname, f2->fname));
 }
 
-char *
-cat(dir, file)
-       char *dir, *file;
-{
+char *cat(dir, file) char *dir; char *file; {
        static char dfile[BUFSIZ];
 
        if (strlen(dir)+1+strlen(file)+1 > BUFSIZ) {
@@ -448,10 +467,7 @@ cat(dir, file)
        return (dfile);
 }
 
-char *
-savestr(str)
-       char *str;
-{
+char *savestr(str) char *str; {
        char *cp = malloc(strlen(str) + 1);
 
        if (cp == NULL) {
@@ -462,12 +478,9 @@ savestr(str)
        return (cp);
 }
 
-char   *fmtinum(), *fmtsize(), *fmtlstuff(), *fmtmode();
+/*char *fmtinum(), *fmtsize(), *fmtlstuff(), *fmtmode();*/
 
-char *
-fmtentry(fp)
-       register struct afile *fp;
-{
+char *fmtentry(fp) register struct afile *fp; {
        static char fmtres[BUFSIZ];
        register char *cp, *dp;
 
@@ -503,30 +516,21 @@ fmtentry(fp)
        return (fmtres);
 }
 
-char *
-fmtinum(p)
-       register struct afile *p;
-{
+char *fmtinum(p) register struct afile *p; {
        static char inumbuf[8];
 
        (void) sprintf(inumbuf, "%6d ", p->fnum);
        return (inumbuf);
 }
 
-char *
-fmtsize(p)
-       register struct afile *p;
-{
+char *fmtsize(p) register struct afile *p; {
        static char sizebuf[32];
 
        (void) sprintf(sizebuf, "%4ld ", kbytes(dbtob(p->fblks)));
        return (sizebuf);
 }
 
-char *
-fmtlstuff(p)
-       register struct afile *p;
-{
+char *fmtlstuff(p) register struct afile *p; {
        static char lstuffbuf[256];
        char gname[32], uname[32], fsize[32], ftime[32];
        register char *lp = lstuffbuf;
@@ -582,11 +586,7 @@ int        m9[] = { 2, S_ISVTX, 't', S_IEXEC>>6, 'x', '-' };
 
 int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
 
-char *
-fmtmode(lp, flags)
-       char *lp;
-       int flags;
-{
+char *fmtmode(lp, flags) char *lp; int flags; {
        int **mp;
 
        for (mp = &m[0]; mp < &m[sizeof(m)/sizeof(m[0])]; ) {
@@ -602,9 +602,9 @@ fmtmode(lp, flags)
 
 /* rest should be done with nameserver or database */
 
-#include <pwd.h>
-#include <grp.h>
-#include <utmp.h>
+/*#include <pwd.h>*/
+/*#include <grp.h>*/
+/*#include <utmp.h>*/
 
 struct utmp utmp;
 #define        NMAX    (sizeof (utmp.ut_name))
@@ -624,9 +624,7 @@ char        groups[NGID][NMAX+1];
 char   outrangegroup[NMAX+1];
 int    outrangegid = -1;
 
-char *
-getname(uid)
-{
+char *getname(uid) int uid; {
        register struct passwd *pw;
        struct passwd *getpwent();
        extern int _pw_stayopen;
@@ -644,9 +642,7 @@ getname(uid)
        return (nc[cp].name);
 }
 
-char *
-getgroup(gid)
-{
+char *getgroup(gid) int gid; {
        register struct group *gr;
        static init;
        struct group *getgrent();
index 124f1b9..a002716 100644 (file)
@@ -1,19 +1,49 @@
-#ifndef lint
+#include <gen.h>
+#include <netdb.h>
+#include <netinet/in.h>
+/*#include <pwd.h> gen.h*/
+/*#include <setjmp.h> gen.h*/
+#include <stdio.h>
+#include <string.h>
+/*#include <strings.h> gen.h*/
+#include <sys.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/ioctl.h> sys.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+/*#include <sys/socket.h> sys.h*/
+/*#include <sys/stat.h> sys.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/wait.h> sys.h*/
+#include <sysexits.h>
+/*#include <time.h> gen.h*/
+/*#include <utmp.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[] = "@(#)mail.c     4.25 (Berkeley) 5/1/85";
 #endif
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/file.h>*/
 
-#include <ctype.h>
-#include <stdio.h>
-#include <pwd.h>
-#include <utmp.h>
-#include <signal.h>
-#include <setjmp.h>
-#include <sysexits.h>
-#include <varargs.h>
+/*#include <ctype.h>*/
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <utmp.h>*/
+/*#include <signal.h>*/
+/*#include <setjmp.h>*/
+/*#include <sysexits.h>*/
+/*#include <varargs.h>*/
 
 #define SENDMAIL       "/usr/lib/sendmail"
 
@@ -36,9 +66,9 @@ struct let {
 int    nlet    = 0;
 char   lfil[50];
 long   iop;
-long   time();
-char   *getenv();
-char   *index();
+/*long time();*/
+/*char *getenv();*/
+/*char *index();*/
 char   lettmp[] = "/tmp/maXXXXX";
 char   maildir[] = "/usr/spool/mail/";
 char   mailfile[] = "/usr/spool/mail/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
@@ -47,14 +77,14 @@ char        forwmsg[] = " forwarded\n";
 FILE   *tmpf;
 FILE   *malf;
 char   *my_name;
-char   *getlogin();
+/*char *getlogin();*/
 int    error;
 int    changed;
 int    forward;
 char   from[] = "From ";
-long   ftell();
-int    delex();
-char   *ctime();
+/*long ftell();*/
+/*int  delex();*/
+/*char *ctime();*/
 int    flgf;
 int    flgp;
 int    delflg = 1;
@@ -62,9 +92,35 @@ int  hseqno;
 jmp_buf        sjbuf;
 int    rmail;
 
-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 setsig __P((int i, int (*f)(void)));
+int any __P((register int c, register char *str));
+int printmail __P((int argc, char **argv));
+int copyback __P((void));
+int copymt __P((FILE *f1, FILE *f2));
+int copylet __P((int n, FILE *f, int type));
+int isfrom __P((register char *lp));
+int bulkmail __P((int argc, char **argv));
+int sendrmt __P((int n, char *name));
+int usage __P((void));
+int notifybiff __P((char *msg));
+int sendmail __P((int n, char *name, char *fromaddr));
+int delex __P((int i));
+int done __P((void));
+int cat __P((char *to, char *from1, char *from2));
+char *getarg __P((register char *s, register char *p));
+int safefile __P((char *f));
+int panic __P((char *msg, ...));
+
+int main(argc, argv) int argc; char **argv; {
        register i;
        struct passwd *pwent;
 
@@ -106,18 +162,12 @@ char **argv;
        done();
 }
 
-setsig(i, f)
-int i;
-int (*f)();
-{
+int setsig(i, f) int i; int (*f)(); {
        if (signal(i, SIG_IGN) != SIG_IGN)
                signal(i, f);
 }
 
-any(c, str)
-       register int c;
-       register char *str;
-{
+int any(c, str) register int c; register char *str; {
 
        while (*str)
                if (c == *str++)
@@ -125,9 +175,7 @@ any(c, str)
        return(0);
 }
 
-printmail(argc, argv)
-       char **argv;
-{
+int printmail(argc, argv) int argc; char **argv; {
        int flg, i, j, print;
        char *p, *getarg();
        struct stat statb;
@@ -312,8 +360,7 @@ printmail(argc, argv)
 }
 
 /* copy temp or whatever back to /usr/spool/mail */
-copyback()
-{
+int copyback() {
        register i, c;
        int fd, new = 0, oldmask;
        struct stat stbuf;
@@ -349,9 +396,7 @@ copyback()
 }
 
 /* copy mail (f1) to temp (f2) */
-copymt(f1, f2)
-       FILE *f1, *f2;
-{
+int copymt(f1, f2) FILE *f1; FILE *f2; {
        long nextadr;
 
        nlet = nextadr = 0;
@@ -365,9 +410,7 @@ copymt(f1, f2)
        let[nlet].adr = nextadr;        /* last plus 1 */
 }
 
-copylet(n, f, type)
-       FILE *f;
-{
+int copylet(n, f, type) int n; FILE *f; int type; {
        int ch;
        long k;
        char hostname[32];
@@ -406,9 +449,7 @@ copylet(n, f, type)
                putc(getc(tmpf), f);
 }
 
-isfrom(lp)
-register char *lp;
-{
+int isfrom(lp) register char *lp; {
        register char *p;
 
        for (p = from; *p; )
@@ -417,9 +458,7 @@ register char *lp;
        return(1);
 }
 
-bulkmail(argc, argv)
-char **argv;
-{
+int bulkmail(argc, argv) int argc; char **argv; {
        char truename[100];
        int first;
        register char *cp;
@@ -537,9 +576,7 @@ char **argv;
        fclose(tmpf);
 }
 
-sendrmt(n, name)
-char *name;
-{
+int sendrmt(n, name) int n; char *name; {
        FILE *rmf, *popen();
        register char *p;
        char rsys[64], cmd[64];
@@ -589,21 +626,18 @@ skip:
        exit(pclose(rmf) != 0);
 }
 
-usage()
-{
+int usage() {
 
        fprintf(stderr, "Usage: mail [ -f ] people . . .\n");
        error = EX_USAGE;
        done();
 }
 
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <netdb.h>*/
 
-notifybiff(msg)
-       char *msg;
-{
+int notifybiff(msg) char *msg; {
        static struct sockaddr_in addr;
        static int f = -1;
 
@@ -624,10 +658,7 @@ notifybiff(msg)
        }
 }
 
-sendmail(n, name, fromaddr)
-       int n;
-       char *name, *fromaddr;
-{
+int sendmail(n, name, fromaddr) int n; char *name; char *fromaddr; {
        char file[256];
        int mask, fd;
        struct passwd *pw;
@@ -671,8 +702,7 @@ sendmail(n, name, fromaddr)
        return(1);
 }
 
-delex(i)
-{
+int delex(i) int i; {
        setsig(i, delex);
        putc('\n', stderr);
        if (delflg)
@@ -680,16 +710,13 @@ delex(i)
        done();
 }
 
-done()
-{
+int done() {
 
        unlink(lettmp);
        exit(error);
 }
 
-cat(to, from1, from2)
-       char *to, *from1, *from2;
-{
+int cat(to, from1, from2) char *to; char *from1; char *from2; {
        register char *cp, *dp;
 
        cp = to;
@@ -700,10 +727,7 @@ cat(to, from1, from2)
 }
 
 /* copy p... into s, update p */
-char *
-getarg(s, p)
-       register char *s, *p;
-{
+char *getarg(s, p) register char *s; register char *p; {
        while (*p == ' ' || *p == '\t')
                p++;
        if (*p == '\n' || *p == '\0')
@@ -714,9 +738,7 @@ getarg(s, p)
        return(p);
 }
 
-safefile(f)
-       char *f;
-{
+int safefile(f) char *f; {
        struct stat statb;
 
        if (lstat(f, &statb) < 0)
@@ -730,14 +752,16 @@ safefile(f)
        return (1);
 }
 
-panic(msg, va_alist)
-       char *msg;
-       va_dcl
+#ifdef __STDC__
+int panic(char *msg, ...)
+#else
+int panic(msg, va_alist) char *msg; va_dcl
+#endif
 {
        va_list argp;
 
        fprintf(stderr, "mail: ");
-       va_start(argp);
+       _va_start(argp, fmt);
        vfprintf(stderr, msg, argp);
        va_end(argp);
        fprintf(stderr, "\n");
index cf6cf5b..564e2e2 100644 (file)
@@ -1,27 +1,29 @@
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/stat.h>
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)mkdir.c    5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
 /*
  * make directory
  */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
-main(argc, argv)
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        int errors = 0;
 
        if (argc < 2) {
index 4b862ac..532c3a0 100644 (file)
--- a/bin/mt.c
+++ b/bin/mt.c
@@ -1,28 +1,36 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/ioctl.h> sys/mtio.h*/
+#include <sys/mtio.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[] = "@(#)mt.c       5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
 /*
  * mt --
  *   magnetic tape manipulation program
  */
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-#include <sys/ioctl.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/mtio.h>*/
+/*#include <sys/ioctl.h>*/
 
 #define        equal(s1,s2)    (strcmp(s1, s2) == 0)
 
@@ -49,9 +57,19 @@ struct mtop mt_com;
 struct mtget mt_status;
 char *tape;
 
-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 status __P((register struct mtget *bp));
+int printreg __P((char *s, int v, register char *bits));
+
+int main(argc, argv) int argc; char **argv; {
        char line[80], *getenv();
        register char *cp;
        register struct commands *comp;
@@ -139,9 +157,7 @@ struct tape_desc {
 /*
  * Interpret the status buffer returned
  */
-status(bp)
-       register struct mtget *bp;
-{
+int status(bp) register struct mtget *bp; {
        register struct tape_desc *mt;
 
        for (mt = tapes; mt->t_type; mt++)
@@ -160,11 +176,7 @@ status(bp)
 /*
  * Print a register a la the %b format of the kernel's printf
  */
-printreg(s, v, bits)
-       char *s;
-       register char *bits;
-       register unsigned short v;
-{
+int printreg(s, v, bits) char *s; int v; register char *bits; {
        register int i, any = 0;
        register char c;
 
index b4829fb..b1d91a5 100644 (file)
--- a/bin/mv.c
+++ b/bin/mv.c
@@ -1,30 +1,46 @@
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> sys/file.h*/
+#include <sys/stat.h>
+#include <sys/time.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
+
 /*
  * 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[] = "@(#)mv.c       5.3 (Berkeley) 5/15/86";
-#endif not lint
+#endif
 
 /*
  * mv file1 file2
  */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/time.h>*/
 
-#include <stdio.h>
-#include <sys/dir.h>
-#include <errno.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <sys/dir.h>*/
+/*#include <errno.h>*/
+/*#include <signal.h>*/
 
 #define        DELIM   '/'
 #define MODEBITS 07777
@@ -35,15 +51,30 @@ static char sccsid[] = "@(#)mv.c    5.3 (Berkeley) 5/15/86";
 #define        ISDEV(st) \
        (((st).st_mode&S_IFMT) == S_IFCHR || ((st).st_mode&S_IFMT) == S_IFBLK)
 
-char   *dname();
+/*char *dname();*/
 struct stat s1, s2;
 int    iflag = 0;      /* interactive mode */
 int    fflag = 0;      /* force overwriting */
 extern int errno;
 
-main(argc, argv)
-       register char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, register char *argv[]));
+int movewithshortname __P((char *src, char *dest));
+int move __P((char *source, char *target));
+int query __P((char *prompt, ...));
+char *dname __P((register char *name));
+int error __P((char *fmt, ...));
+int Perror __P((char *s));
+int Perror2 __P((char *s1, char *s2));
+
+int main(argc, argv) int argc; register char *argv[]; {
        register i, r;
        register char *arg;
        char *dest;
@@ -94,9 +125,7 @@ usage:
        return (1);
 }
 
-movewithshortname(src, dest)
-       char *src, *dest;
-{
+int movewithshortname(src, dest) char *src; char *dest; {
        register char *shortname;
        char target[MAXPATHLEN + 1];
 
@@ -110,9 +139,7 @@ movewithshortname(src, dest)
        return (move(src, target));
 }
 
-move(source, target)
-       char *source, *target;
-{
+int move(source, target) char *source; char *target; {
        int targetexists;
 
        if (lstat(source, &s1) < 0) {
@@ -250,14 +277,16 @@ cleanup:
        return (0);
 }
 
-query(prompt, va_alist)
-       char *prompt;
-       va_dcl
+#ifdef __STDC__
+int query(char *prompt, ...)
+#else
+int query(prompt, va_alist) char *prompt; va_dcl
+#endif
 {
        va_list argp;
        register int i, c;
 
-       va_start(argp);
+       _va_start(argp, fmt);
        vfprintf(stderr, prompt, argp);
        va_end(argp);
        i = c = getchar();
@@ -266,10 +295,7 @@ query(prompt, va_alist)
        return (i == 'y');
 }
 
-char *
-dname(name)
-       register char *name;
-{
+char *dname(name) register char *name; {
        register char *p;
 
        p = name;
@@ -279,31 +305,29 @@ dname(name)
        return name;
 }
 
-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, "mv: ");
-       va_start(argp);
+       _va_start(argp, fmt);
        vfprintf(stderr, fmt, argp);
        va_end(argp);
        fprintf(stderr, "\n");
 }
 
-Perror(s)
-       char *s;
-{
+int Perror(s) char *s; {
        char buf[MAXPATHLEN + 10];
        
        sprintf(buf, "mv: %s", s);
        perror(buf);
 }
 
-Perror2(s1, s2)
-       char *s1, *s2;
-{
+int Perror2(s1, s2) char *s1; char *s2; {
        char buf[MAXPATHLEN + 20];
 
        sprintf(buf, "mv: %s: %s", s1, s2);
index f34b6a1..332c610 100644 (file)
@@ -1,28 +1,31 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/resource.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[] = "@(#)nice.c     5.2 (Berkeley) 1/12/86";
-#endif not lint
+#endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
 
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        int nicarg = 10;
 
        if (argc > 1 && argv[1][0] == '-') {
index 2d92722..a18db92 100644 (file)
--- a/bin/nm.c
+++ b/bin/nm.c
@@ -1,16 +1,27 @@
-#ifndef lint
+/*#include <a.out.h> gen.h*/
+#include <ar.h>
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stab.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/stat.h>
+/*#include <sys/types.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)nm.c 4.7 5/19/86";
 #endif
 /*
  * nm - print name list; VAX string table version
  */
-#include <sys/types.h>
-#include <ar.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <a.out.h>
-#include <stab.h>
-#include <sys/stat.h>
+/*#include <sys/types.h>*/
+/*#include <ar.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <a.out.h>*/
+/*#include <stab.h>*/
+/*#include <sys/stat.h>*/
 
 #define        SELECT  archive ? archdr.ar_name : *xargv
 
@@ -26,19 +37,33 @@ union {
 #define        OARMAG  0177545
 FILE   *fi;
 off_t  off;
-off_t  ftell();
-void   *malloc();
-char   *realloc();
+/*off_t        ftell();*/
+/*void *malloc();*/
+/*char *realloc();*/
 char   *strp;
-char   *stab();
+/*char *stab();*/
 off_t  strsiz;
-int    compare();
+/*int  compare();*/
 int    narg;
 int    errs;
 
-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 namelist __P((void));
+int psyms __P((register struct nlist *symp, int nsyms));
+int compare __P((struct nlist *p1, struct nlist *p2));
+int nextel __P((FILE *af));
+int error __P((int n, char *s));
+char *stab __P((int val));
+
+int main(argc, argv) int argc; char **argv; {
 
        if (--argc>0 && argv[1][0]=='-' && argv[1][1]!=0) {
                argv++;
@@ -85,8 +110,7 @@ char **argv;
        exit(errs);
 }
 
-namelist()
-{
+int namelist() {
        register int j;
 
        archive = 0;
@@ -190,10 +214,7 @@ out:
        fclose(fi);
 }
 
-psyms(symp, nsyms)
-       register struct nlist *symp;
-       int nsyms;
-{
+int psyms(symp, nsyms) register struct nlist *symp; int nsyms; {
        register int n, c;
 
        for (n=0; n<nsyms; n++) {
@@ -257,9 +278,7 @@ l1:         ;
        }
 }
 
-compare(p1, p2)
-struct nlist *p1, *p2;
-{
+int compare(p1, p2) struct nlist *p1; struct nlist *p2; {
        register i;
 
        if (nflg) {
@@ -271,9 +290,7 @@ struct nlist *p1, *p2;
        return (rflg * strcmp(p1->n_un.n_name, p2->n_un.n_name));
 }
 
-nextel(af)
-FILE *af;
-{
+int nextel(af) FILE *af; {
        register char *cp;
        register r;
        long arsize;
@@ -292,9 +309,7 @@ FILE *af;
        return(1);
 }
 
-error(n, s)
-char *s;
-{
+int error(n, s) int n; char *s; {
        fprintf(stderr, "nm: %s:", *xargv);
        if (archive) {
                fprintf(stderr, "(%s)", archdr.ar_name);
@@ -334,9 +349,7 @@ struct      stabnames {
        0, 0
 };
 
-char *
-stab(val)
-{
+char *stab(val) int val; {
        register struct stabnames *sp;
        static char prbuf[32];
 
index c803456..c93d985 100644 (file)
--- a/bin/od.c
+++ b/bin/od.c
@@ -1,4 +1,12 @@
+#include <stdio.h>
+#include <strings.h>
+#include <sys/errno.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)od.c        5.12 (Berkeley) 5/14/84";
+#endif
 /*
  * od -- octal, hex, decimal, character dump of data in a file.
  *
@@ -33,7 +41,7 @@ static char *sccsid = "@(#)od.c       5.12 (Berkeley) 5/14/84";
  * The default is octal. The same radix will be used to display the address.
  */
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 #define DBUF_SIZE      BUFSIZ
 #define BIG_DBUF       32
@@ -46,15 +54,15 @@ static char *sccsid = "@(#)od.c     5.12 (Berkeley) 5/14/84";
 #define PADDR          1
 #define MIN_SLEN       3
 
-int    a_put();
-int    b_put();
-int    c_put();
-int    s_put();
-int    us_put();
-int    l_put();
-int    f_put();
-int    d_put();
-int    st_put();
+/*int  a_put();*/
+/*int  b_put();*/
+/*int  c_put();*/
+/*int  s_put();*/
+/*int  us_put();*/
+/*int  l_put();*/
+/*int  f_put();*/
+/*int  d_put();*/
+/*int  st_put();*/
 
 struct dfmt {
        int     df_field;       /* external field required for object */
@@ -81,7 +89,6 @@ struct dfmt   flt     = {14, sizeof (float),  10,   SIGNED, PADDR,  f_put, 0};
 struct dfmt    dble    = {21, sizeof (double), 10,   SIGNED, PADDR,  d_put, 0};
 struct dfmt    string  = { 0,               0,  8,        0,    NO, st_put, 0};
 
-
 char   usage[] ="usage: od [-abcdfhilopswvx] [file] [[+]offset[.][b] [label]]";
 char   dbuf[DBUF_SIZE];
 char   lastdbuf[DBUF_SIZE];
@@ -91,11 +98,10 @@ long        label           = -1L;          /* current label; -1 is "off" */
 int    dbuf_size       = 16;           /* file bytes / display line */
 int    _parity         = NO;           /* show parity on ascii bytes */
 char   fmt[]   = "            %s";     /* 12 blanks */
-char   *icvt();
-char   *scvt();
-char   *underline();
-long   get_addr();
-
+/*char *icvt();*/
+/*char *scvt();*/
+/*char *underline();*/
+/*long get_addr();*/
 
 /*
  * special form of _ctype
@@ -147,11 +153,38 @@ char      _ctype[256] = {
 /* 370 */      0,      0,      0,      0,      0,      0,      0,      0,
 };
 
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
 
-main(argc, argv)
-int    argc;
-char   **argv;
-{
+int main __P((int argc, char **argv));
+int put_addr __P((long a, long l, int c));
+int line __P((int n));
+int s_put __P((short *n, struct dfmt *d));
+int us_put __P((unsigned short *n, struct dfmt *d));
+int l_put __P((long *n, struct dfmt *d));
+int d_put __P((double *f, struct dfmt *d));
+int f_put __P((float *f, struct dfmt *d));
+int a_put __P((char *cc, struct dfmt *d));
+int parity __P((int word));
+char *underline __P((char *s));
+int b_put __P((char *b, struct dfmt *d));
+int c_put __P((char *cc, struct dfmt *d));
+char *scvt __P((int c, struct dfmt *d));
+int st_put __P((char *cc, struct dfmt *d));
+int put_sbuf __P((int c, struct dfmt *d));
+int pr_sbuf __P((struct dfmt *d, int end));
+char *icvt __P((long value, int radix, int _signed, int ndigits));
+long get_addr __P((register char *s));
+int offset __P((long a));
+int dumbseek __P((FILE *s, long offset));
+int canseek __P((FILE *f));
+
+int main(argc, argv) int argc; char **argv; {
        register char *p;
        register char *l;
        register n, same;
@@ -164,15 +197,11 @@ char      **argv;
        argv++;
        argc--;
 
-       if(argc > 0)
-       {
+       if(argc > 0) {
                p = *argv;
-               if(*p == '-')
-               {
-                       while(*++p != '\0')
-                       {
-                               switch(*p)
-                               {
+               if(*p == '-') {
+                       while(*++p != '\0') {
+                               switch(*p) {
                                case 'a':
                                        d = &ascii;
                                        break;
@@ -266,8 +295,7 @@ char        **argv;
        /*
         * calculate display parameters
         */
-       for (cv = conv_vec; d = *cv; cv++)
-       {
+       for (cv = conv_vec; d = *cv; cv++) {
                nelm = (dbuf_size + d->df_size - 1) / d->df_size;
                llen = nelm * (d->df_field + 1);
                if (llen > max_llen)
@@ -277,10 +305,8 @@ char       **argv;
        /*
         * setup df_fmt to point to uniform output fields.
         */
-       for (cv = conv_vec; d = *cv; cv++)
-       {
-               if (d->df_field)        /* only if external field is known */
-               {
+       for (cv = conv_vec; d = *cv; cv++) {
+               if (d->df_field)        /* only if external field is known */ {
                        nelm = (dbuf_size + d->df_size - 1) / d->df_size;
                        field = max_llen / nelm;
                        d->df_fmt = fmt + 12 - (field - d->df_field);
@@ -290,10 +316,8 @@ char       **argv;
        /*
         * input file specified ?
         */
-       if(argc > 0 && **argv != '+')
-       {
-               if (freopen(*argv, "r", stdin) == NULL)
-               {
+       if(argc > 0 && **argv != '+') {
+               if (freopen(*argv, "r", stdin) == NULL) {
                        perror(*argv);
                        exit(1);
                }
@@ -304,8 +328,7 @@ char        **argv;
        /*
         * check for possible offset [label]
         */
-       if (argc > 0)
-       {
+       if (argc > 0) {
                addr = get_addr(*argv);
                offset(addr);
                argv++;
@@ -319,24 +342,19 @@ char      **argv;
         * main dump loop
         */
        same = -1;
-       while ((n = fread(dbuf, 1, dbuf_size, stdin)) > 0)
-       {
-               if (same>=0 && bcmp(dbuf, lastdbuf, dbuf_size) == 0 && !showall)
-               {
-                       if (same==0)
-                       {
+       while ((n = fread(dbuf, 1, dbuf_size, stdin)) > 0) {
+               if (same>=0 && bcmp(dbuf, lastdbuf, dbuf_size) == 0 && !showall) {
+                       if (same==0) {
                                printf("*\n");
                                same = 1;
                        }
                }
-               else
-               {
+               else {
                        line(n);
                        same = 0;
                        p = dbuf;
                        l = lastdbuf;
-                       for (nelm = 0; nelm < dbuf_size; nelm++)
-                       {
+                       for (nelm = 0; nelm < dbuf_size; nelm++) {
                                *l++ = *p;
                                *p++ = '\0';
                        }
@@ -350,10 +368,8 @@ char       **argv;
         * Some conversions require "flushing".
         */
        n = 0;
-       for (cv = conv_vec; *cv; cv++)
-       {
-               if ((*cv)->df_paddr)
-               {
+       for (cv = conv_vec; *cv; cv++) {
+               if ((*cv)->df_paddr) {
                        if (n++ == 0)
                                put_addr(addr, label, '\n');
                }
@@ -362,36 +378,26 @@ char      **argv;
        }
 }
 
-put_addr(a, l, c)
-long   a;
-long   l;
-char   c;
-{
+int put_addr(a, l, c) long a; long l; int c; {
        fputs(icvt(a, addr_base, UNSIGNED, 7), stdout);
        if (l >= 0)
                printf(" (%s)", icvt(l, addr_base, UNSIGNED, 7));
        putchar(c);
 }
 
-line(n)
-int    n;
-{
+int line(n) int n; {
        register i, first;
        register struct dfmt *c;
        register struct dfmt **cv = conv_vec;
 
        first = YES;
-       while (c = *cv++)
-       {
-               if (c->df_paddr)
-               {
-                       if (first)
-                       {
+       while (c = *cv++) {
+               if (c->df_paddr) {
+                       if (first) {
                                put_addr(addr, label, ' ');
                                first = NO;
                        }
-                       else
-                       {
+                       else {
                                putchar('\t');
                                if (label >= 0)
                                        fputs("\t  ", stdout);
@@ -405,34 +411,22 @@ int       n;
        }
 }
 
-s_put(n, d)
-short  *n;
-struct dfmt    *d;
-{
+int s_put(n, d) short *n; struct dfmt *d; {
        printf(d->df_fmt, icvt((long)*n, d->df_radix, d->df_signed, d->df_field));
        return(d->df_size);
 }
 
-us_put(n, d)
-unsigned short *n;
-struct dfmt    *d;
-{
+int us_put(n, d) unsigned short *n; struct dfmt *d; {
        printf(d->df_fmt, icvt((long)*n, d->df_radix, d->df_signed, d->df_field));
        return(d->df_size);
 }
 
-l_put(n, d)
-long   *n;
-struct dfmt    *d;
-{
+int l_put(n, d) long *n; struct dfmt *d; {
        printf(d->df_fmt, icvt(*n, d->df_radix, d->df_signed, d->df_field));
        return(d->df_size);
 }
 
-d_put(f, d)
-double *f;
-struct dfmt *d;
-{
+int d_put(f, d) double *f; struct dfmt *d; {
        char fbuf[24];
        struct l { long n[2]; };
 
@@ -448,10 +442,7 @@ struct dfmt *d;
        return(d->df_size);
 }
 
-f_put(f, d)
-float  *f;
-struct dfmt *d;
-{
+int f_put(f, d) float *f; struct dfmt *d; {
        char fbuf[16];
 
 #if    vax
@@ -464,7 +455,6 @@ struct dfmt *d;
        return(d->df_size);
 }
 
-
 char   asc_name[34][4] = {
 /* 000 */      "nul",  "soh",  "stx",  "etx",  "eot",  "enq",  "ack",  "bel",
 /* 010 */      " bs",  " ht",  " nl",  " vt",  " ff",  " cr",  " so",  " si",
@@ -473,25 +463,20 @@ char      asc_name[34][4] = {
 /* 040 */      " sp",  "del"
 };
 
-a_put(cc, d)
-char   *cc;
-struct dfmt *d;
-{
+int a_put(cc, d) char *cc; struct dfmt *d; {
        int c = *cc;
        register char *s = "   ";
        register pbit = parity((int)c & 0377);
 
        c &= 0177;
-       if (isgraphic(c))
-       {
+       if (isgraphic(c)) {
                s[2] = c;
                if (pbit == _parity)
                        printf(d->df_fmt, underline(s));
                else
                        printf(d->df_fmt, s);
        }
-       else
-       {
+       else {
                if (c == 0177)
                        c = ' ' + 1;
                if (pbit == _parity)
@@ -502,31 +487,23 @@ struct dfmt *d;
        return(1);
 }
 
-parity(word)
-int    word;
-{
+int parity(word) int word; {
        register int p = 0;
        register int w = word;
 
        if (w)
-               do
-               {
+               do {
                        p ^= 1;
                } while(w &= (~(-w)));
        return (p? ODD:EVEN);
 }
 
-char *
-underline(s)
-char   *s;
-{
+char *underline(s) char *s; {
        static char ulbuf[16];
        register char *u = ulbuf;
 
-       while (*s)
-       {
-               if (*s != ' ')
-               {
+       while (*s) {
+               if (*s != ' ') {
                        *u++ = '_';
                        *u++ = '\b';
                }
@@ -536,18 +513,12 @@ char      *s;
        return(ulbuf);
 }
 
-b_put(b, d)
-char   *b;
-struct dfmt *d;
-{
+int b_put(b, d) char *b; struct dfmt *d; {
        printf(d->df_fmt, icvt((long)*b & 0377, d->df_radix, d->df_signed, d->df_field));
        return(1);
 }
 
-c_put(cc, d)
-char   *cc;
-struct dfmt *d;
-{
+int c_put(cc, d) char *cc; struct dfmt *d; {
        register char   *s;
        register int    n;
        register int    c = *cc & 0377;
@@ -559,14 +530,10 @@ struct dfmt *d;
        return(1);
 }
 
-char *scvt(c, d)
-int    c;
-struct dfmt    *d;
-{
+char *scvt(c, d) int c; struct dfmt *d; {
        static char s[2];
 
-       switch(c)
-       {
+       switch(c) {
                case '\0':
                        return("\\0");
 
@@ -586,8 +553,7 @@ struct dfmt *d;
                        return("\\t");
 
                default:
-                       if (isprint(c))
-                       {
+                       if (isprint(c)) {
                                s[0] = c;
                                return(s);
                        }
@@ -613,34 +579,27 @@ static char       *str_ptr;
 static long    str_addr;
 static long    str_label;
 
-st_put(cc, d)
-char   *cc;
-struct dfmt    *d;
-{
+int st_put(cc, d) char *cc; struct dfmt *d; {
        register int    c;
 
-       if (cc == 0)
-       {
+       if (cc == 0) {
                pr_sbuf(d, YES);
                return(1);
        }
 
        c = (*cc & 0377);
 
-       if (str_mode & S_FILL)
-       {
+       if (str_mode & S_FILL) {
                if (isascii(c))
                        put_sbuf(c, d);
-               else
-               {
+               else {
                        *str_ptr = CNULL;
                        if (c == NULL)
                                pr_sbuf(d, YES);
                        str_mode = S_EMPTY;
                }
        }
-       else if (isascii(c))
-       {
+       else if (isascii(c)) {
                str_mode = S_FILL;
                str_addr = addr + (cc - dbuf);    /* ugly */
                if ((str_label = label) >= 0)
@@ -652,23 +611,16 @@ struct dfmt       *d;
        return(1);
 }
 
-put_sbuf(c, d)
-int    c;
-struct dfmt    *d;
-{
+int put_sbuf(c, d) int c; struct dfmt *d; {
        *str_ptr++ = c;
-       if (str_ptr >= (str_buf + SBUFSIZE))
-       {
+       if (str_ptr >= (str_buf + SBUFSIZE)) {
                pr_sbuf(d, NO);
                str_ptr = str_buf;
                str_mode |= S_CONT;
        }
 }
 
-pr_sbuf(d, end)
-struct dfmt    *d;
-int    end;
-{
+int pr_sbuf(d, end) struct dfmt *d; int end; {
        register char   *p = str_buf;
 
        if (str_mode == S_EMPTY
@@ -696,13 +648,7 @@ static char        _digit[] = "0123456789abcdef";
 static char    _icv_buf[MAXINTLENGTH+1];
 static long    _mask = 0x7fffffff;
 
-char *
-icvt (value, radix, _signed, ndigits)
-long   value;
-int    radix;
-int    _signed;
-int    ndigits;
-{
+char *icvt(value, radix, _signed, ndigits) long value; int radix; int _signed; int ndigits; {
        register long   val = value;
        register long   rad = radix;
        register char   *b = &_icv_buf[MAXINTLENGTH];
@@ -713,15 +659,13 @@ int       ndigits;
        long    kludge;
        int     sign;
 
-       if (val == 0)
-       {
+       if (val == 0) {
                *--b = '0';
                sign = 0;
                goto done; /*return(b);*/
        }
 
-       if (_signed && (sign = (val < 0)))      /* signed conversion */
-       {
+       if (_signed && (sign = (val < 0)))      /* signed conversion */ {
                /*
                 * It is necessary to do the first divide
                 * before the absolute value, for the case -2^31
@@ -736,8 +680,7 @@ int ndigits;
                *--b = d[(tmp1 * rad) - val];
                val = -tmp1;
        }
-       else                            /* unsigned conversion */
-       {
+       else                            /* unsigned conversion */ {
                sign = 0;
                if (val < 0)
                {       /* ALL THIS IS TO SIMULATE UNSIGNED LONG MOD & DIV */
@@ -759,8 +702,7 @@ int ndigits;
                }
        }
 
-       while (val)
-       {
+       while (val) {
                /*
                 * This is really what's being done ...
                 * *--b = d[val % rad];
@@ -777,8 +719,7 @@ done:
 
        tmp1 = ndigits - (&_icv_buf[MAXINTLENGTH] - b);
        tmp2 = _signed? ' ':'0';
-       while (tmp1 > 0)
-       {
+       while (tmp1 > 0) {
                *--b = tmp2;
                tmp1--;
        }
@@ -786,35 +727,29 @@ done:
        return(b);
 }
 
-long get_addr(s)
-register char *s;
-{
+long get_addr(s) register char *s; {
        register char *p;
        register long a;
        register int d;
 
        if (*s=='+')
                s++;
-       if (*s=='x')
-       {
+       if (*s=='x') {
                s++;
                addr_base = 16;
        }
-       else if (*s=='0' && s[1]=='x')
-       {
+       else if (*s=='0' && s[1]=='x') {
                s += 2;
                addr_base = 16;
        }
        else if (*s == '0')
                addr_base = 8;
        p = s;
-       while(*p)
-       {
+       while(*p) {
                if (*p++=='.')
                        addr_base = 10;
        }
-       for (a=0; *s; s++)
-       {
+       for (a=0; *s; s++) {
                d = *s;
                if(isdigit(d))
                        a = a*addr_base + d - '0';
@@ -834,11 +769,8 @@ register char *s;
        return(a);
 }
 
-offset(a)
-long   a;
-{
-       if (canseek(stdin))
-       {
+int offset(a) long a; {
+       if (canseek(stdin)) {
                /*
                 * in case we're accessing a raw disk,
                 * we have to seek in multiples of a physical block.
@@ -849,19 +781,14 @@ long      a;
        dumbseek(stdin, a);
 }
 
-dumbseek(s, offset)
-FILE   *s;
-long   offset;
-{
+int dumbseek(s, offset) FILE *s; long offset; {
        char    buf[BUFSIZ];
        int     n;
        int     nr;
 
-       while (offset > 0)
-       {
+       while (offset > 0) {
                nr = (offset > BUFSIZ) ? BUFSIZ : (int)offset;
-               if ((n = fread(buf, 1, nr, s)) != nr)
-               {
+               if ((n = fread(buf, 1, nr, s)) != nr) {
                        fprintf(stderr, "EOF\n");
                        exit(1);
                }
@@ -869,12 +796,10 @@ long      offset;
        }
 }
 
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <sys/types.h> stdio.h*/
+/*#include <sys/stat.h>*/
 
-canseek(f)
-FILE   *f;
-{
+int canseek(f) FILE *f; {
        struct stat statb;
 
        return( (fstat(fileno(f),&statb)==0) &&
index f4105d7..fdfe5ef 100644 (file)
@@ -1,21 +1,23 @@
+#include <stdio.h>
+#include <sys.h>
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)pagesize.c 5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
-main()
-{
+int main() {
 
        printf("%d\n", getpagesize());
 }
index 5a87b2f..7c55c9d 100644 (file)
@@ -1,18 +1,33 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+/*#include <ndbm.h> gen.h*/
+/*#include <pwd.h> gen.h*/
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/proc.h> gen.h*/
+#include <sys/resource.h>
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <utmp.h> gen.h*/
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)passwd.c   4.24 (Berkeley) 5/28/86";
-#endif not lint
+#endif
 
 /*
  * Modify a field in the password file (either
@@ -20,18 +35,18 @@ static char sccsid[] = "@(#)passwd.c        4.24 (Berkeley) 5/28/86";
  * This program should be suid with an owner
  * with write permission on /etc/passwd.
  */
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-#include <stdio.h>
-#include <signal.h>
-#include <pwd.h>
-#include <ndbm.h>
-#include <errno.h>
-#include <strings.h>
-#include <ctype.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <pwd.h>*/
+/*#include <ndbm.h>*/
+/*#include <errno.h>*/
+/*#include <strings.h>*/
+/*#include <ctype.h>*/
 
 /*
  * This should be the first thing returned from a getloginshells()
@@ -41,18 +56,37 @@ static char sccsid[] = "@(#)passwd.c        4.24 (Berkeley) 5/28/86";
 
 char   temp[] = "/etc/ptmp";
 char   passwd[] = "/etc/passwd";
-char   *getpass();
-char   *getlogin();
-char   *getfingerinfo();
-char   *getloginshell();
-char   *getnewpasswd();
-void   *malloc();
-char   *getusershell();
+/*char *getpass();*/
+/*char *getlogin();*/
+/*char *getfingerinfo();*/
+/*char *getloginshell();*/
+/*char *getnewpasswd();*/
+/*void *malloc();*/
+/*char *getusershell();*/
 extern int errno;
 
-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 unlimit __P((int lim));
+int replace __P((DBM *dp, struct passwd *pwd));
+char *getnewpasswd __P((register struct passwd *pwd, int u));
+char *getloginshell __P((struct passwd *pwd, int u, char *arg));
+char *getfingerinfo __P((struct passwd *pwd));
+int illegal_input __P((char *input_str));
+int remove_hyphens __P((char *str));
+int not_all_digits __P((char *str));
+int illegal_building __P((register char *str));
+struct default_values *get_defaults __P((char *str));
+int special_case __P((char *str, char *default_str));
+
+int main(argc, argv) int argc; char *argv[]; {
        struct passwd *pwd;
        char *cp, *uname, *progname;
        int fd, u, dochfn, dochsh, err;
@@ -207,8 +241,7 @@ main(argc, argv)
        exit(0);
 }
 
-unlimit(lim)
-{
+int unlimit(lim) int lim; {
        struct rlimit rlim;
 
        rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
@@ -218,10 +251,7 @@ unlimit(lim)
 /*
  * Replace the password entry in the dbm data base with pwd.
  */
-replace(dp, pwd)
-       DBM *dp;
-       struct passwd *pwd;
-{
+int replace(dp, pwd) DBM *dp; struct passwd *pwd; {
        datum key, content;
        register char *cp, *tp;
        char buf[BUFSIZ];
@@ -253,11 +283,7 @@ replace(dp, pwd)
        dbm_store(dp, key, content, DBM_REPLACE);
 }
 
-char *
-getnewpasswd(pwd, u)
-       register struct passwd *pwd;
-       int u;
-{
+char *getnewpasswd(pwd, u) register struct passwd *pwd; int u; {
        char saltc[2];
        long salt;
        int i, insist = 0, ok, flags;
@@ -332,12 +358,7 @@ tryagain:
        return (crypt(pwbuf, saltc));
 }
 
-char *
-getloginshell(pwd, u, arg)
-       struct passwd *pwd;
-       int u;
-       char *arg;
-{
+char *getloginshell(pwd, u, arg) struct passwd *pwd; int u; char *arg; {
        static char newshell[BUFSIZ];
        char *cp, *valid, *getusershell();
 
@@ -411,10 +432,7 @@ struct default_values {
 /*
  * Get name, room number, school phone, and home phone.
  */
-char *
-getfingerinfo(pwd)
-       struct passwd *pwd;
-{
+char *getfingerinfo(pwd) struct passwd *pwd; {
        char in_str[BUFSIZ];
        struct default_values *defaults, *get_defaults();
        static char answer[4*BUFSIZ];
@@ -487,9 +505,7 @@ getfingerinfo(pwd)
  *
  * Returns '1' if a colon or newline is found or the input line is too long.
  */
-illegal_input(input_str)
-       char *input_str;
-{
+int illegal_input(input_str) char *input_str; {
        char *ptr;
        int error_flag = 0;
        int length = strlen(input_str);
@@ -527,9 +543,7 @@ illegal_input(input_str)
 /*
  * Removes '-'s from the input string.
  */
-remove_hyphens(str)
-       char *str;
-{
+int remove_hyphens(str) char *str; {
        char *hyphen;
 
        while ((hyphen = index(str, '-')) != NULL)
@@ -540,9 +554,7 @@ remove_hyphens(str)
  *  Checks to see if 'str' contains only digits (0-9).  If not, then
  *  an error message is printed and '1' is returned.
  */
-not_all_digits(str)
-       char *str;
-{
+int not_all_digits(str) char *str; {
        char *ptr;
 
        for (ptr = str; *ptr != '\0'; ++ptr)
@@ -561,9 +573,7 @@ not_all_digits(str)
  * 
  * Note: this function assumes that the newline has been removed from str.
  */
-illegal_building(str)
-       register char *str;
-{
+int illegal_building(str) register char *str; {
        int length = strlen(str);
        register char *ptr;
 
@@ -598,10 +608,7 @@ illegal_building(str)
  * "str" contains up to 4 fields separated by commas.
  * Any field that is missing is set to blank.
  */
-struct default_values *
-get_defaults(str)
-       char *str;
-{
+struct default_values *get_defaults(str) char *str; {
        struct default_values *answer;
 
        answer = (struct default_values *)
@@ -642,9 +649,7 @@ get_defaults(str)
  *  either upper or lower case (or any combination).  'str' is modified
  *  in these two cases.
  */
-special_case(str,default_str)
-       char *str, *default_str;
-{
+int special_case(str, default_str) char *str; char *default_str; {
        static char word[] = "none\n";
        char *ptr, *wordptr;
 
index ef441dd..d6c7b4d 100644 (file)
--- a/bin/pr.c
+++ b/bin/pr.c
@@ -1,14 +1,26 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <time.h> gen.h*/
+/*#include <utmp.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)pr.c        4.5 (Berkeley) 12/12/84";
+#endif
 
 /*
  *   print file with headings
  *  2+head+2+page[56]+5
  */
 
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 
 /* Making putcp a macro sped things up by 14%. */
 #define putcp(c)  if (page >= fpage) putchar(c)
@@ -44,12 +56,31 @@ int mflg;
 int    tabc;
 char   *tty;
 int    mode;
-char   *ttyname();
-char   *ctime();
-
-main(argc, argv)
-char **argv;
-{
+/*char *ttyname();*/
+/*char *ctime();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int done __P((void));
+int numeric __P((char *str));
+int onintr __P((void));
+int fixtty __P((void));
+int print __P((char *fp, char **argp));
+int mopen __P((char **ap));
+int putpage __P((void));
+int nexbuf __P((void));
+int tpgetc __P((int ai));
+int pgetc __P((int i));
+int put __P((int ac));
+
+int main(argc, argv) int argc; char **argv; {
        int nfdone;
        int onintr();
 
@@ -123,8 +154,7 @@ char **argv;
        done();
 }
 
-done()
-{
+int done() {
 
        if (tty)
                chmod(tty, mode);
@@ -132,9 +162,7 @@ done()
 }
 
 /* numeric -- returns 1 if str is numeric, elsewise 0 */
-numeric(str)
-       char    *str;
-{
+int numeric(str) char *str; {
        for (; *str ; str++) {
                if (*str > '9' || *str < '0') {
                        return(0);
@@ -143,16 +171,14 @@ numeric(str)
        return(1);
 }
 
-onintr()
-{
+int onintr() {
 
        if (tty)
                chmod(tty, mode);
        _exit(1);
 }
 
-fixtty()
-{
+int fixtty() {
        struct stat sbuf;
 
        tty = ttyname(1);
@@ -164,10 +190,7 @@ fixtty()
 }
 
 /* print -- print file */
-print(fp, argp)
-char *fp;
-char **argp;
-{
+int print(fp, argp) char *fp; char **argp; {
        struct stat sbuf;
        register sncol;
        register char *sheader;
@@ -257,9 +280,7 @@ char **argp;
        header = sheader;
 }
 
-mopen(ap)
-char **ap;
-{
+int mopen(ap) char **ap; {
        register char **p, *p1;
 
        p = ap;
@@ -277,8 +298,7 @@ char **ap;
        }
 }
 
-putpage()
-{
+int putpage() {
        register int lastcol, i, c;
        int j;
 
@@ -322,8 +342,7 @@ putpage()
        }
 }
 
-nexbuf()
-{
+int nexbuf() {
        register int n;
        register char *rbufp;
 
@@ -344,8 +363,7 @@ nexbuf()
        bufp = rbufp;
 }
 
-tpgetc(ai)
-{
+int tpgetc(ai) int ai; {
        register char **p;
        register int c, i;
 
@@ -379,8 +397,7 @@ loop:
        return(c);
 }
 
-pgetc(i)
-{
+int pgetc(i) int i; {
        register int c;
 
        if (peekc) {
@@ -411,8 +428,7 @@ pgetc(i)
                icol++;
        return(c);
 }
-put(ac)
-{
+int put(ac) int ac; {
        register int ns, c;
 
        c = ac;
index 09f12ab..2460556 100644 (file)
--- a/bin/ps.c
+++ b/bin/ps.c
@@ -1,36 +1,61 @@
+/*#include <a.out.h> gen.h*/
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+/*#include <pwd.h> gen.h*/
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+/*#include <sys/dmap.h> sys/user.h*/
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/resource.h> sys/user.h*/
+#include <sys/stat.h>
+#include <sys/text.h>
+/*#include <sys/types.h> gen.h*/
+#include <sys/user.h>
+#include <sys/vmmac.h>
+/*#include <utmp.h> gen.h*/
+/*#include <vax/machparam.h> gen.h*/
+/*#include <vax/pte.h> gen.h*/
+/*#include <vax/vmparam.h> sys/vmmac.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[] = "@(#)ps.c       5.9 (Berkeley) 5/8/86";
-#endif not lint
+#endif
 
-#include <stdio.h>
-#include <ctype.h>
-#include <a.out.h>
-#include <pwd.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/tty.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <machine/pte.h>
-#include <sys/vm.h>
-#include <sys/text.h>
-#include <sys/stat.h>
-#include <sys/mbuf.h>
-#include <math.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <a.out.h>*/
+/*#include <pwd.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/ioctl.h>*/
+/*#include <sys/tty.h>*/
+/*#include <sys/dir.h>*/
+/*#include <sys/user.h>*/
+/*#include <sys/proc.h>*/
+/*#include <machine/pte.h>*/
+/*#include <sys/vm.h>*/
+/*#include <sys/text.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/mbuf.h>*/
+/*#include <math.h>*/
+/*#include <errno.h>*/
 
 char *nl_names[] = {
        "_proc",
@@ -161,19 +186,19 @@ int       aflg, cflg, eflg, gflg, kflg, lflg, nflg, sflg,
        uflg, vflg, xflg, Uflg;
 int    nchans;                         /* total # of wait channels */
 char   *tptr;
-char   *gettty(), *getcmd(), *getname(), *savestr(), *state();
-char   *rindex();
-void   *calloc(), *sbrk();
-char   *strcpy(), *strcat(), *strncat();
-char   *strncpy(), *index(), *ttyname();
+/*char *gettty(), *getcmd(), *getname(), *savestr(), *state();*/
+/*char *rindex();*/
+/*void *calloc(), *sbrk();*/
+/*char *strcpy(), *strcat(), *strncat();*/
+/*char *strncpy(), *index(), *ttyname();*/
 char   mytty[MAXPATHLEN+1];
-void   *malloc();
-char   *getchan();
-long   lseek();
-off_t  vtophys();
-double pcpu(), pmem();
-int    wchancomp();
-int    pscomp();
+/*void *malloc();*/
+/*char *getchan();*/
+/*long lseek();*/
+/*off_t        vtophys();*/
+/*double       pcpu(), pmem();*/
+/*int  wchancomp();*/
+/*int  pscomp();*/
 int    nswap, maxslp;
 struct text *atext;
 double ccpu;
@@ -243,9 +268,54 @@ int        argaddr;
 
 #define        pgtok(a)        ((a)/(1024/NBPG))
 
-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 _getw __P((unsigned long loc));
+int klseek __P((int fd, long loc, int off));
+int writepsdb __P((char *unixname));
+int readpsdb __P((char *unixname));
+int openfiles __P((int argc, char **argv));
+int getkvars __P((int argc, char **argv));
+int getvchans __P((void));
+int printhdr __P((void));
+int cantread __P((char *what, char *fromwhat));
+int getdev __P((void));
+int maybetty __P((void));
+char *gettty __P((void));
+int save __P((void));
+double pmem __P((register struct asav *ap));
+double pcpu __P((void));
+int getu __P((void));
+char *getcmd __P((void));
+int lpr __P((struct savcom *sp));
+int ptty __P((char *tp));
+int ptime __P((struct asav *ap));
+int upr __P((struct savcom *sp));
+int vpr __P((struct savcom *sp));
+int spr __P((struct savcom *sp));
+char *state __P((register struct asav *ap));
+int vstodb __P((register int vsbase, int vssize, struct dmap *dmp, register struct dblock *dbp, int rev));
+int panic __P((char *cp));
+int min __P((int a, int b));
+int pscomp __P((struct savcom *s1, struct savcom *s2));
+int vsize __P((struct savcom *sp));
+char *getname __P((int uid));
+char *savestr __P((char *cp));
+off_t vtophys __P((long loc));
+int init_nlist __P((void));
+int nlist __P((char *name, struct nlist *list));
+int addchan __P((char *name, caddr_t caddr));
+char *getchan __P((register caddr_t chan));
+int wchancomp __P((struct wchan *w1, struct wchan *w2));
+
+int main(argc, argv) int argc; char **argv; {
        register int i, j;
        register char *ap;
        int uid;
@@ -410,9 +480,7 @@ main(argc, argv)
        exit(npr == 0);
 }
 
-_getw(loc)
-       unsigned long loc;
-{
+int _getw(loc) unsigned long loc; {
        int word;
 
        klseek(kmem, (long)loc, 0);
@@ -421,11 +489,7 @@ _getw(loc)
        return (word);
 }
 
-klseek(fd, loc, off)
-       int fd;
-       long loc;
-       int off;
-{
+int klseek(fd, loc, off) int fd; long loc; int off; {
        if (kflg) {
                if ((loc = vtophys(loc)) == -1)
                        return;
@@ -438,9 +502,7 @@ klseek(fd, loc, off)
  */
 char thisversion[4] = "V2";            /* length must remain 4 */
 
-writepsdb(unixname)
-       char *unixname;
-{
+int writepsdb(unixname) char *unixname; {
        register FILE *fp;
        struct lttys *lt;
        struct stat stb;
@@ -471,9 +533,7 @@ writepsdb(unixname)
        fclose(fp);
 }
 
-readpsdb(unixname)
-       char *unixname;
-{
+int readpsdb(unixname) char *unixname; {
        register i;
        register FILE *fp;
        char unamebuf[BUFSIZ];
@@ -534,9 +594,7 @@ bad:
        return(0);
 }
 
-openfiles(argc, argv)
-       char **argv;
-{
+int openfiles(argc, argv) int argc; char **argv; {
 
        kmemf = "/dev/kmem";
        if (kflg)
@@ -567,9 +625,7 @@ openfiles(argc, argv)
        }
 }
 
-getkvars(argc, argv)
-       char **argv;
-{
+int getkvars(argc, argv) int argc; char **argv; {
        int faildb = 0;                 /* true if psdatabase init failed */
        int i;
 
@@ -658,8 +714,7 @@ getkvars(argc, argv)
 /*
  * get the valloc'ed kernel variables for symbolic wait channels
  */
-getvchans()
-{
+int getvchans() {
        int i, tmp;
 
        if (nflg)
@@ -692,8 +747,7 @@ getvchans()
        }
 #undef addv
 }
-printhdr()
-{
+int printhdr() {
        char *hdr;
 
        if (sflg+lflg+vflg+uflg > 1) {
@@ -730,9 +784,7 @@ printhdr()
        (void) fflush(stdout);
 }
 
-cantread(what, fromwhat)
-       char *what, *fromwhat;
-{
+int cantread(what, fromwhat) char *what; char *fromwhat; {
 
        fprintf(stderr, "ps: error reading %s from %s\n", what, fromwhat);
 }
@@ -740,8 +792,7 @@ cantread(what, fromwhat)
 struct direct *dbuf;
 int    dialbase;
 
-getdev()
-{
+int getdev() {
        register DIR *df;
        struct ttys *t;
        struct lttys *lt;
@@ -773,8 +824,7 @@ getdev()
  * know that r(hp|up|mt) are unlikely as are different mem's,
  * floppy, null, tty, etc.
  */
-maybetty()
-{
+int maybetty() {
        register char *cp = dbuf->d_name;
        static struct lttys *dp;
        struct lttys *olddp;
@@ -903,9 +953,7 @@ donecand:
        cand[x] = nttys-1;
 }
 
-char *
-gettty()
-{
+char *gettty() {
        register char *p;
        register struct ttys *dp;
        struct stat stb;
@@ -946,8 +994,7 @@ found:
        return (p);
 }
 
-save()
-{
+int save() {
        register struct savcom *sp;
        register struct asav *ap;
        register char *cp;
@@ -1029,10 +1076,7 @@ save()
        npr++;
 }
 
-double
-pmem(ap)
-       register struct asav *ap;
-{
+double pmem(ap) register struct asav *ap; {
        double fracmem;
        int szptudot;
 
@@ -1048,9 +1092,7 @@ pmem(ap)
        return (100.0 * fracmem);
 }
 
-double
-pcpu()
-{
+double pcpu() {
        time_t time;
 
        time = mproc->p_time;
@@ -1061,8 +1103,7 @@ pcpu()
        return (100.0 * mproc->p_pctcpu / (1.0 - exp(time * log(ccpu))));
 }
 
-getu()
-{
+int getu() {
        struct pte *pteaddr, apte;
        struct pte arguutl[UPAGES+CLSIZE];
        register int i;
@@ -1115,9 +1156,7 @@ getu()
        return (1);
 }
 
-char *
-getcmd()
-{
+char *getcmd() {
        char cmdbuf[CLSIZE*NBPG];
        union {
                char    argc[CLSIZE*NBPG];
@@ -1201,9 +1240,7 @@ retucomm:
 
 char   *lhdr =
 "      F UID   PID  PPID CP PRI NI ADDR  SZ  RSS %*s STAT TT  TIME";
-lpr(sp)
-       struct savcom *sp;
-{
+int lpr(sp) struct savcom *sp; {
        register struct asav *ap = sp->ap;
        register struct lsav *lp = sp->s_un.lp;
 
@@ -1222,25 +1259,19 @@ lpr(sp)
        ptime(ap);
 }
 
-ptty(tp)
-       char *tp;
-{
+int ptty(tp) char *tp; {
 
        printf("%-2.2s", tp);
 }
 
-ptime(ap)
-       struct asav *ap;
-{
+int ptime(ap) struct asav *ap; {
 
        printf("%3ld:%02ld", ap->a_cpu / 60, ap->a_cpu % 60);
 }
 
 char   *uhdr =
 "%s   PID %%CPU %%MEM   SZ  RSS TT STAT  TIME";
-upr(sp)
-       struct savcom *sp;
-{
+int upr(sp) struct savcom *sp; {
        register struct asav *ap = sp->ap;
        int vmsize, rmsize;
 
@@ -1262,9 +1293,7 @@ upr(sp)
 
 char *vhdr =
 " SIZE  PID TT STAT  TIME SL RE PAGEIN SIZE  RSS   LIM TSIZ TRS %CPU %MEM"+5;
-vpr(sp)
-       struct savcom *sp;
-{
+int vpr(sp) struct savcom *sp; {
        register struct vsav *vp = sp->s_un.vp;
        register struct asav *ap = sp->ap;
 
@@ -1286,9 +1315,7 @@ vpr(sp)
 
 char   *shdr =
 "SSIZ   PID TT STAT  TIME";
-spr(sp)
-       struct savcom *sp;
-{
+int spr(sp) struct savcom *sp; {
        register struct asav *ap = sp->ap;
 
        if (sflg)
@@ -1300,10 +1327,7 @@ spr(sp)
        ptime(ap);
 }
 
-char *
-state(ap)
-       register struct asav *ap;
-{
+char *state(ap) register struct asav *ap; {
        char stat, load, nice, anom;
        static char res[5];
 
@@ -1355,12 +1379,7 @@ state(ap)
  * return a physical base/size pair which is the
  * (largest) initial, physically contiguous block.
  */
-vstodb(vsbase, vssize, dmp, dbp, rev)
-       register int vsbase;
-       int vssize;
-       struct dmap *dmp;
-       register struct dblock *dbp;
-{
+int vstodb(vsbase, vssize, dmp, dbp, rev) register int vsbase; int vssize; struct dmap *dmp; register struct dblock *dbp; int rev; {
        register int blk = dmmin;
        register swblk_t *ip = dmp->dm_map;
 
@@ -1381,24 +1400,19 @@ vstodb(vsbase, vssize, dmp, dbp, rev)
 }
 
 /*ARGSUSED*/
-panic(cp)
-       char *cp;
-{
+int panic(cp) char *cp; {
 
 #ifdef DEBUG
        printf("%s\n", cp);
 #endif
 }
 
-min(a, b)
-{
+int min(a, b) int a; int b; {
 
        return (a < b ? a : b);
 }
 
-pscomp(s1, s2)
-       struct savcom *s1, *s2;
-{
+int pscomp(s1, s2) struct savcom *s1; struct savcom *s2; {
        register int i;
 
        if (uflg)
@@ -1411,9 +1425,7 @@ pscomp(s1, s2)
        return (i);
 }
 
-vsize(sp)
-       struct savcom *sp;
-{
+int vsize(sp) struct savcom *sp; {
        register struct asav *ap = sp->ap;
        register struct vsav *vp = sp->s_un.vp;
        
@@ -1423,7 +1435,7 @@ vsize(sp)
        return (vp->v_swrss + (ap->a_xccount ? 0 : vp->v_txtswrss));
 }
 
-#include <utmp.h>
+/*#include <utmp.h>*/
 
 struct utmp utmp;
 #define        NMAX    (sizeof (utmp.ut_name))
@@ -1440,9 +1452,7 @@ struct ncache {
  * This function assumes that the password file is hashed
  * (or some such) to allow fast access based on a uid key.
  */
-char *
-getname(uid)
-{
+char *getname(uid) int uid; {
        register struct passwd *pw;
        struct passwd *getpwent();
        register int cp;
@@ -1465,10 +1475,7 @@ getname(uid)
        return (nc[cp].name);
 }
 
-char *
-savestr(cp)
-       char *cp;
-{
+char *savestr(cp) char *cp; {
        register unsigned len;
        register char *dp;
 
@@ -1482,10 +1489,7 @@ savestr(cp)
  * This routine was stolen from adb to simulate memory management
  * on the VAX.
  */
-off_t
-vtophys(loc)
-long   loc;
-{
+off_t vtophys(loc) long loc; {
        register        p;
        off_t   newloc;
 
@@ -1514,8 +1518,7 @@ long      loc;
  * of nlist.h (required since nlist() uses some defines) is to do a
  * runtime copy into the nl array -- sigh
  */
-init_nlist()
-{
+int init_nlist() {
        register struct nlist *np;
        register char **namep;
 
@@ -1539,10 +1542,7 @@ init_nlist()
  * nlist - retreive attributes from name list (string table version)
  *     modified to add wait channels - Charles R. LaBrec 8/85
  */
-nlist(name, list)
-       char *name;
-       struct nlist *list;
-{
+int nlist(name, list) char *name; struct nlist *list; {
        register struct nlist *p, *q;
        register char *s1, *s2;
        register n, m;
@@ -1631,10 +1631,7 @@ alldone:
 /*
  * add the given channel to the channel list
  */
-addchan(name, caddr)
-char *name;
-caddr_t caddr;
-{
+int addchan(name, caddr) char *name; caddr_t caddr; {
        static int left = 0;
        register struct wchan *wp;
        register char **p;
@@ -1671,10 +1668,7 @@ caddr_t caddr;
 /*
  * returns the symbolic wait channel corresponding to chan
  */
-char *
-getchan(chan)
-register caddr_t chan;
-{
+char *getchan(chan) register caddr_t chan; {
        register i, iend;
        register char *prevsym;
        register struct wchan *wp;
@@ -1704,10 +1698,7 @@ register caddr_t chan;
 /*
  * used in sorting the wait channel array
  */
-int
-wchancomp (w1, w2)
-struct wchan *w1, *w2;
-{
+int wchancomp(w1, w2) struct wchan *w1; struct wchan *w2; {
        register unsigned c1, c2;
 
        c1 = (unsigned) w1->wc_caddr;
index 44008c2..52f8028 100644 (file)
--- a/bin/pwd.c
+++ b/bin/pwd.c
@@ -1,29 +1,32 @@
+#include <stdio.h>
+#include <sys/dir.h>
+/*#include <sys/param.h> sys/dir.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[] = "@(#)pwd.c      5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
 /*
  * Print working (current) directory
  */
-#include <stdio.h>
-#include <sys/param.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
 
-char *getwd();
+/*char *getwd();*/
 
-main()
-{
+int main() {
        char pathname[MAXPATHLEN + 1];
 
        if (getwd(pathname) == NULL) {
index 2c27359..db32d24 100644 (file)
--- a/bin/rcp.c
+++ b/bin/rcp.c
@@ -1,50 +1,77 @@
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <net.h>
+/*#include <netdb.h> net.h*/
+/*#include <pwd.h> gen.h*/
+/*#include <stdio.h> net.h*/
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+#include <sys/fs.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+#include <sys/wait.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
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)rcp.c      5.4 (Berkeley) 9/12/85";
-#endif not lint
+#endif
 
 /*
  * rcp
  */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/ioctl.h>*/
 
-#include <netinet/in.h>
+/*#include <netinet/in.h>*/
 
-#include <stdio.h>
-#include <signal.h>
-#include <pwd.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <errno.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <pwd.h>*/
+/*#include <ctype.h>*/
+/*#include <netdb.h>*/
+/*#include <errno.h>*/
+/*#include <varargs.h>*/
 
 int    rem;
-char   *colon(), *index(), *rindex();
-void   *malloc();
-char   *strcpy();
+/*char *colon(), *index(), *rindex();*/
+/*void *malloc();*/
+/*char *strcpy();*/
 int    errs;
-int    lostconn();
+/*int  lostconn();*/
 int    errno;
 char   *sys_errlist[];
 int    iamremote, targetshouldbedirectory;
 int    iamrecursive;
 int    pflag;
 struct passwd *pwd;
-struct passwd *getpwuid();
+/*struct       passwd *getpwuid();*/
 int    userid;
 int    port;
 
@@ -54,14 +81,32 @@ struct buffer {
 } *allocbuf();
 
 /*VARARGS*/
-int    error();
+/*int  error();*/
 
 #define        ga()            (void) write(rem, "", 1)
 
-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 verifydir __P((char *cp));
+char *colon __P((char *cp));
+int okname __P((char *cp0));
+int susystem __P((char *s));
+int source __P((int argc, char **argv));
+int rsource __P((char *name, struct stat *statp));
+int response __P((void));
+int lostconn __P((void));
+int sink __P((int argc, char **argv));
+struct buffer *allocbuf __P((struct buffer *bp, int fd, int blksize));
+int error __P((char *fmt, ...));
+
+int main(argc, argv) int argc; char **argv; {
        char *targ, *host, *src;
        char *suser, *tuser, *thost;
        int i;
@@ -224,9 +269,7 @@ main(argc, argv)
        exit(errs);
 }
 
-verifydir(cp)
-       char *cp;
-{
+int verifydir(cp) char *cp; {
        struct stat stb;
 
        if (stat(cp, &stb) >= 0) {
@@ -238,10 +281,7 @@ verifydir(cp)
        exit(1);
 }
 
-char *
-colon(cp)
-       char *cp;
-{
+char *colon(cp) char *cp; {
 
        while (*cp) {
                if (*cp == ':')
@@ -253,9 +293,7 @@ colon(cp)
        return (0);
 }
 
-okname(cp0)
-       char *cp0;
-{
+int okname(cp0) char *cp0; {
        register char *cp = cp0;
        register int c;
 
@@ -273,9 +311,7 @@ bad:
        return (0);
 }
 
-susystem(s)
-       char *s;
-{
+int susystem(s) char *s; {
        int status, pid, w;
        register int (*istat)(), (*qstat)();
 
@@ -295,10 +331,7 @@ susystem(s)
        return (status);
 }
 
-source(argc, argv)
-       int argc;
-       char **argv;
-{
+int source(argc, argv) int argc; char **argv; {
        char *last, *name;
        struct stat stb;
        static struct buffer buffer;
@@ -380,12 +413,9 @@ notreg:
        }
 }
 
-#include <sys/dir.h>
+/*#include <sys/dir.h>*/
 
-rsource(name, statp)
-       char *name;
-       struct stat *statp;
-{
+int rsource(name, statp) char *name; struct stat *statp; {
        DIR *d = opendir(name);
        char *last;
        struct direct *dp;
@@ -434,8 +464,7 @@ rsource(name, statp)
        (void) response();
 }
 
-response()
-{
+int response() {
        char resp, c, rbuf[BUFSIZ], *cp = rbuf;
 
        if (read(rem, &resp, 1) != 1)
@@ -465,18 +494,14 @@ response()
        /*NOTREACHED*/
 }
 
-lostconn()
-{
+int lostconn() {
 
        if (iamremote == 0)
                fprintf(stderr, "rcp: lost connection\n");
        exit(1);
 }
 
-sink(argc, argv)
-       int argc;
-       char **argv;
-{
+int sink(argc, argv) int argc; char **argv; {
        off_t i, j;
        char *targ, *whopp, *cp;
        int of, mode, wrerr, exists, first, count, amt, size;
@@ -666,11 +691,7 @@ screwup:
        exit(1);
 }
 
-struct buffer *
-allocbuf(bp, fd, blksize)
-       struct buffer *bp;
-       int fd, blksize;
-{
+struct buffer *allocbuf(bp, fd, blksize) struct buffer *bp; int fd; int blksize; {
        struct stat stb;
        int size;
 
@@ -694,16 +715,18 @@ allocbuf(bp, fd, blksize)
        return (bp);
 }
 
-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
 {
        char buf[BUFSIZ], *cp = buf;
        va_list argp;
 
        errs++;
        *cp++ = 1;
-       va_start(argp);
+       _va_start(argp, fmt);
        (void) vsprintf(cp, fmt, argp);
        va_end(argp);
        (void) write(rem, buf, strlen(buf));
index 6aef1dd..80fde66 100644 (file)
--- a/bin/rm.c
+++ b/bin/rm.c
@@ -1,14 +1,25 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> gen.h*/
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)rm.c        4.18 (Berkeley) 1/6/86";
+#endif
 
 /*
  * rm - for ReMoving files, directories & trees.
  */
 
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <sys/file.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
+/*#include <sys/file.h>*/
 
 int    fflg;           /* -f force - supress error messages */
 int    iflg;           /* -i interrogate user on each file */
@@ -16,12 +27,24 @@ int rflg;           /* -r recurse */
 
 int    errcode;        /* true if errors occured */
 
-char   *strcpy();
-void   *malloc(), *realloc();
+/*char *strcpy();*/
+/*void *malloc(), *realloc();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int rm __P((char arg[], int level));
+int dotname __P((char *s));
+int yes __P((void));
+int append __P((char *name));
 
-main(argc, argv)
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        register char *arg;
 
        fflg = !isatty(0);
@@ -76,9 +99,7 @@ int   pathsz;         /* size of path */
 /*
  * Return TRUE if sucessful. Recursive with -r (rflg)
  */
-rm(arg, level)
-       char arg[];
-{
+int rm(arg, level) char arg[]; int level; {
        int ok;                         /* true if recursive rm succeeded */
        struct stat buf;                /* for finding out what a file is */
        struct direct *dp;              /* for reading a directory */
@@ -210,9 +231,7 @@ rm(arg, level)
 /*
  * boolean: is it "." or ".." ?
  */
-dotname(s)
-       char *s;
-{
+int dotname(s) char *s; {
        if (s[0] == '.')
                if (s[1] == '.')
                        if (s[2] == '\0')
@@ -227,8 +246,7 @@ dotname(s)
 /*
  * Get a yes/no answer from the user.
  */
-yes()
-{
+int yes() {
        int i, b;
 
        i = b = getchar();
@@ -240,9 +258,7 @@ yes()
 /*
  * Append 'name' to 'path'.
  */
-append(name)
-       char *name;
-{
+int append(name) char *name; {
        register int n;
 
        n = strlen(name);
index a4446ac..e8029ae 100644 (file)
@@ -1,4 +1,9 @@
-#ifndef lint
+#include <stdio.h>
+#include <strings.h>
+#include <sysexits.h>
+#include <vaxuba/npreg.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char sccsid[] = "@(#)rmail.c    4.8 (Berkeley) 5/15/86";
 #endif
 
@@ -11,24 +16,22 @@ static char sccsid[] =      "@(#)rmail.c    4.8 (Berkeley) 5/15/86";
 **     lines.
 */
 
-# include <stdio.h>
-# include <sysexits.h>
+/*# include <stdio.h>*/
+/*# include <sysexits.h>*/
 
 typedef char   bool;
 #define TRUE   1
 #define FALSE  0
 
-extern FILE    *popen();
-extern char    *index();
-extern char    *rindex();
+/*extern FILE  *popen();*/
+/*extern char  *index();*/
+/*extern char  *rindex();*/
 
 bool   Debug;
 
 # define MAILER        "/usr/lib/sendmail"
 
-main(argc, argv)
-       char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        FILE *out;      /* output to sendmail */
        char lbuf[1024];        /* one line of the message */
        char from[512];         /* accumulated path of sender */
@@ -41,16 +44,14 @@ main(argc, argv)
        int i;
 
 # ifdef DEBUG
-       if (argc > 1 && strcmp(argv[1], "-T") == 0)
-       {
+       if (argc > 1 && strcmp(argv[1], "-T") == 0) {
                Debug = TRUE;
                argc--;
                argv++;
        }
-# endif DEBUG
+# endif
 
-       if (argc < 2)
-       {
+       if (argc < 2) {
                fprintf(stderr, "Usage: rmail user ...\n");
                exit(EX_USAGE);
        }
@@ -58,22 +59,18 @@ main(argc, argv)
        (void) strcpy(from, "");
        (void) strcpy(ufrom, "/dev/null");
 
-       for (;;)
-       {
+       for (;;) {
                (void) fgets(lbuf, sizeof lbuf, stdin);
                if (strncmp(lbuf, "From ", 5) != 0 && strncmp(lbuf, ">From ", 6) != 0)
                        break;
                (void) sscanf(lbuf, "%s %s", junk, ufrom);
                cp = lbuf;
-               for (;;)
-               {
+               for (;;) {
                        cp = index(cp+1, 'r');
-                       if (cp == NULL)
-                       {
+                       if (cp == NULL) {
                                register char *p = rindex(uf, '!');
 
-                               if (p != NULL)
-                               {
+                               if (p != NULL) {
                                        *p = '\0';
                                        (void) strcpy(sys, uf);
                                        uf = p + 1;
@@ -100,8 +97,7 @@ main(argc, argv)
        (void) strcat(from, uf);
 
        (void) sprintf(cmd, "%s -ee -f%s -i", MAILER, from);
-       while (*++argv != NULL)
-       {
+       while (*++argv != NULL) {
                (void) strcat(cmd, " '");
                if (**argv == '(')
                        (void) strncat(cmd, *argv + 1, strlen(*argv) - 2);
@@ -118,8 +114,7 @@ main(argc, argv)
        while (fgets(lbuf, sizeof lbuf, stdin))
                fputs(lbuf, out);
        i = pclose(out);
-       if ((i & 0377) != 0)
-       {
+       if ((i & 0377) != 0) {
                fprintf(stderr, "pclose: status 0%o\n", i);
                exit(EX_OSERR);
        }
index dd84de3..5dfef49 100644 (file)
@@ -1,28 +1,29 @@
+#include <stdio.h>
+#include <sys/dir.h>
+#include <sys/errno.h>
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)rmdir.c    5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
 /*
  * Remove directory
  */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
-main(argc,argv)
-       int argc;
-       char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        int errors = 0;
 
        if (argc < 2) {
index ab50afc..f253426 100644 (file)
@@ -1,16 +1,20 @@
+#include <a.out.h>
+#include <stdio.h>
+/*#include <sys/exec.h> a.out.h*/
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)size.c      4.4 (Berkeley) 4/22/85";
+#endif
 /*
  * size
  */
 
-#include       <stdio.h>
-#include       <a.out.h>
+/*#include     <stdio.h>*/
+/*#include     <a.out.h>*/
 
 int    header;
 
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        struct exec buf;
        long sum;
        int gorp,i;
index 9928fe3..b8b846a 100644 (file)
@@ -1,31 +1,48 @@
+#include <a.out.h>
+#include <stdio.h>
+#include <sys.h>
+/*#include <sys/errno.h> sys.h*/
+/*#include <sys/exec.h> a.out.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/signal.h> sys.h*/
+
 /*
  * Copyright (c) 1983 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) 1983 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[] = "@(#)strip.c    5.1 (Berkeley) 4/30/85";
-#endif not lint
+#endif
 
-#include <a.out.h>
-#include <signal.h>
-#include <stdio.h>
-#include <sys/file.h>
+/*#include <a.out.h>*/
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
+/*#include <sys/file.h>*/
 
 struct exec head;
 int    status;
 int    pagesize;
 
-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 strip __P((char *name));
+
+int main(argc, argv) int argc; char *argv[]; {
        register i;
 
        pagesize = getpagesize();
@@ -40,9 +57,7 @@ main(argc, argv)
        exit(status);
 }
 
-strip(name)
-       char *name;
-{
+int strip(name) char *name; {
        register f;
        long size;
 
index 4e2796e..4a5e876 100644 (file)
@@ -1,28 +1,36 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/ttychars.h> sys/ioctl.h*/
+/*#include <sys/ttydev.h> sys/ioctl.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[] = "@(#)stty.c     5.4 (Berkeley) 4/4/86";
-#endif not lint
+#endif
 
 /*
  * set teletype modes
  */
 
-#include <stdio.h>
-#include <sys/ioctl.h>
+/*#include <stdio.h>*/
+/*#include <sys/ioctl.h>*/
 
-struct
-{
+struct {
        char    *string;
        int     speed;
 } speeds[] = {
@@ -47,8 +55,7 @@ struct
        "38400", EXTB,
        0,
 };
-struct
-{
+struct {
        char    *string;
        int     set;
        int     reset;
@@ -171,9 +178,23 @@ char       *arg;
 
 int    argc;
 char   **argv;
-main(iargc, iargv)
-char   **iargv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int iargc, char **iargv));
+int eq __P((char *string));
+int prmodes __P((int all));
+int pcol __P((int ch1, int ch2));
+int pit __P((unsigned what, char *itsname, char *sep));
+int delay __P((int m, char *s));
+int prspeed __P((char *c, int s));
+
+int main(iargc, iargv) int iargc; char **iargv; {
        int i;
        register struct special *sp;
        char obuf[BUFSIZ];
@@ -327,9 +348,7 @@ done:
        ioctl(1, TIOCSWINSZ, &win);
 }
 
-eq(string)
-char *string;
-{
+int eq(string) char *string; {
        int i;
 
        if(!arg)
@@ -344,8 +363,7 @@ loop:
        return(1);
 }
 
-prmodes(all)
-{
+int prmodes(all) int all; {
        register m;
        int any;
 
@@ -493,9 +511,7 @@ erase  kill   werase rprnt  flush  lnext  susp   intr   quit   stop   eof\
        }
 }
 
-pcol(ch1, ch2)
-       int ch1, ch2;
-{
+int pcol(ch1, ch2) int ch1; int ch2; {
        int nout = 0;
 
        ch1 &= 0377;
@@ -532,10 +548,7 @@ pcol(ch1, ch2)
        }
 }
 
-pit(what, itsname, sep)
-       unsigned what;
-       char *itsname, *sep;
-{
+int pit(what, itsname, sep) unsigned what; char *itsname; char *sep; {
 
        what &= 0377;
        fprintf(stderr, "%s%s", sep, itsname);
@@ -558,9 +571,7 @@ pit(what, itsname, sep)
        fprintf(stderr, "%c", what);
 }
 
-delay(m, s)
-char *s;
-{
+int delay(m, s) int m; char *s; {
 
        if(m)
                fprintf(stderr,"%s%d ", s, m);
@@ -570,9 +581,7 @@ int speed[] = {
        0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,19200,38400
 };
 
-prspeed(c, s)
-char *c;
-{
+int prspeed(c, s) char *c; int s; {
 
        fprintf(stderr,"%s%d baud",  c, speed[s]);
 }
index 95cf539..f9cb06c 100644 (file)
--- a/bin/su.c
+++ b/bin/su.c
@@ -1,26 +1,38 @@
+#include <gen.h>
+/*#include <grp.h> gen.h*/
+/*#include <pwd.h> gen.h*/
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+#include <sys/resource.h>
+/*#include <sys/syslog.h> gen.h*/
+/*#include <utmp.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[] = "@(#)su.c       5.4 (Berkeley) 1/13/86";
-#endif not lint
+#endif
 
-#include <stdio.h>
-#include <pwd.h>
-#include <grp.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <grp.h>*/
+/*#include <syslog.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
 
 char   userbuf[16]     = "USER=";
 char   homebuf[128]    = "HOME=";
@@ -34,15 +46,24 @@ int fastlogin;
 
 extern char    **environ;
 struct passwd *pwd;
-char   *crypt();
-char   *getpass();
-char   *getenv();
-char   *getlogin();
-
-main(argc,argv)
-       int argc;
-       char *argv[];
-{
+/*char *crypt();*/
+/*char *getpass();*/
+/*char *getenv();*/
+/*char *getlogin();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int setenv __P((char *ename, char *eval, char *buf));
+char *getenv __P((char *ename));
+
+int main(argc, argv) int argc; char *argv[]; {
        char *password;
        char buf[1000];
        FILE *fp;
@@ -150,9 +171,7 @@ ok:
        exit(7);
 }
 
-setenv(ename, eval, buf)
-       char *ename, *eval, *buf;
-{
+int setenv(ename, eval, buf) char *ename; char *eval; char *buf; {
        register char *cp, *dp;
        register char **ep = environ;
 
@@ -170,10 +189,7 @@ setenv(ename, eval, buf)
        }
 }
 
-char *
-getenv(ename)
-       char *ename;
-{
+char *getenv(ename) char *ename; {
        register char *cp, *dp;
        register char **ep = environ;
 
index a38100f..12aafe8 100644 (file)
@@ -1,6 +1,9 @@
+#include <sys/file.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)sync.c      4.1 (Berkeley) 10/1/80";
-main()
-{
+#endif
+int main() {
 
        sync();
 }
index 8f018db..1347572 100644 (file)
--- a/bin/tar.c
+++ b/bin/tar.c
@@ -1,32 +1,49 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/ioctl.h> sys/mtio.h*/
+#include <sys/mtio.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+/*#include <time.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[] = "@(#)tar.c      5.7 (Berkeley) 4/26/86";
-#endif not lint
+#endif
 
 /*
  * Tape Archival Program
  */
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <sys/ioctl.h>
-#include <sys/mtio.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <errno.h>
-#include <fcntl.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
+/*#include <sys/ioctl.h>*/
+/*#include <sys/mtio.h>*/
+/*#include <sys/time.h>*/
+/*#include <signal.h>*/
+/*#include <errno.h>*/
+/*#include <fcntl.h>*/
 
 #define TBLOCK 512
 #define NBLOCK 20
@@ -87,37 +104,86 @@ int        first;
 int    prtlinkerr;
 int    freemem = 1;
 int    nblock = 0;
-int    onintr();
-int    onquit();
-int    onhup();
+/*int  onintr();*/
+/*int  onquit();*/
+/*int  onhup();*/
 #ifdef notdef
-int    onterm();
+/*int  onterm();*/
 #endif
 
 daddr_t        low;
 daddr_t        high;
-daddr_t        bsrch();
+/*daddr_t      bsrch();*/
 
 FILE   *vfile = stdout;
 FILE   *tfile;
 char   tname[] = "/tmp/tarXXXXXX";
 char   *usefile;
 char   magtape[] = "/dev/rmt8";
-void   *malloc();
-long   time();
-off_t  lseek();
-char   *mktemp();
-char   *strcat();
-char   *strcpy();
-char   *rindex();
-char   *getcwd();
-char   *getwd();
-char   *getmem();
-
-main(argc, argv)
-int    argc;
-char   *argv[];
-{
+/*void *malloc();*/
+/*long time();*/
+/*off_t        lseek();*/
+/*char *mktemp();*/
+/*char *strcat();*/
+/*char *strcpy();*/
+/*char *rindex();*/
+/*char *getcwd();*/
+/*char *getwd();*/
+/*char *getmem();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int usage __P((void));
+int openmt __P((char *tape, int writing));
+int dorep __P((char *argv[]));
+int endtape __P((void));
+int getdir __P((void));
+int passtape __P((void));
+int putfile __P((char *longname, char *shortname, char *parent));
+int doxtract __P((char *argv[]));
+int dotable __P((char *argv[]));
+int putempty __P((void));
+int longt __P((register struct stat *st));
+int pmode __P((register struct stat *st));
+int selectbits __P((int *pairp, struct stat *st));
+int checkdir __P((register char *name));
+int onintr __P((void));
+int onquit __P((void));
+int onhup __P((void));
+int onterm __P((void));
+int tomodes __P((register struct stat *sp));
+int checksum __P((void));
+int checkw __P((int c, char *name));
+int response __P((void));
+int checkf __P((char *name, int mode, int howmuch));
+int checkupdate __P((char *arg));
+int done __P((int n));
+int wantit __P((char *argv[]));
+int prefix __P((register char *s1, register char *s2));
+daddr_t lookup __P((char *s));
+daddr_t bsrch __P((char *s, int n, daddr_t l, daddr_t h));
+int cmp __P((char *b, char *s, int n));
+int readtape __P((char *buffer));
+int readtbuf __P((char **bufpp, int size));
+int writetbuf __P((register char *buffer, register int n));
+int backtape __P((void));
+int flushtape __P((void));
+int mterr __P((char *operation, int i, int exitcode));
+int bread __P((int fd, char *buf, int size));
+char *getcwd __P((char *buf));
+int getbuf __P((void));
+int dodirtimes __P((union hblock *hp));
+int setimes __P((char *path, time_t mt));
+char *getmem __P((int size));
+
+int main(argc, argv) int argc; char *argv[]; {
        char *cp;
 
        if (argc < 2)
@@ -268,18 +334,13 @@ char      *argv[];
        done(0);
 }
 
-usage()
-{
+int usage() {
        fprintf(stderr,
 "tar: usage: tar -{txru}[cvfblmhopwBi] [tapefile] [blocksize] file1 file2...\n");
        done(1);
 }
 
-int
-openmt(tape, writing)
-       char *tape;
-       int writing;
-{
+int openmt(tape, writing) char *tape; int writing; {
 
        if (strcmp(tape, "-") == 0) {
                /*
@@ -318,9 +379,7 @@ openmt(tape, writing)
        return(mt);
 }
 
-dorep(argv)
-       char *argv[];
-{
+int dorep(argv) char *argv[]; {
        register char *cp, *cp2;
        char wdir[MAXPATHLEN], tempdir[MAXPATHLEN], *parent;
 
@@ -393,13 +452,11 @@ dorep(argv)
        }
 }
 
-endtape()
-{
+int endtape() {
        return (dblock.dbuf.name[0] == '\0');
 }
 
-getdir()
-{
+int getdir() {
        register struct stat *sp;
        int i;
 
@@ -428,8 +485,7 @@ top:
                fprintf(tfile, "%s %s\n", dblock.dbuf.name, dblock.dbuf.mtime);
 }
 
-passtape()
-{
+int passtape() {
        long blocks;
        char *bufp;
 
@@ -443,11 +499,7 @@ passtape()
                (void) readtbuf(&bufp, TBLOCK);
 }
 
-putfile(longname, shortname, parent)
-       char *longname;
-       char *shortname;
-       char *parent;
-{
+int putfile(longname, shortname, parent) char *longname; char *shortname; char *parent; {
        int infile = 0;
        long blocks;
        char buf[TBLOCK];
@@ -646,9 +698,7 @@ putfile(longname, shortname, parent)
        }
 }
 
-doxtract(argv)
-       char *argv[];
-{
+int doxtract(argv) char *argv[]; {
        long blocks, bytes;
        int ofile, i;
 
@@ -769,9 +819,7 @@ doxtract(argv)
        }
 }
 
-dotable(argv)
-       char *argv[];
-{
+int dotable(argv) char *argv[]; {
        register int i;
 
        for (;;) {
@@ -791,17 +839,14 @@ dotable(argv)
        }
 }
 
-putempty()
-{
+int putempty() {
        char buf[TBLOCK];
 
        bzero(buf, sizeof (buf));
        (void) writetape(buf);
 }
 
-longt(st)
-       register struct stat *st;
-{
+int longt(st) register struct stat *st; {
        register char *cp;
        char *ctime();
 
@@ -836,19 +881,14 @@ int       m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
 
 int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
 
-pmode(st)
-       register struct stat *st;
-{
+int pmode(st) register struct stat *st; {
        register int **mp;
 
        for (mp = &m[0]; mp < &m[9];)
                selectbits(*mp++, st);
 }
 
-selectbits(pairp, st)
-       int *pairp;
-       struct stat *st;
-{
+int selectbits(pairp, st) int *pairp; struct stat *st; {
        register int n, *ap;
 
        ap = pairp;
@@ -863,9 +903,7 @@ selectbits(pairp, st)
  * a directory on the tar tape (indicated by a trailing '/'),
  * return 1; else 0.
  */
-checkdir(name)
-       register char *name;
-{
+int checkdir(name) register char *name; {
        register char *cp;
 
        /*
@@ -902,35 +940,29 @@ checkdir(name)
        return (cp[-1]=='/');
 }
 
-onintr()
-{
+int onintr() {
        (void) signal(SIGINT, SIG_IGN);
        term++;
 }
 
-onquit()
-{
+int onquit() {
        (void) signal(SIGQUIT, SIG_IGN);
        term++;
 }
 
-onhup()
-{
+int onhup() {
        (void) signal(SIGHUP, SIG_IGN);
        term++;
 }
 
 #ifdef notdef
-onterm()
-{
+int onterm() {
        (void) signal(SIGTERM, SIG_IGN);
        term++;
 }
 #endif
 
-tomodes(sp)
-register struct stat *sp;
-{
+int tomodes(sp) register struct stat *sp; {
        register char *cp;
 
        for (cp = dblock.dummy; cp < &dblock.dummy[TBLOCK]; cp++)
@@ -942,8 +974,7 @@ register struct stat *sp;
        sprintf(dblock.dbuf.mtime, "%11lo ", sp->st_mtime);
 }
 
-checksum()
-{
+int checksum() {
        register i;
        register char *cp;
 
@@ -956,9 +987,7 @@ checksum()
        return (i);
 }
 
-checkw(c, name)
-       char *name;
-{
+int checkw(c, name) int c; char *name; {
        if (!wflag)
                return (1);
        printf("%c ", c);
@@ -968,8 +997,7 @@ checkw(c, name)
        return (response() == 'y');
 }
 
-response()
-{
+int response() {
        char c;
 
        c = getchar();
@@ -981,10 +1009,7 @@ response()
        return (c);
 }
 
-checkf(name, mode, howmuch)
-       char *name;
-       int mode, howmuch;
-{
+int checkf(name, mode, howmuch) char *name; int mode; int howmuch; {
        int l;
 
        if ((mode & S_IFMT) == S_IFDIR){
@@ -1005,9 +1030,7 @@ checkf(name, mode, howmuch)
 }
 
 /* Is the current file a new file, or the newest one of the same name? */
-checkupdate(arg)
-       char *arg;
-{
+int checkupdate(arg) char *arg; {
        char name[100];
        long mtime;
        daddr_t seekp;
@@ -1023,8 +1046,7 @@ checkupdate(arg)
        }
 }
 
-done(n)
-{
+int done(n) int n; {
        unlink(tname);
        exit(n);
 }
@@ -1033,9 +1055,7 @@ done(n)
  * Do we want the next entry on the tape, i.e. is it selected?  If
  * not, skip over the entire entry.  Return -1 if reached end of tape.
  */
-wantit(argv)
-       char *argv[];
-{
+int wantit(argv) char *argv[]; {
        register char **cp;
 
        getdir();
@@ -1053,9 +1073,7 @@ wantit(argv)
 /*
  * Does s2 begin with the string s1, on a directory boundary?
  */
-prefix(s1, s2)
-       register char *s1, *s2;
-{
+int prefix(s1, s2) register char *s1; register char *s2; {
        while (*s1)
                if (*s1++ != *s2++)
                        return (0);
@@ -1067,10 +1085,7 @@ prefix(s1, s2)
 #define        N       200
 int    njab;
 
-daddr_t
-lookup(s)
-       char *s;
-{
+daddr_t lookup(s) char *s; {
        register i;
        daddr_t a;
 
@@ -1081,11 +1096,7 @@ lookup(s)
        return (a);
 }
 
-daddr_t
-bsrch(s, n, l, h)
-       daddr_t l, h;
-       char *s;
-{
+daddr_t bsrch(s, n, l, h) char *s; int n; daddr_t l; daddr_t h; {
        register i, j;
        char b[N];
        daddr_t m, m1;
@@ -1127,9 +1138,7 @@ loop:
        return (m);
 }
 
-cmp(b, s, n)
-       char *b, *s;
-{
+int cmp(b, s, n) char *b; char *s; int n; {
        register i;
 
        if (b[0] != '\n')
@@ -1143,9 +1152,7 @@ cmp(b, s, n)
        return (b[i+1] == ' '? 0 : -1);
 }
 
-readtape(buffer)
-       char *buffer;
-{
+int readtape(buffer) char *buffer; {
        char *bufp;
 
        if (first == 0)
@@ -1155,10 +1162,7 @@ readtape(buffer)
        return(TBLOCK);
 }
 
-readtbuf(bufpp, size)
-       char **bufpp;
-       int size;
-{
+int readtbuf(bufpp, size) char **bufpp; int size; {
        register int i;
 
        if (recno >= nblock || first == 0) {
@@ -1185,10 +1189,7 @@ readtbuf(bufpp, size)
        return (size);
 }
 
-writetbuf(buffer, n)
-       register char *buffer;
-       register int n;
-{
+int writetbuf(buffer, n) register char *buffer; register int n; {
        int i;
 
        if (first == 0) {
@@ -1231,8 +1232,7 @@ writetbuf(buffer, n)
        return (nblock - recno);
 }
 
-backtape()
-{
+int backtape() {
        static int mtdev = 1;
        static struct mtop mtop = {MTBSR, 1};
        struct mtget mtget;
@@ -1250,8 +1250,7 @@ backtape()
        recno--;
 }
 
-flushtape()
-{
+int flushtape() {
        int i;
 
        i = write(mt, (char *)tbuf, TBLOCK*nblock);
@@ -1259,10 +1258,7 @@ flushtape()
                mterr("write", i, 2);
 }
 
-mterr(operation, i, exitcode)
-       char *operation;
-       int i;
-{
+int mterr(operation, i, exitcode) char *operation; int i; int exitcode; {
        fprintf(stderr, "tar: tape %s error: ", operation);
        if (i < 0)
                perror("");
@@ -1271,11 +1267,7 @@ mterr(operation, i, exitcode)
        done(exitcode);
 }
 
-bread(fd, buf, size)
-       int fd;
-       char *buf;
-       int size;
-{
+int bread(fd, buf, size) int fd; char *buf; int size; {
        int count;
        static int lastread = 0;
 
@@ -1294,10 +1286,7 @@ bread(fd, buf, size)
        return (count);
 }
 
-char *
-getcwd(buf)
-       char *buf;
-{
+char *getcwd(buf) char *buf; {
        if (getwd(buf) == NULL) {
                fprintf(stderr, "tar: %s\n", buf);
                exit(1);
@@ -1305,8 +1294,7 @@ getcwd(buf)
        return (buf);
 }
 
-getbuf()
-{
+int getbuf() {
        
        if (nblock == 0) {
                fstat(mt, &stbuf);
@@ -1347,9 +1335,7 @@ char dirstack[NAMSIZ];
 #define NTIM (NAMSIZ/2+1)              /* a/b/c/d/... */
 time_t mtime[NTIM];
 
-dodirtimes(hp)
-       union hblock *hp;
-{
+int dodirtimes(hp) union hblock *hp; {
        register char *p = dirstack;
        register char *q = hp->dbuf.name;
        register int ndir = 0;
@@ -1387,10 +1373,7 @@ dodirtimes(hp)
        mtime[ndir] = stbuf.st_mtime;   /* overwrite the last one */
 }
 
-setimes(path, mt)
-       char *path;
-       time_t mt;
-{
+int setimes(path, mt) char *path; time_t mt; {
        struct timeval tv[2];
 
        tv[0].tv_sec = time((time_t *) 0);
@@ -1402,9 +1385,7 @@ setimes(path, mt)
        }
 }
 
-char *
-getmem(size)
-{
+char *getmem(size) int size; {
        char *p = malloc((unsigned) size);
 
        if (p == NULL && freemem) {
index 6b4221d..c3c2be5 100644 (file)
--- a/bin/tee.c
+++ b/bin/tee.c
@@ -1,14 +1,20 @@
-#ifndef lint
+/*#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 = "@(#)tee.c       5.4 (Berkeley) 12/14/85";
 #endif
 /*
  * tee-- pipe fitting
  */
 
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
+/*#include <signal.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <errno.h>*/
 
 #define        BUFSIZ  8192
 int openf[20] = { 1 };
@@ -21,11 +27,21 @@ char in[BUFSIZ];
 char out[BUFSIZ];
 
 extern errno;
-long   lseek();
+/*long lseek();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int stash __P((int p));
+int puts __P((char *s));
 
-main(argc,argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register r,w,p;
        struct stat buf;
        while(argc>1&&argv[1][0]=='-') {
@@ -81,8 +97,7 @@ char **argv;
        }
 }
 
-stash(p)
-{
+int stash(p) int p; {
        int k;
        int i;
        int d;
@@ -92,9 +107,7 @@ stash(p)
                        write(openf[k], out+i, d<p-i?d:p-i);
 }
 
-puts(s)
-char *s;
-{
+int puts(s) char *s; {
        while(*s)
                write(2,s++,1);
 }
index b739406..070f8cd 100644 (file)
@@ -1,4 +1,12 @@
-#ifndef lint
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/dir.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)test.c      4.2 (Berkeley) 5/11/86";
 #endif
 
@@ -7,9 +15,9 @@ static char *sccsid = "@(#)test.c      4.2 (Berkeley) 5/11/86";
  *     [ expression ]
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 #define EQ(a,b)        ((tmp=a)==0?0:(strcmp(tmp,b)==0))
 
 #define DIR 1
@@ -18,11 +26,29 @@ int ap;
 int    ac;
 char   **av;
 char   *tmp;
-char   *nxtarg();
+/*char *nxtarg();*/
+
+#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[]));
+char *nxtarg __P((int mt));
+int exp __P((void));
+int e1 __P((void));
+int e2 __P((void));
+int e3 __P((void));
+int tio __P((char *a, int f));
+int ftype __P((char *f));
+int fsizep __P((char *f));
+int synbad __P((char *s1, char *s2));
+int length __P((char *s));
+
+int main(argc, argv) int argc; char *argv[]; {
        int status;
 
        ac = argc; av = argv; ap = 1;
@@ -38,7 +64,7 @@ char *argv[];
        exit(status);
 }
 
-char *nxtarg(mt) {
+char *nxtarg(mt) int mt; {
 
        if (ap>=ac) {
                if(mt) {
@@ -50,7 +76,7 @@ char *nxtarg(mt) {
        return(av[ap++]);
 }
 
-exp() {
+int exp() {
        int p1;
 
        p1 = e1();
@@ -59,7 +85,7 @@ exp() {
        return(p1);
 }
 
-e1() {
+int e1() {
        int p1;
 
        p1 = e2();
@@ -68,14 +94,14 @@ e1() {
        return(p1);
 }
 
-e2() {
+int e2() {
        if (EQ(nxtarg(0), "!"))
                return(!e3());
        ap--;
        return(e3());
 }
 
-e3() {
+int e3() {
        int p1;
        register char *a;
        char *p2;
@@ -145,10 +171,7 @@ e3() {
        return(!EQ(a,""));
 }
 
-tio(a, f)
-char *a;
-int f;
-{
+int tio(a, f) char *a; int f; {
 
        f = open(a, f);
        if (f>=0) {
@@ -158,9 +181,7 @@ int f;
        return(0);
 }
 
-ftype(f)
-char *f;
-{
+int ftype(f) char *f; {
        struct stat statb;
 
        if(stat(f,&statb)<0)
@@ -170,18 +191,14 @@ char *f;
        return(FIL);
 }
 
-fsizep(f)
-char *f;
-{
+int fsizep(f) char *f; {
        struct stat statb;
        if(stat(f,&statb)<0)
                return(0);
        return(statb.st_size>0);
 }
 
-synbad(s1,s2)
-char *s1, *s2;
-{
+int synbad(s1, s2) char *s1; char *s2; {
        (void) write(2, "test: ", 6);
        (void) write(2, s1, strlen(s1));
        (void) write(2, s2, strlen(s2));
@@ -189,9 +206,7 @@ char *s1, *s2;
        exit(255);
 }
 
-length(s)
-       char *s;
-{
+int length(s) char *s; {
        char *es=s;
        while(*es++);
        return(es-s-1);
index d2aae1a..2070b89 100644 (file)
@@ -1,20 +1,37 @@
-#ifndef lint
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/exec.h>
+#include <sys/proc.h>
+/*#include <sys/resource.h> sys/wait.h*/
+#include <sys/signal.h>
+/*#include <sys/time.h> sys/proc.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)time.c      4.5 (Berkeley) 7/1/83";
 #endif
 
 /*
  * time
  */
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-main(argc, argv)
-       int argc;
-       char **argv;
-{
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int printt __P((char *s, struct timeval *tv));
+
+int main(argc, argv) int argc; char **argv; {
        int status;
        register int p;
        struct timeval before, after;
@@ -51,10 +68,7 @@ main(argc, argv)
        exit (status>>8);
 }
 
-printt(s, tv)
-       char *s;
-       struct timeval *tv;
-{
+int printt(s, tv) char *s; struct timeval *tv; {
 
        fprintf(stderr, "%9d.%01d %s ", tv->tv_sec, tv->tv_usec/100000, s);
 }
index de6018a..a3cfc3e 100644 (file)
@@ -1,18 +1,31 @@
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <sys.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/stat.h> sys.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/wait.h> sys.h*/
+/*#include <time.h> gen.h*/
+/*#include <utmp.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[] = "@(#)wall.c     5.3 (Berkeley) 4/20/86";
-#endif not lint
+#endif
 
 /*
  * wall.c - Broadcast a message to all users.
@@ -21,14 +34,14 @@ static char sccsid[] = "@(#)wall.c  5.3 (Berkeley) 4/20/86";
  * is entitled "Mechanisms for Broadcast and Selective Broadcast".
  */
 
-#include <stdio.h>
-#include <utmp.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <utmp.h>*/
+/*#include <errno.h>*/
+/*#include <signal.h>*/
+/*#include <sys/time.h>*/
+/*#include <fcntl.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
 
 #define IGNOREUSER     "sleeper"
 
@@ -36,20 +49,29 @@ char        hostname[32];
 char   mesg[3000];
 int    msize,sline;
 struct utmp *utmp;
-char   *strcpy();
-char   *strcat();
-void   *malloc();
+/*char *strcpy();*/
+/*char *strcat();*/
+/*void *malloc();*/
 char   who[9] = "???";
 long   clock;
-long   time();
-struct tm *localtime();
+/*long time();*/
+/*struct tm *localtime();*/
 struct tm *localclock;
 
 extern errno;
 
-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 sendmes __P((char *tty));
+
+int main(argc, argv) int argc; char *argv[]; {
        register int i, c;
        register struct utmp *p;
        int f;
@@ -107,9 +129,7 @@ char *argv[];
        exit(0);
 }
 
-sendmes(tty)
-char *tty;
-{
+int sendmes(tty) char *tty; {
        register f, flags;
        static char t[50] = "/dev/";
        int e, i;
index 3c2e4e3..1cbfa3b 100644 (file)
--- a/bin/who.c
+++ b/bin/who.c
@@ -1,27 +1,36 @@
+#include <pwd.h>
+#include <stdio.h>
+/*#include <strings.h> sys.h*/
+#include <sys.h>
+/*#include <sys/proc.h> sys.h*/
+/*#include <sys/time.h> sys.h*/
+/*#include <time.h> sys.h*/
+#include <utmp.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[] = "@(#)who.c      5.1 (Berkeley) 5/2/85";
-#endif not lint
+#endif
 
 /*
  * who
  */
 
-#include <stdio.h>
-#include <utmp.h>
-#include <pwd.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <utmp.h>*/
+/*#include <pwd.h>*/
+/*#include <ctype.h>*/
 
 #define NMAX sizeof(utmp.ut_name)
 #define LMAX sizeof(utmp.ut_line)
@@ -29,15 +38,23 @@ static char sccsid[] = "@(#)who.c   5.1 (Berkeley) 5/2/85";
 
 struct utmp utmp;
 struct passwd *pw;
-struct passwd *getpwuid();
+/*struct       passwd *getpwuid();*/
 char   hostname[32];
 
-char   *ttyname(), *rindex(), *ctime(), *strcpy();
+/*char *ttyname(), *rindex(), *ctime(), *strcpy();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int putline __P((void));
 
-main(argc, argv)
-       int argc;
-       char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
        register char *tp, *s;
        register FILE *fi;
        extern char _sobuf[];
@@ -78,8 +95,7 @@ main(argc, argv)
        }
 }
 
-putline()
-{
+int putline() {
        register char *cbuf;
 
        printf("%-*.*s %-*.*s",
index d068d17..22e3f3f 100644 (file)
@@ -1,23 +1,39 @@
-#ifndef        lint
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <sys.h>
+/*#include <sys/errno.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+/*#include <sys/file.h> sys.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+/*#include <sys/stat.h> sys.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/wait.h> sys.h*/
+/*#include <time.h> gen.h*/
+/*#include <utmp.h> gen.h*/
+
+#if    defined(DOSCCS) && !defined(lint)
 static char *sccsid = "@(#)write.c     4.13 3/13/86";
 #endif
 /*
  * write to another user
  */
 
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <utmp.h>
-#include <sys/time.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <signal.h>*/
+/*#include <utmp.h>*/
+/*#include <sys/time.h>*/
 
 #define        NMAX    sizeof(ubuf.ut_name)
 #define        LMAX    sizeof(ubuf.ut_line)
 
-char   *strcat();
-char   *strcpy();
+/*char *strcat();*/
+/*char *strcpy();*/
 struct utmp ubuf;
 int    signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
 char   me[NMAX + 1]    = "???";
@@ -26,18 +42,29 @@ char        *mytty;
 char   histty[32];
 char   ttybuf[32];
 char   *histtya;
-char   *ttyname();
-char   *rindex();
+/*char *ttyname();*/
+/*char *rindex();*/
 int    logcnt;
-int    eof();
-int    timout();
+/*int  eof();*/
+/*int  timout();*/
 FILE   *tf;
-char   *getenv();
+/*char *getenv();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int timout __P((void));
+int eof __P((void));
+int ex __P((char *bp));
+int sigs __P((int (*sig)(void)));
 
-main(argc, argv)
-       int argc;
-       char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
        struct stat stbuf;
        register i;
        register FILE *uf;
@@ -197,23 +224,19 @@ cont:
        }
 }
 
-timout()
-{
+int timout() {
 
        fprintf(stderr, "write: Timeout opening their tty\n");
        exit(1);
 }
 
-eof()
-{
+int eof() {
 
        fprintf(tf, "EOF\r\n");
        exit(0);
 }
 
-ex(bp)
-       char *bp;
-{
+int ex(bp) char *bp; {
        register i;
 
        sigs(SIG_IGN);
@@ -237,9 +260,7 @@ out:
        sigs(eof);
 }
 
-sigs(sig)
-       int (*sig)();
-{
+int sigs(sig) int (*sig)(); {
        register i;
 
        for (i=0; signum[i]; i++)