allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (07/23/89)
Posting-number: Volume 7, Issue 43 Submitted-by: fox@marlow.UUCP (Paul Fox) Archive-name: crisp1.9/part23 #!/bin/sh # this is part 2 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file ./def.h continued # CurArch=2 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 echo "x - Continuing file ./def.h" sed 's/^X//' << 'SHAR_EOF' >> ./def.h X /* line. */ X char b_nwnd; /* Count of windows on buffer */ X u_int16 b_flag; /* Flags */ X char b_fname[NFILEN]; /* File name */ X char *b_title; /* Title from create_buffer. */ X short b_bufnum; /* Buffer number. */ X short b_system; /* Non-zero if system buffer. */ X undo_info b_undo; X undo_info b_redo; X long b_nummod; /* No. of modifications to buffer. */ X /* When zero, buffer has not been*/ X /* modified. */ X char b_uchar; /* Last character selfinserted */ X /* to do undo collapsing. */ X int b_mode; /* Mode for chmod(). */ X u_int16 b_tabs[NTABS+1]; /* Tab columns. */ X Head_p b_alist; /* Anchor list. */ X SPTREE *b_syms; /* Local symbols. */ X struct ANCHOR *b_anchor; /* Pointer to current anchor. */ X struct DISPLAY *b_display; /* Pointer to screen buffer if this*/ X /* buffer is attached to a pty. */ X int b_wstat; /* Exit status of child process.*/ X struct kbd_stk *b_keyboard; /* Local keyboard. */ X Head_p b_register; /* List of registered macros */ X char **b_chunk; /* Original file. */ X} BUFFER; X X#define BFCHG 0x01 /* Changed. */ X#define BFBAK 0x02 /* Need to make a backup. */ X#define BFRO 0x04 /* Read-only. */ X#define BFREAD 0x08 /* Buffer needs to be read in. */ X#define BFEXEC 0x10 /* File is executable. */ X#define BFPROC 0x20 /* Buffer has process attached. */ X#define BFBINARY 0x40 /* Binary buffer. */ X#define BFANSI 0x80 /* If TRUE, ANSI-fication is done.*/ X Xtypedef struct ANCHOR { X u_int16 a_type; X int a_line; X int a_offset; X } ANCHOR; X X# define MAX_PT 20 X/* X/* /-------+------\ X/* | | | X/* +-------+------+ X/* | | | X/* \-------+------/ X/*----------------------------------------------*/ Xtypedef struct pt { X char pt_top_left[MAX_PT]; /* Top left corner. */ X char pt_top_right[MAX_PT]; /* Top right corner. */ X char pt_bot_left[MAX_PT]; /* Bottom left corner. */ X char pt_bot_right[MAX_PT]; /* Bottom right corner. */ X char pt_vertical[MAX_PT]; /* Vertical Line. */ X char pt_horizontal[MAX_PT]; /* Horizontal line. */ X char pt_top_join[MAX_PT]; /* Horizontal line, with */ X /* Vertical join going down */ X char pt_bot_join[MAX_PT]; /* Horizontal line, with */ X /* vertical join going up */ X char pt_cross[MAX_PT]; /* Four way intersection. */ X char pt_left_join[MAX_PT]; /* Vertical line with join */ X /* going left. */ X char pt_right_join[MAX_PT]; /* Vertical line with join */ X /* going right. */ X char pt_space[MAX_PT]; /* Escape sequence to */ X /* erase multiple spaces. */ X /* eg ESC [ %d X on Xenix */ X char pt_character[MAX_PT]; /* Sequence to print */ X /* special characters, */ X /* eg ESC [ %d g on Xenix */ X char pt_icursor[MAX_PT]; /* Escape sequence for insert*/ X /* mode cursor. */ X char pt_ocursor[MAX_PT]; /* Escape sequence for overst*/ X /* mode cursor. */ X char pt_vicursor[MAX_PT]; /* Escape sequence for insert*/ X /* mode cursor. (Virtual) */ X char pt_vocursor[MAX_PT]; /* Escape sequence for overst*/ X /* mode cursor. (Virtual) */ X char pt_escape[MAX_PT]; /* Sequence to print ESC. */ X char pt_repeat[MAX_PT]; /* Sequence for repeating last*/ X /* character. */ X char pt_0m; /* ESC [ 0m resets color as well */ X /* as character attributes. */ X char pt_color; /* TRUE if terminal supports */ X /* color. */ X char pt_escC[MAX_PT]; /* Sequence to move cursor */ X /* on same line. */ X } PHYS_TERM; X X# define CH_MIN 240 X# define CH_HORIZONTAL CH_MIN+0 X# define CH_VERTICAL CH_MIN+1 X# define CH_TOP_LEFT CH_MIN+2 X# define CH_TOP_RIGHT CH_MIN+3 X# define CH_BOT_LEFT CH_MIN+4 X# define CH_BOT_RIGHT CH_MIN+5 X# define CH_TOP_JOIN CH_MIN+6 X# define CH_BOT_JOIN CH_MIN+7 X# define CH_LEFT_JOIN CH_MIN+8 X# define CH_RIGHT_JOIN CH_MIN+9 X# define CH_CROSS CH_MIN+10 X# define CH_MAX CH_MIN+10 X/** X * All text is kept in circularly linked X * lists of "LINE" structures. These begin at the X * header line (which is the blank line beyond the X * end of the buffer). This line is pointed to by X * the "BUFFER". Each line contains a the number of X * bytes in the line (the "used" size), the size X * of the text array, and the text. The end of line X * is not stored as a byte; it's implied. Future X * additions will include update hints, and a X * list of marks into the line. X */ X# define L_INCORE 0x0001 /* Line is in-memory. */ X# define L_LOCKED 0x0002 /* Line has been locked. */ X# define L_FILE 0x0004 /* Line must be copied before */ X /* operating on. */ Xtypedef struct LINE { X struct LINE *l_fp; /* Link to the next line */ X struct LINE *l_bp; /* Link to the previous line */ X u_int16 l_size; /* Allocated size */ X u_int16 l_used; /* Used size */ X u_int16 l_lineno; /* Old line number. */ X u_int16 l_flags; X union { X u_char *text; X long tell; /* Offset in file when swapped out.*/ X } u; X } LINE; X# define l_tell u.tell X# define l_text u.text X X/* X * The rationale behind these macros is that you X * could (with some editing, like changing the type of a line X * link from a "LINE *" to a "REFLINE", and fixing the commands X * like file reading that break the rules) change the actual X * storage representation of lines to use something fancy on X * machines with small address spaces. X */ X#define lforw(lp) ((lp)->l_fp) X#define lback(lp) ((lp)->l_bp) X#define lgetc(lp, n) ((lp)->l_text[(n)]) X#define ltext(lp) ((lp)->l_text) X#define llength(lp) ((lp)->l_used) X X# define SWAP(a,b,c) c=a,a=b,b=c X#endif Xchar *getenv(); Xchar *strtok(); X SHAR_EOF echo "File ./def.h is complete" chmod 0444 ./def.h || echo "restore of ./def.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./gdir.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./gdir.h && X# if defined(VMS) X# include "vmsdir.h" X# else X# include <sys/dir.h> X# endif X X# if defined(DIRSIZ_DEFINED) X# if defined(DIRSIZ) X# undef DIRSIZ X# endif X# define DIRSIZ MAXNAMLEN X# define dirent direct X# else X# include <dirent.h> X# endif X SHAR_EOF chmod 0444 ./gdir.h || echo "restore of ./gdir.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./list.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./list.h && X/************************************************************** X * X * CRISP - Custom Reduced Instruction Set Programmers Editor X * X * (C) Paul Fox, 1989 X * 43, Jerome Close Tel: +44 6284 4222 X * Marlow X * Bucks. X * England SL7 1TX X * X * X * Please See COPYRIGHT notice. X * X **************************************************************/ X# include "def.h" X X# if defined(l_next) X# undef l_next X# endif X X#ifndef _U X# include <ctype.h> X#endif X# include "regexp.h" Xtypedef short int16; Xtypedef unsigned char LIST; X X# define MAX_ARGC 12 X# define MAX_MACROS 256 X# define MAX_NESTING 128 X# define SYMLEN 32 X X# define vm_lock_line(line) linep(line) X# define vm_unlock(line) X/*--------------------------------------- X * Registered macro types. X *---------------------------------------*/ X# define REG_TYPED 0 /* Character typed. */ X# define REG_EDIT 1 /* Different file edited. */ X# define REG_ALT_H 2 /* ALT-H pressed in response */ X /* to a prompt. */ X# define REG_UNASSIGNED 3 /* Unassigned key pressed. */ X# define REG_IDLE 4 /* Idle time expired. */ X# define REG_EXIT 5 /* About to exit. */ X# define REG_NEW 6 /* New file edited and readin. */ X# define REG_CTRLC 7 /* CTRL-C (SIGINT) pressed */ X /* during macro execution. */ X# define REG_INVALID 8 /* Invalid key pressed during */ X /* response input. */ X# define REG_INTERNAL 9 /* Internal error. */ X# define REG_MAX 9 X X/*--------------------------------------- X * Reference string structure. X *---------------------------------------*/ Xtypedef struct r_str { X char *r_str; X int r_ref; X int r_used; X int r_size; X } r_str; X/*--------------------------------------- X * List-macro definitions. X *---------------------------------------*/ X# define is_id(list) (list->l_flags == F_ID) X# define is_int(list) (list->l_flags == F_INT) X# define is_list(list) (list->l_flags == F_LIST) X X# ifdef OPCODE X# define F_ERROR -1 /* Non-existant case. */ X# define F_HALT 0 /* End of List. */ X# define F_INT 1 /* 32-bit integer. */ X# define F_STR 2 /* Unquoted string. */ X# define F_LIST 3 /* List. */ X# define F_NULL 4 /* Used as destination of loops.*/ X# define F_ID 5 /* 16-bit keyword. */ X# define F_END 6 /* End of list. */ X# define F_POLY 7 /* Symbol is polymorphic. */ X# define F_LIT 8 /* Pointer to literal string. */ X# define F_RSTR 9 /* Pointer to reference string. */ X# else Xtypedef enum opcodes { X F_ERROR = -1, /* Non-existant case. */ X F_HALT = 0, /* End of List. */ X F_INT = 1, /* 32-bit integer. */ X F_STR = 2, /* Unquoted string. */ X F_LIST = 3, /* List. */ X F_NULL = 4, /* Used as destination of loops.*/ X F_ID = 5, /* 16-bit keyword. */ X F_END = 6, /* End of list. */ X F_POLY = 7, /* Symbol is polymorphic. */ X F_LIT = 8, /* Pointer to literal string. */ X F_RSTR = 9, /* Pointer to reference string. */ X } OPCODE; X# endif Xextern char *get_str(); Xvoid LPUT16(); Xvoid LPUT32(); Xlong LGET32(); Xu_int16 LGET16(); X X# define NOOP 0 X# define PLUS 1 X# define MINUS 2 X# define MULTIPLY 3 X# define DIVIDE 4 X# define MODULO 5 X# define EQ 6 X# define NE 7 X# define LT 8 X# define LE 9 X# define GT 10 X# define GE 11 X# define ABOVE 12 X# define ABOVE_EQ 13 X# define BELOW 14 X# define BELOW_EQ 15 X# define BNOT 16 X# define BAND 17 X# define BOR 18 X# define BXOR 19 X Xextern int sizeof_atoms[]; X X# define SF_POLY 0x01 /* Symbol is polymorphic. */ X# define SF_RO 0x02 /* Symbol is read-only. */ Xtypedef struct SYMBOL { X char s_name[SYMLEN]; X OPCODE s_type; X u_char s_flag; X union { X r_str *str; X long l; X LIST *list; X } s_v; X } SYMBOL; X# define s_int s_v.l X# define s_str s_v.str X# define s_list s_v.list X Xtypedef struct define { X char *name; X char *value; X struct define *next; X } DEFINE; X X X/* Following typedef for argv's benefit only. */ Xtypedef struct LISTV { X OPCODE l_flags; X union { X r_str *ref_str; X char *string; X long integer; X SYMBOL *symbol; X LIST *list; X } u; X } LISTV; X# define l_str u.string X# define l_rstr u.ref_str X# define l_int u.integer X# define l_list u.list X# define l_sym u.symbol X# define lnext(lp) ((lp)->l_next ? (lp) + (lp)->l_next : 0) X# define lnull(lp) (lp->l_next == 0) X# define llist(lp) ((lp)->l_int ? (lp) + (lp)->l_int : 0) X X# define M_AUTOLOAD 0x01 /* Macro needs to be autoloaded */ X /* on reference. */ Xtypedef struct MACRO { X char *m_name; X short m_flags; X short m_ftime; X LIST *m_list; X int m_size; /* Size of macro in atoms. */ X struct MACRO *m_next; /* Next macro in list for this file.*/ X } MACRO; X X/*------------------------------------ X * Typedef for list of macro files. X * All this info is needed in case we X * delete the macro. X *------------------------------------*/ Xtypedef struct MACROF { X char *mf_name; X char *mf_list; X MACRO *mf_macro; X } MACROF; X/*-------------------------------- X * Define debug flags. X *--------------------------------*/ X# define DB_REGEXP 0x0002 /* Regular expression debug output*/ X# define DB_UNDO 0x0004 /* Undo trace. */ X# define DB_PROMPT 0x0008 /* Debug prompting code. */ X X# define MAX_FILES 10 X X# define TERMINAL 0x01 Xstruct f { X char *bufp; X char *buf; X char *bufend; X int fd; X int line_no; X int flags; X off_t size; X char name[64]; X }; X X# define B_REDEFINE 0x0001 /* Builtin macro has been */ X /* redefined. */ X# define B_NOVALUE 0x0002 /* Dont print accumulator result*/ X /* in debug mode. */ Xtypedef struct BUILTIN { X char *name; X int (*func)(); X char *args; X int flags; X int arg; X LIST *argv; X MACRO *first_macro; X MACRO *macro; /* Current macro being executed in */ X /* recursive keyword execution. */ X# ifndef PRODUCTION X long reference; /* No. of times keyword referenced. */ X# endif X } BUILTIN; X Xstruct mac_stack { X char *name; X LIST *argv; X }; X X/*---------------------------------------- X/* Following information defines the X/* format of characters passed to the X/* low level ttputc() function. X/* X/* _____________________________________ X/* | fg-col | bg-col | character | X/* ------------------------------------- X/* 15 12 7 0 X/*----------------------------------------*/ Xtypedef unsigned short BYTE; X X# define FG_COLOR 0xf000 X# define BG_COLOR 0x0f00 X# define COLOR_MASK (FG_COLOR | BG_COLOR) X X# define FG_SHIFT 12 X# define BG_SHIFT 8 X# define FG(x) ((x) << FG_SHIFT) X# define BG(x) ((x) << BG_SHIFT) X X# define WHITE 7 X/* X * Display colors. X */ X# define CMESSAGE 4 X# define CERROR 5 Xtypedef struct color { X u_int16 c_background; X u_int16 c_normal; X u_int16 c_select; X u_int16 c_messages; X u_int16 c_error; X u_int16 c_bg; X u_int16 c_fg; X } COLOR; X/*-------------------------------------- X * Define color masks for output bytes. X *--------------------------------------*/ X# define CL_MASK 0xe000 X X/*---------------------------------------- X/* Information needed by the pty code. X/*----------------------------------------*/ X# define MAX_ESCAPE 40 /* Size of escape sequences. */ X X# define P_ECHO 0x0001 /* Local echo on. */ X# define P_NOINSERT 0x0002 /* If on, dont insert to process*/ X# define P_WAIT 0x8000 /* Waiting for text. */ X Xtypedef struct DISPLAY { X short d_x, /* Current cursor position. */ X d_y; X short d_cols, /* Physical size. */ X d_rows; X BYTE **d_line; X /* Pointer to each line. */ X BYTE *d_display; X /* Actual display buffer. */ X char d_escape[MAX_ESCAPE]; X /* Buffer to assemble escape sequence*/ X char *d_escptr;/* Pointer to next byte in */ X /* d_escape. */ X BYTE d_color;/* Color mask to be OR'ed in. */ X BYTE d_attr; /* Mask telling us whether its */ X /* reverse/bold. */ X u_int16 d_flags; X int d_pipe_in;/* Pipe to read from. */ X int d_pipe_out;/* Pipe to write to. */ X int d_pid; /* Process ID of child. */ X u_int16 d_wlen; /* Number of characters in waitfor*/ X /* buffer. */ X char *d_waitfor;/* Queue of characters inserted */ X /* into buffer from pty. */ X int d_line_marker;/* Place to insert output. */ X int d_col_marker; X } DISPLAY; X Xextern r_str *r_init(), *r_cat(), *r_inc(), *r_linit(); X# if !defined(STANDALONE) Xextern struct f fps[MAX_FILES]; Xextern struct f *fp_ptr; Xextern DEFINE *def_head, X *def_ptr; Xextern LIST *delete_atom(); Xextern SPTREE *gsym_tbl; Xextern SPTREE *lsym_tbl[MAX_NESTING]; Xextern struct mac_stack mac_stack[MAX_NESTING]; Xextern int nest_level; Xextern int ms_cnt; Xextern OPCODE acc_type; Xextern char *saccumulator; Xextern long accumulator; Xextern SYMBOL *lookup(); Xextern int argc; Xextern LISTV *argv; Xextern char *get_arg1(); Xextern Head_p macrof; X/* X * Externals. X */ Xextern int *cur_line; Xextern int *cur_col; Xextern LINE *ntol(); Xextern u_int16 ncol, X nrow, X ttcol, X ttrow; Xextern int tceeol, X tcinsl, X tcdell; X Xextern int epresf, X hooked, X lastflag, X mode, X msg_level, X sgarbf, X thisflag; Xextern BUFFER *curbp, X *bheadp; X Xextern BUFFER *bfind(); Xextern WINDOW *curwp; Xextern WINDOW *wheadp; Xextern KEY getkey(); Xextern LINE *lalloc(); Xextern COLOR col_table; Xextern PHYS_TERM pt; Xvoid trace_sym(); X/* X * Standard I/O. X */ Xextern MACRO *lookup_macro(); Xextern BUILTIN *lookup_builtin(); Xextern BUILTIN builtin[]; Xextern int sizeof_builtin; Xextern int msg_level; X# endif X# include "decls.h" SHAR_EOF chmod 0444 ./list.h || echo "restore of ./list.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-sun3os3.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-sun3os3.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file contains various conditional compilation flags * X * which are needed to support different operating systems. * X * Different versions of this file are supplied for various * X * operating systems. You should set up a link between the * X * m-machine.h file and the m- file describing your system. If * X * your system isn't supported then simply modify the * X * definitions below as appropriate. You may need to change the * X * code as well depending on your system. * X ************************************************************************/ X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X# define SUN X/*# define SYSV*/ X/*#define VMS*/ X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X# define BSD X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X# define DIRSIZ_DEFINED X/*#undef DIRSIZ_DEFINED*/ X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODE typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X# define OPCODE int X/*#undef OPCODE */ X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X# undef HAVE_PTY X/*# define HAVE_PTY*/ X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X/*# undef SELECT*/ X# define SELECT X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X/*#undef U_CHAR*/ X# define U_CHAR X X X SHAR_EOF chmod 0644 ./m-sun3os3.h || echo "restore of ./m-sun3os3.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-sun3os4.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-sun3os4.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file contains various conditional compilation flags * X * which are needed to support different operating systems. * X * Different versions of this file are supplied for various * X * operating systems. You should set up a link between the * X * m-machine.h file and the m- file describing your system. If * X * your system isn't supported then simply modify the * X * definitions below as appropriate. You may need to change the * X * code as well depending on your system. * X ************************************************************************/ X X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X# define SUN X/*# define SYSV*/ X/*#define VMS*/ X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X# define BSD X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X# define DIRSIZ_DEFINED X/*#undef DIRSIZ_DEFINED*/ X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODE typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X/*# define OPCODE int*/ X#undef OPCODE X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X# define HAVE_PTY X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X# define SELECT X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X/*#undef U_CHAR*/ X# define U_CHAR X X X SHAR_EOF chmod 0644 ./m-sun3os4.h || echo "restore of ./m-sun3os4.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-sysv.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-sysv.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file is suitable for the following operating systems: * X * * X * Microport V.3/386 * X * Interactive V.3/386 * X * * X ************************************************************************/ X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X/*# define SUN*/ X# define SYSV X/*#define VMS*/ X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X/*# define BSD*/ X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X/*# define DIRSIZ_DEFINED*/ X#undef DIRSIZ_DEFINED X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODES typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X/*# define OPCODE int*/ X#undef OPCODE X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X# undef HAVE_PTY X/*# define HAVE_PTY*/ X X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X# undef SELECT X/*# define SELECT*/ X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X#undef U_CHAR X/*# define U_CHAR*/ X X X SHAR_EOF chmod 0644 ./m-sysv.h || echo "restore of ./m-sysv.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-sysv3.2.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-sysv3.2.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file is suitable for the following operating systems: * X * * X * Interactive V.3.2/386 * X * * X ************************************************************************/ X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X/*# define SUN*/ X# define SYSV X/*#define VMS*/ X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X/*# define BSD*/ X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X/*# define DIRSIZ_DEFINED*/ X#undef DIRSIZ_DEFINED X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODE typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X/*# define OPCODE int*/ X#undef OPCODE X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X# undef HAVE_PTY X/*# define HAVE_PTY*/ X X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X# undef SELECT X/*# define SELECT*/ X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X#undef U_CHAR X/*# define U_CHAR*/ X X/************************************************************************ X * If EGA43 is defined, then the Unix V.3.2 ioctl() for putting * X * PC display into 43 line mode is available. * X ************************************************************************/ X# define EGA43 X/* #undef EGA43*/ X X SHAR_EOF chmod 0644 ./m-sysv3.2.h || echo "restore of ./m-sysv3.2.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-vms.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-vms.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file is suitable for the following operating systems: * X * * X * VAX/VMS. * X * * X ************************************************************************/ X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X/*# define SUN*/ X/*# define SYSV*/ X#define VMS X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X/*# define BSD*/ X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X# define DIRSIZ_DEFINED X X/************************************************************************ X * The MALLOC definition tells the code that there is no * X * <malloc.h> file and that the malloc() library may behave in * X * strange ways which may force us to optimise our usage. It is * X * really only necessary if your system doesn't support the SVID * X * mallopt() call. drivers are streams modules. * X ************************************************************************/ X# define MALLOC X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODES typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X/*# define OPCODE int*/ X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X/*# define HAVE_PTY*/ X X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X/*# define SELECT*/ X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X/*# define U_CHAR*/ X X X SHAR_EOF chmod 0644 ./m-vms.h || echo "restore of ./m-vms.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./m-xenix.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./m-xenix.h && X/************************************************************************ X * * X * CRISP - Custom Reduced Instruction Set Programmers Editor * X * * X * (C) Paul Fox, 1989 * X * 43, Jerome Close Tel: +44 6284 4222 * X * Marlow * X * Bucks. * X * England SL7 1TX * X * * X * * X * Please See COPYRIGHT notice. * X * * X * This file is suitable for the following operating systems: * X * * X * Xenix System V/386 * X * Xenix System V/286 (possibly - untested). * X * * X ************************************************************************/ X X/************************************************************************ X * One of the following should be set to indicate machine type. * X * Some of the definitions may apply to more than one machine * X * type, eg SUN may be more indicative of BSD, but I dont have a * X * generic BSD to try this out on. * X ************************************************************************/ X/*# define SUN*/ X# define SYSV X/*#define VMS*/ X/************************************************************************ X * Some combination of the following may need to be set for * X * operating system dependent features which dont fit under the * X * general category of operating system features. * X ************************************************************************/ X/*# define BSD*/ X/*# define XENIX*/ X X/************************************************************************ X * DIRSIZ_DEFINED should be define'd if the POSIX directory * X * access include files are wrong. (Are they wrong or right ?) * X ************************************************************************/ X/*# define DIRSIZ_DEFINED*/ X#undef DIRSIZ_DEFINED X X/************************************************************************ X * The following # define is used to control the use of the enum * X * OPCODE typedef in the list.h. It doesn't matter if you set * X * this to 'int' as below, but if it is undefined then it is * X * easier to debug the CRISP lisp-code. Older Unix C compilers * X * do not treat enum's and int's as the same type and will * X * complain during compilation. * X ************************************************************************/ X# define OPCODE int X/*#undef OPCODE */ X X X/************************************************************************ X * If you have support for pty's in your kernel, then define * X * HAVE_PTY. If not #undef it, and normal unnamed pipes will be * X * used instead. * X ************************************************************************/ X# undef HAVE_PTY X/*# define HAVE_PTY*/ X X/************************************************************************ X * SELECT should be defined if we can do a select() on the * X * keyboard and on the process pty's/pipes. This will tend to be * X * true on BSD systems, and Sys V.4. Alas, poll() isn't * X * generally applicable on V.3 because the standard pipe and tty * X * drivers are streams modules. * X ************************************************************************/ X# undef SELECT X/*# define SELECT*/ X X/************************************************************************ X * CRISP defines a typedef called u_char. Some Unix systems also * X * define this type in one of the system header files * X * (/usr/include/sys/types.h) which causes a compilation error. * X * If you have this typedef in your system header file, then * X * #define U_CHAR. Otherwise undefine it. * X ************************************************************************/ X#undef U_CHAR X/*# define U_CHAR*/ X X X SHAR_EOF chmod 0644 ./m-xenix.h || echo "restore of ./m-xenix.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./regexp.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./regexp.h && X/************************************************************** X * X * CRISP - Custom Reduced Instruction Set Programmers Editor X * X * (C) Paul Fox, 1989 X * 43, Jerome Close Tel: +44 6284 4222 X * Marlow X * Bucks. X * England SL7 1TX X * X * X * Please See COPYRIGHT notice. X * X **************************************************************/ X#define NSUBEXP 10 Xtypedef struct REGEXP { X char *startp[NSUBEXP]; X char *endp[NSUBEXP]; X char *start; X char *end; X int exp_level; /* Highest level of {} parsed. */ X char *setpos; X char *program; X } REGEXP; X Xextern REGEXP *regcomp(); X SHAR_EOF chmod 0444 ./regexp.h || echo "restore of ./regexp.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./sptree.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./sptree.h && X/* X** sptree.h: The following type declarations provide the binary tree X** representation of event-sets or priority queues needed by splay trees X** X** assumes that data and datb will be provided by the application X** to hold all application specific information X** X** assumes that key will be provided by the application, comparable X** with the compare function applied to the addresses of two keys. X*/ X X# ifndef SPTREE_H X# define SPTREE_H X X# ifndef NULL X# define NULL 0 X# endif X X# define STRCMP( a, b ) ( (Sct = *(a) - *(b)) ? Sct : strcmp( (a), (b) ) ) X Xtypedef struct _spblk X{ X struct _spblk * leftlink; X struct _spblk * rightlink; X struct _spblk * uplink; X char * key; /* formerly time/timetyp */ X char * data; /* formerly aux/auxtype */ X char * datb; X} SPBLK; X X# define SPF_WALK 0x0001 /* If set, we cannot splay tree */ X /* because we are walking down the tree*/ Xtypedef struct _sptree X{ X SPBLK * root; /* root node */ X int flags; X X /* Statistics, not strictly necessary, but handy for tuning */ X X long lookups; /* number of splookup()s */ X long lkpcmps; /* number of lookup comparisons */ X X long enqs; /* number of spenq()s */ X long enqcmps; /* compares in spenq */ X X long splays; X long splayloops; X X} SPTREE; X X X/* sptree.c */ Xextern SPTREE * spinit(); /* init tree */ Xextern int spempty(); /* is tree empty? */ Xextern spenq(); /* insert item into the tree */ Xextern spdeq(); /* return and remove lowest item in subtree */ Xextern splay(); /* reorganize tree */ Xextern SPBLK *sprotate(); Xextern SPBLK * splookup(); /* find key in a tree */ Xextern SPBLK *sphead(); Xextern char *spstats(); X# endif SHAR_EOF chmod 0444 ./sptree.h || echo "restore of ./sptree.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./anchor.c (Text)" sed 's/^X//' << 'SHAR_EOF' > ./anchor.c && X/************************************************************** X * X * CRISP - Custom Reduced Instruction Set Programmers Editor X * X * (C) Paul Fox, 1989 X * 43, Jerome Close Tel: +44 6284 4222 X * Marlow X * Bucks. X * England SL7 1TX X * X * X * Please See COPYRIGHT notice. X * X **************************************************************/ X# include "list.h" X XSCCSID("@(#) anchor.c 1.7, (C) 1988, P. Fox"); SHAR_EOF echo "End of part 2" echo "File ./anchor.c is continued in part 3" echo "3" > s2_seq_.tmp exit 0 -- ===================== Reuters Ltd PLC, Tel: +44 628 891313 x. 212 Westthorpe House, UUCP: fox%marlow.uucp@idec.stc.co.uk Little Marlow, Bucks, England SL7 3RQ