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