home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 178_01 / tvx_glbl.ic < prev    next >
Text File  |  1986-01-17  |  7KB  |  191 lines

  1. /* -------------------->>> tvx_glbl.ic <<<----------------------------- */
  2. /* ---------------   TVX global declarations   ------------------------ */
  3.  
  4. /*
  5.    Following trick allows only one file for externals.  If EXTERN is not
  6.    defined, then variables are decleared extern.  ONE module, tvlex.c,
  7.    defines EXTERN, and thus actually declares things.  If you need to
  8.    change one of these values (terminal definition, for example), then
  9.    only tvlex.c needs to be recompiled!
  10. */
  11. #ifndef EXTERN
  12. #define EXTERN extern
  13. #define USEEXTERN /**/
  14. #endif
  15.  
  16. /* constants defined within the next #ifndef area are the important
  17.    system values that define the terminal, margins, etc.  ALL variables
  18.    between begpatch and endpatch must be initialized for the MS-DOS cii-86
  19.    compiler to put them all in the same contiguous memory area.
  20.    This allows the tvconfig program to work properly to find the #####:
  21.    patch area patern.  This works on the C/80 CP/M version, too, but
  22.    has never been tried on unix since the termcap driver is normally used.
  23. */
  24.  
  25. #ifndef USEEXTERN
  26.     EXTERN char begpatch[6] = {'#','#','#','#','#',':'};
  27.  
  28. #include "tvx_term.ic"        /* include terminal definitions */
  29.  
  30. /* define standard command set */
  31.     EXTERN char lexsym[LEXVALUES+1] = { E0, 'r', 'l', 'd', 'u',
  32.       4, 21, 8, 'k', 'i', 11, '"', '\'', ',', '.', 'f', 6, 'p',
  33.       'b', 'e', 2, 'v', 'o', '/', 's', 'g', 23, 25, 24, ';', '&',
  34.       'm', ':', '=', 7, 9, '{', 'a', 16, '?', 'h', 20, 'c', 'j', 't',
  35.       'n', 14, 15, 5, 18, '#', '*','(', ')' };
  36.  
  37.     EXTERN char user_set[40] = "";        /* user search set */
  38.     EXTERN char use_wild = 1;            /* use wild cards by default */
  39.     EXTERN char old_cmds[16] = {0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 };
  40.     EXTERN int old_cindex = 0;            /* cursor into old_cmds */
  41.  
  42. #ifdef MSDOS
  43.     EXTERN char cfgname[40] = "-c=\\bin\\config.tvx";
  44. #endif
  45. #ifdef GEMDOS
  46.     EXTERN char cfgname[40] = "-c=config.tvx";
  47. #endif
  48. #ifdef UNIX
  49.     EXTERN char cfgname[40] = "-c=config.tvx";
  50. #endif
  51. #ifdef OSCPM
  52.     EXTERN char cfgname[40] = "-c=a:config.tvx";
  53. #endif
  54.     EXTERN int endpatch = 0;    /* to get address of end of patch area */
  55.  
  56. #else
  57.     EXTERN char begpatch[6];
  58.     EXTERN int addx,        /* amount to add to get x */
  59.     addy;            /* to get y */
  60.     EXTERN char cxychr;        /* true if convert xy bin to ascii */
  61.     EXTERN char cversn[12],    /* a version to identify config */
  62.     cxy1st,            /* l if line first, c if column 1st */
  63.     cxybeg[8],        /* start xy control seq */
  64.     cxymid[8],        /* middle xy control seq */
  65.     cxyend[8],        /* end sequence */
  66.     cerrbg[8],        /* string to print when errors start */
  67.     cerred[8],        /* when errors done */
  68.     ctopb[8],        /* top blanks = reverse linefeed */
  69.     cinit[20],        /* start up sequence */
  70.     cendit[20],        /* to end session */
  71.     cbotb[8],        /* bottom sequence */
  72.     celin[8],        /* erase to end of line */
  73.     cescr[8],        /* erase to end of screen */
  74.     ccsrcm[8],        /* set cursor to command mode */
  75.     ccsrin[8],        /* set cursor to insert mode */
  76.     ciline[8],        /* insert a line */
  77.     ckline[8],        /* kill a line */
  78.     cundlb[8],        /* turn on underline */
  79.     cundle[8],        /* turn off underline */
  80.     cboldb[8],        /* start bold */
  81.     cbolde[8];        /* end bold */
  82.  
  83.     EXTERN int ddline,dscrl,dxcase,usecz,autoin,logdef;
  84.     EXTERN char delkey;
  85.  
  86.     EXTERN int    tvlins,    /* number of lines on screen */
  87.         tvcols,    /* number of columns on screen */
  88.         tvhardlines,    /* real number of lines (for small window) */
  89.         tvx,    /* current x cursor position */
  90.         tvy,    /* current y cursor position */
  91.         tvdlin,    /* the "active" display line */
  92.         dsplin,    /* the default display line */
  93.         tabspc,    /* spacing for tabs */
  94.         leftmg,    /* left margin of display */
  95.         wraplm,    /* auto wrap? */
  96.         isibmpc; /* for possible use with a general version */
  97.  
  98.     EXTERN char synofr[20],    /* from table */
  99.     synoto[20];        /* translate to table */
  100.  
  101.     EXTERN char funkey,        /* leading char for function key */
  102.     funchar[50],    /* code sent by function key */
  103.     funcmd[50];    /* equivalent command */
  104.     EXTERN char lexsym[LEXVALUES+1];
  105.  
  106.     EXTERN char user_set[40],            /* wild matches */
  107.     use_wild;
  108.  
  109.     EXTERN char old_cmds[16];
  110.     EXTERN int old_cindex ;            /* cursor into old_cmds */
  111.  
  112.     EXTERN char cfgname[40];
  113.  
  114.     EXTERN int endpatch;    /* to get address of end of patch area */
  115. #endif
  116.  
  117.  
  118.     EXTERN int    bakpos,        /* used when building log file */
  119.         bakflg,        /* if writing to log file */
  120.         usebak,        /* if want to build a log file or not */
  121.         makebackup;    /* if want to retain backup .bak file */
  122.  
  123.     EXTERN BUFFINDEX nxtsav,    /* top of save buffer */
  124.         curchr,        /* pointer to current character */
  125.         nxtchr,        /* ptr to buff of next new chr */
  126.         mxbuff,        /* maximum number of chars in buff */
  127.         *lines;        /* line ptrs */
  128.  
  129.     EXTERN int     curlin,        /* pointer to current line */
  130.         nxtlin,        /* ptr to lines of next new line */
  131.         mxline;        /* maximum number of lines */
  132.  
  133.     EXTERN char *buff;        /* character and save buffer */
  134.  
  135. #ifdef NOALLOC
  136.     EXTERN int myline[MAXLINE+1];    /* the real line buffer */
  137.     EXTERN char mybuff[MAXBUFF+1];    /* the real buffer */
  138. #endif
  139.  
  140.     EXTERN int    oldlen,        /* length for '=' command */
  141.         savlin,        /* number of saved lines */
  142.         savlen;        /* line lenght of save buffer for rmvlst */
  143.  
  144.     EXTERN int    oldlex,        /* last commands lexical value */
  145.         oldcol,        /* beginning column for dwncol */
  146.         echof,        /* whether or not to echo action */
  147.         xcases,        /* exact case flag */
  148.         scroll;        /* scroll window */
  149.  
  150.     EXTERN int newfil;        /* YES if creating a new file */
  151.     EXTERN int rdonly;        /* YES if reading a file only */
  152.  
  153.     EXTERN char orig_file[FNAMESIZE+1],    /* original file */
  154.         source_file[FNAMESIZE+1], /* where file really is */
  155.         work_file[FNAMESIZE+1],    /* current working output file */
  156.         dest_file[FNAMESIZE+1];    /* ultimate name for file */
  157.  
  158.     EXTERN int    rptuse,            /* which repeat buffer currently active */
  159.         rptcnt[REPEATBUFS],    /* number of repeats left to do */
  160.         nxtrpt[REPEATBUFS],    /* pointer to next repeat character */
  161.         lstrpt[REPEATBUFS];    /* last good char in buffer */
  162.  
  163.     EXTERN char rptbuf[REPEATBUFS][102]; /* up to 100 chars in repeat loop */
  164.     EXTERN char sbuff[102];        /* search buffer */
  165.     EXTERN char pat_buff[102];        /* save the pattern */
  166.  
  167. /* other globals */
  168. #ifndef USEEXTERN
  169.     int slastl = 0;
  170. #else
  171.     extern int slastl;
  172. #endif
  173.  
  174.     EXTERN char unkbuf[130];
  175.  
  176.     EXTERN int useprint;    /* whether to print */
  177.     EXTERN int xoutcm;        /* used for 240 col virtual screen */
  178.     EXTERN int last_col_out;    /* last column output */
  179.     EXTERN int waserr;
  180.     EXTERN int blimit;        /* limit for read in buffer */
  181.     EXTERN int ttymode;        /* true if in tty mode */
  182.     EXTERN int ttynext;        /* cursor to next char from rdtty */
  183.     EXTERN int ins_mode;    /* true if insert mode */
  184.     EXTERN int force_tty;    /* for unix to force tty mode */
  185.  
  186.  
  187.     EXTERN FILE *infile, *outfile, *bkuin, *bkuout;
  188.     EXTERN int ineof;
  189.  
  190. /* ---------------------------- GLOBALS ------------------------------- */
  191.