home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / editor / tvx_edit.arc / TVX_GLBL.IC < prev    next >
Text File  |  1986-03-17  |  19KB  |  459 lines

  1. /* ---------------   TVX global declarations   ------------------------ */
  2.  
  3. /*   This version of TVX Copyright (c) 1986 by Bruce E. Wampler
  4.  
  5.    Permission is hereby granted for free, unrestricted nonprofit
  6.    use of this software.  Please feel free to modify, distribute,
  7.    and share this software as long as you aren't making any money
  8.    from it.  If you want to use this code in a profit making environment,
  9.    please contact the author for permission.
  10. */
  11. /*
  12.    Following trick allows only one file for externals.  If EXTERN is not
  13.    defined, then variables are decleared extern.  ONE module, tvlex.c,
  14.    defines EXTERN, and thus actually declares things.  If you need to
  15.    change one of these values (terminal definition, for example), then
  16.    only tvlex.c needs to be recompiled!
  17. */
  18. #ifndef EXTERN
  19. #define EXTERN extern
  20. #define USEEXTERN /**/
  21. #endif
  22.  
  23. /* constants defined within the next #ifndef area are the important
  24.    system values that define the terminal, margins, etc.  ALL variables
  25.    between begpatch and endpatch must be initialized for the MS-DOS cii-86
  26.    compiler to put them all in the same contiguous memory area.
  27.    This allows the tvconfig program to work properly to find the #####:
  28.    patch area patern.  This works on the C/80 CP/M version, too, but
  29.    has never been tried on unix since the termcap driver is normally used.
  30. */
  31.  
  32. #ifndef USEEXTERN
  33.     EXTERN char begpatch[6] = {'#','#','#','#','#',':'};
  34.  
  35. #include "tvx_term.ic"        /* include terminal definitions */
  36.  
  37. /* the order of lexsym values MUST be in the order specified here to
  38.    correspond to the order of the switch in edit()
  39. */
  40. /* ---------------------------- Standard TVX --------------------------- */
  41. #ifdef TVX_EM            /* define standard command set */
  42.     EXTERN char lexsym[LEXVALUES+1] = { '@', 'r', 'l', 'd', 'u',
  43.       4, 21, 8, 'k', 'i', 11, '"', '\'', ',', '.', 'f', 6, 'p',
  44.       'b', 'e', 2, 'v', 'o', '/', 's', 'g', 23, 25, 24, ';', '&',
  45.       'm', ':', '=', 7, 9, '{', 'a', 16, '?', 'h', 20, 'c', 'j', 't',
  46.       'n', 14, 15, 5, 18, '#', '*','(', ')','~'};
  47. /*  SYNONYM and function key list */
  48.  
  49.     EXTERN char loop_beg = '<';
  50.     EXTERN char loop_end = '>';
  51.  
  52.     EXTERN char synofr[20] =    /* from table */
  53.       {' ',13,'[',']',000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
  54.     EXTERN char synoto[20] =        /* translate to table */
  55.       {'r','d','{','{',000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
  56. #ifdef IBMPC
  57.     EXTERN char funkey = 0;        /* leading char for function key */
  58.     EXTERN char funchar[50] =    /* code sent by function key */
  59.       {     /* make keypad function keys work like you would expect */
  60.      71,  72,  73,  75,  77,  79,  82,  83,  80,  81,
  61.      59, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  62.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  63.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  64.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  65.       };
  66.     EXTERN char funcmd[50] =    /* equivalent command */
  67.       {
  68.     'b',  21, 'h', 'l', 'r', 'e', 'i',  11,   4, 'p',
  69.     '&', 000, 000, 000, 000, 000, 000, 000, 000, 000,
  70.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  71.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  72.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  73.       };
  74. #else                /* regular terminal synonyms */
  75.     EXTERN char funkey = 0;        /* leading char for function key */
  76.     EXTERN char funchar[50] =    /* code sent by function key */
  77.       {
  78.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  79.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  80.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  81.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  82.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  83.       };
  84.     EXTERN char funcmd[50] =    /* equivalent command */
  85.       {
  86.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  87.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  88.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  89.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  90.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  91.       };
  92. #endif
  93. #endif        /* TVX_EM */
  94.  
  95. /* ---------------------------- VI EMULATOR --------------------------- */
  96. #ifdef VI_EM            /* define vi emulation set */
  97.     EXTERN char lexsym[LEXVALUES+1] =
  98.       {
  99.       /*     1    2    3    4    5    6    7    8   9   10 */
  100.       '_',   2,   4,   6,   7,   8,  12, '=', '!', '#', '$',
  101.        '*', '/', ':', 'J', '?', '@', 'A', 'C', 'D', 'G',
  102.        'H', 'I',  14,  16, 'L', 'M', 'N', 'O', 'P', 'T',
  103.        'X', 'Y', 'Z', '^', 'a', 'b', 'c', 'd',  21, 'i',
  104.        '+', 'K', 'l', 'm', 'n', 'o', 'p', 'r', 's',  27,
  105.        'w', 'x', 'y', '~'
  106.       };
  107.     EXTERN char loop_beg = '<';
  108.     EXTERN char loop_end = '>';
  109.  
  110. /*  SYNONYM and function key list */
  111. #ifdef VI_MODS            /* extended definitions */
  112.     EXTERN char synofr[20] =    /* from table */
  113. /*          ^J  ^M  ^R  ^T    */
  114.       { 'h',10, 13, 18, 20,' ','B','Q','W','`','q','z','j','k',
  115.     11,127,00,00,00,00};
  116.     EXTERN char synoto[20] =        /* translate to table */
  117.       {  8, 14,'+', 12,'T','l','b','T','w','M','T', 12,'+','K',
  118.     16,'X',00,00,00,00};
  119. #else                /* regular definitions */
  120.     EXTERN char synofr[20] =    /* from table */
  121. /*          ^J  ^M  ^R  ^T    */
  122.       { 'h',10, 13, 18, 20,' ','B','Q','W','`','q','z','j','k',
  123.     11,127,00,00,00,00};
  124.     EXTERN char synoto[20] =        /* translate to table */
  125.       {  8, 14,'+', 12,'T','l','b','T','w','M','T', 12, 14, 16,
  126.     16,'X',00,00,00,00};
  127. #endif
  128.  
  129. #ifdef IBMPC
  130.     EXTERN char funkey = 0;        /* leading char for function key */
  131.     EXTERN char funchar[50] =    /* code sent by function key */
  132.       {     /* make keypad function keys work like you would expect */
  133.      71,  72,  73,  75,  77,  79,  82,  83,  80,  81,
  134.      00, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  135.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  136.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  137.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  138.       };
  139.     EXTERN char funcmd[50] =    /* equivalent command */
  140.       {
  141.     'H', 'K',   2,   8, 'l', 'L', 'i', 'X', '+',   6,
  142.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  143.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  144.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  145.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  146.       };
  147. #else                /* regular terminal synonyms */
  148.     EXTERN char funkey = 0;        /* leading char for function key */
  149.     EXTERN char funchar[50] =    /* code sent by function key */
  150.       {
  151.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  152.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  153.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  154.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  155.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  156.       };
  157.     EXTERN char funcmd[50] =    /* equivalent command */
  158.       {
  159.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  160.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  161.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  162.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  163.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  164.       };
  165. #endif
  166. #endif
  167. /* .......................... MODELESS VERSIONS ........................ */
  168. /*
  169.     The lexical analyzer and parser has been designed to allow
  170.     function keys to be easily used for modeless commands.  The
  171.     best way is to define lexsym using the usual mnemonic forms
  172.     of commands, and use the function key and synonym tables to
  173.     define function keys.  First, map function keys to single
  174.     negative values (or chars with hi bit set (> 127)).  Then,
  175.     have those values mapped to the real command in the synomym
  176.     tables.
  177. */
  178. /* ---------------------------- Modeless TVX --------------------------- */
  179. #ifdef TVX0M_EM
  180.    /* like tvx, except normal lower case commands map to ^X and normal
  181.       control commands map to ESC commands */
  182.     EXTERN char lexsym[LEXVALUES+1] = { '@', 18, 12, 4, 21,
  183.       'd', 'u', 8, 11, 'i', 'k', '"', '\'', ',', '.', 6, 'f', 16,
  184.         2, 5, 'b', 22, 15, '/', 's', 'g', 'w', 'y', 'x', ';', '&',
  185.       'm', ':', '=', 7, 9, '{', 'a', 'p', '?', 'h', 't', 3, 'j', 20,
  186.       14, 'n', 'o', 'e', 'r', '#', '*','(', ')','~'};
  187. /*  SYNONYM and function key list */
  188.  
  189.     EXTERN char loop_beg = '<';
  190.     EXTERN char loop_end = '>';
  191.     EXTERN char synofr[20] =    /* from table */
  192.       {'[',']',0,0,000,000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
  193.     EXTERN char synoto[20] =        /* translate to table */
  194.       {'{','{',0,0,000,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
  195. #ifdef IBMPC
  196.     EXTERN char funkey = 0;        /* leading char for function key */
  197.     EXTERN char funchar[50] =    /* code sent by function key */
  198.       {     /* make keypad function keys work like you would expect */
  199.      71,  72,  73,  75,  77,  79,  83,  80,  81, 000,
  200.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  201.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  202.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  203.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  204.       };
  205.     EXTERN char funcmd[50] =    /* equivalent command */
  206.       {
  207.       2,  21,  16,  12,  18,  5,   11,   4,  16, 000,
  208.         000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  209.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  210.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  211.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  212.       };
  213. #else                /* regular terminal synonyms */
  214.     EXTERN char funkey = 0;        /* leading char for function key */
  215.     EXTERN char funchar[50] =    /* code sent by function key */
  216.       {
  217.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  218.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  219.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  220.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  221.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  222.       };
  223.     EXTERN char funcmd[50] =    /* equivalent command */
  224.       {
  225.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  226.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  227.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  228.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  229.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  230.       };
  231. #endif
  232. #endif
  233.  
  234. /* ---------------------------- EMAX --------------------------- */
  235. #ifdef EMAX_EM
  236.    /* like tvx, except normal lower case commands map to ^X and normal
  237.       control commands map to ESC commands */
  238.     EXTERN char lexsym[LEXVALUES+1] =
  239.       { '%',   1,   2,   3,   4,   5,   6,   7,   8,  11,  12,
  240.           14,  15,  16,  18,  19,  22,  24,  25,  26, '!',
  241.              '#', '>', '<', 'b', 'f', 'v', '?'
  242.       };
  243. /*  SYNONYM and function key list */
  244.  
  245.     EXTERN char loop_beg = '(';        /* <esc>( for emax */
  246.     EXTERN char loop_end = ')';
  247.  
  248.     EXTERN char synofr[20] =    /* from table */
  249.       {127,0202,0203,0204,'s',000,000,000,000,000,00,00,00,00,00,00,00,00,00,00};
  250.     EXTERN char synoto[20] =        /* translate to table */
  251.       {  8, '<', 'v', '>', 19,0,000,00,00,000,00,00,00,00,00,00,00,00,00,00};
  252. #ifdef IBMPC
  253.     EXTERN char funkey = 0;        /* leading char for function key */
  254.     EXTERN char funchar[50] =    /* code sent by function key */
  255.       {     /* make keypad function keys work like you would expect */
  256. /*     hm,  ^,  pgu,  <-,  ->, end, del,  v , pgd, */
  257.      71,  72,  73,  75,  77,  79,  83,  80,  81, 000,
  258.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  259.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  260.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  261.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  262.       };
  263.     EXTERN char funcmd[50] =    /* equivalent command */
  264.       {
  265.     0202, 16,0203,   2,   6,0204,   4,  14,  22, 000,
  266.         000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  267.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  268.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  269.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  270.       };
  271. #else                /* regular terminal synonyms */
  272.     EXTERN char funkey = 0;        /* leading char for function key */
  273.     EXTERN char funchar[50] =    /* code sent by function key */
  274.       {
  275.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  276.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  277.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  278.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  279.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  280.       };
  281.     EXTERN char funcmd[50] =    /* equivalent command */
  282.       {
  283.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  284.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  285.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  286.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000,
  287.     000, 000, 000, 000, 000, 000, 000, 000, 000, 000
  288.       };
  289. #endif
  290. #endif
  291. /* ------------------- END OF COMMAND SET VALUES ------------------ */
  292.  
  293.     EXTERN char user_set[40] = "";        /* user search set */
  294.     EXTERN char use_wild = TRUE;        /* use wild cards by default */
  295.     EXTERN char old_cmds[16] = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 };
  296.     EXTERN int old_cindex = 0;            /* cursor into old_cmds */
  297.     EXTERN int cut_mode = DEF_CUTMODE;        /* kill line cuts */
  298. #ifdef NOMODE_LEX
  299.     EXTERN int escape_chr = 27;            /* ESC is default prefix char */
  300. #else
  301.     EXTERN int escape_chr = 0;            /* ESC is default prefix char */
  302. #endif
  303.  
  304.  
  305. #ifdef MSDOS
  306.     EXTERN char cfgname[40] = "-c=\\bin\\config.tvx";
  307. #endif
  308. #ifdef GEMDOS
  309.     EXTERN char cfgname[40] = "-c=config.tvx";
  310. #endif
  311. #ifdef UNIX
  312.     EXTERN char cfgname[40] = "-c=config.tvx";
  313. #endif
  314. #ifdef OSCPM
  315.     EXTERN char cfgname[40] = "-c=a:config.tvx";
  316. #endif
  317.     EXTERN int endpatch = 0;    /* to get address of end of patch area */
  318.  
  319. #else
  320.     EXTERN char begpatch[6];
  321.  
  322.     EXTERN char lexsym[LEXVALUES+1];
  323.     EXTERN char loop_beg, loop_end;
  324.  
  325.     EXTERN char synofr[20],    /* from table */
  326.     synoto[20];        /* translate to table */
  327.  
  328.     EXTERN char funkey,        /* leading char for function key */
  329.     funchar[50],    /* code sent by function key */
  330.     funcmd[50];    /* equivalent command */
  331.     EXTERN int addx,        /* amount to add to get x */
  332.     addy;            /* to get y */
  333.     EXTERN char cxychr;        /* true if convert xy bin to ascii */
  334.     EXTERN char cversn[12],    /* a version to identify config */
  335.     cxy1st,            /* l if line first, c if column 1st */
  336.     cxybeg[8],        /* start xy control seq */
  337.     cxymid[8],        /* middle xy control seq */
  338.     cxyend[8],        /* end sequence */
  339.     cerrbg[8],        /* string to print when errors start */
  340.     cerred[8],        /* when errors done */
  341.     ctopb[8],        /* top blanks = reverse linefeed */
  342.     cinit[20],        /* start up sequence */
  343.     cendit[20],        /* to end session */
  344.     cbotb[8],        /* bottom sequence */
  345.     celin[8],        /* erase to end of line */
  346.     cescr[8],        /* erase to end of screen */
  347.     cclears[8],        /* clear and home */
  348.     cdelchr[8],        /* delete character */
  349.     ccsrcm[8],        /* set cursor to command mode */
  350.     ccsrin[8],        /* set cursor to insert mode */
  351.     ciline[8],        /* insert a line */
  352.     ckline[8],        /* kill a line */
  353.     cundlb[8],        /* turn on underline */
  354.     cundle[8],        /* turn off underline */
  355.     cboldb[8],        /* start bold */
  356.     cbolde[8];        /* end bold */
  357.  
  358.     EXTERN int dsp_mem,ddline,dscrl,dxcase,usecz,autoin,logdef;
  359.     EXTERN char delkey;
  360.  
  361.     EXTERN int    tvlins,    /* number of lines on screen */
  362.         tvcols,    /* number of columns on screen */
  363.         tvhardlines,    /* real number of lines (for small window) */
  364.         tvx,    /* current x cursor position */
  365.         tvy,    /* current y cursor position */
  366.         tvdlin,    /* the "active" display line */
  367.         dsplin,    /* the default display line */
  368.         tabspc,    /* spacing for tabs */
  369.         leftmg,    /* left margin of display */
  370.         wraplm,    /* auto wrap? */
  371.         isibmpc; /* for possible use with a general version */
  372.  
  373.     EXTERN char user_set[40],            /* wild matches */
  374.     use_wild;
  375.  
  376.     EXTERN char old_cmds[16];
  377.     EXTERN int old_cindex;            /* cursor into old_cmds */
  378.     EXTERN int cut_mode;            /* kill line cuts */
  379.     EXTERN int escape_chr;            /* prefix char */
  380.  
  381.     EXTERN char cfgname[40];
  382.  
  383.     EXTERN int endpatch;    /* to get address of end of patch area */
  384. #endif
  385.  
  386.  
  387.     EXTERN int    bakpos,        /* used when building log file */
  388.         bakflg,        /* if writing to log file */
  389.         usebak,        /* if want to build a log file or not */
  390.         makebackup;    /* if want to retain backup .bak file */
  391.  
  392.     EXTERN BUFFINDEX nxtsav,    /* top of save buffer */
  393.         curchr,        /* pointer to current character */
  394.         nxtchr,        /* ptr to buff of next new chr */
  395.         mxbuff,        /* maximum number of chars in buff */
  396.         *lines;        /* line ptrs */
  397.  
  398.     EXTERN int     curlin,        /* pointer to current line */
  399.         nxtlin,        /* ptr to lines of next new line */
  400.         mxline;        /* maximum number of lines */
  401.  
  402.     EXTERN char *buff;        /* character and save buffer */
  403.  
  404. #ifdef NOALLOC
  405.     EXTERN int myline[MAXLINE+1];    /* the real line buffer */
  406.     EXTERN char mybuff[MAXBUFF+1];    /* the real buffer */
  407. #endif
  408.  
  409.     EXTERN int    oldlen,        /* length for '=' command */
  410.         savlin,        /* number of saved lines */
  411.         savlen;        /* line lenght of save buffer for rmvlst */
  412.  
  413.     EXTERN int    oldlex,        /* last commands lexical value */
  414.         oldcol,        /* beginning column for dwncol */
  415.         echof,        /* whether or not to echo action */
  416.         xcases,        /* exact case flag */
  417.         scroll;        /* scroll window */
  418.  
  419.     EXTERN int newfil;        /* YES if creating a new file */
  420.     EXTERN int rdonly;        /* YES if reading a file only */
  421.  
  422.     EXTERN char orig_file[FNAMESIZE+1],    /* original file */
  423.         source_file[FNAMESIZE+1], /* where file really is */
  424.         work_file[FNAMESIZE+1],    /* current working output file */
  425.         dest_file[FNAMESIZE+1];    /* ultimate name for file */
  426.  
  427.     EXTERN int    rptuse,            /* which repeat buffer currently active */
  428.         rptcnt[REPEATBUFS],    /* number of repeats left to do */
  429.         nxtrpt[REPEATBUFS];    /* pointer to next repeat character */
  430.  
  431.     EXTERN char rptbuf[REPEATBUFS][102]; /* up to 100 chars in repeat loop */
  432.     EXTERN char sbuff[102];        /* search buffer */
  433.     EXTERN char pat_buff[102];        /* save the pattern */
  434.  
  435. /* other globals */
  436. #ifndef USEEXTERN
  437.     int slastl = 0;
  438. #else
  439.     extern int slastl;
  440. #endif
  441.  
  442.     EXTERN char unkbuf[130];
  443.  
  444.     EXTERN int useprint;    /* whether to print */
  445.     EXTERN int xoutcm;        /* used for 240 col virtual screen */
  446.     EXTERN int last_col_out;    /* last column output */
  447.     EXTERN int waserr;
  448.     EXTERN int blimit;        /* limit for read in buffer */
  449.     EXTERN int ttymode;        /* true if in tty mode */
  450.     EXTERN int ttynext;        /* cursor to next char from rdtty */
  451.     EXTERN int ins_mode;    /* true if insert mode */
  452.     EXTERN int force_tty;    /* for unix to force tty mode */
  453.  
  454.  
  455.     EXTERN FILE *infile, *outfile, *bkuin, *bkuout;
  456.     EXTERN int ineof;
  457.  
  458. /* ---------------------------- GLOBALS ------------------------------- */
  459.