home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 198_01 / edef.h < prev    next >
C/C++ Source or Header  |  1990-01-23  |  14KB  |  337 lines

  1. /*    EDEF:        Global variable definitions for
  2.             MicroEMACS 3.9
  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. extern char *flook();
  12. extern char *getctext();
  13. extern char *getfname();
  14. extern char *getval();
  15. extern char *gtenv();
  16. extern char *gtfun();
  17. extern char *gtusr();
  18. extern char *itoa();
  19. extern char *ltos();
  20. extern char *malloc();
  21. extern char *mklower();
  22. extern char *mkupper();
  23. extern char *strcat();
  24. extern char *strcpy();
  25. extern char *strncpy();
  26. extern char *bytecopy();
  27. extern char *token();
  28. extern char *transbind();
  29. extern unsigned int getckey();
  30. extern unsigned int stock();
  31. extern char *fixnull();
  32. #if    BCOMPL
  33. extern BUFFER *tenexbuf();
  34. #endif
  35.  
  36. #ifdef    maindef
  37.  
  38. /* for MAIN.C */
  39.  
  40. /* initialized global definitions */
  41.  
  42. int     fillcol = 72;                   /* Current fill column          */
  43. short   kbdm[NKBDM];            /* Macro                        */
  44. char    *execstr = NULL;        /* pointer to string to execute    */
  45. char    golabel[NPAT] = "";        /* current line to go to    */
  46. int    execlevel = 0;            /* execution IF level        */
  47. int    eolexist = TRUE;        /* does clear to EOL exist    */
  48. int    revexist = FALSE;        /* does reverse video exist?    */
  49. int    isvt100 = FALSE;        /* vt100 compatible        */
  50. int    flickcode = FALSE;        /* do flicker supression?    */
  51. char    *modename[] = {            /* name of modes        */
  52.     "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER",
  53.     "MAGIC", "CRYPT", "ASAVE", "BINARY"};
  54. char    modecode[] = "WCSEVOMYAB";    /* letters to represent modes    */
  55. int    gmode = 0;            /* global editor mode        */
  56. int    gfcolor = 7;            /* global forgrnd color (white)    */
  57. int    gbcolor    = 0;            /* global backgrnd color (black)*/
  58. int    gasave = 256;            /* global ASAVE size        */
  59. int    gacount = 256;            /* count until next ASAVE    */
  60. int     sgarbf  = TRUE;                 /* TRUE if screen is garbage    */
  61. int     mpresf  = FALSE;                /* TRUE if message in last line */
  62. int    clexec    = FALSE;        /* command line execution flag    */
  63. int    mstore    = FALSE;        /* storing text to macro flag    */
  64. int    discmd    = TRUE;            /* display command flag        */
  65. int    disinp    = TRUE;            /* display input characters    */
  66. BUFFER    *bstore = NULL;            /* buffer to store macro text to*/
  67. int     vtrow   = 0;                    /* Row location of SW cursor */
  68. int     vtcol   = 0;                    /* Column location of SW cursor */
  69. int     ttrow   = HUGE;                 /* Row location of HW cursor */
  70. int     ttcol   = HUGE;                 /* Column location of HW cursor */
  71. int    lbound    = 0;            /* leftmost column of current line
  72.                        being displayed */
  73. int    taboff    = 0;            /* tab offset for display    */
  74. int    hscroll = MEMMAP;        /* horizontal scrolling flag    */
  75. int    hjump = 1;            /* horizontal jump size        */
  76. int    tabsize = 8;            /* tab offset for display    */
  77. int    stabsize = 0;            /* current soft tab size    */
  78. int    metac = CTRL | '[';        /* current meta character */
  79. int    ctlxc = CTRL | 'X';        /* current control X prefix char */
  80. int    reptc = CTRL | 'U';        /* current universal repeat char */
  81. int    abortc = CTRL | 'G';        /* current abort command char    */
  82.  
  83. int    quotec = 0x11;            /* quote char during mlreply() */
  84. char    *cname[] = {            /* names of colors        */
  85.     "BLACK", "RED", "GREEN", "YELLOW", "BLUE",
  86.     "MAGENTA", "CYAN", "WHITE"};
  87. KILL *kbufp  = NULL;        /* current kill buffer chunk pointer    */
  88. KILL *kbufh  = NULL;        /* kill buffer header pointer        */
  89. int kused = KBLOCK;        /* # of bytes used in kill buffer    */
  90. WINDOW *swindow = NULL;        /* saved window pointer            */
  91. int cryptflag = FALSE;        /* currently encrypting?        */
  92. short    *kbdptr;        /* current position in keyboard buf */
  93. short    *kbdend = &kbdm[0];    /* ptr to end of the keyboard */
  94. int    kbdmode = STOP;        /* current keyboard macro mode    */
  95. int    kbdrep = 0;        /* number of repetitions    */
  96. int    restflag = FALSE;    /* restricted use?        */
  97. int    lastkey = 0;        /* last keystoke        */
  98. int    seed = 0;        /* random number seed        */
  99. long    envram = 0l;    /* # of bytes current in use by malloc */
  100. int    macbug = FALSE;        /* macro debuging flag        */
  101. char    errorm[] = "ERROR";    /* error literal        */
  102. char    truem[] = "TRUE";    /* true literal            */
  103. char    falsem[] = "FALSE";    /* false litereal        */
  104. int    cmdstatus = TRUE;    /* last command status        */
  105. int    firstflag = TRUE;    /* first time            */
  106. char    palstr[49] = "";    /* palette string        */
  107. int    saveflag = 0;        /* Flags, saved with the $target var */
  108. char    *fline = NULL;        /* dynamic return line */
  109. int    flen = 0;        /* current length of fline */
  110. int    menuflag = FALSE;    /* menu mode */
  111. LINE    *menuline = NULL;    /* menu    line */
  112. int    ykchar = -1;        /* last deleted character */
  113. int    vt100keys = 0;        /* wait after escapes */
  114.  
  115. /* uninitialized global definitions */
  116.  
  117. int     currow;                 /* Cursor row                   */
  118. int     curcol;                 /* Cursor column                */
  119. int     thisflag;               /* Flags, this command          */
  120. int     lastflag;               /* Flags, last command          */
  121. int     curgoal;                /* Goal for C-P, C-N            */
  122. WINDOW  *curwp;                 /* Current window               */
  123. BUFFER  *curbp;                 /* Current buffer               */
  124. WINDOW  *wheadp;                /* Head of list of windows      */
  125. BUFFER  *bheadp;                /* Head of list of buffers      */
  126. BUFFER  *blistp;                /* Buffer for C-X C-B           */
  127. WINDOW    *spltwp;        /* New window created by split    */
  128.  
  129. extern BUFFER  *bfind();    /* Lookup a buffer by name      */
  130. extern WINDOW  *wpopup();    /* Pop up window creation       */
  131. extern LINE    *lalloc();    /* Allocate a line              */
  132.  
  133. char    sres[NBUFN];        /* current screen resolution    */
  134.  
  135. char    pat[NPAT];                      /* Search pattern        */
  136. char    tap[NPAT];            /* Reversed pattern array.    */
  137. char    rpat[NPAT];            /* replacement pattern        */
  138.  
  139. int    (*fkeytab[NFBIND])();    /* fast lookup table        */
  140. int    (*ffuncc)();        /* FUNC | 'C' hook        */
  141. KEYTAB    fkeylast;        /* last looked up key        */
  142.  
  143. unsigned int    frlen;            /* number of chars in fline */
  144.  
  145. char    mlline[NSTRING];    /* saved message line         */
  146. int    mllen;            /* length of saved message line    */
  147.  
  148. int    scrltop, scrlbot;    /* scrolling region */
  149. int    phrow;            /* physical terminal row */
  150.  
  151. /* The variable matchlen holds the length of the matched
  152.  * string - used by the replace functions.
  153.  * The variable patmatch holds the string that satisfies
  154.  * the search command.
  155.  * The variables matchline and matchoff hold the line and
  156.  * offset position of the start of match.
  157.  */
  158. unsigned int    mtchlen = 0;
  159. unsigned int    mlenold  = 0;
  160. char        *patmatch = NULL;
  161. LINE        *matchline = NULL;
  162. int        matchoff = 0;
  163.  
  164. #if    MAGIC
  165. /*
  166.  * The variable magical determines if there are actual
  167.  * metacharacters in the string - if not, then we don't
  168.  * have to use the slower MAGIC mode search functions.
  169.  */
  170. short        magical = FALSE;
  171. short        rmagical = FALSE;
  172. MC        mcpat[NPAT];        /* the magic pattern        */
  173. MC        tapcm[NPAT];        /* the reversed magic pattern    */
  174. RMC        rmcpat[NPAT];        /* the replacement magic array */
  175.  
  176. #endif
  177.  
  178. /* directive name table:
  179.     This holds the names of all the directives....    */
  180.  
  181. char *dname[] = {
  182.     "if", "else", "endif",
  183.     "goto", "return", "endm",
  184.     "while", "endwhile", "break",
  185.     "force"
  186. };
  187.  
  188. #if    DEBUGM
  189. /*    vars needed for macro debugging output    */
  190. char outline[NSTRING];        /* global string to hold debug line text */
  191. #endif
  192.  
  193. #else
  194.  
  195. /* for all the other .C files */
  196.  
  197. /* initialized global external declarations */
  198.  
  199. extern  int     fillcol;                /* Fill column                  */
  200. extern  short   kbdm[];                 /* Holds kayboard macro data    */
  201. extern  char    pat[];                  /* Search pattern               */
  202. extern    char    rpat[];            /* Replacement pattern        */
  203. extern    char    *execstr;        /* pointer to string to execute    */
  204. extern    char    golabel[];        /* current line to go to    */
  205. extern    int    execlevel;        /* execution IF level        */
  206. extern    int    eolexist;        /* does clear to EOL exist?    */
  207. extern    int    revexist;        /* does reverse video exist?    */
  208. extern    int    isvt100;        /* vt100 compatible        */
  209. extern    int    flickcode;        /* do flicker supression?    */
  210. extern    char *modename[];        /* text names of modes        */
  211. extern    char    modecode[];        /* letters to represent modes    */
  212. extern    KEYTAB keytab[];        /* key bind to functions table    */
  213. extern    NBIND names[];            /* name to function table    */
  214. extern    int    gmode;            /* global editor mode        */
  215. extern    int    gfcolor;        /* global forgrnd color (white)    */
  216. extern    int    gbcolor;        /* global backgrnd color (black)*/
  217. extern    int    gasave;            /* global ASAVE size        */
  218. extern    int    gacount;        /* count until next ASAVE    */
  219. extern  int     sgarbf;                 /* State of screen unknown      */
  220. extern  int     mpresf;                 /* Stuff in message line        */
  221. extern    int    clexec;            /* command line execution flag    */
  222. extern    int    mstore;            /* storing text to macro flag    */
  223. extern    int    discmd;            /* display command flag        */
  224. extern    int    disinp;            /* display input characters    */
  225. extern    BUFFER    *bstore;        /* buffer to store macro text to*/
  226. extern    int     vtrow;                  /* Row location of SW cursor */
  227. extern    int     vtcol;                  /* Column location of SW cursor */
  228. extern    int     ttrow;                  /* Row location of HW cursor */
  229. extern    int     ttcol;                  /* Column location of HW cursor */
  230. extern    int    lbound;            /* leftmost column of current line
  231.                        being displayed */
  232. extern    int    taboff;            /* tab offset for display    */
  233. extern    int    hscroll;        /* horizontal scrolling flag    */
  234. extern    int    hjump;            /* horizontal jump size        */
  235. extern    int    tabsize;        /* tab offset for display    */
  236. extern    int    stabsize;        /* current soft tab size    */
  237. extern    int    metac;            /* current meta character */
  238. extern    int    ctlxc;            /* current control X prefix char */
  239. extern    int    reptc;            /* current universal repeat char */
  240. extern    int    abortc;            /* current abort command char    */
  241.  
  242. extern    int    quotec;            /* quote char during mlreply() */
  243. extern    char    *cname[];        /* names of colors        */
  244. extern KILL *kbufp;            /* current kill buffer chunk pointer */
  245. extern KILL *kbufh;            /* kill buffer header pointer    */
  246. extern int kused;            /* # of bytes used in KB        */
  247. extern WINDOW *swindow;            /* saved window pointer        */
  248. extern int cryptflag;            /* currently encrypting?    */
  249. extern    short    *kbdptr;        /* current position in keyboard buf */
  250. extern    short    *kbdend;        /* ptr to end of the keyboard */
  251. extern    int kbdmode;            /* current keyboard macro mode    */
  252. extern    int kbdrep;            /* number of repetitions    */
  253. extern    int restflag;            /* restricted use?        */
  254. extern    int lastkey;            /* last keystoke        */
  255. extern    int seed;            /* random number seed        */
  256. extern    long envram;        /* # of bytes current in use by malloc */
  257. extern    int    macbug;            /* macro debuging flag        */
  258. extern    char    errorm[];        /* error literal        */
  259. extern    char    truem[];        /* true literal            */
  260. extern    char    falsem[];        /* false litereal        */
  261. extern    int    cmdstatus;        /* last command status        */
  262. extern    char    palstr[];        /* palette string        */
  263. extern    int    saveflag;        /* Flags, saved with the $target var */
  264. extern    char    *fline;            /* dynamic return line */
  265. extern    int    flen;            /* current length of fline */
  266. extern    int    firstflag;        /* first time            */
  267. extern    int    menuflag;        /* menu mode */
  268. extern    LINE    *menuline;        /* menu    line */
  269. extern    int    ykchar;            /* last deleted character */
  270. extern    int    vt100keys;        /* wait after escapes */
  271.  
  272. /* uninitialized global external declarations */
  273.  
  274. extern  int     currow;                 /* Cursor row                   */
  275. extern  int     curcol;                 /* Cursor column                */
  276. extern  int     thisflag;               /* Flags, this command          */
  277. extern  int     lastflag;               /* Flags, last command          */
  278. extern  int     curgoal;                /* Goal for C-P, C-N            */
  279. extern  WINDOW  *curwp;                 /* Current window               */
  280. extern  BUFFER  *curbp;                 /* Current buffer               */
  281. extern  WINDOW  *wheadp;                /* Head of list of windows      */
  282. extern  BUFFER  *bheadp;                /* Head of list of buffers      */
  283. extern  BUFFER  *blistp;                /* Buffer for C-X C-B           */
  284. extern    WINDOW    *spltwp;        /* New window created by split    */
  285.  
  286. extern  BUFFER  *bfind();               /* Lookup a buffer by name      */
  287. extern  WINDOW  *wpopup();              /* Pop up window creation       */
  288. extern  LINE    *lalloc();              /* Allocate a line              */
  289. extern    char    sres[NBUFN];        /* current screen resolution    */
  290. extern    char    pat[];                  /* Search pattern        */
  291. extern    char    tap[];            /* Reversed pattern array.    */
  292. extern    char    rpat[];            /* replacement pattern        */
  293.  
  294. extern    unsigned int    mtchlen;    /* length of found string    */
  295. extern    unsigned int    mlenold;    /* previous length of found str    */
  296. extern    char    *patmatch;        /* the found string        */
  297. extern    LINE    *matchline;        /* line pointer to found string    */
  298. extern    int    matchoff;        /* offset to the found string    */
  299.  
  300. extern    int    (*fkeytab[NFBIND])();    /* fast lookup table        */
  301. extern    int    (*ffuncc)();        /* FUNC | 'C' hook        */
  302. extern    KEYTAB    fkeylast;        /* last looked up key        */
  303.  
  304. extern    unsigned int    frlen;        /* number of chars in fline */
  305.  
  306. extern    char    mlline[NSTRING];    /* saved message line         */
  307. extern    int    mllen;            /* length of saved message line    */
  308.  
  309. extern    int    scrltop, scrlbot;    /* scrolling region */
  310. extern    int    phrow;            /* physical terminal row */
  311.  
  312. #if    MAGIC
  313.  
  314. extern    short        magical;    /* meta-characters in pattern?    */
  315. extern    short        rmagical;
  316. extern    MC        mcpat[];    /* the magic pattern        */
  317. extern    MC        tapcm[];    /* the reversed magic pattern    */
  318. extern    RMC        rmcpat[];    /* the replacement magic array */
  319.  
  320. #endif
  321.  
  322. extern char *dname[];            /* directive name table        */
  323.  
  324. #if    DEBUGM
  325. /*    vars needed for macro debugging output    */
  326. extern char outline[];        /* global string to hold debug line text */
  327. #endif
  328.  
  329. #endif
  330.  
  331. /* terminal table defined only in TERM.C */
  332.  
  333. #ifndef    termdef
  334. extern  TERM    term;                   /* Terminal information.        */
  335. #endif
  336.  
  337.