From: nealcrook Date: Mon, 7 Nov 2016 17:52:10 +0000 (+0000) Subject: Delete trailing whitespace. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8e558c093379039917de53f91e2e5676d91293c8;p=FUZIX.git Delete trailing whitespace. Comment VT52, ANSI defines out of levee.h so they can be done on the command line. Remove dead code. Disambiguate levee code from standard library functions (as the original author has done in later versions than we are using): refresh -> lvrefresh scan -> lvscan getcontext -> lvgetcontext getline -> lvgetline --- diff --git a/Applications/levee/display.c b/Applications/levee/display.c index d28eb57e..9ae0aef6 100644 --- a/Applications/levee/display.c +++ b/Applications/levee/display.c @@ -41,7 +41,7 @@ PROC mvcur(int y, int x) { static char gt[30]; - + if (y == -1) y = curpos.y; else @@ -106,7 +106,7 @@ printi(int num) { char nb[10]; register int size; - + numtoa(nb,num); size = min(strlen(nb),COLS-curpos.x); if (size > 0) { @@ -202,7 +202,7 @@ writeline(int y,int x,int start) register int size; char buf[MAXCOLS+1]; register int bi = 0; - + endd = fseekeol(start); if (start==0 || core[start-1] == EOL) mvcur(y, 0); @@ -230,10 +230,10 @@ writeline(int y,int x,int start) /* redraw && refresh the screen */ PROC -refresh(int y,int x,int start,int endd, bool rest) +lvrefresh(int y,int x,int start,int endd, bool rest) { int sp; - + #if ST /* turn the cursor off */ asm(" clr.l -(sp) "); @@ -271,9 +271,9 @@ redisplay(bool flag) { if (flag) clrprompt(); - refresh(0, 0, ptop, pend, TRUE); + lvrefresh(0, 0, ptop, pend, TRUE); } - + PROC scrollback(int curr) { @@ -303,11 +303,11 @@ bool PROC ok_to_scroll(int top, int bottom) { int nl, i; - + nl = dofscroll; i = top; do - i += 1+scan(bufmax-i,'=',EOL, &core[i]); + i += 1 + lvscan(bufmax-i,'=',EOL, &core[i]); while (--nl > 0 && i < bottom); return(nl>0); } diff --git a/Applications/levee/editcor.c b/Applications/levee/editcor.c index d692fb03..a116e3ed 100644 --- a/Applications/levee/editcor.c +++ b/Applications/levee/editcor.c @@ -345,9 +345,9 @@ docommand(cmdtype cmd) else { yp = setY(curr); if (endY != setY(newend)) /* shuffled lines */ - refresh(setY(disp), setX(disp), disp, pend, TRUE); + lvrefresh(setY(disp), setX(disp), disp, pend, TRUE); else /* refresh to end position */ - refresh(setY(disp), setX(disp), disp, newend, FALSE); + lvrefresh(setY(disp), setX(disp), disp, newend, FALSE); } if (curr >= bufmax && bufmax > 0) { /* adjust off end of buffer */ setpos(bufmax-1); diff --git a/Applications/levee/extern.h b/Applications/levee/extern.h index b7f1a7c4..27f72e8d 100644 --- a/Applications/levee/extern.h +++ b/Applications/levee/extern.h @@ -57,13 +57,13 @@ int RE_start[9], /* start of substitute argument */ extern struct undostack undo; /* To undo a command */ /* R A N D O M S T R I N G S */ - + extern char instring[], /* Latest input */ filenm[], /* Filename */ altnm[], /* Alternate filename */ gcb[]; /* Command buffer for mutations of insert */ - + extern char undobuf[], undotmp[], @@ -75,7 +75,7 @@ int uread, /* reading from the undo stack */ extern char rcb[], *rcp, /* last modification command */ core[]; /* data space */ - + extern struct ybuf yank; /* last deleted/yanked text */ /* STATIC INITIALIZATIONS: */ @@ -112,7 +112,7 @@ char ED_NOTICE[], /* Editor version */ ED_REVISION, /* Small revisions & corrections */ fismod[], /* File is modified message */ fisro[]; /* permission denied message */ - + extern char *excmds[], wordset[], @@ -132,7 +132,7 @@ int autowrite, wrapscan, bell, magic; -/*extern +/*extern char *suffix; */ /* For movement routines */ extern @@ -140,7 +140,7 @@ int setstep[]; /* Where the last diddling left us */ extern struct coord curpos; - + /* initialize the buffer */ extern int curr, /* Global cursor pos */ @@ -162,7 +162,7 @@ bool modified, /* File has been modified */ lineonly, /* Dumb terminal? */ zotscreen, /* do more after command in execmode */ diddled; /* force redraw when I enter editcore */ - + extern int macro; /* Index into MCR macro execution stack */ extern @@ -173,7 +173,7 @@ cmdtype movemap[]; #endif /*GLOBALS_D*/ #ifndef EXTERN_D #define EXTERN_D -#define wc(ch) (scan(65,'=',(ch),wordset)<65) +#define wc(ch) (lvscan(65,'=',(ch),wordset)<65) #if SYS5 #define fillchar(p,l,c) memset((p),(c),(l)) @@ -183,7 +183,7 @@ cmdtype movemap[]; #endif /*ST*/ #endif /*SYS5*/ /* non int functions to be found elsewhere */ - + #if 0 extern findstates findCP(); extern exec_type editcore(); diff --git a/Applications/levee/find.c b/Applications/levee/find.c index 500a8cd5..fbdf4cef 100644 --- a/Applications/levee/find.c +++ b/Applications/levee/find.c @@ -87,7 +87,7 @@ omatch(char *pattern, char **cp, char *endp) } return FALSE; } - + int PROC amatch(char *pattern, char *start, char *endp) { @@ -132,7 +132,7 @@ PROC patsize(char **pattern) { register int count; - + switch (**pattern) { case LITCHAR: *pattern += 2; @@ -154,7 +154,7 @@ locate(char *pattern, char *linep) { register char *p = 1+pattern; register int count; - + if ((count = (*p++)&0xff) == 0) return FALSE; while (count--) @@ -245,11 +245,11 @@ char * PROC makepat(char *string, char delim) RE_start[arg] = RE_size[arg] = (-1); arg = 0; p = pattern; - + while ((*string != delim) && (*string != 0)) { oldcp = cp; cp = p; - + if (!magic) /* kludge for nonmagical patterns */ goto normal; if (*string == ANY) @@ -397,7 +397,7 @@ findparse(char *src, int *idx, int start) /* driver for ?, /, && : lineranges */ count = 0; while (*src >= '0' && *src <= '9') count = (count*10) + *(src++) - '0'; - + addr = to_index(count); break; case '$': @@ -409,7 +409,7 @@ findparse(char *src, int *idx, int start) /* driver for ?, /, && : lineranges */ break; case '`': case '\'': - addr = getcontext(*(src+1), (*src == '\'')); + addr = lvgetcontext(*(src+1), (*src == '\'')); src += 2; break; } @@ -465,22 +465,22 @@ nextline(bool advance, int dest, int count) int PROC fseekeol(int origin) { - return(origin + scan(bufmax-origin-1,'=',EOL,&core[origin])); + return(origin + lvscan(bufmax-origin-1,'=',EOL,&core[origin])); } int PROC bseekeol(int origin) { - return(origin + scan(-origin,'=',EOL,&core[origin-1])); + return(origin + lvscan(-origin,'=',EOL,&core[origin-1])); } /* get something from the context table */ int PROC -getcontext(char c, bool begline) +lvgetcontext(char c, bool begline) { int i; - + if (c == '\'') c = '`'; if (c >= '`' && c <= 'z') diff --git a/Applications/levee/globals.c b/Applications/levee/globals.c index c4f49dc4..0921f25e 100644 --- a/Applications/levee/globals.c +++ b/Applications/levee/globals.c @@ -21,8 +21,8 @@ #include "levee.h" #define GLOBALS -char lastchar, /* Last character read via peekc */ - ch; /* Global command char */ +char lastchar, /* Last character read via peekc */ + ch; /* Global command char */ exec_type mode; /* editor init state */ int lastexec = 0; /* last exec command */ @@ -35,50 +35,50 @@ bool adjcurr[PARA_BACK+1], adjendp[PARA_BACK+1]; /* A R G U M E N T S */ -char startcmd[80] = ""; /* initial command after read */ -char **argv; /* Arguments */ -int argc=0, /* # arguments */ - pc=0; /* Index into arguments */ +char startcmd[80] = ""; /* initial command after read */ +char **argv; /* Arguments */ +int argc=0, /* # arguments */ + pc=0; /* Index into arguments */ #if 0 -struct stat thisfile; /* status on current file, for writeout... */ +struct stat thisfile; /* status on current file, for writeout... */ #endif /* M A C R O S T U F F */ struct macrecord mbuffer[MAXMACROS]; -struct tmacro mcr[NMACROS]; /* A place for executing macros */ +struct tmacro mcr[NMACROS]; /* A place for executing macros */ /* S E A R C H S T U F F */ -char dst[80] = "", /* last replacement pattern */ - lastpatt[80] = "", /* last search pattern */ - pattern[MAXPAT] = ""; /* encoded last pattern */ +char dst[80] = "", /* last replacement pattern */ + lastpatt[80] = "", /* last search pattern */ + pattern[MAXPAT] = ""; /* encoded last pattern */ -int RE_start[9], /* start of substitution arguments */ - RE_size [9], /* size of substitution arguments */ - lastp; /* end of last pattern */ +int RE_start[9], /* start of substitution arguments */ + RE_size [9], /* size of substitution arguments */ + lastp; /* end of last pattern */ -struct undostack undo; /* To undo a command */ +struct undostack undo; /* To undo a command */ /* R A N D O M S T R I N G S */ -char instring[80], /* Latest input */ - filenm[80] = "", /* Filename */ - altnm[80] = ""; /* Alternate filename */ -char gcb[16]; /* Command buffer for mutations of insert */ +char instring[80], /* Latest input */ + filenm[80] = "", /* Filename */ + altnm[80] = ""; /* Alternate filename */ +char gcb[16]; /* Command buffer for mutations of insert */ char undobuf[40]; char undotmp[40]; char yankbuf[40]; -HANDLE uread, /* reading from the undo stack */ - uwrite; /* writing to the undo stack */ +HANDLE uread, /* reading from the undo stack */ + uwrite; /* writing to the undo stack */ - /* B U F F E R S */ -char rcb[256]; /* last modification command */ -char *rcp; /* this points at the end of the redo */ -char core[SIZE+1]; /* data space */ + /* B U F F E R S */ +char rcb[256]; /* last modification command */ +char *rcp; /* this points at the end of the redo */ +char core[SIZE+1]; /* data space */ -struct ybuf yank; /* last deleted/yanked text */ +struct ybuf yank; /* last deleted/yanked text */ /* STATIC INITIALIZATIONS: */ @@ -175,7 +175,7 @@ char erasechar = ERASE, /* our erase character */ char ED_NOTICE[] = "(c)3.4", /* Editor version */ ED_REVISION = 'm', /* Small revisions & corrections */ fismod[] = "File is modified", /* File is modified message */ - fisro[] = "File is readonly"; /* when you can't write the file */ + fisro[] = "File is readonly"; /* When you can't write the file */ char *excmds[] = { "print", /* lines to screen */ @@ -262,7 +262,7 @@ int setstep[2] = {-1,1}; /* Where the last diddling left us */ struct coord curpos={0, 0}; - /* initialize the buffer */ +/* Initialize the buffer */ int bufmax = 0, /* End of file here */ lstart = 0, lend = 0, /* Start & end of current line */ ptop = 0, pend = 0, /* Top & bottom of CRT window */ @@ -286,8 +286,7 @@ bool modified= NO, /* File has been modified */ int macro = -1; /* Index into MCR */ char nlsearch = 0; /* for N and n'ing... */ -/* movement, command codes */ - +/* Movement, command codes */ cmdtype movemap[256]={ /*^@*/ BAD_COMMAND, /*^A*/ DEBUG_C, @@ -321,7 +320,7 @@ cmdtype movemap[256]={ /*^]*/ BAD_COMMAND, /*^^*/ BAD_COMMAND, /*^_*/ BAD_COMMAND, - /* */ GO_RIGHT, + /* */ GO_RIGHT, /* 0x20 */ /*! */ BAD_COMMAND, /*" */ BAD_COMMAND, /*# */ BAD_COMMAND, @@ -337,7 +336,7 @@ cmdtype movemap[256]={ /*- */ CR_BACK, /*. */ REDO_C, /*/ */ PATT_FWD, - /*0 */ BAD_COMMAND, + /*0 */ BAD_COMMAND, /* 0x30 */ /*1 */ BAD_COMMAND, /*2 */ BAD_COMMAND, /*3 */ BAD_COMMAND, @@ -353,7 +352,7 @@ cmdtype movemap[256]={ /*= */ BAD_COMMAND, /*> */ ADJUST_C, /*? */ PATT_BACK, - /*@ */ BAD_COMMAND, + /*@ */ BAD_COMMAND, /* 0x40 */ /*A */ A_AT_END, /*B */ BACK_WD, /*C */ HARDMACRO, @@ -369,7 +368,7 @@ cmdtype movemap[256]={ /*M */ PAGE_MIDDLE, /*N */ BSEARCH, /*O */ OPENUP_C, - /*P */ PUT_AFTER, + /*P */ PUT_AFTER, /* 0x50 */ /*Q */ EDIT_C, /*R */ BIG_REPL_C, /*S */ BAD_COMMAND, @@ -385,7 +384,7 @@ cmdtype movemap[256]={ /*] */ BAD_COMMAND, /*^ */ NOTWHITE, /*_ */ BAD_COMMAND, - /*` */ TO_MARK, + /*` */ TO_MARK, /* 0x60 */ /*a */ APPEND_C, /*b */ BACK_WD, /*c */ CHANGE_C, @@ -401,7 +400,7 @@ cmdtype movemap[256]={ /*m */ MARKER_C, /*n */ FSEARCH, /*o */ OPEN_C, - /*p */ PUT_BEFORE, + /*p */ PUT_BEFORE, /* 0x70 */ /*q */ BAD_COMMAND, /*r */ REPLACE_C, /*s */ HARDMACRO, @@ -423,126 +422,126 @@ cmdtype movemap[256]={ /*83*/ BAD_COMMAND, /*84*/ BAD_COMMAND, /*85*/ BAD_COMMAND, + /*86*/ BAD_COMMAND, + /*87*/ BAD_COMMAND, + /*88*/ BAD_COMMAND, + /*89*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*90*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*A0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*B0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*C0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*D0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*E0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, + /*x6*/ BAD_COMMAND, + /*x7*/ BAD_COMMAND, + /*x8*/ BAD_COMMAND, + /*x9*/ BAD_COMMAND, + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND, + /*F0*/ BAD_COMMAND, + /*x1*/ BAD_COMMAND, + /*x2*/ BAD_COMMAND, + /*x3*/ BAD_COMMAND, + /*x4*/ BAD_COMMAND, + /*x5*/ BAD_COMMAND, /*x6*/ BAD_COMMAND, /*x7*/ BAD_COMMAND, /*x8*/ BAD_COMMAND, /*x9*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND, - /*xx*/ BAD_COMMAND + /*xA*/ BAD_COMMAND, + /*xB*/ BAD_COMMAND, + /*xC*/ BAD_COMMAND, + /*xD*/ BAD_COMMAND, + /*xE*/ BAD_COMMAND, + /*xF*/ BAD_COMMAND }; diff --git a/Applications/levee/levee.h b/Applications/levee/levee.h index 292eaa20..af08bdb9 100644 --- a/Applications/levee/levee.h +++ b/Applications/levee/levee.h @@ -58,10 +58,11 @@ #define SYS5 1 /* what sort of terminal are you emulating? */ -#define VT52 1 /* this must be nonzero for the Atari ST */ +/* use "-DANSI=1 -DVT52=0" etc. on compile line */ +/*#define VT52 0*/ /* this must be nonzero for the Atari ST */ +/*#define ANSI 0*/ #define TERMCAP 0 #define ZTERM 0 -#define ANSI 0 #if ST diff --git a/Applications/levee/main.c b/Applications/levee/main.c index 9e2fd73b..d8ce0a20 100644 --- a/Applications/levee/main.c +++ b/Applications/levee/main.c @@ -245,7 +245,7 @@ execmode(exec_type emode) mode=emode; do { prompt(FALSE,":"); - if (getline(instring)) + if (lvgetline(instring)) exec(instring, &mode, &noquit); indirect = FALSE; if (mode == E_VISUAL && zotscreen && noquit) { /*ask for more*/ diff --git a/Applications/levee/misc.c b/Applications/levee/misc.c index b1887042..ef7fe962 100644 --- a/Applications/levee/misc.c +++ b/Applications/levee/misc.c @@ -20,16 +20,16 @@ #include "extern.h" bool PROC -getline(char *str) +lvgetline(char *str) { int len; char flag; - + flag = line(str, 0, COLS-curpos.x, &len); str[len] = 0; strput(CE); return (flag == EOL); -} /* getline */ +} /* lvgetline */ char PROC @@ -101,7 +101,7 @@ int PROC setX(int cp) { int top, xp; - + top = bseekeol(cp); xp = 0; while (top < cp) { @@ -121,7 +121,7 @@ int PROC setY(int cp) { int yp, ix; - + ix = ptop; yp = -1; cp = min(cp,bufmax-1); @@ -157,12 +157,12 @@ to_index(int line) } return(cp); } /* to_index */ - + PROC void swap(int *a, int *b) { int c; - + c = *a; *a = *b; *b = c; @@ -259,7 +259,7 @@ PROC insertmacro(char *cmdstr, int count) int PROC lookup(char c) { int ix = MAXMACROS; - + while (--ix >= 0 && mbuffer[ix].token != c) ; return ix; @@ -270,7 +270,7 @@ PROC void fixmarkers(int base, int offset) { char c; - + for (c = 0;c<'z'-'`';c++) if (contexts[c] > base) if (contexts[c]+offset < base || contexts[c]+offset >= bufmax) @@ -313,7 +313,7 @@ void wr_stat(void) static int tabptr, tabstack[20], ixp; - + PROC void back_up(char c) { @@ -340,7 +340,7 @@ line(char *s, int start, int endd, int *size) int col0, ip; char c; - + col0 = ixp = curpos.x; ip = start; tabptr = 0; @@ -424,7 +424,7 @@ PROC void setend(void) { int bottom, count; - + bottom = ptop; count = LINES-1; while (bottom < bufmax && count > 0) { @@ -442,7 +442,7 @@ int PROC settop(int lines) { int top, yp; - + top = curr; yp = -1; do { diff --git a/Applications/levee/move.c b/Applications/levee/move.c index cc0bfd06..36727f76 100644 --- a/Applications/levee/move.c +++ b/Applications/levee/move.c @@ -31,7 +31,7 @@ findCP(int curp, int *newpos, cmdtype cmd) *newpos = ERR; switch (cmd) { /* move around */ - + case GO_LEFT: *newpos = max(lstart, curp-max(count,1)); break; @@ -135,7 +135,7 @@ findCP(int curp, int *newpos, cmdtype cmd) case TO_MARK: case TO_MARK_LINE: - *newpos = getcontext((char)tolower(readchar()), cmd==TO_MARK_LINE); + *newpos = lvgetcontext((char)tolower(readchar()), cmd==TO_MARK_LINE); break; case CR_FWD: @@ -153,7 +153,7 @@ findCP(int curp, int *newpos, cmdtype cmd) clrprompt(); if (cmd == PATT_FWD || cmd == PATT_BACK) { printch(tsearch = instring[0] = chars[cmd-PATT_FWD]); - if (!getline(&instring[1])) + if (!lvgetline(&instring[1])) return ESCAPED; /* needs to skip later tests */ } else { @@ -184,7 +184,7 @@ PROC movearound(cmdtype cmd) { int cp; - + switch (findCP(curr, &cp, cmd)) { case LEGALMOVE: if (cp < bufmax) { @@ -231,12 +231,12 @@ movearound(cmdtype cmd) } mvcur(yp, xp); } - + int PROC findcol(int ip, int col) { int tcol, endd; - + ip = bseekeol(ip); /* start search here */ endd = fseekeol(ip); /* end search here */ @@ -260,8 +260,8 @@ match(int p) { char srcchar, dstchar; int lev, step; - - while((lev = scan(6,'=',core[p],srcpatt)) >= 6 && core[p] != EOL) + + while((lev = lvscan(6,'=',core[p],srcpatt)) >= 6 && core[p] != EOL) p++; if (lev < 6) { srcchar = srcpatt[lev]; @@ -317,7 +317,7 @@ moveword(int cp, bool forwd, bool toword) { int step; register char *ccl; - + step = setstep[forwd]; /* set direction to move.. */ if (!toword) cp += step; /* advance one character */ @@ -351,7 +351,7 @@ int PROC fchar(int pos, int npos) { do - pos += scan(lend-pos-1,'=',ch, &core[pos+1]) + 1; + pos += lvscan(lend-pos-1,'=',ch, &core[pos+1]) + 1; while (--count>0 && pos0 && pos>=lstart); if (pos>=lstart) return(pos); diff --git a/Applications/levee/proto.h b/Applications/levee/proto.h index 2c930c95..88e4d09d 100644 --- a/Applications/levee/proto.h +++ b/Applications/levee/proto.h @@ -1,9 +1,9 @@ -/* -** levee function prototypes -** (generated by cl -Gms -Ox -nologo -I../tools -Zg) -*/ -#ifndef _PROTO_D -#define _PROTO_D +/* +** levee function prototypes +** (generated by cl -Gms -Ox -nologo -I../tools -Zg) +*/ +#ifndef _PROTO_D +#define _PROTO_D char *PROC badccl(char *src); char *PROC class(char c); char *PROC dodash(char *src); @@ -14,7 +14,7 @@ char *PROC getname(void); char *PROC makepat(char *string,char delim); char *PROC search(char *pat,int *start); char *basename(char *s); -char *glob(char *path,struct glob_t *dta); +//char *glob(char *path,struct glob_t *dta); char PROC editcore(void); char PROC esc(char * *s); char PROC findCP(int curp,int *newpos,char cmd); @@ -70,8 +70,8 @@ int PROC format(char *out,unsigned c); int PROC fseekeol(int origin); int PROC gcount(void); int PROC getKey(void); -int PROC getcontext(char c,int begline); -int PROC getline(char *str); +int PROC lvgetcontext(char c,int begline); +int PROC lvgetline(char *str); void PROC initialize(int count,char * *args); int PROC inputf(char *fname,int newbuf); int PROC insert_to_undo(struct undostack *u,int start,int size); @@ -124,9 +124,9 @@ int PROC putfile(FILE *f,int start,int endd); int PROC putin(struct undostack *save_undo,int *curp); int PROC readfile(void); int PROC redisplay(int flag); -int PROC refresh(int y,int x,int start,int endd,int rest); +int PROC lvrefresh(int y,int x,int start,int endd,int rest); void PROC resetX(void); -int PROC scan(int length,char tst,char ch,char *src); +int PROC lvscan(int length,char tst,char ch,char *src); int PROC scroll(int down); int PROC scrollback(int curr); int PROC scrollforward(int curr); @@ -161,4 +161,4 @@ int PROC zerostack(struct undostack *u); void main(int argc,char *argv[]); void PROC initcon(void); void PROC fixcon(void); -#endif /*_PROTO_D*/ +#endif /*_PROTO_D*/ diff --git a/Applications/levee/ucsd.c b/Applications/levee/ucsd.c index 7b1cceb6..a1fad199 100644 --- a/Applications/levee/ucsd.c +++ b/Applications/levee/ucsd.c @@ -55,10 +55,10 @@ fillchar(char *src,int length, char ch) #endif int PROC -scan(int length, char tst, char ch, char *src) +lvscan(int length, char tst, char ch, char *src) { register int inc,l; - + if (length < 0) inc = -1; else diff --git a/Applications/levee/unixcall.c b/Applications/levee/unixcall.c index 01715d2c..67768253 100644 --- a/Applications/levee/unixcall.c +++ b/Applications/levee/unixcall.c @@ -67,8 +67,7 @@ void initcon(void) struct termios new; if (!ioset) { - tcgetattr(0, &old); - /*ioctl(0, TCGETS, &old);*/ /* get editing keys */ + tcgetattr(0, &old); /* preserve current terminal setup */ erasechar = old.c_cc[VERASE]; eraseline = old.c_cc[VKILL]; @@ -79,8 +78,7 @@ void initcon(void) new.c_lflag &= ~(ICANON|ISIG|ECHO); new.c_oflag = 0; - tcsetattr(0, TCSANOW, &new); - /*ioctl(0, TCSETS, &new);*/ + tcsetattr(0, TCSANOW, &new); /* terminal setup for editor */ ioset=1; } } @@ -88,12 +86,7 @@ void initcon(void) void fixcon(void) { if (ioset) { - tcsetattr(0, TCSANOW, &old); - /*ioctl(0, TCSETS, &old);*/ -/* More or less blind attempt to fix console corruption. - T. Huld 1998-05-19 - ioctl(0, TCSETA, &old); -*/ + tcsetattr(0, TCSANOW, &old); /* restore original terminal setup */ ioset = 0; } }