+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+#include <sys/file.h>
+/*#include <sys/signal.h> gen.h*/
+#include <sys/stat.h>
+/*#include <time.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)ar11.c 4.3 (Berkeley) 12/6/82";
+#endif
/* ar11 - archiver for PDP-11 formatted archives */
-#include <signal.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
#define ARMAG ((short)0177545)
struct ar_hdr {
char ar_name[14];
#define mklong(sp) (((sp)[0] << 16) + (sp)[1])
#define unmklong(sp,l) { sp[0] = l >> 16; sp[1] = l & 0177777; }
#define fixhdr(hdr) swaphdr(hdr)
-struct ar_hdr swaphdr();
+/*struct ar_hdr swaphdr();*/
#endif
struct stat stbuf;
char *opt = { "uvnbai" };
int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
-int sigdone();
-int rcmd();
-int dcmd();
-int xcmd();
-int tcmd();
-int pcmd();
-int mcmd();
+/*int sigdone();*/
+/*int rcmd();*/
+/*int dcmd();*/
+/*int xcmd();*/
+/*int tcmd();*/
+/*int pcmd();*/
+/*int mcmd();*/
int (*comfun)();
char flg[26];
char **namv;
int bastate;
char buf[512];
-char *trim();
-char *mktemp();
-char *ctime();
+/*char *trim();*/
+/*char *mktemp();*/
+/*char *ctime();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
-main(argc, argv)
-char *argv[];
-{
+int main __P((int argc, char *argv[]));
+int setcom __P((int (*fun)(void)));
+int rcmd __P((void));
+int dcmd __P((void));
+int xcmd __P((void));
+int pcmd __P((void));
+int mcmd __P((void));
+int tcmd __P((void));
+int init __P((void));
+int getaf __P((void));
+int usage __P((void));
+int noar __P((void));
+int sigdone __P((void));
+int done __P((int c));
+int notfound __P((void));
+int cleanup __P((void));
+int install __P((void));
+int movefil __P((int f));
+int stats __P((void));
+int copyfil __P((int fi, int fo, int flag));
+int getdir __P((void));
+int match __P((void));
+int bamatch __P((void));
+int phserr __P((void));
+int mesg __P((int c));
+char *trim __P((char *s));
+int longt __P((void));
+int pmode __P((void));
+int select __P((int *pairp));
+int wrerr __P((void));
+struct ar_hdr swaphdr __P((struct ar_hdr hdr));
+
+int main(argc, argv) int argc; char *argv[]; {
register i;
register char *cp;
done(notfound());
}
-setcom(fun)
-int (*fun)();
-{
+int setcom(fun) int (*fun)(); {
if(comfun != 0) {
fprintf(stderr, "ar11: 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;
if(getaf())
}
}
-pcmd()
-{
+int pcmd() {
if(getaf())
noar();
}
}
-mcmd()
-{
+int mcmd() {
init();
if(getaf())
install();
}
-tcmd()
-{
+int tcmd() {
if(getaf())
noar();
}
}
-init()
-{
+int init() {
static short mbuf = fixshort(ARMAG);
tfnam = mktemp("/tmp/vXXXXX");
wrerr();
}
-getaf()
-{
+int getaf() {
short mbuf;
af = open(arnam, 0);
return(0);
}
-usage()
-{
+int usage() {
printf("usage: ar11 [%s][%s] archive files ...\n", opt, man);
done(1);
}
-noar()
-{
+int noar() {
fprintf(stderr, "ar11: %s does not exist\n", arnam);
done(1);
}
-sigdone()
-{
+int sigdone() {
done(100);
}
-done(c)
-{
+int done(c) int c; {
if(tfnam)
unlink(tfnam);
exit(c);
}
-notfound()
-{
+int notfound() {
register i, n;
n = 0;
return(n);
}
-cleanup()
-{
+int cleanup() {
register i, f;
for(i=0; i<namc; i++) {
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; {
register char *cp;
register i;
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 i;
i = read(af, (char *)&arbuf, sizeof arbuf);
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, "ar11: phase error on %s\n", file);
}
-mesg(c)
-{
+int mesg(c) int c; {
if(flg['v'-'a'])
if(c != 'c' || flg['v'-'a'] > 1)
printf("%c - %s\n", c, file);
}
-char *
-trim(s)
-char *s;
-{
+char *trim(s) char *s; {
register char *p1, *p2;
for(p1 = s; *p1; p1++)
#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);
}
#ifdef mc68000
-struct ar_hdr
-swaphdr(hdr)
- struct ar_hdr hdr;
-{
+struct ar_hdr swaphdr(hdr) struct ar_hdr hdr; {
hdr.ar_sdate[0] = fixshort(hdr.ar_sdate[0]);
hdr.ar_sdate[1] = fixshort(hdr.ar_sdate[1]);
hdr.ar_ssize[0] = fixshort(hdr.ar_ssize[0]);
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)basename.c 4.2 (Berkeley) 10/20/82";
+#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
register char *p1, *p2, *p3;
if (argc < 2) {
-#ifndef lint
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)cal.c 4.3 (Berkeley) 83/08/11";
#endif
"September", "October", "November", "December",
};
char string[432];
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int number __P((char *str));
+int pstr __P((char *str, int n));
+int cal __P((int m, int y, char *p, int w));
+int jan1 __P((int yr));
+
+int main(argc, argv) int argc; char *argv[]; {
register y, i, j;
int m;
printf("Bad argument\n");
}
-number(str)
-char *str;
-{
+int number(str) char *str; {
register n, c;
register char *s;
return(n);
}
-pstr(str, n)
-char *str;
-{
+int pstr(str, n) char *str; int n; {
register i;
register char *s;
30, 31, 30, 31,
};
-cal(m, y, p, w)
-char *p;
-{
+int cal(m, y, p, w) int m; int y; char *p; int w; {
register d, i;
register char *s;
* of jan 1 of given year
*/
-jan1(yr)
-{
+int jan1(yr) int yr; {
register y, d;
/*
-static char *sccsid = "@(#)cb.c 4.3 (Berkeley) 2/17/86";
#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)cb.c 4.3 (Berkeley) 2/17/86";
+#endif
+/*#include <stdio.h>*/
int slevel[10];
int clevel = 0;
int spflg[20][10];
int tabs = 0;
int lastchar;
int c;
-int getstr();
-main(argc,argv) int argc;
-char argv[];
-{
+/*int getstr();*/
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char argv[]));
+int ptabs __P((void));
+int getch __P((void));
+int _puts __P((void));
+int lookup __P((char *tab[]));
+int getstr __P((void));
+int gotelse __P((void));
+int getnl __P((void));
+int comment __P((void));
+
+int main(argc, argv) int argc; char argv[]; {
while((c = getch()) != EOF){
switch(c){
case ' ':
}
}
}
-ptabs(){
+int ptabs() {
int i;
for(i=0; i < tabs; i++)printf("\t");
}
-getch(){
+int getch() {
if(peek < 0 && lastchar != ' ' && lastchar != '\t')pchar = lastchar;
lastchar = (peek<0) ? getc(stdin):peek;
peek = -1;
return(lastchar);
}
-_puts(){
+int _puts() {
if(j > 0){
if(sflg != 0){
ptabs();
}
}
}
-lookup(tab)
-char *tab[];
-{
+int lookup(tab) char *tab[]; {
char r;
int l,kk,k,i;
if(j < 1)return(0);
}
return(0);
}
-getstr(){
+int getstr() {
char ch;
beg:
if((ch = string[j++] = getch()) == '\\'){
}
else return(ch);
}
-gotelse(){
+int gotelse() {
tabs = stabs[clevel][iflev];
pflg[level] = spflg[clevel][iflev];
ind[level] = sind[clevel][iflev];
ifflg = 1;
}
-getnl(){
+int getnl() {
while((peek = getch()) == '\t' || peek == ' '){
string[j++] = peek;
peek = -1;
}
return(0);
}
-comment(){
+int comment() {
int i = j;
while ((c = getch()) != EOF) {
-static char *sccsid = "@(#)checkeq.c 4.2 (Berkeley) 4/29/83";
#include <stdio.h>
+#include <sys/errno.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)checkeq.c 4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
FILE *fin;
int delim = '$';
-main(argc, argv) char **argv; {
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int check __P((FILE *f));
+
+int main(argc, argv) int argc; char **argv; {
if (argc <= 1)
check(stdin);
}
}
-check(f)
-FILE *f;
-{
+int check(f) FILE *f; {
int start, line, eq, ndel, totdel;
char in[600], *p;
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)col.c 4.2 (Berkeley) 5/15/84";
-# include <stdio.h>
+#endif
+/*# include <stdio.h>*/
# define PL 256
# define ESC '\033'
# define RLF '\013'
int ll, llh, mustwr;
int pcp = 0;
char *pgmname;
-char *strcpy();
-
-main (argc, argv)
- int argc; char **argv;
-{
+/*char *strcpy();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int outc __P((int c));
+int store __P((int lno));
+int fetch __P((int lno));
+int emit __P((char *s, int lineno));
+int incr __P((void));
+int decr __P((void));
+
+int main(argc, argv) int argc; char **argv; {
int i;
int greek;
register int c;
exit(0);
}
-outc (c)
- register char c;
-{
+int outc(c) int c; {
if (lp > cp) {
line = lbuff;
lp = 0;
}
}
-store (lno)
-{
+int store(lno) int lno; {
void *malloc();
lno %= PL;
strcpy (page[lno],lbuff);
}
-fetch(lno)
-{
+int fetch(lno) int lno; {
register char *p;
lno %= PL;
if (page[lno])
strcpy (line, page[lno]);
}
-emit (s, lineno)
- char *s;
- int lineno;
-{
+int emit(s, lineno) char *s; int lineno; {
static int cline = 0;
register int ncp;
register char *p;
}
}
-incr()
-{
+int incr() {
store (ll++);
if (ll > llh)
llh = ll;
fetch (ll);
}
-decr()
-{
+int decr() {
if (ll > mustwr - PL) {
store (ll--);
fetch (ll);
-static char *sccsid = "@(#)comm.c 4.2 (Berkeley) 4/29/83";
#include <stdio.h>
+#include <sys/errno.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)comm.c 4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
#define LB 256
int one;
int two;
FILE *ib1;
FILE *ib2;
-FILE *openfil();
-main(argc,argv)
-char *argv[];
-{
+/*FILE *openfil();*/
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int rd __P((FILE *file, char *buf));
+int wr __P((char *str, int n));
+int copy __P((FILE *ibuf, char *lbuf, int n));
+int compare __P((char *a, char *b));
+FILE *openfil __P((char *s));
+
+int main(argc, argv) int argc; char *argv[]; {
int l;
char lb1[LB],lb2[LB];
ib1 = openfil(argv[1]);
ib2 = openfil(argv[2]);
-
if(rd(ib1,lb1) < 0) {
if(rd(ib2,lb2) < 0) exit(0);
copy(ib2,lb2,2);
}
}
-rd(file,buf)
-FILE *file;
-char *buf;
-{
+int rd(file, buf) FILE *file; char *buf; {
register int i, c;
i = 0;
return(-1);
}
-wr(str,n)
- char *str;
-{
+int wr(str, n) char *str; int n; {
switch(n) {
printf("%s%s\n",ldr[n-1],str);
}
-copy(ibuf,lbuf,n)
-FILE *ibuf;
-char *lbuf;
-{
+int copy(ibuf, lbuf, n) FILE *ibuf; char *lbuf; int n; {
do {
wr(lbuf,n);
} while(rd(ibuf,lbuf) >= 0);
exit(0);
}
-compare(a,b)
- char *a,*b;
-{
+int compare(a, b) char *a; char *b; {
register char *ra,*rb;
ra = --a;
if(*ra < *rb) return(1);
return(2);
}
-FILE *openfil(s)
-char *s;
-{
+FILE *openfil(s) char *s; {
FILE *b;
if(s[0]=='-' && s[1]==0)
b = stdin;
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/proc.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)crypt.c 4.3 (Berkeley) 1/25/85";
+#endif
/*
* A one-rotor machine designed along the lines of Enigma
*/
#define ECHO 010
-#include <stdio.h>
+/*#include <stdio.h>*/
#define ROTORSZ 256
#define MASK 0377
char t1[ROTORSZ];
char t2[ROTORSZ];
char t3[ROTORSZ];
char deck[ROTORSZ];
-char *getpass();
+/*char *getpass();*/
char buf[13];
-setup(pw)
-char *pw;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int setup __P((char *pw));
+int main __P((int argc, char *argv[]));
+int shuffle __P((char deck[]));
+
+int setup(pw) char *pw; {
int ic, i, k, temp, pf[2];
int pid, wpid;
unsigned random;
t2[t1[i]&MASK] = i;
}
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
register i, n1, n2, nr1, nr2;
int secureflg = 0;
}
}
-shuffle(deck)
- char deck[];
-{
+int shuffle(deck) char deck[]; {
int i, ic, k, temp;
unsigned random;
static long seed = 123;
-#ifndef lint
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+/*#include <sys/errno.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)deroff.c 4.5 (Berkeley) 84/12/18";
-#endif not lint
+#endif
-#include <stdio.h>
+/*#include <stdio.h>*/
/*
* Deroff command -- strip troff, eqn, and Tbl sequences from
#ifdef DEBUG
# define C _Cget()
# define C1 _C1get()
-#else not DEBUG
+#else
# define C Cget
# define C1 C1get
-#endif not DEBUG
+#endif
#define SKIP while(C != '\n')
#define SKIP_TO_COM SKIP; SKIP; pc=c; while(C != '.' || pc != '\n' || C > 'Z')pc=c
#ifdef DEBUG
char *mactab[] = {"-ms", "-mm", "-me", "-ma"};
-#endif DEBUG
+#endif
#define ONE 1
#define TWO 2
int ldelim;
int rdelim;
-
int argc;
char **argv;
FILE *files[15];
FILE **filesp;
FILE *infile;
-FILE *opn();
+/*FILE *opn();*/
/*
* Flags for matching conditions other than
* the macro name
*/
#define M(cond, c1, c2, func) {cond, tomac(c1, c2), func}
\f
-main(ac, av)
-int ac;
-char **av;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int ac, char **av));
+int skeqn __P((void));
+FILE *opn __P((register char *p));
+int eof __P((void));
+int getfname __P((void));
+int fatal __P((char *s, char *p));
+int textline __P((char *str, int _const));
+int work __P((void));
+int regline __P((int (*pfunc)(void), int _const));
+int macro __P((void));
+int tbl __P((void));
+int stbl __P((void));
+int eqn __P((void));
+int backsl __P((void));
+char *copys __P((register char *s));
+int sce __P((void));
+int refer __P((int c1));
+int inpic __P((void));
+int _C1get __P((void));
+int _Cget __P((void));
+int msputmac __P((register char *s, int _const));
+int msputwords __P((int macline));
+int meputmac __P((register char *cp, int _const));
+int meputwords __P((int macline));
+int noblock __P((int a1, int a2));
+int EQ __P((void));
+int domacro __P((void));
+int PS __P((void));
+int skip __P((void));
+int intbl __P((void));
+int outtbl __P((void));
+int so __P((void));
+int nx __P((void));
+int skiptocom __P((void));
+int PP __P((pacmac c12));
+int AU __P((void));
+int SH __P((pacmac c12));
+int UX __P((void));
+int MMHU __P((pacmac c12));
+int mesnblock __P((pacmac c12));
+int mssnblock __P((pacmac c12));
+int nf __P((void));
+int ce __P((void));
+int meip __P((pacmac c12));
+int mepp __P((pacmac c12));
+int mesh __P((pacmac c12));
+int mefont __P((pacmac c12));
+int manfont __P((pacmac c12));
+int manpp __P((pacmac c12));
+int defcomline __P((pacmac c12));
+int comline __P((void));
+int macsort __P((struct mactab *p1, struct mactab *p2));
+int sizetab __P((register struct mactab *mp));
+struct mactab *macfill __P((register struct mactab *dst, register struct mactab *src));
+int buildtab __P((struct mactab **r_back, int *r_size));
+
+int main(ac, av) int ac; char **av; {
register int i;
int errflg = 0;
register optchar;
#ifdef DEBUG
printf("msflag = %d, mac = %s, keepblock = %d, disp = %d\n",
msflag, mactab[mac], keepblock, disp);
-#endif DEBUG
+#endif
if (argc == 0){
infile = stdin;
} else {
++argv;
}
-
files[0] = infile;
filesp = &files[0];
chars[':'] = PUNCT;
work();
}
-char *calloc();
+/*char *calloc();*/
-skeqn()
-{
+int skeqn() {
while((c = getc(infile)) != rdelim)
if(c == EOF)
c = eof();
return(c = ' ');
}
-FILE *opn(p)
-register char *p;
-{
+FILE *opn(p) register char *p; {
FILE *fd;
if( (fd = fopen(p, "r")) == NULL) {
return(fd);
}
-eof()
-{
+int eof() {
if(infile != stdin)
fclose(infile);
if(filesp > files)
return(C);
}
-getfname()
-{
+int getfname() {
register char *p;
struct chain {
struct chain *nextp;
/* see if this name has already been used */
for(q = namechain ; q; q = q->nextp)
- if( ! strcmp(fname, q->datap))
- {
+ if( ! strcmp(fname, q->datap)) {
fname[0] = '\0';
return;
}
namechain = q;
}
-fatal(s,p)
-char *s, *p;
-{
+int fatal(s, p) char *s; char *p; {
fprintf(stderr, "Deroff: ");
fprintf(stderr, s, p);
exit(1);
}
/*ARGSUSED*/
-textline(str, _const)
- char *str;
- int _const;
-{
+int textline(str, _const) char *str; int _const; {
if (wordflag) {
msputwords(0);
return;
puts(str);
}
-work()
-{
- for( ;; )
- {
+int work() {
+ for( ;; ) {
C;
#ifdef FULLDEBUG
printf("Starting work with `%c'\n", c);
-#endif FULLDEBUG
+#endif
if(c == '.' || c == '\'')
comline();
else
}
}
-regline(pfunc, _const)
- int (*pfunc)();
- int _const;
-{
+int regline(pfunc, _const) int (*pfunc)(); int _const; {
line[0] = c;
lp = line;
- for( ; ; )
- {
+ for( ; ; ) {
if(c == '\\') {
*lp = ' ';
backsl();
(*pfunc)(line, _const);
}
-macro()
-{
+int macro() {
if(msflag){
do {
SKIP;
inmacro = YES;
}
-tbl()
-{
+int tbl() {
while(C != '.');
SKIP;
intable = YES;
}
-stbl()
-{
+int stbl() {
while(C != '.');
SKIP_TO_COM;
if(c != 'T' || C != 'E'){
}
}
-eqn()
-{
+int eqn() {
register int c1, c2;
register int dflg;
char last;
dflg = 1;
SKIP;
- for( ;;)
- {
- if(C1 == '.' || c == '\'')
- {
+ for( ;;) {
+ if(C1 == '.' || c == '\'') {
while(C1==' ' || c=='\t')
;
- if(c=='E' && C1=='N')
- {
+ if(c=='E' && C1=='N') {
SKIP;
if(msflag && dflg){
putchar('x');
return;
}
}
- else if(c == 'd') /* look for delim */
- {
+ else if(c == 'd') /* look for delim */ {
if(C1=='e' && C1=='l')
- if( C1=='i' && C1=='m')
- {
+ if( C1=='i' && C1=='m') {
while(C1 == ' ');
if((c1=c)=='\n' || (c2=C1)=='\n'
- || (c1=='o' && c2=='f' && C1=='f') )
- {
+ || (c1=='o' && c2=='f' && C1=='f') ) {
ldelim = NOCHAR;
rdelim = NOCHAR;
}
}
}
-backsl() /* skip over a complete backslash construction */
-{
+int backsl() /* skip over a complete backslash construction */ {
int bdelim;
sw:
- switch(C)
- {
+ switch(C) {
case '"':
SKIP;
return;
}
}
-char *copys(s)
-register char *s;
-{
+char *copys(s) register char *s; {
register char *t, *t0;
if( (t0 = t = calloc( (unsigned)(strlen(s)+1), sizeof(*t) ) ) == NULL)
return(t0);
}
-sce()
-{
+int sce() {
register char *ap;
register int n, i;
char a[10];
}
}
-refer(c1)
-{
+int refer(c1) int c1; {
register int c2;
if(c1 != '\n')
SKIP;
}
}
-inpic()
-{
+int inpic() {
register int c1;
register char *p1;
SKIP;
}
#ifdef DEBUG
-_C1get()
-{
+int _C1get() {
return(C1get);
}
-_Cget()
-{
+int _Cget() {
return(Cget);
}
-#endif DEBUG
+#endif
\f
/*
* Put out a macro line, using ms and mm conventions.
*/
-msputmac(s, _const)
- register char *s;
- int _const;
-{
+int msputmac(s, _const) register char *s; int _const; {
register char *t;
register found;
int last;
msputwords(YES);
return;
}
- while(*s)
- {
+ while(*s) {
while(*s==' ' || *s=='\t')
putchar(*s++);
for(t = s ; *t!=' ' && *t!='\t' && *t!='\0' ; ++t)
/*
* put out words (for the -w option) with ms and mm conventions
*/
-msputwords(macline)
- int macline; /* is this is a macro line */
-{
+int msputwords(macline) int macline; /* is this is a macro line */ {
register char *p, *p1;
int i, nlet;
#define SKIPBLANK(cp) while(*cp == ' ' || *cp == '\t') { cp++; }
#define SKIPNONBLANK(cp) while(*cp !=' ' && *cp !='\cp' && *cp !='\0') { cp++; }
-meputmac(cp, _const)
- register char *cp;
- int _const;
-{
+int meputmac(cp, _const) register char *cp; int _const; {
register char *np;
int found;
int argno;
}
printf("]");
}
-#endif FULLDEBUG
+#endif
/*
* Determine if the argument merits being printed
*
/*
* put out words (for the -w option) with ms and mm conventions
*/
-meputwords(macline)
- int macline;
-{
+int meputwords(macline) int macline; {
msputwords(macline);
}
/*
* ([lqbzcdf]
*/
-noblock(a1, a2)
- char a1, a2;
-{
+int noblock(a1, a2) int a1; int a2; {
register int c1,c2;
register int eqnf;
int lct;
}
}
-EQ()
-{
+int EQ() {
eqn();
return(0);
}
-domacro()
-{
+int domacro() {
macro();
return(0);
}
-PS()
-{
+int PS() {
if (!msflag) {
inpic();
} else {
return(0);
}
-skip()
-{
+int skip() {
SKIP;
return(0);
}
-intbl()
-{
+int intbl() {
if(msflag){
stbl();
}
return(0);
}
-outtbl(){ intable = NO; }
+int outtbl() { intable = NO; }
-so()
-{
+int so() {
getfname();
if( fname[0] )
infile = *++filesp = opn( fname );
return(0);
}
-nx()
-{
+int nx() {
getfname();
if(fname[0] == '\0') exit(0);
if(infile != stdin)
infile = *filesp = opn(fname);
return(0);
}
-skiptocom(){ SKIP_TO_COM; return(COMX); }
+int skiptocom() { SKIP_TO_COM; return(COMX); }
-PP(c12)
- pacmac c12;
-{
+int PP(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
putchar('\n');
return(0);
}
-AU()
-{
+int AU() {
if(mac==MM) {
return(0);
} else {
}
}
-SH(c12)
- pacmac c12;
-{
+int SH(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
}
}
-UX()
-{
+int UX() {
if(wordflag)
printf("UNIX\n");
else
return(0);
}
-MMHU(c12)
- pacmac c12;
-{
+int MMHU(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
return(0);
}
-mesnblock(c12)
- pacmac c12;
-{
+int mesnblock(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
noblock(')',c2);
return(0);
}
-mssnblock(c12)
- pacmac c12;
-{
+int mssnblock(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
noblock(c1,'E');
return(0);
}
-nf()
-{
+int nf() {
noblock('f','i');
return(0);
}
-ce()
-{
+int ce() {
sce();
return(0);
}
-meip(c12)
- pacmac c12;
-{
+int meip(c12) pacmac c12; {
if(parag)
mepp(c12);
else if (wordflag) /* save the tag */
/*
* only called for -me .pp or .sh, when parag is on
*/
-mepp(c12)
- pacmac c12;
-{
+int mepp(c12) pacmac c12; {
PP(c12); /* eats the line */
return(0);
}
/*
* Start of a section heading; output the section name if doing words
*/
-mesh(c12)
- pacmac c12;
-{
+int mesh(c12) pacmac c12; {
if (parag)
mepp(c12);
else if (wordflag)
/*
* process a font setting
*/
-mefont(c12)
- pacmac c12;
-{
+int mefont(c12) pacmac c12; {
argconcat = 1;
defcomline(c12);
argconcat = 0;
return(0);
}
-manfont(c12)
- pacmac c12;
-{
+int manfont(c12) pacmac c12; {
return(mefont(c12));
}
-manpp(c12)
- pacmac c12;
-{
+int manpp(c12) pacmac c12; {
return(mepp(c12));
}
-defcomline(c12)
- pacmac c12;
-{
+int defcomline(c12) pacmac c12; {
int c1, c2;
frommac(c12, c1, c2);
--inmacro;
}
-comline()
-{
+int comline() {
register int c1;
register int c2;
pacmac c12;
hit = 1;
#ifdef FULLDEBUG
printf("preliminary hit macro %c%c ", c1, c2);
-#endif FULLDEBUG
+#endif
switch(mp->condition){
case NONE: hit = YES; break;
case FNEST: hit = (filesp == files); break;
if (hit) {
#ifdef FULLDEBUG
printf("MATCH\n");
-#endif FULLDEBUG
+#endif
switch( (*(mp->func))(c12) ) {
default: return;
case COMX: goto comx;
}
#ifdef FULLDEBUG
printf("FAIL\n");
-#endif FULLDEBUG
+#endif
break;
}
}
defcomline(c12);
}
-int macsort(p1, p2)
- struct mactab *p1, *p2;
-{
+int macsort(p1, p2) struct mactab *p1; struct mactab *p2; {
return(p1->macname - p2->macname);
}
-int sizetab(mp)
- register struct mactab *mp;
-{
+int sizetab(mp) register struct mactab *mp; {
register int i;
i = 0;
if (mp){
return(i);
}
-struct mactab *macfill(dst, src)
- register struct mactab *dst;
- register struct mactab *src;
-{
+struct mactab *macfill(dst, src) register struct mactab *dst; register struct mactab *src; {
if (src) {
while(src->macname){
*dst++ = *src++;
return(dst);
}
-buildtab(r_back, r_size)
- struct mactab **r_back;
- int *r_size;
-{
+int buildtab(r_back, r_size) struct mactab **r_back; int *r_size; {
int size;
struct mactab *p, *p1, *p2;
M(NONE, 0,0, 0)
};
-
struct mactab manmactab[] = {
M(PARAG, 'B','I', manfont),
M(PARAG, 'B','R', manfont),
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+#include <sys/file.h>
+#include <sys/fs.h>
+/*#include <sys/param.h> gen.h*/
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)fgrep.c 4.3 (Berkeley) 5/30/85";
+#endif
/*
* fgrep -- print all lines containing any of a set of keywords
*
* 2 - some error
*/
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/param.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
#define BLKSIZE 8192
#define MAXSIZ 6000
FILE *wordf;
char *argptr;
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int execute __P((char *file));
+int getargc __P((void));
+int cgotofn __P((void));
+int overflo __P((void));
+int cfail __P((void));
+
+int main(argc, argv) int argc; char **argv; {
while (--argc > 0 && (++argv)[0][0]=='-')
switch (argv[0][1]) {
# define ccomp(a,b) (yflag ? lca(a)==lca(b) : a==b)
# define lca(x) (isupper(x) ? tolower(x) : x)
-execute(file)
-char *file;
-{
+int execute(file) char *file; {
register struct words *c;
register ccount;
register char ch;
}
}
-getargc()
-{
+int getargc() {
register c;
if (wordf)
return(getc(wordf));
return(c);
}
-cgotofn() {
+int cgotofn() {
register c;
register struct words *s;
goto nword;
}
-overflo() {
+int overflo() {
fprintf(stderr, "wordlist too large\n");
exit(2);
}
-cfail() {
+int cfail() {
struct words *queue[QSIZE];
struct words **front, **rear;
struct words *state;
-#ifndef lint
+#include <a.out.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/file.h>
+/*#include <sys/param.h> sys/file.h*/
+#include <sys/stat.h>
+/*#include <sys/types.h> stdio.h*/
+
+#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)file.c 4.12 (Berkeley) 11/17/85";
#endif
/*
* file - determine type of file
*/
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <a.out.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <a.out.h>*/
int errno;
int sys_nerr;
char *sys_errlist[];
"repeat", "setenv", "source", "path", "home", 0 };
int ifile;
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int type __P((char *file));
+int oldo __P((char *cp));
+int troffint __P((char *bp, int n));
+int lookup __P((char *tab[]));
+int ccom __P((void));
+int ascom __P((void));
+int english __P((char *bp, int n));
+int shellscript __P((char buf[], struct stat *sb));
+int shell __P((char *bp, int n, char *tab[]));
+
+int main(argc, argv) int argc; char **argv; {
FILE *fl;
register char *p;
char ap[MAXPATHLEN + 1];
exit(0);
}
-type(file)
-char *file;
-{
+int type(file) char *file; {
int j,nl;
char ch;
struct stat mbuf;
printf("\n");
}
-oldo(cp)
-char *cp;
-{
+int oldo(cp) char *cp; {
struct exec ex;
struct stat stb;
return (0);
}
-
-
-troffint(bp, n)
-char *bp;
-int n;
-{
+int troffint(bp, n) char *bp; int n; {
int k;
i = 0;
}
return(1);
}
-lookup(tab)
-char *tab[];
-{
+int lookup(tab) char *tab[]; {
char r;
int k,j,l;
while(buf[i] == ' ' || buf[i] == '\t' || buf[i] == '\n')i++;
}
return(0);
}
-ccom(){
+int ccom() {
char cc;
while((cc = buf[i]) == ' ' || cc == '\t' || cc == '\n')if(i++ >= in)return(0);
if(buf[i] == '/' && buf[i+1] == '*'){
if(buf[i] == '\n')if(ccom() == 0)return(0);
return(1);
}
-ascom(){
+int ascom() {
while(buf[i] == '/'){
i++;
while(buf[i++] != '\n')if(i >= in)return(0);
return(1);
}
-english (bp, n)
-char *bp;
-{
+int english(bp, n) char *bp; int n; {
# define NASC 128
int ct[NASC], j, vow, freq, rare;
int badpun = 0, punct = 0;
if (n<50) return(0); /* no point in statistics on squibs */
for(j=0; j<NASC; j++)
ct[j]=0;
- for(j=0; j<n; j++)
- {
+ for(j=0; j<n; j++) {
if (bp[j]<NASC)
ct[bp[j]|040]++;
- switch (bp[j])
- {
+ switch (bp[j]) {
case '.':
case ',':
case ')':
return (vow*5 >= n-ct[' '] && freq >= 10*rare);
}
-shellscript(buf, sb)
- char buf[];
- struct stat *sb;
-{
+int shellscript(buf, sb) char buf[]; struct stat *sb; {
register char *tp;
char *cp, *xp, *index();
return (1);
}
-shell(bp, n, tab)
- char *bp;
- int n;
- char *tab[];
-{
+int shell(bp, n, tab) char *bp; int n; char *tab[]; {
i = 0;
do {
-#ifndef lint
+/*#include <a.out.h> gen.h*/
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <sys/dk.h>
+#include <sys/file.h>
+/*#include <sys/signal.h> gen.h*/
+/*#include <sys/time.h> gen.h*/
+/*#include <time.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)iostat.c 4.13 (Berkeley) 85/04/25";
#endif
/*
* iostat
*/
-#include <stdio.h>
-#include <ctype.h>
-#include <nlist.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <nlist.h>*/
+/*#include <signal.h>*/
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/buf.h>
-#include <sys/dk.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/buf.h>*/
+/*#include <sys/dk.h>*/
struct nlist nl[] = {
{ "_dk_busy" },
int phz;
double etime;
int tohdr = 1;
-int printhdr();
+/*int printhdr();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int printhdr __P((void));
+int stats __P((int dn));
+int stat1 __P((int o));
+int read_names __P((void));
-main(argc, argv)
- char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
extern char *ctime();
register i;
int iter, ndrives;
}
}
-printhdr()
-{
+int printhdr() {
register int i;
printf(" tty");
tohdr = 19;
}
-stats(dn)
-{
+int stats(dn) int dn; {
register i;
double atime, words, xtime, itime;
s.dk_seek[dn] ? itime*1000./s.dk_seek[dn] : 0.0);
}
-stat1(o)
-{
+int stat1(o) int o; {
register i;
double time;
#include <vaxuba/ubavar.h>
#include <vaxmba/mbavar.h>
-read_names()
-{
+int read_names() {
struct mba_device mdev;
register struct mba_device *mp;
struct mba_driver mdrv;
+#include <gen.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#ifdef __STDC__
+#include <stdarg.h>
+#define _va_start(argp, arg) va_start(argp, arg)
+#else
+#include <varargs.h>
+#define _va_start(argp, arg) va_start(argp)
+#endif
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)join.c 4.2 (Berkeley) 6/30/83";
+#endif
/* join F1 F2 on stuff */
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
#define F1 0
#define F2 1
#define NFLD 20 /* max field per line */
int unpub2;
int aflg;
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int input __P((int n));
+int output __P((int on1, int on2));
+int error __P((char *fmt, ...));
+int cmp __P((char *s1, char *s2));
+
+int main(argc, argv) int argc; char *argv[]; {
int i;
int n1, n2;
long top2, bot2;
return(0);
}
-input(n) /* get input line and split into fields */
-{
+int input(n) /* get input line and split into fields */ int n; /* get input line and split into fields */ {
register int i, c;
char *bp;
char **pp;
return(i);
}
-output(on1, on2) /* print items from olist */
-int on1, on2;
-{
+int output(on1, on2) /* print items from olist */ int on1; int on2; {
int i;
char *temp;
}
}
-error(fmt, va_alist)
-char *fmt;
-va_dcl
+#ifdef __STDC__
+int error(char *fmt, ...)
+#else
+int error(fmt, va_alist) char *fmt; va_dcl
+#endif
{
va_list argp;
fprintf(stderr, "join: ");
- va_start(argp);
+ _va_start(argp, fmt);
vfprintf(stderr, fmt, argp);
va_end(argp);
fprintf(stderr, "\n");
exit(1);
}
-cmp(s1, s2)
-char *s1, *s2;
-{
+int cmp(s1, s2) char *s1; char *s2; {
return(strcmp(s1, s2));
}
-static char *sccsid = "@(#)look.c 4.2 (Berkeley) 7/2/81";
-#include <stdio.h>
#include <ctype.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)look.c 4.2 (Berkeley) 7/2/81";
+#endif
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
FILE *dfile;
char *filenam = "/usr/dict/words";
char word[250];
char key[50];
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int compare __P((register char *s, register char *t));
+int getword __P((char *w));
+int canon __P((char *old, char *new));
+
+int main(argc, argv) int argc; char **argv; {
register c;
long top,bot,mid;
while(argc>=2 && *argv[1]=='-') {
exit(0);
}
-compare(s,t)
-register char *s,*t;
-{
+int compare(s, t) register char *s; register char *t; {
for(;*s==*t;s++,t++)
if(*s==0)
return(0);
2);
}
-getword(w)
-char *w;
-{
+int getword(w) char *w; {
register c;
for(;;) {
c = getc(dfile);
return(1);
}
-canon(old,new)
-char *old,*new;
-{
+int canon(old, new) char *old; char *new; {
register c;
for(;;) {
*new = c = *old++;
+#include <stdio.h>
+#include <sys/stat.h>
+#include <utmp.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)mesg.c 4.3 (Berkeley) 3/13/86";
+#endif
/*
* mesg -- set current tty to accept or
* forbid write permission.
* n forbid messages
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
struct stat sbuf;
char *tty;
-char *ttyname();
+/*char *ttyname();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int error __P((char *s));
+int newmode __P((int m));
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
int r=0;
tty = ttyname(2);
if (tty == 0)
exit(r);
}
-error(s)
-char *s;
-{
+int error(s) char *s; {
fprintf(stderr,"mesg: %s\n",s);
exit(-1);
}
-newmode(m)
-{
+int newmode(m) int m; {
if(chmod(tty,m)<0)
error("cannot change mode");
}
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/exec.h> gen.h*/
+#include <sys/file.h>
+#include <sys/ioctl.h>
+/*#include <sys/param.h> gen.h*/
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)ptx.c 4.2 (Berkeley) 9/23/85";
+#endif
#
/* permuted title index
\e make: cc ptx.c -lS
*/
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
#include <signal.h>
#define DEFLTX "/usr/lib/eign"
#define TILDE 0177
#define isabreak(c) (btable[c])
-extern char *calloc(), *mktemp();
-extern char *getline();
+/*extern char *calloc(), *mktemp();*/
+/*extern char *getline();*/
int status;
-
char *hasht[MAXT];
char line[LMAX];
char btable[128];
char *bfile; /*contains user supplied break chars */
FILE *bptr;
-main(argc,argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int msg __P((char *s, char *arg));
+int diag __P((char *s, char *arg));
+char *getline __P((void));
+int cmpline __P((char *pend));
+int cmpword __P((char *cpp, char *pend, char *hpp));
+int putline __P((char *strt, char *end));
+int getsort __P((void));
+char *rtrim __P((char *a, char *c, int d));
+char *ltrim __P((char *c, char *b, int d));
+int putout __P((char *strt, char *end));
+int onintr __P((void));
+int hash __P((char *strtp, char *endp));
+int storeh __P((int num, char *strtp));
+
+int main(argc, argv) int argc; char **argv; {
register int c;
register char *bufp;
int pid;
outfile = 0;
}
-
/* Default breaks of blank, tab and newline */
btable[' '] = SET;
btable['\t'] = SET;
and put resulting words in buffer.
*/
-
if((strtbufp = calloc(N,BUFSIZ)) == NULL)
diag("Out of memory space",empty);
bufp = strtbufp;
while(wait(&status) != pid);
}
-
getsort();
if(*sortfile)
unlink(sortfile);
exit(0);
}
-msg(s,arg)
-char *s;
-char *arg;
-{
+int msg(s, arg) char *s; char *arg; {
fprintf(stderr,"%s %s\n",s,arg);
return;
}
-diag(s,arg)
-char *s, *arg;
-{
+int diag(s, arg) char *s; char *arg; {
msg(s,arg);
exit(1);
}
-
-char *getline()
-{
+char *getline() {
register c;
register char *linep;
char *endlinep;
-
endlinep= line + mlen;
linep = line;
/* Throw away leading white space */
return(0);
}
-cmpline(pend)
-char *pend;
-{
+int cmpline(pend) char *pend; {
char *pstrt, *pchar, *cp;
char **hp;
}
}
-cmpword(cpp,pend,hpp)
-char *cpp, *pend, *hpp;
-{
+int cmpword(cpp, pend, hpp) char *cpp; char *pend; char *hpp; {
char c;
while(*hpp != '\0'){
return(0);
}
-putline(strt, end)
-char *strt, *end;
-{
+int putline(strt, end) char *strt; char *end; {
char *cp;
for(cp=strt; cp<end; cp++)
putc('\n',sortptr);
}
-getsort()
-{
+int getsort() {
register c;
register char *tilde, *linep, *ref;
char *p1a,*p1b,*p2a,*p2b,*p3a,*p3b,*p4a,*p4b;
}
}
-char *rtrim(a,c,d)
-char *a,*c;
-{
+char *rtrim(a, c, d) char *a; char *c; int d; {
char *b,*x;
b = c;
for(x=a+1; x<=c&&x-a<=d; x++)
return(b);
}
-char *ltrim(c,b,d)
-char *c,*b;
-{
+char *ltrim(c, b, d) char *c; char *b; int d; {
char *a,*x;
a = c;
for(x=b-1; x>=c&&b-x<=d; x--)
return(a);
}
-putout(strt,end)
-char *strt, *end;
-{
+int putout(strt, end) char *strt; char *end; {
char *cp;
cp = strt;
}
}
-onintr()
-{
+int onintr() {
if(*sortfile)
unlink(sortfile);
exit(1);
}
-hash(strtp,endp)
-char *strtp, *endp;
-{
+int hash(strtp, endp) char *strtp; char *endp; {
char *cp, c;
int i, j, k;
return(k);
}
-storeh(num,strtp)
-int num;
-char *strtp;
-{
+int storeh(num, strtp) int num; char *strtp; {
int i;
for(i=num; i<MAXT; i++) {
+/*#include <a.out.h> gen.h*/
+#include <ar.h>
+#include <gen.h>
+#include <ranlib.h>
+#include <stdio.h>
+/*#include <strings.h> gen.h*/
+#include <struct.h>
+/*#include <sys/exec.h> a.out.h*/
+#include <sys/file.h>
+/*#include <sys/time.h> gen.h*/
+/*#include <sys/types.h> gen.h*/
+
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
-#ifndef lint
+#if defined(DOCOPYRIGHT) && !defined(lint)
char copyright[] =
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
All rights reserved.\n";
-#endif not lint
+#endif
-#ifndef lint
+#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)ranlib.c 5.3 (Berkeley) 1/22/86";
-#endif not lint
+#endif
/*
* ranlib - create table of contents for archive; string table version
*/
-#include <sys/types.h>
-#include <ar.h>
-#include <ranlib.h>
-#include <a.out.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <ar.h>*/
+/*#include <ranlib.h>*/
+/*#include <a.out.h>*/
+/*#include <stdio.h>*/
struct ar_hdr archdr;
#define OARMAG 0177545
struct exec exp;
FILE *fi, *fo;
long off, oldoff;
-long atol(), ftell();
+/*long atol(), ftell();*/
#define TABSZ 3000
int tnum;
#define STRTABSZ 30000
int new;
char tempnm[] = "__.SYMDEF";
char firstname[17];
-void stash();
-char *malloc(), *calloc();
+/*void stash();*/
+/*char *malloc(), *calloc();*/
/*
* table segment definitions
*/
-char *segalloc();
-void segclean();
+/*char *segalloc();*/
+/*void segclean();*/
struct tabsegment {
struct tabsegment *pnext;
unsigned nelem;
char stab[STRTABSZ];
} strbase, *pstrseg;
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int nextel __P((FILE *af));
+void stash __P((struct nlist *s));
+char *segalloc __P((unsigned size));
+void segclean __P((void));
+int fixsize __P((void));
+int fixdate __P((char *s));
+
+int main(argc, argv) int argc; char **argv; {
char cmdbuf[BUFSIZ];
/* magbuf must be an int array so it is aligned on an int-ish
boundary, so that we may access its first word as an int! */
exit(0);
}
-nextel(af)
-FILE *af;
-{
+int nextel(af) FILE *af; {
register r;
register char *cp;
return(1);
}
-void
-stash(s)
- struct nlist *s;
-{
+void stash(s) struct nlist *s; {
register char *cp;
register char *strtab;
register strsiz;
}
/* allocate a zero filled segment of size bytes */
-char *
-segalloc(size)
-unsigned size;
-{
+char *segalloc(size) unsigned size; {
char *pseg = NULL;
pseg = malloc(size);
}
/* free segments */
-void
-segclean()
-{
+void segclean() {
register struct tabsegment *ptab;
register struct strsegment *pstr;
pstrseg->nelem = 0;
}
-fixsize()
-{
+int fixsize() {
int i;
off_t offdelta;
register struct tabsegment *ptab;
}
/* patch time */
-fixdate(s)
- char *s;
-{
+int fixdate(s) char *s; {
long time();
char buf[24];
int fd;
-static char *sccsid = "@(#)rev.c 4.1 (Berkeley) 10/1/80";
#include <stdio.h>
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)rev.c 4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
+
/* reverse lines of a file */
#define N 256
char line[N];
FILE *input;
-main(argc,argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
register i,c;
input = stdin;
do {
+#include <stdio.h>
+#include <sys/time.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)sleep.c 4.1 (Berkeley) 10/1/80";
-main(argc, argv)
-char **argv;
-{
+#endif
+int main(argc, argv) int argc; char **argv; {
int c, n;
char *s;
-static char *sccsid = "@(#)sort.c 4.11 (Berkeley) 6/3/86";
-#include <stdio.h>
#include <ctype.h>
-#include <signal.h>
-#include <sys/types.h>
+#include <stdio.h>
+#include <strings.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
#include <sys/stat.h>
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)sort.c 4.11 (Berkeley) 6/3/86";
+#endif
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <signal.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+
#define L 1024
#define N 7
#define C 20
unsigned ntext;
int *lspace;
char *tspace;
-int cmp(), cmpa();
+/*int cmp(), cmpa();*/
int (*compare)() = cmpa;
-char *eol();
-int term();
+/*char *eol();*/
+/*int term();*/
int mflg;
int cflg;
int uflg;
};
int nfields;
int error = 1;
-char *setfil();
-char *sbrk();
-char *brk();
+/*char *setfil();*/
+/*char *sbrk();*/
+/*char *brk();*/
#define blank(c) ((c) == ' ' || (c) == '\t')
-main(argc, argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int sort __P((void));
+int merge __P((int a, int b));
+int disorder __P((char *s, char *t));
+int newfile __P((void));
+char *setfil __P((int i));
+int oldfile __P((void));
+int safeoutfil __P((void));
+int cant __P((char *f));
+int diag __P((char *s, char *t));
+int term __P((void));
+int cmp __P((char *i, char *j));
+int cmpa __P((register char *pa, register char *pb));
+char *skip __P((char *pp, struct field *fp, int j));
+char *eol __P((register char *p));
+int copyproto __P((void));
+int field __P((char *s, int k));
+int number __P((char **ppa));
+int _qsort __P((char **a, char **l));
+
+int main(argc, argv) int argc; char **argv; {
register a;
/*extern char end[1];*/
char *ep;
term();
}
-sort()
-{
+int sort() {
register char *cp;
register char **lp;
register lines, text, len;
} while(done == 0);
}
-struct merg
-{
+struct merg {
char l[L];
FILE *b;
} *ibuf[256];
-merge(a,b)
-{
+int merge(a, b) int a; int b; {
struct merg *p;
register char *cp, *dp;
register i;
fclose(os);
}
-disorder(s,t)
-char *s, *t;
-{
+int disorder(s, t) char *s; char *t; {
register char *u;
for(u=t; *u!='\n';u++) ;
*u = 0;
term();
}
-newfile()
-{
+int newfile() {
register char *f;
f = setfil(nfiles);
nfiles++;
}
-char *
-setfil(i)
-{
+char *setfil(i) int i; {
if(i < eargc)
if(eargv[i][0] == '-' && eargv[i][1] == '\0')
return(file);
}
-oldfile()
-{
+int oldfile() {
if(outfil) {
if((os=fopen(outfil, "w")) == NULL) {
os = stdout;
}
-safeoutfil()
-{
+int safeoutfil() {
register int i;
struct stat obuf,ibuf;
}
}
-cant(f)
-char *f;
-{
+int cant(f) char *f; {
perror(f);
term();
}
-diag(s,t)
-char *s, *t;
-{
+int diag(s, t) char *s; char *t; {
fputs("sort: ",stderr);
fputs(s,stderr);
fputs(t,stderr);
fputs("\n",stderr);
}
-term()
-{
+int term() {
register i;
signal(SIGINT, SIG_IGN);
_exit(error);
}
-cmp(i, j)
-char *i, *j;
-{
+int cmp(i, j) char *i; char *j; {
register char *pa, *pb;
char *skip();
char *code, *ignore;
return(cmpa(i, j));
}
-cmpa(pa, pb)
-register char *pa, *pb;
-{
+int cmpa(pa, pb) register char *pa; register char *pb; {
while(*pa == *pb) {
if(*pa++ == '\n')
return(0);
);
}
-char *
-skip(pp, fp, j)
-struct field *fp;
-char *pp;
-{
+char *skip(pp, fp, j) char *pp; struct field *fp; int j; {
register i;
register char *p;
return(p);
}
-char *
-eol(p)
-register char *p;
-{
+char *eol(p) register char *p; {
while(*p != '\n') p++;
return(p);
}
-copyproto()
-{
+int copyproto() {
register i;
register int *p, *q;
*q++ = *p++;
}
-field(s,k)
-char *s;
-{
+int field(s, k) char *s; int k; {
register struct field *p;
register d;
p = &fields[nfields];
}
}
-number(ppa)
-char **ppa;
-{
+int number(ppa) char **ppa; {
int n;
register char *pa;
pa = *ppa;
#define qsexc(p,q) t= *p;*p= *q;*q=t
#define qstexc(p,q,r) t= *p;*p= *r;*r= *q;*q=t
-_qsort(a,l)
-char **a, **l;
-{
+int _qsort(a, l) char **a; char **l; {
register char **i, **j;
char **k;
char **lp, **hp;
char *t;
unsigned n;
-
-
start:
if((n=l-a) <= 1)
return;
-
n /= 2;
hp = lp = a+n;
i = a;
j = l-1;
-
for(;;) {
if(i < lp) {
if((c = (*compare)(*i, *lp)) == 0) {
goto loop;
}
-
if(i == lp) {
if(uflg)
for(k=lp+1; k<=hp;) **k++ = '\0';
goto start;
}
-
--lp;
qstexc(j, lp, i);
j = --hp;
}
}
-
-#ifndef lint
+#include <gen.h>
+/*#include <math.h> gen.h*/
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)spline.c 4.3 (Berkeley) 9/21/85";
#endif
-#include <stdio.h>
-#include <math.h>
+/*#include <stdio.h>*/
+/*#include <math.h>*/
#define NP 1000
#define INF HUGE
All that is necessary is to add h1 to a1 and hn+1 to an.
-
Periodic case_____________
To do this, add 1 more row and column thus
x- = x-xi
*/
-float
-rhs(i){
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+float rhs __P((int i));
+int spline __P((void));
+int readin __P((void));
+int getfloat __P((float *p));
+int getlim __P((struct proj *p));
+int main __P((int argc, char *argv[]));
+int numb __P((float *np, int *argcp, char ***argvp));
+
+float rhs(i) int i; {
int i_;
double zz;
i_ = i==n-1?0:i;
return(6*((y.val[i_+1]-y.val[i_])/(x.val[i+1]-x.val[i]) - zz));
}
-spline(){
+int spline() {
float d,s,u,v,hi,hi1;
float h;
float D2yi,D2yi1,D2yn1,x0,x1,yy,a;
}
return(1);
}
-readin() {
+int readin() {
for(n=0;n<NP;n++){
if(auta) x.val[n] = n*dx+x.lb;
else if(!getfloat(&x.val[n])) break;
if(!getfloat(&y.val[n])) break; } }
-getfloat(p)
- float *p;{
+int getfloat(p) float *p; {
char buf[30];
register c;
int i;
*p = atof(buf);
return(1); }
-getlim(p)
- struct proj *p; {
+int getlim(p) struct proj *p; {
int i;
for(i=0;i<n;i++) {
if(!p->lbf && p->lb>(p->val[i])) p->lb = p->val[i];
if(!p->ubf && p->ub<(p->val[i])) p->ub = p->val[i]; }
}
-
-main(argc,argv)
- char *argv[];{
+int main(argc, argv) int argc; char *argv[]; {
extern void *malloc();
int i;
x.lbf = x.ubf = y.lbf = y.ubf = 0;
printf("%f ",x.val[i]);
printf("%f\n",y.val[i]); }
}
-numb(np,argcp,argvp)
- int *argcp;
- float *np;
- char ***argvp;{
+int numb(np, argcp, argvp) float *np; int *argcp; char ***argvp; {
double atof();
char c;
if(*argcp<=1) return(0);
(*argcp)--;
(*argvp)++;
return(1); }
-
-static char *sccsid = "@(#)split.c 4.2 (Berkeley) 4/29/83";
+#include <gen.h>
#include <stdio.h>
+/*#include <sys/errno.h> gen.h*/
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)split.c 4.2 (Berkeley) 4/29/83";
+#endif
+/*#include <stdio.h>*/
unsigned count = 1000;
int fnumber;
FILE *is;
FILE *os;
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
register i, c, f;
int iflg = 0;
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)sum.c 4.1 (Berkeley) 10/1/80";
+#endif
/*
* Sum bytes in file mod 2^16
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
-main(argc,argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
register unsigned sum;
register i, c;
register FILE *f;
-static char *sccsid = "@(#)tabs.c 4.1 (Berkeley) 10/1/80";
+#include <gen.h>
#include <stdio.h>
-#include <sgtty.h>
+/*#include <strings.h> gen.h*/
+#include <sys/ioctl.h>
+/*#include <sys/ttydev.h> sys/ioctl.h*/
+#include <vax/mtpr.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)tabs.c 4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
+/*#include <sgtty.h>*/
#define SP ' '
#define TB '\t'
};
int margset = 1;
-syslook(w)
-char *w;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int syslook __P((char *w));
+int main __P((int argc, char **argv));
+int clear __P((int n));
+int delay __P((int n));
+int tabs __P((int n));
+int margin __P((int n));
+int escape __P((int c));
+int bs __P((int n));
+int nl __P((void));
+int dasi450 __P((void));
+int tty37 __P((void));
+int dasi300 __P((void));
+int tn300 __P((void));
+int hp2645 __P((void));
+int misc __P((void));
+
+int syslook(w) char *w; {
register struct sysnod *sp;
for (sp = tty; sp->sysnam!=NULL; sp++)
return(0);
}
-main(argc,argv)
-int argc; char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
struct sgttyb tb;
int type;
char *getenv();
}
}
-clear(n)
-{
+int clear(n) int n; {
escape(CLR);
delay(n);
putchar(CR); nl();
}
-delay(n)
-{
+int delay(n) int n; {
while (n--) putchar(DEL);
}
-tabs(n)
-{
+int tabs(n) int n; {
int i,j;
if(margset) n--;
}
}
-margin(n)
-{
+int margin(n) int n; {
int i;
if(margset) {
}
}
-escape(c)
-{
+int escape(c) int c; {
putchar(ESC); putchar(c);
}
-bs(n)
-{
+int bs(n) int n; {
while (n--) putchar(BS);
}
-nl()
-{
+int nl() {
putchar(NL);
}
-
-
/* ======== terminal types ======== */
-dasi450()
-{
+int dasi450() {
struct sgttyb t;
gtty(0,&t);
t.sg_flags &= ~ALLDELAY;
escape(RHM); nl();
}
-tty37()
-{
+int tty37() {
putchar(SI); clear(40); bs(8); tabs(9); nl();
}
-dasi300()
-{
+int dasi300() {
clear(8); tabs(15); nl();
}
-tn300()
-{
+int tn300() {
struct sgttyb t;
gtty(0,&t);
t.sg_flags &= ~ALLDELAY;
clear(8); margin(8); escape(SET); tabs(14); nl();
}
-hp2645()
-{
+int hp2645() {
escape('3'); /*clr*/
putchar(CR);
tabs(10);
nl();
}
-misc()
-{
+int misc() {
tabs(14); nl();
}
+#include <stdio.h>
+#include <sys/exec.h>
+#include <sys/file.h>
+#include <sys/proc.h>
+#include <sys/signal.h>
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)tc.c 4.2 (Berkeley) 7/6/81";
+#endif
/*
* Simulate typesetter on 4014
*/
-#include <signal.h>
-#include <stdio.h>
+/*#include <signal.h>*/
+/*#include <stdio.h>*/
#define oput(c) if (pgskip==0) putchar(c); else (c);
#define MAXY 3071
int (*sigint)();
int (*sigquit)();
-main(argc,argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int lig __P((char *x));
+int init __P((void));
+int ex __P((void));
+int kwait __P((void));
+int callunix __P((char line[]));
+int readch __P((void));
+int sendpt __P((void));
+int _atoi __P((void));
+long tscale __P((int n));
+int getch __P((void));
+
+int main(argc, argv) int argc; char **argv; {
register i, j;
register char *k;
extern ex();
}
ex();
}
-lig(x)
-char *x;
-{
+int lig(x) char *x; {
register i, j;
register char *k;
xx -= j;
sendpt();
}
-init(){
+int init() {
fflush(stdout);
if(erase){
skip = 0;
sendpt();
}
-ex(){
+int ex() {
yy = MAXY;
xx = 0;
sendpt();
fflush(stdout);
exit(0);
}
-kwait(){
+int kwait() {
char buf[128]; char *bptr; char c;
if(pgskip) return;
next:
else if (c==0) ex();
else return;
}
-callunix(line)
-char line[];
-{
+int callunix(line) char line[]; {
int rc, status, unixpid;
if( (unixpid=fork())==0 ) {
signal(SIGINT,sigint); signal(SIGQUIT,sigquit);
signal(SIGINT,ex); signal(SIGQUIT,sigquit);
}
}
-readch(){
+int readch() {
char c;
if (read(2,&c,1)<1) c=0;
return(c);
}
-sendpt(){
+int sendpt() {
int hy,xb,ly,hx,lx;
oput(GS);
alpha = 0;
return;
}
-_atoi()
-{
+int _atoi() {
register i, j, acc;
int field, digits;
long dd;
ch = 0;
return(acc);
}
-long tscale(n)
-int n;
-{
+long tscale(n) int n; {
register i, j;
switch(i = getch()){
}
return((long)n*j);
}
-getch(){
+int getch() {
register i;
if(ch){
+#include <gen.h>
+#include <stdio.h>
+/*#include <sys/exec.h> gen.h*/
+#include <sys/ioctl.h>
+/*#include <sys/proc.h> gen.h*/
+/*#include <sys/signal.h> gen.h*/
+#include <sys/wait.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)tk.c 4.2 (Berkeley) 5/15/84";
+#endif
/*
* optimize output for Tek 4014
*/
-#include <stdio.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
#define MAXY 3071
#define LINE 47
int ry;
FILE *ttyin;
-main(argc, argv)
-int argc;
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int init __P((void));
+int ex __P((void));
+int kwait __P((void));
+int execom __P((void));
+int sendpt __P((int a));
+
+int main(argc, argv) int argc; char **argv; {
register i, j;
extern ex();
ex();
}
-init()
-{
+int init() {
ohx = oxb = olx = ohy = oly = -1;
if (ncol >= maxcol) {
ncol = 0;
sendpt(0);
}
-ex()
-{
+int ex() {
yy = MAXY;
xx = 0;
fputs("\033;\037", stdout);
exit(0);
}
-kwait()
-{
+int kwait() {
register c;
fflush(stdout);
}
}
-execom()
-{
+int execom() {
int (*si)(), (*sq)();
if (fork() != 0) {
execl("/bin/sh", "sh", "-t", 0);
}
-sendpt(a)
-{
+int sendpt(a) int a; {
register zz;
int hy,xb,ly,hx,lx;
-#ifndef lint
+#include <stdio.h>
+/*#include <sys/errno.h> sys/file.h*/
+#include <sys/file.h>
+#include <sys/stat.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)touch.c 4.3 (Berkeley) 8/11/83";
#endif
* if the file is read-only, -f forces chmod'ing and touch'ing.
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
int dontcreate; /* set if -c option */
int force; /* set if -f option */
char *whoami = "touch";
-main(argc,argv)
- int argc;
- char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int touch __P((char *filename));
+int readwrite __P((char *filename, int size));
+
+int main(argc, argv) int argc; char **argv; {
char *argp;
dontcreate = 0;
}
}
-touch(filename)
- char *filename;
-{
+int touch(filename) char *filename; {
struct stat statbuffer;
if (stat(filename,&statbuffer) == -1) {
}
}
-readwrite(filename,size)
- char *filename;
- int size;
-{
+int readwrite(filename, size) char *filename; int size; {
int filedescriptor;
char first;
-static char *sccsid = "@(#)tr.c 4.2 (Berkeley) 4/22/85";
#include <stdio.h>
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)tr.c 4.2 (Berkeley) 4/22/85";
+#endif
+/*#include <stdio.h>*/
+
/* tr - transliterate data stream */
int dflag = 0;
int sflag = 0;
char vect[256];
struct string { int last, max; char *p; } string1, string2;
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int next __P((struct string *s));
+int nextc __P((struct string *s));
+
+int main(argc, argv) int argc; char **argv; {
register i;
int j;
register c, d;
exit(0);
}
-next(s)
-struct string *s;
-{
+int next(s) struct string *s; {
again:
if(s->max) {
return(s->last = nextc(s));
}
-nextc(s)
-struct string *s;
-{
+int nextc(s) struct string *s; {
register c, i, n;
c = *s->p++;
+#include <gen.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)tsort.c 4.2 (Berkeley) 10/20/82";
+#endif
/* topological sort
* input is sequence of pairs of items (blank-free strings)
* nonidentical pair is a directed edge in graph
* output is ordered list of items consistent with
* the partial ordering specified by the graph
*/
-#include <stdio.h>
+/*#include <stdio.h>*/
/* the nodelist always has an empty element at the end to
* make it easy to grow in natural order
struct nodelist *pred;
};
-struct nodelist *_index();
-struct nodelist *findloop();
-struct nodelist *mark();
-char *malloc();
+/*struct nodelist *_index();*/
+/*struct nodelist *findloop();*/
+/*struct nodelist *mark();*/
+/*char *malloc();*/
char *empty = "";
/* the first for loop reads in the graph,
* the second prints out the ordering
*/
-main(argc,argv)
-char **argv;
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char **argv));
+int present __P((struct nodelist *i, struct nodelist *j));
+int anypred __P((struct nodelist *i));
+struct nodelist *_index __P((register char *s));
+int cmp __P((register char *s, register char *t));
+int error __P((char *s, char *t));
+int note __P((char *s, char *t));
+struct nodelist *findloop __P((void));
+struct nodelist *mark __P((register struct nodelist *i));
+
+int main(argc, argv) int argc; char **argv; {
register struct predlist *t;
FILE *input = stdin;
register struct nodelist *i, *j;
/* is i present on j's predecessor list?
*/
-present(i,j)
-struct nodelist *i, *j;
-{
+int present(i, j) struct nodelist *i; struct nodelist *j; {
register struct predlist *t;
for(t=j->inedges; t!=NULL; t=t->nextpred)
if(t->pred==i)
/* is there any live predecessor for i?
*/
-anypred(i)
-struct nodelist *i;
-{
+int anypred(i) struct nodelist *i; {
register struct predlist *t;
for(t=i->inedges; t!=NULL; t=t->nextpred)
if(t->pred->live==LIVE)
/* turn a string into a node pointer
*/
-struct nodelist *
-_index(s)
-register char *s;
-{
+struct nodelist *_index(s) register char *s; {
register struct nodelist *i;
register char *t;
for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
return(i);
}
-cmp(s,t)
-register char *s, *t;
-{
+int cmp(s, t) register char *s; register char *t; {
while(*s==*t) {
if(*s==0)
return(1);
return(0);
}
-error(s,t)
-char *s, *t;
-{
+int error(s, t) char *s; char *t; {
note(s,t);
exit(1);
}
-note(s,t)
-char *s,*t;
-{
+int note(s, t) char *s; char *t; {
fprintf(stderr,"tsort: %s%s\n",s,t);
}
/* given that there is a cycle, find some
* node in it
*/
-struct nodelist *
-findloop()
-{
+struct nodelist *findloop() {
register struct nodelist *i, *j;
for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
if(i->live==LIVE)
* VISITED is a temporary state recording the
* visits of the search
*/
-struct nodelist *
-mark(i)
-register struct nodelist *i;
-{
+struct nodelist *mark(i) register struct nodelist *i; {
register struct nodelist *j;
register struct predlist *t;
if(i->live==DEAD)
+#include <stdio.h>
+#include <strings.h>
+#include <utmp.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)tty.c 4.1 (Berkeley) 10/1/80";
+#endif
/*
* Type tty name
*/
-char *ttyname();
+/*char *ttyname();*/
-main(argc, argv)
-char **argv;
-{
+int main(argc, argv) int argc; char **argv; {
register char *p;
p = ttyname(0);
+/*#include <ctype.h> gen.h*/
+#include <gen.h>
+#include <stdio.h>
+
+#if defined(DOSCCS) && !defined(lint)
static char *sccsid = "@(#)uniq.c 4.1 (Berkeley) 10/1/80";
+#endif
/*
* Deal with duplicated lines in a file
*/
-#include <stdio.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
int fields;
int letters;
int linec;
char mode;
int uniq;
-char *skip();
+/*char *skip();*/
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int gline __P((register char buf[]));
+int pline __P((register char buf[]));
+int equal __P((register char b1[], register char b2[]));
+char *skip __P((register char *s));
+int printe __P((char *p, char *s));
-main(argc, argv)
-int argc;
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
static char b1[1000], b2[1000];
while(argc > 1) {
}
}
-gline(buf)
-register char buf[];
-{
+int gline(buf) register char buf[]; {
register c;
while((c = getchar()) != '\n') {
return(0);
}
-pline(buf)
-register char buf[];
-{
+int pline(buf) register char buf[]; {
switch(mode) {
putchar('\n');
}
-equal(b1, b2)
-register char b1[], b2[];
-{
+int equal(b1, b2) register char b1[]; register char b2[]; {
register char c;
b1 = skip(b1);
return(1);
}
-char *
-skip(s)
-register char *s;
-{
+char *skip(s) register char *s; {
register nf, nl;
nf = nl = 0;
return(s);
}
-printe(p,s)
-char *p,*s;
-{
+int printe(p, s) char *p; char *s; {
fprintf(stderr, p, s);
exit(1);
}
-static char *sccsid = "@(#)units.c 4.1 (Berkeley) 10/1/80";
#include <stdio.h>
+#include <sys/signal.h>
+
+#if defined(DOSCCS) && !defined(lint)
+static char *sccsid = "@(#)units.c 4.1 (Berkeley) 10/1/80";
+#endif
+/*#include <stdio.h>*/
#define NDIM 10
#define NTAB 601
char *dfile = "/usr/lib/units";
char *unames[NDIM];
-double getflt();
-int fperr();
-struct table *hash();
-struct unit
-{
+/*double getflt();*/
+/*int fperr();*/
+/*struct table *hash();*/
+struct unit {
double factor;
char dim[NDIM];
};
-struct table
-{
+struct table {
double factor;
char dim[NDIM];
char *name;
} table[NTAB];
char names[NTAB*10];
-struct prefix
-{
+struct prefix {
double factor;
char *pname;
-} prefix[] =
-{
+} prefix[] = {
1e-18, "atto",
1e-15, "femto",
1e-12, "pico",
int peekc;
int dumpflg;
-main(argc, argv)
-char *argv[];
-{
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+int main __P((int argc, char *argv[]));
+int units __P((struct unit *up));
+int pu __P((int u, int i, int f));
+int convr __P((struct unit *up));
+int lookup __P((char *name, struct unit *up, int den, int c));
+int equal __P((char *s1, char *s2));
+int init __P((void));
+double getflt __P((void));
+int get __P((void));
+struct table *hash __P((char *name));
+int fperr __P((void));
+
+int main(argc, argv) int argc; char *argv[]; {
register i;
register char *file;
struct unit u1, u2;
goto loop;
}
-units(up)
-struct unit *up;
-{
+int units(up) struct unit *up; {
register struct unit *p;
register f, i;
putchar('\n');
}
-pu(u, i, f)
-{
+int pu(u, i, f) int u; int i; int f; {
if(u > 0) {
if(f&2)
return(0);
}
-convr(up)
-struct unit *up;
-{
+int convr(up) struct unit *up; {
register struct unit *p;
register c;
register char *cp;
goto loop;
}
-lookup(name, up, den, c)
-char *name;
-struct unit *up;
-{
+int lookup(name, up, den, c) char *name; struct unit *up; int den; int c; {
register struct unit *p;
register struct table *q;
register i;
return(1);
}
-equal(s1, s2)
-char *s1, *s2;
-{
+int equal(s1, s2) char *s1; char *s2; {
register char *c1, *c2;
c1 = s1;
return(0);
}
-init()
-{
+int init() {
register char *cp;
register struct table *tp, *lp;
int c, i, f, t;
goto l0;
}
-double
-getflt()
-{
+double getflt() {
register c, i, dp;
double d, e;
int f;
return(d);
}
-get()
-{
+int get() {
register c;
if(c=peekc) {
return(c);
}
-struct table *
-hash(name)
-char *name;
-{
+struct table *hash(name) char *name; {
register struct table *tp;
register char *np;
register unsigned h;
goto l0;
}
-fperr()
-{
+int fperr() {
signal(8, fperr);
fperrc++;