home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / crisp1.9 / part23 < prev    next >
Encoding:
Text File  |  1989-06-18  |  49.7 KB  |  1,278 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. Subject: v07i043: CRISP release 1.9 part 22/32
  4. Organization: Reuters Ltd PLC, Marlow, England
  5. Reply-To: fox@marlow.UUCP (Paul Fox)
  6.  
  7. Posting-number: Volume 7, Issue 43
  8. Submitted-by: fox@marlow.UUCP (Paul Fox)
  9. Archive-name: crisp1.9/part23
  10.  
  11.  
  12.  
  13. #!/bin/sh
  14. # this is part 2 of a multipart archive
  15. # do not concatenate these parts, unpack them in order with /bin/sh
  16. # file ./def.h continued
  17. #
  18. CurArch=2
  19. if test ! -r s2_seq_.tmp
  20. then echo "Please unpack part 1 first!"
  21.      exit 1; fi
  22. ( read Scheck
  23.   if test "$Scheck" != $CurArch
  24.   then echo "Please unpack part $Scheck next!"
  25.        exit 1;
  26.   else exit 0; fi
  27. ) < s2_seq_.tmp || exit 1
  28. echo "x - Continuing file ./def.h"
  29. sed 's/^X//' << 'SHAR_EOF' >> ./def.h
  30. X                    /*  line.            */
  31. X    char    b_nwnd;                 /* Count of windows on buffer   */
  32. X    u_int16 b_flag;                 /* Flags                        */
  33. X    char    b_fname[NFILEN];        /* File name                    */
  34. X    char    *b_title;        /* Title from create_buffer.    */
  35. X    short    b_bufnum;        /* Buffer number.        */
  36. X    short    b_system;        /* Non-zero if system buffer.    */
  37. X    undo_info b_undo;
  38. X    undo_info b_redo;
  39. X    long    b_nummod;        /* No. of modifications to buffer. */
  40. X                    /* When zero, buffer has not been*/
  41. X                    /* modified.            */
  42. X    char    b_uchar;        /* Last character selfinserted  */
  43. X                    /* to do undo collapsing.    */
  44. X    int    b_mode;            /* Mode for chmod().        */
  45. X    u_int16    b_tabs[NTABS+1];    /* Tab columns.            */
  46. X    Head_p    b_alist;        /* Anchor list.            */
  47. X    SPTREE    *b_syms;        /* Local symbols.        */
  48. X    struct ANCHOR     *b_anchor;    /* Pointer to current anchor.    */
  49. X    struct    DISPLAY    *b_display;    /* Pointer to screen buffer if this*/
  50. X                    /* buffer is attached to a pty. */
  51. X    int    b_wstat;        /* Exit status of child process.*/
  52. X    struct kbd_stk    *b_keyboard;    /* Local keyboard.        */
  53. X    Head_p    b_register;        /* List of registered macros    */
  54. X    char    **b_chunk;        /* Original file.        */
  55. X}       BUFFER;
  56. X
  57. X#define BFCHG   0x01                    /* Changed.                     */
  58. X#define BFBAK   0x02                    /* Need to make a backup.       */
  59. X#define    BFRO    0x04            /* Read-only.            */
  60. X#define    BFREAD    0x08            /* Buffer needs to be read in.    */
  61. X#define    BFEXEC    0x10            /* File is executable.        */
  62. X#define BFPROC    0x20            /* Buffer has process attached. */
  63. X#define BFBINARY 0x40            /* Binary buffer.        */
  64. X#define    BFANSI    0x80            /* If TRUE, ANSI-fication is done.*/
  65. X
  66. Xtypedef struct ANCHOR {
  67. X    u_int16        a_type;
  68. X    int        a_line;
  69. X    int        a_offset;
  70. X    } ANCHOR;
  71. X    
  72. X# define    MAX_PT    20
  73. X/*
  74. X/*        /-------+------\ 
  75. X/*        |       |      |
  76. X/*        +-------+------+
  77. X/*        |       |      |
  78. X/*        \-------+------/
  79. X/*----------------------------------------------*/
  80. Xtypedef    struct pt    {
  81. X    char    pt_top_left[MAX_PT];        /* Top left corner.         */
  82. X    char    pt_top_right[MAX_PT];        /* Top right corner.         */
  83. X    char    pt_bot_left[MAX_PT];        /* Bottom left corner.         */
  84. X    char    pt_bot_right[MAX_PT];        /* Bottom right corner.         */
  85. X    char    pt_vertical[MAX_PT];        /* Vertical Line.         */
  86. X    char    pt_horizontal[MAX_PT];        /* Horizontal line.         */
  87. X    char    pt_top_join[MAX_PT];        /* Horizontal line, with     */
  88. X                        /* Vertical join going down  */
  89. X    char    pt_bot_join[MAX_PT];        /* Horizontal line, with     */
  90. X                        /* vertical join going up    */
  91. X    char    pt_cross[MAX_PT];        /* Four way intersection.    */
  92. X    char    pt_left_join[MAX_PT];        /* Vertical line with join   */
  93. X                        /* going left.             */
  94. X    char    pt_right_join[MAX_PT];        /* Vertical line with join   */
  95. X                        /* going right.             */
  96. X    char    pt_space[MAX_PT];        /* Escape sequence to        */
  97. X                        /* erase multiple spaces.    */
  98. X                        /* eg ESC [ %d X on Xenix    */
  99. X    char    pt_character[MAX_PT];        /* Sequence to print         */
  100. X                        /* special characters,       */
  101. X                        /* eg ESC [ %d g on Xenix    */
  102. X    char    pt_icursor[MAX_PT];        /* Escape sequence for insert*/
  103. X                        /* mode cursor.             */
  104. X    char    pt_ocursor[MAX_PT];        /* Escape sequence for overst*/
  105. X                        /* mode cursor.             */
  106. X    char    pt_vicursor[MAX_PT];        /* Escape sequence for insert*/
  107. X                        /* mode cursor.    (Virtual)    */
  108. X    char    pt_vocursor[MAX_PT];        /* Escape sequence for overst*/
  109. X                        /* mode cursor.    (Virtual)    */
  110. X    char    pt_escape[MAX_PT];        /* Sequence to print ESC.    */
  111. X    char    pt_repeat[MAX_PT];        /* Sequence for repeating last*/
  112. X                        /* character.             */
  113. X    char    pt_0m;                /* ESC [ 0m resets color as well */
  114. X                        /* as character attributes.   */
  115. X    char    pt_color;            /* TRUE if terminal supports */
  116. X                        /* color.                    */
  117. X    char    pt_escC[MAX_PT];        /* Sequence to move cursor   */
  118. X                        /* on same line.         */
  119. X    } PHYS_TERM;
  120. X    
  121. X# define    CH_MIN        240
  122. X# define    CH_HORIZONTAL    CH_MIN+0
  123. X# define    CH_VERTICAL    CH_MIN+1
  124. X# define    CH_TOP_LEFT    CH_MIN+2
  125. X# define    CH_TOP_RIGHT    CH_MIN+3
  126. X# define    CH_BOT_LEFT    CH_MIN+4
  127. X# define    CH_BOT_RIGHT    CH_MIN+5
  128. X# define    CH_TOP_JOIN    CH_MIN+6
  129. X# define    CH_BOT_JOIN    CH_MIN+7
  130. X# define    CH_LEFT_JOIN    CH_MIN+8
  131. X# define    CH_RIGHT_JOIN    CH_MIN+9
  132. X# define    CH_CROSS    CH_MIN+10
  133. X# define    CH_MAX        CH_MIN+10
  134. X/**
  135. X * All text is kept in circularly linked
  136. X * lists of "LINE" structures. These begin at the
  137. X * header line (which is the blank line beyond the
  138. X * end of the buffer). This line is pointed to by
  139. X * the "BUFFER". Each line contains a the number of
  140. X * bytes in the line (the "used" size), the size
  141. X * of the text array, and the text. The end of line
  142. X * is not stored as a byte; it's implied. Future
  143. X * additions will include update hints, and a
  144. X * list of marks into the line.
  145. X */
  146. X# define    L_INCORE    0x0001    /* Line is in-memory.        */
  147. X# define    L_LOCKED    0x0002    /* Line has been locked.    */
  148. X# define    L_FILE        0x0004    /* Line must be copied before   */
  149. X                    /* operating on.        */
  150. Xtypedef struct  LINE {
  151. X    struct  LINE *l_fp;             /* Link to the next line        */
  152. X    struct  LINE *l_bp;             /* Link to the previous line    */
  153. X    u_int16   l_size;        /* Allocated size               */
  154. X    u_int16   l_used;                 /* Used size                    */
  155. X    u_int16      l_lineno;        /* Old line number.        */
  156. X    u_int16    l_flags;
  157. X    union {
  158. X        u_char    *text;
  159. X        long    tell;        /* Offset in file when swapped out.*/
  160. X        } u;
  161. X    } LINE;
  162. X# define    l_tell    u.tell
  163. X# define    l_text    u.text
  164. X
  165. X/*
  166. X * The rationale behind these macros is that you
  167. X * could (with some editing, like changing the type of a line
  168. X * link from a "LINE *" to a "REFLINE", and fixing the commands
  169. X * like file reading that break the rules) change the actual
  170. X * storage representation of lines to use something fancy on
  171. X * machines with small address spaces.
  172. X */
  173. X#define lforw(lp)       ((lp)->l_fp)
  174. X#define lback(lp)       ((lp)->l_bp)
  175. X#define lgetc(lp, n)    ((lp)->l_text[(n)])
  176. X#define ltext(lp)       ((lp)->l_text)
  177. X#define    llength(lp)    ((lp)->l_used)
  178. X
  179. X# define    SWAP(a,b,c)    c=a,a=b,b=c
  180. X#endif
  181. Xchar    *getenv();
  182. Xchar    *strtok();
  183. X
  184. SHAR_EOF
  185. echo "File ./def.h is complete"
  186. chmod 0444 ./def.h || echo "restore of ./def.h fails"
  187. mkdir . >/dev/null 2>&1
  188. echo "x - extracting ./gdir.h (Text)"
  189. sed 's/^X//' << 'SHAR_EOF' > ./gdir.h &&
  190. X# if    defined(VMS)
  191. X#     include    "vmsdir.h"
  192. X# else
  193. X#     include    <sys/dir.h>
  194. X# endif
  195. X
  196. X# if    defined(DIRSIZ_DEFINED)
  197. X#    if    defined(DIRSIZ)
  198. X#        undef    DIRSIZ
  199. X#    endif
  200. X#    define    DIRSIZ    MAXNAMLEN
  201. X#    define    dirent direct
  202. X# else
  203. X#     include    <dirent.h>
  204. X# endif
  205. X
  206. SHAR_EOF
  207. chmod 0444 ./gdir.h || echo "restore of ./gdir.h fails"
  208. mkdir . >/dev/null 2>&1
  209. echo "x - extracting ./list.h (Text)"
  210. sed 's/^X//' << 'SHAR_EOF' > ./list.h &&
  211. X/**************************************************************
  212. X *
  213. X *    CRISP - Custom Reduced Instruction Set Programmers Editor
  214. X *
  215. X *    (C) Paul Fox, 1989
  216. X *    43, Jerome Close          Tel: +44 6284 4222
  217. X *        Marlow
  218. X *         Bucks.
  219. X *        England SL7 1TX
  220. X *
  221. X *
  222. X *    Please See COPYRIGHT notice.
  223. X *
  224. X **************************************************************/
  225. X# include    "def.h"
  226. X
  227. X# if    defined(l_next)
  228. X#    undef    l_next
  229. X# endif
  230. X
  231. X#ifndef _U
  232. X# include    <ctype.h>
  233. X#endif
  234. X# include    "regexp.h"
  235. Xtypedef    short    int16;
  236. Xtypedef    unsigned char    LIST;
  237. X
  238. X# define    MAX_ARGC    12
  239. X# define    MAX_MACROS    256
  240. X# define    MAX_NESTING    128
  241. X# define    SYMLEN        32
  242. X
  243. X# define    vm_lock_line(line)    linep(line)
  244. X# define    vm_unlock(line)        
  245. X/*---------------------------------------
  246. X *   Registered macro types.
  247. X *---------------------------------------*/
  248. X# define    REG_TYPED    0    /* Character typed.        */
  249. X# define    REG_EDIT    1    /* Different file edited.    */
  250. X# define    REG_ALT_H    2    /* ALT-H pressed in response    */
  251. X                    /* to a prompt.            */
  252. X# define    REG_UNASSIGNED    3    /* Unassigned key pressed.    */
  253. X# define    REG_IDLE    4    /* Idle time expired.        */
  254. X# define    REG_EXIT    5    /* About to exit.        */
  255. X# define    REG_NEW        6    /* New file edited and readin.     */
  256. X# define    REG_CTRLC    7    /* CTRL-C (SIGINT) pressed     */
  257. X                    /* during macro execution.    */
  258. X# define    REG_INVALID    8    /* Invalid key pressed during    */
  259. X                    /* response input.        */
  260. X# define    REG_INTERNAL    9    /* Internal error.        */
  261. X# define    REG_MAX        9
  262. X
  263. X/*---------------------------------------
  264. X *   Reference string structure.
  265. X *---------------------------------------*/
  266. Xtypedef struct r_str {
  267. X    char    *r_str;
  268. X    int    r_ref;
  269. X    int    r_used;
  270. X    int    r_size;
  271. X    } r_str;
  272. X/*---------------------------------------
  273. X *   List-macro definitions.
  274. X *---------------------------------------*/
  275. X# define    is_id(list)    (list->l_flags == F_ID)
  276. X# define    is_int(list)    (list->l_flags == F_INT)
  277. X# define    is_list(list)    (list->l_flags == F_LIST)
  278. X
  279. X# ifdef OPCODE
  280. X# define    F_ERROR        -1    /* Non-existant case.        */
  281. X# define    F_HALT        0    /* End of List.            */
  282. X# define    F_INT        1    /* 32-bit integer.        */
  283. X# define    F_STR        2    /* Unquoted string.        */
  284. X# define    F_LIST        3    /* List.            */
  285. X# define    F_NULL        4    /* Used as destination of loops.*/
  286. X# define    F_ID        5    /* 16-bit keyword.        */
  287. X# define    F_END        6    /* End of list.            */
  288. X# define    F_POLY        7    /* Symbol is polymorphic.    */
  289. X# define    F_LIT        8    /* Pointer to literal string.    */
  290. X# define    F_RSTR        9    /* Pointer to reference string.    */
  291. X# else
  292. Xtypedef enum opcodes {
  293. X        F_ERROR        = -1,    /* Non-existant case.        */
  294. X        F_HALT        = 0,    /* End of List.            */
  295. X        F_INT        = 1,    /* 32-bit integer.        */
  296. X        F_STR        = 2,    /* Unquoted string.        */
  297. X        F_LIST        = 3,    /* List.            */
  298. X        F_NULL        = 4,    /* Used as destination of loops.*/
  299. X        F_ID        = 5,    /* 16-bit keyword.        */
  300. X        F_END        = 6,    /* End of list.            */
  301. X        F_POLY        = 7,    /* Symbol is polymorphic.    */
  302. X        F_LIT        = 8,    /* Pointer to literal string.    */
  303. X        F_RSTR        = 9,    /* Pointer to reference string.    */
  304. X        } OPCODE;
  305. X# endif
  306. Xextern char    *get_str();
  307. Xvoid    LPUT16();
  308. Xvoid    LPUT32();
  309. Xlong    LGET32();
  310. Xu_int16    LGET16();
  311. X
  312. X# define    NOOP        0
  313. X# define    PLUS        1
  314. X# define    MINUS        2
  315. X# define    MULTIPLY    3
  316. X# define    DIVIDE        4
  317. X# define    MODULO        5
  318. X# define    EQ        6
  319. X# define    NE        7
  320. X# define    LT        8
  321. X# define    LE        9
  322. X# define    GT        10
  323. X# define    GE        11
  324. X# define    ABOVE        12
  325. X# define    ABOVE_EQ    13
  326. X# define    BELOW        14
  327. X# define    BELOW_EQ    15
  328. X# define    BNOT        16
  329. X# define    BAND        17
  330. X# define    BOR        18
  331. X# define    BXOR        19
  332. X
  333. Xextern    int    sizeof_atoms[];
  334. X
  335. X# define    SF_POLY        0x01    /* Symbol is polymorphic.    */
  336. X# define    SF_RO        0x02    /* Symbol is read-only.        */
  337. Xtypedef    struct SYMBOL {
  338. X    char    s_name[SYMLEN];
  339. X    OPCODE    s_type;
  340. X    u_char    s_flag;
  341. X    union    {
  342. X        r_str    *str;
  343. X        long    l;
  344. X        LIST    *list;
  345. X        } s_v;
  346. X    } SYMBOL;
  347. X# define    s_int    s_v.l
  348. X# define    s_str    s_v.str
  349. X# define    s_list    s_v.list
  350. X
  351. Xtypedef    struct define {
  352. X    char    *name;
  353. X    char    *value;
  354. X    struct define    *next;
  355. X    } DEFINE;
  356. X
  357. X
  358. X/* Following typedef for argv's benefit only. */
  359. Xtypedef    struct LISTV {
  360. X    OPCODE    l_flags;
  361. X    union {
  362. X        r_str    *ref_str;
  363. X        char    *string;
  364. X        long    integer;
  365. X        SYMBOL    *symbol;
  366. X        LIST *list;
  367. X        } u;
  368. X    } LISTV;
  369. X# define    l_str    u.string
  370. X# define    l_rstr    u.ref_str
  371. X# define    l_int    u.integer
  372. X# define    l_list    u.list
  373. X# define    l_sym    u.symbol
  374. X# define    lnext(lp)    ((lp)->l_next ? (lp) + (lp)->l_next : 0)
  375. X# define    lnull(lp)    (lp->l_next == 0)
  376. X# define    llist(lp)    ((lp)->l_int ? (lp) + (lp)->l_int : 0)
  377. X
  378. X# define    M_AUTOLOAD    0x01    /* Macro needs to be autoloaded */
  379. X                    /* on reference.        */
  380. Xtypedef    struct MACRO {
  381. X    char    *m_name;
  382. X    short    m_flags;
  383. X    short    m_ftime;
  384. X    LIST    *m_list;
  385. X    int    m_size;            /* Size of macro in atoms.       */
  386. X    struct MACRO    *m_next;    /* Next macro in list for this file.*/
  387. X    } MACRO;
  388. X
  389. X/*------------------------------------
  390. X *    Typedef for list of macro files.
  391. X *    All this info is needed in case we
  392. X *    delete the macro.
  393. X *------------------------------------*/
  394. Xtypedef struct MACROF {
  395. X    char    *mf_name;
  396. X    char    *mf_list;
  397. X    MACRO    *mf_macro;
  398. X    } MACROF;
  399. X/*--------------------------------
  400. X *   Define debug flags.
  401. X *--------------------------------*/
  402. X# define    DB_REGEXP    0x0002    /* Regular expression debug output*/
  403. X# define    DB_UNDO        0x0004    /* Undo trace.              */
  404. X# define    DB_PROMPT    0x0008    /* Debug prompting code.      */
  405. X
  406. X# define    MAX_FILES    10
  407. X
  408. X# define    TERMINAL    0x01
  409. Xstruct    f {
  410. X    char    *bufp;
  411. X    char    *buf;
  412. X    char    *bufend;
  413. X    int    fd;
  414. X    int    line_no;
  415. X    int    flags;
  416. X    off_t    size;
  417. X    char    name[64];
  418. X    };
  419. X
  420. X# define    B_REDEFINE    0x0001    /* Builtin macro has been    */
  421. X                    /* redefined.            */
  422. X# define    B_NOVALUE    0x0002    /* Dont print accumulator result*/
  423. X                    /* in debug mode.        */
  424. Xtypedef struct BUILTIN    {
  425. X    char    *name;
  426. X    int    (*func)();
  427. X    char    *args;
  428. X    int    flags;
  429. X    int    arg;
  430. X    LIST    *argv;
  431. X    MACRO    *first_macro;
  432. X    MACRO    *macro;        /* Current macro being executed in     */
  433. X                /* recursive keyword execution.        */
  434. X# ifndef    PRODUCTION
  435. X    long    reference;    /* No. of times keyword referenced.    */
  436. X# endif
  437. X    } BUILTIN;
  438. X
  439. Xstruct mac_stack {
  440. X    char    *name;
  441. X    LIST    *argv;
  442. X    };
  443. X
  444. X/*----------------------------------------    
  445. X/*   Following information defines the
  446. X/*   format of characters passed to the
  447. X/*   low level ttputc() function.
  448. X/*
  449. X/*   _____________________________________
  450. X/*   | fg-col | bg-col |  character      |
  451. X/*   -------------------------------------
  452. X/*    15       12       7        0
  453. X/*----------------------------------------*/    
  454. Xtypedef unsigned short BYTE;
  455. X
  456. X# define    FG_COLOR    0xf000
  457. X# define    BG_COLOR    0x0f00
  458. X# define    COLOR_MASK    (FG_COLOR | BG_COLOR)
  459. X
  460. X# define    FG_SHIFT    12
  461. X# define    BG_SHIFT    8 
  462. X# define    FG(x)        ((x) << FG_SHIFT)
  463. X# define    BG(x)        ((x) << BG_SHIFT)
  464. X
  465. X# define    WHITE        7
  466. X/*
  467. X * Display colors.
  468. X */
  469. X# define    CMESSAGE    4
  470. X# define    CERROR        5
  471. Xtypedef struct color {
  472. X    u_int16        c_background;
  473. X    u_int16        c_normal;
  474. X    u_int16        c_select;
  475. X    u_int16        c_messages;
  476. X    u_int16        c_error;
  477. X    u_int16        c_bg;
  478. X    u_int16        c_fg;
  479. X    } COLOR;
  480. X/*--------------------------------------
  481. X *   Define color masks for output bytes.
  482. X *--------------------------------------*/
  483. X# define    CL_MASK        0xe000
  484. X
  485. X/*----------------------------------------    
  486. X/*   Information needed by the pty code.
  487. X/*----------------------------------------*/
  488. X# define    MAX_ESCAPE    40    /* Size of escape sequences.    */
  489. X
  490. X# define    P_ECHO        0x0001    /* Local echo on.        */
  491. X# define    P_NOINSERT    0x0002    /* If on, dont insert to process*/
  492. X# define    P_WAIT        0x8000    /* Waiting for text.        */
  493. X
  494. Xtypedef    struct DISPLAY    {
  495. X        short        d_x,    /* Current cursor position.    */
  496. X                d_y;
  497. X        short        d_cols,    /* Physical size.        */
  498. X                d_rows;
  499. X        BYTE        **d_line;
  500. X                    /* Pointer to each line.    */
  501. X        BYTE        *d_display;
  502. X                    /* Actual display buffer.    */
  503. X        char        d_escape[MAX_ESCAPE];
  504. X                    /* Buffer to assemble escape sequence*/
  505. X        char        *d_escptr;/* Pointer to next byte in     */
  506. X                    /* d_escape.            */
  507. X        BYTE        d_color;/* Color mask to be OR'ed in.    */
  508. X        BYTE        d_attr;    /* Mask telling us whether its  */
  509. X                    /* reverse/bold.        */
  510. X        u_int16        d_flags;
  511. X        int        d_pipe_in;/* Pipe to read from.        */
  512. X        int        d_pipe_out;/* Pipe to write to.        */
  513. X        int        d_pid;    /* Process ID of child.        */
  514. X        u_int16        d_wlen;    /* Number of characters in waitfor*/
  515. X                    /* buffer.            */
  516. X        char        *d_waitfor;/* Queue of characters inserted */
  517. X                    /* into buffer from pty.    */
  518. X        int        d_line_marker;/* Place to insert output. */
  519. X        int        d_col_marker;
  520. X        } DISPLAY;
  521. X
  522. Xextern    r_str    *r_init(), *r_cat(), *r_inc(), *r_linit();
  523. X# if    !defined(STANDALONE)
  524. Xextern struct f fps[MAX_FILES];
  525. Xextern    struct    f    *fp_ptr;
  526. Xextern DEFINE    *def_head,
  527. X        *def_ptr;
  528. Xextern LIST    *delete_atom();
  529. Xextern    SPTREE    *gsym_tbl;
  530. Xextern    SPTREE    *lsym_tbl[MAX_NESTING];
  531. Xextern    struct mac_stack    mac_stack[MAX_NESTING];
  532. Xextern    int    nest_level;
  533. Xextern    int    ms_cnt;
  534. Xextern    OPCODE    acc_type;
  535. Xextern    char    *saccumulator;
  536. Xextern long accumulator;
  537. Xextern    SYMBOL    *lookup();
  538. Xextern    int    argc;
  539. Xextern    LISTV    *argv;
  540. Xextern    char    *get_arg1();
  541. Xextern    Head_p    macrof;
  542. X/*
  543. X * Externals.
  544. X */
  545. Xextern    int    *cur_line;
  546. Xextern    int    *cur_col;
  547. Xextern    LINE    *ntol();
  548. Xextern    u_int16    ncol,
  549. X        nrow,
  550. X        ttcol,
  551. X        ttrow;
  552. Xextern  int    tceeol,
  553. X        tcinsl,
  554. X        tcdell;
  555. X
  556. Xextern    int    epresf,
  557. X        hooked,
  558. X        lastflag,
  559. X        mode,
  560. X        msg_level,
  561. X        sgarbf,
  562. X        thisflag;
  563. Xextern  BUFFER  *curbp,
  564. X        *bheadp;
  565. X
  566. Xextern  BUFFER  *bfind();
  567. Xextern  WINDOW  *curwp;
  568. Xextern  WINDOW  *wheadp;
  569. Xextern  KEY     getkey();
  570. Xextern  LINE    *lalloc();
  571. Xextern    COLOR    col_table;
  572. Xextern    PHYS_TERM    pt;
  573. Xvoid    trace_sym();
  574. X/*
  575. X * Standard I/O.
  576. X */
  577. Xextern MACRO *lookup_macro();
  578. Xextern BUILTIN *lookup_builtin();
  579. Xextern     BUILTIN    builtin[];
  580. Xextern    int    sizeof_builtin;
  581. Xextern    int    msg_level;
  582. X# endif
  583. X# include    "decls.h"
  584. SHAR_EOF
  585. chmod 0444 ./list.h || echo "restore of ./list.h fails"
  586. mkdir . >/dev/null 2>&1
  587. echo "x - extracting ./m-sun3os3.h (Text)"
  588. sed 's/^X//' << 'SHAR_EOF' > ./m-sun3os3.h &&
  589. X/************************************************************************
  590. X *                                                                      *
  591. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  592. X *                                                                      *
  593. X *        (C) Paul Fox, 1989                                            *
  594. X *        43, Jerome Close              Tel: +44 6284 4222              *
  595. X *            Marlow                                                    *
  596. X *             Bucks.                                                   *
  597. X *                England SL7 1TX                                       *
  598. X *                                                                      *
  599. X *                                                                      *
  600. X *    Please See COPYRIGHT notice.                                      *
  601. X *                                                                      *
  602. X *    This   file  contains  various  conditional  compilation  flags   *
  603. X *    which  are  needed  to  support  different  operating  systems.   *
  604. X *    Different  versions  of  this  file  are  supplied  for various   *
  605. X *    operating  systems.  You  should  set  up  a  link  between the   *
  606. X *    m-machine.h  file  and  the  m- file describing your system. If   *
  607. X *    your   system   isn't   supported   then   simply   modify  the   *
  608. X *    definitions  below  as  appropriate. You may need to change the   *
  609. X *    code as well depending on your system.                            *
  610. X ************************************************************************/
  611. X
  612. X/************************************************************************
  613. X *    One  of  the  following should be set to indicate machine type.    *
  614. X *    Some  of  the  definitions  may  apply to more than one machine    *
  615. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  616. X *    generic BSD to try this out on.                    *
  617. X ************************************************************************/
  618. X# define    SUN
  619. X/*# define    SYSV*/
  620. X/*#define    VMS*/
  621. X/************************************************************************
  622. X *    Some  combination  of  the  following  may  need  to be set for    *
  623. X *    operating  system  dependent  features which dont fit under the    *
  624. X *    general category of operating system features.            *
  625. X ************************************************************************/
  626. X# define    BSD
  627. X/*# define    XENIX*/
  628. X
  629. X/************************************************************************
  630. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  631. X *    access include files are wrong. (Are they wrong or right ?)    *
  632. X ************************************************************************/
  633. X# define    DIRSIZ_DEFINED
  634. X/*#undef    DIRSIZ_DEFINED*/
  635. X
  636. X/************************************************************************
  637. X *    The  following  # define is used to control the use of the enum    *
  638. X *    OPCODE  typedef  in  the  list.h.  It doesn't matter if you set    *
  639. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  640. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  641. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  642. X *    complain during compilation.                    *
  643. X ************************************************************************/
  644. X# define        OPCODE    int
  645. X/*#undef OPCODE */
  646. X
  647. X
  648. X/************************************************************************
  649. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  650. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  651. X *    used instead.                            *
  652. X ************************************************************************/
  653. X# undef        HAVE_PTY
  654. X/*# define        HAVE_PTY*/
  655. X
  656. X/************************************************************************
  657. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  658. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  659. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  660. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  661. X *    drivers are streams modules.                    *
  662. X ************************************************************************/
  663. X/*# undef    SELECT*/
  664. X# define    SELECT
  665. X
  666. X/************************************************************************
  667. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  668. X *    define   this   type   in   one  of  the  system  header  files    *
  669. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  670. X *    If  you  have  this  typedef  in  your system header file, then    *
  671. X *    #define U_CHAR. Otherwise undefine it.                *
  672. X ************************************************************************/
  673. X/*#undef        U_CHAR*/
  674. X# define        U_CHAR
  675. X
  676. X
  677. X
  678. SHAR_EOF
  679. chmod 0644 ./m-sun3os3.h || echo "restore of ./m-sun3os3.h fails"
  680. mkdir . >/dev/null 2>&1
  681. echo "x - extracting ./m-sun3os4.h (Text)"
  682. sed 's/^X//' << 'SHAR_EOF' > ./m-sun3os4.h &&
  683. X/************************************************************************
  684. X *                                                                      *
  685. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  686. X *                                                                      *
  687. X *        (C) Paul Fox, 1989                                            *
  688. X *        43, Jerome Close              Tel: +44 6284 4222              *
  689. X *            Marlow                                                    *
  690. X *             Bucks.                                                   *
  691. X *                England SL7 1TX                                       *
  692. X *                                                                      *
  693. X *                                                                      *
  694. X *    Please See COPYRIGHT notice.                                      *
  695. X *                                                                      *
  696. X *    This   file  contains  various  conditional  compilation  flags   *
  697. X *    which  are  needed  to  support  different  operating  systems.   *
  698. X *    Different  versions  of  this  file  are  supplied  for various   *
  699. X *    operating  systems.  You  should  set  up  a  link  between the   *
  700. X *    m-machine.h  file  and  the  m- file describing your system. If   *
  701. X *    your   system   isn't   supported   then   simply   modify  the   *
  702. X *    definitions  below  as  appropriate. You may need to change the   *
  703. X *    code as well depending on your system.                            *
  704. X ************************************************************************/
  705. X
  706. X
  707. X/************************************************************************
  708. X *    One  of  the  following should be set to indicate machine type.    *
  709. X *    Some  of  the  definitions  may  apply to more than one machine    *
  710. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  711. X *    generic BSD to try this out on.                    *
  712. X ************************************************************************/
  713. X# define    SUN
  714. X/*# define    SYSV*/
  715. X/*#define    VMS*/
  716. X/************************************************************************
  717. X *    Some  combination  of  the  following  may  need  to be set for    *
  718. X *    operating  system  dependent  features which dont fit under the    *
  719. X *    general category of operating system features.            *
  720. X ************************************************************************/
  721. X# define    BSD
  722. X/*# define    XENIX*/
  723. X
  724. X/************************************************************************
  725. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  726. X *    access include files are wrong. (Are they wrong or right ?)    *
  727. X ************************************************************************/
  728. X# define    DIRSIZ_DEFINED
  729. X/*#undef    DIRSIZ_DEFINED*/
  730. X
  731. X/************************************************************************
  732. X *    The  following  # define is used to control the use of the enum    *
  733. X *    OPCODE   typedef  in  the  list.h. It doesn't matter if you set    *
  734. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  735. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  736. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  737. X *    complain during compilation.                    *
  738. X ************************************************************************/
  739. X/*# define        OPCODE        int*/
  740. X#undef OPCODE
  741. X
  742. X
  743. X/************************************************************************
  744. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  745. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  746. X *    used instead.                            *
  747. X ************************************************************************/
  748. X# define        HAVE_PTY
  749. X
  750. X/************************************************************************
  751. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  752. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  753. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  754. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  755. X *    drivers are streams modules.                    *
  756. X ************************************************************************/
  757. X# define    SELECT
  758. X
  759. X/************************************************************************
  760. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  761. X *    define   this   type   in   one  of  the  system  header  files    *
  762. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  763. X *    If  you  have  this  typedef  in  your system header file, then    *
  764. X *    #define U_CHAR. Otherwise undefine it.                *
  765. X ************************************************************************/
  766. X/*#undef        U_CHAR*/
  767. X# define        U_CHAR
  768. X
  769. X
  770. X
  771. SHAR_EOF
  772. chmod 0644 ./m-sun3os4.h || echo "restore of ./m-sun3os4.h fails"
  773. mkdir . >/dev/null 2>&1
  774. echo "x - extracting ./m-sysv.h (Text)"
  775. sed 's/^X//' << 'SHAR_EOF' > ./m-sysv.h &&
  776. X/************************************************************************
  777. X *                                                                      *
  778. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  779. X *                                                                      *
  780. X *        (C) Paul Fox, 1989                                            *
  781. X *        43, Jerome Close              Tel: +44 6284 4222              *
  782. X *            Marlow                                                    *
  783. X *             Bucks.                                                   *
  784. X *                England SL7 1TX                                       *
  785. X *                                                                      *
  786. X *                                                                      *
  787. X *    Please See COPYRIGHT notice.                                      *
  788. X *                                                                      *
  789. X *    This file is suitable for the following operating systems:    *
  790. X *                                                                      *
  791. X *         Microport V.3/386                                            *
  792. X *         Interactive V.3/386                                          *
  793. X *                                                                      *
  794. X ************************************************************************/
  795. X
  796. X/************************************************************************
  797. X *    One  of  the  following should be set to indicate machine type.    *
  798. X *    Some  of  the  definitions  may  apply to more than one machine    *
  799. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  800. X *    generic BSD to try this out on.                    *
  801. X ************************************************************************/
  802. X/*# define    SUN*/
  803. X# define    SYSV
  804. X/*#define    VMS*/
  805. X/************************************************************************
  806. X *    Some  combination  of  the  following  may  need  to be set for    *
  807. X *    operating  system  dependent  features which dont fit under the    *
  808. X *    general category of operating system features.            *
  809. X ************************************************************************/
  810. X/*# define    BSD*/
  811. X/*# define    XENIX*/
  812. X
  813. X/************************************************************************
  814. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  815. X *    access include files are wrong. (Are they wrong or right ?)    *
  816. X ************************************************************************/
  817. X/*# define    DIRSIZ_DEFINED*/
  818. X#undef    DIRSIZ_DEFINED
  819. X
  820. X/************************************************************************
  821. X *    The  following  # define is used to control the use of the enum    *
  822. X *    OPCODES  typedef  in  the  list.h. It doesn't matter if you set    *
  823. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  824. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  825. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  826. X *    complain during compilation.                    *
  827. X ************************************************************************/
  828. X/*# define        OPCODE        int*/
  829. X#undef OPCODE
  830. X
  831. X
  832. X/************************************************************************
  833. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  834. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  835. X *    used instead.                            *
  836. X ************************************************************************/
  837. X# undef        HAVE_PTY
  838. X/*# define        HAVE_PTY*/
  839. X
  840. X
  841. X/************************************************************************
  842. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  843. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  844. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  845. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  846. X *    drivers are streams modules.                    *
  847. X ************************************************************************/
  848. X# undef        SELECT
  849. X/*# define    SELECT*/
  850. X
  851. X/************************************************************************
  852. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  853. X *    define   this   type   in   one  of  the  system  header  files    *
  854. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  855. X *    If  you  have  this  typedef  in  your system header file, then    *
  856. X *    #define U_CHAR. Otherwise undefine it.                *
  857. X ************************************************************************/
  858. X#undef        U_CHAR
  859. X/*# define        U_CHAR*/
  860. X
  861. X
  862. X
  863. SHAR_EOF
  864. chmod 0644 ./m-sysv.h || echo "restore of ./m-sysv.h fails"
  865. mkdir . >/dev/null 2>&1
  866. echo "x - extracting ./m-sysv3.2.h (Text)"
  867. sed 's/^X//' << 'SHAR_EOF' > ./m-sysv3.2.h &&
  868. X/************************************************************************
  869. X *                                                                      *
  870. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  871. X *                                                                      *
  872. X *        (C) Paul Fox, 1989                                            *
  873. X *        43, Jerome Close              Tel: +44 6284 4222              *
  874. X *            Marlow                                                    *
  875. X *             Bucks.                                                   *
  876. X *                England SL7 1TX                                       *
  877. X *                                                                      *
  878. X *                                                                      *
  879. X *    Please See COPYRIGHT notice.                                      *
  880. X *                                                                      *
  881. X *    This file is suitable for the following operating systems:    *
  882. X *                                                                      *
  883. X *         Interactive V.3.2/386                                        *
  884. X *                                                                      *
  885. X ************************************************************************/
  886. X
  887. X/************************************************************************
  888. X *    One  of  the  following should be set to indicate machine type.    *
  889. X *    Some  of  the  definitions  may  apply to more than one machine    *
  890. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  891. X *    generic BSD to try this out on.                    *
  892. X ************************************************************************/
  893. X/*# define    SUN*/
  894. X# define    SYSV
  895. X/*#define    VMS*/
  896. X/************************************************************************
  897. X *    Some  combination  of  the  following  may  need  to be set for    *
  898. X *    operating  system  dependent  features which dont fit under the    *
  899. X *    general category of operating system features.            *
  900. X ************************************************************************/
  901. X/*# define    BSD*/
  902. X/*# define    XENIX*/
  903. X
  904. X/************************************************************************
  905. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  906. X *    access include files are wrong. (Are they wrong or right ?)    *
  907. X ************************************************************************/
  908. X/*# define    DIRSIZ_DEFINED*/
  909. X#undef    DIRSIZ_DEFINED
  910. X
  911. X/************************************************************************
  912. X *    The  following  # define is used to control the use of the enum    *
  913. X *    OPCODE   typedef  in  the  list.h. It doesn't matter if you set    *
  914. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  915. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  916. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  917. X *    complain during compilation.                    *
  918. X ************************************************************************/
  919. X/*# define        OPCODE        int*/
  920. X#undef OPCODE
  921. X
  922. X
  923. X/************************************************************************
  924. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  925. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  926. X *    used instead.                            *
  927. X ************************************************************************/
  928. X# undef        HAVE_PTY
  929. X/*# define        HAVE_PTY*/
  930. X
  931. X
  932. X/************************************************************************
  933. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  934. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  935. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  936. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  937. X *    drivers are streams modules.                    *
  938. X ************************************************************************/
  939. X# undef        SELECT
  940. X/*# define    SELECT*/
  941. X
  942. X/************************************************************************
  943. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  944. X *    define   this   type   in   one  of  the  system  header  files    *
  945. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  946. X *    If  you  have  this  typedef  in  your system header file, then    *
  947. X *    #define U_CHAR. Otherwise undefine it.                *
  948. X ************************************************************************/
  949. X#undef        U_CHAR
  950. X/*# define        U_CHAR*/
  951. X
  952. X/************************************************************************
  953. X *    If  EGA43  is  defined, then the Unix V.3.2 ioctl() for putting    *
  954. X *    PC display into 43 line mode is available.            *
  955. X ************************************************************************/
  956. X# define    EGA43
  957. X/* #undef    EGA43*/
  958. X
  959. X
  960. SHAR_EOF
  961. chmod 0644 ./m-sysv3.2.h || echo "restore of ./m-sysv3.2.h fails"
  962. mkdir . >/dev/null 2>&1
  963. echo "x - extracting ./m-vms.h (Text)"
  964. sed 's/^X//' << 'SHAR_EOF' > ./m-vms.h &&
  965. X/************************************************************************
  966. X *                                                                      *
  967. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  968. X *                                                                      *
  969. X *        (C) Paul Fox, 1989                                            *
  970. X *        43, Jerome Close              Tel: +44 6284 4222              *
  971. X *            Marlow                                                    *
  972. X *             Bucks.                                                   *
  973. X *                England SL7 1TX                                       *
  974. X *                                                                      *
  975. X *                                                                      *
  976. X *    Please See COPYRIGHT notice.                                      *
  977. X *                                                                      *
  978. X *    This file is suitable for the following operating systems:    *
  979. X *                                                                      *
  980. X *         VAX/VMS.                                                     *
  981. X *                                                                      *
  982. X ************************************************************************/
  983. X
  984. X/************************************************************************
  985. X *    One  of  the  following should be set to indicate machine type.    *
  986. X *    Some  of  the  definitions  may  apply to more than one machine    *
  987. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  988. X *    generic BSD to try this out on.                    *
  989. X ************************************************************************/
  990. X/*# define    SUN*/
  991. X/*# define    SYSV*/
  992. X#define    VMS
  993. X/************************************************************************
  994. X *    Some  combination  of  the  following  may  need  to be set for    *
  995. X *    operating  system  dependent  features which dont fit under the    *
  996. X *    general category of operating system features.            *
  997. X ************************************************************************/
  998. X/*# define    BSD*/
  999. X/*# define    XENIX*/
  1000. X
  1001. X/************************************************************************
  1002. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  1003. X *    access include files are wrong. (Are they wrong or right ?)    *
  1004. X ************************************************************************/
  1005. X# define    DIRSIZ_DEFINED
  1006. X
  1007. X/************************************************************************
  1008. X *    The   MALLOC  definition  tells  the  code  that  there  is  no    *
  1009. X *    <malloc.h>  file  and  that  the malloc() library may behave in    *
  1010. X *    strange  ways  which  may force us to optimise our usage. It is    *
  1011. X *    really  only  necessary if your system doesn't support the SVID    *
  1012. X *    mallopt() call. drivers are streams modules.            *
  1013. X ************************************************************************/
  1014. X# define    MALLOC
  1015. X
  1016. X/************************************************************************
  1017. X *    The  following  # define is used to control the use of the enum    *
  1018. X *    OPCODES  typedef  in  the  list.h. It doesn't matter if you set    *
  1019. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  1020. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  1021. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  1022. X *    complain during compilation.                    *
  1023. X ************************************************************************/
  1024. X/*# define        OPCODE        int*/
  1025. X
  1026. X
  1027. X/************************************************************************
  1028. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  1029. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  1030. X *    used instead.                            *
  1031. X ************************************************************************/
  1032. X/*# define        HAVE_PTY*/
  1033. X
  1034. X
  1035. X/************************************************************************
  1036. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  1037. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  1038. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  1039. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  1040. X *    drivers are streams modules.                    *
  1041. X ************************************************************************/
  1042. X/*# define    SELECT*/
  1043. X
  1044. X/************************************************************************
  1045. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  1046. X *    define   this   type   in   one  of  the  system  header  files    *
  1047. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  1048. X *    If  you  have  this  typedef  in  your system header file, then    *
  1049. X *    #define U_CHAR. Otherwise undefine it.                *
  1050. X ************************************************************************/
  1051. X/*# define        U_CHAR*/
  1052. X
  1053. X
  1054. X
  1055. SHAR_EOF
  1056. chmod 0644 ./m-vms.h || echo "restore of ./m-vms.h fails"
  1057. mkdir . >/dev/null 2>&1
  1058. echo "x - extracting ./m-xenix.h (Text)"
  1059. sed 's/^X//' << 'SHAR_EOF' > ./m-xenix.h &&
  1060. X/************************************************************************
  1061. X *                                                                      *
  1062. X *        CRISP - Custom Reduced Instruction Set Programmers Editor     *
  1063. X *                                                                      *
  1064. X *        (C) Paul Fox, 1989                                            *
  1065. X *        43, Jerome Close              Tel: +44 6284 4222              *
  1066. X *            Marlow                                                    *
  1067. X *             Bucks.                                                   *
  1068. X *                England SL7 1TX                                       *
  1069. X *                                                                      *
  1070. X *                                                                      *
  1071. X *    Please See COPYRIGHT notice.                                      *
  1072. X *                                                                      *
  1073. X *    This file is suitable for the following operating systems:    *
  1074. X *                                                                      *
  1075. X *         Xenix System V/386                                           *
  1076. X *         Xenix System V/286 (possibly - untested).                    *
  1077. X *                                                                      *
  1078. X ************************************************************************/
  1079. X
  1080. X/************************************************************************
  1081. X *    One  of  the  following should be set to indicate machine type.    *
  1082. X *    Some  of  the  definitions  may  apply to more than one machine    *
  1083. X *    type,  eg  SUN may be more indicative of BSD, but I dont have a    *
  1084. X *    generic BSD to try this out on.                    *
  1085. X ************************************************************************/
  1086. X/*# define    SUN*/
  1087. X# define    SYSV
  1088. X/*#define    VMS*/
  1089. X/************************************************************************
  1090. X *    Some  combination  of  the  following  may  need  to be set for    *
  1091. X *    operating  system  dependent  features which dont fit under the    *
  1092. X *    general category of operating system features.            *
  1093. X ************************************************************************/
  1094. X/*# define    BSD*/
  1095. X/*# define    XENIX*/
  1096. X
  1097. X/************************************************************************
  1098. X *    DIRSIZ_DEFINED  should  be  define'd  if  the  POSIX  directory    *
  1099. X *    access include files are wrong. (Are they wrong or right ?)    *
  1100. X ************************************************************************/
  1101. X/*# define    DIRSIZ_DEFINED*/
  1102. X#undef    DIRSIZ_DEFINED
  1103. X
  1104. X/************************************************************************
  1105. X *    The  following  # define is used to control the use of the enum    *
  1106. X *    OPCODE   typedef  in  the  list.h. It doesn't matter if you set    *
  1107. X *    this  to  'int'  as  below,  but  if it is undefined then it is    *
  1108. X *    easier  to  debug  the  CRISP lisp-code. Older Unix C compilers    *
  1109. X *    do  not  treat  enum's  and  int's  as  the  same type and will    *
  1110. X *    complain during compilation.                    *
  1111. X ************************************************************************/
  1112. X# define        OPCODE        int
  1113. X/*#undef OPCODE */
  1114. X
  1115. X
  1116. X/************************************************************************
  1117. X *    If  you  have  support  for  pty's  in your kernel, then define    *
  1118. X *    HAVE_PTY.  If  not  #undef it, and normal unnamed pipes will be    *
  1119. X *    used instead.                            *
  1120. X ************************************************************************/
  1121. X# undef        HAVE_PTY
  1122. X/*# define        HAVE_PTY*/
  1123. X
  1124. X/************************************************************************
  1125. X *    SELECT  should  be  defined  if  we  can  do  a select() on the    *
  1126. X *    keyboard  and  on the process pty's/pipes. This will tend to be    *
  1127. X *    true   on   BSD  systems,  and  Sys  V.4.  Alas,  poll()  isn't    *
  1128. X *    generally  applicable  on V.3 because the standard pipe and tty    *
  1129. X *    drivers are streams modules.                    *
  1130. X ************************************************************************/
  1131. X# undef        SELECT
  1132. X/*# define    SELECT*/
  1133. X
  1134. X/************************************************************************
  1135. X *    CRISP  defines  a typedef called u_char. Some Unix systems also    *
  1136. X *    define   this   type   in   one  of  the  system  header  files    *
  1137. X *    (/usr/include/sys/types.h)  which  causes  a compilation error.    *
  1138. X *    If  you  have  this  typedef  in  your system header file, then    *
  1139. X *    #define U_CHAR. Otherwise undefine it.                *
  1140. X ************************************************************************/
  1141. X#undef        U_CHAR
  1142. X/*# define        U_CHAR*/
  1143. X
  1144. X
  1145. X
  1146. SHAR_EOF
  1147. chmod 0644 ./m-xenix.h || echo "restore of ./m-xenix.h fails"
  1148. mkdir . >/dev/null 2>&1
  1149. echo "x - extracting ./regexp.h (Text)"
  1150. sed 's/^X//' << 'SHAR_EOF' > ./regexp.h &&
  1151. X/**************************************************************
  1152. X *
  1153. X *    CRISP - Custom Reduced Instruction Set Programmers Editor
  1154. X *
  1155. X *    (C) Paul Fox, 1989
  1156. X *    43, Jerome Close          Tel: +44 6284 4222
  1157. X *        Marlow
  1158. X *         Bucks.
  1159. X *        England SL7 1TX
  1160. X *
  1161. X *
  1162. X *    Please See COPYRIGHT notice.
  1163. X *
  1164. X **************************************************************/
  1165. X#define NSUBEXP  10
  1166. Xtypedef struct REGEXP {
  1167. X    char    *startp[NSUBEXP];
  1168. X    char    *endp[NSUBEXP];
  1169. X    char    *start;
  1170. X    char    *end;
  1171. X    int    exp_level;    /* Highest level of {} parsed.    */
  1172. X    char    *setpos;
  1173. X    char    *program;
  1174. X    } REGEXP;
  1175. X
  1176. Xextern REGEXP *regcomp();
  1177. X
  1178. SHAR_EOF
  1179. chmod 0444 ./regexp.h || echo "restore of ./regexp.h fails"
  1180. mkdir . >/dev/null 2>&1
  1181. echo "x - extracting ./sptree.h (Text)"
  1182. sed 's/^X//' << 'SHAR_EOF' > ./sptree.h &&
  1183. X/*
  1184. X** sptree.h:  The following type declarations provide the binary tree
  1185. X**  representation of event-sets or priority queues needed by splay trees
  1186. X**
  1187. X**  assumes that data and datb will be provided by the application
  1188. X**  to hold all application specific information
  1189. X**
  1190. X**  assumes that key will be provided by the application, comparable
  1191. X**  with the compare function applied to the addresses of two keys.
  1192. X*/
  1193. X
  1194. X# ifndef SPTREE_H
  1195. X# define SPTREE_H
  1196. X
  1197. X# ifndef NULL
  1198. X# define NULL    0
  1199. X# endif
  1200. X
  1201. X# define STRCMP( a, b ) ( (Sct = *(a) - *(b)) ? Sct : strcmp( (a), (b) ) )
  1202. X
  1203. Xtypedef struct _spblk
  1204. X{
  1205. X    struct _spblk    * leftlink;
  1206. X    struct _spblk    * rightlink;
  1207. X    struct _spblk    * uplink;
  1208. X    char    * key;        /* formerly time/timetyp */
  1209. X    char    * data;        /* formerly aux/auxtype */
  1210. X    char    * datb;
  1211. X} SPBLK;
  1212. X
  1213. X# define    SPF_WALK    0x0001    /* If set, we cannot splay tree */
  1214. X                    /* because we are walking down the tree*/
  1215. Xtypedef struct _sptree
  1216. X{
  1217. X    SPBLK    * root;        /* root node */
  1218. X    int    flags;
  1219. X
  1220. X    /* Statistics, not strictly necessary, but handy for tuning  */
  1221. X
  1222. X    long    lookups;    /* number of splookup()s */
  1223. X    long    lkpcmps;    /* number of lookup comparisons */
  1224. X    
  1225. X    long    enqs;        /* number of spenq()s */
  1226. X    long    enqcmps;    /* compares in spenq */
  1227. X    
  1228. X    long    splays;
  1229. X    long    splayloops;
  1230. X
  1231. X} SPTREE;
  1232. X
  1233. X
  1234. X/* sptree.c */
  1235. Xextern SPTREE * spinit();    /* init tree */
  1236. Xextern int spempty();        /* is tree empty? */
  1237. Xextern spenq();        /* insert item into the tree */
  1238. Xextern spdeq();        /* return and remove lowest item in subtree */
  1239. Xextern splay();        /* reorganize tree */
  1240. Xextern SPBLK *sprotate();
  1241. Xextern SPBLK * splookup();    /* find key in a tree */
  1242. Xextern SPBLK    *sphead();
  1243. Xextern    char    *spstats();
  1244. X# endif
  1245. SHAR_EOF
  1246. chmod 0444 ./sptree.h || echo "restore of ./sptree.h fails"
  1247. mkdir . >/dev/null 2>&1
  1248. echo "x - extracting ./anchor.c (Text)"
  1249. sed 's/^X//' << 'SHAR_EOF' > ./anchor.c &&
  1250. X/**************************************************************
  1251. X *
  1252. X *    CRISP - Custom Reduced Instruction Set Programmers Editor
  1253. X *
  1254. X *    (C) Paul Fox, 1989
  1255. X *    43, Jerome Close          Tel: +44 6284 4222
  1256. X *        Marlow
  1257. X *         Bucks.
  1258. X *        England SL7 1TX
  1259. X *
  1260. X *
  1261. X *    Please See COPYRIGHT notice.
  1262. X *
  1263. X **************************************************************/
  1264. X# include    "list.h"
  1265. X
  1266. XSCCSID("@(#) anchor.c 1.7, (C) 1988, P. Fox");
  1267. SHAR_EOF
  1268. echo "End of part 2"
  1269. echo "File ./anchor.c is continued in part 3"
  1270. echo "3" > s2_seq_.tmp
  1271. exit 0
  1272. -- 
  1273. =====================            Reuters Ltd PLC, 
  1274. Tel: +44 628 891313 x. 212         Westthorpe House,
  1275. UUCP:     fox%marlow.uucp@idec.stc.co.uk  Little Marlow,
  1276.                        Bucks, England SL7 3RQ
  1277.  
  1278.