Must distinguish between "ambiguous" and "unknown" commands.
[unix-history] / usr / src / usr.bin / ex / ex_vis.h
index 959037c..4f7781a 100644 (file)
@@ -1,5 +1,11 @@
-/* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_vis.h    6.1 %G%  */
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)ex_vis.h    7.5 (Berkeley) %G%
+ */
+
 /*
  * Ex version 3
  * Mark Horton, UCB
 /*
  * Ex version 3
  * Mark Horton, UCB
@@ -17,8 +23,8 @@
  * line is longer than 80.
  */
 
  * line is longer than 80.
  */
 
-short  bastate;
-short  state;
+var    short   bastate;
+var    short   state;
 
 #define        VISUAL          0
 #define        CRTOPEN         1
 
 #define        VISUAL          0
 #define        CRTOPEN         1
@@ -38,20 +44,20 @@ 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.
  */
-short  basWTOP;
-short  basWLINES;
-short  WTOP;
-short  WBOT;
-short  WLINES;
-short  WCOLS;
-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.
  */
-bool   splitw;
+var    bool    splitw;
 
 /*
  * Information about each line currently on the screen includes
 
 /*
  * Information about each line currently on the screen includes
@@ -62,10 +68,11 @@ bool        splitw;
  * appropriate juncture.
  */
 struct vlinfo {
  * appropriate juncture.
  */
 struct vlinfo {
-       char    vliny;          /* Y coordinate */
-       char    vdepth;         /* Depth of displayed line */
+       short   vliny;          /* Y coordinate */      /* mjm: was char */
+       short   vdepth;         /* Depth of displayed line */ /*mjm: was char */
        short   vflags;         /* Is line potentially dirty ? */
        short   vflags;         /* Is line potentially dirty ? */
-} 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)
@@ -92,8 +99,8 @@ struct vlinfo {
  * 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.
  */
-short  vcline;
-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
@@ -103,8 +110,8 @@ 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.
  */
-char   *vtube[TUBELINES];
-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
@@ -114,9 +121,9 @@ 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.
  */
-char   *cursor;
-char   *wcursor;
-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
@@ -132,8 +139,8 @@ line        *wdot;
 #define        VMCHNG  4
 #define        VMANYINS 5
 
 #define        VMCHNG  4
 #define        VMANYINS 5
 
-short  vundkind;       /* Which kind of undo - from above */
-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
@@ -147,7 +154,7 @@ 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 */
 
-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
@@ -156,9 +163,9 @@ 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.
  */
-char   *vUNDcurs;      /* Cursor just before 'U' */
-line   *vUNDdot;       /* The line address of line saved in vUNDsav */
-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
 
@@ -188,8 +195,8 @@ 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.
  */
-short  hold;
-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
@@ -202,43 +209,43 @@ short     holdupd;                /* Hold off update when echo line is too long */
 /*
  * Miscellaneous variables
  */
 /*
  * Miscellaneous variables
  */
-short  CDCNT;                  /* Count of ^D's in insert on this line */
-char   DEL[VBSIZE];            /* Last deleted text */
-bool   HADUP;                  /* This insert line started with ^ then ^D */
-bool   HADZERO;                /* This insert line started with 0 then ^D */
-char   INS[VBSIZE];            /* Last inserted text */
-int    Vlines;                 /* Number of file lines "before" vi command */
-int    Xcnt;                   /* External variable holding last cmd's count */
-bool   Xhadcnt;                /* Last command had explicit count? */
-short  ZERO;
-short  dir;                    /* Direction for search (+1 or -1) */
-short  doomed;                 /* Disply chars right of cursor to be killed */
-bool   gobblebl;               /* Wrapmargin space generated nl, eat a space */
-bool   hadcnt;                 /* (Almost) internal to vmain() */
-bool   heldech;                /* We owe a clear of echo area */
-bool   insmode;                /* Are in character insert mode */
-char   lastcmd[5];             /* Chars in last command */
-int    lastcnt;                /* Count for last command */
-char   *lastcp;                /* Save current command here to repeat */
-bool   lasthad;                /* Last command had a count? */
-short  lastvgk;                /* Previous input key, if not from keyboard */
-short  lastreg;                /* Register with last command */
-char   *ncols['z'-'a'+2];      /* Cursor positions of marks */
-char   *notenam;               /* Name to be noted with change count */
-char   *notesgn;               /* Change count from last command */
-char   op;                     /* Operation of current command */
-short  Peekkey;                /* Peek ahead key */
-bool   rubble;                 /* Line is filthy (in hardcopy open), redraw! */
-int    vSCROLL;                /* Number lines to scroll on ^D/^U */
-char   *vglobp;                /* Untyped input (e.g. repeat insert text) */
-char   vmacbuf[VBSIZE];        /* Text of visual macro, hence nonnestable */
-char   *vmacp;                 /* Like vglobp but for visual macros */
-char   *vmcurs;                /* Cursor for restore after undo d), e.g. */
-short  vmovcol;                /* Column to try to keep on arrow keys */
-bool   vmoving;                /* Are trying to keep vmovcol */
-char   vreg;                   /* Register for this command */
-short  wdkind;                 /* Liberal/conservative words? */
-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   ex_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   Peek_key;       /* Peek ahead key */
+var    bool    rubble;         /* Line is filthy (in hardcopy open), redraw! */
+var    int     ex_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 */
 
 
 /*
 
 
 /*