home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 318_01 / redglb.c < prev    next >
C/C++ Source or Header  |  1990-06-18  |  3KB  |  124 lines

  1. /*
  2.     RED--Definitions of all global variables.
  3.  
  4.     Source:  redglb.c
  5.     Version: November 18, 1983; August 8, 1986; January 18, 1990.
  6.  
  7.     Written by
  8.     
  9.         Edward K. Ream
  10.         166 N. Prospect
  11.         Madison WI 53705
  12.         (608) 257-0802
  13.  
  14.  
  15.     PUBLIC DOMAIN SOFTWARE
  16.  
  17.     This software is in the public domain.
  18.  
  19.     See red.h for a disclaimer of warranties and other information.
  20. */
  21.  
  22. /*
  23.     Include red.h instead of just redbuf.h to get rid of the necessity
  24.     for multiple definitions of SYSFNMAX.
  25. */
  26.  
  27. #include "red.h"
  28.  
  29. /*
  30.     Define global file name.
  31. */
  32. char g_file [SYSFNMAX];        /* file name for (re)save */
  33.  
  34. /*
  35.     Define the global recovery point for disk errors.
  36. */
  37. jmp_buf DISK_ERR;
  38.  
  39. /*
  40.     Define globals used by the 'again' command.
  41. */
  42. int    a_start, a_end, again_flag, a_rev;
  43. int    a_rflag, a_wflag, a_cflag;
  44. char    a_spat [MAXLEN1], a_rpat [MAXLEN1];
  45.  
  46. /*
  47.     fmtcol[i] is the first column at which buf[i] is printed.
  48.     fmtsub() and fmtlen() assume fmtcol[] is valid on entry.
  49. */
  50. int fmtcol[MAXLEN1];
  51.  
  52. /*
  53.     Define globals used to describe the terminal.
  54.     At present,  they are set by the outinit routine,
  55.     but the sysinit routine would be a better place if
  56.     you want to support multiple terminals without
  57.     recompiling RED.
  58. */
  59. int    hasdn;     /* has scroll down            */
  60. int    hasup;     /* has scroll up            */
  61. int    hasins;     /* has insert line (ABOVE current line)*/
  62. int    hasdel;     /* has delete line            */
  63. int    hasint;     /* use interrupt driven screen        */
  64. int    hascol;     /* put columns on prompt line        */
  65. int    haswrap; /* enables line wrapping        */
  66. int    hasword; /* restricts matches to word boundaries*/
  67.  
  68. /*
  69.     Define the current location of the cursor.
  70. */
  71. int    outx;
  72. int    outy;
  73.  
  74. /*
  75.     Allocate memory for variables global to the
  76.     buffer routines.
  77. */
  78. int    DATA_RES;    /* pseudo constant        */
  79.             /* no greater than MAX_RES    */
  80.  
  81. int    b_fatal;    /* clear buffer on error    */
  82. int    b_cflag;    /* buffer changed flag        */
  83.  
  84. int    b_line;        /* current line number        */
  85. int    b_max_line;    /* highest line number        */
  86. int    b_start;    /* first line of current block    */
  87.  
  88. int    b_head;        /* # of first disk block    */
  89. int    b_tail;        /* # of last disk block        */
  90.  
  91. int    b_max_diskp;    /* last block allocated        */
  92. int    b_max_put;    /* last block written        */
  93.  
  94. int    b_data_fd;    /* file descriptor of data file    */
  95. int    b_user_fd;    /* file descriptor of user file    */
  96. int    b_free;        /* head of list of free blocks    */
  97.  
  98. struct BLOCK * b_bp;    /* mem pointer to current block    */
  99.  
  100. /*
  101.     Define an array of pointers to each slot.
  102.     The DATA_RES pseudo constant tells how many
  103.     slots have actually been allocated.
  104. */
  105. struct BLOCK * b_bpp [MAX_RES];
  106.  
  107. /*
  108.     Define variables used only by read_file() and read1().
  109.     They are used to speed up the code.
  110. */
  111. char *    br_bufp;    /* pointer to input buffer    */
  112. int    br_bufc;    /* number of current buffer    */
  113. int    br_count;    /* index into input buffer    */
  114.  
  115. int    br_avail;    /* number of free characters    */
  116. int    br_out;        /* index into outbuf        */
  117.  
  118. /*
  119.     Define variables used only by write_file() and write1().
  120.     They are used to speed up the code.
  121. */
  122.  
  123. int    bw_count;    /* index into buffer        */
  124.