home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!inmos!fulcrum!bham!warwick!doc.ic.ac.uk!sot-ecs!tpm
- From: tpm@ecs (TP Monks)
- Newsgroups: comp.sys.sgi
- Subject: Re: CRISP editor for IRIX 4.0.X
- Message-ID: <14327@ecs.soton.ac.uk>
- Date: 28 Jan 93 09:49:29 GMT
- References: <1993Jan19.190155.21652@ramon.bgu.ac.il> <14276@ecs.soton.ac.uk>
- Sender: news@ecs.soton.ac.uk
- Lines: 614
- Nntp-Posting-Host: elstar
-
-
- I've had a lot of mail from people asking how to compile Crisp2.2e
- (the last shareware version) on sgi machines.
-
- Here's how to do it, its quite easy, but BEWARE, my implementation
- occasionally crashes without dumping core, and losing my work.
- This is infrequent enough for me not to mind too much, but I do always
- keep backups of the file I'm editing, and periodically save it and back
- it up. Apart from this, crisp is an excellent editor
-
- 1) Use s-machine.h and machine.h from below. I'm told this compiles.
- 2) compile!
- 3) If you try running it now, it'll crash - do the stuff below first.
- 4) Put the file sgi.cf below in /usr/local/crisp_inst/src/crunch/tty/sgi.cf
- or your equivalent install directory. Move to that directory and do:
- crunch sgi.cf. This builds sgi.cm which tells crisp what escape
- codes your keyboard uses. Next, set the vars below so that crisp
- knows where everything lives and what macro to use.
- 5) BPATH=/usr/local/crisp/macros
- BTERM=sgi
- BVERSION=6
- BHELP=/usr/local/crisp/help
- 6) Mail me if this doesn't work - nobodys perfect
- 7) Mail me if it works, and you start using crisp. It would be good to
- know how many other users there are. Also send me any fixes/improvements
- you may make.
-
- Tim
-
-
- ******************************************************
- s-machine.h
- ******************************************************
-
- #! /bin/sh
- # Machine dependent environment variables to control
- # making of CRISP sources.
- #
- # This file is for generic System V systems. It has been tested under
- # Interactive Unix V.3 rel 2.2. If you have a pre-V.3 system (i.e. without
- # shared libraries) then you should comment out the SHLIB= definition
- # below.
- #
- SHLIB="-lc -lbsd -lsun -lgen"
- ########
- # Uncomment out the following line if you don't want the floating point
- # library to be included. This disables the sin(), cos(), tan(), etc
- # functions but otherwise doesn't affect crisp (except the floating
- # point calculator).
- #NO_FLOAT_MATH=-DNO_FLOAT_MATH
- ########
- # Select one of following for your system.
- # another tpm hack... ld complains about -systype ...
- CC="cc -cckr"
- #CC="cc -systype sysv"
- #CC="gcc -ansi -W -Wall -pedantic"
- ########
- # Select one of following for your system.
- #G=-g; export G
- G=-O; export G
- ########
- DIR=`pwd`
- PATH=$DIR:$DIR/crunch:$PATH
- export SHLIB CC PATH NO_FLOAT_MATH
-
-
- ******************************************************
- machine.h
- ******************************************************
-
- /************************************************************************
- * *
- * CRISP - Custom Reduced Instruction Set Programmers Editor *
- * *
- * (C) Paul Fox, 1989, 1991 *
- * *
- * File: machine.h *
- * *
- * This file contains the #defines necessary to configure different *
- * machine architectures. *
- * *
- ************************************************************************/
-
- # define CR_ACORN 0 /* Acorn running Risc IX */
- # define CR_AIX_3 0 /* AIX v3 -- not tested. */
- # define CR_DOS 0 /* MS-DOS C5.1 and OS2 */
- # define CR_SUN_OS3 0 /* Sun running SunOS 3.x */
- # define CR_SUN_OS40 0 /* Sun running SunOS 4.0 */
- # define CR_SUN_OS41 0 /* Sun running SunOS 4.1 */
- # define CR_SYSV 1 /* Generic System V. */
- # define CR_SYSV_3_2 0 /* Generic System V.3.2 */
- # define CR_SYSV_32_PTY 0 /* Generic System V.3.2 with PTY*/
- # define CR_VMS 0 /* VMS 4.7 and above. */
- # define CR_XENIX 0 /* Xenix 2.2 and above. */
-
- /************************************************************************
- * *
- * The following describes the various parameters which control *
- * compilation of CRISP. After the comments are separate *
- * sections for the different machine/operating system *
- * conbinations already supported. If you are producing your own *
- * description then you should first try to determine whether *
- * your machine is a mostly System V variant or BSD variant. *
- * *
- * BSD This is used to indicate that the system is *
- * more a BSD derivative than a System V. It *
- * affects certain features which may actually *
- * only be true of SunOS. *
- * *
- * CANNOT_UNLINK_OPEN_FILES *
- * System doesnt support Unix unlink() on an open *
- * file semantic. *
- * *
- * DIRSIZ_DEFINED This should be define'd if the POSIX directory *
- * access include files are wrong. (Are they wrong *
- * or right ? - I'm not sure - basically if you *
- * have problems with this defined try undeffing it. *
- * *
- * EGA43 If this is defined, then code for supporting *
- * the EGA in 43 line mode on a PC is compiled in. *
- * This is only supported for Unix V.3.2. *
- * *
- * HAVE_MOUSE Define this if you want the mouse code compiled *
- * in. (Only do this if the mouse code is *
- * supported for your system). *
- * *
- * HAVE_PTY This is used to compline in the code for *
- * process buffers. If your machine has the *
- * Berkeley /dev/pty driver, then define this. *
- * Otherwise CRISP will try and used pipes. *
- * *
- * HAVE_SGTTY System supports old style terminal interface. *
- * *
- * HAVE_SIGINTERRUPT System supports Sun compatible siginterrupt() *
- * system call. *
- * *
- * HAVE_SIGSETMASK The system call sigsetmask is defined. TRUE *
- * under some versions of SunOS. Used for job *
- * control. *
- * *
- * HAVE_TERMIO System supports old style terminal interface *
- * System V terminal interface. *
- * *
- * HAVE_TERMIOS System supports POSIX style terminal interface. *
- * *
- * HAVE_WAITPID System has System V (POSIX) waitpid() call with *
- * <sys/wait.h> to get the definitions. *
- * On systems which dont have this, CRISP may hang *
- * if we get SIGCHLD signals when we're not *
- * expecting them. Please read comment in def.h *
- * about why we don't actually include the *
- * include file. *
- * *
- * LINEFEED_DOES_CR Defined on systems where \n outputs a \r as well*
- * *
- * MONOCASE_FILENAMES Define this if operating system ignores case *
- * in filenames. *
- * *
- * NO_FLOAT_MATH Define this if you dont want the floating *
- * point primitives to be included, i.e. sin(), *
- * cos(), etc. (You still have access to raw *
- * floating point). This setting should be machine *
- * independent so you shoudl check your s-machine *
- * file first. *
- * *
- * NO_SYS_DIR_H The file <sys/dir.h> does not exist. *
- * *
- * ONLY_ONE_EXTENSION System only allows one '.' in filename. *
- * *
- * MALLOC This tells the code that there is no *
- * <malloc.h> file and that the malloc() library *
- * may behave in strange ways which may force us *
- * to optimise our usage. It is really only *
- * necessary if your system doesn't support the *
- * SVID mallopt() call. *
- * *
- * OPCODE This is used to control the use of the enum *
- * OPCODE typedef in the list.h. It doesn't matter *
- * if you set this to 'int' as below, but if it is *
- * undefined then it is easier to debug the CRISP *
- * lisp-code. Older Unix C compilers do not treat *
- * enum's and int's as the same type and will *
- * complain during compilation. *
- * *
- * SELECT SELECT should be defined if we can do a *
- * select() on the keyboard and on the process *
- * pty's/pipes. This will tend to be true on BSD *
- * systems, and Sys V.4. Alas, poll() isn't *
- * generally applicable on V.3 because the *
- * standard pipe and tty drivers are streams *
- * modules. *
- * *
- * SPAWN System supports a 'spawn' primitive rather *
- * than fork/exec. *
- * *
- * SUN Operating system is SunOS 3.x or SunOS 4.x. *
- * *
- * SYSV Operating is a System V derivative. *
- * *
- * U_CHAR CRISP defines a typedef called u_char. Some *
- * Unix systems also define this type in one of *
- * the system header files (<sys/types.h>) which *
- * causes a compilation error. If you have this *
- * typedef in your system header file, then *
- * #define U_CHAR. *
- * *
- * VERSION Set this to a number representing the operating *
- * system version number. Used for major *
- * differences in working, eg Xenix versions. *
- * *
- * WANT_SYS_SOCKET_H Interactive Unix wants <sys/socket.h> when *
- * using the select() system call. *
- * *
- * WANT_GETCWD This define causes us to load our own getcwd() *
- * function. The standard Unix/Xenix one works *
- * by forking a '/bin/pwd' process and reading *
- * the output from it. This is not only bloody *
- * awful, but causes problems with process buffers *
- * when the sub-process dies. (We get an unwanted *
- * SIGCHLD). *
- * *
- * WINDOW_SIZE_SUPPORTED *
- * Define this if system supports TIOCGWINSZ *
- * ioctl to get size of pty window. *
- * *
- * WORD_SIZE_16 TRUE for 16 bit machines. It simply restricts *
- * the size of chunks read in from input files. *
- * *
- ************************************************************************/
-
- # if CR_AIX_3
- /***********************************************/
- /* This entry not tested but based on */
- /* updates I received for v1.9 & v2 by */
- /* Warren Jones */
- /***********************************************/
- # define DIRSIZ_DEFINED
- # define GOT_STDLIB
- # define HAVE_PTY
- # define HAVE_TERMIO
- # define SELECT
- # define SYSV
- # define U_CHAR
- # define VERSION 31
- # define WANT_GETCWD
- # define WINDOW_SIZE_SUPPORTED
- # endif
-
- # if CR_DOS
- # define CANNOT_UNLINK_OPEN_FILES
- # define DIRSIZ_DEFINED
- # define FOPEN_R_BINARY "rb"
- # define FOPEN_W_BINARY "wb"
- # define LINEFEED_DOES_CR
- # define MONOCASE_FILENAMES
- # define OPEN_R_BINARY O_BINARY
- # define OPEN_W_BINARY O_BINARY
- # define SYSV
- # define ONLY_ONE_EXTENSION
- # define SPAWN
- # define WORD_SIZE_16
- # define GOT_STDLIB
- # endif
-
- # if CR_SUN_OS3
- /***********************************************/
- /* This entry has not been verified, and */
- /* is subject to removal. */
- /***********************************************/
- # define SUN
- # define BSD
- # define HAVE_SIGINTERRUPT
- # define DIRSIZ_DEFINED
- # define OPCODE int
- /*# define HAVE_PTY *//* Not tried under SunOS 3.x */
- # define WINDOW_SIZE_SUPPORTED
- # define SELECT
- # define U_CHAR
- # define WANT_GETCWD
- # define HAVE_SGTTY
- # endif
-
- # if CR_ACORN
- # define BSD
- # define HAVE_PTY
- # define HAVE_SGTTY
- # define HAVE_SIGSETMASK
- # define NO_SYS_DIR_H
- # define SELECT
- # define SUN
- # define WANT_GETCWD
- # define WINDOW_SIZE_SUPPORTED
- # define U_CHAR
- # endif
- # if CR_SUN_OS40
- # define BSD
- # define DIRSIZ_DEFINED
- # define HAVE_PTY
- # define HAVE_SIGINTERRUPT
- # define HAVE_SIGSETMASK
- # define HAVE_TERMIO
- # define SELECT
- # define SUN
- # define U_CHAR
- # define WANT_GETCWD
- # define WINDOW_SIZE_SUPPORTED
- # endif
-
- # if CR_SUN_OS41
- # define BSD
- # define DIRSIZ_DEFINED
- # define GOT_STDLIB
- # define HAVE_PTY
- # define HAVE_SIGINTERRUPT
- # define HAVE_SIGSETMASK
- # define SELECT
- # define SUN
- # define WINDOW_SIZE_SUPPORTED
- # define WANT_GETCWD
- # define HAVE_TERMIO
- # define HAVE_WAITPID
- # define U_CHAR
- # endif
-
- # if CR_SYSV
- # define SYSV
- # define HAVE_TERMIO
- # define WANT_GETCWD
- # define GOT_STDLIB
- /* the following are mods - tpm 8/91 */
- # define HAVE_MOUSE
- # define HAVE_WAITPID
- # define SELECT
- # define U_CHAR
- # define DIRSIZ_DEFINED
- # endif
-
- # if CR_SYSV_3_2
- # define SYSV
- # define WANT_GETCWD
- # define HAVE_TERMIO
- # define EGA43
- # define GOT_STDLIB
- # endif
-
- /**********************************************************************/
- /* Following entry works for Interactive Unix V.3.2 with TCP */
- /* support. */
- /**********************************************************************/
- # if CR_SYSV_32_PTY
- # define EGA43
- # define GOT_STDLIB
- # define HAVE_MOUSE
- # define SELECT
- # define SYSV
- # define WANT_GETCWD
- # define HAVE_PTY
- # define HAVE_TERMIO
- # define HAVE_WAITPID
- # define WANT_SYS_SOCKET_H
- # define U_CHAR
- # endif
-
- # if CR_VMS
- # define VMS
- # define DIRSIZ_DEFINED
- # define MALLOC
- # define CANNOT_UNLINK_OPEN_FILES
- # endif
-
- # if CR_XENIX
- # define WANT_GETCWD
- # define SYSV
- # define OPCODE int
- # define HAVE_TERMIO
- # define VERSION 23
- # if VERSION < 23
- # define DIRSIZ_DEFINED
- # else
- # define SELECT
- # define PTY
- # endif
- # endif
-
- /**********************************************************************/
- /* This section gives some default values to various definitions. */
- /**********************************************************************/
-
- # if !defined(OPEN_W_BINARY)
- # define OPEN_W_BINARY 0
- # define OPEN_R_BINARY 0
- # endif
- # if !defined(FOPEN_W_BINARY)
- # define FOPEN_W_BINARY "w"
- # define FOPEN_R_BINARY "r"
- # endif
-
-
-
-
- ******************************************************
- sgi.cf
- ******************************************************
-
-
- /********************************************************************
- * *
- * CRISP - Custom Reduced Instruction Set Programmers Editor *
- * *
- * This is the terminal description file for SGITERM, SGI's *
- * version of XTERM. Crisp works quite nicely in this *
- * environment, since SGITERM returns escape sequences for *
- * all Alt-key combinations, and many Ctrl-Key combinations *
- * that are not usually available on ASCII terminals. *
- ********************************************************************/
-
- # include "tty.h"
- void
- main()
- {
-
- /***********************************************/
- /* Set characters used for extended */
- /* graphics support when drawing windows. */
- /***********************************************/
- set_term_characters(
- '+', /* Top left of window. */
- '+', /* Top right of window. */
- '+', /* Bottom left of window. */
- '+', /* Bottom right of window. */
- '|', /* Vertical bar for window sides. */
- '-', /* Top and bottom horizontal bar for window.*/
- '+', /* Top join. */
- '+', /* Bottom join. */
- '+', /* Window 4-way intersection. */
- '+', /* Left hand join. */
- '+' /* Right hand join. */
- );
-
- /***********************************************/
- /* Define escape sequences used for */
- /* special optimisations on output. */
- /***********************************************/
- set_term_features(
- NULL, /* Sequence to clear 'n' spaces. */
- /* ("\x1B[%dX" almost works, but */
- /* doesn't preserve standout mode, */
- /* so help menus don't look right.) */
- NULL, /* Sequence to print characters with top*/
- /* bit set. */
- NULL, /* Insert-mode cursor. */
- NULL, /* Overwrite-mode cursor. */
- NULL, /* Insert-mode cursor (on virtual space)*/
- NULL, /* Overwrite-mode cursor (on virtual space)*/
- NULL, /* Print ESCAPE character graphically. */
- NULL, /* Escape sequence to repeat last character*/
- FALSE, /* ESC [0m resets color. */
- FALSE, /* Terminal supports color. */
- "\x1B[%dC" /* Sequence to move cursor on same line.*/
- );
-
- /***********************************************/
- /* Define keyboard layout for non-ascii */
- /* characters. These can only be used for */
- /* the console). */
- /***********************************************/
- set_term_keyboard(
- F1_F12, quote_list(
- "\x1B[001q", "\x1B[002q", "\x1B[003q", "\x1B[004q",
- "\x1B[005q", "\x1B[006q", "\x1B[007q", "\x1B[008q",
- "\x1B[009q", "\x1B[010q", "\x1B[011q", "\x1B[012q" ),
-
- CTRL_F1_F12, quote_list(
- "\x1B[025q", "\x1B[026q", "\x1B[027q", "\x1B[028q",
- "\x1B[029q", "\x1B[030q", "\x1B[031q", "\x1B[032q",
- "\x1B[033q", "\x1B[034q", "\x1B[035q", "\x1B[036q"),
-
- SHIFT_F1_F12, quote_list(
- "\x1B[013q", "\x1B[014q", "\x1B[015q", "\x1B[016q",
- "\x1B[017q", "\x1B[018q", "\x1B[019q", "\x1B[020q",
- "\x1B[021q", "\x1B[022q", "\x1B[023q", "\x1B[024q"),
-
- /* added tpm 9/91 */
- ALT_F1_F12, quote_list(
- "\x1b[037q", "\x1b[038q", "\x1b[039q", "\x1b[040q",
- "\x1b[041q", "\x1b[042q", "\x1b[043q", "\x1b[044q",
- "\x1b[045q", "\x1b[046q", "\x1b[047q", "\x1b[048q"),
-
-
- ALT_A_Z, quote_list(
- "\x1B[087q", "\x1B[105q", "\x1B[103q", "\x1B[089q",
- "\x1B[076q", "\x1B[090q", "\x1B[091q", "\x1B[092q",
- "\x1B[081q", "\x1B[093q", "\x1B[094q", "\x1B[095q",
- "\x1B[107q", "\x1B[106q", "\x1B[082q", "\x1B[083q",
- "\x1B[074q", "\x1B[077q", "\x1B[088q", "\x1B[078q",
- "\x1B[080q", "\x1B[104q", "\x1B[075q", "\x1B[102q",
- "\x1B[079q", "\x1B[101q" ),
-
- /* modified tpm 9/91 */
- ALT_0_9, quote_list(
- "\x1b[067q","\x1b[058q","\x1b[059q","\x1b[060q",
- "\x1b[061q","\x1b[062q","\x1b[063q","\x1b[064q",
- "\x1b[065q","\x1b[066q"),
-
- /* changed KEYPAD_5 from NULL to "\x1b[000q" - no difference I
- guess - tpm 9/91 */
- KEYPAD_0_9, quote_list(
- "\x1b[139q", "\x1b[146q", "\x1b[B", "\x1b[154q",
- "\x1b[D", "\x1b[000q", "\x1b[C", "\x1b[H",
- "\x1b[A", "\x1b[150q"),
-
- /* everything after here has been updated tpm 9/91 */
-
- CTRL_KEYPAD_0_9, quote_list(
- "\x1B[178q", "\x1B[176q", "\x1B[186q", "\x1B[194q",
- "\x1B[174q", "\x1B[184q", "\x1B[192q", "\x1B[172q",
- "\x1B[182q", "\x1B[190q" ),
-
- ALT_KEYPAD_END, "\x01",
- ALT_KEYPAD_HOME, "\x07",
-
- ALT_KEYPAD_MINUS, "\x1b[048q", /* these three use F11=+,F12=- */
- CTRL_KEYPAD_MINUS, "\x1b[036q",
- CTRL_KEYPAD_PLUS, "\x1b[035q",
-
- KEYPAD_PRTSC, "\x1b[209q",
- KEYPAD_SCROLL, "\x1b[213q",
-
- DEL, quote_list("\x1B[P"), /* del on the numerical pad */
- COPY, "\x1b[011q", /* f11 */
- CUT, "\x1b[012q" /* f12 */
-
- /* other bits that should be included are SHIFT_ARROWKEYS. I'm
- not sure how to define these - presumably they should be used for
- shifting from window to window.
- SHIFT_LEFT = "\x1b[158q"
- SHIFT_RIGHT = "\x1b[167q"
- SHIFT_UP = "\x1b[161q"
- SHIFT_DOWN = "\x1b[164q"
-
- PAGE_UP = ?
- PAGE_DOWN = ?
- HOME = ?
- END = ? */
-
- );
- }
- /**********************************************************************/
- /* Following function should be appended to BTERM when the */
- /* hpfont is figured out on your system. */
- /**********************************************************************/
- void
- hpfont()
- {
- /***********************************************/
- /* Set characters used for extended */
- /* graphics support when drawing windows. */
- /***********************************************/
- set_term_characters(
- 0xF5, /* Top left of window. */
- 0xF6, /* Top right of window. */
- 0xF4, /* Bottom left of window. */
- 0xF7, /* Bottom right of window. */
- 0xF9, /* Vertical bar for window sides. */
- 0xFA, /* Top and bottom horizontal bar for window.*/
- 0xFD, /* Top join. */
- 0xFE, /* Bottom join. */
- 0xF8, /* Window 4-way intersection. */
- 0xFB, /* Left hand join. */
- 0xFC /* Right hand join. */
- );
- }
-
- /**********************************************************************/
- /* Macro called when a mouse button is hit from an Xterm when */
- /* the mouse option is enabled in the window. */
- /**********************************************************************/
- int mouse_cnt = 0;
- void
- xterm_mouse()
- { int ch1, ch2, ch3;
-
- ch1 = read_char(0);
- ch2 = read_char(0);
- ch3 = read_char(0);
- message("Mouse hit %d! %s%s%s (%d,%d)",
- mouse_cnt++,
- ch1 == ' ' ? "o" : "-",
- ch1 == '!' ? "o" : "-",
- ch1 == '"' ? "o" : "-",
- ch2 - ' ', ch3 - ' '
- );
- /***********************************************/
- /* Let CRISP do the real work of working */
- /* out whats happened to the mouse keys. */
- /***********************************************/
- process_mouse(ch1 == ' ', ch1 == '!', ch1 == '"',
- ch2 - ' ' - 1,
- ch3 - ' ' - 1);
- }
-
-
-
-
-
-
-
-
-
- --
- -----------------------------------------------------------------------------
- Tim Monks Vision, Speech and Signal Processing
- tpm@ecs.soton.ac.uk Southampton University
- Tel: +44 (703) 592774 Fax: +44 (703) 592895
-