Delete trailing whitespace.
authornealcrook <neal@pippaluk.org.uk>
Mon, 7 Nov 2016 17:52:10 +0000 (17:52 +0000)
committernealcrook <neal@pippaluk.org.uk>
Mon, 7 Nov 2016 17:52:10 +0000 (17:52 +0000)
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

12 files changed:
Applications/levee/display.c
Applications/levee/editcor.c
Applications/levee/extern.h
Applications/levee/find.c
Applications/levee/globals.c
Applications/levee/levee.h
Applications/levee/main.c
Applications/levee/misc.c
Applications/levee/move.c
Applications/levee/proto.h
Applications/levee/ucsd.c
Applications/levee/unixcall.c

index d28eb57..9ae0aef 100644 (file)
@@ -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);
 }
index d692fb0..a116e3e 100644 (file)
@@ -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);
index b7f1a7c..27f72e8 100644 (file)
@@ -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();
index 500a8cd..fbdf4ce 100644 (file)
@@ -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')
index c4f49dc..0921f25 100644 (file)
@@ -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
     };
index 292eaa2..af08bdb 100644 (file)
 #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
 
index 9e2fd73..d8ce0a2 100644 (file)
@@ -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*/
index b188704..ef7fe96 100644 (file)
 #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 {
index cc0bfd0..36727f7 100644 (file)
@@ -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 && pos<lend);
     if (pos<lend)
        return(pos);
@@ -364,7 +364,7 @@ int PROC
 bchar(int pos, int npos)
 {
     do
-       pos += scan(-pos+lstart+1,'=',ch, &core[pos-1]) - 1;
+       pos += lvscan(-pos+lstart+1,'=',ch, &core[pos-1]) - 1;
     while (--count>0 && pos>=lstart);
     if (pos>=lstart)
        return(pos);
index 2c930c9..88e4d09 100644 (file)
@@ -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*/
index 7b1cceb..a1fad19 100644 (file)
@@ -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
index 01715d2..6776825 100644 (file)
@@ -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;
     }
 }