home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / memacs32.zip / h / estruct.h < prev    next >
C/C++ Source or Header  |  1994-03-09  |  36KB  |  1,132 lines

  1. /*    ESTRUCT:    Structure and preprocesser defined for
  2.             MicroEMACS 3.12
  3.  
  4.             (C)Copyright 1993 by Daniel Lawrence
  5.             written by Daniel Lawrence
  6.             based on code by Dave G. Conroy,
  7.                 Steve Wilhite and George Jones
  8. */
  9.  
  10. #ifdef    LATTICE
  11. #undef    LATTICE      /* don't use their definitions...use ours     */
  12. #endif
  13. #ifdef    MSDOS
  14. #undef    MSDOS
  15. #endif
  16. #ifdef    WINNT
  17. #undef    WINNT
  18. #endif
  19. #ifdef    AMIGA
  20. #undef    AMIGA
  21. #endif
  22. #ifdef    EGA
  23. #undef    EGA
  24. #endif
  25. #ifdef    CTRLZ
  26. #undef    CTRLZ
  27. #endif
  28.  
  29. /*    Program Identification.....
  30.  
  31.     PROGNAME should always be MicroEMACS for a distribution
  32.     unmodified version. People using MicroEMACS as a shell
  33.     for other products should change this to reflect their
  34.     product. Macros can query this via the $progname variable
  35. */
  36.  
  37. #define PROGNAME    "MicroEMACS"
  38. #define VERSION     "3.12"
  39.  
  40. /*    Machine/OS definitions            */
  41. /*    [Set one of these!!]            */
  42.  
  43. #define AMIGA    0            /* AmigaDOS            */
  44. #define AOSVS    0            /* Data General AOS/VS        */
  45. #define AUX     0                       /* Apple UNIX for Macintosh     */
  46. #define AVIION    0            /* Data General AViiON        */
  47. #define BSD    0            /* UNIX BSD 4.2 and ULTRIX    */
  48. #define FINDER    0            /* Macintosh OS         */
  49. #define HPUX8    0            /* HPUX HP 9000 ver 8 or less    */
  50. #define HPUX9    0            /* HPUX HP 9000 ver 9           */
  51. #define MPE    0            /* HP MPE/XL            */
  52. #define MSDOS    0            /* MS-DOS            */
  53. #define WINNT    0            /* MS-Win NT            */
  54. #define OS2    0            /* Microsoft or IBM OS/2    */
  55. #define SMOS    0            /* Supermax UNIX System V    */
  56. #define SUN    0            /* SUN v4.0            */
  57. #define TOS    0            /* ST520, TOS            */
  58. #define USG    1            /* UNIX system V        */
  59. #define V7    0            /* V7 UNIX or Coherent or BSD4.2*/ 
  60. #define VMS    0            /* VAX/VMS            */
  61. #define WMCS    0            /* Wicat's MCS            */
  62. #define XENIX    0            /* IBM-PC SCO XENIX        */
  63. #define LINUX   1
  64.  
  65. /*    Compiler definitions            */
  66. /*    [Set one of these!!]            */
  67. #define ALCYON    0    /* ALCYON Atari ST compiler */ 
  68. #define AZTEC    0    /* Aztec C 3.20e */
  69. #define DGC    0    /* Data General AOS/VS C... */
  70. #define DTL    0    /* DataLight C v3.12 */
  71. #define GCC    1    /* the GNU C compiler */
  72. #define IC    0    /* Rational Systems Instant C */
  73. #define LATTICE 0    /* Lattice 2.14 through 3.0 compilers */
  74. #define MSC    0    /* MicroSoft C compile version 3 thru 7 */
  75. #define MWC    0    /* Mark Williams C */
  76. #define TURBO    0    /* Turbo C and Borland C++ under MSDOS */
  77. #define UNIX    0    /* a standard UNIX compiler (cc) */
  78. #define ZTC    0    /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */
  79.  
  80. /*    Machine stack growth direction.             */
  81. /*  [Set this to 1 if your machine stack grows UP!!!]        */
  82. /*    data general mv/eclipse series stack grows up.        */
  83. /*    dec vax series stack grows down... got it???        */
  84.  
  85. #define STACK_GROWS_UP    0
  86.  
  87. /*    Rational Systems, Inc DOS/16M dos extender allows MicroEMACS
  88.     to run in Protected Mode under MSDOS. It has a few special
  89.     requirements.                            */
  90.  
  91. #define    DOS16M    0
  92.  
  93. /*    Debugging options    */
  94. #define RAMSIZE 0    /* dynamic RAM memory usage tracking */
  95. #define RAMSHOW 0    /* auto dynamic RAM reporting */
  96. #define RAMTRCK 0    /* send debug info to MALLOC.DAT */
  97.  
  98. /*   Special keyboard/network definitions         */
  99.  
  100. #define ATKBD    1        /* AT-style keyboard with F11, F12 & grey keys */
  101. #define WANGPC    0        /* WangPC - mostly escape sequences    */
  102. #define VT100    0        /* Handle VT100 style keypad - NOT VMS. */
  103. #define KEYPAD    0        /* VMS - turn on and off application    */
  104.                 /* keypad automatically */
  105. #define XONDATA 0        /* VMS - set to force /NOTTSYNC/NOHOSTSY */
  106. #define RMSIO    0        /* VMS - skip the rotten C runtime and    */
  107.                 /* use RMS directly            */
  108. #define OPTMEM    0        /* VMS 5.0 and up - use a less standard */
  109.                 /* but more efficient memory allocator    */
  110.  
  111. /*    Terminal Output definitions        */
  112. /*    [Set one of these!!]            */
  113.  
  114. #define ANSI    0            /* ANSI escape sequences    */
  115. #define DASHER    0            /* DG Dasher 2xx/4xx crts    */
  116. #define DG10    0            /* Data General system/10    */
  117. #define FMR    0            /* Fujitsu FMR series driver    */
  118. #define HP110    0            /* HP110 screen driver        */
  119. #define HP150    0            /* HP150 screen driver        */
  120. #define I55    0            /* IBM PS55 DOS J4.0/V        */
  121. #define IBMPC    0            /* IBM-PC CGA/MONO/EGA/VGA drvr */
  122. #define MAC    0            /* Macintosh            */
  123. #define NEC    0            /* NEC-9801VM driver        */
  124. #define OS2NPM    0            /* OS/2 non-Presentation Mgr.    */
  125. #define SMG    0            /* SMG library on VMS        */
  126. #define ST52    0            /* Atari 520/1040ST screen    */
  127. #define TERMCAP 1            /* Use TERMCAP            */
  128. #define TIPC    0            /* TI Profesional PC driver    */
  129. #define VT52    0            /* VT52 terminal (Zenith).    */
  130. #define Z309    0            /* Zenith 100 PC family driver    */
  131. #define WINNTCON 0            /* Windows NT console        */
  132.  
  133. /*    Windowing system style (pick one)                */
  134.  
  135. #define WINDOW_TEXT    1        /* [default] Text mode        */
  136. #define WINDOW_XVT    0        /* using XVT/any platform    */
  137. #define WINDOW_MSWIN    0        /* MicroSoft Windows        */
  138. #define WINDOW_MSWIN32    0        /* MicroSoft Windows 32 bit API */
  139. #define WINDOW_X    0        /* X/Unix            */
  140.  
  141. /*    Language text options    (pick one)                */
  142.  
  143. #define ENGLISH 1        /* [default] */
  144. #define FRENCH    0
  145. #define SPANISH 0
  146. #define GERMAN    0
  147. #define DUTCH    0
  148. #define PLATIN    0        /* Pig Latin */
  149. #define JAPAN    0
  150. #define LATIN    0        /* real Latin */
  151.  
  152. /*    Configuration options    */
  153.  
  154. #define TYPEAH    1    /* type ahead causes update to be skipped    */
  155. #define DEBUGM    1    /* $debug triggers macro debugging        */
  156. #define LOGFLG    0    /* send all executed commands to EMACS.LOG    */
  157. #define VISMAC    0    /* update display during keyboard macros    */
  158. #define CTRLZ    0    /* add a ^Z at end of files under MSDOS only    */
  159. #define CLEAN    0    /* de-alloc memory on exit            */
  160. #define CALLED    0    /* is emacs a called subroutine? or stand alone */
  161.  
  162. #define REVSTA    1    /* Status line appears in reverse video     */
  163. #define COLOR    1    /* color commands and windows            */
  164.  
  165. #define FILOCK    0    /* file locking under unix BSD 4.2        */
  166. #define ISRCH    1    /* Incremental searches like ITS EMACS        */
  167. #define FLABEL    0    /* function key label code [HP150]        */
  168. #define CRYPT    1    /* file encryption enabled?            */
  169. #define MAGIC    1    /* include regular expression matching?     */
  170. #define MOUSE    1    /* Include routines for mouse actions        */
  171. #define NOISY    1    /* Use a fancy BELL if it exists        */
  172. #define CTAGS    0    /* include vi-like tagging?            */
  173. #define SPEECH    0    /* spoken EMACS, for the sight impared [not ready] */
  174. #define VARARG    1    /* use varargs.h for mlwrite()            */
  175.  
  176. /*    Character set options        */
  177. /*    [Set one of these!!]        */
  178. #define ASCII    1    /* always using ASCII char sequences for now    */
  179. #define EBCDIC    0    /* later IBM mainfraim versions will use EBCDIC */
  180.  
  181. /* handle constant and voids properly */
  182.  
  183. #if    VMS
  184. #define CONST    readonly
  185. #define VOID    void
  186. #define NOSHARE noshare
  187. #else
  188. #if    AOSVS
  189. #define CONST $shared $align(1)     /* fake a  const */
  190. #define VOID
  191. #define NOSHARE $low32k $align(1)   /* attempt to optimize read/write vars. */
  192. #else
  193. #if    __STDC__ || MSC || TURBO || DTL || GCC
  194. #define CONST    const
  195. #define VOID    void
  196. #define NOSHARE
  197. #else
  198. #define CONST
  199. #define VOID
  200. #define NOSHARE
  201. #endif
  202. #endif
  203. #endif
  204.  
  205. /*    System dependant library redefinitions, structures and includes */
  206.  
  207. /*    multibyte character support?    */
  208.  
  209. #if    NEC || FMR || I55
  210. #define DBCS    1    /* double byte character sets enabled */
  211. #define INSDEL    1    /* use insert/delete line display optimizations */
  212.  
  213. /* define DBCS prefix bytes */
  214. #define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc))
  215.  
  216. #else
  217. #define DBCS    0
  218. #define INSDEL    0
  219. #endif
  220.  
  221. /*    Prototypes in use?    */
  222.  
  223. #if    MSC || TURBO || IC || DTL || VMS || GCC || ZTC
  224. #define PROTO    1
  225. #else
  226. #define PROTO    0
  227. #endif
  228.  
  229. /*    the following define allows me to initialize unions...
  230.     otherwise we make them structures (like the keybinding table)  */
  231.  
  232. #if    __STDC__ || MSC || TURBO || IC || DTL || ZTC
  233. #define ETYPE    union
  234. #else
  235. #define ETYPE    struct
  236. #endif
  237.  
  238. /* Instant C can't do stat()s. Arrrg. No file locking for you */
  239. #if    IC && MSDOS
  240. #undef FILOCK
  241. #define FILOCK    0
  242. #endif
  243.  
  244. /* Mark Williams/Atari has no standard or varargs or directory functions */
  245. #if    TOS & MWC
  246. #undef VARARG
  247. #define    VARARG    0
  248. #undef    FILOCK
  249. #define    FILOCK    0
  250. #endif
  251.  
  252. /* MS-Windows */
  253.  
  254. #if     WINNT || WINDOW_MSWIN || WINDOW_MSWIN32
  255. #if     WINDOW_MSWIN32
  256. #undef  WINDOW_MSWIN
  257. #define WINDOW_MSWIN    1
  258. #endif
  259. #if     WINDOW_MSWIN && WINNT
  260. #undef  WINDOW_MSWIN32
  261. #define WINDOW_MSWIN32  1
  262. #endif
  263. #undef  VOID    /* windows.h will wind up defining this */
  264. #include <windows.h>    /* --------- Huge include file here !!! ---------*/
  265. #if     WINNTCON
  266. #include <wincon.h>
  267. #include <stdio.h>
  268. #include <dos.h>
  269. #endif
  270.  
  271. #undef NEAR
  272. #define NEAR
  273. #define DNEAR
  274. #if     MSC || IC
  275. #undef CDECL
  276. #define CDECL   __cdecl
  277. #define DUMMYSZ 1    /* dummy size for unsized extern arrays to avoid
  278.                         silly DGROUP fixup */
  279. #else
  280. #if    TURBO
  281. #define DUMMYSZ     /* nothing */
  282. #else
  283. #define CDECL   _cdecl  /* ZTC */
  284. #define DUMMYSZ     /* nothing */
  285. #endif
  286. #endif
  287.  
  288. #if    WINNT
  289. #define    EXPORT    /* Windows NT doesn't like this */
  290. #endif
  291.  
  292. #if     WINDOW_MSWIN
  293. #undef  TYPEAH
  294. #define TYPEAH  0   /* typeahead is handled at the term driver level */
  295. #undef  CALLED
  296. #define CALLED  1   /* under MS Windows, "main" resides in the sys driver */
  297. #if     MSC
  298. #define EXPORT  __export
  299. #else
  300. #define EXPORT  _export    /* Fine for TURBO and ZTC */
  301. #endif
  302. #endif
  303. #else
  304.  
  305. /* neither Windows NT nor MS-Windows */
  306.  
  307. #define DUMMYSZ     /* nothing */
  308.  
  309. #if MSDOS & (TURBO | MSC | TIPC)
  310. #define    NEAR
  311. #define    DNEAR
  312. #define    PASCAL pascal
  313. #define    CDECL cdecl
  314. #else
  315. #if MSDOS & ZTC
  316. #define    NEAR
  317. #define    DNEAR
  318. #define    PASCAL _pascal
  319. #define    CDECL _cdecl
  320. #else
  321. #define NEAR
  322. #define    DNEAR
  323. #define    PASCAL
  324. #define    CDECL
  325. #endif
  326. #endif
  327.  
  328. #endif
  329.  
  330. #if    TURBO
  331. #include      <dos.h>
  332. #include      <mem.h>
  333. #undef peek
  334. #undef poke
  335. #define       peek(a,b,c,d)   movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  336. #define       poke(a,b,c,d)   movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  337. #endif
  338.  
  339. #if    IC
  340. #include      <dos.h>
  341. #undef peek
  342. #undef poke
  343. #define       peek(a,b,c,d)   movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  344. #define       poke(a,b,c,d)   movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  345. #endif
  346.  
  347. #if    LATTICE & MSDOS
  348. /* you may have to remove this one definition with LATTICE version
  349.    3.2 and above                          */
  350. #define unsigned
  351. #endif
  352.  
  353. #if    IC
  354. #define inp    inportb
  355. #define outp    outportb
  356. #define intdos(a, b)    int86(33, a, b)
  357. #endif
  358.  
  359. #if    AZTEC
  360. #undef    putc
  361. #undef    getc
  362. #if    MSDOS
  363. #define getc    a1getc
  364. #define int86    sysint
  365. #define intdos(a, b)    sysint(33, a, b)
  366. #define inp    inportb
  367. #define outp    outportb
  368. #else
  369. #define getc    agetc
  370. #endif
  371. #define putc    aputc
  372.  
  373. struct XREG {
  374.     unsigned ax,bx,cx,dx,si,di,ds,es;
  375. };
  376.  
  377. struct HREG {
  378.     char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2;
  379. };
  380.  
  381. union REGS {
  382.     struct XREG x;
  383.     struct HREG h;
  384. };
  385.  
  386. struct SREGS {
  387.     unsigned cs, ss, ds, es;
  388. };
  389. #endif
  390.  
  391. #if    MSDOS & DTL
  392. #include    <dos.h>
  393. #endif
  394.  
  395. #if    MSDOS & MWC
  396. #include    <dos.h>
  397. #define int86(a, b, c)    intcall(b, c, a)
  398. #define intdos(a, b)    intcall(a, b, DOSINT)
  399. #define inp(a)        in(a)
  400. #define outp(a, b)    out(a, b)
  401. #define movmem(a, b, c) memcpy(b, a, c)
  402.  
  403. struct XREG {
  404.     unsigned int ax,bx,cx,dx,si,di,ds,es,flags;
  405. };
  406.  
  407. struct HREG {
  408.     char al,ah,bl,bh,cl,ch,dl,dh;
  409.     unsigned int ds,es,flags;
  410. };
  411.  
  412. union REGS {
  413.     struct XREG x;
  414.     struct HREG h;
  415. };
  416. #endif
  417.  
  418. #if    MSDOS & MSC
  419. #include    <dos.h>
  420. #include    <memory.h>
  421. #define peek(a,b,c,d)    movedata(a,b,FP_SEG(c),FP_OFF(c),d)
  422. #define poke(a,b,c,d)    movedata(FP_SEG(c),FP_OFF(c),a,b,d)
  423. #define movmem(a, b, c)     memcpy(b, a, c)
  424. #endif
  425.  
  426. #if    MSDOS & LATTICE
  427. #undef    CPM
  428. #undef    LATTICE
  429. #include    <dos.h>
  430. #undef    CPM
  431. #endif
  432.  
  433. /* System V doesn't name this the same as others */
  434. #if    USG | AUX | SUN | (OS2 & MSC)
  435. #define movmem(a, b, c)     memcpy(b, a, c)
  436. #endif
  437.  
  438. /* this keeps VMS happy */
  439. #if    VMS
  440. #define getname xgetname
  441. #define unlink(a)    delete(a)
  442. #endif
  443.  
  444. /* some options for AOS/VS */
  445. #if    AOSVS
  446. #define ORMDNI    1
  447. #endif
  448.  
  449. /*    define some ability flags */
  450.  
  451. #if    (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32)
  452. #define MEMMAP    1
  453. #else
  454. #define MEMMAP    0
  455. #endif
  456.  
  457. #if    MSDOS | WINNT | OS2 | V7 | USG | AUX | SMOS | HPUX8 | HPUX9 | BSD | (TOS & MWC) | WMCS | SUN | MPE
  458. #define ENVFUNC 1
  459. #else
  460. #define ENVFUNC 0
  461. #endif
  462.  
  463. #if    AUX
  464. #define RETCHAR    '\n'
  465. #else
  466. #define RETCHAR '\r'
  467. #endif
  468.  
  469. #if    MPE
  470. #define DIRSEPSTR    "."
  471. #define DIRSEPCHAR    '.'
  472. #else
  473. #if    TOS || MSDOS || WINNT || OS2
  474. #define DIRSEPSTR    "\\"
  475. #define DIRSEPCHAR    '\\'
  476. #else
  477. #define DIRSEPSTR    "/"
  478. #define DIRSEPCHAR    '/'
  479. #endif
  480. #endif
  481.  
  482. #define DRIVESEPCHAR    ':'
  483.  
  484. #if    VARARG
  485. #if    (GCC == 0) && (USG || AUX || BSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE)
  486. #define VARG    1
  487. #define SARG    0
  488. #include    <varargs.h>
  489. #else
  490. #define VARG    0
  491. #define SARG    1
  492. #include    <stdarg.h>
  493. #endif
  494. #endif
  495.  
  496. #if ZTC
  497. #include     <dos.h>
  498. #define      movmem(a, b, c) memcpy(b, a, c)
  499. #endif
  500.  
  501. /*    Emacs global flag bit definitions (for gflags)    */
  502.  
  503. #define GFREAD    1    /* read first file in at startup */
  504. #define GFSDRAW 2    /* suppress a screen redraw */
  505.  
  506. /*    internal constants    */
  507.  
  508. #define NBINDS    300            /* max # of bound keys        */
  509. #if    AOSVS | VMS | WINNT | SUN | BSD | V7 | ZENIX | OS2
  510. #define NFILEN    256
  511. #else
  512. #define NFILEN    80            /* # of bytes, file name    */
  513. #endif
  514. #define NBUFN    32            /* # of bytes, buffer name    */
  515. #define NLINE    256            /* # of bytes, input line    */
  516. #define NSTRING 128            /* # of bytes, string buffers    */
  517. #define NKBDM    256            /* # of strokes, keyboard macro */
  518. #define NPAT    128            /* # of bytes, pattern        */
  519. #define HUGE    1000            /* Huge number            */
  520. #define NLOCKS    256            /* max # of file locks active    */
  521. #define NCOLORS 16            /* number of supported colors    */
  522. #define KBLOCK    250            /* sizeof kill buffer chunks    */
  523. #define NRING    16            /* # of buffers in kill ring    */
  524. #define NBLOCK    16            /* line block chunk size    */
  525. #define NVSIZE    10            /* max #chars in a var name    */
  526. #define NMARKS    16            /* number of marks        */
  527.  
  528. #define CTRL    0x0100        /* Control flag, or'ed in        */
  529. #define META    0x0200        /* Meta flag, or'ed in            */
  530. #define CTLX    0x0400        /* ^X flag, or'ed in            */
  531. #define SPEC    0x0800        /* special key (function keys)        */
  532. #define MOUS    0x1000        /* alternative input device (mouse)    */
  533. #define SHFT    0x2000        /* shifted (for function keys)        */
  534. #define ALTD    0x4000        /* ALT key...                */
  535. #define MENU    MOUS+SPEC    /* menu selection (WINDOW_MSWIN)    */
  536.  
  537. #define BINDNUL 0        /* not bound to anything        */
  538. #define BINDFNC 1        /* key bound to a function        */
  539. #define BINDBUF 2        /* key bound to a buffer        */
  540.  
  541. #ifdef    FALSE
  542. #undef    FALSE
  543. #endif
  544. #ifdef    TRUE
  545. #undef    TRUE
  546. #endif
  547.  
  548. #define FALSE    0            /* False, no, bad, etc.     */
  549. #define TRUE    1            /* True, yes, good, etc.    */
  550. #define ABORT    2            /* Death, ^G, abort, etc.    */
  551. #define FAILED    3            /* not-quite fatal false return */
  552.  
  553. #define STOP    0            /* keyboard macro not in use    */
  554. #define PLAY    1            /*          playing    */
  555. #define RECORD    2            /*          recording    */
  556.  
  557. /*    Completion types     */
  558.  
  559. #define CMP_BUFFER    0
  560. #define CMP_COMMAND    1
  561. #define CMP_FILENAME    2
  562.  
  563. /*    Directive definitions    */
  564.  
  565. #define DIF        0
  566. #define DELSE        1
  567. #define DENDIF        2
  568. #define DGOTO        3
  569. #define DRETURN     4
  570. #define DENDM        5
  571. #define DWHILE        6
  572. #define DENDWHILE    7
  573. #define DBREAK        8
  574. #define DFORCE        9
  575.  
  576. #define NUMDIRS     10
  577.  
  578. /*
  579.  * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
  580.  * routines that need directions.
  581.  */
  582. #define PTBEG    0    /* Leave the point at the beginning on search    */
  583. #define PTEND    1    /* Leave the point at the end on search     */
  584. #define FORWARD 0    /* do things in a forward direction        */
  585. #define REVERSE 1    /* do things in a backwards direction        */
  586.  
  587. #define FIOSUC    0            /* File I/O, success.        */
  588. #define FIOFNF    1            /* File I/O, file not found.    */
  589. #define FIOEOF    2            /* File I/O, end of file.    */
  590. #define FIOERR    3            /* File I/O, error.        */
  591. #define FIOMEM    4            /* File I/O, out of memory    */
  592. #define FIOFUN    5            /* File I/O, eod of file/bad line*/
  593. #define FIODEL    6            /* Can't delete/rename file    */
  594.  
  595. #if     WINDOW_MSWIN
  596. /* values for the fbusy flag */
  597. #define FREADING 1                      /* file read in progress */
  598. #define FWRITING 2                      /* file write in progress */
  599. /* if no file activity, the value FALSE is used */
  600. #endif
  601.  
  602. #define CFCPCN    0x0001            /* Last command was C-P, C-N    */
  603. #define CFKILL    0x0002            /* Last command was a kill    */
  604. #define CFSRCH    0x0004            /* last command was a search    */
  605. #define CFYANK    0x0008            /* last command was a yank    */
  606.  
  607. #define SRNORM    0            /* end past, begin front    */
  608. #define SRBEGIN 1            /* always at front        */
  609. #define SREND    2            /* always one past end        */
  610.  
  611. #define BELL    0x07            /* a bell character        */
  612. #define TAB    0x09            /* a tab character        */
  613.  
  614. #if    V7 | USG | AUX | SMOS | HPUX8 | HPUX9 | BSD | SUN | XENIX | AVIION
  615. #define PATHCHR ':'
  616. #else
  617. #if    WMCS || MPE
  618. #define PATHCHR ','
  619. #else
  620. #define PATHCHR ';'
  621. #endif
  622. #endif
  623.  
  624. #define INTWIDTH    sizeof(int) * 3
  625. #define LONGWIDTH    sizeof(long) * 3
  626.  
  627. /*    Macro argument token types                    */
  628.  
  629. #define TKNUL    0            /* end-of-string        */
  630. #define TKARG    1            /* interactive argument     */
  631. #define TKBUF    2            /* buffer argument        */
  632. #define TKVAR    3            /* user variables        */
  633. #define TKENV    4            /* environment variables    */
  634. #define TKFUN    5            /* function....         */
  635. #define TKDIR    6            /* directive            */
  636. #define TKLBL    7            /* line label            */
  637. #define TKLIT    8            /* numeric literal        */
  638. #define TKSTR    9            /* quoted string literal    */
  639. #define TKCMD    10            /* command name         */
  640.  
  641. /*    Internal defined functions                    */
  642.  
  643. #define nextab(a)    (a - (a % tabsize)) + tabsize
  644.  
  645. /* DIFCASE represents the integer difference between upper
  646.    and lower case letters.  It is an xor-able value, which is
  647.    fortunate, since the relative positions of upper to lower
  648.    case letters is the opposite of ascii in ebcdic.
  649. */
  650.  
  651. #if    ASCII
  652. #define DIFCASE     0x20
  653. #else
  654. #define DIFCASE     0x40
  655. #endif
  656.  
  657. /*    Dynamic RAM tracking and reporting redefinitions    */
  658.  
  659. #if    RAMSIZE
  660. #define malloc    allocate
  661. #define free    release
  662. #else
  663. #if    VMS & OPTMEM
  664. #define malloc    VAXC$MALLOC_OPT
  665. #define free    VAXC$FREE_OPT
  666. #define calloc    VAXC$CALLOC_OPT
  667. #define realloc    VAXC$REALLOC_OPT
  668. #define cfree    VAXC$CFREE_OPT
  669. #endif
  670. #endif
  671.  
  672. /* under MS Windows, we use dialog boxes to prompt the user for filenames */
  673. #if     WINDOW_MSWIN
  674. #define FILENAMEREPLY(p,b,nb)   filenamedlg(p,b,nb,TRUE)
  675. #else
  676. #define FILENAMEREPLY(p,b,nb)   mlreply(p,b,nb)
  677. #endif
  678.  
  679. /*
  680.  * There is a window structure allocated for every active display window. The
  681.  * windows are kept in a big list, in top to bottom screen order, with the
  682.  * listhead at "wheadp". Each window contains its own values of dot and mark.
  683.  * The flag field contains some bits that are set by commands to guide
  684.  * redisplay. Although this is a bit of a compromise in terms of decoupling,
  685.  * the full blown redisplay is just too expensive to run for every input
  686.  * character.
  687.  */
  688. typedef struct    WINDOW {
  689.     struct    WINDOW *w_wndp;     /* Next window            */
  690.     struct    BUFFER *w_bufp;     /* Buffer displayed in window    */
  691.     struct    LINE *w_linep;        /* Top line in the window    */
  692.     struct    LINE *w_dotp;        /* Line containing "."        */
  693.     short    w_doto;         /* Byte offset for "."        */
  694.     struct    LINE *w_markp[NMARKS];    /* Line containing "mark"    */
  695.     short    w_marko[NMARKS];    /* Byte offset for "mark"    */
  696.     char    w_toprow;        /* Origin 0 top row of window    */
  697.     char    w_ntrows;        /* # of rows of text in window    */
  698.     char    w_force;        /* If NZ, forcing row.        */
  699.     char    w_flag;         /* Flags.            */
  700. #if    COLOR
  701.     char    w_fcolor;        /* current forground color    */
  702.     char    w_bcolor;        /* current background color    */
  703. #endif
  704.     int    w_fcol;         /* first column displayed    */
  705. }    WINDOW;
  706.  
  707. #define WFFORCE 0x01            /* Window needs forced reframe    */
  708. #define WFMOVE    0x02            /* Movement from line to line    */
  709. #define WFEDIT    0x04            /* Editing within a line    */
  710. #define WFHARD    0x08            /* Better to a full display    */
  711. #define WFMODE    0x10            /* Update mode line.        */
  712. #define WFCOLR    0x20            /* Needs a color change     */
  713.  
  714. /* This structure holds the information about each line appearing on the
  715.  * video display. The redisplay module uses an array of virtual display
  716.  * lines. On systems that do not have direct access to display memory,
  717.  * there is also an array of physical display lines used to minimize
  718.  * video updating. In most cases, these two arrays are unique. If
  719.  * WINDOW_MSWIN is 1, there is a pair of such arrays in each SCREEN
  720.  * structure.
  721.  */
  722.  
  723. typedef struct    VIDEO {
  724.     int    v_flag;         /* Flags */
  725. #if    COLOR
  726.     int    v_fcolor;        /* current forground color */
  727.     int    v_bcolor;        /* current background color */
  728.     int    v_rfcolor;        /* requested forground color */
  729.     int    v_rbcolor;        /* requested background color */
  730. #endif
  731.     int    v_left;            /* left edge of reverse video */
  732.     int    v_right;        /* right right of reverse video */
  733. #if    INSDEL && MEMMAP == 0
  734.     int    v_rline;        /* requested screen line # */
  735. #endif
  736.     char    v_text[1];        /* Screen data. */
  737. }    VIDEO;
  738.  
  739. #define VFNEW    0x0001            /* contents not meaningful yet    */
  740. #define VFCHG    0x0002            /* Changed flag         */
  741. #define VFEXT    0x0004            /* extended (beyond column 80)    */
  742. #define VFCOL    0x0008            /* color change requested    */
  743.  
  744. /*
  745.  *    This structure holds the information about each separate "screen"
  746.  * within the current editing session.  On a character based system, these
  747.  * screens overlay each other, and can individually be brought to front.
  748.  * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh,
  749.  * Intuition, Sunview or X-windows, each screen is represented in an OS
  750.  * window.  The terminolgy is wrong in emacs.....
  751.  *
  752.  *    EMACS        The outside World
  753.  *    screen        window
  754.  *    window        pane
  755.  */
  756.  
  757. typedef struct SCREEN {
  758.     struct SCREEN *s_next_screen;    /* link to next screen in list */
  759.     WINDOW *s_first_window;     /* head of linked list of windows */
  760.     WINDOW *s_cur_window;        /* current window in this screen */
  761.     char *s_screen_name;        /* name of the current window */
  762.     short s_roworg;         /* row origin of stored screen */
  763.     short s_colorg;         /* column origin of stored screen */
  764.     short s_nrow;            /* row width of stored screen */
  765.     short s_ncol;            /* column origin of stored screen */
  766. #if WINDOW_MSWIN
  767.     VIDEO **s_virtual;        /* virtual screen contents */
  768.     VIDEO **s_physical;        /* physical screen contents */
  769.     HWND s_drvhandle;        /* handle for the "term" driver */
  770. #endif
  771. } SCREEN;
  772.  
  773. /*
  774.  * Text is kept in buffers. A buffer header, described below, exists for every
  775.  * buffer in the system. The buffers are kept in a big list, so that commands
  776.  * that search for a buffer by name can find the buffer header. There is a
  777.  * safe store for the dot and mark in the header, but this is only valid if
  778.  * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
  779.  * the buffer is kept in a circularly linked list of lines, with a pointer to
  780.  * the header line in "b_linep".  Buffers may be "Inactive" which means the
  781.  * files associated with them have not been read in yet.  These get read in
  782.  * at "use buffer" time.
  783.  */
  784. typedef struct    BUFFER {
  785.     struct    BUFFER *b_bufp;     /* Link to next BUFFER        */
  786.     struct    LINE *b_dotp;        /* Link to "." LINE structure    */
  787.     short    b_doto;         /* Offset of "." in above LINE    */
  788.     struct    LINE *b_markp[NMARKS];    /* The same as the above two,    */
  789.     short    b_marko[NMARKS];    /* but for the "mark"        */
  790.     int    b_fcol;         /* first col to display     */
  791.     struct    LINE *b_linep;        /* Link to the header LINE    */
  792.     struct    LINE *b_topline;    /* Link to narrowed top text    */
  793.     struct    LINE *b_botline;    /* Link to narrowed bottom text */
  794.     char    b_active;        /* window activated flag    */
  795.     char    b_nwnd;         /* Count of windows on buffer    */
  796.     char    b_exec;         /* how many active executions    */
  797.     char    b_flag;         /* Flags            */
  798.     int    b_mode;         /* editor mode of this buffer    */
  799.     char    b_fname[NFILEN];    /* File name            */
  800.     char    b_bname[NBUFN];     /* Buffer name            */
  801. #if    CRYPT
  802.     char   b_key[NPAT];           /* current encrypted key        */
  803. #endif
  804. }    BUFFER;
  805.  
  806. #define BFINVS    0x01            /* Internal invisable buffer    */
  807. #define BFCHG    0x02            /* Changed since last write    */
  808. #define BFTRUNC 0x04            /* buffer was truncated when read */
  809. #define BFNAROW 0x08            /* buffer has been narrowed    */
  810.  
  811. /*    mode flags    */
  812. #define NUMMODES    10           /* # of defined modes           */
  813.  
  814. #define MDWRAP    0x0001            /* word wrap            */
  815. #define MDCMOD    0x0002            /* C indentation and fence match*/
  816. #define MDSPELL 0x0004            /* spell error parsing        */
  817. #define MDEXACT 0x0008            /* Exact matching for searches    */
  818. #define MDVIEW    0x0010            /* read-only buffer        */
  819. #define MDOVER    0x0020            /* overwrite mode        */
  820. #define MDMAGIC 0x0040            /* regular expresions in search */
  821. #define MDCRYPT 0x0080            /* encrytion mode active    */
  822. #define MDASAVE 0x0100            /* auto-save mode        */
  823. #define MDREPL    0x0200            /* replace mode         */
  824.  
  825. /*
  826.  * The starting position of a region, and the size of the region in
  827.  * characters, is kept in a region structure.  Used by the region commands.
  828.  */
  829. typedef struct    {
  830.     struct    LINE *r_linep;        /* Origin LINE address.     */
  831.     short    r_offset;        /* Origin LINE offset.        */
  832.     long    r_size;         /* Length in characters.    */
  833. }    REGION;
  834.  
  835. /*
  836.  * All text is kept in circularly linked lists of "LINE" structures. These
  837.  * begin at the header line (which is the blank line beyond the end of the
  838.  * buffer). This line is pointed to by the "BUFFER". Each line contains a the
  839.  * number of bytes in the line (the "used" size), the size of the text array,
  840.  * and the text. The end of line is not stored as a byte; it's implied.
  841.  */
  842. typedef struct    LINE {
  843.     struct    LINE *l_fp;        /* Link to the next line    */
  844.     struct    LINE *l_bp;        /* Link to the previous line    */
  845.     short    l_size;         /* Allocated size        */
  846.     short    l_used;         /* Used size            */
  847.     char    l_text[1];        /* A bunch of characters.    */
  848. }    LINE;
  849.  
  850. #define lforw(lp)    ((lp)->l_fp)
  851. #define lback(lp)    ((lp)->l_bp)
  852. #define lgetc(lp, n)    ((lp)->l_text[(n)])
  853. #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
  854. #define lused(lp)    ((lp)->l_used)
  855. #define lsize(lp)    ((lp)->l_size)
  856. #define ltext(lp)    ((lp)->l_text)
  857.  
  858. /*
  859.  * The editor communicates with the display using a high level interface. A
  860.  * "TERM" structure holds useful variables, and indirect pointers to routines
  861.  * that do useful operations. The low level get and put routines are here too.
  862.  * This lets a terminal, in addition to having non standard commands, have
  863.  * funny get and put character code too. The calls might get changed to
  864.  * "termp->t_field" style in the future, to make it possible to run more than
  865.  * one terminal type.
  866.  */
  867. #if    PROTO
  868. typedef struct    {
  869.     short    t_mrow;         /* max number of rows allowable */
  870.     short    t_nrow;         /* current number of rows used    */
  871.     short    t_mcol;         /* max Number of columns.    */
  872.     short    t_ncol;         /* current Number of columns.    */
  873.     short    t_roworg;        /* origin row (normally zero)    */
  874.     short    t_colorg;        /* origin column (normally zero)*/
  875.     short    t_margin;        /* min margin for extended lines*/
  876.     short    t_scrsiz;        /* size of scroll region "    */
  877.     int    t_pause;        /* # times thru update to pause */
  878.     int (PASCAL NEAR *t_open)(void);    /* Open terminal at the start.*/
  879.     int (PASCAL NEAR *t_close)(void);   /* Close terminal at end.    */
  880.     int (PASCAL NEAR *t_kopen)(void);   /* Open keyboard        */
  881.     int (PASCAL NEAR *t_kclose)(void);  /* Close keyboard        */
  882.     int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */
  883.     int (PASCAL NEAR *t_putchar)(int);  /* Put character to display.*/
  884.     int (PASCAL NEAR *t_flush)(void);   /* Flush output buffers.    */
  885.     int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/
  886.     int (PASCAL NEAR *t_eeol)(void);    /* Erase to end of line.    */
  887.     int (PASCAL NEAR *t_eeop)(void);    /* Erase to end of page.    */
  888.     int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally    */
  889.     int (PASCAL NEAR *t_beep)(void);    /* Beep.            */
  890.     int (PASCAL NEAR *t_rev)(int);      /* set reverse video state    */
  891.     int (PASCAL NEAR *t_rez)(char *);   /* change screen resolution    */
  892. #if    COLOR
  893.     int (PASCAL NEAR *t_setfor)(int);   /* set forground color    */
  894.     int (PASCAL NEAR *t_setback)(int);  /* set background color     */
  895. #endif
  896. #if    INSDEL
  897.     int (PASCAL NEAR *t_insline)(int); /* insert a screen line     */
  898.     int (PASCAL NEAR *t_delline)(int); /* delete a screen line     */
  899. #endif
  900. #if     WINDOW_MSWIN
  901.         int (PASCAL NEAR *t_sleep)(int);   /* go to sleep for a while    */
  902.         int (PASCAL NEAR *t_newscr)(SCREEN *);  /* create new screen display */
  903.         int (PASCAL NEAR *t_delscr)(SCREEN *);  /* destroy screen display */
  904.         int (PASCAL NEAR *t_selscr)(SCREEN *);  /* select screen display */
  905.         int (PASCAL NEAR *t_sizscr)(SCREEN *);  /* resize screen display */
  906.         int (PASCAL NEAR *t_topscr)(SCREEN *);  /* bring screen to top    */
  907. #endif
  908. }    TERM;
  909. #else    /* TERM structure, no prototyping.*/
  910.  
  911. typedef struct    {
  912.     short    t_mrow;         /* max number of rows allowable */
  913.     short    t_nrow;         /* current number of rows used    */
  914.     short    t_mcol;         /* max Number of columns.    */
  915.     short    t_ncol;         /* current Number of columns.    */
  916.     short    t_roworg;        /* origin row (normally zero)    */
  917.     short    t_colorg;        /* origin column (normally zero)*/
  918.     short    t_margin;        /* min margin for extended lines*/
  919.     short    t_scrsiz;        /* size of scroll region "    */
  920.     int    t_pause;        /* # times thru update to pause */
  921.     int (PASCAL NEAR *t_open)();    /* Open terminal at the start.    */
  922.     int (PASCAL NEAR *t_close)();    /* Close terminal at end.    */
  923.     int (PASCAL NEAR *t_kopen)();    /* Open keyboard        */
  924.     int (PASCAL NEAR *t_kclose)();    /* close keyboard        */
  925.     int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */
  926.     int (PASCAL NEAR *t_putchar)(); /* Put character to display.    */
  927.     int (PASCAL NEAR *t_flush)();    /* Flush output buffers.    */
  928.     int (PASCAL NEAR *t_move)();    /* Move the cursor, origin 0.    */
  929.     int (PASCAL NEAR *t_eeol)();    /* Erase to end of line.    */
  930.     int (PASCAL NEAR *t_eeop)();    /* Erase to end of page.    */
  931.     int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally    */
  932.     int (PASCAL NEAR *t_beep)();    /* Beep.            */
  933.     int (PASCAL NEAR *t_rev)();    /* set reverse video state    */
  934.     int (PASCAL NEAR *t_rez)();    /* change screen resolution    */
  935. #if    COLOR
  936.     int (PASCAL NEAR *t_setfor)();    /* set forground color        */
  937.     int (PASCAL NEAR *t_setback)(); /* set background color     */
  938. #endif
  939. #if    INSDEL
  940.     int (PASCAL NEAR *t_insline)(); /* insert a screen line     */
  941.     int (PASCAL NEAR *t_delline)(); /* delete a screen line     */
  942. #endif
  943. #if     WINDOW_MSWIN
  944.         int (PASCAL NEAR *t_sleep)();   /* go to sleep for a while    */
  945.         int (PASCAL NEAR *t_newscr)();  /* create new screen display    */
  946.         int (PASCAL NEAR *t_delscr)();  /* destroy screen display    */
  947.         int (PASCAL NEAR *t_selscr)();  /* select screen display    */
  948.         int (PASCAL NEAR *t_sizscr)();  /* resize screen display    */
  949.         int (PASCAL NEAR *t_topscr)();  /* bring screen to top        */
  950. #endif
  951. }    TERM;
  952. #endif
  953.  
  954.  
  955. /*    TEMPORARY macros for terminal I/O  (to be placed in a machine
  956.                         dependant place later) */
  957.  
  958. #define TTopen        (*term.t_open)
  959. #define TTclose     (*term.t_close)
  960. #define TTkopen     (*term.t_kopen)
  961. #define TTkclose    (*term.t_kclose)
  962. #define TTgetc        (*term.t_getchar)
  963. #define TTputc        (*term.t_putchar)
  964. #define TTflush     (*term.t_flush)
  965. #define TTmove        (*term.t_move)
  966. #define TTeeol        (*term.t_eeol)
  967. #define TTeeop        (*term.t_eeop)
  968. #define TTclrdesk    (*term.t_clrdesk)
  969. #define TTbeep        (*term.t_beep)
  970. #define TTrev        (*term.t_rev)
  971. #define TTrez        (*term.t_rez)
  972. #if    COLOR
  973. #define TTforg        (*term.t_setfor)
  974. #define TTbacg        (*term.t_setback)
  975. #endif
  976.  
  977. /*    Structure for the table of current key bindings     */
  978.  
  979. ETYPE EPOINTER {
  980.     int (PASCAL NEAR *fp)();    /* C routine to invoke */
  981.     BUFFER *buf;            /* buffer to execute */
  982. };
  983.  
  984. typedef struct    {
  985.     short k_code;        /* Key code            */
  986.     short k_type;        /* binding type (C function or EMACS buffer) */
  987.     ETYPE EPOINTER k_ptr;    /* ptr to thing to execute */
  988. }    KEYTAB;
  989.  
  990. /*    structure for the name binding table        */
  991.  
  992. typedef struct {
  993.     char *n_name;            /* name of function key */
  994.     int (PASCAL NEAR *n_func)();    /* function name is bound to */
  995. }    NBIND;
  996.  
  997. /*    The editor holds deleted text chunks in the KILL buffer. The
  998.     kill buffer is logically a stream of ascii characters, however
  999.     due to its unpredicatable size, it gets implemented as a linked
  1000.     list of chunks. (The d_ prefix is for "deleted" text, as k_
  1001.     was taken up by the keycode structure)
  1002. */
  1003.  
  1004. typedef struct KILL {
  1005.     struct KILL *d_next;   /* link to next chunk, NULL if last */
  1006.     char d_chunk[KBLOCK];    /* deleted text */
  1007. } KILL;
  1008.  
  1009. /*    When emacs's command interpetor needs to get a variable's name,
  1010.     rather than it's value, it is passed back as a VDESC variable
  1011.     description structure. The v_num field is a index into the
  1012.     appropriate variable table.
  1013. */
  1014.  
  1015. typedef struct VDESC {
  1016.     int v_type;    /* type of variable */
  1017.     int v_num;    /* ordinal pointer to variable in list */
  1018. } VDESC;
  1019.  
  1020. /*    The !WHILE directive in the execution language needs to
  1021.     stack references to pending whiles. These are stored linked
  1022.     to each currently open procedure via a linked list of
  1023.     the following structure
  1024. */
  1025.  
  1026. typedef struct WHBLOCK {
  1027.     LINE *w_begin;        /* ptr to !while statement */
  1028.     LINE *w_end;        /* ptr to the !endwhile statement*/
  1029.     int w_type;        /* block type */
  1030.     struct WHBLOCK *w_next; /* next while */
  1031. } WHBLOCK;
  1032.  
  1033. #define BTWHILE     1
  1034. #define BTBREAK     2
  1035.  
  1036.  
  1037. /* HICHAR - 1 is the largest character we will deal with.
  1038.  * BMAPSIZE represents the number of bytes in the bitmap.
  1039.  */
  1040. #define HICHAR        256
  1041. #define BMAPSIZE    HICHAR >> 3
  1042.  
  1043. #if    MAGIC
  1044. /*
  1045.  * Defines for the metacharacters in the regular expression
  1046.  * search routines.  MCNIL and GROUP are used in both search
  1047.  * and replace metachar-arrays.
  1048.  */
  1049. #define MCNIL        0    /* Like the '\0' for strings.*/
  1050. #define LITSTRING    1    /* Literal string.*/
  1051. #define LITCHAR     2    /* Literal character.*/
  1052. #define ANY        3    /* Any character but the <NL>.*/
  1053. #define CCL        4
  1054. #define NCCL        5
  1055. #define BOL        6
  1056. #define EOL        7
  1057. #define GRPBEG        8    /* Signal start of group.*/
  1058. #define GRPEND        9    /* Signal end of group.*/
  1059. #define GROUP        10    /* String of group match.*/
  1060. #define DITTO        11    /* Replacement with match string.*/
  1061.  
  1062. #define CLOSURE     0x0100    /* An or-able value for a closure modifier.*/
  1063. #define CLOSURE_1    0x0200    /* An or-able value for a closure modifier.*/
  1064. #define ZEROONE     0x0400    /* An or-able value for a closure modifier.*/
  1065.  
  1066. #define ALLCLOS     (CLOSURE | CLOSURE_1 | ZEROONE)
  1067. #define MASKCLO     (~ALLCLOS)
  1068.  
  1069. #define MC_ANY        '.'    /* 'Any' character (except newline).*/
  1070. #define MC_CCL        '['    /* Character class.*/
  1071. #define MC_NCCL     '^'    /* Negate character class.*/
  1072. #define MC_RCCL     '-'    /* Range in character class.*/
  1073. #define MC_ECCL     ']'    /* End of character class.*/
  1074. #define MC_BOL        '^'    /* Beginning of line.*/
  1075. #define MC_EOL        '$'    /* End of line.*/
  1076. #define MC_CLOSURE    '*'    /* Closure - zero to many characters match.*/
  1077. #define MC_CLOSURE_1    '+'    /* Closure - one to many characters match.*/
  1078. #define MC_ZEROONE    '?'    /* Closure - zero to one characters match.*/
  1079. #define MC_DITTO    '&'    /* Use matched string in replacement.*/
  1080. #define MC_GRPBEG    '('    /* Start of group (begun with a backslash).*/
  1081. #define MC_GRPEND    ')'    /* End of group (begun with a backslash).*/
  1082. #define MC_ESC        '\\'    /* Escape - suppress meta-meaning.*/
  1083.  
  1084. #define MAXGROUPS    10        /* 1 + maximum # of r. e. groups. */
  1085. #define BIT(n)        (1 << (n))    /* An integer with one bit set.*/
  1086.  
  1087. /* Typedefs that define the bitmap type for searching (EBITMAP),
  1088.  * the meta-character structure for MAGIC mode searching (MC),
  1089.  * and the meta-character structure for MAGIC mode replacment (RMC).
  1090.  */
  1091. typedef char    *EBITMAP;
  1092.  
  1093. typedef struct {
  1094.     short int    mc_type;
  1095.     union {
  1096.         int    lchar;
  1097.         int    group_no;
  1098.         EBITMAP    cclmap;
  1099.     } u;
  1100. } MC;
  1101.  
  1102. typedef struct {
  1103.     short int    mc_type;
  1104.     union {
  1105.         int    group_no;
  1106.         char    *rstr;
  1107.     } u;
  1108. } RMC;
  1109. #endif
  1110.  
  1111. /*
  1112.     This is the message which should be added to any "About MicroEMACS"
  1113.     boxes on any of the machines with window managers.
  1114.  
  1115.  
  1116.     ------------------------------------------
  1117.     |                     |
  1118.     |     MicroEMACS v3.xx         |
  1119.     |        for the ............     |
  1120.     |                     |
  1121.     |    Text Editor and Corrector         |
  1122.     |                     |
  1123.     |    written by Daniel M. Lawrence     |
  1124.     |    [based on code by Dave Conroy]     |
  1125.     |                     |
  1126.     |    Send inquiries and donations to:     |
  1127.     |    617 New York St             |
  1128.     |    Lafayette, IN 47901         |
  1129.     |                     |
  1130.     ------------------------------------------
  1131. */
  1132.