fixes for 3b
authorMark Horton <mark@ucbvax.Berkeley.EDU>
Mon, 27 Jul 1981 11:05:34 +0000 (03:05 -0800)
committerMark Horton <mark@ucbvax.Berkeley.EDU>
Mon, 27 Jul 1981 11:05:34 +0000 (03:05 -0800)
SCCS-vsn: usr.bin/ex/ex.h 7.2
SCCS-vsn: usr.bin/ex/ex_argv.h 7.2
SCCS-vsn: usr.bin/ex/ex_cmds.c 7.2
SCCS-vsn: usr.bin/ex/ex_extern.c 7.2
SCCS-vsn: usr.bin/ex/ex_re.h 7.2
SCCS-vsn: usr.bin/ex/ex_subr.c 7.2
SCCS-vsn: usr.bin/ex/ex_temp.c 7.2
SCCS-vsn: usr.bin/ex/ex_temp.h 7.2
SCCS-vsn: usr.bin/ex/ex_tty.h 7.2
SCCS-vsn: usr.bin/ex/ex_tune.h 7.2
SCCS-vsn: usr.bin/ex/ex_vars.h 7.2
SCCS-vsn: usr.bin/ex/ex_vis.h 7.2
SCCS-vsn: usr.bin/ex/ex_vops2.c 6.5
SCCS-vsn: usr.bin/ex/ex3.7preserve/ex3.7preserve.c 7.4
SCCS-vsn: usr.bin/ex/Makefile 7.3

15 files changed:
usr/src/usr.bin/ex/Makefile
usr/src/usr.bin/ex/ex.h
usr/src/usr.bin/ex/ex3.7preserve/ex3.7preserve.c
usr/src/usr.bin/ex/ex_argv.h
usr/src/usr.bin/ex/ex_cmds.c
usr/src/usr.bin/ex/ex_extern.c
usr/src/usr.bin/ex/ex_re.h
usr/src/usr.bin/ex/ex_subr.c
usr/src/usr.bin/ex/ex_temp.c
usr/src/usr.bin/ex/ex_temp.h
usr/src/usr.bin/ex/ex_tty.h
usr/src/usr.bin/ex/ex_tune.h
usr/src/usr.bin/ex/ex_vars.h
usr/src/usr.bin/ex/ex_vis.h
usr/src/usr.bin/ex/ex_vops2.c

index 94753df..7cb5d8a 100644 (file)
@@ -94,7 +94,7 @@ exrecover.o: exrecover.c
        ${CC} ${CFLAGS} -c -O exrecover.c
 
 expreserve: expreserve.o
        ${CC} ${CFLAGS} -c -O exrecover.c
 
 expreserve: expreserve.o
-       ${CC} expreserve.o ex_extern.o -o expreserve
+       ${CC} expreserve.o -o expreserve
 
 expreserve.o:
        ${CC} ${CFLAGS} -c -O expreserve.c
 
 expreserve.o:
        ${CC} ${CFLAGS} -c -O expreserve.c
index bb48d3e..03dc849 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex.h        7.1     %G%  */
+/* sccs id:    @(#)ex.h        7.2     %G%  */
 #ifdef V6
 #include <retrofit.h>
 #endif
 #ifdef V6
 #include <retrofit.h>
 #endif
@@ -48,6 +48,9 @@
 #include <setjmp.h>
 #include <sys/stat.h>
 
 #include <setjmp.h>
 #include <sys/stat.h>
 
+#ifndef var
+#define var    var
+#endif
 /*
  *     The following little dance copes with the new USG tty handling.
  *     This stuff has the advantage of considerable flexibility, and
 /*
  *     The following little dance copes with the new USG tty handling.
  *     This stuff has the advantage of considerable flexibility, and
@@ -100,7 +103,7 @@ struct      option {
 #define        value(a)        options[a].ovalue
 #define        svalue(a)       options[a].osvalue
 
 #define        value(a)        options[a].ovalue
 #define        svalue(a)       options[a].osvalue
 
-extern struct  option options[NOPTS + 1];
+extern  struct option options[NOPTS + 1];
 
 
 /*
 
 
 /*
@@ -117,10 +120,10 @@ extern struct     option options[NOPTS + 1];
  */
 #ifdef TRACE
 #      include <stdio.h>
  */
 #ifdef TRACE
 #      include <stdio.h>
-       extern FILE     *trace;
-       extern bool     trubble;
-       extern bool     techoin;
-       extern char     tracbuf[BUFSIZ];
+       var     FILE    *trace;
+       var     bool    trubble;
+       var     bool    techoin;
+       var     char    tracbuf[BUFSIZ];
 #      undef   putchar
 #      undef   getchar
 #else
 #      undef   putchar
 #      undef   getchar
 #else
@@ -152,67 +155,67 @@ extern struct     option options[NOPTS + 1];
 /*
  * Miscellaneous random variables used in more than one place
  */
 /*
  * Miscellaneous random variables used in more than one place
  */
-extern bool    aiflag;         /* Append/change/insert with autoindent */
-extern bool    anymarks;       /* We have used '[a-z] */
-extern int     chng;           /* Warn "No write" */
-extern char    *Command;
-extern short   defwind;        /* -w# change default window size */
-extern int     dirtcnt;        /* When >= MAXDIRT, should sync temporary */
+var    bool    aiflag;         /* Append/change/insert with autoindent */
+var    bool    anymarks;       /* We have used '[a-z] */
+var    int     chng;           /* Warn "No write" */
+var    char    *Command;
+var    short   defwind;        /* -w# change default window size */
+var    int     dirtcnt;        /* When >= MAXDIRT, should sync temporary */
 #ifdef TIOCLGET
 #ifdef TIOCLGET
-extern bool    dosusp;         /* Do SIGTSTP in visual when ^Z typed */
+var    bool    dosusp;         /* Do SIGTSTP in visual when ^Z typed */
 #endif
 #endif
-extern bool    edited;         /* Current file is [Edited] */
-extern line    *endcore;       /* Last available core location */
-extern bool    endline;        /* Last cmd mode command ended with \n */
+var    bool    edited;         /* Current file is [Edited] */
+var    line    *endcore;       /* Last available core location */
+extern  bool   endline;        /* Last cmd mode command ended with \n */
 #ifndef VMUNIX
 #ifndef VMUNIX
-extern short   erfile;         /* Error message file unit */
+var    short   erfile;         /* Error message file unit */
 #endif
 #endif
-extern line    *fendcore;      /* First address in line pointer space */
-extern char    file[FNSIZE];   /* Working file name */
-extern char    genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */
-extern bool    hush;           /* Command line option - was given, hush up! */
-extern char    *globp;         /* (Untyped) input string to command mode */
-extern bool    holdcm;         /* Don't cursor address */
-extern bool    inappend;       /* in ex command append mode */
-extern bool    inglobal;       /* Inside g//... or v//... */
-extern char    *initev;        /* Initial : escape for visual */
-extern bool    inopen;         /* Inside open or visual */
-extern char    *input;         /* Current position in cmd line input buffer */
-extern bool    intty;          /* Input is a tty */
-extern short   io;             /* General i/o unit (auto-closed on error!) */
-extern short   lastc;          /* Last character ret'd from cmd input */
-extern bool    laste;          /* Last command was an "e" (or "rec") */
-extern char    lastmac;        /* Last macro called for ** */
-extern char    lasttag[TAGSIZE];       /* Last argument to a tag command */
-extern char    *linebp;        /* Used in substituting in \n */
-extern char    linebuf[LBSIZE];        /* The primary line buffer */
-extern bool    listf;          /* Command should run in list mode */
-extern char    *loc1;          /* Where re began to match (in linebuf) */
-extern char    *loc2;          /* First char after re match (") */
-extern line    names['z'-'a'+2];       /* Mark registers a-z,' */
-extern int     notecnt;        /* Count for notify (to visual from cmd) */
-extern bool    numberf;        /* Command should run in number mode */
-extern char    obuf[BUFSIZ];   /* Buffer for tty output */
-extern short   oprompt;        /* Saved during source */
-extern short   ospeed;         /* Output speed (from gtty) */
-extern int     otchng;         /* Backup tchng to find changes in macros */
-extern short   peekc;          /* Peek ahead character (cmd mode input) */
-extern char    *pkill[2];      /* Trim for put with ragged (LISP) delete */
-extern bool    pfast;          /* Have stty -nl'ed to go faster */
-extern int     pid;            /* Process id of child */
-extern int     ppid;           /* Process id of parent (e.g. main ex proc) */
-extern jmp_buf resetlab;       /* For error throws to top level (cmd mode) */
-extern int     rpid;           /* Pid returned from wait() */
-extern bool    ruptible;       /* Interruptible is normal state */
-extern bool    seenprompt;     /* 1 if have gotten user input */
-extern bool    shudclob;       /* Have a prompt to clobber (e.g. on ^D) */
-extern int     status;         /* Status returned from wait() */
-extern int     tchng;          /* If nonzero, then [Modified] */
-extern short   tfile;          /* Temporary file unit */
-extern bool    vcatch;         /* Want to catch an error (open/visual) */
-extern jmp_buf vreslab;        /* For error throws to a visual catch */
-extern bool    writing;        /* 1 if in middle of a file write */
-extern int     xchng;          /* Suppresses multiple "No writes" in !cmd */
+var    line    *fendcore;      /* First address in line pointer space */
+var    char    file[FNSIZE];   /* Working file name */
+var    char    genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */
+var    bool    hush;           /* Command line option - was given, hush up! */
+var    char    *globp;         /* (Untyped) input string to command mode */
+var    bool    holdcm;         /* Don't cursor address */
+var    bool    inappend;       /* in ex command append mode */
+var    bool    inglobal;       /* Inside g//... or v//... */
+var    char    *initev;        /* Initial : escape for visual */
+var    bool    inopen;         /* Inside open or visual */
+var    char    *input;         /* Current position in cmd line input buffer */
+var    bool    intty;          /* Input is a tty */
+var    short   io;             /* General i/o unit (auto-closed on error!) */
+extern  short  lastc;          /* Last character ret'd from cmd input */
+var    bool    laste;          /* Last command was an "e" (or "rec") */
+var    char    lastmac;        /* Last macro called for ** */
+var    char    lasttag[TAGSIZE];       /* Last argument to a tag command */
+var    char    *linebp;        /* Used in substituting in \n */
+var    char    linebuf[LBSIZE];        /* The primary line buffer */
+var    bool    listf;          /* Command should run in list mode */
+var    char    *loc1;          /* Where re began to match (in linebuf) */
+var    char    *loc2;          /* First char after re match (") */
+var    line    names['z'-'a'+2];       /* Mark registers a-z,' */
+var    int     notecnt;        /* Count for notify (to visual from cmd) */
+var    bool    numberf;        /* Command should run in number mode */
+var    char    obuf[BUFSIZ];   /* Buffer for tty output */
+var    short   oprompt;        /* Saved during source */
+extern short   ospeed;         /* Output speed (from gtty) */
+var    int     otchng;         /* Backup tchng to find changes in macros */
+var    short   peekc;          /* Peek ahead character (cmd mode input) */
+var    char    *pkill[2];      /* Trim for put with ragged (LISP) delete */
+var    bool    pfast;          /* Have stty -nl'ed to go faster */
+var    int     pid;            /* Process id of child */
+var    int     ppid;           /* Process id of parent (e.g. main ex proc) */
+var    jmp_buf resetlab;       /* For error throws to top level (cmd mode) */
+var    int     rpid;           /* Pid returned from wait() */
+var    bool    ruptible;       /* Interruptible is normal state */
+var    bool    seenprompt;     /* 1 if have gotten user input */
+var    bool    shudclob;       /* Have a prompt to clobber (e.g. on ^D) */
+var    int     status;         /* Status returned from wait() */
+var    int     tchng;          /* If nonzero, then [Modified] */
+extern short   tfile;          /* Temporary file unit */
+var    bool    vcatch;         /* Want to catch an error (open/visual) */
+var    jmp_buf vreslab;        /* For error throws to a visual catch */
+var    bool    writing;        /* 1 if in middle of a file write */
+var    int     xchng;          /* Suppresses multiple "No writes" in !cmd */
 
 /*
  * Macros
 
 /*
  * Macros
@@ -244,11 +247,11 @@ extern int        xchng;          /* Suppresses multiple "No writes" in !cmd */
 /*
  * Environment like memory
  */
 /*
  * Environment like memory
  */
-extern char    altfile[FNSIZE];        /* Alternate file name */
-extern char    direct[ONMSZ];          /* Temp file goes here */
-extern char    shell[ONMSZ];           /* Copied to be settable */
-extern char    ttytype[ONMSZ];         /* A long and pretty name */
-extern char    uxb[UXBSIZE + 2];       /* Last !command for !! */
+var    char    altfile[FNSIZE];        /* Alternate file name */
+extern  char   direct[ONMSZ];          /* Temp file goes here */
+extern  char   shell[ONMSZ];           /* Copied to be settable */
+extern  char   ttytype[ONMSZ];         /* A long and pretty name */
+var    char    uxb[UXBSIZE + 2];       /* Last !command for !! */
 
 /*
  * The editor data structure for accessing the current file consists
 
 /*
  * The editor data structure for accessing the current file consists
@@ -263,14 +266,14 @@ extern char       uxb[UXBSIZE + 2];       /* Last !command for !! */
  * dol and unddol, a copy of the entire, pre-command buffer state
  * is saved between unddol and truedol.
  */
  * dol and unddol, a copy of the entire, pre-command buffer state
  * is saved between unddol and truedol.
  */
-extern line    *addr1;                 /* First addressed line in a command */
-extern line    *addr2;                 /* Second addressed line */
-extern line    *dol;                   /* Last line in buffer */
-extern line    *dot;                   /* Current line */
-extern line    *one;                   /* First line */
-extern line    *truedol;               /* End of all lines, including saves */
-extern line    *unddol;                /* End of undo saved lines */
-extern line    *zero;                  /* Points to empty slot before one */
+var    line    *addr1;                 /* First addressed line in a command */
+var    line    *addr2;                 /* Second addressed line */
+var    line    *dol;                   /* Last line in buffer */
+var    line    *dot;                   /* Current line */
+var    line    *one;                   /* First line */
+var    line    *truedol;               /* End of all lines, including saves */
+var    line    *unddol;                /* End of undo saved lines */
+var    line    *zero;                  /* Points to empty slot before one */
 
 /*
  * Undo information
 
 /*
  * Undo information
@@ -286,12 +289,12 @@ extern line       *zero;                  /* Points to empty slot before one */
  * are lines saved between dol and unddol we don't stick these back
  * into the buffer.
  */
  * are lines saved between dol and unddol we don't stick these back
  * into the buffer.
  */
-extern short   undkind;
+var    short   undkind;
 
 
-extern line    *unddel;        /* Saved deleted lines go after here */
-extern line    *undap1;        /* Beginning of new lines */
-extern line    *undap2;        /* New lines end before undap2 */
-extern line    *undadot;       /* If we saved all lines, dot reverts here */
+var    line    *unddel;        /* Saved deleted lines go after here */
+var    line    *undap1;        /* Beginning of new lines */
+var    line    *undap2;        /* New lines end before undap2 */
+var    line    *undadot;       /* If we saved all lines, dot reverts here */
 
 #define        UNDCHANGE       0
 #define        UNDMOVE         1
 
 #define        UNDCHANGE       0
 #define        UNDMOVE         1
@@ -305,13 +308,13 @@ extern line       *undadot;       /* If we saved all lines, dot reverts here */
  */
 #define        KSIZE   9       /* key size for encryption */
 #define        KEYPROMPT       "Key: "
  */
 #define        KSIZE   9       /* key size for encryption */
 #define        KEYPROMPT       "Key: "
-extern int     xflag;          /* True if we are in encryption mode */
-extern int     xtflag;         /* True if the temp file is being encrypted */
-extern int     kflag;          /* True if the key has been accepted */
-extern char    perm[768];
-extern char    tperm[768];
-extern char    *key;
-extern char    crbuf[CRSIZE];
+var    int     xflag;          /* True if we are in encryption mode */
+var    int     xtflag;         /* True if the temp file is being encrypted */
+var    int     kflag;          /* True if the key has been accepted */
+var    char    perm[768];
+var    char    tperm[768];
+var    char    *key;
+var    char    crbuf[CRSIZE];
 char   *getpass();
 #endif
 
 char   *getpass();
 #endif
 
@@ -321,10 +324,10 @@ char      *getpass();
 #define        NOSTR   (char *) 0
 #define        NOLINE  (line *) 0
 
 #define        NOSTR   (char *) 0
 #define        NOLINE  (line *) 0
 
-extern int     (*Outchar)();
-extern int     (*Pline)();
-extern int     (*Putchar)();
-extern int     (*oldhup)();
+extern int     (*Outchar)();
+extern int     (*Pline)();
+extern int     (*Putchar)();
+var    int     (*oldhup)();
 int    (*setlist())();
 int    (*setnorm())();
 int    (*setnorm())();
 int    (*setlist())();
 int    (*setnorm())();
 int    (*setnorm())();
@@ -369,7 +372,7 @@ off_t       lseek();
 int    normchar();
 int    normline();
 int    numbline();
 int    normchar();
 int    normline();
 int    numbline();
-extern int     (*oldquit)();
+var    int     (*oldquit)();
 int    onhup();
 int    onintr();
 int    onsusp();
 int    onhup();
 int    onintr();
 int    onsusp();
index e9d3878..46057c1 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex3.7preserve.c     7.3     %G%";
+static char *sccsid = "@(#)ex3.7preserve.c     7.4     %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
index 4fded2d..d93fcd3 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_argv.h   7.1     %G%  */
+/* sccs id:    @(#)ex_argv.h   7.2     %G%  */
 /*
  * The current implementation of the argument list is poor,
  * using an argv even for internally done "next" commands.
 /*
  * The current implementation of the argument list is poor,
  * using an argv even for internally done "next" commands.
@@ -7,16 +7,16 @@
  * space.  The statically allocated glob structure could be replaced
  * by a dynamically allocated argument area space.
  */
  * space.  The statically allocated glob structure could be replaced
  * by a dynamically allocated argument area space.
  */
-extern char    **argv;
-extern char    **argv0;
-extern char    *args;
-extern char    *args0;
-extern short   argc;
-extern short   argc0;
-extern short   morargc;                /* Used with "More files to edit..." */
+var char       **argv;
+var char       **argv0;
+var char       *args;
+var char       *args0;
+var short      argc;
+var short      argc0;
+var short      morargc;                /* Used with "More files to edit..." */
 
 
-extern int     firstln;                /* From +lineno */
-extern char    *firstpat;              /* From +/pat   */
+var int        firstln;                /* From +lineno */
+var char       *firstpat;              /* From +/pat   */
 
 /* Yech... */
 struct glob {
 
 /* Yech... */
 struct glob {
@@ -25,4 +25,4 @@ struct        glob {
        char    *argv[NARGS + 1];       /* WHAT A WASTE! */
        char    argspac[NCARGS + sizeof (int)];
 };
        char    *argv[NARGS + 1];       /* WHAT A WASTE! */
        char    argspac[NCARGS + sizeof (int)];
 };
-extern struct  glob frob;
+var struct     glob frob;
index cad2130..97b8470 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_cmds.c   7.1     %G%";
+static char *sccsid = "@(#)ex_cmds.c   7.2     %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
index a421f0a..3c85889 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccs_id = "@(#)ex_extern.c        7.1     %G%";
+static char *sccs_id = "@(#)ex_extern.c        7.2     %G%";
 /*
  * Provide defs of the global variables.
  * This crock is brought to you by the turkeys
 /*
  * Provide defs of the global variables.
  * This crock is brought to you by the turkeys
@@ -7,7 +7,7 @@ static char *sccs_id = "@(#)ex_extern.c 7.1     %G%";
  * book says!"
  */
 
  * book says!"
  */
 
-# define extern        /* nothing */
+# define var   /* nothing */
 # include "ex.h"
 # include "ex_argv.h"
 # include "ex_re.h"
 # include "ex.h"
 # include "ex_argv.h"
 # include "ex_re.h"
@@ -16,5 +16,3 @@ static char *sccs_id = "@(#)ex_extern.c       7.1     %G%";
 # include "ex_tune.h"
 # include "ex_vars.h"
 # include "ex_vis.h"
 # include "ex_tune.h"
 # include "ex_vars.h"
 # include "ex_vis.h"
-
-short tfile = -1;
index 9452243..76c1713 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_re.h     7.1     %G%  */
+/* sccs id:    @(#)ex_re.h     7.2     %G%  */
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
@@ -21,9 +21,9 @@ struct        regexp {
  * It would be possible to get rid of "re" by making it a stack parameter
  * to the appropriate routines.
  */
  * It would be possible to get rid of "re" by making it a stack parameter
  * to the appropriate routines.
  */
-extern struct  regexp re;              /* Last re */
-extern struct  regexp scanre;          /* Last scanning re */
-extern struct  regexp subre;           /* Last substitute re */
+var struct     regexp re;              /* Last re */
+var struct     regexp scanre;          /* Last scanning re */
+var struct     regexp subre;           /* Last substitute re */
 
 /*
  * Defining circfl and expbuf like this saves us from having to change
 
 /*
  * Defining circfl and expbuf like this saves us from having to change
@@ -43,9 +43,9 @@ extern struct regexp subre;           /* Last substitute re */
 /*
  * Definitions for substitute
  */
 /*
  * Definitions for substitute
  */
-extern char    *braslist[NBRA];        /* Starts of \(\)'ed text in lhs */
-extern char    *braelist[NBRA];        /* Ends... */
-extern char    rhsbuf[RHSSIZE];        /* Rhs of last substitute */
+var char       *braslist[NBRA];        /* Starts of \(\)'ed text in lhs */
+var char       *braelist[NBRA];        /* Ends... */
+var char       rhsbuf[RHSSIZE];        /* Rhs of last substitute */
 
 /*
  * Definitions of codes for the compiled re's.
 
 /*
  * Definitions of codes for the compiled re's.
index ade400f..da54376 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_subr.c   7.1     %G%";
+static char *sccsid = "@(#)ex_subr.c   7.2     %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
@@ -352,7 +352,7 @@ merror(seekpt, i)
        merror1(seekpt);
        if (*cp == '\n')
                putnl(), cp++;
        merror1(seekpt);
        if (*cp == '\n')
                putnl(), cp++;
-       if (inopen && CE)
+       if (inopen > 0 && CE)
                vclreol();
        if (SO && SE)
                putpad(SO);
                vclreol();
        if (SO && SE)
                putpad(SO);
index a6e551b..53475d4 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_temp.c   7.1     %G%";
+static char *sccsid = "@(#)ex_temp.c   7.2     %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
@@ -15,7 +15,7 @@ static char *sccsid = "@(#)ex_temp.c  7.1     %G%";
 char   tfname[40];
 char   rfname[40];
 int    havetmp;
 char   tfname[40];
 char   rfname[40];
 int    havetmp;
-/* short       tfile = -1;     mjm: in ex_space.c */
+short  tfile = -1;
 short  rfile = -1;
 
 fileinit()
 short  rfile = -1;
 
 fileinit()
index e101ff6..e31ec6f 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_temp.h   7.1     %G%  */
+/* sccs id:    @(#)ex_temp.h   7.2     %G%  */
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
  * spends (spent) roughly 30% of its time in the system read routine,
  * this can be a big help.
  */
  * spends (spent) roughly 30% of its time in the system read routine,
  * this can be a big help.
  */
-extern bool    hitin2;         /* Last read hit was ibuff2 not ibuff */
-extern bool    ichang2;        /* Have actually changed ibuff2 */
-extern bool    ichanged;       /* Have actually changed ibuff */
-extern short   iblock;         /* Temp file block number of ibuff (or -1) */
-extern short   iblock2;        /* Temp file block number of ibuff2 (or -1) */
-extern short   ninbuf;         /* Number useful chars left in input buffer */
-extern short   nleft;          /* Number usable chars left in output buffer */
-extern short   oblock;         /* Temp file block number of obuff (or -1) */
+var bool       hitin2;         /* Last read hit was ibuff2 not ibuff */
+var bool       ichang2;        /* Have actually changed ibuff2 */
+var bool       ichanged;       /* Have actually changed ibuff */
+var short      iblock;         /* Temp file block number of ibuff (or -1) */
+var short      iblock2;        /* Temp file block number of ibuff2 (or -1) */
+var short      ninbuf;         /* Number useful chars left in input buffer */
+var short      nleft;          /* Number usable chars left in output buffer */
+var short      oblock;         /* Temp file block number of obuff (or -1) */
 #ifndef VMUNIX
 #ifndef VMUNIX
-extern short   tline;          /* Current temp file ptr */
+var short      tline;          /* Current temp file ptr */
 #else
 #else
-extern int     tline;
+var int        tline;
 #endif
 
 #endif
 
-extern char    ibuff[BUFSIZ];
-extern char    ibuff2[BUFSIZ];
-extern char    obuff[BUFSIZ];
+var char       ibuff[BUFSIZ];
+var char       ibuff2[BUFSIZ];
+var char       obuff[BUFSIZ];
 
 /*
  * Structure of the descriptor block which resides
 
 /*
  * Structure of the descriptor block which resides
@@ -108,7 +108,7 @@ struct      header {
        char    Savedfile[FNSIZE];      /* The current file name */
        short   Blocks[LBLKS];          /* Blocks where line pointers stashed */
 }; 
        char    Savedfile[FNSIZE];      /* The current file name */
        short   Blocks[LBLKS];          /* Blocks where line pointers stashed */
 }; 
-extern struct  header H;
+var struct     header H;
 
 #define        uid             H.Uid
 #define        flines          H.Flines
 
 #define        uid             H.Uid
 #define        flines          H.Flines
index 4f7a5bd..4fc7437 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_tty.h    7.1     %G%  */
+/* sccs id:    @(#)ex_tty.h    7.2     %G%  */
 /*
  * Capabilities from termcap
  *
 /*
  * Capabilities from termcap
  *
  * before the capability to say 12 milliseconds per affected whatever
  * (currently always line).  Capabilities where this makes sense say P*.
  */
  * before the capability to say 12 milliseconds per affected whatever
  * (currently always line).  Capabilities where this makes sense say P*.
  */
-extern char    tspace[256];    /* Space for capability strings */
-extern char    *aoftspace;     /* Address of tspace for relocation */
+var    char    tspace[256];    /* Space for capability strings */
+var    char    *aoftspace;     /* Address of tspace for relocation */
 
 
-extern char    *AL;            /* P* Add new blank line */
-extern char    *BC;            /*    Back cursor */
-extern char    *BT;            /* P  Back tab */
-extern char    *CD;            /* P* Clear to end of display */
-extern char    *CE;            /* P  Clear to end of line */
-extern char    *CL;            /* P* Clear screen */
-extern char    *CM;            /* P  Cursor motion */
-extern char    *xCR;           /* P  Carriage return */
-extern char    *DC;            /* P* Delete character */
-extern char    *DL;            /* P* Delete line sequence */
-extern char    *DM;            /*    Delete mode (enter)  */
-extern char    *DO;            /*    Down line sequence */
-extern char    *ED;            /*    End delete mode */
-extern char    *EI;            /*    End insert mode */
-extern char    *F0,*F1,*F2,*F3,*F4,*F5,*F6,*F7,*F8,*F9;
+var    char    *AL;            /* P* Add new blank line */
+extern char    *BC;            /*    Back cursor */
+var    char    *BT;            /* P  Back tab */
+var    char    *CD;            /* P* Clear to end of display */
+var    char    *CE;            /* P  Clear to end of line */
+var    char    *CL;            /* P* Clear screen */
+var    char    *CM;            /* P  Cursor motion */
+var    char    *xCR;           /* P  Carriage return */
+var    char    *DC;            /* P* Delete character */
+var    char    *DL;            /* P* Delete line sequence */
+var    char    *DM;            /*    Delete mode (enter)  */
+var    char    *DO;            /*    Down line sequence */
+var    char    *ED;            /*    End delete mode */
+var    char    *EI;            /*    End insert mode */
+var    char    *F0,*F1,*F2,*F3,*F4,*F5,*F6,*F7,*F8,*F9;
                                /*    Strings sent by various function keys */
                                /*    Strings sent by various function keys */
-extern char    *HO;            /*    Home cursor */
-extern char    *IC;            /* P  Insert character */
-extern char    *IM;            /*    Insert mode (give as ':im=:' if 'ic' */
-extern char    *IP;            /* P* Insert pad after char ins'd using IM+IE */
-extern char    *KD;            /*    Keypad down arrow */
-extern char    *KE;            /*    Keypad don't xmit */
-extern char    *KH;            /*    Keypad home key */
-extern char    *KL;            /*    Keypad left arrow */
-extern char    *KR;            /*    Keypad right arrow */
-extern char    *KS;            /*    Keypad start xmitting */
-extern char    *KU;            /*    Keypad up arrow */
-extern char    *LL;            /*    Quick to last line, column 0 */
-extern char    *ND;            /*    Non-destructive space */
-extern char    *xNL;           /*    Line feed (new line) */
-extern char    PC;             /*    Pad character */
-extern char    *SE;            /*    Standout end (may leave space) */
-extern char    *SF;            /* P  Scroll forwards */
-extern char    *SO;            /*    Stand out begin (may leave space) */
-extern char    *SR;            /* P  Scroll backwards */
-extern char    *TA;            /* P  Tab (other than ^I or with padding) */
-extern char    *TE;            /*    Terminal end sequence */
-extern char    *TI;            /*    Terminal initial sequence */
-extern char    *UP;            /*    Upline */
-extern char    *VB;            /*    Visible bell */
-extern char    *VE;            /*    Visual end sequence */
-extern char    *VS;            /*    Visual start sequence */
-extern bool    AM;             /* Automatic margins */
-extern bool    BS;             /* Backspace works */
-extern bool    CA;             /* Cursor addressible */
-extern bool    DA;             /* Display may be retained above */
-extern bool    DB;             /* Display may be retained below */
-extern bool    EO;             /* Can erase overstrikes with ' ' */
-extern bool    GT;             /* Gtty indicates tabs */
-extern bool    HC;             /* Hard copy terminal */
-extern bool    HZ;             /* Hazeltine ~ braindamage */
-extern bool    IN;             /* Insert-null blessing */
-extern bool    MI;             /* can move in insert mode */
-extern bool    NC;             /* No Cr - \r snds \r\n then eats \n (dm2500) */
-extern bool    NS;             /* No scroll - linefeed at bottom won't scroll */
-extern bool    OS;             /* Overstrike works */
-extern bool    UL;             /* Underlining works even though !os */
-extern bool    XB;             /* Beehive (no escape key, simulate with f1) */
-extern bool    XN;             /* A newline gets eaten after wrap (concept) */
-extern bool    XT;             /* Tabs are destructive */
-bool   XV;                     /* VT100 - run AL and DL through tgoto */
-extern bool    XX;             /* Tektronix 4025 insert line */
+var    char    *HO;            /*    Home cursor */
+var    char    *IC;            /* P  Insert character */
+var    char    *IM;            /*    Insert mode (give as ':im=:' if 'ic' */
+var    char    *IP;            /* P* Insert pad after char ins'd using IM+IE */
+var    char    *KD;            /*    Keypad down arrow */
+var    char    *KE;            /*    Keypad don't xmit */
+var    char    *KH;            /*    Keypad home key */
+var    char    *KL;            /*    Keypad left arrow */
+var    char    *KR;            /*    Keypad right arrow */
+var    char    *KS;            /*    Keypad start xmitting */
+var    char    *KU;            /*    Keypad up arrow */
+var    char    *LL;            /*    Quick to last line, column 0 */
+var    char    *ND;            /*    Non-destructive space */
+var    char    *xNL;           /*    Line feed (new line) */
+extern char    PC;             /*    Pad character */
+var    char    *SE;            /*    Standout end (may leave space) */
+var    char    *SF;            /* P  Scroll forwards */
+var    char    *SO;            /*    Stand out begin (may leave space) */
+var    char    *SR;            /* P  Scroll backwards */
+var    char    *TA;            /* P  Tab (other than ^I or with padding) */
+var    char    *TE;            /*    Terminal end sequence */
+var    char    *TI;            /*    Terminal initial sequence */
+extern char    *UP;            /*    Upline */
+var    char    *VB;            /*    Visible bell */
+var    char    *VE;            /*    Visual end sequence */
+var    char    *VS;            /*    Visual start sequence */
+var    bool    AM;             /* Automatic margins */
+var    bool    BS;             /* Backspace works */
+var    bool    CA;             /* Cursor addressible */
+var    bool    DA;             /* Display may be retained above */
+var    bool    DB;             /* Display may be retained below */
+var    bool    EO;             /* Can erase overstrikes with ' ' */
+var    bool    GT;             /* Gtty indicates tabs */
+var    bool    HC;             /* Hard copy terminal */
+var    bool    HZ;             /* Hazeltine ~ braindamage */
+var    bool    IN;             /* Insert-null blessing */
+var    bool    MI;             /* can move in insert mode */
+var    bool    NC;             /* No Cr - \r snds \r\n then eats \n (dm2500) */
+var    bool    NS;             /* No scroll - linefeed at bottom won't scroll */
+var    bool    OS;             /* Overstrike works */
+var    bool    UL;             /* Underlining works even though !os */
+var    bool    XB;             /* Beehive (no escape key, simulate with f1) */
+var    bool    XN;             /* A newline gets eaten after wrap (concept) */
+var    bool    XT;             /* Tabs are destructive */
+var    bool    XV;             /* VT100 - run AL and DL through tgoto */
+var    bool    XX;             /* Tektronix 4025 insert line */
        /* X? is reserved for severely nauseous glitches */
        /* If there are enough of these we may need bit masks! */
 
 /*
  * From the tty modes...
  */
        /* X? is reserved for severely nauseous glitches */
        /* If there are enough of these we may need bit masks! */
 
 /*
  * From the tty modes...
  */
-extern bool    NONL;           /* Terminal can't hack linefeeds doing a CR */
-extern bool    UPPERCASE;      /* Ick! */
-extern short   LINES;          /* Number of lines on screen */
-extern short   COLUMNS;
-extern short   OCOLUMNS;       /* Save COLUMNS for a hack in open mode */
+var    bool    NONL;           /* Terminal can't hack linefeeds doing a CR */
+var    bool    UPPERCASE;      /* Ick! */
+extern short   LINES;          /* Number of lines on screen */
+extern short   COLUMNS;
+var    short   OCOLUMNS;       /* Save COLUMNS for a hack in open mode */
 
 
-extern short   outcol;         /* Where the cursor is */
-extern short   outline;
+var    short   outcol;         /* Where the cursor is */
+var    short   outline;
 
 
-extern short   destcol;        /* Where the cursor should be */
-extern short   destline;
+var    short   destcol;        /* Where the cursor should be */
+var    short   destline;
 
 /*
  * There are several kinds of tty drivers to contend with.  These include:
 
 /*
  * There are several kinds of tty drivers to contend with.  These include:
@@ -126,32 +126,29 @@ extern short      destline;
  * to stty.  In USG V3 it's the whole tty structure.
  */
 #ifdef USG3TTY                 /* USG V3 */
  * to stty.  In USG V3 it's the whole tty structure.
  */
 #ifdef USG3TTY                 /* USG V3 */
-  extern struct        termio tty;     /* Use this one structure to change modes */
+  var  struct  termio tty;     /* Use this one structure to change modes */
   typedef      struct termio ttymode;  /* Mode to contain tty flags */
 
 #else                          /* All others */
   typedef      struct termio ttymode;  /* Mode to contain tty flags */
 
 #else                          /* All others */
-  extern struct        sgttyb tty;     /* Always stty/gtty using this one structure */
+  var  struct  sgttyb tty;     /* Always stty/gtty using this one structure */
   typedef      int ttymode;    /* Mode to contain tty flags */
 # ifdef        TIOCSETC        /* V7 */
   typedef      int ttymode;    /* Mode to contain tty flags */
 # ifdef        TIOCSETC        /* V7 */
-   extern struct       tchars ottyc, nttyc;    /* For V7 character masking */
+   var struct  tchars ottyc, nttyc;    /* For V7 character masking */
 # endif
 # ifdef                TIOCLGET        /* Berkeley */
 # endif
 # ifdef                TIOCLGET        /* Berkeley */
-   extern struct       ltchars olttyc, nlttyc; /* More of tchars style stuff */
+   var struct  ltchars olttyc, nlttyc; /* More of tchars style stuff */
 # endif
 
 #endif
 
 # endif
 
 #endif
 
-extern ttymode normf;          /* Restore tty flags to this (someday) */
-extern bool    normtty;        /* Have to restore normal mode from normf */
+var    ttymode normf;          /* Restore tty flags to this (someday) */
+var    bool    normtty;        /* Have to restore normal mode from normf */
 
 ttymode ostart(), setty(), unixex();
 
 
 ttymode ostart(), setty(), unixex();
 
-extern short   WBOT;
-extern short   WECHO;
-
-extern short   costCM; /* # chars to output a typical CM, with padding etc. */
-extern short   costSR; /* likewise */
-extern short   costAL;
+var    short   costCM; /* # chars to output a typical CM, with padding etc. */
+var    short   costSR; /* likewise */
+var    short   costAL;
 
 #ifdef VMUNIX
 # define MAXNOMACS     128     /* max number of macros of each kind */
 
 #ifdef VMUNIX
 # define MAXNOMACS     128     /* max number of macros of each kind */
@@ -165,13 +162,13 @@ struct maps {
        char *mapto;    /* .. maps to this string */
        char *descr;    /* legible description of key */
 };
        char *mapto;    /* .. maps to this string */
        char *descr;    /* legible description of key */
 };
-extern struct maps arrows[MAXNOMACS];  /* macro defs - 1st 5 built in */
-extern struct maps immacs[MAXNOMACS];  /* for while in insert mode */
-extern struct maps abbrevs[MAXNOMACS]; /* for word abbreviations */
-extern int     ldisc;                  /* line discipline for ucb tty driver */
-extern char    mapspace[MAXCHARMACS];
-extern char    *msnext;        /* next free location in mapspace */
-extern int     maphopcnt;      /* check for infinite mapping loops */
-extern bool    anyabbrs;       /* true if abbr or unabbr has been done */
-extern char    ttynbuf[20];    /* result of ttyname() */
-extern int     ttymesg;        /* original mode of users tty */
+var    struct maps arrows[MAXNOMACS];  /* macro defs - 1st 5 built in */
+var    struct maps immacs[MAXNOMACS];  /* for while in insert mode */
+var    struct maps abbrevs[MAXNOMACS]; /* for word abbreviations */
+var    int     ldisc;                  /* line discipline for ucb tty driver */
+var    char    mapspace[MAXCHARMACS];
+var    char    *msnext;        /* next free location in mapspace */
+var    int     maphopcnt;      /* check for infinite mapping loops */
+var    bool    anyabbrs;       /* true if abbr or unabbr has been done */
+var    char    ttynbuf[20];    /* result of ttyname() */
+var    int     ttymesg;        /* original mode of users tty */
index 38e0226..ee86f91 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_tune.h   7.1     %G%  */
+/* sccs id:    @(#)ex_tune.h   7.2     %G%  */
 /*
  * Definitions of editor parameters and limits
  */
 /*
  * Definitions of editor parameters and limits
  */
index 5222037..747359e 100644 (file)
@@ -1,4 +1,4 @@
-/*  sccs id  @(#)ex_vars.h     7.1     %G% */
+/*  sccs id  @(#)ex_vars.h     7.2     %G% */
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
index d6b87a9..e4a3cdb 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex_vis.h    7.1     %G%  */
+/* sccs id:    @(#)ex_vis.h    7.2     %G%  */
 /*
  * Ex version 3
  * Mark Horton, UCB
 /*
  * Ex version 3
  * Mark Horton, UCB
@@ -17,8 +17,8 @@
  * line is longer than 80.
  */
 
  * line is longer than 80.
  */
 
-extern short   bastate;
-extern short   state;
+var short      bastate;
+var short      state;
 
 #define        VISUAL          0
 #define        CRTOPEN         1
 
 #define        VISUAL          0
 #define        CRTOPEN         1
@@ -38,20 +38,20 @@ extern short        state;
  * If WBOT!=WECHO then WECHO will be the last line on the screen
  * and WBOT is the line before it.
  */
  * If WBOT!=WECHO then WECHO will be the last line on the screen
  * and WBOT is the line before it.
  */
-extern short   basWTOP;
-extern short   basWLINES;
-extern short   WTOP;
-extern short   WBOT;
-extern short   WLINES;
-extern short   WCOLS;
-extern short   WECHO;
+var short      basWTOP;
+var short      basWLINES;
+var short      WTOP;
+var short      WBOT;
+var short      WLINES;
+var short      WCOLS;
+var short      WECHO;
 
 /*
  * When we are dealing with the echo area we consider the window
  * to be "split" and set the variable splitw.  Otherwise, moving
  * off the bottom of the screen into WECHO causes a screen rollup.
  */
 
 /*
  * When we are dealing with the echo area we consider the window
  * to be "split" and set the variable splitw.  Otherwise, moving
  * off the bottom of the screen into WECHO causes a screen rollup.
  */
-extern bool    splitw;
+var bool       splitw;
 
 /*
  * Information about each line currently on the screen includes
 
 /*
  * Information about each line currently on the screen includes
@@ -66,7 +66,7 @@ struct vlinfo {
        short   vdepth;         /* Depth of displayed line */ /*mjm: was char */
        short   vflags;         /* Is line potentially dirty ? */
 };
        short   vdepth;         /* Depth of displayed line */ /*mjm: was char */
        short   vflags;         /* Is line potentially dirty ? */
 };
-extern struct vlinfo  vlinfo[TUBELINES + 2];
+var struct vlinfo  vlinfo[TUBELINES + 2];
 
 #define        DEPTH(c)        (vlinfo[c].vdepth)
 #define        LINE(c)         (vlinfo[c].vliny)
 
 #define        DEPTH(c)        (vlinfo[c].vdepth)
 #define        LINE(c)         (vlinfo[c].vliny)
@@ -93,8 +93,8 @@ extern struct vlinfo  vlinfo[TUBELINES + 2];
  * Vcline is intimately tied to the current value of dot,
  * and when command mode is used as a subroutine fancy footwork occurs.
  */
  * Vcline is intimately tied to the current value of dot,
  * and when command mode is used as a subroutine fancy footwork occurs.
  */
-extern short   vcline;
-extern short   vcnt;
+var short      vcline;
+var short      vcnt;
 
 /*
  * To allow many optimizations on output, an exact image of the terminal
 
 /*
  * To allow many optimizations on output, an exact image of the terminal
@@ -104,8 +104,8 @@ extern short        vcnt;
  * data itself.  It is also rearranged during insert mode across line
  * boundaries to make incore work easier.
  */
  * data itself.  It is also rearranged during insert mode across line
  * boundaries to make incore work easier.
  */
-extern char    *vtube[TUBELINES];
-extern char    *vtube0;
+var char       *vtube[TUBELINES];
+var char       *vtube0;
 
 /*
  * The current cursor position within the current line is kept in
 
 /*
  * The current cursor position within the current line is kept in
@@ -115,9 +115,9 @@ extern char *vtube0;
  * lines to mark the other end of the affected area, or the target
  * for a motion.
  */
  * lines to mark the other end of the affected area, or the target
  * for a motion.
  */
-extern char    *cursor;
-extern char    *wcursor;
-extern line    *wdot;
+var char       *cursor;
+var char       *wcursor;
+var line       *wdot;
 
 /*
  * Undo information is saved in a LBSIZE buffer at "vutmp" for changes
 
 /*
  * Undo information is saved in a LBSIZE buffer at "vutmp" for changes
@@ -133,8 +133,8 @@ extern line *wdot;
 #define        VMCHNG  4
 #define        VMANYINS 5
 
 #define        VMCHNG  4
 #define        VMANYINS 5
 
-extern short   vundkind;       /* Which kind of undo - from above */
-extern char    *vutmp;         /* Prev line image when "VCHNG" */
+var short      vundkind;       /* Which kind of undo - from above */
+var char       *vutmp;         /* Prev line image when "VCHNG" */
 
 /*
  * State information for undoing of macros.  The basic idea is that
 
 /*
  * State information for undoing of macros.  The basic idea is that
@@ -148,7 +148,7 @@ extern char *vutmp;         /* Prev line image when "VCHNG" */
 #define VC_ONECHANGE   2       /* In a macro, one change so far */
 #define VC_MANYCHANGE  3       /* In a macro, at least 2 changes so far */
 
 #define VC_ONECHANGE   2       /* In a macro, one change so far */
 #define VC_MANYCHANGE  3       /* In a macro, at least 2 changes so far */
 
-extern short   vch_mac;        /* Change state - one of the above */
+var short      vch_mac;        /* Change state - one of the above */
 
 /*
  * For U undo's the line is grabbed by "vmove" after it first appears
 
 /*
  * For U undo's the line is grabbed by "vmove" after it first appears
@@ -157,9 +157,9 @@ extern short        vch_mac;        /* Change state - one of the above */
  * are made, i.e. after a 'J' join.  This is because a 'JU' would
  * lose completely the text of the line just joined on.
  */
  * are made, i.e. after a 'J' join.  This is because a 'JU' would
  * lose completely the text of the line just joined on.
  */
-extern char    *vUNDcurs;      /* Cursor just before 'U' */
-extern line    *vUNDdot;       /* The line address of line saved in vUNDsav */
-extern line    vUNDsav;        /* Grabbed initial "*dot" */
+var char       *vUNDcurs;      /* Cursor just before 'U' */
+var line       *vUNDdot;       /* The line address of line saved in vUNDsav */
+var line       vUNDsav;        /* Grabbed initial "*dot" */
 
 #define        killU()         vUNDdot = NOLINE
 
 
 #define        killU()         vUNDdot = NOLINE
 
@@ -189,8 +189,8 @@ extern line vUNDsav;        /* Grabbed initial "*dot" */
  * is actually needed is recorded in heldech, which says that a clear
  * of the echo area was actually held off.
  */
  * is actually needed is recorded in heldech, which says that a clear
  * of the echo area was actually held off.
  */
-extern short   hold;
-extern short   holdupd;        /* Hold off update when echo line is too long */
+var short      hold;
+var short      holdupd;        /* Hold off update when echo line is too long */
 
 #define        HOLDAT          1
 #define        HOLDDOL         2
 
 #define        HOLDAT          1
 #define        HOLDDOL         2
@@ -203,43 +203,43 @@ extern short      holdupd;        /* Hold off update when echo line is too long */
 /*
  * Miscellaneous variables
  */
 /*
  * Miscellaneous variables
  */
-extern short   CDCNT;          /* Count of ^D's in insert on this line */
-extern char    DEL[VBSIZE];    /* Last deleted text */
-extern bool    HADUP;          /* This insert line started with ^ then ^D */
-extern bool    HADZERO;        /* This insert line started with 0 then ^D */
-extern char    INS[VBSIZE];    /* Last inserted text */
-extern int     Vlines;         /* Number of file lines "before" vi command */
-extern int     Xcnt;           /* External variable holding last cmd's count */
-extern bool    Xhadcnt;        /* Last command had explicit count? */
-extern short   ZERO;
-extern short   dir;            /* Direction for search (+1 or -1) */
-extern short   doomed;         /* Disply chars right of cursor to be killed */
-extern bool    gobblebl;       /* Wrapmargin space generated nl, eat a space */
-extern bool    hadcnt;         /* (Almost) internal to vmain() */
-extern bool    heldech;        /* We owe a clear of echo area */
-extern bool    insmode;        /* Are in character insert mode */
-extern char    lastcmd[5];     /* Chars in last command */
-extern int     lastcnt;        /* Count for last command */
-extern char    *lastcp;        /* Save current command here to repeat */
-extern bool    lasthad;        /* Last command had a count? */
-extern short   lastvgk;        /* Previous input key, if not from keyboard */
-extern short   lastreg;        /* Register with last command */
-extern char    *ncols['z'-'a'+2];      /* Cursor positions of marks */
-extern char    *notenam;       /* Name to be noted with change count */
-extern char    *notesgn;       /* Change count from last command */
-extern char    op;             /* Operation of current command */
-extern short   Peekkey;        /* Peek ahead key */
-extern bool    rubble;         /* Line is filthy (in hardcopy open), redraw! */
-extern int     vSCROLL;        /* Number lines to scroll on ^D/^U */
-extern char    *vglobp;        /* Untyped input (e.g. repeat insert text) */
-extern char    vmacbuf[VBSIZE];   /* Text of visual macro, hence nonnestable */
-extern char    *vmacp;         /* Like vglobp but for visual macros */
-extern char    *vmcurs;        /* Cursor for restore after undo d), e.g. */
-extern short   vmovcol;        /* Column to try to keep on arrow keys */
-extern bool    vmoving;        /* Are trying to keep vmovcol */
-extern short   vreg;           /* Reg for this command */   /* mjm: was char */
-extern short   wdkind;         /* Liberal/conservative words? */
-extern char    workcmd[5];     /* Temporary for lastcmd */
+var short      CDCNT;          /* Count of ^D's in insert on this line */
+var char       DEL[VBSIZE];    /* Last deleted text */
+var bool       HADUP;          /* This insert line started with ^ then ^D */
+var bool       HADZERO;        /* This insert line started with 0 then ^D */
+var char       INS[VBSIZE];    /* Last inserted text */
+var int        Vlines;         /* Number of file lines "before" vi command */
+var int        Xcnt;           /* External variable holding last cmd's count */
+var bool       Xhadcnt;        /* Last command had explicit count? */
+var short      ZERO;
+var short      dir;            /* Direction for search (+1 or -1) */
+var short      doomed;         /* Disply chars right of cursor to be killed */
+var bool       gobblebl;       /* Wrapmargin space generated nl, eat a space */
+var bool       hadcnt;         /* (Almost) internal to vmain() */
+var bool       heldech;        /* We owe a clear of echo area */
+var bool       insmode;        /* Are in character insert mode */
+var char       lastcmd[5];     /* Chars in last command */
+var int        lastcnt;        /* Count for last command */
+var char       *lastcp;        /* Save current command here to repeat */
+var bool       lasthad;        /* Last command had a count? */
+var short      lastvgk;        /* Previous input key, if not from keyboard */
+var short      lastreg;        /* Register with last command */
+var char       *ncols['z'-'a'+2];      /* Cursor positions of marks */
+var char       *notenam;       /* Name to be noted with change count */
+var char       *notesgn;       /* Change count from last command */
+var char       op;             /* Operation of current command */
+var short      Peekkey;        /* Peek ahead key */
+var bool       rubble;         /* Line is filthy (in hardcopy open), redraw! */
+var int        vSCROLL;        /* Number lines to scroll on ^D/^U */
+var char       *vglobp;        /* Untyped input (e.g. repeat insert text) */
+var char       vmacbuf[VBSIZE];   /* Text of visual macro, hence nonnestable */
+var char       *vmacp;         /* Like vglobp but for visual macros */
+var char       *vmcurs;        /* Cursor for restore after undo d), e.g. */
+var short      vmovcol;        /* Column to try to keep on arrow keys */
+var bool       vmoving;        /* Are trying to keep vmovcol */
+var short      vreg;           /* Reg for this command */   /* mjm: was char */
+var short      wdkind;         /* Liberal/conservative words? */
+var char       workcmd[5];     /* Temporary for lastcmd */
 
 
 /*
 
 
 /*
index a5a3382..b4a877b 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_vops2.c  6.4 %G%";
+static char *sccsid = "@(#)ex_vops2.c  6.5 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"