+#ifndef _SED_H_
+#define _SED_H_
+
+#include <stdio.h>
+
/* sed.h 4.1 85/04/05 */
/*
char negfl;
} ptrspace[PTRSIZE], *rep;
-
extern char respace[RESIZE];
extern struct label {
extern struct re *pending;
extern char *badp;
extern char bad;
-char *compile();
-char *ycomp();
-char *address();
-char *text();
-char *compsub();
-struct label *search();
-char *gline();
-char *place();
+/*char *compile();*/
+/*char *ycomp();*/
+/*char *address();*/
+/*char *text();*/
+/*char *compsub();*/
+/*struct label *search();*/
+/*char *gline();*/
+/*char *place();*/
extern char compfl;
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
+#endif
+
+/* sed0.c */
+int main __P((int argc, char *argv[]));
+int fcomp __P((void));
+char *compsub __P((char *rhsbuf));
+char *compile __P((char *expbuf));
+int rline __P((char *lbuf));
+char *address __P((char *expbuf));
+int cmp __P((char *a, char *b));
+char *text __P((char *textbuf));
+struct label *search __P((struct label *ptr));
+int dechain __P((void));
+char *ycomp __P((char *expbuf));
+
+/* sed1.c */
+int execute __P((char *file));
+int match __P((char *expbuf, int gf));
+int advance __P((char *alp, char *aep));
+int substitute __P((struct re *ipc));
+int dosub __P((char *rhsbuf));
+char *place __P((char *asp, char *al1, char *al2));
+int command __P((struct re *ipc));
+char *gline __P((char *addr));
+int ecmp __P((char *a, char *b, int count));
+int arout __P((void));
+
+#endif
+/*#include <stdio.h> sed.h*/
+#include "sed.h"
+
/* sed0.c 4.2 85/06/19 */
-#include <stdio.h>
-#include "sed.h"
+/*#include <stdio.h>*/
+/*#include "sed.h"*/
/* moved here from sed.h, which now just declares them extern */
FILE *fin;
128
};
-main(argc, argv)
-char *argv[];
-{
+int main(argc, argv) int argc; char *argv[]; {
eargc = argc;
eargv = argv;
if(eargc == 1)
exit(0);
-
while (--eargc > 0 && (++eargv)[0][0] == '-')
switch (eargv[0][1]) {
continue;
}
-
if(compfl == 0) {
eargv--;
eargc++;
fclose(stdout);
exit(0);
}
-fcomp()
-{
+int fcomp() {
register char *p, *op, *tp;
char *address();
while(*cp++ == ' ');
cp--;
-
tp = lab->asc;
while((*tp++ = *cp++))
if(tp >= &(lab->asc[8])) {
rep->command = 0;
lastre = op;
}
-char *compsub(rhsbuf)
-char *rhsbuf;
-{
+char *compsub(rhsbuf) char *rhsbuf; {
register char *p, *q;
p = rhsbuf;
}
}
-char *compile(expbuf)
-char *expbuf;
-{
+char *compile(expbuf) char *expbuf; {
register c;
register char *ep, *sp;
char neg;
}
}
}
-rline(lbuf)
-char *lbuf;
-{
+int rline(lbuf) char *lbuf; {
register char *p, *q;
register t;
static char *saveq;
return(-1);
}
-char *address(expbuf)
-char *expbuf;
-{
+char *address(expbuf) char *expbuf; {
register char *rcp;
long lno;
}
return(0);
}
-cmp(a, b)
-char *a,*b;
-{
+int cmp(a, b) char *a; char *b; {
register char *ra, *rb;
ra = a - 1;
return(1);
}
-char *text(textbuf)
-char *textbuf;
-{
+char *text(textbuf) char *textbuf; {
register char *p, *q;
p = textbuf;
}
}
-
-struct label *search(ptr)
-struct label *ptr;
-{
+struct label *search(ptr) struct label *ptr; {
struct label *rp;
rp = labtab;
return(0);
}
-
-dechain()
-{
+int dechain() {
struct label *lptr;
struct re *rptr, *trptr;
}
}
-char *ycomp(expbuf)
-char *expbuf;
-{
+char *ycomp(expbuf) char *expbuf; {
register char c, *ep, *tsp;
char *sp;
+/*#include <stdio.h> sed.h*/
+#include <sys/file.h>
+#include "sed.h"
+
/* sed1.c 4.2 85/04/05 */
-#include <stdio.h>
-#include "sed.h"
+/*#include <stdio.h>*/
+/*#include "sed.h"*/
char *trans[040] = {
"\\01",
};
char rub[] = {"\177"};
-execute(file)
-char *file;
-{
+int execute(file) char *file; {
register char *p1, *p2;
register struct re *ipc;
int c;
}
}
-match(expbuf, gf)
-char *expbuf;
-{
+int match(expbuf, gf) char *expbuf; int gf; {
register char *p1, *p2, c;
if(gf) {
} while(*p1++);
return(0);
}
-advance(alp, aep)
-char *alp, *aep;
-{
+int advance(alp, aep) char *alp; char *aep; {
register char *lp, *ep, *curlp;
char c;
char *bbeg;
}
return(0);
-
case CDOT|STAR:
curlp = lp;
while (*lp++);
fprintf(stderr, "RE botch, %o\n", *--ep);
}
}
-substitute(ipc)
-struct re *ipc;
-{
+int substitute(ipc) struct re *ipc; {
if(match(ipc->re1, 0) == 0) return(0);
sflag = 1;
return(1);
}
-dosub(rhsbuf)
-char *rhsbuf;
-{
+int dosub(rhsbuf) char *rhsbuf; {
register char *lp, *sp, *rp;
int c;
while (*lp++ = *sp++);
spend = lp-1;
}
-char *place(asp, al1, al2)
-char *asp, *al1, *al2;
-{
+char *place(asp, al1, al2) char *asp; char *al1; char *al2; {
register char *sp, *l1, *l2;
sp = asp;
return(sp);
}
-command(ipc)
-struct re *ipc;
-{
+int command(ipc) struct re *ipc; {
register int i;
register char *p1, *p2, *p3;
char *execp;
-
switch(ipc->command) {
case ACOM:
}
-char *
-gline(addr)
-char *addr;
-{
+char *gline(addr) char *addr; {
register char *p1, *p2;
register c;
p1 = addr;
return(p1);
}
-ecmp(a, b, count)
-char *a, *b;
-{
+int ecmp(a, b, count) char *a; char *b; int count; {
while(count--)
if(*a++ != *b++) return(0);
return(1);
}
-arout()
-{
+int arout() {
register char *p1;
FILE *fi;
char c;
aptr = abuf;
*aptr = 0;
}
-