home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 001-099 / ff093.lzh / MicroEmacs / source / src.arc / edef.h < prev    next >
C/C++ Source or Header  |  1987-08-16  |  11KB  |  250 lines

  1. /*    EDEF:        Global variable definitions for
  2.             MicroEMACS 3.2
  3.  
  4.             written by Dave G. Conroy
  5.             modified by Steve Wilhite, George Jones
  6.             greatly modified by Daniel Lawrence
  7. */
  8.  
  9. /* some global fuction declarations */
  10.  
  11. char *malloc();
  12. char *strcpy();
  13. char *strcat();
  14. char *strncpy();
  15. char *itoa();
  16. char *getval();
  17. char *gtenv();
  18. char *gtusr();
  19. char *gtfun();
  20. char *token();
  21. char *ltos();
  22. char *flook();
  23. char *mkupper();
  24. char *mklower();
  25. unsigned int getckey();
  26.  
  27. #ifdef    maindef
  28.  
  29. /* for MAIN.C */
  30.  
  31. /* initialized global definitions */
  32.  
  33. int     fillcol = 72;                   /* Current fill column          */
  34. short   kbdm[NKBDM];            /* Macro                        */
  35. char    *execstr = NULL;        /* pointer to string to execute    */
  36. char    golabel[NPAT] = "";        /* current line to go to    */
  37. int    execlevel = 0;            /* execution IF level        */
  38. int    eolexist = TRUE;        /* does clear to EOL exist    */
  39. int    revexist = FALSE;        /* does reverse video exist?    */
  40. int    flickcode = FALSE;        /* do flicker supression?    */
  41. char    *modename[] = {            /* name of modes        */
  42.     "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER",
  43.     "MAGIC", "CRYPT", "ASAVE"};
  44. char    modecode[] = "WCSEVOMYA";    /* letters to represent modes    */
  45. int    gmode = 0;            /* global editor mode        */
  46. int    gfcolor = 7;            /* global forgrnd color (white)    */
  47. int    gbcolor    = 0;            /* global backgrnd color (black)*/
  48. int    gasave = 256;            /* global ASAVE size        */
  49. int    gacount = 256;            /* count until next ASAVE    */
  50. int     sgarbf  = TRUE;                 /* TRUE if screen is garbage    */
  51. int     mpresf  = FALSE;                /* TRUE if message in last line */
  52. int    clexec    = FALSE;        /* command line execution flag    */
  53. int    mstore    = FALSE;        /* storing text to macro flag    */
  54. int    discmd    = TRUE;            /* display command flag        */
  55. int    disinp    = TRUE;            /* display input characters    */
  56. struct    BUFFER *bstore = NULL;        /* buffer to store macro text to*/
  57. int     vtrow   = 0;                    /* Row location of SW cursor */
  58. int     vtcol   = 0;                    /* Column location of SW cursor */
  59. int     ttrow   = HUGE;                 /* Row location of HW cursor */
  60. int     ttcol   = HUGE;                 /* Column location of HW cursor */
  61. int    lbound    = 0;            /* leftmost column of current line
  62.                        being displayed */
  63. int    taboff    = 0;            /* tab offset for display    */
  64. int    metac = CTRL | '[';        /* current meta character */
  65. int    ctlxc = CTRL | 'X';        /* current control X prefix char */
  66. int    reptc = CTRL | 'U';        /* current universal repeat char */
  67. int    abortc = CTRL | 'G';        /* current abort command char    */
  68.  
  69. int    quotec = 0x11;            /* quote char during mlreply() */
  70. char    *cname[] = {            /* names of colors        */
  71.     "BLACK", "RED", "GREEN", "YELLOW", "BLUE",
  72.     "MAGENTA", "CYAN", "WHITE"};
  73. KILL *kbufp  = NULL;        /* current kill buffer chunk pointer    */
  74. KILL *kbufh  = NULL;        /* kill buffer header pointer        */
  75. int kused = KBLOCK;        /* # of bytes used in kill buffer    */
  76. WINDOW *swindow = NULL;        /* saved window pointer            */
  77. int cryptflag = FALSE;        /* currently encrypting?        */
  78. short    *kbdptr;        /* current position in keyboard buf */
  79. short    *kbdend = &kbdm[0];    /* ptr to end of the keyboard */
  80. int    kbdmode = STOP;        /* current keyboard macro mode    */
  81. int    kbdrep = 0;        /* number of repetitions    */
  82. int    restflag = FALSE;    /* restricted use?        */
  83. int    lastkey = 0;        /* last keystoke        */
  84. int    seed = 0;        /* random number seed        */
  85. long    envram = 0l;    /* # of bytes current in use by malloc */
  86. int    macbug = FALSE;        /* macro debuging flag        */
  87. char    errorm[] = "ERROR";    /* error literal        */
  88. char    truem[] = "TRUE";    /* true literal            */
  89. char    falsem[] = "FALSE";    /* false litereal        */
  90. int    cmdstatus = TRUE;    /* last command status        */
  91. char    palstr[49] = "";    /* palette string        */
  92.  
  93. /* uninitialized global definitions */
  94.  
  95. int     currow;                 /* Cursor row                   */
  96. int     curcol;                 /* Cursor column                */
  97. int     thisflag;               /* Flags, this command          */
  98. int     lastflag;               /* Flags, last command          */
  99. int     curgoal;                /* Goal for C-P, C-N            */
  100. WINDOW  *curwp;                 /* Current window               */
  101. BUFFER  *curbp;                 /* Current buffer               */
  102. WINDOW  *wheadp;                /* Head of list of windows      */
  103. BUFFER  *bheadp;                /* Head of list of buffers      */
  104. BUFFER  *blistp;                /* Buffer for C-X C-B           */
  105.  
  106. BUFFER  *bfind();               /* Lookup a buffer by name      */
  107. WINDOW  *wpopup();              /* Pop up window creation       */
  108. LINE    *lalloc();              /* Allocate a line              */
  109. char    sres[NBUFN];        /* current screen resolution    */
  110.  
  111. char    pat[NPAT];                      /* Search pattern        */
  112. char    tap[NPAT];            /* Reversed pattern array.    */
  113. char    rpat[NPAT];            /* replacement pattern        */
  114.  
  115. /* The variable matchlen holds the length of the matched
  116.  * string - used by the replace functions.
  117.  * The variable patmatch holds the string that satisfies
  118.  * the search command.
  119.  * The variables matchline and matchoff hold the line and
  120.  * offset position of the start of match.
  121.  */
  122. unsigned int    matchlen = 0;
  123. unsigned int    mlenold  = 0;
  124. char        *patmatch = NULL;
  125. LINE        *matchline = NULL;
  126. int        matchoff = 0;
  127.  
  128. #if    MAGIC
  129. /*
  130.  * The variable magical determines if there are actual
  131.  * metacharacters in the string - if not, then we don't
  132.  * have to use the slower MAGIC mode search functions.
  133.  */
  134. short int    magical = FALSE;
  135. MC        mcpat[NPAT];        /* the magic pattern        */
  136. MC        tapcm[NPAT];        /* the reversed magic pattern    */
  137.  
  138. #endif
  139.  
  140. #else
  141.  
  142. /* for all the other .C files */
  143.  
  144. /* initialized global external declarations */
  145.  
  146. extern  int     fillcol;                /* Fill column                  */
  147. extern  short   kbdm[];                 /* Holds kayboard macro data    */
  148. extern  char    pat[];                  /* Search pattern               */
  149. extern    char    rpat[];            /* Replacement pattern        */
  150. extern    char    *execstr;        /* pointer to string to execute    */
  151. extern    char    golabel[];        /* current line to go to    */
  152. extern    int    execlevel;        /* execution IF level        */
  153. extern    int    eolexist;        /* does clear to EOL exist?    */
  154. extern    int    revexist;        /* does reverse video exist?    */
  155. extern    int    flickcode;        /* do flicker supression?    */
  156. extern    char *modename[];        /* text names of modes        */
  157. extern    char    modecode[];        /* letters to represent modes    */
  158. extern    KEYTAB keytab[];        /* key bind to functions table    */
  159. extern    NBIND names[];            /* name to function table    */
  160. extern    int    gmode;            /* global editor mode        */
  161. extern    int    gfcolor;        /* global forgrnd color (white)    */
  162. extern    int    gbcolor;        /* global backgrnd color (black)*/
  163. extern    int    gasave;            /* global ASAVE size        */
  164. extern    int    gacount;        /* count until next ASAVE    */
  165. extern  int     sgarbf;                 /* State of screen unknown      */
  166. extern  int     mpresf;                 /* Stuff in message line        */
  167. extern    int    clexec;            /* command line execution flag    */
  168. extern    int    mstore;            /* storing text to macro flag    */
  169. extern    int    discmd;            /* display command flag        */
  170. extern    int    disinp;            /* display input characters    */
  171. extern    struct    BUFFER *bstore;        /* buffer to store macro text to*/
  172. extern    int     vtrow;                  /* Row location of SW cursor */
  173. extern    int     vtcol;                  /* Column location of SW cursor */
  174. extern    int     ttrow;                  /* Row location of HW cursor */
  175. extern    int     ttcol;                  /* Column location of HW cursor */
  176. extern    int    lbound;            /* leftmost column of current line
  177.                        being displayed */
  178. extern    int    taboff;            /* tab offset for display    */
  179. extern    int    metac;            /* current meta character */
  180. extern    int    ctlxc;            /* current control X prefix char */
  181. extern    int    reptc;            /* current universal repeat char */
  182. extern    int    abortc;            /* current abort command char    */
  183.  
  184. extern    int    quotec;            /* quote char during mlreply() */
  185. extern    char    *cname[];        /* names of colors        */
  186. extern KILL *kbufp;            /* current kill buffer chunk pointer */
  187. extern KILL *kbufh;            /* kill buffer header pointer    */
  188. extern int kused;            /* # of bytes used in KB        */
  189. extern WINDOW *swindow;            /* saved window pointer        */
  190. extern int cryptflag;            /* currently encrypting?    */
  191. extern    short    *kbdptr;        /* current position in keyboard buf */
  192. extern    short    *kbdend;        /* ptr to end of the keyboard */
  193. extern    int kbdmode;            /* current keyboard macro mode    */
  194. extern    int kbdrep;            /* number of repetitions    */
  195. extern    int restflag;            /* restricted use?        */
  196. extern    int lastkey;            /* last keystoke        */
  197. extern    int seed;            /* random number seed        */
  198. extern    long envram;        /* # of bytes current in use by malloc */
  199. extern    int    macbug;            /* macro debuging flag        */
  200. extern    char    errorm[];        /* error literal        */
  201. extern    char    truem[];        /* true literal            */
  202. extern    char    falsem[];        /* false litereal        */
  203. extern    int    cmdstatus;        /* last command status        */
  204. extern    char    palstr[];        /* palette string        */
  205.  
  206. /* uninitialized global external declarations */
  207.  
  208. extern  int     currow;                 /* Cursor row                   */
  209. extern  int     curcol;                 /* Cursor column                */
  210. extern  int     thisflag;               /* Flags, this command          */
  211. extern  int     lastflag;               /* Flags, last command          */
  212. extern  int     curgoal;                /* Goal for C-P, C-N            */
  213. extern  WINDOW  *curwp;                 /* Current window               */
  214. extern  BUFFER  *curbp;                 /* Current buffer               */
  215. extern  WINDOW  *wheadp;                /* Head of list of windows      */
  216. extern  BUFFER  *bheadp;                /* Head of list of buffers      */
  217. extern  BUFFER  *blistp;                /* Buffer for C-X C-B           */
  218.  
  219. extern  BUFFER  *bfind();               /* Lookup a buffer by name      */
  220. extern  WINDOW  *wpopup();              /* Pop up window creation       */
  221. extern  LINE    *lalloc();              /* Allocate a line              */
  222. extern    char    sres[NBUFN];        /* current screen resolution    */
  223. extern    char    pat[];                  /* Search pattern        */
  224. extern    char    tap[];            /* Reversed pattern array.    */
  225. extern    char    rpat[];            /* replacement pattern        */
  226.  
  227. extern    unsigned int    matchlen;    /* length of found string    */
  228. extern    unsigned int    mlenold;    /* previous length of found str    */
  229. extern    char    *patmatch;        /* the found string        */
  230. extern    LINE    *matchline;        /* line pointer to found string    */
  231. extern    int    matchoff;        /* offset to the found string    */
  232.  
  233. #if    MAGIC
  234.  
  235. extern    short int    magical;    /* meta-characters in pattern?    */
  236. extern    MC        mcpat[];    /* the magic pattern        */
  237. extern    MC        tapcm[];    /* the reversed magic pattern    */
  238.  
  239. #endif
  240.  
  241. #endif
  242.  
  243. /* terminal table defined only in TERM.C */
  244.  
  245. #ifndef    termdef
  246. extern  TERM    term;                   /* Terminal information.        */
  247. #endif
  248.  
  249.  
  250.