allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (07/23/89)
Posting-number: Volume 7, Issue 42 Submitted-by: fox@marlow.UUCP (Paul Fox) Archive-name: crisp1.9/part22 #!/bin/sh # shar: Shell Archiver (v1.22) # # This is part 1 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # # Run the following text with /bin/sh to create: # SRC.README # ./COPYRIGHT # ./CRISP.Inst # ./ChangeLog # ./Makefile # ./RESUME # ./THANKS # ./TODO # ./alt.h # ./clk.h # ./cm.h # ./decls.h # ./def.h # ./gdir.h # ./list.h # ./m-sun3os3.h # ./m-sun3os4.h # ./m-sysv.h # ./m-sysv3.2.h # ./m-vms.h # ./m-xenix.h # ./regexp.h # ./sptree.h # ./anchor.c # ./basic.c # ./bookmark.c # ./buffer.c # ./builtin.c # ./clock.c # ./cm.c # ./config.c # ./debug.c # ./display.c # ./echo.c # ./env.c # ./eval.c # ./file.c # ./keywd.c # ./kill.c # ./language.c # ./line.c # ./lisp.c # ./list.c # ./m_buf.c # ./m_msg.c # ./mac1.c # ./main.c # ./map.c # ./math.c # ./phys_term.c # ./playback.c # ./pty.c # ./ref_string.c # ./regexp.c # ./region.c # ./register.c # ./search.c # ./spawn.c # ./symbol.c # ./system.c # ./termcap.c # ./tty.c # ./ttyio.c # ./ttykbd.c # ./undo.c # ./unix.c # ./version.c # ./vms.c # ./wild.c # ./window.c # ./word.c # ./m-sun3os3.h # ./m-sun3os4.h # ./m-sysv.h # ./m-sysv3.2.h # ./m-vms.h # ./m-xenix.h # ./s-bsd # ./s-sysv # ./s-xenix # vms/ccom.com # vms/make.com # vms/recomp.com # vms/precomp.com # vms/crisp.com # vms/login.com # vms/README # if test -r s2_seq_.tmp then echo "Must unpack archives in sequence!" next=`cat s2_seq_.tmp`; echo "Please unpack part $next next" exit 1; fi echo "x - extracting SRC.README (Text)" sed 's/^X//' << 'SHAR_EOF' > SRC.README && XThis is the README file for the GRIEF source code. X---------------------------------------------------------------------- XGRIEF: Release 1.6 XVersions: X XThis file is the new README for GRIEF v1.6. The source distribution Xhas been changed to take into account peoples moans about me not Xproviding diffs between releases. This is the best I can do. The Xdistribution is now split into the following: X X - grief source code (Makefile, .h & .c files) X - grief macros X - grief documentation X - grief support libraries. X XThe support libraries are not expected to undergo any changes from Xrelease to release, and this README file will let you know which Xversions of these modules you will need. X XEach module comes with its own README file (partly due to the way Xin which I produce my releases). X X Bugs fixed since last release X ----------------------------- X XQuite a few were fixed before I changed the release format and subsequently Xlost the details. X X1. search_string now sets length to the correct value if \c is in the X search string. X2. (wait_for) now accepts regular expressions. X3. PTY stuff improved (I hope). Now allows input to go to buffer and/or X pty. (Needed by shell.m). X4. Fixed bug in (create_buffer) which caused it to sometimes clear the X buffer next time it was accessed. X5. Fixed bug in assign_to_key -- "<Ins>" mapped to wrong key. X6. Bug in regular expression handling -- [x-y] didnt include 'y'. X7. Fixed bug in regexp for things like X@>. X8. Fixed bug in .m parser (language.c) which caused parser to go a bit X haywire when parsing code in a .h file. X9. GRIEF shouldnt core dump if you type in commands too long at prompts. X10. Finally implemented block search/translate. (Only works to within X the line where block starts/ends, ie ignores columns, etc). X11. When collapsing undo, ESCapes treated same as alphanumerics. X (Makes it easier to undo cursor keys which get inserted into buffer). X12. (inq_line_length) now returns length of longest line in buffer or X in currently select region. X13. Now full support for Sun-386i. Makefiles parameterised so that X 68020 and 386i suns can share same source directory. X14. Because of above, .cm files now fully machine independent (well X 68020 & 386 - don't know about vaxes). X15. Now runs entirely without BRIEF macros. X16. Fixed annoying bug in window display when moving a window edge which X caused the border to get duplicated. X17. Fixed bug in display code which caused windows to update wrongly X after a fast scroll. X18. Made lots of things faster, especially reading in of files and regexps. X19. When initially reading in a file, it now allocates a large X buffer to read file into, rather than going thru the standard insertion X code -- gives a 50% performance boost on reading in files. Also X saves a bit of memory for files with lots of short lines. X20. Fixed bugs in (set_buffer), (attach_buffer) which caused us to X get confused about how many windows a buffer was displayed in. X X Known Bugs in this release of GRIEF X ----------------------------------- X X=== XFile Version X============ ======= X X X./CRISP.Inst 1.6 X./Makefile 1.25 X./RELEASE 1.5 X./alt.h 1.3 X./anchor.c 1.7 X./basic.c 1.5 X./bookmark.c 1.4 X./buffer.c 1.14 X./builtin.c 1.8 X./clk.h 1.3 X./clock.c 1.7 X./cm.c 1.12 X./cm.h 1.9 X./config.c 1.7 X./debug.c 1.7 X./decls.h 1.8 X./def.h 1.18 X./display.c 1.16 X./echo.c 1.13 X./env.c 1.3 X./eval.c 1.6 X./file.c 1.15 X./gdir.h 1.4 X./keywd.c 1.35 X./kill.c 1.7 X./language.c 1.17 X./line.c 1.16 X./lisp.c 1.8 X./list.c 1.8 X./list.h 1.10 X./m_buf.c 1.17 X./m_msg.c 1.7 X./mac1.c 1.14 X./main.c 1.16 X./map.c 1.10 X./math.c 1.10 X./mkhelp.c 1.4 X./phys_term.c 1.12 X./playback.c 1.7 X./prof.c 1.2 X./pty.c 1.15 X./ref_string.c 1.4 X./regexp.c 1.14 X./regexp.h 1.4 X./region.c 1.9 X./register.c 1.8 X./search.c 1.16 X./spawn.c 1.12 X./sptree.h 1.5 X./symbol.c 1.8 X./system.c 1.3 X./termcap.c 1.8 X./tty.c 1.14 X./ttyio.c 1.15 X./ttykbd.c 1.11 X./undo.c 1.14 X./unix.c 1.6 X./version.c 1.12 X./vm.c 1.9 X./vms.c 1.3 X./wild.c 1.11 X./window.c 1.9 X./word.c 1.6 SHAR_EOF chmod 0444 SRC.README || echo "restore of SRC.README fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./COPYRIGHT (Text)" sed 's/^X//' << 'SHAR_EOF' > ./COPYRIGHT && X X CRISP - Custom Reduced Instruction Set Programmers Editor X ========================================================= X XThe software included here is: X X (C) 1988 Paul David Fox, X 43 Jerome Close X Marlow, X Bucks SL7 1TX X England Tel: +44 6284 4222 X XThe copyright restrictions are as follows: X X 1. You are free to distribute this software to any person, X persons, companies, institutions, etc. X 2. The software as distributed should be made available to X all parties interested, for NO cost, except media and time X to copy the software. X 3. The software may be modified, extended, fixed etc, but X any such enhancements/fixes/etc should be noted in the X distribution to avoid confusion with my master sources. X 4. I accept no responsibility, etc, etc for the quality use, etc X under any form of law, liable, fraud, etc. X 5. If you like this software, then feel free to send donations X to the above address; this will allow me to develop the software X more. X 6. This software may not be sold without my prior consent. X XIf you wish to get in contact with me, then either try the address above, Xor, on usenet: X XUSENET: fox@marlow.uucp XBIX: foxy X XPaul Fox 1st June 1988 SHAR_EOF chmod 0644 ./COPYRIGHT || echo "restore of ./COPYRIGHT fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./CRISP.Inst (Text)" sed 's/^X//' << 'SHAR_EOF' > ./CRISP.Inst && X#!/bin/sh X########################################################################## X# Patchable variables go here. Please change to whatever you feel X# appropriate. X########################################################################## Xbin=/usr/local/bin # Directory for binaries. Xinst=/usr/local/crisp # Directory for macros and help texts X########################################################################## X# Some drudgery before we get started. X########################################################################## Xversion=1.9 X########################################################################## X# Now unpack any .tar files X########################################################################## Xfor i in *.Z Xdo X if [ -f $i ]; then X echo Uncompressing $i X uncompress $i X fi Xdone Xfor i in *-sh* Xdo X if [ -f $i ]; then X sh $i X rm $i X fi Xdone X########################################################################## X# Try and deduce what system we are on. X# If you are going to edit this because you are trying to make X# it work for your own system, then you can delete the following X# tests, and just set the m-machine.h and s-machine files up. X########################################################################## Xrm -f m-machine.h s-machine Xif [ -f /vmunix ]; then X if [ -f /lib/ld.so ]; then X DESCR="SunOS 4.x" X ln m-sun3os4.h m-machine.h X else X ln m-sun3os3.h m-machine.h X DESCR="SunOS 3.x" X fi X ln s-bsd s-machine Xfi Xif [ -d /vrm ]; then X DESCR="RT-PC Running AIX" X ln m-aix.h m-machine.h X ln s-sysv s-machine Xfi Xif [ -f /xenix ]; then X DESCR="Xenix 386/286" X ln m-xenix.h m-machine.h X ln s-xenix s-machine Xfi Xif [ -f /system5 ]; then X DESCR="Microport Unix V.2/286" Xfi Xif [ -f /etc/atconf/systems/linkorder ]; then X DESCR="Interactive Systems Unix V.3" X ln m-sysv.h m-machine.h X ln s-sysv s-machine Xfi Xif [ -f /unix ]; then X DESCR="Microport Unix V.3/386" X ln m-sysv.h m-machine.h X ln s-sysv s-machine Xfi Xecho "" Xecho "Installation script for CRISP v$version" Xecho "" Xecho "If this script completes successfully, it will annihilate the $inst" Xecho "directory. If you have any personal macros in this directory tree" Xecho "abort the installation now, and save your files." Xecho "" Xecho "" Xmkdir dirlib doc foxlib help lib llist obj splay src utils >/dev/null 2>&1 Xmkdir help/crisp >/dev/null 2>&1 Xecho "" Xecho "I think the system you are installing CRISP on is: " Xecho "" Xecho " $DESCR" Xecho "" Xecho "Press <CR> if this is correct, or hack this script if wrong: " Xread ans X########################################################################## X# Now create major crisp object files. X########################################################################## Xmake Xecho "" Xecho "Removing $inst directory..." Xcp cm cr $bin Xrm -rf $inst ; mkdir $inst Xmkdir $inst/macros $inst/macros/kbd $inst/macros/tty >/dev/null 2>&1 Xecho "Compiling macro sources..." Xmake cmac Xecho "Installing Help files..." Xmake hmac Xecho Installation successfully completed. SHAR_EOF chmod 0444 ./CRISP.Inst || echo "restore of ./CRISP.Inst fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./ChangeLog (Text)" sed 's/^X//' << 'SHAR_EOF' > ./ChangeLog && XKnown Bugs in V1.9 X================== X X1. Playback after having recorded keystrokes where we were prompted X screws up playback string. X2. Writing buffers from Exit prompt doesnt do backups. X3a. Borderless windows dont position hilited marks properly. X3b. Borderless windows cause crap to be displayed on right hand edge X sometimes. X XChanges since version 1.8 X========================= X X1. Added new keyword (set_buffer_modified) so that things like X GREP buffer dont get autosaved. X2. Fixed bug in clock.c which could cause us to do an alarm X call with a silly argument. X3. Fixed display bug caused when line number caching got screwed up. X4. Implemented redo facility to undo an undo. X5. Fixed bug in handling of regions in MK_NORMAL and MK_NONINC mode X where it would delete/copy the wrong area of the buffer. X6. Fixed bug in region handling code which could cause a core dump if X cursor was on the non-existant last line of a buffer and a cut/copy X was executed. X7. Fixed bug in assign_to_key which caused a core-dump if trying to X assign a quote-list to a non-internal key sequence. X8. Added support for SIGWINCH. Implementation may be buggy - especially X if you make window so small that some windows disappear off screen. X Also you shouldn't resize window whilst a macro is executing. X9. Added support for termcap 'is' and 'rs' sequences - init sequence and X reset sequence. Why are these in termcap if we already have ti and te ? X10. CRISP.Inst now a portable Bourne-Shell script rather than csh. X11. Fixed bug in termcap code which caused it to truncate a termcap X entry if entry was split over a buffer boundary. X12. Fixed bug which caused problems when translate pattern was '$' or '>'. X13. Borderless windows now work properly - although not as they do in X BRIEF. BRIEF's color scheme is awful. X14. Added new primitive (set_display_chars) which allows user to X define how control characters are displayed on screen - especially X useful for EDT emulation (ie ^L displays as <FF>). X15. Fixed bug in undo code to stop Undone being printed twice when X undoing scrap buffer. X16. Added real pty support in addition to pipes. X17. Added optimisation to display update code to use delete to eol if X possible. X18. Modified makefile mechanism to use GNU style m-* and s-* files X to make it easier for potential porters to understand what things X might need specifying. X19. Fixed bug which causes core dump if you are in overwrite mode X and hit <CR> and try to insert at beginning of newline. X20. Totally reorganised internal color coding scheme to support X 4-bit colors for foreground and background. X21. Fixed bug in termcap.c which interprets %+ incorrectly. (Fix supplied X by john@hcrvax.uucp) X22. Removed (set_buffer_modified) primitive and replaced with X (set_buffer_flags) primitive to be more generic. X23. Keyboard driver now can handle select(). This means that on X systems with a real select() call, it wont poll the pty's every X second in an attempt to simulate it. On systems that done X support select(), it does it the old way. X24. Fixed bug in overlapping windows code. If a window behind the X current window updates (eg becos of pty activity), then current X window isn't obscured. This isn't foolproof at the moment, I X believe. The window chain is sorted in order of creation, on the X basis that newly created windows will tend to sit on top of X older windows. If someone writes a macro to pop up a background window X then the window order wont be updated and so obscureness will occur. X I'll fix this when/if I manage to get around to the overlapping X window manager. X25. Added yet another display optimisation for <Alt-D>, ie delete_line. X26. Fixed bug in file-readin code (lreadin_file) which caused crisp to X run out of memory when a file with a line longer than CHUNK_SIZE X (20K) was read in. Still doesn't handle lines longer than size u_int16. X27. Added new registered macro type (9) to handle segmentation violations X and make a possibly futile attempt at saving modified buffers. X28. Modified load_macro code so that we dont look in '.' first for a macro -- X '.' must be in BPATH in order to have effect. This avoids a lot X of excess calls to stat() on startup. X Modified default BPATH in unix.c to take this into account. X29. Made macro table into a splay tree to try and boost startup X performance. Also modified code in language.c to avoid doing X two calls to stat() and fstat() for .cm files. X30. Added BRIEF-OS/2 feature to (dos) and (shell) to support a completion X routine to be called when a sub-shell dies. X31. Fixed bug file readin code where we forgot to tell user X what's happening when things get slow. X32. Fixed bug in (index "ABC" "") - should return 4 - not 1. X33. Fixed bug in display code which causes first part of top title line X to come out in wrong color after an exit from a sub-shell. X34. Added full 43-line mode EGA support for Unix V.3.2. X Plus added (ega) primitive to dynamically switch sizes. X35. Added ability to record macro sequences for keyboard macros so they X can be modified and made into proper macros. X36. Made SysV version of crisp not clear terminal input buffer on X startup. (Its very annoying when it takes time to start up). X37. Added BRIEF OS/2 #include <..> and #include ".." directives. X38. Fixed display bug which caused title bar of a window to not be X cleared when window killed. (in delete_edge code when <Up> was last X key pressed). X39. Moved tcopy_string() out of termcap.c into tty.c. This makes it X easier for people to use their own native termcap library by not X linking in termcap.c and by adding -ltermcap to the LIBS line in the X Makefile. X40. Changed the hardcoded escape sequences in putpad() to use SO, SE and X MD. Currently dont support the other attributes like italic and X underlining. X41. Added putenv.c to foxlib directory. X42. Fixed bug in tcopy_string() which stopped you having ':' characters X in your escape sequence definitions in the tty-*.m files. (Thanks edf). X43. Modified search_fwd and search_back macros to support BRIEF-OS/2 return X values - ie length of matched string. X44. Added new macro primitive (re_syntax) which allows the user to X control whether Unix or BRIEF/CRISP like regular expression syntax X is to be used. X45. Display of time on bottom line no longer has hardcoded escape sequences X in it - instead it makes use of 'mb' and 'me' termcap codes. X This means the pt_0m phys term attribute is no longer required. X46. Fixed bug in insert-line code which didnt bother to update marked X area if end of marked region was after current cursor. X47. Improved time it takes to search for a fixed string by a huge amount. X48. -mexit on the command line now allows CRISP to exit after startup. This X allows standalone macros to be executed on the command-line. X49. Fixed bug in language parser which didnt handle /**/ too well. X50. Fixed out by 1 error in (transfer) macro which didn't include the X end-line. X51. Fixed bug in (tabs) macro which would treat a '1' parameter as terminating X the tab-stop list. '1' parameters are now ignored. X52. Fixed bug in translate code which didnt handle \<num> properly if X <num> was zero. X53. Fixed bug in (beep) macro which causes CRISP to think cursor has X moved. X54. Fixed bug in (read_file) code which didnt check to see if X buffer was read-only. X XMacros X====== X1. Fixed bug in word-left macro which caused it to go back X to start of PREVIOUS word when on second character of a word. X2. Added a trivial EDT emulator. X3. Mail macros now support ability to reply to mail. X4. Added an mtags macro for creating a tags file for .m files. X5. Added h-format_block macro which treats .h files same as .c files X for ^F. X6. Modified makeman.m to use env variable BHELP. Also added support X for -mm, -me and -ms nroff/troff macros. X7. Added Command Summary option to help. Currently maps onto the old X key_list macro. X8. <Alt-N> and <Alt-P> now display full file name on status line. X9. Added core.m which gets loaded when CRISP suffers a segmentation X violation in an attempt to save any modified buffers. X10. Modified options macro (Screen & Status) option to allow user to X toggle 25 & 43 line modes. X11. Fixed references to non-existant macros in ansi.m and tty.m. X12. Moved all tty files into tty subdirectory. X13. Created new kbd subdirectory. This is for keyboard descriptions - X used by the Command Summary option of the help menus only. X14. Modifed search-fwd, search-back, search-next, search-previous to X hilite the matched pattern on the screen until a key is hit. X15. Modified most macros so that messages which appear at bottom of X windows are now keyboard independent. X16. Added <Alt-P> to select_buffer operations to get a screen dump. X17. When you do an Alt-W on a highlited region, no longer prints X the 'Pattern not found.' message. X18. Modified compile.m and makeman.m to take into account wrong implementation X of point (52) above. X19. Added a telnet/rlogin macro so that a shell buffer will work X properly with the peculiarities of single character input mode. X Its an improvement over the raw shell buffer, but I suppose its not X as sophisticated as the Emacs one. Maybe this'll get improved an X awful lot. X20. Implemented the (previous_tab) macro. SHAR_EOF chmod 0644 ./ChangeLog || echo "restore of ./ChangeLog fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./Makefile (Text)" sed 's/^X//' << 'SHAR_EOF' > ./Makefile && X#************************************************************** X#* X#* CRISP - Custom Reduced Instruction Set Programmers Editor X#* X#* (C) Paul Fox, 1988 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#* Version 1.25 X#* X#**************************************************************/ XOBJDIR = obj XCFLAGS = $(G) XTARGET = cr XL = lib XLIB1 = $(L)/libsptree.a $(L)/llist.a $(L)/foxlib.a XLIBS = $(LIB1) $(MALLOC) $(SHLIB) XSRCDIR = sleepy:/usr/fox/crisp XINSTALL_DIR = /usr/local/crisp XLDFLAGS = XSHELL = /bin/sh XRANLIB = echo X########################################## X# System Independant Definitions. X########################################## XCP = cp X XH = def.h list.h m-machine.h X XSRC = [A-Z]* *.h *.c m-* s-* XOBJ = \ X $(OBJDIR)/anchor.o $(OBJDIR)/basic.o $(OBJDIR)/bookmark.o \ X $(OBJDIR)/buffer.o $(OBJDIR)/builtin.o $(OBJDIR)/clock.o \ X $(OBJDIR)/config.o $(OBJDIR)/debug.o $(OBJDIR)/display.o \ X $(OBJDIR)/echo.o $(OBJDIR)/env.o $(OBJDIR)/eval.o $(OBJDIR)/file.o \ X $(OBJDIR)/keywd.o $(OBJDIR)/kill.o $(OBJDIR)/language.o \ X $(OBJDIR)/line.o $(OBJDIR)/lisp.o $(OBJDIR)/list.o \ X $(OBJDIR)/m_buf.o $(OBJDIR)/m_msg.o $(OBJDIR)/mac1.o \ X $(OBJDIR)/main.o $(OBJDIR)/map.o $(OBJDIR)/math.o \ X $(OBJDIR)/phys_term.o $(OBJDIR)/playback.o \ X $(OBJDIR)/pty.o $(OBJDIR)/ref_string.o $(OBJDIR)/regexp.o \ X $(OBJDIR)/region.o $(OBJDIR)/register.o $(OBJDIR)/search.o \ X $(OBJDIR)/spawn.o $(OBJDIR)/symbol.o $(OBJDIR)/system.o \ X $(OBJDIR)/tty.o $(OBJDIR)/ttyio.o \ X $(OBJDIR)/ttykbd.o $(OBJDIR)/undo.o $(OBJDIR)/unix.o \ X $(OBJDIR)/version.o $(OBJDIR)/wild.o $(OBJDIR)/window.o \ X $(OBJDIR)/word.o \ X $(OBJDIR)/termcap.o X X XMARKER = __Foxlib __Llist __Splay Xall: X . s-machine ; $(MAKE) all1 X Xall1: $(MARKER) $(TARGET) cm X X__Foxlib: $(L)/foxlib.a X touch __Foxlib X$(L)/foxlib.a: X cd foxlib ; $(MAKE) X X__Llist: $(L)/llist.a X touch __Llist X$(L)/llist.a: X cd llist ; $(MAKE) X X__Splay: $(L)/libsptree.a X touch __Splay X$(L)/libsptree.a: X cd splay ; $(MAKE) X Xclean: X -rm -f crisp.log X -rm -f obj/* lib/* a.out core X -rm -f *.o X -rm -f */*.o X X$(TARGET): $(OBJ) $(MARKER) X $(CC) $(LDFLAGS) $(CFLAGS) $(SEG) -o $(TARGET) $(OBJ) $(LIBS) X sync X @echo "Finished making 'cr' executable." X Xcrisp.dist: X $(MAKE) doc.dist X $(MAKE) lib.dist X $(MAKE) gmc.dist X $(MAKE) src.dist X# $(MAKE) bmc.dist Xdoc.dist: X sh /usr/local/bin/mkrelease release/DOC doc Xlib.dist: X sh /usr/local/bin/mkrelease -shar release/LIB dirlib foxlib llist splay utils X compress -b 12 release/LIB*-sh* X rcp release/LIB*Z alice:/usr/fox/release/crisp Xbmc.dist: X sh /usr/local/bin/mkrelease release/BMC help/brief_2.1 src/brief_2.1 Xhlp.dist: X sh /usr/local/bin/mkrelease -shar release/HLP help/crisp X compress -b 12 release/HLP*-sh* X rcp release/HLP*Z alice:/usr/fox/release/crisp Xmac.dist: X sh /usr/local/bin/mkrelease -shar release/MAC src/crisp X compress -b 12 release/MAC*-sh* X rcp release/MAC*Z alice:/usr/fox/release/crisp Xsrc.dist: X mv m-machine.h ,m-machine.H X mv s-machine ,s-machine X sh /usr/local/bin/mkrelease -shar release/SRC . vms X mv ,m-machine.H m-machine.h X mv ,s-machine s-machine X compress -b 12 release/SRC*-sh* X rcp release/SRC*Z alice:/usr/fox/release/crisp Xdist: X sh /usr/local/bin/sccs update < /dev/null Xdist-list: X @echo $(SRC) X Xobj: $(OBJ) X @echo Objects now upto date. X$(OBJDIR)/anchor.o: $(H) anchor.c X $(CC) $(CFLAGS) -c anchor.c ; mv anchor.o $(OBJDIR) X$(OBJDIR)/basic.o: basic.c $(H) X $(CC) $(CFLAGS) -c basic.c ; mv basic.o $(OBJDIR) X$(OBJDIR)/bookmark.o: bookmark.c $(H) X $(CC) $(CFLAGS) -c bookmark.c ; mv bookmark.o $(OBJDIR) X$(OBJDIR)/buffer.o: buffer.c $(H) X $(CC) $(CFLAGS) -c buffer.c ; mv buffer.o $(OBJDIR) X$(OBJDIR)/builtin.o: builtin.c $(H) X $(CC) $(CFLAGS) -c builtin.c ; mv builtin.o $(OBJDIR) X$(OBJDIR)/clock.o: clock.c $(H) X $(CC) $(CFLAGS) -c clock.c ; mv clock.o $(OBJDIR) X$(OBJDIR)/config.o: config.c $(H) X $(CC) $(CFLAGS) -c config.c ; mv config.o $(OBJDIR) X$(OBJDIR)/debug.o: debug.c $(H) X $(CC) $(CFLAGS) -c debug.c ; mv debug.o $(OBJDIR) X$(OBJDIR)/display.o: display.c $(H) X $(CC) $(CFLAGS) -c display.c ; mv display.o $(OBJDIR) X$(OBJDIR)/echo.o: echo.c $(H) X $(CC) $(CFLAGS) -c echo.c ; mv echo.o $(OBJDIR) X$(OBJDIR)/env.o: env.c $(H) X $(CC) $(CFLAGS) -c env.c ; mv env.o $(OBJDIR) X$(OBJDIR)/eval.o: eval.c $(H) X $(CC) $(CFLAGS) -c eval.c ; mv eval.o $(OBJDIR) X$(OBJDIR)/file.o: file.c $(H) X $(CC) $(CFLAGS) -c file.c ; mv file.o $(OBJDIR) X$(OBJDIR)/keywd.o: keywd.c $(H) X $(CC) $(CFLAGS) -c keywd.c ; mv keywd.o $(OBJDIR) X$(OBJDIR)/kill.o: kill.c $(H) X $(CC) $(CFLAGS) -c kill.c ; mv kill.o $(OBJDIR) X$(OBJDIR)/language.o: language.c $(H) cm.h X $(CC) $(CFLAGS) -c language.c ; mv language.o $(OBJDIR) X$(OBJDIR)/line.o: line.c $(H) X $(CC) $(CFLAGS) -c line.c ; mv line.o $(OBJDIR) X$(OBJDIR)/lisp.o: lisp.c $(H) X $(CC) $(CFLAGS) -c lisp.c ; mv lisp.o $(OBJDIR) X$(OBJDIR)/list.o: list.c $(H) X $(CC) $(CFLAGS) -c list.c ; mv list.o $(OBJDIR) X$(OBJDIR)/m_buf.o: m_buf.c $(H) X $(CC) $(CFLAGS) -c m_buf.c ; mv m_buf.o $(OBJDIR) X$(OBJDIR)/m_msg.o: m_msg.c $(H) X $(CC) $(CFLAGS) -c m_msg.c ; mv m_msg.o $(OBJDIR) X$(OBJDIR)/mac1.o: mac1.c $(H) X $(CC) $(CFLAGS) -c mac1.c ; mv mac1.o $(OBJDIR) X$(OBJDIR)/main.o: main.c $(H) X $(CC) $(CFLAGS) -c main.c ; mv main.o $(OBJDIR) X$(OBJDIR)/map.o: map.c $(H) X $(CC) $(CFLAGS) -c map.c ; mv map.o $(OBJDIR) X$(OBJDIR)/math.o: math.c $(H) X $(CC) $(CFLAGS) -c math.c ; mv math.o $(OBJDIR) X$(OBJDIR)/phys_term.o: phys_term.c $(H) X $(CC) $(CFLAGS) -c phys_term.c ; mv phys_term.o $(OBJDIR) X$(OBJDIR)/playback.o: playback.c $(H) X $(CC) $(CFLAGS) -c playback.c ; mv playback.o $(OBJDIR) X$(OBJDIR)/pty.o: pty.c $(H) X $(CC) $(CFLAGS) -c pty.c ; mv pty.o $(OBJDIR) X$(OBJDIR)/ref_string.o: ref_string.c $(H) X $(CC) $(CFLAGS) -c ref_string.c ; mv ref_string.o $(OBJDIR) X$(OBJDIR)/regexp.o: regexp.c $(H) X $(CC) $(CFLAGS) -c regexp.c ; mv regexp.o $(OBJDIR) X$(OBJDIR)/region.o: region.c $(H) X $(CC) $(CFLAGS) -c region.c ; mv region.o $(OBJDIR) X$(OBJDIR)/register.o: register.c $(H) X $(CC) $(CFLAGS) -c register.c ; mv register.o $(OBJDIR) X$(OBJDIR)/search.o: search.c $(H) X $(CC) $(CFLAGS) -c search.c ; mv search.o $(OBJDIR) X$(OBJDIR)/spawn.o: spawn.c $(H) X $(CC) $(CFLAGS) -c spawn.c ; mv spawn.o $(OBJDIR) X$(OBJDIR)/symbol.o: symbol.c $(H) X $(CC) $(CFLAGS) -c symbol.c ; mv symbol.o $(OBJDIR) X$(OBJDIR)/system.o: system.c $(H) X $(CC) $(CFLAGS) -c system.c ; mv system.o $(OBJDIR) X$(OBJDIR)/termcap.o: termcap.c $(H) X $(CC) $(CFLAGS) -c termcap.c ; mv termcap.o $(OBJDIR) X$(OBJDIR)/tty.o: tty.c $(H) X $(CC) $(CFLAGS) -c tty.c ; mv tty.o $(OBJDIR) X$(OBJDIR)/ttyio.o: ttyio.c $(H) X $(CC) $(CFLAGS) -c ttyio.c ; mv ttyio.o $(OBJDIR) X$(OBJDIR)/ttykbd.o: ttykbd.c $(H) X $(CC) $(CFLAGS) -c ttykbd.c ; mv ttykbd.o $(OBJDIR) X$(OBJDIR)/undo.o: undo.c $(H) X $(CC) $(CFLAGS) -c undo.c ; mv undo.o $(OBJDIR) X$(OBJDIR)/unix.o: unix.c $(H) X $(CC) $(CFLAGS) -c unix.c ; mv unix.o $(OBJDIR) X$(OBJDIR)/version.o: version.c $(H) X $(CC) $(CFLAGS) -c version.c ; mv version.o $(OBJDIR) X$(OBJDIR)/vm.o: vm.c $(H) X $(CC) $(CFLAGS) -c vm.c ; mv vm.o $(OBJDIR) X$(OBJDIR)/wild.o: wild.c X $(CC) $(CFLAGS) -c wild.c ; mv wild.o $(OBJDIR) X$(OBJDIR)/window.o: window.c $(H) X $(CC) $(CFLAGS) -c window.c ; mv window.o $(OBJDIR) X$(OBJDIR)/word.o: word.c $(H) X $(CC) $(CFLAGS) -c word.c ; mv word.o $(OBJDIR) X Xlint: X lint -DOPCODE=int *.c X X$(OBJ): $(H) X Xctags: X ctags *.c X######### XENIX ############### Xxenix.386: X $(MAKE) G=-O "CFLAGS=-DOPCODE=int -M3" \ X "DEFS=-DDOT=... -DPROTO" RANLIB=ranlib WORLD X Xxenix.286: X $(MAKE) "CFLAGS=-LARGE -F 4000 -M2l" \ X DEFS= TARGET=cr.286 "SEG=-SEG 256" RANLIB=ranlib WORLD X######### Microport ############### Xuport.386: X $(MAKE) G=-O WORLD Xuport.286: X $(MAKE) "CFLAGS=-DOPCODE=int -Ml -DMALLOC=4" MALLOC= WORLD X X######### Interactive Systems V.3/386 ############### Xisc: X $(MAKE) G=-O WORLD Xsun: X $(MAKE) "CFLAGS=-DSUN -pipe" LDFLAGS= RANLIB=ranlib WORLD Xsun3.x: X $(MAKE) "CFLAGS=-DOPCODE=int -DSUN -pipe" LDFLAGS= RANLIB=ranlib WORLD X386i: X $(MAKE) "CFLAGS=-DSUN -pipe" OBJDIR=obj386 L=lib386 LDFLAGS= RANLIB=ranlib WORLD Xrtpc: X $(MAKE) G=-O "CFLAGS=-DAIX -i -DMALLOC=4" WORLD X######### GNU CC compiler for me to play with.(1.34) ########## X## Known to work under Microport with GCC 1.34 Xgnu: X $(MAKE) "CC=gcc -ansi -O" X X Xcmac: X cd src/crisp ; make Xhmac: X -rm -rf /usr/local/crisp/help X -mkdir /usr/local/crisp/help X cd help/crisp ; tar cf - . | (cd /usr/local/crisp/help ; tar xvf - ) X Xcm: cm.c debug.c env.c keywd.c language.c ref_string.c system.c word.c X $(CC) $(CFLAGS) -DNOFUNCTIONS \ X -o cm cm.c debug.c env.c keywd.c \ X language.c ref_string.c system.c word.c \ X $(LIBS) X -rm *.o X Xtst: retest.o tregexp.o X $(CC) $(CFLAGS) -o tst retest.o tregexp.o /u/fox/lib/foxlib.3.a X Xtregexp.o: regexp.c X echo '# define DEBUG' > tmp.c X echo '# define STATIC' >> tmp.c X cat regexp.c >> tmp.c X $(MAKE) tmp.o X mv tmp.o tregexp.o X X#decls: X# echo '# include "gproto.h"' > decls.h X# $(CC) $(DEFS) -Zg -Zs -Zd -I/u/fox/include $(SRC) > decls.new X# grep -v static decls.new | sed 's/^..global.. //' | \ X# sed 's/(.*)/()/' | sed 's/unsigned short/u_int16/g' > decls.old X# sed 's/\.\.\./DOT/' decls.new > x X# mv x decls.new X# (echo '#ifndef _DECLS' ; \ X# echo '# define _DECLS' ; \ X# echo '# include "gproto.h"' ; \ X# echo '# ifdef PROTO' ; \ X# cat decls.new ; \ X# echo '# else' ; \ X# cat decls.old ; \ X# echo '# endif' ; \ X# echo '#endif') | grep -v static | sed 's/struct//g' > decls.h X# rm decls.new decls.old SHAR_EOF chmod 0444 ./Makefile || echo "restore of ./Makefile fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./RESUME (Text)" sed 's/^X//' << 'SHAR_EOF' > ./RESUME && XCRISP is a program which emulates the PC software called BRIEF. XIn its basic form, it is a programmers editor, and supports the Xsorts of things that are useful to programmers. X XIt basically consists of two parts - the executable binary code which Ximplements the various data structures and user interface mechanisms, Xand a high level macro language. X XThe executable code is designed to provide no restrictions - if there Xare any decisions to be made, then these are available as options Xin the macro language. X XThe macro language is a cross between C and Lisp. The Lisp language Xis fairly easy to program in but is tedious because of its prefix Xnotation, eg: X X (message "1+2*3=%d" (+ 1 (* 2 3))) X XI have been working on a higher level language, but have not finished Xit yet. X XThe executable code provides the following high level objects: X X windows - both overlapped and tiled. X buffers X files X processes X strings, integers and lists. These are used X in the programming language. X XThere can be an unlimited number of these objects. There is no limit Xto the size of files which can be edited; CRISP relies on virtual memory Xrather than implementing paging algorithms itself, which means it Xworks well on 68020 and 386 class machines, but is a bit more Xrestrictive XProcess buffers are like normal text buffers, except when the user types Xinto them, the characters are forwarded to the attached process as well Xas inserted into the buffer. When data is available to be read from the Xunderlying process, it is inserted into the text buffer as if the Xuser had typed into it. This works well for normal Unix command Xline type programs. In addition the code which talks to the underlying Xprocesses understands some subset of ANSI escape sequences (approximately Xthose understood by the SSL, because this is where the code came from Xoriginally). X XThe user interface is entirely implemented in the macro language. XThere are a set of macros for doing things like selecting options from Xpop-up windows. Currently there is no support for Windows like Xdialog boxes, but implementing that in the macro language is fairly Xtrivial - maybe a day or twos work depending on the experience of Xthe macro writer. There are an awful lot of macros which will tend Xto be appreciated more by programmers than managers, who may not Xbe aware of the problems caused by having limited screen real estate Xwhen editing files. X XCRISP has some support for word-processing features, eg there is a Xspelling checker which is layered on the standard Unix spell utility; Xa C cross-reference system. As an example of the formatting, the Xjustified margins in this memo were done entirely by a macro from Xwithin CRISP. X XCRISP has a nearly complete help system. I tend to add things to it Xwhen I have the time. X XCRISP has to be seen to be appreciated. It started out as a programming Xexercise and I use it to play with programming algorithms and learning Xabout optimisation techniques in a portable fashion. X X SHAR_EOF chmod 0644 ./RESUME || echo "restore of ./RESUME fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./THANKS (Text)" sed 's/^X//' << 'SHAR_EOF' > ./THANKS && XThanks to the following for making suggestions on improvements to Xthe code, or for providing source code for which I have spent many Xhours hacking. My apologies if your name does not appear here - Xif you think your name should go here - please mail me. I havent Xkept track of the people over the months/years. X X1. edf@rocky2.rockefeller.edu (David MacKenzie). X2. Michael J. Haertel for the putenv.c file. SHAR_EOF chmod 0666 ./THANKS || echo "restore of ./THANKS fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./TODO (Text)" sed 's/^X//' << 'SHAR_EOF' > ./TODO && X4. Split manual up. X7. terminfo SHAR_EOF chmod 0644 ./TODO || echo "restore of ./TODO fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./alt.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./alt.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 ALT_A 176 X# define ALT_B 177 X# define ALT_C 178 X# define ALT_D 179 X# define ALT_E 180 X# define ALT_F 181 X# define ALT_G 182 X# define ALT_H 183 X# define ALT_I 184 X# define ALT_J 185 X# define ALT_K 186 X# define ALT_L 187 X# define ALT_M 188 X# define ALT_N 189 X# define ALT_O 190 X# define ALT_P 191 X# define ALT_Q 192 X# define ALT_R 193 X# define ALT_S 194 X# define ALT_T 195 X# define ALT_U 196 X# define ALT_V 197 X# define ALT_W 198 X# define ALT_X 199 X# define ALT_Y 200 X# define ALT_Z 201 X X# define SHIFT_F1 140 X# define CTRL_F1 152 X# define ALT_F1 164 X# define KEY_0 202 X# define CTRL_0 216 X# define ALT_0 231 X X# define KEY_WRIGHT 0xde X# define KEY_WLEFT 0xdc X# define KEY_DEL 0xd4 X X# define BACK_TAB 0xe6 X# define ESC 0x1b SHAR_EOF chmod 0444 ./alt.h || echo "restore of ./alt.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./clk.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./clk.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 SECONDS *1000 X# define SECOND *1000 X# define MILLISECONDS X SHAR_EOF chmod 0444 ./clk.h || echo "restore of ./clk.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./cm.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./cm.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 CM_MAGIC ((')' << 8) | ')') X Xtypedef struct CM { X u_int16 cm_magic; /* Magic file number. */ X u_int16 cm_version; /* .cm version number. */ X X u_int16 cm_num_macros; /* Number of macro sections. */ X u_int16 cm_num_atoms; /* Number of atoms in all macros*/ X X u_int32 cm_globals; /* Offset to start of globals table*/ X X u_int16 cm_num_globals; /* Size of globals array. */ X u_int16 cm_num_strings; /* Number of strings. */ X X } CM; X/*------------------------------------ X/* Followed by: X/* u_int32 cm_moffsets[cm_num_macros]; X/* /* Array of cm_num_macros to */ X/* /* start of each macro. */ X/* u_int32 cm_string_offset;/* Pointer to string offset table*/ X/* MACROS X/* u_int32 cm_soffsets[cm_string_offset]; X/* /* Offsets to string table. */ X/* STRINGS X/*------------------------------------*/ X X X SHAR_EOF chmod 0444 ./cm.h || echo "restore of ./cm.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./decls.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./decls.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#ifndef _DECLS X# define _DECLS Xchar *c_string(); Xchar *bname(); XLINE *linep(); Xchar *strdup(); Xchar *chk_alloc(); Xchar *chk_realloc(); XBUFFER *numberb(); Xchar *filename(); XBUFFER *bfind(); Xvoid eval_expr(); Xvoid delete_local_symbols(); Xvoid set_hooked(); Xchar *get_arg1(); Xvoid trace_list(); Xvoid trace_ilog(); Xvoid trace_log(); Xvoid list_macro(); Xvoid dump_all_lines(); Xvoid dmp_lines(); Xvoid phex(); Xvoid dmp_win(); Xvoid dmp_coord(); Xvoid mac_list(); Xvoid print_line(); Xvoid trace_sym(); Xvoid key_list(); Xchar *c_string(); Xvoid vtinit(); Xvoid vttidy(); Xvoid vtcolor(); Xvoid vtmove(); Xvoid VTPUTC(); Xvoid vteeol(); Xvoid ucopy(); Xvoid uline(); Xvoid vtputs(); Xvoid vtleft(); Xvoid vtupdate(); Xvoid draw_title(); Xvoid vtputl(); Xvoid pupdate(); Xvoid print_cursor(); Xvoid ewprintf(); Xvoid eputc(); Xvoid eerase(); Xvoid line_col(); XBUFFER *findbuffer(); Xchar *bname(); Xvoid percentage(); Xvoid init_builtin(); XBUILTIN *lookup_builtin(); Xvoid k_init(); Xvoid k_delete(); Xvoid k_write(); Xvoid k_insert(); Xvoid get_until(); Xvoid yyerror(); Xvoid cpp(); Xvoid do_include(); Xvoid do_define(); Xvoid LPUT16(); Xvoid LPUT32(); Xlong LGET32(); Xu_int16 LGET16(); X LINE *lalloc(); Xvoid lfree(); Xvoid lchange(); Xvoid ldelete(); XMACRO *lookup_macro(); Xvoid startupfile(); X WINDOW *get_edge(); X WINDOW *get_window(); Xchar *do__prntf(); Xvoid infof(); Xvoid errorf(); Xu_int16 get_narg(); Xchar *get_cwd(); Xvoid init_file(); Xvoid edinit(); Xvoid usage(); Xvoid check_environment(); X LINE *linep(); Xvoid init_phys_term(); Xvoid decode_entry(); Xvoid pt_error(); Xvoid store_char(); Xvoid mon_write(); Xvoid mon_start(); X DISPLAY *p_create(); Xvoid p_destroy(); Xvoid p_addstr(); Xvoid p_newline(); Xvoid p_scroll(); Xvoid p_clear_screen(); Xvoid p_tab(); Xvoid p_escape(); Xvoid p_cleanup(); Xvoid p_poll(); XREGEXP *regcomp(); Xchar *next_block(); Xvoid init_register(); Xvoid trigger(); Xvoid regerror(); Xchar *get_shell(); X SYMBOL *lookup(); Xvoid str_assign(); Xvoid close_termcap(); Xchar *tgetstr(); Xchar *tcopy_string(); Xvoid ttinit(); Xvoid tttidy(); Xvoid ttmove(); Xvoid tteeol(); Xvoid tteeop(); Xvoid ttbeep(); Xvoid ttwindow(); Xvoid ttresize(); Xvoid putpad(); Xvoid ttspace(); Xvoid ttopen(); Xvoid tttimeout(); Xvoid ttclose(); Xvoid ttputpad(); Xvoid ttputs(); Xvoid ttputc(); Xvoid ttflush(); Xvoid panic(); Xvoid setttysize(); Xvoid key_init(); Xvoid j_close(); Xshort getkey(); Xchar *aitokey(); Xvoid u_init(); Xvoid u_close(); Xvoid u_insert(); Xvoid u_delete(); Xvoid u_chain(); Xvoid u_terminate(); Xvoid u_dot(); Xvoid u_raise(); Xvoid u_drop(); X WINDOW *splitwind(); Xvoid w_title(); X WINDOW *vsplitwind(); Xint window_color(); X#endif SHAR_EOF chmod 0444 ./decls.h || echo "restore of ./decls.h fails" mkdir . >/dev/null 2>&1 echo "x - extracting ./def.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ./def.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# ifndef _DEF X# define _DEF X X# include "m-machine.h" X X# if defined(VMS) X# include "llist.h" X# define EXIT_FAILURE 0 X# define EXIT_SUCCESS 1 X# else X# include "llist/llist.h" X# define EXIT_FAILURE 1 X# define EXIT_SUCCESS 0 X# endif X#include <stdio.h> X X# if defined(VMS) X# include <stat.h> X# include <file.h> X# define fork vfork X# else X# include <fcntl.h> X# include <sys/types.h> X# include <sys/stat.h> X# endif X X# if defined(EGA43) X# include <sys/at_ansi.h> X# include <sys/kd.h> X# undef DOWN X# undef UP X# undef REVERSE X# undef CTRL X# undef SHIFT X# undef ALT X# undef NORMAL X# endif X X# include <assert.h> X# include "sptree.h" X X# ifdef lint X# define SCCSID(x) X# else X# define SCCSID(x) static char sccsid[] = x; X# endif X Xtypedef long RSIZE; /* Type for file/region sizes */ Xtypedef short KEY; /* Type for internal keystrokes */ Xtypedef unsigned short u_int16; Xtypedef unsigned long u_int32; X# ifndef U_CHAR Xtypedef unsigned char u_char; X# endif X X# define NFKEYS 128 X X/* X * Universal. X */ X#define FALSE 0 /* False, no, bad, etc. */ X#define TRUE 1 /* True, yes, good, etc. */ X#define ABORT 2 /* Death, ^G, abort, etc. */ X# define QUIT -2 /* exit macro called. */ X X#define NKEYS 512 /* 9 bit code. */ X X#define KFIRST 0x0080 /* First special. */ X#define KLAST 0x009F /* Last special. */ X# define KEY_HOME 209 X# define KEY_UP 210 X# define KEY_DOWN 204 X# define KEY_LEFT 206 X# define KEY_RIGHT 208 X# define KEY_END 203 X# define KEY_PAGEUP 211 X# define KEY_PAGEDOWN 205 X X# define MK_NORMAL 1 X# define MK_COLUMN 2 X# define MK_LINE 3 X# define MK_NONINC 4 X X/* X * generally useful thing for chars X */ X#define CCHR(x) ((x) & 0x1f) X# define CTRL_A CCHR('a') X# define CTRL_B CCHR('b') X# define CTRL_C CCHR('c') X# define CTRL_D CCHR('d') X# define CTRL_E CCHR('e') X# define CTRL_F CCHR('f') X# define CTRL_G CCHR('g') X# define CTRL_H CCHR('h') X# define CTRL_I CCHR('i') X# define CTRL_J CCHR('j') X# define CTRL_K CCHR('k') X# define CTRL_L CCHR('l') X# define CTRL_M CCHR('m') X# define CTRL_N CCHR('n') X# define CTRL_O CCHR('o') X# define CTRL_P CCHR('p') X# define CTRL_Q CCHR('q') X# define CTRL_R CCHR('r') X# define CTRL_S CCHR('s') X# define CTRL_T CCHR('t') X# define CTRL_U CCHR('u') X# define CTRL_V CCHR('v') X# define CTRL_W CCHR('w') X# define CTRL_X CCHR('x') X# define CTRL_Y CCHR('y') X# define CTRL_Z CCHR('z') X X# define F1 KFIRST+0 X# define F2 KFIRST+1 X# define F3 KFIRST+2 X# define F4 KFIRST+3 X# define F5 KFIRST+4 X# define F6 KFIRST+5 X# define F7 KFIRST+6 X# define F8 KFIRST+7 X# define F9 KFIRST+8 X# define F10 KFIRST+9 X X/* X * Table sizes, etc. X */ X#define NFILEN 80 /* Length, file name. */ X#define NBUFN 24 /* Length, buffer name. */ X#define NPAT 80 /* Length, pattern. */ X#define HUGE 1000 /* A rather large number. */ X# define NTABS 6 /* Max. number of tab stops. */ X Xstruct k_tbl { X short key; X char *name; X }; X X/* X * There is a window structure allocated for X * every active display window. The windows are kept in a X * big list, in top to bottom screen order, with the listhead at X * "wheadp". Each window contains its own values of dot and mark. X * The flag field contains some bits that are set by commands X * to guide redisplay; although this is a bit of a compromise in X * terms of decoupling, the full blown redisplay is just too X * expensive to run for every input character. X */ Xtypedef struct WINDOW { X struct WINDOW *w_wndp; /* Next window. */ X struct BUFFER *w_bufp; /* Buffer displayed in window */ X long w_layer; /* Relative window layer to allow*/ X /* windows to sit on top of each*/ X /* other. */ X int w_indent; /* Left hand margin. */ X int w_top_line; /* Top line in window. */ X struct LINE *w_cache; /* Pointer to current line. */ X int w_line; /* Current line no. */ X int w_old_line; /* Line where cursor used to be.*/ X /* Used after page-up/down to */ X /* keep cursor on same line. */ X int w_col; /* Current column number. */ X int w_left; /* Left hand column. */ X int w_mined; /* Lowest line modified. */ X int w_maxed; /* Highest line modified. */ X u_int16 w_x, w_y; X u_int16 w_h, w_w; X u_char w_tiled; X struct WINDOW *w_prev; /* Previous window. */ X char w_force; /* If NZ, forcing row. */ X char w_flag; /* Flags. */ X char *w_ttitle; /* Top title line. */ X char *w_btitle; /* Bottom line title. */ X u_int16 w_num; /* Window number for inq_window */ X u_int16 w_popup; /* TRUE if pop-up window. */ X} WINDOW; X# define W_POPUP 0x01 /* Window is a pop-up. */ X# define W_ROOT 0x02 /* Window is part of background.*/ X X/* X * Window flags are set by command processors to X * tell the display system what has happened to the buffer X * mapped by the window. Setting "WFHARD" is always a safe thing X * to do, but it may do more work than is necessary. Always try X * to set the simplest action that achieves the required update. X * Because commands set bits in the "w_flag", update will see X * all change flags, and do the most general one. X */ X#define WFMOVE 0x02 /* Movement from line to line. */ X#define WFEDIT 0x04 /* Editing within a line. */ X#define WFHARD 0x08 /* Better to a full display. */ X#define WFDELL 0x10 /* Line been deleted. */ X#define WFINSL 0x20 /* Line inserted. */ X X/* X * Text is kept in buffers. A buffer header, described X * below, exists for every buffer in the system. The buffers are X * kept in a big list, so that commands that search for a buffer by X * name can find the buffer header. There is a safe store for the X * dot and mark in the header, but this is only valid if the buffer X * is not being displayed (that is, if "b_nwnd" is 0). The text for X * the buffer is kept in a circularly linked list of lines, with X * a pointer to the header line in "b_linep". X */ Xtypedef struct undo_info { X long u_chain; /* Buffer undo chain. */ X long u_last; /* ftell() position of undo. */ X long u_last1; /* This is used to allow us to */ X /* undo past the last (write_buffer)*/ X /* mark. */ X } undo_info; Xtypedef struct BUFFER { X struct BUFFER *b_bufp; /* Next buffer in list. */ X struct BUFFER *b_altb; /* Link to alternate buffer */ X int b_line; /* Current line no. */ X int b_col; /* Current column number. */ X int b_numlines; /* Lines in buffer. */ X int b_top; /* Top line on screen. */ X struct LINE *b_linep; /* Link to the header LINE */ X int b_cline; /* Cached line number. */ X struct LINE *b_clinep; /* Pointer to currently cached */ SHAR_EOF echo "End of part 1" echo "File ./def.h is continued in part 2" echo "2" > 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