Update diff and emg.
This commit is contained in:
@@ -6,6 +6,6 @@ extern int tgetnum(char *);
|
||||
extern int tgetflag(char *);
|
||||
extern char *tgetstr(char *, char **);
|
||||
extern char *tgoto(char *, int, int);
|
||||
extern int tputs(register char *, int, int (*)());
|
||||
extern int tputs(register char *, int, int (*)(int));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,10 +3,36 @@
|
||||
*/
|
||||
#include "diff.h"
|
||||
|
||||
int opt;
|
||||
int tflag; /* expand tabs on output */
|
||||
int hflag; /* -h, use halfhearted DIFFH */
|
||||
int bflag; /* ignore blanks in comparisons */
|
||||
int wflag; /* totally ignore blanks in comparisons */
|
||||
int iflag; /* ignore case in comparisons */
|
||||
int lflag; /* long output format with header */
|
||||
int rflag; /* recursively trace directories */
|
||||
int sflag; /* announce files which are same */
|
||||
char *start; /* do file only if name >= this */
|
||||
int wantelses; /* -E */
|
||||
char *ifdef1; /* String for -1 */
|
||||
char *ifdef2; /* String for -2 */
|
||||
char *endifname; /* What we will print on next #endif */
|
||||
int inifdef;
|
||||
int context; /* lines of context to be printed */
|
||||
int status;
|
||||
int anychange;
|
||||
char *tempfile; /* used when comparing against std input */
|
||||
char **diffargv; /* option list to pass to recursive diffs */
|
||||
char *file1, *file2, *efile1, *efile2;
|
||||
struct stat stb1, stb2;
|
||||
|
||||
char diff[] = DIFF;
|
||||
char diffh[] = DIFFH;
|
||||
char pr[] = PR;
|
||||
|
||||
void noroom(void);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
@@ -158,6 +184,7 @@ savestr(cp)
|
||||
return (dp);
|
||||
}
|
||||
|
||||
int
|
||||
min(a,b)
|
||||
int a,b;
|
||||
{
|
||||
@@ -165,6 +192,7 @@ min(a,b)
|
||||
return (a < b ? a : b);
|
||||
}
|
||||
|
||||
int
|
||||
max(a,b)
|
||||
int a,b;
|
||||
{
|
||||
@@ -172,7 +200,8 @@ max(a,b)
|
||||
return (a > b ? a : b);
|
||||
}
|
||||
|
||||
void done(sig)
|
||||
void
|
||||
done(sig)
|
||||
int sig;
|
||||
{
|
||||
if (tempfile)
|
||||
@@ -185,9 +214,10 @@ talloc(n)
|
||||
{
|
||||
register char *p;
|
||||
|
||||
if ((p = malloc((unsigned)n)) != NULL)
|
||||
return(p);
|
||||
noroom();
|
||||
p = malloc((unsigned)n);
|
||||
if (p == NULL)
|
||||
noroom();
|
||||
return(p);
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -201,6 +231,7 @@ char *p;
|
||||
return(q);
|
||||
}
|
||||
|
||||
void
|
||||
noroom()
|
||||
{
|
||||
fprintf(stderr, "diff: files too big, try -h\n");
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/dir.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/*
|
||||
* Output format options
|
||||
*/
|
||||
int opt;
|
||||
extern int opt;
|
||||
|
||||
#define D_NORMAL 0 /* Normal output */
|
||||
#define D_EDIT -1 /* Editor script out */
|
||||
@@ -23,49 +25,49 @@ int opt;
|
||||
#define D_NREVERSE 4 /* Reverse ed script with numbered
|
||||
lines and no trailing . */
|
||||
|
||||
int tflag; /* expand tabs on output */
|
||||
extern int tflag; /* expand tabs on output */
|
||||
|
||||
/*
|
||||
* Algorithm related options
|
||||
*/
|
||||
int hflag; /* -h, use halfhearted DIFFH */
|
||||
int bflag; /* ignore blanks in comparisons */
|
||||
int wflag; /* totally ignore blanks in comparisons */
|
||||
int iflag; /* ignore case in comparisons */
|
||||
extern int hflag; /* -h, use halfhearted DIFFH */
|
||||
extern int bflag; /* ignore blanks in comparisons */
|
||||
extern int wflag; /* totally ignore blanks in comparisons */
|
||||
extern int iflag; /* ignore case in comparisons */
|
||||
|
||||
/*
|
||||
* Options on hierarchical diffs.
|
||||
*/
|
||||
int lflag; /* long output format with header */
|
||||
int rflag; /* recursively trace directories */
|
||||
int sflag; /* announce files which are same */
|
||||
char *start; /* do file only if name >= this */
|
||||
extern int lflag; /* long output format with header */
|
||||
extern int rflag; /* recursively trace directories */
|
||||
extern int sflag; /* announce files which are same */
|
||||
extern char *start; /* do file only if name >= this */
|
||||
|
||||
/*
|
||||
* Variables for -I D_IFDEF option.
|
||||
*/
|
||||
int wantelses; /* -E */
|
||||
char *ifdef1; /* String for -1 */
|
||||
char *ifdef2; /* String for -2 */
|
||||
char *endifname; /* What we will print on next #endif */
|
||||
int inifdef;
|
||||
extern int wantelses; /* -E */
|
||||
extern char *ifdef1; /* String for -1 */
|
||||
extern char *ifdef2; /* String for -2 */
|
||||
extern char *endifname; /* What we will print on next #endif */
|
||||
extern int inifdef;
|
||||
|
||||
/*
|
||||
* Variables for -c context option.
|
||||
*/
|
||||
int context; /* lines of context to be printed */
|
||||
extern int context; /* lines of context to be printed */
|
||||
|
||||
/*
|
||||
* State for exit status.
|
||||
*/
|
||||
int status;
|
||||
int anychange;
|
||||
char *tempfile; /* used when comparing against std input */
|
||||
extern int status;
|
||||
extern int anychange;
|
||||
extern char *tempfile; /* used when comparing against std input */
|
||||
|
||||
/*
|
||||
* Variables for diffdir.
|
||||
*/
|
||||
char **diffargv; /* option list to pass to recursive diffs */
|
||||
extern char **diffargv; /* option list to pass to recursive diffs */
|
||||
|
||||
/*
|
||||
* Input file names.
|
||||
@@ -73,12 +75,16 @@ char **diffargv; /* option list to pass to recursive diffs */
|
||||
* and padded with a '/', and then efile0 and efile1 point after
|
||||
* the '/'.
|
||||
*/
|
||||
char *file1, *file2, *efile1, *efile2;
|
||||
struct stat stb1, stb2;
|
||||
extern char *file1, *file2, *efile1, *efile2;
|
||||
extern struct stat stb1, stb2;
|
||||
|
||||
char *talloc(), *ralloc();
|
||||
char *savestr(), *splice(), *splicen();
|
||||
char *copytemp();
|
||||
char *talloc(int n);
|
||||
char *ralloc(char *p, int n);
|
||||
char *savestr(char *cp);
|
||||
int min(int a, int b);
|
||||
int max(int a, int b);
|
||||
void done(int);
|
||||
void diffdir(char **argv);
|
||||
void diffreg(void);
|
||||
|
||||
extern char diffh[], diff[], pr[];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* diff - directory comparison
|
||||
*/
|
||||
#include <sys/wait.h>
|
||||
#include "diff.h"
|
||||
|
||||
#define d_flags d_ino
|
||||
@@ -21,6 +22,15 @@ struct dir *setupdir();
|
||||
int header;
|
||||
char title[2*BUFSIZ], *etitle;
|
||||
|
||||
void setfile(char **fpp, char **epp, char *file);
|
||||
int useless(char *cp);
|
||||
void only(struct dir *dp, int which);
|
||||
void compare(struct dir *dp);
|
||||
void scanpr(struct dir *dp, int test, char *title, char *file1, char *efile1, char *file2, char *efile2);
|
||||
void calldiff(char *wantpr);
|
||||
int ascii(int f);
|
||||
|
||||
void
|
||||
diffdir(argv)
|
||||
char **argv;
|
||||
{
|
||||
@@ -109,6 +119,7 @@ diffdir(argv)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
setfile(fpp, epp, file)
|
||||
char **fpp, **epp;
|
||||
char *file;
|
||||
@@ -127,6 +138,7 @@ setfile(fpp, epp, file)
|
||||
*epp = cp;
|
||||
}
|
||||
|
||||
void
|
||||
scanpr(dp, test, title, file1, efile1, file2, efile2)
|
||||
register struct dir *dp;
|
||||
int test;
|
||||
@@ -152,6 +164,7 @@ scanpr(dp, test, title, file1, efile1, file2, efile2)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
only(dp, which)
|
||||
struct dir *dp;
|
||||
int which;
|
||||
@@ -193,7 +206,7 @@ setupdir(cp)
|
||||
fprintf(stderr, "diff: ran out of memory\n");
|
||||
done(0);
|
||||
}
|
||||
while (rp = readdir(dirp)) {
|
||||
while ((rp = readdir(dirp))) {
|
||||
ep = &dp[nitems++];
|
||||
ep->d_reclen = rp->d_reclen;
|
||||
ep->d_namlen = rp->d_namlen;
|
||||
@@ -222,12 +235,14 @@ setupdir(cp)
|
||||
return (dp);
|
||||
}
|
||||
|
||||
int
|
||||
entcmp(d1, d2)
|
||||
struct dir *d1, *d2;
|
||||
{
|
||||
return (strcmp(d1->d_entry, d2->d_entry));
|
||||
}
|
||||
|
||||
void
|
||||
compare(dp)
|
||||
register struct dir *dp;
|
||||
{
|
||||
@@ -320,6 +335,7 @@ closem:
|
||||
|
||||
char *prargs[] = { "pr", "-h", 0, "-f", 0, 0 };
|
||||
|
||||
void
|
||||
calldiff(wantpr)
|
||||
char *wantpr;
|
||||
{
|
||||
@@ -379,6 +395,7 @@ calldiff(wantpr)
|
||||
|
||||
#include <a.out.h>
|
||||
|
||||
int
|
||||
ascii(f)
|
||||
int f;
|
||||
{
|
||||
@@ -404,6 +421,7 @@ ascii(f)
|
||||
/*
|
||||
* THIS IS CRUDE.
|
||||
*/
|
||||
int
|
||||
useless(cp)
|
||||
register char *cp;
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -17,12 +18,22 @@ int bflag;
|
||||
int debug = 0;
|
||||
FILE *file[2];
|
||||
|
||||
void progerr(char *s);
|
||||
int hardsynch(void);
|
||||
void movstr(char *s, char *t);
|
||||
void error(char *s, char *t);
|
||||
int cmp(char *s, char *t);
|
||||
int easysynch(void);
|
||||
int output(int a, int b);
|
||||
void change(long a, int b, long c, int d, char *s);
|
||||
void range(long a, int b);
|
||||
|
||||
/* return pointer to line n of file f*/
|
||||
char *getl(f,n)
|
||||
long n;
|
||||
{
|
||||
register char *t;
|
||||
register delta, nt;
|
||||
register int delta, nt;
|
||||
again:
|
||||
delta = n - lineno[f];
|
||||
nt = ntext[f];
|
||||
@@ -39,11 +50,12 @@ again:
|
||||
t = text[f][nt];
|
||||
if(t==0) {
|
||||
t = text[f][nt] = malloc(LEN+1);
|
||||
if(t==NULL)
|
||||
if(t==NULL) {
|
||||
if(hardsynch())
|
||||
goto again;
|
||||
else
|
||||
progerr("5");
|
||||
}
|
||||
}
|
||||
t = fgets(t,LEN,file[f]);
|
||||
if(t!=NULL)
|
||||
@@ -52,10 +64,11 @@ again:
|
||||
}
|
||||
|
||||
/*remove thru line n of file f from storage*/
|
||||
void
|
||||
clrl(f,n)
|
||||
long n;
|
||||
{
|
||||
register i,j;
|
||||
register int i,j;
|
||||
j = n-lineno[f]+1;
|
||||
for(i=0;i+j<ntext[f];i++)
|
||||
movstr(text[f][i+j],text[f][i]);
|
||||
@@ -63,13 +76,15 @@ long n;
|
||||
ntext[f] -= j;
|
||||
}
|
||||
|
||||
void
|
||||
movstr(s,t)
|
||||
register char *s, *t;
|
||||
{
|
||||
while(*t++= *s++)
|
||||
while ((*t++ = *s++))
|
||||
continue;
|
||||
}
|
||||
|
||||
int
|
||||
main(argc,argv)
|
||||
char **argv;
|
||||
{
|
||||
@@ -112,10 +127,11 @@ char **argv;
|
||||
}
|
||||
|
||||
/* synch on C successive matches*/
|
||||
int
|
||||
easysynch()
|
||||
{
|
||||
int i,j;
|
||||
register k,m;
|
||||
register int k,m;
|
||||
char *s0,*s1;
|
||||
for(i=j=1;i<RANGE&&j<RANGE;i++,j++) {
|
||||
s0 = getl(0,n0+i);
|
||||
@@ -144,9 +160,10 @@ cont2: ;
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
output(a,b)
|
||||
{
|
||||
register i;
|
||||
register int i;
|
||||
char *s;
|
||||
if(a<0)
|
||||
change(n0-1,0,n1,b,"a");
|
||||
@@ -175,6 +192,7 @@ output(a,b)
|
||||
return(1);
|
||||
}
|
||||
|
||||
void
|
||||
change(a,b,c,d,s)
|
||||
long a,c;
|
||||
char *s;
|
||||
@@ -185,6 +203,7 @@ char *s;
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void
|
||||
range(a,b)
|
||||
long a;
|
||||
{
|
||||
@@ -196,6 +215,7 @@ long a;
|
||||
printf("%ld,%ld",a,a+b);
|
||||
}
|
||||
|
||||
int
|
||||
cmp(s,t)
|
||||
char *s,*t;
|
||||
{
|
||||
@@ -220,20 +240,21 @@ char *f1,*f2;
|
||||
FILE *f;
|
||||
char b[100],*bptr,*eptr;
|
||||
struct stat statbuf;
|
||||
if(cmp(f1,"-")==0)
|
||||
if (cmp(f1, "-") == 0) {
|
||||
if(cmp(f2,"-")==0)
|
||||
error("can't do - -","");
|
||||
else
|
||||
return(stdin);
|
||||
}
|
||||
if(stat(f1,&statbuf)==-1)
|
||||
error("can't access ",f1);
|
||||
if((statbuf.st_mode&S_IFMT)==S_IFDIR) {
|
||||
for(bptr=b;*bptr= *f1++;bptr++) ;
|
||||
for (bptr = b; (*bptr = *f1++); bptr++) ;
|
||||
*bptr++ = '/';
|
||||
for(eptr=f2;*eptr;eptr++)
|
||||
if(*eptr=='/'&&eptr[1]!=0&&eptr[1]!='/')
|
||||
f2 = eptr+1;
|
||||
while(*bptr++= *f2++) ;
|
||||
while ((*bptr++ = *f2++)) ;
|
||||
f1 = b;
|
||||
}
|
||||
f = fopen(f1,"r");
|
||||
@@ -242,13 +263,14 @@ char *f1,*f2;
|
||||
return(f);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
progerr(s)
|
||||
char *s;
|
||||
{
|
||||
error("program error ",s);
|
||||
}
|
||||
|
||||
void
|
||||
error(s,t)
|
||||
char *s,*t;
|
||||
{
|
||||
@@ -257,6 +279,7 @@ char *s,*t;
|
||||
}
|
||||
|
||||
/*stub for resychronization beyond limits of text buf*/
|
||||
int
|
||||
hardsynch()
|
||||
{
|
||||
change(n0,INF,n1,INF,"c");
|
||||
|
||||
@@ -135,6 +135,28 @@ const char cup2low[256] = {
|
||||
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
|
||||
};
|
||||
|
||||
char *splice(char *dir, char *file);
|
||||
char *copytemp(void);
|
||||
int asciifile(FILE *f);
|
||||
void prepare(int i, FILE *fd);
|
||||
void prune(void);
|
||||
void sort(struct line *a, int n);
|
||||
void equiv(struct line *a, int n, struct line *b, int m, int *c);
|
||||
void unsort(struct line *f, int l, int *b);
|
||||
int stone(int *a, int n, int *b, int *c);
|
||||
void unravel(int p);
|
||||
void check(void);
|
||||
void output(void);
|
||||
int readhash(FILE *f);
|
||||
int newcand(int x, int y, int pred);
|
||||
int search(int *c, int k, int y);
|
||||
int skipline(int f);
|
||||
void change(int a, int b, int c, int d);
|
||||
void dump_context_vec(void);
|
||||
void range(int a, int b, char *separator);
|
||||
void fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile);
|
||||
|
||||
void
|
||||
diffreg()
|
||||
{
|
||||
register int i, j;
|
||||
@@ -306,16 +328,17 @@ splice(dir, file)
|
||||
return (savestr(buf));
|
||||
}
|
||||
|
||||
void
|
||||
prepare(i, fd)
|
||||
int i;
|
||||
FILE *fd;
|
||||
{
|
||||
register struct line *p;
|
||||
register j,h;
|
||||
register int j, h;
|
||||
|
||||
fseek(fd, (long)0, 0);
|
||||
p = (struct line *)talloc(3*sizeof(line));
|
||||
for(j=0; h=readhash(fd);) {
|
||||
for (j = 0; (h = readhash(fd)); ) {
|
||||
p = (struct line *)ralloc((char *)p,(++j+3)*sizeof(line));
|
||||
p[j].value = h;
|
||||
}
|
||||
@@ -323,9 +346,10 @@ prepare(i, fd)
|
||||
file[i] = p;
|
||||
}
|
||||
|
||||
void
|
||||
prune()
|
||||
{
|
||||
register i,j;
|
||||
register int i, j;
|
||||
for(pref=0;pref<len[0]&&pref<len[1]&&
|
||||
file[0][pref+1].value==file[1][pref+1].value;
|
||||
pref++ ) ;
|
||||
@@ -340,6 +364,7 @@ prune()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
equiv(a,n,b,m,c)
|
||||
struct line *a, *b;
|
||||
int *c;
|
||||
@@ -368,6 +393,7 @@ int *c;
|
||||
c[j] = -1;
|
||||
}
|
||||
|
||||
int
|
||||
stone(a,n,b,c)
|
||||
int *a;
|
||||
int *b;
|
||||
@@ -409,6 +435,7 @@ register int *c;
|
||||
return(k);
|
||||
}
|
||||
|
||||
int
|
||||
newcand(x,y,pred)
|
||||
{
|
||||
register struct cand *q;
|
||||
@@ -420,6 +447,7 @@ newcand(x,y,pred)
|
||||
return(clen-1);
|
||||
}
|
||||
|
||||
int
|
||||
search(c, k, y)
|
||||
int *c;
|
||||
{
|
||||
@@ -444,6 +472,7 @@ int *c;
|
||||
return(l+1);
|
||||
}
|
||||
|
||||
void
|
||||
unravel(p)
|
||||
{
|
||||
register int i;
|
||||
@@ -461,6 +490,7 @@ unravel(p)
|
||||
to confounding by hashing (which result in "jackpot")
|
||||
2. collect random access indexes to the two files */
|
||||
|
||||
void
|
||||
check()
|
||||
{
|
||||
register int i, j;
|
||||
@@ -560,6 +590,7 @@ check()
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
sort(a,n) /*shellsort CACM #201*/
|
||||
struct line *a;
|
||||
{
|
||||
@@ -595,6 +626,7 @@ struct line *a;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
unsort(f, l, b)
|
||||
struct line *f;
|
||||
int *b;
|
||||
@@ -609,9 +641,10 @@ int *b;
|
||||
free((char *)a);
|
||||
}
|
||||
|
||||
int
|
||||
skipline(f)
|
||||
{
|
||||
register i, c;
|
||||
register int i, c;
|
||||
|
||||
for(i=1;(c=getc(input[f]))!='\n';i++)
|
||||
if (c < 0)
|
||||
@@ -619,6 +652,7 @@ skipline(f)
|
||||
return(i);
|
||||
}
|
||||
|
||||
void
|
||||
output()
|
||||
{
|
||||
int m;
|
||||
@@ -686,6 +720,7 @@ struct context_vec *context_vec_start,
|
||||
and this means that there were lines appended (beginning at b).
|
||||
If c is greater than d then there are lines missing from the to file.
|
||||
*/
|
||||
void
|
||||
change(a,b,c,d)
|
||||
{
|
||||
int ch;
|
||||
@@ -776,6 +811,7 @@ change(a,b,c,d)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
range(a,b,separator)
|
||||
char *separator;
|
||||
{
|
||||
@@ -785,6 +821,7 @@ char *separator;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fetch(f,a,b,lb,s,oldfile)
|
||||
long *f;
|
||||
FILE *lb;
|
||||
@@ -864,13 +901,14 @@ char *s;
|
||||
* arranging line in 7-bit bytes and then
|
||||
* summing 1-s complement in 16-bit hunks
|
||||
*/
|
||||
int
|
||||
readhash(f)
|
||||
register FILE *f;
|
||||
{
|
||||
register long sum;
|
||||
register unsigned shift;
|
||||
register t;
|
||||
register space;
|
||||
register int t;
|
||||
register int space;
|
||||
|
||||
sum = 1;
|
||||
space = 0;
|
||||
@@ -931,6 +969,7 @@ register FILE *f;
|
||||
|
||||
#include <a.out.h>
|
||||
|
||||
int
|
||||
asciifile(f)
|
||||
FILE *f;
|
||||
{
|
||||
@@ -953,8 +992,8 @@ asciifile(f)
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/* dump accumulated "context" diff changes */
|
||||
void
|
||||
dump_context_vec()
|
||||
{
|
||||
register int a, b, c, d;
|
||||
@@ -998,15 +1037,15 @@ dump_context_vec()
|
||||
ch = (a <= b) ? 'd' : 'a';
|
||||
|
||||
if (ch == 'a')
|
||||
fetch(ixold,lowa,b,input[0]," ");
|
||||
fetch(ixold,lowa,b,input[0]," ", 0);
|
||||
else {
|
||||
fetch(ixold,lowa,a-1,input[0]," ");
|
||||
fetch(ixold,a,b,input[0],ch == 'c' ? "! " : "- ");
|
||||
fetch(ixold,lowa,a-1,input[0]," ", 0);
|
||||
fetch(ixold,a,b,input[0],ch == 'c' ? "! " : "- ", 0);
|
||||
}
|
||||
lowa = b + 1;
|
||||
cvp++;
|
||||
}
|
||||
fetch(ixold, b+1, upb, input[0], " ");
|
||||
fetch(ixold, b+1, upb, input[0], " ", 0);
|
||||
}
|
||||
|
||||
/* output changes to the "new" file */
|
||||
@@ -1032,15 +1071,15 @@ dump_context_vec()
|
||||
ch = (a <= b) ? 'd' : 'a';
|
||||
|
||||
if (ch == 'd')
|
||||
fetch(ixnew,lowc,d,input[1]," ");
|
||||
fetch(ixnew,lowc,d,input[1]," ", 0);
|
||||
else {
|
||||
fetch(ixnew,lowc,c-1,input[1]," ");
|
||||
fetch(ixnew,c,d,input[1],ch == 'c' ? "! " : "+ ");
|
||||
fetch(ixnew,lowc,c-1,input[1]," ", 0);
|
||||
fetch(ixnew,c,d,input[1],ch == 'c' ? "! " : "+ ", 0);
|
||||
}
|
||||
lowc = d + 1;
|
||||
cvp++;
|
||||
}
|
||||
fetch(ixnew, d+1, upd, input[1], " ");
|
||||
fetch(ixnew, d+1, upd, input[1], " ", 0);
|
||||
}
|
||||
|
||||
context_vec_ptr = context_vec_start - 1;
|
||||
|
||||
@@ -11,10 +11,10 @@ CFLAGS = -Os -Wall -Werror
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
|
||||
# This reduces code size significantly.
|
||||
CFLAGS += -mips16
|
||||
#CFLAGS += -mips16
|
||||
|
||||
# with CFLAGS+= -ffunction-sections -fdata-sections
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
#LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
LIBS = -ltermcap -lc
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ typedef struct
|
||||
void (*t_open) (); /* Open terminal at the start */
|
||||
void (*t_close) (); /* Close terminal at end */
|
||||
int (*t_getchar) (); /* Get character from keyboard */
|
||||
void (*t_putchar) (); /* Put character to display */
|
||||
int (*t_putchar) (); /* Put character to display */
|
||||
void (*t_flush) (); /* Flush output buffers */
|
||||
void (*t_move) (); /* Move the cursor, origin 0 */
|
||||
void (*t_eeol) (); /* Erase to end of line */
|
||||
|
||||
@@ -8,16 +8,12 @@
|
||||
#include "edef.h"
|
||||
#undef CTRL /* Needs to be done here. */
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
extern int tgetent();
|
||||
extern char *tgetstr();
|
||||
extern char *tgoto();
|
||||
extern void tputs();
|
||||
#include <term.h>
|
||||
|
||||
extern char *getenv();
|
||||
extern void ttopen();
|
||||
extern int ttgetc();
|
||||
extern void ttputc();
|
||||
extern int ttputc(int);
|
||||
extern void ttflush();
|
||||
extern void ttclose();
|
||||
|
||||
@@ -39,6 +35,11 @@ void tcapbeep(void);
|
||||
char tcapbuf[TCAPSLEN]; /* capabilities actually used */
|
||||
char *CM, *CE, *CL, *SO, *SE;
|
||||
|
||||
char *UP; /* required by libtermcap */
|
||||
char *BC;
|
||||
char PC = '\0';
|
||||
short ospeed = 0;
|
||||
|
||||
TERM term = {
|
||||
0, 0, MARGIN, SCRSIZ, tcapopen, ttclose, ttgetc, ttputc,
|
||||
ttflush, tcapmove, tcapeeol, tcapeeop, tcapbeep, tcaprev
|
||||
|
||||
@@ -4,7 +4,8 @@ include $(TOPSRC)/target.mk
|
||||
#CC=gcc
|
||||
CFLAGS += -g -DUNIX_HOST -DVER='"1.0"' -DFILENAME_MAX=64 \
|
||||
-DL_tmpnam=30 -DCLOCKS_PER_SEC=80000000 -DPATH_MAX=200 \
|
||||
-DNO_FP -Os -Werror -mips16
|
||||
-DNO_FP -Os -Werror
|
||||
#CFLAGS += -mips16
|
||||
LIBS = -lm -lc
|
||||
|
||||
TARGET = picoc
|
||||
|
||||
@@ -5,6 +5,7 @@ CFLAGS = -Os -Wall -DMIPS -DNO_ANNOTATIONS -DNO_PREPROCESSOR \
|
||||
-DNO_PPACK -D_RETROBSD -D__SMALLER_C_SCHAR__ \
|
||||
-D__SMALLER_C__ -D__SMALLER_C_32__ -DSTATIC \
|
||||
-DNO_EXTRA_WARNS -DSYNTAX_STACK_MAX=3200
|
||||
#CFLAGS += -mips16
|
||||
|
||||
# For cross compile
|
||||
#include $(TOPSRC)/cross.mk
|
||||
@@ -33,4 +34,4 @@ clean:
|
||||
rm -f *.o smlrc smlrc.dis smlrc.elf
|
||||
###
|
||||
smlrc.o: smlrc.c fp.c cgmips.c
|
||||
${CC} ${CFLAGS} -mips16 smlrc.c -c -o $@
|
||||
${CC} ${CFLAGS} smlrc.c -c -o $@
|
||||
|
||||
@@ -17,8 +17,8 @@ LIBOBJ = logent.o ulockf.o uucpdefs.o subdir.o gename.o assert.o expfile.o \
|
||||
mailst.o systat.o cntrl.o imsg.o gio.o sysacct.o pk0.o pk1.o \
|
||||
conn.o condevs.o chksum.o setline.o gnsys.o
|
||||
|
||||
CC = $(GCCPREFIX)gcc -mips16 -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES)
|
||||
|
||||
CC = $(GCCPREFIX)gcc -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES)
|
||||
#CC += -mips16
|
||||
|
||||
|
||||
OWNER= uucp
|
||||
|
||||
@@ -28,7 +28,7 @@ void
|
||||
tputs(cp, affcnt, outc)
|
||||
register char *cp;
|
||||
int affcnt;
|
||||
int (*outc)();
|
||||
int (*outc)(int);
|
||||
{
|
||||
register int i = 0;
|
||||
register int mspc10;
|
||||
|
||||
Reference in New Issue
Block a user