+#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;
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;
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;
done(notfound());
}
-setcom(fun)
-int (*fun)();
-{
+int setcom(fun) int (*fun)(); {
if(comfun != 0) {
fprintf(stderr, "ar: only one of [%s] allowed\n", man);
comfun = fun;
}
-rcmd()
-{
+int rcmd() {
register f;
init();
cleanup();
}
-dcmd()
-{
+int dcmd() {
init();
if(getaf())
install();
}
-xcmd()
-{
+int xcmd() {
register f;
struct timeval tv[2];
}
}
-pcmd()
-{
+int pcmd() {
if(getaf())
noar();
}
}
-mcmd()
-{
+int mcmd() {
init();
if(getaf())
install();
}
-tcmd()
-{
+int tcmd() {
if(getaf())
noar();
}
}
-qcmd()
-{
+int qcmd() {
register i, f;
if (flg['a'-'a'] || flg['b'-'a']) {
}
}
-init()
-{
+int init() {
tfnam = mktemp(tmpnam);
close(creat(tfnam, 0600));
wrerr();
}
-getaf()
-{
+int getaf() {
char mbuf[SARMAG];
af = open(arnam, 0);
return(0);
}
-getqf()
-{
+int getqf() {
char mbuf[SARMAG];
if ((qf = open(arnam, 2)) < 0) {
}
}
-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);
exit(c);
}
-notfound()
-{
+int notfound() {
register i, n;
n = 0;
return(n);
}
-morefil()
-{
+int morefil() {
register i, n;
n = 0;
return(n);
}
-cleanup()
-{
+int cleanup() {
register i, f;
_truncate++;
install();
}
-install()
-{
+int install() {
register i;
for(i=0; signum[i]; i++)
* 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",
close(f);
}
-stats()
-{
+int stats() {
register f;
f = open(file, 0);
* 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;
phserr();
}
-getdir()
-{
+int getdir() {
register char *cp;
register i;
return(0);
}
-match()
-{
+int match() {
register i;
for(i=0; i<namc; i++) {
return(0);
}
-bamatch()
-{
+int bamatch() {
register f;
switch(bastate) {
}
}
-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 */
#define XOTH 01
#define STXT 01000
-longt()
-{
+int longt() {
register char *cp;
pmode();
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;
putchar(*ap);
}
-wrerr()
-{
+int wrerr() {
perror("ar write error");
done(1);
}
+#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;
exit(retval);
}
-copyopt(f)
- register FILE *f;
-{
+int copyopt(f) register FILE *f; {
register int c;
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;
+#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";
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;
#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;
dexit();
}
-idexit()
-{
+int idexit() {
eflag = 100;
dexit();
}
-dexit()
-{
+int dexit() {
if (!pflag) {
cunlink(tmp1);
exit(eflag);
}
-error(s, x)
- char *s, *x;
-{
+int error(s, x) char *s; char *x; {
FILE *diag = exflag ? stderr : stdout;
fprintf(diag, "cc: ");
eflag++;
}
-getsuf(as)
-char as[];
-{
+int getsuf(as) char as[]; {
register int c;
register char *s;
register int t;
return (0);
}
-char *
-setsuf(as, ch)
- char *as;
-{
+char *setsuf(as, ch) char *as; int ch; {
register char *s, *s1;
s = s1 = savestr(as);
return (s1);
}
-callsys(f, v)
- char *f, **v;
-{
+int callsys(f, v) char *f; char **v; {
int t, status;
char **cpp;
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;
char *savetab;
int saveleft;
-char *
-savestr(cp)
- register char *cp;
-{
+char *savestr(cp) register char *cp; {
register int len;
len = strlen(cp) + 1;
return (cp);
}
-char *
-strspl(left, right)
- char *left, *right;
-{
+char *strspl(left, right) char *left; char *right; {
char buf[BUFSIZ];
strcpy(buf, left);
+/*#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;
exit(status);
}
-isnumber(s)
- char *s;
-{
+int isnumber(s) char *s; {
register int c;
while (c = *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;
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);
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: ");
+#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
* 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;
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;
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;
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);
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: ");
return (!fflag);
}
-newmode(nm)
- unsigned nm;
-{
+int newmode(nm) unsigned nm; {
register o, m, b;
int savem;
return (nm);
}
-_abs()
-{
+int _abs() {
register c, i;
i = 0;
#define SETID 06000 /* set[ug]id */
#define STICKY 01000 /* sticky bit */
-who()
-{
+int who() {
register m;
m = 0;
}
}
-what()
-{
+int what() {
switch (*ms) {
case '+':
return (0);
}
-where(om)
- register om;
-{
+int where(om) register om; {
register m;
m = 0;
-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;
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;
exit(1);
}
-long otoi(s)
-char *s;
-{
+long otoi(s) char *s; {
long v;
int base;
+#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;
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;
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;
}
}
-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;
return (0);
}
-Perror(s)
- char *s;
-{
+int Perror(s) char *s; {
fprintf(stderr, "cp: ");
perror(s);
+#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"
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";
{ "{", "", "", 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);
exit(retval);
}
-gtime()
-{
+int gtime() {
register int i, year, month;
int day, hour, mins, secs;
struct tm *L;
return (0);
}
-gp(dfault)
-{
+int gp(dfault) int dfault; {
register int c, d;
if (*sp == 0)
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 */
* 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;
-#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
char *ofile;
char *ibuf;
char *obuf;
-char *sbrk();
+/*char *sbrk();*/
int ibs = 512;
int obs = 512;
int bs;
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,
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;
goto loop;
}
-flsh()
-{
+int flsh() {
register c;
if(obc) {
}
}
-match(s)
-char *s;
-{
+int match(s) char *s; {
register char *cs;
cs = string;
return(1);
}
-number(big)
-{
+int number(big) int big; {
register char *cs;
long n;
/* never gets here */
}
-cnull(cc)
-{
+int cnull(cc) int cc; {
register c;
c = cc;
null(c);
}
-null(c)
-{
+int null(c) int c; {
*op = c;
op++;
}
}
-ascii(cc)
-{
+int ascii(cc) int cc; {
register c;
c = etoa[cc] & 0377;
}
}
-unblock(cc)
-{
+int unblock(cc) int cc; {
register c;
c = cc & 0377;
}
}
-ebcdic(cc)
-{
+int ebcdic(cc) int cc; {
register c;
c = cc;
null(c);
}
-ibm(cc)
-{
+int ibm(cc) int cc; {
register c;
c = cc;
null(c);
}
-block(cc)
-{
+int block(cc) int cc; {
register c;
c = 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);
+#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;
#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]=='-') {
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;
(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;
/*
* 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))
return "";
}
-eq(f1, f2)
- char *f1, *f2;
-{
+int eq(f1, f2) char *f1; char *f2; {
if (strncmp(f1, "/dev/", 5) == 0)
f1 += 5;
-#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;
} 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;
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;
-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;
-#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
* 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
int ninbuf;
int io;
int pflag;
-long lseek();
+/*long lseek();*/
int (*oldhup)();
int (*oldquit)();
int vflag = 1;
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)();
quit();
}
-commands()
-{
+int commands() {
int getfile(), gettty();
register *a1, c;
append(gettty, addr2-1);
continue;
-
case 'j':
if (addr2==0) {
addr1 = dot;
kflag = crinit(key, perm);
continue;
-
case '=':
setall();
newline();
}
}
-int *
-address()
-{
+int *address() {
register *a1, minus, c;
int n, relerr;
}
}
-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;
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')
error(Q);
}
-filename(comm)
-{
+int filename(comm) int comm; {
register char *p1, *p2;
register c;
}
}
-exfile()
-{
+int exfile() {
close(io);
io = -1;
if (vflag) {
}
}
-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) {
quit();
}
-error(s)
-char *s;
-{
+int error(s) char *s; {
register c;
wrapp = 0;
longjmp(savej, 1);
}
-getchr()
-{
+int getchr() {
char c;
if (lastc=peekc) {
peekc = 0;
return(lastc);
}
-gettty()
-{
+int gettty() {
register c;
register char *gf;
register char *p;
return(0);
}
-getfile()
-{
+int getfile() {
register c;
register char *lp, *fp;
return(0);
}
-putfile()
-{
+int putfile() {
int *a1, n;
register char *fp, *lp;
register nib;
}
}
-append(f, a)
-int *a;
-int (*f)();
-{
+int append(f, a) int (*f)(); int *a; {
register *a1, *a2, *rdot;
int nline, tl;
return(nline);
}
-callunix()
-{
+int callunix() {
register (*savint)(), pid, rpid;
int retcode;
puts("!");
}
-quit()
-{
+int quit() {
if (vflag && fchange && dol!=zero) {
fchange = 0;
error(Q);
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;
fchange = 1;
}
-gdelete()
-{
+int gdelete() {
register *a1, *a2, *a3;
a3 = dol;
fchange = 1;
}
-char *
-getline(tl)
-{
+char *getline(tl) int tl; {
register char *bp, *lp;
register nl;
return(linebuf);
}
-putline()
-{
+int putline() {
register char *bp, *lp;
register nl;
int tl;
return(nl);
}
-char *
-getblock(atl, iof)
-{
+char *getblock(atl, iof) int atl; int iof; {
extern read(), write();
register bno, off;
register char *p1, *p2;
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);
dot = dol = zero;
}
-global(k)
-{
+int global(k) int k; {
register char *gp;
register c;
register int *a1;
}
}
-join()
-{
+int join() {
register char *gp, *lp;
register *a1;
dot = addr1;
}
-substitute(inglob)
-{
+int substitute(inglob) int inglob; {
register *markp, *a1, nl;
int gsubf;
int getsub();
error(Q);
}
-compsub()
-{
+int compsub() {
register seof, c;
register char *p;
return(0);
}
-getsub()
-{
+int getsub() {
register char *p1, *p2;
p1 = linebuf;
return(0);
}
-dosub()
-{
+int dosub() {
register char *lp, *sp, *rp;
int c;
;
}
-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++;
return(sp);
}
-move(cflag)
-{
+int move(cflag) int cflag; {
register int *adt, *ad1, *ad2;
int getcopy();
fchange = 1;
}
-reverse(a1, a2)
-register int *a1, *a2;
-{
+int reverse(a1, a2) register int *a1; register int *a2; {
register int t;
for (;;) {
}
}
-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;
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++) {
return(0);
}
-advance(lp, ep)
-register char *ep, *lp;
-{
+int advance(lp, ep) register char *lp; register char *ep; {
register char *curlp;
int i;
}
}
-backref(i, lp)
-register i;
-register char *lp;
-{
+int backref(i, lp) register i; register char *lp; {
register char *bp;
bp = braslist[i];
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)
return(!af);
}
-putd()
-{
+int putd() {
register r;
r = count%10;
putchr(r + '0');
}
-puts(sp)
-register char *sp;
-{
+int puts(sp) register char *sp; {
col = 0;
while (*sp)
putchr(*sp++);
char line[70];
char *linp = line;
-putchr(ac)
-{
+int putchr(ac) int ac; {
register char *lp;
register c;
}
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;
}
}
-getkey()
-{
+int getkey() {
struct sgttyb b;
int save;
int (*sig)();
* 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];
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];
-#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
* 2 - some error
*/
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
#define CBRA 1
#define CCHR 2
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]) {
exit(retcode != 0 ? retcode : nsucc == 0);
}
-compile(astr)
-char *astr;
-{
+int compile(astr) char *astr; {
register c;
register char *ep, *sp;
char *cstart;
errexit("grep: RE error\n", (char *)NULL);
}
-execute(file)
-char *file;
-{
+int execute(file) char *file; {
register char *p1, *p2;
register c;
}
}
-advance(lp, ep)
-register char *lp, *ep;
-{
+int advance(lp, ep) register char *lp; register char *ep; {
register char *curlp;
char c;
char *bbeg;
}
return(0);
-
case CDOT|STAR:
curlp = lp;
while (*lp++);
}
}
-succeed(f)
-char *f;
-{
+int succeed(f) char *f; {
nsucc = 1;
if (sflag)
return;
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);
}
+#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;
+#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--;
+/*#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 */
"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[];
+/*#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:
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;
/*
*/
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;
* 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;
return (n);
}
-delexit()
-{
+int delexit() {
struct stat stbuf;
long size;
char c = 0;
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;
/*
* 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;
* 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) {
* 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])
* 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;
/*
* 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;
return(0);
}
-middle()
-{
+int middle() {
register struct nlist *sp;
long csize, t, corigin, ocsize;
int nund, rnd;
}
}
-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;
off_t wroff;
struct biobuf toutb;
-setupout()
-{
+int setupout() {
int bss;
struct stat stbuf;
extern char *sys_errlist[];
}
}
-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)
wroff += inc;
}
-load2arg(acp)
-char *acp;
-{
+int load2arg(acp) char *acp; {
register char *cp;
off_t loc;
close(infil);
}
-load2(loc)
-long loc;
-{
+int load2(loc) long loc; {
int size;
register struct nlist *sp;
register struct local *lp;
0, 0,
};
-tracesym()
-{
+int tracesym() {
register struct tynames *tp;
if (cursym.n_type & N_STAB)
* 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;
free(codep);
}
-finishout()
-{
+int finishout() {
register int i;
int nsymt;
delexit();
}
-mkfsym(s)
-char *s;
-{
+int mkfsym(s) char *s; {
if (sflag || xflag)
return;
symwrite(&cursym, sout);
}
-getarhdr()
-{
+int getarhdr() {
register char *cp;
mget((char *)&archdr, sizeof archdr, &text);
}
}
-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;
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;
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;
sp->size = 0;
}
-char
-get(asp)
-STREAM *asp;
-{
+char get(asp) STREAM *asp; {
register STREAM *sp;
sp = asp;
return(*sp->ptr++);
}
-getfile(acp)
-char *acp;
-{
+int getfile(acp) char *acp; {
register int c;
char arcmag[SARMAG+1];
struct stat stb;
* 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];
return (fd);
}
-struct nlist **
-lookup()
-{
+struct nlist **lookup() {
register int sh;
register struct nlist **hp;
register char *cp, *cp1;
/*NOTREACHED*/
}
-symfree(saved)
- struct nlist *saved;
-{
+int symfree(saved) struct nlist *saved; {
register struct symseg *gp;
register struct nlist *sp;
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;
return (lookup());
}
-enter(hp)
-register struct nlist **hp;
-{
+int enter(hp) register struct nlist **hp; {
register struct nlist *sp;
if (*hp==0) {
}
}
-symx(sp)
- struct nlist *sp;
-{
+int symx(sp) struct nlist *sp; {
register struct symseg *gp;
if (sp == 0)
/*NOTREACHED*/
}
-symreloc()
-{
+int symreloc() {
if(funding) return;
switch (cursym.n_type & 017) {
}
}
-error(n, s)
-char *s;
-{
+int error(n, s) int n; char *s; {
if (errlev==0)
printf("ld:");
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);
error(1, "bad format");
}
-round(v, r)
- int v;
- u_long r;
-{
+int round(v, r) int v; u_long r; {
r--;
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;
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)
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;
goto top;
}
-bflush()
-{
+int bflush() {
register struct biobuf *bp;
if (bwrerror)
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)
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);
+#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++;
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;
+#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 ]
* 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 */
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;
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;
exit(0);
}
-getloginname(up)
- register struct utmp *up;
-{
+int getloginname(up) register struct utmp *up; {
register char *namep;
char c;
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) {
return (0);
}
-showmotd()
-{
+int showmotd() {
FILE *mf;
register c;
#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)
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");
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 {
"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;
* 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);
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;
+#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
* 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)
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;
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;
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;
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;
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;
}
}
-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') {
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) {
return (dfile);
}
-char *
-savestr(str)
- char *str;
-{
+char *savestr(str) char *str; {
char *cp = malloc(strlen(str) + 1);
if (cp == NULL) {
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;
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;
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])]; ) {
/* 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))
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;
return (nc[cp].name);
}
-char *
-getgroup(gid)
-{
+char *getgroup(gid) int gid; {
register struct group *gr;
static init;
struct group *getgrent();
-#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"
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";
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;
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;
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++)
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;
}
/* copy temp or whatever back to /usr/spool/mail */
-copyback()
-{
+int copyback() {
register i, c;
int fd, new = 0, oldmask;
struct stat stbuf;
}
/* 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;
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];
putc(getc(tmpf), f);
}
-isfrom(lp)
-register char *lp;
-{
+int isfrom(lp) register char *lp; {
register char *p;
for (p = from; *p; )
return(1);
}
-bulkmail(argc, argv)
-char **argv;
-{
+int bulkmail(argc, argv) int argc; char **argv; {
char truename[100];
int first;
register char *cp;
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];
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;
}
}
-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;
return(1);
}
-delex(i)
-{
+int delex(i) int i; {
setsig(i, delex);
putc('\n', stderr);
if (delflg)
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;
}
/* 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')
return(p);
}
-safefile(f)
- char *f;
-{
+int safefile(f) char *f; {
struct stat statb;
if (lstat(f, &statb) < 0)
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");
+#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) {
+#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)
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;
/*
* 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++)
/*
* 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;
+#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
#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;
return (1);
}
-movewithshortname(src, dest)
- char *src, *dest;
-{
+int movewithshortname(src, dest) char *src; char *dest; {
register char *shortname;
char target[MAXPATHLEN + 1];
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) {
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();
return (i == 'y');
}
-char *
-dname(name)
- register char *name;
-{
+char *dname(name) register char *name; {
register char *p;
p = 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);
+#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] == '-') {
-#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
#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++;
exit(errs);
}
-namelist()
-{
+int namelist() {
register int j;
archive = 0;
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++) {
}
}
-compare(p1, p2)
-struct nlist *p1, *p2;
-{
+int compare(p1, p2) struct nlist *p1; struct nlist *p2; {
register i;
if (nflg) {
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;
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);
0, 0
};
-char *
-stab(val)
-{
+char *stab(val) int val; {
register struct stabnames *sp;
static char prbuf[32];
+#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.
*
* 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
#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 */
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];
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
/* 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;
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;
/*
* 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)
/*
* 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);
/*
* 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);
}
/*
* check for possible offset [label]
*/
- if (argc > 0)
- {
+ if (argc > 0) {
addr = get_addr(*argv);
offset(addr);
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';
}
* 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');
}
}
}
-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);
}
}
-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]; };
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
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",
/* 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)
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';
}
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;
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");
return("\\t");
default:
- if (isprint(c))
- {
+ if (isprint(c)) {
s[0] = c;
return(s);
}
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)
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
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];
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
*--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 */
}
}
- while (val)
- {
+ while (val) {
/*
* This is really what's being done ...
* *--b = d[val % rad];
tmp1 = ndigits - (&_icv_buf[MAXINTLENGTH] - b);
tmp2 = _signed? ' ':'0';
- while (tmp1 > 0)
- {
+ while (tmp1 > 0) {
*--b = tmp2;
tmp1--;
}
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';
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.
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);
}
}
}
-#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) &&
+#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());
}
+/*#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
* 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()
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;
exit(0);
}
-unlimit(lim)
-{
+int unlimit(lim) int lim; {
struct rlimit rlim;
rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
/*
* 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];
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;
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();
/*
* 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];
*
* 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);
/*
* Removes '-'s from the input string.
*/
-remove_hyphens(str)
- char *str;
-{
+int remove_hyphens(str) char *str; {
char *hyphen;
while ((hyphen = index(str, '-')) != NULL)
* 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)
*
* 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;
* "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 *)
* 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;
+#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)
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();
done();
}
-done()
-{
+int done() {
if (tty)
chmod(tty, mode);
}
/* 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);
return(1);
}
-onintr()
-{
+int onintr() {
if (tty)
chmod(tty, mode);
_exit(1);
}
-fixtty()
-{
+int fixtty() {
struct stat sbuf;
tty = ttyname(1);
}
/* 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;
header = sheader;
}
-mopen(ap)
-char **ap;
-{
+int mopen(ap) char **ap; {
register char **p, *p1;
p = ap;
}
}
-putpage()
-{
+int putpage() {
register int lastcol, i, c;
int j;
}
}
-nexbuf()
-{
+int nexbuf() {
register int n;
register char *rbufp;
bufp = rbufp;
}
-tpgetc(ai)
-{
+int tpgetc(ai) int ai; {
register char **p;
register int c, i;
return(c);
}
-pgetc(i)
-{
+int pgetc(i) int i; {
register int c;
if (peekc) {
icol++;
return(c);
}
-put(ac)
-{
+int put(ac) int ac; {
register int ns, c;
c = ac;
+/*#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",
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;
#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;
exit(npr == 0);
}
-_getw(loc)
- unsigned long loc;
-{
+int _getw(loc) unsigned long loc; {
int word;
klseek(kmem, (long)loc, 0);
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;
*/
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;
fclose(fp);
}
-readpsdb(unixname)
- char *unixname;
-{
+int readpsdb(unixname) char *unixname; {
register i;
register FILE *fp;
char unamebuf[BUFSIZ];
return(0);
}
-openfiles(argc, argv)
- char **argv;
-{
+int openfiles(argc, argv) int argc; char **argv; {
kmemf = "/dev/kmem";
if (kflg)
}
}
-getkvars(argc, argv)
- char **argv;
-{
+int getkvars(argc, argv) int argc; char **argv; {
int faildb = 0; /* true if psdatabase init failed */
int i;
/*
* get the valloc'ed kernel variables for symbolic wait channels
*/
-getvchans()
-{
+int getvchans() {
int i, tmp;
if (nflg)
}
#undef addv
}
-printhdr()
-{
+int printhdr() {
char *hdr;
if (sflg+lflg+vflg+uflg > 1) {
(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);
}
struct direct *dbuf;
int dialbase;
-getdev()
-{
+int getdev() {
register DIR *df;
struct ttys *t;
struct lttys *lt;
* 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;
cand[x] = nttys-1;
}
-char *
-gettty()
-{
+char *gettty() {
register char *p;
register struct ttys *dp;
struct stat stb;
return (p);
}
-save()
-{
+int save() {
register struct savcom *sp;
register struct asav *ap;
register char *cp;
npr++;
}
-double
-pmem(ap)
- register struct asav *ap;
-{
+double pmem(ap) register struct asav *ap; {
double fracmem;
int szptudot;
return (100.0 * fracmem);
}
-double
-pcpu()
-{
+double pcpu() {
time_t time;
time = mproc->p_time;
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;
return (1);
}
-char *
-getcmd()
-{
+char *getcmd() {
char cmdbuf[CLSIZE*NBPG];
union {
char argc[CLSIZE*NBPG];
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;
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;
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;
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)
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];
* 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;
}
/*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)
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;
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))
* 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;
return (nc[cp].name);
}
-char *
-savestr(cp)
- char *cp;
-{
+char *savestr(cp) char *cp; {
register unsigned len;
register char *dp;
* 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;
* 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;
* 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;
/*
* 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;
/*
* 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;
/*
* 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;
+#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) {
+/*#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;
} *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;
exit(errs);
}
-verifydir(cp)
- char *cp;
-{
+int verifydir(cp) char *cp; {
struct stat stb;
if (stat(cp, &stb) >= 0) {
exit(1);
}
-char *
-colon(cp)
- char *cp;
-{
+char *colon(cp) char *cp; {
while (*cp) {
if (*cp == ':')
return (0);
}
-okname(cp0)
- char *cp0;
-{
+int okname(cp0) char *cp0; {
register char *cp = cp0;
register int c;
return (0);
}
-susystem(s)
- char *s;
-{
+int susystem(s) char *s; {
int status, pid, w;
register int (*istat)(), (*qstat)();
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;
}
}
-#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;
(void) response();
}
-response()
-{
+int response() {
char resp, c, rbuf[BUFSIZ], *cp = rbuf;
if (read(rem, &resp, 1) != 1)
/*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;
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;
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));
+#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 */
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);
/*
* 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 */
/*
* boolean: is it "." or ".." ?
*/
-dotname(s)
- char *s;
-{
+int dotname(s) char *s; {
if (s[0] == '.')
if (s[1] == '.')
if (s[2] == '\0')
/*
* Get a yes/no answer from the user.
*/
-yes()
-{
+int yes() {
int i, b;
i = b = getchar();
/*
* Append 'name' to 'path'.
*/
-append(name)
- char *name;
-{
+int append(name) char *name; {
register int n;
n = strlen(name);
-#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
** 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 */
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);
}
(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;
(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);
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);
}
+#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) {
+#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;
+#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();
exit(status);
}
-strip(name)
- char *name;
-{
+int strip(name) char *name; {
register f;
long size;
+#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[] = {
"38400", EXTB,
0,
};
-struct
-{
+struct {
char *string;
int set;
int reset;
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];
ioctl(1, TIOCSWINSZ, &win);
}
-eq(string)
-char *string;
-{
+int eq(string) char *string; {
int i;
if(!arg)
return(1);
}
-prmodes(all)
-{
+int prmodes(all) int all; {
register m;
int any;
}
}
-pcol(ch1, ch2)
- int ch1, ch2;
-{
+int pcol(ch1, ch2) int ch1; int ch2; {
int nout = 0;
ch1 &= 0377;
}
}
-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);
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);
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]);
}
+#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=";
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;
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;
}
}
-char *
-getenv(ename)
- char *ename;
-{
+char *getenv(ename) char *ename; {
register char *cp, *dp;
register char **ep = environ;
+#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();
}
+#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
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)
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) {
/*
return(mt);
}
-dorep(argv)
- char *argv[];
-{
+int dorep(argv) char *argv[]; {
register char *cp, *cp2;
char wdir[MAXPATHLEN], tempdir[MAXPATHLEN], *parent;
}
}
-endtape()
-{
+int endtape() {
return (dblock.dbuf.name[0] == '\0');
}
-getdir()
-{
+int getdir() {
register struct stat *sp;
int i;
fprintf(tfile, "%s %s\n", dblock.dbuf.name, dblock.dbuf.mtime);
}
-passtape()
-{
+int passtape() {
long blocks;
char *bufp;
(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];
}
}
-doxtract(argv)
- char *argv[];
-{
+int doxtract(argv) char *argv[]; {
long blocks, bytes;
int ofile, i;
}
}
-dotable(argv)
- char *argv[];
-{
+int dotable(argv) char *argv[]; {
register int i;
for (;;) {
}
}
-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();
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;
* 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;
/*
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++)
sprintf(dblock.dbuf.mtime, "%11lo ", sp->st_mtime);
}
-checksum()
-{
+int checksum() {
register i;
register char *cp;
return (i);
}
-checkw(c, name)
- char *name;
-{
+int checkw(c, name) int c; char *name; {
if (!wflag)
return (1);
printf("%c ", c);
return (response() == 'y');
}
-response()
-{
+int response() {
char c;
c = getchar();
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){
}
/* 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;
}
}
-done(n)
-{
+int done(n) int n; {
unlink(tname);
exit(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();
/*
* 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);
#define N 200
int njab;
-daddr_t
-lookup(s)
- char *s;
-{
+daddr_t lookup(s) char *s; {
register i;
daddr_t a;
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;
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')
return (b[i+1] == ' '? 0 : -1);
}
-readtape(buffer)
- char *buffer;
-{
+int readtape(buffer) char *buffer; {
char *bufp;
if (first == 0)
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) {
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) {
return (nblock - recno);
}
-backtape()
-{
+int backtape() {
static int mtdev = 1;
static struct mtop mtop = {MTBSR, 1};
struct mtget mtget;
recno--;
}
-flushtape()
-{
+int flushtape() {
int i;
i = write(mt, (char *)tbuf, TBLOCK*nblock);
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("");
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;
return (count);
}
-char *
-getcwd(buf)
- char *buf;
-{
+char *getcwd(buf) char *buf; {
if (getwd(buf) == NULL) {
fprintf(stderr, "tar: %s\n", buf);
exit(1);
return (buf);
}
-getbuf()
-{
+int getbuf() {
if (nblock == 0) {
fstat(mt, &stbuf);
#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;
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);
}
}
-char *
-getmem(size)
-{
+char *getmem(size) int size; {
char *p = malloc((unsigned) size);
if (p == NULL && freemem) {
-#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 };
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]=='-') {
}
}
-stash(p)
-{
+int stash(p) int p; {
int k;
int i;
int d;
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);
}
-#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
* [ 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
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;
exit(status);
}
-char *nxtarg(mt) {
+char *nxtarg(mt) int mt; {
if (ap>=ac) {
if(mt) {
return(av[ap++]);
}
-exp() {
+int exp() {
int p1;
p1 = e1();
return(p1);
}
-e1() {
+int e1() {
int p1;
p1 = e2();
return(p1);
}
-e2() {
+int e2() {
if (EQ(nxtarg(0), "!"))
return(!e3());
ap--;
return(e3());
}
-e3() {
+int e3() {
int p1;
register char *a;
char *p2;
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) {
return(0);
}
-ftype(f)
-char *f;
-{
+int ftype(f) char *f; {
struct stat statb;
if(stat(f,&statb)<0)
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));
exit(255);
}
-length(s)
- char *s;
-{
+int length(s) char *s; {
char *es=s;
while(*es++);
return(es-s-1);
-#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;
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);
}
+#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.
* 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"
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;
exit(0);
}
-sendmes(tty)
-char *tty;
-{
+int sendmes(tty) char *tty; {
register f, flags;
static char t[50] = "/dev/";
int e, i;
+#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)
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[];
}
}
-putline()
-{
+int putline() {
register char *cbuf;
printf("%-*.*s %-*.*s",
-#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] = "???";
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;
}
}
-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);
sigs(eof);
}
-sigs(sig)
- int (*sig)();
-{
+int sigs(sig) int (*sig)(); {
register i;
for (i=0; signum[i]; i++)