home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / code / microema.sit / src / edef.h < prev    next >
Encoding:
Text File  |  1989-06-09  |  10.9 KB  |  308 lines  |  [TEXT/Earl]

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