diff options
-rw-r--r-- | .gdbinit | 14 | ||||
-rw-r--r-- | ANNOUNCE | 185 | ||||
-rw-r--r-- | ChangeLog | 243 | ||||
-rw-r--r-- | Idiffer.scm | 31 | ||||
-rw-r--r-- | Iedline.scm | 2 | ||||
-rw-r--r-- | Init5e4.scm (renamed from Init5e3.scm) | 98 | ||||
-rw-r--r-- | Makefile | 260 | ||||
-rw-r--r-- | README | 23 | ||||
-rw-r--r-- | Transcen.scm | 3 | ||||
-rw-r--r-- | Xlibscm.html | 3399 | ||||
-rw-r--r-- | Xlibscm.info | 40 | ||||
-rw-r--r-- | Xlibscm.texi | 2 | ||||
-rwxr-xr-x | build | 16 | ||||
-rw-r--r-- | build.scm | 101 | ||||
-rw-r--r-- | byte.c | 10 | ||||
-rw-r--r-- | bytenumb.c | 469 | ||||
-rw-r--r-- | continue.h | 4 | ||||
-rw-r--r-- | debian/changelog | 31 | ||||
-rw-r--r-- | debian/control | 6 | ||||
-rw-r--r-- | debian/doc-base | 7 | ||||
-rw-r--r-- | debian/doc-base.scm-xlib | 13 | ||||
-rw-r--r-- | debian/postinst | 6 | ||||
-rw-r--r-- | debian/postrm | 9 | ||||
-rw-r--r-- | debian/prerm | 6 | ||||
-rwxr-xr-x | debian/rules | 5 | ||||
-rw-r--r-- | debug.c | 40 | ||||
-rw-r--r-- | dynl.c | 18 | ||||
-rw-r--r-- | eval.c | 36 | ||||
-rw-r--r-- | features.txi | 4 | ||||
-rw-r--r-- | findexec.c | 19 | ||||
-rw-r--r-- | hobbit.info | 101 | ||||
-rw-r--r-- | hobbit.scm | 23 | ||||
-rw-r--r-- | hobbit.texi | 4 | ||||
-rw-r--r-- | indexes.texi | 18 | ||||
-rw-r--r-- | ioext.c | 47 | ||||
-rw-r--r-- | mkimpcat.scm | 2 | ||||
-rw-r--r-- | patchlvl.h | 4 | ||||
-rw-r--r-- | platform.txi | 8 | ||||
-rw-r--r-- | posix.c | 2 | ||||
-rw-r--r-- | r4rstest.scm | 9 | ||||
-rw-r--r-- | ramap.c | 76 | ||||
-rw-r--r-- | record.c | 22 | ||||
-rw-r--r-- | repl.c | 432 | ||||
-rw-r--r-- | requires.scm | 12 | ||||
-rw-r--r-- | rgx.c | 10 | ||||
-rw-r--r-- | rope.c | 18 | ||||
-rw-r--r-- | scl.c | 24 | ||||
-rw-r--r-- | scm.1 | 9 | ||||
-rw-r--r-- | scm.c | 39 | ||||
-rw-r--r-- | scm.doc | 8 | ||||
-rw-r--r-- | scm.h | 86 | ||||
-rw-r--r-- | scm.info | 1088 | ||||
-rw-r--r-- | scm.nsi | 477 | ||||
-rw-r--r-- | scm.spec | 4 | ||||
-rw-r--r-- | scm.texi | 280 | ||||
-rw-r--r-- | scmfig.h | 22 | ||||
-rw-r--r-- | scmhob.h | 8 | ||||
-rw-r--r-- | script.c | 4 | ||||
-rw-r--r-- | socket.c | 8 | ||||
-rw-r--r-- | subr.c | 76 | ||||
-rw-r--r-- | sys.c | 91 | ||||
-rw-r--r-- | time.c | 2 | ||||
-rw-r--r-- | unif.c | 40 | ||||
-rw-r--r-- | version.txi | 4 | ||||
-rw-r--r-- | x.c | 16 |
65 files changed, 3089 insertions, 5085 deletions
@@ -55,18 +55,18 @@ define verbose end define errobj - call iprin1(*loc_errobj, sys_protects[2], 1),(void)0 - call newline(sys_protects[2]),(void)0 + call scm_iprin1(*loc_errobj, sys_protects[2], 1),(void)0 + call scm_newline(sys_protects[2]),(void)0 end define scm - call iprin1($arg0, sys_protects[2], 1),(void)0 - call newline(sys_protects[2]),(void)0 + call scm_iprin1($arg0, sys_protects[2], 1),(void)0 + call scm_newline(sys_protects[2]),(void)0 end define code call scm_princode($arg0, scm_estk_ptr[2], sys_protects[2], 1),(void)0 - call newline(sys_protects[2]),(void)0 + call scm_newline(sys_protects[2]),(void)0 end define lload @@ -101,12 +101,12 @@ CDR of $ end define disp - call iprin1($arg0, sys_protects[2], 0) + call scm_iprin1($arg0, sys_protects[2], 0) echo \n end define writ - call iprin1($arg0, sys_protects[2], 1) + call scm_iprin1($arg0, sys_protects[2], 1) echo \n end @@ -1,4 +1,4 @@ -This message announces the availability of Scheme release scm5e3. +This message announces the availability of Scheme release scm5e4. SCM conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification. SCM is written in C and runs under @@ -12,176 +12,87 @@ programs (see http://swiss.csail.mit.edu/~jaffer/SCM_LICENSE). Documentation and distributions in several formats are linked from SCM's home page: - http://swissnet.ai.mit.edu/~jaffer/SCM.html + http://swiss.csail.mit.edu/~jaffer/SCM Links to distributions of SCM and related softwares are at the end of this message. -=-=- -scm5e3 news: +scm5e4 news: -Richard Harke ported SCM to the Linux-ia64. +* Jerry van Dijk wrote NSIS script to create MS-Windows installers. -SRFI-94 Type-Restricted Numerical Functions. +* Added (compiled) byte-number module. -SRFI-63 uniform array type support expanded to: +* scm-file-position replaces file-position and file-set-position!; + moved from i/o-extensions module to SCM core functionality. - A:floC64b inexact 64.bit binary flonum complex - A:floC32b inexact 32.bit binary flonum complex - A:floC16b inexact 16.bit binary flonum complex - A:floR64b inexact 64.bit binary flonum real - A:floR32b inexact 32.bit binary flonum real - A:floR16b inexact 16.bit binary flonum real - A:fixZ32b exact 32.bit binary fixnum - A:fixZ16b exact 16.bit binary fixnum - A:fixZ8b exact 8.bit binary fixnum - A:fixN32b exact 32.bit nonnegative binary fixnum - A:fixN16b exact 16.bit nonnegative binary fixnum - A:fixN8b exact 8.bit nonnegative binary fixnum - A:bool boolean - string char +* Added --no-symbol-case-fold command-line option to make symbol + reading case-sensitive. -Radey Shouman has changed LETREC to behave like LETREC*: +* Added (R6RS) bitwise-bit-count. - * eval.c (ceval_1): Change LETREC behavior to that of LETREC*: - initializers are run in left to right order, and may use - previously evaluated variables bound in the same contour. This - change also applies to LETRECs resulting from internal DEFINE. - - * eval.c (macroexp1): Add #ifdef to switch case handling line numbers - in ceval_1 so that they are safely discarded when MEMOIZE_LOCALS is - not #defined. Perhaps line number generation should be disabled in - that case. - - * scl.c: Changes to allow compilation with MinGW (gnu-win32); - asinh, acosh, and atanh are not yet supported. - -From Aubrey Jaffer: - - * indexes.texi (Indexes): Give each index its own node when not in - info mode. Moved index stuff here so it doesn't break - texinfo-every-node-update. - - * scm.texi (Index): Replaced nodes under Indexes with node Index - when in info mode; fixes indexing in Emacs 21.4.1. - Converted to use @copying. - (Indexes): Reorganized. - (Data Type Representations): Corrected pattern for specfun and cclo. - - * byte.c (subbytes): Added. - (scm_subbytes_read, scm_subbytes_write): Renamed from substring. - - * Makefile (dscm4, dscm5): != is string operator in shell. - "mv -f" for previous scm, slibcat, and implcat. - - * Init5e2.scm (boot-tail): Don't load ScmInit.scm if *script*. - (string-index, read-line): Defined for login->home-directory, which - may be called before REQUIRE is defined. - - * Makefile (dscm4, dscm5): Added randomize_va_space machinations. - (dvi, pdf): New tetex-3.0(-20.FC5) broke them -- fixed. - (SETARCH): Workarounds allow dumping in recent Linux. - - * time.c (linux): defined CLKTCK to (sysconf(_SC_CLK_TCK)). - - * repl.c (scm_read_numbered): Don't #ifndef MEMOIZED_LOCALS. - - * build.scm (dont-memoize-locals): Added feature. - (stack-limit): Removed feature. - - * scmfig.h (STACK_LIMIT): Always defined. - (CHECK_STACK): Condition on scm_verbose. - - * sys.c (stack_check): Always present. - - * Makefile (docs): Added target to make all documentation files; - then invoke xdvi. - - * ugsetjmp.s (_setjump, _longjump): For Ultrix VAX circa 1997. - - * subr.c (mkbig, adjbig): Improved overflow message. - - * mkimpcat.scm (wbtab, rwb-isam): moved to "Simple associations". - (add-source): Use 'source form and check file's existence. - - * scl.c (scm_magnitude): Extend dynamic range by eliminating - intermediate expression swell. - (divide): Use "Smith's formula" to extend dynamic range; - but makes an insignificant difference when compiled with -O3. - (atanh, acosh, asinh): define if #ifndef HAVE_ATANH. - - * scmfig.h (HAVE_ATANH): Decides whether atanh, asinh, and acosh - are supported. - - * r4rstest.scm (5 2 1): Expose Bigloo tprint redefinition bug. - (test-bignum): Convert test bignums from strings. - (have-bignums?): Check bignum arithmetic works. - (test-inexact): Do complex tests only if non-real numbers are - supported. - (test-inexact): Added equal? tests. - (test-inexact): Test for -0.0 lossage. - (test-inexact): Check that / and magnitude work for - very large and very small complex numbers (1e300; 1e-300); +* Makefile (install*): Added $(DESTDIR) prefix. -=-=- SCM source is available from: - http://swissnet.ai.mit.edu/ftpdir/scm/scm5e3.zip - swissnet.ai.mit.edu:/pub/scm/scm5e3.zip - http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e3-1.src.rpm - swissnet.ai.mit.edu:/pub/scm/scm-5e3-1.src.rpm + http://swiss.csail.mit.edu/ftpdir/scm/scm5e4.zip + swiss.csail.mit.edu:/pub/scm/scm5e4.zip + http://swiss.csail.mit.edu/ftpdir/scm/scm-5e4-1.src.rpm + swiss.csail.mit.edu:/pub/scm/scm-5e4-1.src.rpm Also available as i386 binary RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e3-1.i386.rpm - swissnet.ai.mit.edu:/pub/scm/scm-5e3-1.i386.rpm + http://swiss.csail.mit.edu/ftpdir/scm/scm-5e4-1.i386.rpm + swiss.csail.mit.edu:/pub/scm/scm-5e4-1.i386.rpm SLIB is a portable Scheme library which SCM uses: - http://swissnet.ai.mit.edu/ftpdir/scm/slib3a4.zip - swissnet.ai.mit.edu:/pub/scm/slib3a4.zip + http://swiss.csail.mit.edu/ftpdir/scm/slib3a5.zip + swiss.csail.mit.edu:/pub/scm/slib3a5.zip Also available as RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/slib-3a4-1.noarch.rpm - swissnet.ai.mit.edu:/pub/scm/slib-3a4-1.noarch.rpm + http://swiss.csail.mit.edu/ftpdir/scm/slib-3a5-1.noarch.rpm + swiss.csail.mit.edu:/pub/scm/slib-3a5-1.noarch.rpm JACAL is a symbolic math system written in Scheme: - http://swissnet.ai.mit.edu/ftpdir/scm/jacal1b7.zip - swissnet.ai.mit.edu:/pub/scm/jacal1b7.zip + http://swiss.csail.mit.edu/ftpdir/scm/jacal1b8.zip + swiss.csail.mit.edu:/pub/scm/jacal1b8.zip SLIB-PSD is a portable debugger for Scheme (requires emacs editor): - http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz - swissnet.ai.mit.edu:/pub/scm/slib-psd1-3.tar.gz + http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz + swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz SMG-SCM is an SMG interface package which works with SCM on VMS. - http://swissnet.ai.mit.edu/ftpdir/scm/smg-scm2a1.zip - swissnet.ai.mit.edu:/pub/scm/smg-scm2a1.zip + http://swiss.csail.mit.edu/ftpdir/scm/smg-scm2a1.zip + swiss.csail.mit.edu:/pub/scm/smg-scm2a1.zip A VMS version of Unzip is available by anonymous FTP from ftp.spc.edu:[ANONYMOUS.MACRO32]UNZIP.EXE. TURTLSCM is a turtle graphics package which works with SCM on MS-DOS or X11 machines: - http://swissnet.ai.mit.edu/ftpdir/scm/turtlegr.tar.gz - swissnet.ai.mit.edu:/pub/scm/turtlegr.tar.gz + http://swiss.csail.mit.edu/ftpdir/scm/turtlegr.tar.gz + swiss.csail.mit.edu:/pub/scm/turtlegr.tar.gz XSCM is a X windows interface package which works with SCM: - http://swissnet.ai.mit.edu/ftpdir/scm/xscm-2.01.tar.gz - swissnet.ai.mit.edu:/pub/scm/xscm-2.01.tar.gz + http://swiss.csail.mit.edu/ftpdir/scm/xscm-2.01.tar.gz + swiss.csail.mit.edu:/pub/scm/xscm-2.01.tar.gz MacSCM is a Macintosh applications building package which works with SCM (similar to XSCM). - http://swissnet.ai.mit.edu/ftpdir/scm/macscm.tar.Z - swissnet.ai.mit.edu:/pub/scm/macscm.tar.Z + http://swiss.csail.mit.edu/ftpdir/scm/macscm.tar.Z + swiss.csail.mit.edu:/pub/scm/macscm.tar.Z WB is a disk based, sorted associative array (B-tree) library for SCM. Using WB, large databases can be created and managed from SCM. - http://swissnet.ai.mit.edu/ftpdir/scm/wb1c3.zip - swissnet.ai.mit.edu:/pub/scm/wb1c3.zip - http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c3-1.src.rpm - swissnet.ai.mit.edu:/pub/scm/wb-1c3-1.src.rpm + http://swiss.csail.mit.edu/ftpdir/scm/wb2a1.zip + swiss.csail.mit.edu:/pub/scm/wb2a1.zip + http://swiss.csail.mit.edu/ftpdir/scm/wb-2a1-1.src.rpm + swiss.csail.mit.edu:/pub/scm/wb-2a1-1.src.rpm Also available as i386 binary RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c3-1.i386.rpm - swissnet.ai.mit.edu:/pub/scm/wb-1c3-1.i386.rpm + http://swiss.csail.mit.edu/ftpdir/scm/wb-2a1-1.i386.rpm + swiss.csail.mit.edu:/pub/scm/wb-2a1-1.i386.rpm SIMSYNCH is a digital logic simulation system written in SCM. - http://swissnet.ai.mit.edu/ftpdir/scm/synch1b0.zip - swissnet.ai.mit.edu:/pub/scm/synch1b0.zip + http://swiss.csail.mit.edu/ftpdir/scm/synch1b0.zip + swiss.csail.mit.edu:/pub/scm/synch1b0.zip DLD is a C library package allowing SCM to dynamically load object files on VAX (Ultrix), Sun 3 (SunOS 3.4 and 4.0), SPARCstation @@ -190,15 +101,15 @@ systems. ftp.gnu.org:pub/gnu/dld/dld-3.3.tar.gz SCM.EXE (314k) is a SCM executable for DOS and MS-Windows. -Note: SCM.EXE still requires slib3a4 and scm5e3 above. - http://swissnet.ai.mit.edu/ftpdir/scm/scm.exe - swissnet.ai.mit.edu:/pub/scm/scm.exe +Note: SCM.EXE still requires slib3a5 and scm5e4 above. + http://swiss.csail.mit.edu/ftpdir/scm/scm.exe + swiss.csail.mit.edu:/pub/scm/scm.exe #! implements "#!" (POSIX) shell-scripts for MS-DOS batch files. - http://swissnet.ai.mit.edu/ftpdir/scm/sharpbang.zip - swissnet.ai.mit.edu:/pub/scm/sharpbang.zip - http://swissnet.ai.mit.edu/ftpdir/scm/#!.zip - swissnet.ai.mit.edu:/pub/scm/#!.zip + http://swiss.csail.mit.edu/ftpdir/scm/sharpbang.zip + swiss.csail.mit.edu:/pub/scm/sharpbang.zip + http://swiss.csail.mit.edu/ftpdir/scm/#!.zip + swiss.csail.mit.edu:/pub/scm/#!.zip Programs for printing and viewing TexInfo documentation (which SCM has) come with GNU Emacs or can be obtained via ftp from: @@ -1,3 +1,246 @@ +2007-11-28 Aubrey Jaffer <agj@alum.mit.edu> + + * bytenumb.c (scm_integer_to_bytes): Declaration must start block. + + * Makefile (Checklit, Check): Added case-sensitive checks. + + * repl.c (scm_lreadr): Made case-insensitive for character names. + +2007-11-25 Aubrey Jaffer <agj@alum.mit.edu> + + * patchlvl.h (SCMVERSION): Bumped from 5e3 to 5e4. + +2007-11-24 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (release): Upload scm.pdf. + + * repl.c (scm_lreadparen): Fixed case-sensitive symbol reading. + +2007-11-23 Aubrey Jaffer <jaffer@aubrey.jaffer> + + * requires.scm, Iedline.scm, Init5e4.scm: Downcased symbols to + work with case-sensitive symbols (--no-symbol-case-fold). + +2007-11-03 Aubrey Jaffer <agj@alum.mit.edu> + + * repl.c (scm_file_position): Added replacement for + file_set_position and file_position. + + * Init5e3.scm (file-position, file-set-position): Added stub. + + * ioext.c (file_set_position, file_position): Moved to repl.c. + + * scm.texi (Port Properties): Moved file-position from + I/O-Extensions. + +2007-10-24 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (wb): Added "../wb/segs.c". + +2007-10-20 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.nsi: Install "mkimpcat.scm", "wbtab.scm", and "rwb-isam.scm". + +2007-10-14 Aubrey Jaffer <agj@alum.mit.edu> + + * Init5e3.scm (slib:load): Is not the same as slib:load-source. + +2007-09-07 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi (Making SCM): Added cross reference to "Building SCM". + +2007-09-04 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (install): Remove wb dependencies. + + * build.scm, build: Changed copyright and license to match others. + +2007-09-03 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (scm4): Added target. + (install*): Added $(DESTDIR) prefix. + +2007-08-05 Aubrey Jaffer <agj@alum.mit.edu> + + * findexec.c (__DragonflyBSD__, __OpenBSD__): Added. Made BSD + derivative includes more uniform. + + * scm.texi (Automatic C Preprocessor Definitions): Added + __DragonflyBSD__ and __OpenBSD__. + + * repl.c, scl.c, scm.h: Replaced (int) casts with PTR2INT(). + + * scmfig.h (PTR2INT): Added; conditioned on 64.bit processor. + +2007-07-22 Aubrey Jaffer <agj@alum.mit.edu> + + * repl.c (linux): Adding "#include <ctype.h>" fixes implicit + declaration warnings. + +2007-07-21 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.h (num2char): Added declaration. + + * scmfig.h (linux): Adding "#include <unistd.h>" fixes implicit + declaration warnings. + + * findexec.c (linux): Adding "#include <string.h>" fixes implicit + declaration warnings. + +2007-07-19 Aubrey Jaffer <agj@alum.mit.edu> + + * dynl.c (l_dyn_main_call): Removed const from argv. + + * rope.c, scm.h (must_free_argv): Removed `const's from argv. + +2007-07-16 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (udscm5): strip udscm5. + + * scmfig.h: __FreeBSD__ now includes <unistd.h>. + +2007-07-15 Aubrey Jaffer <agj@alum.mit.edu> + + * sys.c (prinport): Don't choke if ttyname returns NULL. + +2007-06-18 Aubrey Jaffer <agj@alum.mit.edu> + + * subr.c (scm_bitwise_bit_count): Added; returns negative integer + for negative input. + +2007-06-08 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile: Changed to use "mkdir -p". + +2007-05-31 Aubrey Jaffer <agj@alum.mit.edu> + + * ramap.c (scm_array_index_for_each): Added. + +2007-04-28 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (gdb.opt): Clear when copying from udscm5.opt. + (scm.html, hobbit.html): Make in unix for w32install because MinGW + chokes on @syncodeindex. + +2007-04-19 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi: Don't break @ref fields over lines. + +2007-04-19 Jerry van Dijk + + * scm.nsi: Added "scmhob.scm". + +2007-04-16 Aubrey Jaffer <agj@alum.mit.edu> + + * repl.c (scm_write): Renamed from lwrite. + (scm_display): Renamed from display. + (scm_newline): Renamed from newline. + (scm_write_char): Renamed from write_char. + (scm_peek_char): Renamed from peek_char. + + * Makefile (udgdbscm, gdbscm): Added dependencies. + +2007-04-15 Aubrey Jaffer <agj@alum.mit.edu> + + * sys.c (sysputs): Don't lfflush cur_errp. + (sysflush): Removed call to syswrite() which doesn't flush. + + * scm.c (process_signals): Don't lfflush. + + * sys.c (marksafep, syswrite): Internal calls to lflush replaced + by conditioned calls to lfflush. + + * repl.c (scm_force_output): Renamed from lflush. + Internal calls replaced by conditioned calls to lfflush. + +2007-04-14 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (udscm5): Depends on ufiles. + (ufiles): Moved earlier in file so dependencies work. + +2007-03-28 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (build): atari.st --> atari-st. + +2007-03-27 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (gw32scmwb.sh, scm.exe): Run in MinGW MSYS. + +2007-03-26 Aubrey Jaffer <agj@alum.mit.edu> + + * Transcen.scm: Provide math-real and srfi-94. + + * Makefile ($(DOSCM)dist/scm$(VERSION).zip): Don't fail if there + is nothing to be updated in zip file. + +2007-03-25 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (wb): Trailing "/" on -I ../scm/ choked MinGW. + + * Makefile (gw32scmwb.sh): Added target for GNU-Win32 compilation. + (mfiles): Added "scm.nsi". + + * build.scm (wb): wb/ent.c --> wb/ents.c. + +2007-03-24 Aubrey Jaffer <agj@alum.mit.edu> + + * indexes.texi: Made like SLIB's; doesn't choke makeinfo --html. + +2007-03-09 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (5 2 1): Added tests for top-level define scope + violation (Kawa). + +2007-03-05 Jerry van Dijk + + * Makefile (w32install): Added target. + + * make-scm-msys.sh: Compile script for MS-Windows. + + * scm.nsi: NSIS Windows installer script. + +2007-01-06 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (byte-number): Added feature. + + * mkimpcat.scm (byte-number): Added. + + * Makefile (cfiles, mydlls): Added bytenumb.c. + (bytenumb.so): Added. + + * bytenumb.c: Byte/integer and byte/IEEE-floating-point + conversions. + +2007-01-03 Aubrey Jaffer <agj@alum.mit.edu> + + * rope.c (scm_addr, scm_base_addr): Added const to s_name arg. + +2006-11-24 Aubrey Jaffer <agj@alum.mit.edu> + + * Init5e3.scm, scm.1, scm.doc, scm.texi (--no-symbol-case-fold): + Added command-line option. + +2006-11-22 Aubrey Jaffer <agj@alum.mit.edu> + + * repl.c: Prefixed lread* functions with scm_ (like Guile). + (scm_iprin1): Don't slashify capitals if case_sensitize_symbols. + (scm_read_token): Don't downcase if case_sensitize_symbols. + + * scm.c (case_sensitize_symbols): Added variable. + (scm_init_from_argv): Set case_sensitize_symbols (to 8) if option + "--no-symbol-case-fold" given. + + * x.c, unif.c, sys.c, socket.c, scm.h, scl.c, rgx.c, record.c, + hobbit.scm, .gdbinit, eval.c, dynl.c, debug.c: Prefixed ipr* + functions with scm_ (like Guile). + +2006-10-28 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (C-libraries): Regularized lib-path field. + (make-defaulting-platform-lookup): Default to OS before *unknown*. + + * Makefile (scm5, udscm4, udscm5): Don't fail deleting *.o files. + 2006-10-21 Aubrey Jaffer <jaffer@aubrey.jaffer> * patchlvl.h (SCMVERSION): Bumped from 5e2 to 5e3. diff --git a/Idiffer.scm b/Idiffer.scm index ee36485..58373f9 100644 --- a/Idiffer.scm +++ b/Idiffer.scm @@ -83,22 +83,21 @@ (define (diff:edits A B . p-lim) (define M (car (array-dimensions A))) (define N (car (array-dimensions B))) - (set! p-lim (if (null? p-lim) -1 (car p-lim))) - (let ((fp (make-array (A:fixZ32b) (if (negative? p-lim) - (+ 3 M N) - (+ 3 (abs (- N M)) p-lim p-lim))))) - (define est (if (< N M) - (diff2editlen fp B A p-lim) - (diff2editlen fp A B p-lim))) - (and est - (let ((edits (make-array (A:fixZ32b) est)) - (CCRR (make-array (A:fixZ32b) (* 2 (+ (max M N) 1))))) - (cond ((< N M) - (diff2edits! edits fp CCRR B A) - (diff:invert-edits! edits)) - (else - (diff2edits! edits fp CCRR A B))) - edits)))) + (define est (diff:edit-length A B (if (null? p-lim) -1 (car p-lim)))) + (and est + (let ((CCRR (make-array (A:fixZ32b) (* 2 (+ (max M N) 1)))) + (edits (make-array (A:fixZ32b) est))) + (define fp (make-array (A:fixZ32b) + (+ (max (- N (quotient M 2)) + (- M (quotient N 2))) + (- est (abs (- N M))) ; 2 * p-lim + 3))) + (cond ((< N M) + (diff2edits! edits fp CCRR B A) + (diff:invert-edits! edits)) + (else + (diff2edits! edits fp CCRR A B))) + edits))) (define (diff:edit-length A B . p-lim) (define M (car (array-dimensions A))) diff --git a/Iedline.scm b/Iedline.scm index 1d49559..e25c1c0 100644 --- a/Iedline.scm +++ b/Iedline.scm @@ -77,7 +77,7 @@ (tail (read-char strp))) str))))) #f) - OPEN_BOTH))) + open_both))) (define line-editing (let ((edit-port #f) diff --git a/Init5e3.scm b/Init5e4.scm index 305cea0..bd5874f 100644 --- a/Init5e3.scm +++ b/Init5e4.scm @@ -41,8 +41,8 @@ ;;;; "Init.scm", Scheme initialization code for SCM. ;;; Author: Aubrey Jaffer. -(define (scheme-implementation-type) 'SCM) -(define (scheme-implementation-version) "5e3") +(define (scheme-implementation-type) 'scm) +(define (scheme-implementation-version) "5e4") (define (scheme-implementation-home-page) "http://swiss.csail.mit.edu/~jaffer/SCM") @@ -51,18 +51,18 @@ ;@ (define (user-vicinity) (case (software-type) - ((VMS) "[.]") + ((vms) "[.]") (else ""))) ;@ (define vicinity:suffix? (let ((suffi (case (software-type) - ((AMIGA) '(#\: #\/)) - ((MACOS THINKC) '(#\:)) - ((MS-DOS WINDOWS ATARIST OS/2) '(#\\ #\/)) - ((NOSVE) '(#\: #\.)) - ((UNIX COHERENT PLAN9) '(#\/)) - ((VMS) '(#\: #\])) + ((amiga) '(#\: #\/)) + ((macos thinkc) '(#\:)) + ((ms-dos windows atarist os/2) '(#\\ #\/)) + ((nosve) '(#\: #\.)) + ((unix coherent plan9) '(#\/)) + ((vms) '(#\: #\])) (else (slib:warn "require.scm" 'unknown 'software-type (software-type)) "/")))) @@ -81,7 +81,7 @@ ;@ (define sub-vicinity (case (software-type) - ((VMS) (lambda + ((vms) (lambda (vic name) (let ((l (string-length vic))) (if (or (zero? (string-length vic)) @@ -91,10 +91,10 @@ "." name "]"))))) (else (let ((*vicinity-suffix* (case (software-type) - ((NOSVE) ".") - ((MACOS THINKC) ":") - ((MS-DOS WINDOWS ATARIST OS/2) "\\") - ((UNIX COHERENT PLAN9 AMIGA) "/")))) + ((nosve) ".") + ((macos thinkc) ":") + ((ms-dos windows atarist os/2) "\\") + ((unix coherent plan9 amiga) "/")))) (lambda (vic name) (string-append vic name *vicinity-suffix*)))))) ;@ @@ -114,14 +114,15 @@ (lambda () (exchange old))))))) (define slib:features - (append '(ed getenv tmpnam abort transcript with-file - ieee-p1178 rev4-report rev4-optional-procedures - hash object-hash delay dynamic-wind fluid-let - multiarg-apply multiarg/and- logical defmacro - string-port source current-time sharp:semi - vicinity srfi-59 srfi-23 srfi-94 - srfi-60) ;logical - (if (defined? *features*) *features* slib:features))) + (append '(ed getenv tmpnam abort transcript with-file + ieee-p1178 rev4-report rev4-optional-procedures + hash object-hash delay dynamic-wind fluid-let + multiarg-apply multiarg/and- logical defmacro + string-port source current-time sharp:semi + math-integer ;math-real and srfi-94 provided in "Transcen.scm" + vicinity srfi-59 srfi-23 + srfi-60) ;logical + (if (defined? *features*) *features* slib:features))) (if (defined? *features*) (set! *features* slib:features)) (define eval @@ -371,39 +372,39 @@ ;;; VMS does something strange when output is sent to both ;;; CURRENT-OUTPUT-PORT and CURRENT-ERROR-PORT. -(case (software-type) ((VMS) (set-current-error-port (current-output-port)))) +(case (software-type) ((vms) (set-current-error-port (current-output-port)))) ;;; OPEN_READ, OPEN_WRITE, and OPEN_BOTH are used to request the proper ;;; mode to open files in. MS-DOS does carriage return - newline ;;; translation if not opened in `b' mode. -(define OPEN_READ (case (software-type) - ((MS-DOS WINDOWS ATARIST) 'rb) +(define open_read (case (software-type) + ((ms-dos windows atarist) 'rb) (else 'r))) -(define OPEN_WRITE (case (software-type) - ((MS-DOS WINDOWS) 'wbc) - ((ATARIST) 'wb) +(define open_write (case (software-type) + ((ms-dos windows) 'wbc) + ((atarist) 'wb) (else 'w))) -(define OPEN_BOTH (case (software-type) - ((MS-DOS WINDOWS) 'r+bc) - ((ATARIST) 'r+b) +(define open_both (case (software-type) + ((ms-dos windows) 'r+bc) + ((atarist) 'r+b) (else 'r+))) (define ((make-moder str) mode) (if (symbol? mode) (string->symbol (string-append (symbol->string mode) str)) (string-append mode str))) -(define _IONBF (make-moder "0")) -(define _TRACKED (make-moder "?")) -(define _EXCLUSIVE (make-moder "x")) +(define _ionbf (make-moder "0")) +(define _tracked (make-moder "?")) +(define _exclusive (make-moder "x")) (define could-not-open #f) (define (open-output-file str) - (or (open-file str OPEN_WRITE) + (or (open-file str open_write) (and (procedure? could-not-open) (could-not-open) #f) (error "OPEN-OUTPUT-FILE couldn't open file " str))) (define (open-input-file str) - (or (open-file str OPEN_READ) + (or (open-file str open_read) (and (procedure? could-not-open) (could-not-open) #f) (error "OPEN-INPUT-FILE couldn't open file " str))) @@ -436,6 +437,11 @@ (cond ((file-exists? str) #f) (else (try-open-file str modes)))))))))) +(if (not (defined? file-position)) +(define (file-position . args) #f)) +(if (not (defined? file-set-position)) +(define file-set-position file-position)) + (define close-input-port close-port) (define close-output-port close-port) @@ -514,7 +520,7 @@ (define browse-url (case (software-type) - ((UNIX COHERENT PLAN9) + ((unix coherent plan9) (lambda (url) (define (try cmd end) (zero? (system (string-append cmd url end)))) (or (try "netscape-remote -remote 'openURL(" ")'") @@ -566,11 +572,11 @@ (if (not (defined? file-exists?)) (define (file-exists? str) - (let ((port (open-file str OPEN_READ))) + (let ((port (open-file str open_read))) (errno 0) (and port (close-port port) #t)))) (define (file-readable? str) - (let ((port (open-file str OPEN_READ))) + (let ((port (open-file str open_read))) (errno 0) (and port (char-ready? port) @@ -771,7 +777,7 @@ (and login (set! home (login->home-directory login))))) (and home (case (software-type) - ((UNIX COHERENT PLAN9 MS-DOS) ;V7 unix has a / on HOME + ((unix coherent plan9 ms-dos) ;V7 unix has a / on HOME (if (not (eqv? #\/ (string-ref home (+ -1 (string-length home))))) (set! home (string-append home "/")))))) @@ -787,10 +793,12 @@ ;;; DO NOT MOVE! SLIB:LOAD-SOURCE and SLIB:LOAD must be defined after ;;; "require.scm" is loaded. -(define (slib:load-source file . libs) +(define (slib:load-source file) + (fluid-let ((*load-reader* *slib-load-reader*)) + (scm:load-source file))) +(define (slib:load file . libs) (fluid-let ((*load-reader* *slib-load-reader*)) (apply scm:load file libs))) -(define slib:load slib:load-source) ;;; Legacy grease (if (not (defined? slib:in-catalog?)) @@ -923,6 +931,7 @@ (define bitwise-and logand) (define bitwise-not lognot) ;;(define bit-count logcount) ;Aliases bit-vector function +;;BITWISE-BIT-COUNT returns negative count for negative inputs. (define bit-set? logbit?) (define any-bits-set? logtest) (define first-set-bit log2-binary-factors) @@ -1243,7 +1252,7 @@ (vector-ref table n))) (if (and (exact? n) (integer? n) (not (negative? n))) (isqrt n) - (type-error 'integer-sqrt n))))) + (slib:error 'integer-sqrt n))))) (if (defined? array?) (begin @@ -1421,6 +1430,7 @@ (let* ((simple-opts "muvqibs") (arg-opts '("a kbytes" "-version" "-help" + "-no-symbol-case-fold" "no-init-file" "-no-init-file" "p number" "h feature" "r feature" "d filename" "f filename" "l filename" @@ -1501,6 +1511,7 @@ ;; -i => (set! *interactive* #t) ;; -b => (set! *interactive* #f) ;; -s => set argv, don't execute first one + ;; --no-symbol-case-fold => symbols preserve character case ;; -no-init-file => don't load init file ;; --no-init-file => don't load init file ;; --help => print and exit @@ -1560,6 +1571,7 @@ (else (or (cond ((not (string? option)) #f) ((string-ci=? "no-init-file" option)) + ((string-ci=? "no-symbol-case-fold" option)) ((string-ci=? "version" option) (display (string-append exe-name " " @@ -55,7 +55,7 @@ SHOBJS = *.so #BUILD = ./build -hsystem -p svr4-gcc-sun-ld BUILD = ./build -hsystem -# Workaround for unexec on Fedora Core 1 Linux i386 +# Workaround for unexec on Fedora Core 1 GNU/Linux i386 #SETARCH = setarch i386 # http://jamesthornton.com/writing/emacs-compile.html @@ -104,12 +104,16 @@ hfiles = scm.h scmfig.h setjump.h patchlvl.h continue.h cfiles = scmmain.c scm.c time.c repl.c ioext.c scl.c sys.c eval.c \ subr.c sc2.c unif.c rgx.c crs.c dynl.c record.c posix.c socket.c\ unix.c rope.c ramap.c gsubr.c edline.c continue.c \ - findexec.c script.c debug.c byte.c differ.c + findexec.c script.c debug.c byte.c bytenumb.c differ.c +ufiles = pre-crt0.c ecrt0.c gmalloc.c unexec.c unexelf.c unexhp9k800.c \ + unexsunos4.c unexalpha.c unexsgi.c +# cxux-crt0.s ecrt0.c gmalloc.c pre-crt0.c unexaix.c unexalpha.c \ +# unexapollo.c unexconvex.c unexec.c unexelf.c unexelf1.c \ +# unexencap.c unexenix.c unexfx2800.c unexhp9k800.c unexmips.c \ +# unexnext.c unexnt.c unexsgi.c unexsni.c unexsunos4.c ofiles = scm.o time.o repl.o scl.o sys.o eval.o subr.o unif.o rope.o \ continue.o findexec.o script.o debug.o -ifeq ($(ARCH),ia64) -ofiles += continue-ia64.o -endif +# continue-ia64.o ifiles = Init$(VERSION).scm Transcen.scm Link.scm Macro.scm Macexp.scm \ Tscript.scm compile.scm Iedline.scm Idiffer.scm hobfiles = hobbit.scm scmhob.scm scmhob.h @@ -163,6 +167,16 @@ scm: scmlit $(BUILD) -s $(IMPLPATH) -F cautious bignums arrays # i/o-extensions $(MAKE) check +# R4RS interpreter (not dumpable) +scm4.opt: + echo "-F cautious bignums arrays inexact" >> scm4.opt + echo "-F engineering-notation dynamic-linking" >> scm4.opt +# if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> scm4.opt; fi +scm4: $(cfiles) $(hfiles) build.scm build scm4.opt + $(BUILD) -f scm4.opt -o scm -s $(IMPLPATH) + -rm $(ofiles) scmmain.o + -$(MAKE) check + # R5RS interpreter (not dumpable) scm5.opt: echo "-F cautious bignums arrays inexact" >> scm5.opt @@ -171,7 +185,7 @@ scm5.opt: # if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> scm5.opt; fi scm5: $(cfiles) $(hfiles) build.scm build scm5.opt $(BUILD) -f scm5.opt -o scm -s $(IMPLPATH) - rm $(ofiles) scmmain.o + -rm $(ofiles) scmmain.o -$(MAKE) check -$(MAKE) checkmacro @@ -182,7 +196,7 @@ udscm4.opt: # if type gcc; then echo "--compiler-options=\"-fno-guess-branch-probability\"" >> udscm4.opt; fi udscm4: $(cfiles) $(hfiles) build.scm build udscm4.opt $(BUILD) -f udscm4.opt -o udscm4 -s $(IMPLPATH) - rm $(ofiles) scmmain.o + -rm $(ofiles) scmmain.o dscm4: udscm4 $(ifiles) require.scm if [ -f /proc/sys/kernel/randomize_va_space -a\ "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\ @@ -202,9 +216,10 @@ udscm5.opt: $(MAKE) udscm4.opt cat udscm4.opt >> udscm5.opt echo "-F macro" >> udscm5.opt -udscm5: $(cfiles) $(hfiles) build.scm build udscm5.opt +udscm5: $(cfiles) $(ufiles) $(hfiles) build.scm build udscm5.opt $(BUILD) -f udscm5.opt -o udscm5 -s $(IMPLPATH) - rm $(ofiles) scmmain.o + -rm $(ofiles) scmmain.o + strip udscm5 dscm5: udscm5 $(ifiles) require.scm if [ -f /proc/sys/kernel/randomize_va_space -a\ "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\ @@ -223,15 +238,15 @@ dscm5: udscm5 $(ifiles) require.scm # R5RS interpreter for debugging with GDB. gdb.opt: udscm5.opt - cat udscm5.opt >> gdb.opt + cat udscm5.opt > gdb.opt echo "-F debug" >> gdb.opt echo "--compiler-options=-Wall" >> gdb.opt echo "--linker-options=-Wall" >> gdb.opt echo "-D NO_ENV_CACHE" >> gdb.opt # echo "-DTEST_FARLOC -DTEST_SCM2PTR" >> gdb.opt -udgdbscm: gdb.opt +udgdbscm: gdb.opt $(cfiles) $(ufiles) $(hfiles) build.scm build $(BUILD) -f gdb.opt -o udgdbscm -s $(IMPLPATH) -gdbscm: udgdbscm +gdbscm: udgdbscm $(ifiles) require.scm echo "(quit)" | $(SETARCH) ./udgdbscm -no-init-file -r5 -o gdbscm # R4RS interpreter for profiling @@ -261,7 +276,7 @@ libtest: libscm.a libtest.c dlls.opt: echo "--compiler-options=-Wall" >> dlls.opt echo "--linker-options=-Wall" >> dlls.opt -mydlls: dlls.opt +mydlls: dlls.opt bytenumb.so $(BUILD) -t dll -f dlls.opt -c ramap.c $(BUILD) -t dll -f dlls.opt -c record.c $(BUILD) -t dll -f dlls.opt -c gsubr.c @@ -282,6 +297,8 @@ db.so: dlls.opt rwb-isam.scm wbtab.scm if [ -f ../wb/blink.c ]; then \ $(BUILD) -t dll -f dlls.opt -F wb; fi +bytenumb.so: bytenumb.c scm.h Makefile + $(BUILD) -t dll -f dlls.opt -F byte-number inexact bignums differ.so: differ.c $(BUILD) -t dll -f dlls.opt -F differ myturtle: dlls.opt @@ -294,13 +311,13 @@ x.so: x.c x.h xevent.h dlls.opt incdir=/usr/include/ x11.scm: inc2scm rm -f x11.scm - $(SCMLIT) -l inc2scm x11.scm x: $(incdir) X11/X.h X11/cursorfont.h X11/Xlib.h \ + $(SCMLIT) -l inc2scm x11.scm x: $(DESTDIR)$(incdir) X11/X.h X11/cursorfont.h X11/Xlib.h \ X11/Xutil.h keysymdef.scm: inc2scm rm -f keysymdef.scm - $(SCMLIT) -l inc2scm keysymdef.scm x: $(incdir) X11/keysym.h X11/keysymdef.h + $(SCMLIT) -l inc2scm keysymdef.scm x: $(DESTDIR)$(incdir) X11/keysym.h X11/keysymdef.h xevent.h xevent.scm xatoms.scm: xgen.scm Makefile - $(SCMLIT) -l xgen.scm $(incdir)X11/Xlib.h + $(SCMLIT) -l xgen.scm $(DESTDIR)$(incdir)X11/Xlib.h x.h: x.c xevent.h if [ -x "$(CPROTO)" ]; then $(CPROTO) x.c > x.h; fi @@ -308,9 +325,15 @@ x.h: x.c xevent.h checklit: $(SCMLIT) -fr4rstest.scm -e'(test-sc4)(test-delay)(gc)' \ -e '(or (null? errs) (quit 1))' +Checklit: + $(SCMLIT) --no-symbol-case-fold -fr4rstest.scm -e'(test-sc4)(test-delay)(gc)' \ + -e '(or (null? errs) (quit 1))' check: r4rstest.scm $(SCMEXE) -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \ -e '(or (null? errs) (quit 1))' +Check: r4rstest.scm + $(SCMEXE) --no-symbol-case-fold -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \ + -e '(or (null? errs) (quit 1))' checkmacro: syntest1.scm syntest2.scm r4rstest.scm $(SCMEXE) -rmacro -fsyntest1.scm -fsyntest2.scm \ -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)' -fsyntest1 \ @@ -357,12 +380,12 @@ implcat: $(SHOBJS) mkimpcat.scm htmldir=../public_html/ dvi: scm.dvi Xlibscm.dvi hobbit.dvi -scm.dvi: version.txi scm.texi platform.txi features.txi Makefile - texi2dvi -b -c $(srcdir)scm.texi +scm.dvi: version.txi scm.texi indexes.texi platform.txi features.txi Makefile + texi2dvi -b -c scm.texi Xlibscm.dvi: version.txi Xlibscm.texi Makefile - texi2dvi -b -c $(srcdir)Xlibscm.texi + texi2dvi -b -c Xlibscm.texi hobbit.dvi: version.txi hobbit.texi Makefile - texi2dvi -b -c $(srcdir)hobbit.texi + texi2dvi -b -c hobbit.texi xdvi: scm.dvi xdvi scm.dvi Xdvi: Xlibscm.dvi @@ -371,14 +394,14 @@ hobdvi: hobbit.dvi xdvi hobbit.dvi pdf: $(htmldir)scm.pdf $(htmldir)Xlibscm.pdf $(htmldir)hobbit.pdf -$(htmldir)scm.pdf: version.txi scm.texi platform.txi features.txi Makefile - texi2pdf -b -c $(srcdir)scm.texi +$(htmldir)scm.pdf: version.txi scm.texi indexes.texi platform.txi features.txi Makefile + texi2pdf -b -c scm.texi mv scm.pdf $(htmldir) $(htmldir)Xlibscm.pdf: version.txi Xlibscm.texi Makefile - texi2pdf -b -c $(srcdir)Xlibscm.texi + texi2pdf -b -c Xlibscm.texi mv Xlibscm.pdf $(htmldir) $(htmldir)hobbit.pdf: version.txi hobbit.texi Makefile - texi2pdf -b -c $(srcdir)hobbit.texi + texi2pdf -b -c hobbit.texi mv hobbit.pdf $(htmldir) xpdf: $(htmldir)scm.pdf xpdf $(htmldir)scm.pdf @@ -391,7 +414,7 @@ PREVDOCS = prevdocs/ html: $(htmldir)scm_toc.html $(htmldir)Xlibscm_toc.html $(htmldir)hobbit_toc.html TEXI2HTML = /usr/local/bin/texi2html -split -verbose -scm_toc.html: version.txi scm.texi platform.txi features.txi +scm_toc.html: version.txi scm.texi indexes.texi platform.txi features.txi ${TEXI2HTML} scm.texi Xlibscm_toc.html: version.txi Xlibscm.texi ${TEXI2HTML} Xlibscm.texi @@ -411,7 +434,7 @@ $(htmldir)hobbit_toc.html: hobbit_toc.html Makefile cp hobbit_*.html $(htmldir) $(PREVDOCS)scm_toc.html: -$(PREVDOCS)scm.info: srcdir.mk Makefile +$(PREVDOCS)scm.info: Makefile cd $(PREVDOCS); unzip -a $(dest)scm*.zip rm $(PREVDOCS)scm/scm.info cd $(PREVDOCS)scm; make scm.info; make scm_toc.html @@ -437,92 +460,116 @@ includedir = $(prefix)include/ README: build build.scm scm.info $(SCMEXE) -l build -e"(make-readme)" -info: installinfo -installinfo: $(infodir)scm.info $(infodir)Xlibscm.info $(infodir)hobbit.info - platform.txi: build.scm $(SCMLIT) -r database-browse -l build.scm -e "(browse build 'platform)" \ > platform.txi features.txi: build build.scm $(SCMLIT) -l build -e"(make-features-txi)" -scm.info: version.txi scm.texi platform.txi features.txi +scm.info: version.txi scm.texi indexes.texi platform.txi features.txi makeinfo scm.texi --no-split -o scm.info mv scm.info scm$(VERSION).info if [ -f $(PREVDOCS)scm.info ]; \ then infobar $(PREVDOCS)scm.info scm$(VERSION).info scm.info; \ else cp scm$(VERSION).info scm.info; fi -$(infodir)scm.info: scm.info - cp -p scm.info $(infodir)scm.info - -install-info $(infodir)scm.info $(infodir)dir - -rm $(infodir)scm.info.gz +$(DESTDIR)$(infodir)scm.info: scm.info + mkdir -p $(DESTDIR)$(infodir) + cp -p scm.info $(DESTDIR)$(infodir)scm.info + -install-info $(DESTDIR)$(infodir)scm.info $(DESTDIR)$(infodir)dir + -rm $(DESTDIR)$(infodir)scm.info.gz Xlibscm.info: version.txi Xlibscm.texi makeinfo Xlibscm.texi --no-split -o Xlibscm.info -$(infodir)Xlibscm.info: Xlibscm.info - cp Xlibscm.info $(infodir)Xlibscm.info - -install-info $(infodir)Xlibscm.info $(infodir)dir - -rm $(infodir)Xlibscm.info*.gz +$(DESTDIR)$(infodir)Xlibscm.info: Xlibscm.info + mkdir -p $(DESTDIR)$(infodir) + cp Xlibscm.info $(DESTDIR)$(infodir)Xlibscm.info + -install-info $(DESTDIR)$(infodir)Xlibscm.info $(DESTDIR)$(infodir)dir + -rm $(DESTDIR)$(infodir)Xlibscm.info*.gz hobbit.info: version.txi hobbit.texi makeinfo hobbit.texi --no-split -o hobbit.info -$(infodir)hobbit.info: hobbit.info - cp hobbit.info $(infodir)hobbit.info - -install-info $(infodir)hobbit.info $(infodir)dir - -rm $(infodir)hobbit.info*.gz +$(DESTDIR)$(infodir)hobbit.info: hobbit.info + mkdir -p $(DESTDIR)$(infodir) + cp hobbit.info $(DESTDIR)$(infodir)hobbit.info + -install-info $(DESTDIR)$(infodir)hobbit.info $(DESTDIR)$(infodir)dir + -rm $(DESTDIR)$(infodir)hobbit.info*.gz + +info: installinfo +installinfo: $(DESTDIR)$(infodir)scm.info $(DESTDIR)$(infodir)Xlibscm.info $(DESTDIR)$(infodir)hobbit.info infoz: installinfoz -installinfoz: $(infodir)scm.info.gz $(infodir)Xlibscm.info.gz $(infodir)hobbit.info.gz -$(infodir)scm.info.gz: $(infodir)scm.info - gzip -f $(infodir)scm.info -$(infodir)Xlibscm.info.gz: $(infodir)Xlibscm.info - gzip -f $(infodir)Xlibscm.info -$(infodir)hobbit.info.gz: $(infodir)hobbit.info - gzip -f $(infodir)hobbit.info - -install: scm.1 db.so wbtab.scm rwb-isam.scm - test -d $(bindir) || mkdir $(bindir) - test -d $(mandir) || mkdir $(mandir) - test -d $(man1dir) || mkdir $(man1dir) - -cp scm scmlit $(bindir) - -strip $(bindir)scmlit - -cp scm.1 $(man1dir) - test -d $(libdir) || mkdir $(libdir) - test -d $(libscmdir) || mkdir $(libscmdir) - -cp $(ifiles) $(hobfiles) COPYING r4rstest.scm $(libscmdir) - test -f $(libscmdir)require.scm || \ - cp requires.scm $(libscmdir)require.scm +installinfoz: $(DESTDIR)$(infodir)scm.info.gz $(DESTDIR)$(infodir)Xlibscm.info.gz $(DESTDIR)$(infodir)hobbit.info.gz +$(DESTDIR)$(infodir)scm.info.gz: $(DESTDIR)$(infodir)scm.info + gzip -f $(DESTDIR)$(infodir)scm.info +$(DESTDIR)$(infodir)Xlibscm.info.gz: $(DESTDIR)$(infodir)Xlibscm.info + gzip -f $(DESTDIR)$(infodir)Xlibscm.info +$(DESTDIR)$(infodir)hobbit.info.gz: $(DESTDIR)$(infodir)hobbit.info + gzip -f $(DESTDIR)$(infodir)hobbit.info + +install: scm.1 + test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir) + test -d $(DESTDIR)$(mandir) || mkdir $(DESTDIR)$(mandir) + test -d $(DESTDIR)$(man1dir) || mkdir $(DESTDIR)$(man1dir) + -cp scm scmlit $(DESTDIR)$(bindir) + -strip $(DESTDIR)$(bindir)scmlit + -cp scm.1 $(DESTDIR)$(man1dir) + test -d $(DESTDIR)$(libdir) || mkdir $(DESTDIR)$(libdir) + test -d $(DESTDIR)$(libscmdir) || mkdir $(DESTDIR)$(libscmdir) + -cp $(ifiles) $(hobfiles) COPYING r4rstest.scm $(DESTDIR)$(libscmdir) + test -f $(DESTDIR)$(libscmdir)require.scm || \ + cp requires.scm $(DESTDIR)$(libscmdir)require.scm -cp build build.scm mkimpcat.scm Iedline.scm $(SHOBJS) patchlvl.h\ - $(xafiles) $(libscmdir) - -cp db.so wbtab.scm rwb-isam.scm $(libscmdir) + $(xafiles) $(DESTDIR)$(libscmdir) + -cp db.so wbtab.scm rwb-isam.scm $(DESTDIR)$(libscmdir) + -cp libscm.dylib $(DESTDIR)$(libdir) installlib: - test -d $(includedir) || mkdir $(includedir) - cp scm.h scmfig.h scmflags.h $(includedir) - test -d $(libdir) || mkdir $(libdir) - cp libscm.a $(libdir)libscm.a + test -d $(DESTDIR)$(includedir) || mkdir $(DESTDIR)$(includedir) + cp scm.h scmfig.h scmflags.h $(DESTDIR)$(includedir) + test -d $(DESTDIR)$(libdir) || mkdir $(DESTDIR)$(libdir) + cp libscm.a $(DESTDIR)$(libdir)libscm.a uninstall: - -rm $(bindir)scm $(bindir)scmlit - -rm $(man1dir)scm.1 - -rm $(includedir)scm.h $(includedir)scmfig.h $(includedir)scmflags.h - -rm $(libdir)libscm.a - -(cd $(libscmdir); rm $(ifiles) $(hobfiles) COPYING r4rstest.scm) - -(cd $(libscmdir); rm build build.scm mkimpcat.scm \ + -rm $(DESTDIR)$(bindir)scm $(DESTDIR)$(bindir)scmlit + -rm $(DESTDIR)$(man1dir)scm.1 + -rm $(DESTDIR)$(includedir)scm.h $(DESTDIR)$(includedir)scmfig.h $(DESTDIR)$(includedir)scmflags.h + -rm $(DESTDIR)$(libdir)libscm.a + -(cd $(DESTDIR)$(libscmdir); rm $(ifiles) $(hobfiles) COPYING r4rstest.scm) + -(cd $(DESTDIR)$(libscmdir); rm build build.scm mkimpcat.scm \ $(SHOBJS) patchlvl.h $(xafiles)) - -(cd $(libscmdir); rm db.so wbtab.scm rwb-isam.scm require.scm) + -(cd $(DESTDIR)$(libscmdir); rm db.so wbtab.scm rwb-isam.scm require.scm) uninstallinfo: - -rm $(infodir)scm.info.gz $(infodir)Xlibscm.info.gz\ - $(infodir)hobbit.info.gz + -rm $(DESTDIR)$(infodir)scm.info.gz $(DESTDIR)$(infodir)Xlibscm.info.gz\ + $(DESTDIR)$(infodir)hobbit.info.gz scm.doc: scm.1 nroff -man $< | ul -tunknown >$@ -docs: $(infodir)scm.info.gz $(htmldir)scm_toc.html scm.doc \ +docs: $(DESTDIR)$(infodir)scm.info.gz $(htmldir)scm_toc.html scm.doc \ scm.dvi Xlibscm.dvi hobbit.dvi \ $(htmldir)scm.pdf $(htmldir)Xlibscm.pdf $(htmldir)hobbit.pdf xdvi -s 4 scm.dvi +winscm5.opt: + echo "-F arrays array-for-each byte i/o-extensions" >> winscm5.opt + echo "-F bignums inexact engineering-notation" >> winscm5.opt + echo "-F cautious rev2-procedures macro" >> winscm5.opt + echo "-F wb" >> winscm5.opt +gw32scmwb.sh: winscm5.opt build.scm Makefile version.txi scmlit + ./build -p gnu-win32 -f winscm5.opt -w gw32scmwb.sh +scm.exe: gw32scmwb.sh + ./gw32scmwb.sh + +hobbit.html: hobbit.texi + makeinfo --html --no-split --no-warn hobbit.texi +scm.html: scm.texi + makeinfo --html --no-split --no-warn --force scm.texi + +## to build a windows installer +## make sure makeinfo and NSIS are available on the commandline +w32install: scm.exe hobbit.html scm.html + makensis scm.nsi + #### Stuff for maintaining SCM below #### ver = $(VERSION) @@ -531,13 +578,6 @@ version.txi: patchlvl.h echo @set SCMDATE `date +"%B %Y"` >> version.txi RM_R = rm -rf -ufiles = pre-crt0.c ecrt0.c gmalloc.c unexec.c unexelf.c unexhp9k800.c \ - unexsunos4.c unexalpha.c unexsgi.c - -# cxux-crt0.s ecrt0.c gmalloc.c pre-crt0.c unexaix.c unexalpha.c \ -# unexapollo.c unexconvex.c unexec.c unexelf.c unexelf1.c \ -# unexencap.c unexenix.c unexfx2800.c unexhp9k800.c unexmips.c \ -# unexnext.c unexnt.c unexsgi.c unexsni.c unexsunos4.c confiles = scmconfig.h.in mkinstalldirs acconfig-1.5.h install-sh \ configure configure.in Makefile.in COPYING README.unix @@ -545,10 +585,10 @@ confiles = scmconfig.h.in mkinstalldirs acconfig-1.5.h install-sh \ tfiles = r4rstest.scm example.scm pi.scm pi.c split.scm bench.scm \ syntest2.scm syntest1.scm dfiles = ANNOUNCE README COPYING scm.1 scm.doc QUICKREF \ - scm.info scm.texi Xlibscm.info Xlibscm.texi hobbit.info hobbit.texi \ + scm.info scm.texi indexes.texi Xlibscm.info Xlibscm.texi hobbit.info hobbit.texi \ version.txi platform.txi features.txi ChangeLog mfiles = Makefile build.scm build build.bat requires.scm \ - .gdbinit mkimpcat.scm disarm.scm scm.spec + .gdbinit mkimpcat.scm disarm.scm scm.spec scm.nsi sfiles = setjump.mar setjump.s ugsetjump.s continue-ia64.S \ get-contoffset-ia64.c wbfiles = wbtab.scm rwb-isam.scm @@ -560,35 +600,21 @@ CHPAT=$(HOME)/bin/chpat RSYNC=rsync --rsync-path=bin/rsync -bav UPLOADEE=swissnet_upload dest = $(HOME)/dist/ -DOSCM = /misc/usb1/scm/ +DOSCM = /c/Voluntocracy/dist/ temp/scm: $(afiles) -$(RM_R) temp - mkdir temp - mkdir temp/scm + mkdir -p temp/scm ln $(afiles) temp/scm release: dist pdf # rpm cvs tag -F scm$(VERSION) - cp $(srcdir)ANNOUNCE $(htmldir)SCM_ANNOUNCE.txt + cp ANNOUNCE $(htmldir)SCM_ANNOUNCE.txt $(RSYNC) $(htmldir)SCM.html $(htmldir)SCM_ANNOUNCE.txt $(UPLOADEE):public_html/ $(RSYNC) $(dest)README $(dest)scm$(VERSION).zip \ $(dest)scm-$(VERSION)-$(RELEASE).src.rpm $(dest)scm-$(VERSION)-$(RELEASE).i386.rpm \ $(htmldir)hobbit.pdf $(htmldir)Xlibscm.pdf $(UPLOADEE):dist/ # upload $(dest)README $(dest)scm$(VERSION).zip ftp.gnu.org:gnu/jacal/ -# $(MAKE) indiana -indiana: - upload $(dest)scm$(VERSION).zip ftp@ftp.cs.indiana.edu:/pub/scheme-repository/incoming - echo -e \ - 'I have uploaded scm$(VERSION).zip to ftp.cs.indiana.edu:/pub/scheme-repository/incoming\n' \ - 'for placement into ftp.cs.indiana.edu:/pub/scheme-repository/imp/' \ - | mail -s 'SCM upload' -b jaffer scheme-repository-request@cs.indiana.edu - -postnews: - echo -e "Newsgroups: comp.lang.scheme\n" | cat - ANNOUNCE | \ - inews -h -O -S \ - -f "announce@voluntocracy.org (Aubrey Jaffer & Radey Shouman)" \ - -t "SCM$(VERSION) Released" -d world upzip: $(HOME)/pub/scm.zip $(RSYNC) $(HOME)/pub/scm.zip $(UPLOADEE):pub/ @@ -617,12 +643,13 @@ scm.com: temp/scm zip: scm.zip scm.zip: temp/scm $(makedev) PROD=scm zip -doszip: $(DOSCM)dist/scm$(VERSION).zip -$(DOSCM)dist/scm$(VERSION).zip: temp/scm turtle turtlegr.c grtest.scm - $(makedev) DEST=$(DOSCM)dist/ PROD=scm ver=$(VERSION) zip - cd ..; zip -9ur $(DOSCM)dist/scm$(VERSION).zip \ - scm/turtle scm/turtlegr.c scm/grtest.scm - zip -d $(DOSCM)dist/scm$(VERSION).zip scm/scm.info scm/Xlibscm.info scm/hobbit.info +doszip: $(DOSCM)scm$(VERSION).zip +$(DOSCM)scm$(VERSION).zip: temp/scm turtle turtlegr.c grtest.scm SCM.lnk scm.html hobbit.html + $(makedev) DEST=$(DOSCM) PROD=scm ver=$(VERSION) zip + -cd ..; zip -9ur $(DOSCM)scm$(VERSION).zip \ + scm/turtle scm/turtlegr.c scm/grtest.scm scm/SCM.lnk \ + scm/scm.html scm/hobbit.html + zip -d $(DOSCM)scm$(VERSION).zip scm/scm.info scm/Xlibscm.info scm/hobbit.info pubzip: $(HOME)/pub/scm.zip $(HOME)/pub/scm.zip: temp/scm $(makedev) DEST=$(HOME)/pub/ PROD=scm zip @@ -639,13 +666,13 @@ CITERS = ANNOUNCE ../jacal/ANNOUNCE \ $(htmldir)SLIB.html $(htmldir)JACAL.html \ $(htmldir)SCM.html $(htmldir)SIMSYNCH.html \ ../jacal/jacal.texi ../wb/wb.texi \ - $(DOSCM)dist/install.bat $(DOSCM)dist/makefile \ - $(DOSCM)dist/mkdisk.bat hobbit.texi hobbit.scm + $(DOSCM)install.bat $(DOSCM)makefile \ + $(DOSCM)mkdisk.bat hobbit.texi hobbit.scm updates: Init$(ver).scm $(CHPAT) scm$(VERSION) scm$(ver) $(CITERS) $(CHPAT) scm-$(VERSION) scm-$(ver) $(CITERS) - $(CHPAT) $(VERSION) $(ver) ../wb/wb.spec $(htmldir)SCM.html scm.spec + $(CHPAT) $(VERSION) $(ver) ../wb/wb.spec $(htmldir)SCM.html scm.spec scm.nsi Init$(ver).scm: mv -f Init$(VERSION).scm Init$(ver).scm @@ -667,8 +694,7 @@ new: updates configtemp/scm: $(confiles) -$(RM_R) configtemp/scm - -mkdir configtemp - mkdir configtemp/scm + -mkdir -p configtemp/scm ln $(confiles) configtemp/scm confdist: scmconfig.tar.gz scmconfig.tar.gz: configtemp/scm @@ -709,7 +735,7 @@ ctags: $(ctagfiles) etags $(ctagfiles) TAGFILES = $(hfiles) $(cfiles) $(ifiles) $(sfiles)\ - version.txi scm.texi Xlibscm.texi hobbit.texi build $(xfiles) $(mfiles)\ + version.txi scm.texi indexes.texi Xlibscm.texi hobbit.texi build $(xfiles) $(mfiles)\ hobbit.scm # # $(ufiles) ChangeLog TAGS: $(TAGFILES) @@ -723,7 +749,7 @@ clean: distclean: clean -rm -f $(EXECFILES) *.o *.obj a.out TAGS implcat slibcat gdbscm realclean: distclean - -rm -f scm.doc + -rm -f scm.doc scm.html hobbit.html scm.exe scmlit.exe scm~ SCM-*.exe realempty: temp/scm -rm -f $(afiles) myclean: clean @@ -1,4 +1,4 @@ -This directory contains the distribution of scm5e3. Scm conforms to +This directory contains the distribution of scm5e4. Scm conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification. SCM runs under Amiga, Atari-ST, MacOS, MS-DOS, OS/2, NOS/VE, Unicos, VMS, Unix and similar systems. @@ -26,6 +26,7 @@ NOS/VE, Unicos, VMS, Unix and similar systems. `build.bat' invokes build.scm for MS-DOS `build.scm' database for compiling and linking new SCM programs. `byte.c' strings as bytes. +`bytenumb.c' Byte-number conversions. `compile.scm' Hobbit compilation to C. `continue-ia64.S'replaces make_root_continuation(), make_continuation(), and dynthrow() in continue.c @@ -107,18 +108,16 @@ SLIB is not _neccessary_ to run SCM, I strongly suggest you obtain and install it. Bug reports about running SCM without SLIB have very low priority. SLIB is available from the same sites as SCM: - * swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz + * swiss.csail.mit.edu:/pub/scm/slib3a5.tar.gz - * ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz + * ftp.gnu.org:/pub/gnu/jacal/slib3a5.tar.gz - * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz - -Unpack SLIB (`tar xzf slib3a4.tar.gz' or `unzip -ao slib3a4.zip') in an +Unpack SLIB (`tar xzf slib3a5.tar.gz' or `unzip -ao slib3a5.zip') in an appropriate directory for your system; both `tar' and `unzip' will create the directory `slib'. Then create a file `require.scm' in the SCM "implementation-vicinity" -(this is the same directory as where the file `Init5e3.scm' is +(this is the same directory as where the file `Init5e4.scm' is installed). `require.scm' should have the contents: (define (library-vicinity) "/usr/local/lib/slib/") @@ -149,7 +148,7 @@ File: scm.info, Node: Making SCM, Next: SLIB, Prev: Installing SCM, Up: Inst The SCM distribution has "Makefile" which contains rules for making "scmlit", a "bare-bones" version of SCM sufficient for running `build'. `build' is used to compile (or create scripts to compile) full -featured versions. +featured versions (*note Building SCM::). Makefiles are not portable to the majority of platforms. If `Makefile' works for you, good; If not, I don't want to hear about it. If you @@ -283,17 +282,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files. recompile scm. add <FLAG> in scmfig.h and recompile scm. -ERROR: Init5e3.scm not found. Assign correct IMPLINIT in makefile +ERROR: Init5e4.scm not found. Assign correct IMPLINIT in makefile or scmfig.h. Define environment variable SCM_INIT_PATH to be the full - pathname of Init5e3.scm. + pathname of Init5e4.scm. WARNING: require.scm not found. Define environment variable SCHEME_LIBRARY_PATH to be the full pathname of the scheme library [SLIB]. Change library-vicinity in - Init5e3.scm to point to library or + Init5e4.scm to point to library or remove. Make sure the value of (library-vicinity) has a trailing @@ -354,7 +353,7 @@ Some symbol names print incorrectly. Change memory model option to C than HEAP_SEG_SIZE). ERROR: Rogue pointer in Heap. See above under machine crashes. Newlines don't appear correctly in Check file mode (define OPEN_... in -output files. `Init5e3.scm'). +output files. `Init5e4.scm'). Spaces or control characters appear Check character defines in in symbol names. `scmfig.h'. Negative numbers turn positive. Check SRS in `scmfig.h'. diff --git a/Transcen.scm b/Transcen.scm index fe0330d..ad42140 100644 --- a/Transcen.scm +++ b/Transcen.scm @@ -209,3 +209,6 @@ (define (infinite? z) (and (= z (* 2 z)) (not (zero? z)))) (define (finite? z) (not (infinite? z))) + +(provide 'math-real) +(provide 'srfi-94) diff --git a/Xlibscm.html b/Xlibscm.html deleted file mode 100644 index 9dc41bb..0000000 --- a/Xlibscm.html +++ /dev/null @@ -1,3399 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> -<html> -<!-- -This manual documents the X Interface for SCM Language (version -5e3, October 2006). - - -Copyright C 1999 Free Software Foundation, Inc. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the author. - ---> -<!-- Created on July, 17 2007 by texi2html 1.76 --> -<!-- -Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) - Karl Berry <karl@freefriends.org> - Olaf Bachmann <obachman@mathematik.uni-kl.de> - and many others. -Maintained by: Many creative people <dev@texi2html.cvshome.org> -Send bugs and suggestions to <users@texi2html.cvshome.org> - ---> -<head> -<title>XlibScm: XlibScm</title> - -<meta name="description" content="XlibScm: XlibScm"> -<meta name="keywords" content="XlibScm: XlibScm"> -<meta name="resource-type" content="document"> -<meta name="distribution" content="global"> -<meta name="Generator" content="texi2html 1.76"> -<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> -<style type="text/css"> -<!-- -a.summary-letter {text-decoration: none} -pre.display {font-family: serif} -pre.format {font-family: serif} -pre.menu-comment {font-family: serif} -pre.menu-preformatted {font-family: serif} -pre.smalldisplay {font-family: serif; font-size: smaller} -pre.smallexample {font-size: smaller} -pre.smallformat {font-family: serif; font-size: smaller} -pre.smalllisp {font-size: smaller} -span.sansserif {font-family:sans-serif; font-weight:normal;} -ul.toc {list-style: none} ---> -</style> - - -</head> - -<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> - -<a name="Top"></a> -<a name="SEC_Top"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="settitle">XlibScm</h1> - - -<p>This manual documents the X Interface for SCM Language (version -5e3, October 2006). -</p> - -<p>Copyright © 1999 Free Software Foundation, Inc. -</p> -<blockquote><p>Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -</p> -<p>Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. -</p> -<p>Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the author. -</p></blockquote> - -<table class="menu" border="0" cellspacing="0"> -<tr><td align="left" valign="top"><a href="#SEC1">1. XlibScm</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC2">2. Display and Screens</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC3">3. Drawables</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC7">4. Graphics Context</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC9">5. Cursor</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC10">6. Colormap</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC11">7. Rendering</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC14">8. Images</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC15">9. Event</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC16">Indexes</a></td><td> </td><td align="left" valign="top"> -</td></tr> -</table> - -<hr size="1"> -<a name="XlibScm"></a> -<a name="SEC1"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC2" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[ << ]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC2" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 1. XlibScm </h1> - -<p><em>XlibScm</em> is a SCM interface to <em>X</em>. -<a name="IDX1"></a> -The -<A HREF="http://www.x.org/"> -X Window System -</A> -is a network-transparent window system that was -designed at MIT. -<A HREF="scm_toc.html"> -SCM -</A> -is a portable Scheme implementation written in C. -The interface can be compiled into SCM or, on those platforms supporting -dynamic linking, compiled separately and loaded with <code>(require -'Xlib)</code>. -<a name="IDX2"></a> -</p> - -<p>Much of this X documentation is dervied from: -</p> -<p align="center"> Xlib - C Language X Interface -</p><p align="center"> X Consortium Standard -</p><p align="center"> X Version 11, Release 6.3 -</p> -<p>The X Window System is a trademark of X Consortium, Inc. -</p> -<p>TekHVC is a trademark of Tektronix, Inc. -</p> - - -<p>Copyright (C) 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X -Consortium -</p> -<p>Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: -</p> -<p>The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. -</p> -<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. -</p> -<p>Except as contained in this notice, the name of the X Consortium shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization from -the X Consortium. -</p> - - - -<p>Copyright (C) 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -Digital Equipment Corporation -</p> -<p>Portions Copyright (C) 1990, 1991 by Tektronix, Inc. -</p> -<p>Permission to use, copy, modify and distribute this documentation for -any purpose and without fee is hereby granted, provided that the above -copyright notice appears in all copies and that both that copyright -notice and this permission notice appear in all copies, and that the -names of Digital and Tektronix not be used in in advertising or -publicity pertaining to this documentation without specific, written -prior permission. Digital and Tektronix makes no representations about -the suitability of this documentation for any purpose. It is provided -"as is" without express or implied warranty. -</p> - -<hr size="6"> -<a name="Display-and-Screens"></a> -<a name="SEC2"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC1" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC3" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC1" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC3" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 2. Display and Screens </h1> - -<dl> -<dt><u>Function:</u> <b>x:open-display</b><i> display-name</i> -<a name="IDX3"></a> -</dt> -<dd><p><var>display-name</var> Specifies the hardware display name, which determines -the display and communications domain to be used. On a POSIX-conformant -system, if the display-name is #f, it defaults to the value of the -<var>DISPLAY</var> environment variable. -</p> -<p>The encoding and interpretation of <var>display-name</var> is -implementation-dependent. On POSIX-conformant systems, the -<var>display-name</var> or <var>DISPLAY</var> environment variable can be a string -in the format: -</p> -<dl> -<dt><u>Special Form:</u> <b>hostname:number.screen-number</b> -<a name="IDX4"></a> -</dt> -<dd><p><var>hostname</var> specifies the name of the host machine on which the -display is physically attached. Follow the <var>hostname</var> with either a -single colon (:) or a double colon (::). -</p> -<p><var>number</var> specifies the number of the display server on that host -machine. You may optionally follow this display number with a period -(.). A single CPU can have more than one display. Multiple displays -are usually numbered starting with zero. -</p> -<p><var>screen-number</var> specifies the screen to be used on that server. -Multiple screens can be controlled by a single X server. The -<var>screen-number</var> sets an internal variable that can be accessed by -using the x:default-screen procedure. -</p></dd></dl> -</dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:close</b><i> display</i> -<a name="IDX5"></a> -</dt> -<dd><p><var>display</var> specifies the connection to the X server. -</p> -<p>The <code>x:close</code> function closes the connection to the X server for -the <var>display</var> specified and destroys all windows, resource IDs -(Window, Font, Pixmap, Colormap, Cursor, and GContext), or other -resources that the client has created on this display, unless the -close-down mode of the resource has been changed (see -<code>x:set-close-down-mode</code>). Therefore, these windows, resource IDs, -and other resources should not be used again or an error will be -generated. Before exiting, you should call <var>x:close-display</var> or -<var>x:flush</var> explicitly so that any pending errors are reported. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:protocol-version</b><i> display</i> -<a name="IDX6"></a> -</dt> -<dd><p>Returns cons of the major version number (11) of the X protocol -associated with the connected <var>display</var> and the minor protocol -revision number of the X server. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:server-vendor</b><i> display</i> -<a name="IDX7"></a> -</dt> -<dd><p>Returns a string that provides some identification of the owner of the X -server implementation. The contents of the string are -implementation-dependent. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:vendor-release</b><i> display</i> -<a name="IDX8"></a> -</dt> -<dd><p>Returns a number related to a vendor's release of the X server. -</p></dd></dl> - - -<p>A display consists of one or more <em>Screen</em>s. Each screen has a -<em>root-window</em>, <em>default-graphics-context</em>, and <em>colormap</em>. -</p> -<dl> -<dt><u>Function:</u> <b>x:screen-count</b><i> display</i> -<a name="IDX9"></a> -</dt> -<dd><p>Returns the number of available screens. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:default-screen</b><i> display</i> -<a name="IDX10"></a> -</dt> -<dd><p>Returns the default screen number specified by the <code>x:open-display</code> -function. Use this screen number in applications which will use only a -single screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:root-window</b><i> display screen-number</i> -<a name="IDX11"></a> -</dt> -<dt><u>Function:</u> <b>x:root-window</b><i> display</i> -<a name="IDX12"></a> -</dt> -<dd><p><var>screen-number</var>, if givien, specifies the appropriate screen number -on the host server. Otherwise the default-screen for <var>display</var> is -used. -</p> -<p>Returns the root window for the specified <var>screen-number</var>. Use -<code>x:root-window</code> for functions that need a drawable of a particular -screen or for creating top-level windows. -</p> -<dl> -<dt><u>Function:</u> <b>x:root-window</b><i> window</i> -<a name="IDX13"></a> -</dt> -<dd><p>Returns the root window for the specified <var>window</var>'s screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:default-colormap</b><i> display screen-number</i> -<a name="IDX14"></a> -</dt> -<dt><u>Function:</u> <b>x:default-colormap</b><i> display</i> -<a name="IDX15"></a> -</dt> -<dt><u>Function:</u> <b>x:default-colormap</b><i> window</i> -<a name="IDX16"></a> -</dt> -<dd><p>Returns the default colormap of the specified screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:default-ccc</b><i> display screen-number</i> -<a name="IDX17"></a> -</dt> -<dt><u>Function:</u> <b>x:default-ccc</b><i> display</i> -<a name="IDX18"></a> -</dt> -<dt><u>Function:</u> <b>x:default-ccc</b><i> window</i> -<a name="IDX19"></a> -</dt> -<dd><p>Returns the default Color-Conversion-Context (ccc) of the specified -screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:default-gc</b><i> display screen-number</i> -<a name="IDX20"></a> -</dt> -<dt><u>Function:</u> <b>x:default-gc</b><i> display</i> -<a name="IDX21"></a> -</dt> -<dt><u>Function:</u> <b>x:default-gc</b><i> window</i> -<a name="IDX22"></a> -</dt> -<dd><p>Returns the default graphics-context of the specified screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-depths</b><i> display screen-number</i> -<a name="IDX23"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-depths</b><i> display</i> -<a name="IDX24"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-depths</b><i> window</i> -<a name="IDX25"></a> -</dt> -<dd><p>Returns an array of depths supported by the specified screen. -</p></dd></dl> - -<p>The <em>Visual</em> type describes possible colormap depths and -arrangements. -</p> -<dl> -<dt><u>Function:</u> <b>x:default-visual</b><i> display screen-number</i> -<a name="IDX26"></a> -</dt> -<dt><u>Function:</u> <b>x:default-visual</b><i> display</i> -<a name="IDX27"></a> -</dt> -<dt><u>Function:</u> <b>x:default-visual</b><i> window</i> -<a name="IDX28"></a> -</dt> -<dd><p>Returns the default Visual type for the specified screen. -</p> -<a name="IDX29"></a> -<a name="IDX30"></a> -</dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:make-visual</b><i> display depth class</i> -<a name="IDX31"></a> -</dt> -<dt><u>Function:</u> <b>x:make-visual</b><i> window depth class</i> -<a name="IDX32"></a> -</dt> -<dd><p>The integer <var>depth</var> specifies the number of bits per pixel. -The <var>class</var> argument specifies one of the possible -visual classes for a screen: -</p><ul> -<li> x:Static-Gray -</li><li> x:Static-Color -</li><li> x:True-Color -</li><li> x:Gray-Scale -</li><li> x:Pseudo-Color -</li><li> x:Direct-Color -</li></ul> - -<p><code>X:make-visual</code> returns a visual type for the screen specified by -<var>display</var> or <var>window</var> if successful; #f if not. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:visual-class</b><i> visual</i> -<a name="IDX33"></a> -</dt> -<dt><u>Function:</u> <b>x:visual-class</b><i> screen</i> -<a name="IDX34"></a> -</dt> -<dt><u>Function:</u> <b>x:visual-class</b><i> display</i> -<a name="IDX35"></a> -</dt> -<dd><p>Returns the (integer) visual class of its argument. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:visual-geometry</b><i> visual</i> -<a name="IDX36"></a> -</dt> -<dt><u>Function:</u> <b>x:visual-geometry</b><i> screen</i> -<a name="IDX37"></a> -</dt> -<dt><u>Function:</u> <b>x:visual-geometry</b><i> display</i> -<a name="IDX38"></a> -</dt> -<dd><p>Returns a list of the: -</p><ul> -<li> red_mask -</li><li> green_mask -</li><li> blue_mask -</li><li> colormap_size -</li></ul> -</dd></dl> - - -<dl> -<dt><u>Function:</u> <b>x:screen-cells</b><i> display screen-number</i> -<a name="IDX39"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-cells</b><i> display</i> -<a name="IDX40"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-cells</b><i> window</i> -<a name="IDX41"></a> -</dt> -<dd><p>Returns the number of entries in the default colormap. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-depth</b><i> display screen-number</i> -<a name="IDX42"></a> -</dt> -<dd><p>Returns the depth of the root window of the specified screen. -</p><dl> -<dt><u>Function:</u> <b>x:screen-depth</b><i> display</i> -<a name="IDX43"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-depth</b><i> window</i> -<a name="IDX44"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-depth</b><i> visual</i> -<a name="IDX45"></a> -</dt> -<dd><p>Returns the depth of argument. -</p> -<a name="IDX46"></a> -<p>The <em>depth</em> of a window or pixmap is the number of bits per pixel it has. -The <em>depth</em> of a graphics context is the depth of the drawables it can be -used in conjunction with graphics output. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-size</b><i> display screen-number</i> -<a name="IDX47"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-size</b><i> display</i> -<a name="IDX48"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-size</b><i> window</i> -<a name="IDX49"></a> -</dt> -<dd><p>Returns a list of integer height and width of the screen in pixels. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-dimensions</b><i> display screen-number</i> -<a name="IDX50"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-dimensions</b><i> display</i> -<a name="IDX51"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-dimensions</b><i> window</i> -<a name="IDX52"></a> -</dt> -<dd><p>Returns a list of integer height and width of the screen in millimeters. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-white</b><i> display screen-number</i> -<a name="IDX53"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-white</b><i> display</i> -<a name="IDX54"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-white</b><i> window</i> -<a name="IDX55"></a> -</dt> -<dd><p>Returns the white pixel value of the specified screen. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:screen-black</b><i> display screen-number</i> -<a name="IDX56"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-black</b><i> display</i> -<a name="IDX57"></a> -</dt> -<dt><u>Function:</u> <b>x:screen-black</b><i> window</i> -<a name="IDX58"></a> -</dt> -<dd><p>Returns the black pixel value of the specified screen. -</p></dd></dl> - -</dd></dl> -</dd></dl> -<hr size="6"> -<a name="Drawables"></a> -<a name="SEC3"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC2" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC4" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC2" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 3. Drawables </h1> - -<p>A <em>Drawable</em> is either a window or pixmap. -</p> -<table class="menu" border="0" cellspacing="0"> -<tr><td align="left" valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC5">3.2 Window Attributes</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td><td> </td><td align="left" valign="top"> -</td></tr> -</table> - - -<hr size="6"> -<a name="Windows-and-Pixmaps"></a> -<a name="SEC4"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC3" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC5" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="section"> 3.1 Windows and Pixmaps </h2> - -<dl> -<dt><u>Function:</u> <b>x:create-window</b><i> window position size border-width depth class visual field-name value …</i> -<a name="IDX59"></a> -</dt> -<dd><p>Creates and returns an unmapped Input-Output subwindow for a specified -parent <var>window</var> and causes the X server to generate a CreateNotify -event. The created window is placed on top in the stacking order with -respect to siblings. Any part of the window that extends outside its -parent <var>window</var> is clipped. The <var>border-width</var> for an -x:Input-Only window must be zero. -</p> -<p>The coordinate system has the X axis horizontal and the Y axis vertical -with the origin [0, 0] at the upper-left corner. Coordinates are -integral, in terms of pixels, and coincide with pixel centers. Each -window and pixmap has its own coordinate system. For a window, the -origin is inside the border at the inside, upper-left corner. -</p> -<p><var>Class</var> can be x:Input-Output, x:Input-Only, or x:Copy-From-Parent. -For class x:Input-Output, the <var>visual</var> type and <var>depth</var> must be -a combination supported for the screen. The <var>depth</var> need not be the -same as the parent, but the parent must not be a window of class -x:Input-Only. For an x:Input-Only window, the <var>depth</var> must be zero, -and the <var>visual</var> must be one supported by the screen. -</p> -<p>The returned window will have the attributes specified by -<var>field-name</var>s and <var>value</var>. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-window</b><i> window position size border-width border background</i> -<a name="IDX60"></a> -</dt> -<dd><p>The returned window inherits its depth, class, and visual from its -parent. All other window attributes, except <var>background</var> and -<var>border</var>, have their default values. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:create-pixmap</b><i> drawable size depth</i> -<a name="IDX61"></a> -</dt> -<dt><u>Function:</u> <b>x:create-pixmap</b><i> display size depth</i> -<a name="IDX62"></a> -</dt> -<dd><p><var>size</var> is a list, vector, or pair of nonzero integers specifying the width -and height desired in the new pixmap. -</p> -<p><var>x:create-pixmap</var> returns a new pixmap of the width, height, and -<var>depth</var> specified. It is valid to pass an x:Input-Only window to the -drawable argument. The <var>depth</var> argument must be one of the depths -supported by the screen of the specified <var>drawable</var>. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:close</b><i> window</i> -<a name="IDX63"></a> -</dt> -<dd><p>Destroys the specified <var>window</var> as well as all of its subwindows and -causes the X server to generate a DestroyNotify event for each window. -The window should not be used again. If the window specified by the -<var>window</var> argument is mapped, it is unmapped automatically. The -ordering of the DestroyNotify events is such that for any given window -being destroyed, DestroyNotify is generated on any inferiors of the -window before being generated on the window itself. The ordering among -siblings and across subhierarchies is not otherwise constrained. If the -<var>window</var> you specified is a root window, an error is signaled. -Destroying a mapped <var>window</var> will generate x:Expose events on other -windows that were obscured by the window being destroyed. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:close</b><i> pixmap</i> -<a name="IDX64"></a> -</dt> -<dd><p>Deletes the association between the <var>pixmap</var> and its storage. The X -server frees the pixmap storage when there are no references to it. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:window-geometry</b><i> drawable</i> -<a name="IDX65"></a> -</dt> -<dd><p>Returns a list of: -</p> -<dl compact="compact"> -<dt> coordinates</dt> -<dd><p><code>list</code> of x and y coordinates that define the location of the -<var>drawable</var>. For a window, these coordinates specify the upper-left -outer corner relative to its parent's origin. For pixmaps, these -coordinates are always zero. -</p></dd> -<dt> size</dt> -<dd><p><code>list</code> of the <var>drawable</var>'s dimensions (width and height). For -a window, these dimensions specify the inside size, not including the -border. -</p></dd> -<dt> border-width</dt> -<dd><p>The border width in pixels. If the <var>drawable</var> is a pixmap, this is -zero. -</p></dd> -<dt> depth</dt> -<dd><p>The depth of the <var>drawable</var> (bits per pixel for the object). -</p></dd> -</dl> -</dd></dl> - - -<dl> -<dt><u>Function:</u> <b>x:window-geometry-set!</b><i> window field-name value …</i> -<a name="IDX66"></a> -</dt> -<dd><p>Changes the <em>Configuration</em> components specified by -<var>field-name</var>s for the specified <var>window</var>. -</p></dd></dl> - - -<p>These are the attributes settable by <code>x:window-geometry-set!</code>. -That these attributes are encoded by small integers - just like those -of the next section. Be warned therefore that confusion of attribute -names will likely not signal errors, just cause mysterious behavior. -</p> -<dl> -<dt><u>Attribute:</u> <b>x:CWX</b> -<a name="IDX67"></a> -</dt> -<dt><u>Attribute:</u> <b>x:CWY</b> -<a name="IDX68"></a> -</dt> -<dt><u>Attribute:</u> <b>x:CW-Width</b> -<a name="IDX69"></a> -</dt> -<dt><u>Attribute:</u> <b>x:CW-Height</b> -<a name="IDX70"></a> -</dt> -<dd><p>The x:CWX and x:CYY members are used to set the window's x and y -coordinates, which are relative to the parent's origin and indicate the -position of the upper-left outer corner of the window. The x:CW-Width -and x:CW-Height members are used to set the inside size of the window, -not including the border, and must be nonzero. Attempts to configure a -root window have no effect. -</p> -<p>If a window's size actually changes, the window's subwindows move -according to their window gravity. Depending on the window's bit -gravity, the contents of the window also may be moved -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Border-Width</b> -<a name="IDX71"></a> -</dt> -<dd><p>The integer x:CW-Border-Width is used to set the width of the border in -pixels. Note that setting just the border width leaves the outer-left -corner of the window in a fixed position but moves the absolute position -of the window's origin. It is an error to set the border-width -attribute of an InputOnly window nonzero. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Sibling</b> -<a name="IDX72"></a> -</dt> -<dd><p>The sibling member is used to set the sibling window for stacking -operations. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Stack-Mode</b> -<a name="IDX73"></a> -</dt> -<dd><p>The x:CW-Stack-Mode member is used to set how the window is to be -restacked and can be set to x:Above, x:Below, x:Top-If, x:Bottom-If, or -x:Opposite. -</p></dd></dl> - - -<p>If a sibling and a stack-mode are specified, the window is restacked as -follows: -</p> -<dl compact="compact"> -<dt> <code>x:Above</code></dt> -<dd><p>The window is placed just above the sibling. -</p></dd> -<dt> <code>x:Below</code></dt> -<dd><p>The window is placed just below the sibling. -</p></dd> -<dt> <code>x:Top-If</code></dt> -<dd><p>If the sibling occludes the window, the window is placed at the top of -the stack. -</p></dd> -<dt> <code>x:Bottom-If</code></dt> -<dd><p>If the window occludes the sibling, the window is placed at the bottom -of the stack. -</p></dd> -<dt> <code>x:Opposite</code></dt> -<dd><p>If the sibling occludes the window, the window is placed at the top of -the stack. If the window occludes the sibling, the window is placed at -the bottom of the stack. -</p></dd> -</dl> - - -<p>If a stack-mode is specified but no sibling is specified, the window -is restacked as follows: -</p> -<dl compact="compact"> -<dt> <code>x:Above</code></dt> -<dd><p>The window is placed at the top of the stack. -</p></dd> -<dt> <code>x:Below</code></dt> -<dd><p>The window is placed at the bottom of the stack. -</p></dd> -<dt> <code>x:Top-If</code></dt> -<dd><p>If any sibling occludes the window, the window is placed at the top of -the stack. -</p></dd> -<dt> <code>x:Bottom-If</code></dt> -<dd><p>If the window occludes any sibling, the window is placed at the bottom -of the stack. -</p></dd> -<dt> <code>x:Opposite</code></dt> -<dd><p>If any sibling occludes the window, the window is placed at the top of -the stack. If the window occludes any sibling, the window is placed at -the bottom of the stack. -</p></dd> -</dl> - - - - -</dd></dl> -<hr size="6"> -<a name="Window-Attributes"></a> -<a name="SEC5"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC4" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC6" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="section"> 3.2 Window Attributes </h2> - -<dl> -<dt><u>Function:</u> <b>x:window-set!</b><i> window field-name value …</i> -<a name="IDX74"></a> -</dt> -<dd><p>Changes the components specified by <var>field-name</var>s for the specified -<var>window</var>. The restrictions are the same as for -<code>x:create-window</code>. The order in which components are verified and -altered is server dependent. If an error occurs, a subset of the -components may have been altered. -</p></dd></dl> - - -<p>The <code>x:create-window</code> and <code>x:window-set!</code> procedures take five -and one argument (respectively) followed by pairs of arguments, where -the first is one of the property-name symbols (or its top-level value) -listed below; and the second is the value to associate with that -property. -</p> -<dl> -<dt><u>Attribute:</u> <b>x:CW-Back-Pixmap</b> -<a name="IDX75"></a> -</dt> -<dd><p>Sets the background pixmap of the <var>window</var> to the specified pixmap. -The background pixmap can immediately be freed if no further explicit -references to it are to be made. If x:Parent-Relative is specified, the -background pixmap of the window's parent is used, or on the root window, -the default background is restored. It is an error to perform this -operation on an x:Input-Only window. If the background is set to #f or -None, the window has no defined background. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Back-Pixel</b> -<a name="IDX76"></a> -</dt> -<dd><p>Sets the background of the <var>window</var> to the specified pixel value. -Changing the background does not cause the <var>window</var> contents to be -changed. It is an error to perform this operation on an x:Input-Only -window. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Border-Pixmap</b> -<a name="IDX77"></a> -</dt> -<dd><p>Sets the border pixmap of the <var>window</var> to the pixmap you specify. -The border pixmap can be freed if no further explicit references to it -are to be made. If you specify x:Copy-From-Parent, a copy of the parent -window's border pixmap is used. It is an error to perform this -operation on an x:Input-Only <var>window</var>. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Border-Pixel</b> -<a name="IDX78"></a> -</dt> -<dd><p>Sets the border of the <var>window</var> to the pixel <var>value</var>. It is an -error to perform this operation on an x:Input-Only window. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Bit-Gravity</b> -<a name="IDX79"></a> -</dt> -<dt><u>Attribute:</u> <b>x:CW-Win-Gravity</b> -<a name="IDX80"></a> -</dt> -<dd><p>The bit gravity of a window defines which region of the window should be -retained when an x:Input-Output window is resized. The default value -for the bit-gravity attribute is x:Forget-Gravity. The window gravity -of a window allows you to define how the x:Input-Output or x:Input-Only -window should be repositioned if its parent is resized. The default -value for the win-gravity attribute is x:North-West-Gravity. -</p> -<p>If the inside width or height of a window is not changed and if the -window is moved or its border is changed, then the contents of the -window are not lost but move with the window. Changing the inside width -or height of the window causes its contents to be moved or lost -(depending on the bit-gravity of the window) and causes children to be -reconfigured (depending on their win-gravity). For a change of width -and height, the (x, y) pairs are defined: -</p> -<table> -<tr><td><p> Gravity Direction -</p></td><td><p> Coordinates -</p></td></tr> -<tr><td><p> x:North-West-Gravity -</p></td><td><p> (0, 0) -</p></td></tr> -<tr><td><p> x:North-Gravity -</p></td><td><p> (Width/2, 0) -</p></td></tr> -<tr><td><p> x:North-East-Gravity -</p></td><td><p> (Width, 0) -</p></td></tr> -<tr><td><p> x:West-Gravity -</p></td><td><p> (0, Height/2) -</p></td></tr> -<tr><td><p> x:Center-Gravity -</p></td><td><p> (Width/2, Height/2) -</p></td></tr> -<tr><td><p> x:East-Gravity -</p></td><td><p> (Width, Height/2) -</p></td></tr> -<tr><td><p> x:South-West-Gravity -</p></td><td><p> (0, Height) -</p></td></tr> -<tr><td><p> x:South-Gravity -</p></td><td><p> (Width/2, Height) -</p></td></tr> -<tr><td><p> x:South-East-Gravity -</p></td><td><p> (Width, Height) -</p></td></tr> -</table> - -<p>When a window with one of these bit-gravity values is resized, the -corresponding pair defines the change in position of each pixel in the -window. When a window with one of these win-gravities has its parent -window resized, the corresponding pair defines the change in position of -the window within the parent. When a window is so repositioned, a -x:Gravity-Notify event is generated (see section 10.10.5). -</p> -<p>A bit-gravity of x:Static-Gravity indicates that the contents or origin -should not move relative to the origin of the root window. If the -change in size of the window is coupled with a change in position (x, -y), then for bit-gravity the change in position of each pixel is (-x, --y), and for win-gravity the change in position of a child when its -parent is so resized is (-x, -y). Note that x:Static-Gravity still only -takes effect when the width or height of the window is changed, not when -the window is moved. -</p> -<p>A bit-gravity of x:Forget-Gravity indicates that the window's contents -are always discarded after a size change, even if a backing store or -save under has been requested. The window is tiled with its background -and zero or more x:Expose events are generated. If no background is -defined, the existing screen contents are not altered. Some X servers -may also ignore the specified bit-gravity and always generate x:Expose -events. -</p> -<p>The contents and borders of inferiors are not affected by their parent's -bit-gravity. A server is permitted to ignore the specified bit-gravity -and use x:Forget-Gravity instead. -</p> -<p>A win-gravity of x:Unmap-Gravity is like x:North-West-Gravity (the -window is not moved), except the child is also unmapped when the parent -is resized, and an x:Unmap-Notify event is generated. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Backing-Store</b> -<a name="IDX81"></a> -</dt> -<dd><p>Some implementations of the X server may choose to maintain the contents -of x:Input-Output windows. If the X server maintains the contents of a -window, the off-screen saved pixels are known as backing store. The -backing store advises the X server on what to do with the contents of a -window. The backing-store attribute can be set to x:Not-Useful -(default), x:When-Mapped, or x:Always. A backing-store attribute of -x:Not-Useful advises the X server that maintaining contents is -unnecessary, although some X implementations may still choose to -maintain contents and, therefore, not generate x:Expose events. A -backing-store attribute of x:When-Mapped advises the X server that -maintaining contents of obscured regions when the window is mapped would -be beneficial. In this case, the server may generate an x:Expose event -when the window is created. A backing-store attribute of x:Always -advises the X server that maintaining contents even when the window is -unmapped would be beneficial. Even if the window is larger than its -parent, this is a request to the X server to maintain complete contents, -not just the region within the parent window boundaries. While the X -server maintains the window's contents, x:Expose events normally are not -generated, but the X server may stop maintaining contents at any time. -</p> -<p>When the contents of obscured regions of a window are being maintained, -regions obscured by noninferior windows are included in the destination -of graphics requests (and source, when the window is the source). -However, regions obscured by inferior windows are not included. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Backing-Planes</b> -<a name="IDX82"></a> -</dt> -<dt><u>Attribute:</u> <b>x:CW-Backing-Pixel</b> -<a name="IDX83"></a> -</dt> -<dd><p>You can set backing planes to indicate (with bits set to 1) which bit -planes of an x:Input-Output window hold dynamic data that must be -preserved in backing store and during save unders. The default value -for the backing-planes attribute is all bits set to 1. You can set -backing pixel to specify what bits to use in planes not covered by -backing planes. The default value for the backing-pixel attribute is -all bits set to 0. The X server is free to save only the specified bit -planes in the backing store or the save under and is free to regenerate -the remaining planes with the specified pixel value. Any extraneous -bits in these values (that is, those bits beyond the specified depth of -the window) may be simply ignored. If you request backing store or save -unders, you should use these members to minimize the amount of -off-screen memory required to store your window. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Override-Redirect</b> -<a name="IDX84"></a> -</dt> -<dd><p>To control window placement or to add decoration, a window manager often -needs to intercept (redirect) any map or configure request. Pop-up -windows, however, often need to be mapped without a window manager -getting in the way. To control whether an x:Input-Output or -x:Input-Only window is to ignore these structure control facilities, use -the override-redirect flag. -</p> -<p>The override-redirect flag specifies whether map and configure requests -on this window should override a x:Substructure-Redirect-Mask on the -parent. You can set the override-redirect flag to #t or #f (default). -Window managers use this information to avoid tampering with pop-up -windows. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Save-Under</b> -<a name="IDX85"></a> -</dt> -<dd><p>Some server implementations may preserve contents of x:Input-Output windows -under other x:Input-Output windows. This is not the same as preserving the -contents of a window for you. You may get better visual appeal if -transient windows (for example, pop-up menus) request that the system -preserve the screen contents under them, so the temporarily obscured -applications do not have to repaint. -</p> -<p>You can set the save-under flag to True or False (default). If -save-under is True, the X server is advised that, when this window is -mapped, saving the contents of windows it obscures would be beneficial. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Event-Mask</b> -<a name="IDX86"></a> -</dt> -<dd><p>The event mask defines which events the client is interested in for this -x:Input-Output or x:Input-Only window (or, for some event types, -inferiors of this window). The event mask is the bitwise inclusive OR -of zero or more of the valid event mask bits. You can specify that no -maskable events are reported by setting x:No-Event-Mask (default). -</p> -<p>The following table lists the event mask constants you can pass to the -event-mask argument and the circumstances in which you would want to -specify the event mask: -</p> -<table> -<tr><td><p> Event Mask -</p></td><td><p> Circumstances -</p></td></tr> -<tr><td><p> x:No-Event-Mask -</p></td><td><p> No events wanted -</p></td></tr> -<tr><td><p> x:Key-Press-Mask -</p></td><td><p> Keyboard down events wanted -</p></td></tr> -<tr><td><p> x:Key-Release-Mask -</p></td><td><p> Keyboard up events wanted -</p></td></tr> -<tr><td><p> x:Button-Press-Mask -</p></td><td><p> Pointer button down events wanted -</p></td></tr> -<tr><td><p> x:Button-Release-Mask -</p></td><td><p> Pointer button up events wanted -</p></td></tr> -<tr><td><p> x:Enter-Window-Mask -</p></td><td><p> Pointer window entry events wanted -</p></td></tr> -<tr><td><p> x:Leave-Window-Mask -</p></td><td><p> Pointer window leave events wanted -</p></td></tr> -<tr><td><p> x:Pointer-Motion-Mask -</p></td><td><p> Pointer motion events wanted -</p></td></tr> -<tr><td><p> x:Pointer-Motion-Hint-Mask -</p></td><td> -<p>If x:Pointer-Motion-Hint-Mask is selected in combination with one or -more motion-masks, the X server is free to send only one x:Motion-Notify -event (with the is_hint member of the X:Pointer-Moved-Event structure -set to x:Notify-Hint) to the client for the event window, until either -the key or button state changes, the pointer leaves the event window, or -the client calls X:Query-Pointer or X:Get-Motion-Events. The server -still may send x:Motion-Notify events without is_hint set to -x:Notify-Hint. -</p></td></tr> -<tr><td><p> x:Button1-Motion-Mask -</p></td><td><p> Pointer motion while button 1 down -</p></td></tr> -<tr><td><p> x:Button2-Motion-Mask -</p></td><td><p> Pointer motion while button 2 down -</p></td></tr> -<tr><td><p> x:Button3-Motion-Mask -</p></td><td><p> Pointer motion while button 3 down -</p></td></tr> -<tr><td><p> x:Button4-Motion-Mask -</p></td><td><p> Pointer motion while button 4 down -</p></td></tr> -<tr><td><p> x:Button5-Motion-Mask -</p></td><td><p> Pointer motion while button 5 down -</p></td></tr> -<tr><td><p> x:Button-Motion-Mask -</p></td><td><p> Pointer motion while any button down -</p></td></tr> -<tr><td><p> x:Keymap-State-Mask -</p></td><td><p> Keyboard state wanted at window entry and focus in -</p></td></tr> -<tr><td><p> x:Exposure-Mask -</p></td><td><p> Any exposure wanted -</p></td></tr> -<tr><td><p> x:Visibility-Change-Mask -</p></td><td><p> Any change in visibility wanted -</p></td></tr> -<tr><td><p> x:Structure-Notify-Mask -</p></td><td><p> Any change in window structure wanted -</p></td></tr> -<tr><td><p> x:Resize-Redirect-Mask -</p></td><td><p> Redirect resize of this window -</p></td></tr> -<tr><td><p> x:Substructure-Notify-Mask -</p></td><td><p> Substructure notification wanted -</p></td></tr> -<tr><td><p> x:Substructure-Redirect-Mask -</p></td><td><p> Redirect structure requests on children -</p></td></tr> -<tr><td><p> x:Focus-Change-Mask -</p></td><td><p> Any change in input focus wanted -</p></td></tr> -<tr><td><p> x:Property-Change-Mask -</p></td><td><p> Any change in property wanted -</p></td></tr> -<tr><td><p> x:Colormap-Change-Mask -</p></td><td><p> Any change in colormap wanted -</p></td></tr> -<tr><td><p> x:Owner-Grab-Button-Mask -</p></td><td><p> Automatic grabs should activate with owner_events set to True -</p></td></tr> -</table> - -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Dont-Propagate</b> -<a name="IDX87"></a> -</dt> -<dd><p>The do-not-propagate-mask attribute defines which events should not be -propagated to ancestor windows when no client has the event type -selected in this x:Input-Output or x:Input-Only window. The -do-not-propagate-mask is the bitwise inclusive OR of zero or more of the -following masks: x:Key-Press, x:Key-Release, x:Button-Press, -x:Button-Release, x:Pointer-Motion, x:Button1Motion, x:Button2Motion, -x:Button3Motion, x:Button4Motion, x:Button5Motion, and x:Button-Motion. -You can specify that all events are propagated by setting -x:No-Event-Mask (default). -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Colormap</b> -<a name="IDX88"></a> -</dt> -<dd><p>The colormap attribute specifies which colormap best reflects the true -colors of the x:Input-Output window. The colormap must have the same -visual type as the window. X servers capable of supporting multiple -hardware colormaps can use this information, and window managers can use -it for calls to X:Install-Colormap. You can set the colormap attribute -to a colormap or to x:Copy-From-Parent (default). -</p> -<p>If you set the colormap to x:Copy-From-Parent, the parent window's -colormap is copied and used by its child. However, the child window -must have the same visual type as the parent. The parent window must -not have a colormap of x:None. The colormap is copied by sharing the -colormap object between the child and parent, not by making a complete -copy of the colormap contents. Subsequent changes to the parent -window's colormap attribute do not affect the child window. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:CW-Cursor</b> -<a name="IDX89"></a> -</dt> -<dd><p>The cursor attribute specifies which cursor is to be used when the -pointer is in the x:Input-Output or x:Input-Only window. You can set -the cursor to a cursor or x:None (default). -</p> -<p>If you set the cursor to x:None, the parent's cursor is used when the -pointer is in the x:Input-Output or x:Input-Only window, and any change -in the parent's cursor will cause an immediate change in the displayed -cursor. On the root window, the default cursor is restored. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:window-ref</b><i> window field-name …</i> -<a name="IDX90"></a> -</dt> -<dd><p>Returns a list of the components specified by <var>field-name</var>s for the -specified <var>window</var>. Allowable <var>field-name</var>s are a subset of -those for <code>x:window-set!</code>: -</p> -<ul> -<li> x:CW-Back-Pixel -</li><li> x:CW-Bit-Gravity -</li><li> x:CW-Win-Gravity -</li><li> x:CW-Backing-Store -</li><li> x:CW-Backing-Planes -</li><li> x:CW-Backing-Pixel -</li><li> x:CW-Override-Redirect -</li><li> x:CW-Save-Under -</li><li> x:CW-Event-Mask -</li><li> x:CW-Dont-Propagate -</li><li> x:CW-Colormap -</li></ul> -</dd></dl> - - -<hr size="6"> -<a name="Window-Properties-and-Visibility"></a> -<a name="SEC6"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC5" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC7" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC3" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC7" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="section"> 3.3 Window Properties and Visibility </h2> - -<dl> -<dt><u>Function:</u> <b>x:get-window-property</b><i> window property </i> -<a name="IDX91"></a> -</dt> -<dd><p>Returns the (string or list of numbers) value of <var>property</var> of -<var>window</var>. -</p><dl> -<dt><u>Function:</u> <b>x:get-window-property</b><i> window property #t</i> -<a name="IDX92"></a> -</dt> -<dd><p>Removes and returns the (string or list of numbers) value of -<var>property</var> of <var>window</var>. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:list-properties</b><i> window</i> -<a name="IDX93"></a> -</dt> -<dd><p>Returns a list of the properties (strings) defined for <var>window</var>. -</p></dd></dl> - - -<p>In X parlance, a window which is hidden even when not obscured by other -windows is <em>unmapped</em>; one which -<a name="IDX94"></a> -<a name="IDX95"></a> -<a name="IDX96"></a> -<a name="IDX97"></a> -shows is <em>mapped</em>. It is an unfortunate name-collision with Scheme, -and is ingrained in the attribute names. -</p> -<dl> -<dt><u>Function:</u> <b>x:map-window</b><i> window</i> -<a name="IDX98"></a> -</dt> -<dd><p>Maps the <var>window</var> and all of its subwindows that have had map -requests. Mapping a window that has an unmapped ancestor does not -display the window but marks it as eligible for display when the -ancestor becomes mapped. Such a window is called unviewable. When all -its ancestors are mapped, the window becomes viewable and will be -visible on the screen if it is not obscured by another window. This -function has no effect if the <var>window</var> is already mapped. -</p> -<p>If the override-redirect of the window is False and if some other client -has selected x:Substructure-Redirect-Mask on the parent window, then the X -server generates a MapRequest event, and the <code>x:map-window</code> -function does not map the <var>window</var>. Otherwise, the <var>window</var> is -mapped, and the X server generates a MapNotify event. -</p> -<p>If the <var>window</var> becomes viewable and no earlier contents for it are -remembered, the X server tiles the <var>window</var> with its background. If -the window's background is undefined, the existing screen contents are -not altered, and the X server generates zero or more x:Expose events. If -backing-store was maintained while the <var>window</var> was unmapped, no -x:Expose events are generated. If backing-store will now be maintained, a -full-window exposure is always generated. Otherwise, only visible -regions may be reported. Similar tiling and exposure take place for any -newly viewable inferiors. -</p> -<p>If the window is an Input-Output window, <code>x:map-window</code> generates -x:Expose events on each Input-Output window that it causes to be displayed. -If the client maps and paints the window and if the client begins -processing events, the window is painted twice. To avoid this, first -ask for x:Expose events and then map the window, so the client processes -input events as usual. The event list will include x:Expose for each -window that has appeared on the screen. The client's normal response to -an x:Expose event should be to repaint the window. This method usually -leads to simpler programs and to proper interaction with window -managers. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:map-subwindows</b><i> window</i> -<a name="IDX99"></a> -</dt> -<dd><p>Maps all subwindows of a specified <var>window</var> in top-to-bottom -stacking order. The X server generates x:Expose events on each newly -displayed window. This may be much more efficient than mapping many -windows one at a time because the server needs to perform much of the -work only once, for all of the windows, rather than for each window. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:unmap-window</b><i> window</i> -<a name="IDX100"></a> -</dt> -<dd><p>Unmaps the specified <var>window</var> and causes the X server to generate an -UnmapNotify event. If the specified <var>window</var> is already unmapped, -<code>x:unmap-window</code> has no effect. Normal exposure processing on -formerly obscured windows is performed. Any child window will no longer -be visible until another map call is made on the parent. In other -words, the subwindows are still mapped but are not visible until the -parent is mapped. Unmapping a <var>window</var> will generate x:Expose events -on windows that were formerly obscured by it. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:unmap-subwindows</b><i> window</i> -<a name="IDX101"></a> -</dt> -<dd><p>Unmaps all subwindows for the specified <var>window</var> in bottom-to-top -stacking order. It causes the X server to generate an UnmapNotify event -on each subwindow and x:Expose events on formerly obscured windows. Using -this function is much more efficient than unmapping multiple windows one -at a time because the server needs to perform much of the work only -once, for all of the windows, rather than for each window. -</p></dd></dl> - -</dd></dl> -<hr size="6"> -<a name="Graphics-Context"></a> -<a name="SEC7"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC6" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC9" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC3" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC9" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 4. Graphics Context </h1> - - -<p>Most attributes of graphics operations are stored in <em>GC</em>s. These -include line width, line style, plane mask, foreground, background, -tile, stipple, clipping region, end style, join style, and so on. -Graphics operations (for example, drawing lines) use these values to -determine the actual drawing operation. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-gc</b><i> drawable field-name value …</i> -<a name="IDX102"></a> -</dt> -<dd><p>Creates and returns graphics context. The graphics context can be used -with any destination drawable having the same root and depth as the -specified <var>drawable</var>. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:gc-set!</b><i> graphics-context field-name value …</i> -<a name="IDX103"></a> -</dt> -<dd><p>Changes the components specified by <var>field-name</var>s for the specified -<var>graphics-context</var>. The restrictions are the same as for -<code>x:create-gc</code>. The order in which components are verified and -altered is server dependent. If an error occurs, a subset of the -components may have been altered. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:copy-gc-fields!</b><i> gcontext-src gcontext-dst field-name …</i> -<a name="IDX104"></a> -</dt> -<dd><p>Copies the components specified by <var>field-name</var>s from -<var>gcontext-src</var> to <var>gcontext-dst</var>. <var>Gcontext-src</var> and -<var>gcontext-dst</var> must have the same root and depth. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:gc-ref</b><i> graphics-context field-name …</i> -<a name="IDX105"></a> -</dt> -<dd><p>Returns a list of the components specified by <var>field-name</var>s … -from the specified <var>graphics-context</var>. -</p></dd></dl> - -<a name="SEC8"></a> -<h2 class="heading"> GC Attributes </h2> - - -<p>Both <code>x:create-gc</code> and <code>x:change-gc</code> take one argument -followed by pairs of arguments, where the first is one of the -property-name symbols (or its top-level value) listed below; and the -second is the value to associate with that property. -</p> -<dl> -<dt><u>Attribute:</u> <b>x:GC-Function</b> -<a name="IDX106"></a> -</dt> -<dd><p>The function attributes of a GC are used when you update a section of a -drawable (the destination) with bits from somewhere else (the source). -The function in a GC defines how the new destination bits are to be -computed from the source bits and the old destination bits. x:G-Xcopy is -typically the most useful because it will work on a color display, but -special applications may use other functions, particularly in concert -with particular planes of a color display. The 16 functions are: -</p> -<table><tr><td> </td><td><pre class="format"><tt> -x:G-Xclear 0 -x:G-Xand (AND src dst) -x:G-Xand-Reverse (AND src (NOT dst)) -x:G-Xcopy src -x:G-Xand-Inverted (AND (NOT src) dst) -x:G-Xnoop dst -x:G-Xxor (XOR src dst) -x:G-Xor (OR src dst) -x:G-Xnor (AND (NOT src) (NOT dst)) -x:G-Xequiv (XOR (NOT src) dst) -x:G-Xinvert (NOT dst) -x:G-Xor-Reverse (OR src (NOT dst)) -x:G-Xcopy-Inverted (NOT src) -x:G-Xor-Inverted (OR (NOT src) dst) -x:G-Xnand (OR (NOT src) (NOT dst)) -x:G-Xset 1</tt> -</pre></td></tr></table></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Plane-Mask</b> -<a name="IDX107"></a> -</dt> -<dd><p>Many graphics operations depend on either pixel values or planes in a -GC. The planes attribute is an integer which specifies which planes of -the destination are to be modified, one bit per plane. A monochrome -display has only one plane and will be the least significant bit of the -integer. As planes are added to the display hardware, they will occupy -more significant bits in the plane mask. -</p> -<p>In graphics operations, given a source and destination pixel, the result -is computed bitwise on corresponding bits of the pixels. That is, a -Boolean operation is performed in each bit plane. The plane-mask -restricts the operation to a subset of planes. <code>x:All-Planes</code> can be -used to refer to all planes of the screen simultaneously. The result is -computed by the following: -</p> -<table><tr><td> </td><td><pre class="format">(OR (AND (FUNC src dst) plane-mask) (AND dst (NOT plane-mask))) -</pre></td></tr></table> -<p>Range checking is not performed on a plane-mask value. It is simply -truncated to the appropriate number of bits. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Foreground</b> -<a name="IDX108"></a> -</dt> -<dt><u>Attribute:</u> <b>x:GC-Background</b> -<a name="IDX109"></a> -</dt> -<dd><p>Range checking is not performed on the values for foreground or -background. They are simply truncated to the appropriate number of -bits. -</p> -<p>Note that foreground and background are not initialized to any values -likely to be useful in a window. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Line-Width</b> -<a name="IDX110"></a> -</dt> -<dd><p>The line-width is measured in pixels and either can be greater than or -equal to one (wide line) or can be the special value zero (thin line). -</p> -<p>Thin lines (zero line-width) are one-pixel-wide lines drawn using an -unspecified, device-dependent algorithm. There are only two constraints -on this algorithm. -</p> -<ul> -<li> -If a line is drawn unclipped from [x1,y1] to [x2,y2] and if another line -is drawn unclipped from [x1+dx,y1+dy] to [x2+dx,y2+dy], a point [x,y] is -touched by drawing the first line if and only if the point [x+dx,y+dy] -is touched by drawing the second line. - -</li><li> -The effective set of points comprising a line cannot be affected by -clipping. That is, a point is touched in a clipped line if and only if -the point lies inside the clipping region and the point would be touched -by the line when drawn unclipped. -</li></ul> - -<p>A wide line drawn from [x1,y1] to [x2,y2] always draws the same pixels -as a wide line drawn from [x2,y2] to [x1,y1], not counting cap-style and -join-style. It is recommended that this property be true for thin -lines, but this is not required. A line-width of zero may differ from a -line-width of one in which pixels are drawn. This permits the use of -many manufacturers' line drawing hardware, which may run many times -faster than the more precisely specified wide lines. -</p> -<p>In general, drawing a thin line will be faster than drawing a wide line -of width one. However, because of their different drawing algorithms, -thin lines may not mix well aesthetically with wide lines. If it is -desirable to obtain precise and uniform results across all displays, a -client should always use a line-width of one rather than a linewidth of -zero. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Line-Style</b> -<a name="IDX111"></a> -</dt> -<dd><p>The line-style defines which sections of a line are drawn: -</p> -<dl compact="compact"> -<dt> <tt>x:Line-Solid</tt></dt> -<dd><p>The full path of the line is drawn. -</p></dd> -<dt> <tt>x:Line-Double-Dash</tt></dt> -<dd><p>The full path of the line is drawn, but the even dashes are filled -differently from the odd dashes (see fill-style) with x:Cap-Butt style used -where even and odd dashes meet. -</p></dd> -<dt> <tt>x:Line-On-Off-Dash</tt></dt> -<dd><p>Only the even dashes are drawn, and cap-style applies to all internal -ends of the individual dashes, except x:Cap-Not-Last is treated as x:Cap-Butt. -</p></dd> -</dl> -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Cap-Style</b> -<a name="IDX112"></a> -</dt> -<dd><p>The cap-style defines how the endpoints of a path are drawn: -</p> -<dl compact="compact"> -<dt> <tt>x:Cap-Not-Last</tt></dt> -<dd><p>This is equivalent to x:Cap-Butt except that for a line-width of zero the -final endpoint is not drawn. -</p></dd> -<dt> <tt>x:Cap-Butt</tt></dt> -<dd><p>The line is square at the endpoint (perpendicular to the slope of the -line) with no projection beyond. -</p></dd> -<dt> <tt>x:Cap-Round</tt></dt> -<dd><p>The line has a circular arc with the diameter equal to the line-width, -centered on the endpoint. (This is equivalent to x:Cap-Butt for line-width -of zero). -</p></dd> -<dt> <tt>x:Cap-Projecting</tt></dt> -<dd><p>The line is square at the end, but the path continues beyond the -endpoint for a distance equal to half the line-width. (This is -equivalent to x:Cap-Butt for line-width of zero). -</p></dd> -</dl> -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Join-Style</b> -<a name="IDX113"></a> -</dt> -<dd><p>The join-style defines how corners are drawn for wide lines: -</p> -<dl compact="compact"> -<dt> <tt>x:Join-Miter</tt></dt> -<dd><p>The outer edges of two lines extend to meet at an angle. However, if -the angle is less than 11 degrees, then a x:Join-Bevel join-style is used -instead. -</p></dd> -<dt> <tt>x:Join-Round</tt></dt> -<dd><p>The corner is a circular arc with the diameter equal to the -line-width, centered on the x:Join-point. -</p></dd> -<dt> <tt>x:Join-Bevel</tt></dt> -<dd><p>The corner has x:Cap-Butt endpoint styles with the triangular notch filled. -</p></dd> -</dl> -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Fill-Style</b> -<a name="IDX114"></a> -</dt> -<dd><p>The fill-style defines the contents of the source for line, text, and -fill requests. For all text and fill requests (for example, -X:Draw-Text, X:Fill-Rectangle, X:Fill-Polygon, and X:Fill-Arc); for line -requests with linestyle x:Line-Solid (for example, X:Draw-Line, -X:Draw-Segments, X:Draw-Rectangle, X:Draw-Arc); and for the even dashes -for line requests with line-style x:Line-On-Off-Dash or -x:Line-Double-Dash, the following apply: -</p> -<dl compact="compact"> -<dt> <tt>x:Fill-Solid</tt></dt> -<dd><p>Foreground -</p></dd> -<dt> <tt>x:Fill-Tiled</tt></dt> -<dd><p>Tile -</p></dd> -<dt> <tt>x:Fill-Opaque-Stippled</tt></dt> -<dd><p>A tile with the same width and height as stipple, but with background -everywhere stipple has a zero and with foreground everywhere stipple has -a one -</p></dd> -<dt> <tt>x:Fill-Stippled</tt></dt> -<dd><p>Foreground masked by stipple -</p></dd> -</dl> - -<p>When drawing lines with line-style x:Line-Double-Dash, the odd dashes -are controlled by the fill-style in the following manner: -</p> -<dl compact="compact"> -<dt> <tt>x:Fill-Solid</tt></dt> -<dd><p>Background -</p></dd> -<dt> <tt>x:Fill-Tiled</tt></dt> -<dd><p>Same as for even dashes -</p></dd> -<dt> <tt>x:Fill-Opaque-Stippled</tt></dt> -<dd><p>Same as for even dashes -</p></dd> -<dt> <tt>x:Fill-Stippled</tt></dt> -<dd><p>Background masked by stipple -</p></dd> -</dl> -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Fill-Rule</b> -<a name="IDX115"></a> -</dt> -<dd><p>The fill-rule defines what pixels are inside (drawn) for paths given in -X:Fill-Polygon requests and can be set to x:Even-Odd-Rule or -x:Winding-Rule. -</p> -<dl compact="compact"> -<dt> <tt>x:Even-Odd-Rule</tt></dt> -<dd><p>A point is inside if an infinite ray with the point as -origin crosses the path an odd number of times. -</p></dd> -<dt> <tt>x:Winding-Rule</tt></dt> -<dd><p>A point is inside if an infinite ray with the point as origin crosses an -unequal number of clockwise and counterclockwise directed path segments. -</p></dd> -</dl> - -<p>A clockwise directed path segment is one that crosses the ray from left -to right as observed from the point. A counterclockwise segment is one -that crosses the ray from right to left as observed from the point. The -case where a directed line segment is coincident with the ray is -uninteresting because you can simply choose a different ray that is not -coincident with a segment. -</p> -<p>For both x:Even-Odd-Rule and x:Winding-Rule, a point is infinitely -small, and the path is an infinitely thin line. A pixel is inside if -the center point of the pixel is inside and the center point is not on -the boundary. If the center point is on the boundary, the pixel is -inside if and only if the polygon interior is immediately to its right -(x increasing direction). Pixels with centers on a horizontal edge are -a special case and are inside if and only if the polygon interior is -immediately below (y increasing direction). -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Tile</b> -<a name="IDX116"></a> -</dt> -<dt><u>Attribute:</u> <b>x:GC-Stipple</b> -<a name="IDX117"></a> -</dt> -<dd><p>The tile/stipple represents an infinite two-dimensional plane, with the -tile/stipple replicated in all dimensions. -</p> -<p>The tile pixmap must have the same root and depth as the GC, or an error -results. The stipple pixmap must have depth one and must have the same -root as the GC, or an error results. For stipple operations where the -fill-style is x:Fill-Stippled but not x:Fill-Opaque-Stippled, the -stipple pattern is tiled in a single plane and acts as an additional -clip mask to be ANDed with the clip-mask. Although some sizes may be -faster to use than others, any size pixmap can be used for tiling or -stippling. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Tile-Stip-X-Origin</b> -<a name="IDX118"></a> -</dt> -<dt><u>Attribute:</u> <b>x:GC-Tile-Stip-Y-Origin</b> -<a name="IDX119"></a> -</dt> -<dd><p>When the tile/stipple plane is superimposed on a drawable for use in a -graphics operation, the upper-left corner of some instance of the -tile/stipple is at the coordinates within the drawable specified by the -tile/stipple origin. The tile/stipple origin is interpreted relative to -the origin of whatever destination drawable is specified in a graphics -request. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Font</b> -<a name="IDX120"></a> -</dt> -<dd><p>The font to be used for drawing text. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Subwindow-Mode</b> -<a name="IDX121"></a> -</dt> -<dd><p>You can set the subwindow-mode to x:Clip-By-Children or -x:Include-Inferiors. -</p><dl compact="compact"> -<dt> <tt>x:Clip-By-Children</tt></dt> -<dd><p>Both source and destination windows are additionally clipped by all -viewable Input-Output children. -</p></dd> -<dt> <tt>x:Include-Inferiors</tt></dt> -<dd><p>Neither source nor destination window is clipped by inferiors. This -will result in including subwindow contents in the source and drawing -through subwindow boundaries of the destination. The use of -<code>x:Include-Inferiors</code> on a window of one depth with mapped -inferiors of differing depth is not illegal, but the semantics are -undefined by the core protocol. -</p></dd> -</dl> -</dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Graphics-Exposures</b> -<a name="IDX122"></a> -</dt> -<dd><p>The graphics-exposure flag controls x:Graphics-Expose event generation -for X:Copy-Area and X:Copy-Plane requests (and any similar requests -defined by extensions). -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Clip-X-Origin</b> -<a name="IDX123"></a> -</dt> -<dt><u>Attribute:</u> <b>x:GC-Clip-Y-Origin</b> -<a name="IDX124"></a> -</dt> -<dd><p>The clip-mask origin is interpreted relative to the origin of whatever -destination drawable is specified in a graphics request. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Clip-Mask</b> -<a name="IDX125"></a> -</dt> -<dd><p>The clip-mask restricts writes to the destination drawable. If the -clip-mask is set to a pixmap, it must have depth one and have the same -root as the GC, or an error results. If clip-mask is set to -<a name="IDX126"></a> -<a name="IDX127"></a> -<em>x:None</em>, the pixels are always drawn regardless of the clip origin. -The clip-mask also can be set by calling <code>X:Set-Region</code>. Only -pixels where the clip-mask has a bit set to 1 are drawn. Pixels are not -drawn outside the area covered by the clip-mask or where the clip-mask -has a bit set to 0. The clip-mask affects all graphics requests. The -clip-mask does not clip sources. The clip-mask origin is interpreted -relative to the origin of whatever destination drawable is specified in -a graphics request. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Dash-Offset</b> -<a name="IDX128"></a> -</dt> -<dd><p>Defines the phase of the pattern, specifying how many pixels into the -dash-list the pattern should actually begin in any single graphics -request. Dashing is continuous through path elements combined with a -join-style but is reset to the dash-offset between each sequence of -joined lines. -</p> -<p>The unit of measure for dashes is the same for the ordinary -coordinate system. Ideally, a dash length is measured along -the slope of the line, but implementations are only required -to match this ideal for horizontal and vertical lines. -Failing the ideal semantics, it is suggested that the length -be measured along the major axis of the line. The major -axis is defined as the x axis for lines drawn at an angle of -between -45 and +45 degrees or between 135 and 225 degrees -from the x axis. For all other lines, the major axis is the -y axis. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Dash-List</b> -<a name="IDX129"></a> -</dt> -<dd><p>There must be at least one element in the specified <var>dash-list</var>. -The initial and alternating elements (second, fourth, and so on) of the -<var>dash-list</var> are the even dashes, and the others are the odd dashes. -Each element specifies a dash length in pixels. All of the elements -must be nonzero. Specifying an odd-length list is equivalent to -specifying the same list concatenated with itself to produce an -even-length list. -</p></dd></dl> - -<dl> -<dt><u>Attribute:</u> <b>x:GC-Arc-Mode</b> -<a name="IDX130"></a> -</dt> -<dd><p>The arc-mode controls filling in the X:Fill-Arcs function and can be set -to x:Arc-Pie-Slice or x:Arc-Chord. -</p><dl compact="compact"> -<dt> <tt>x:Arc-Pie-Slice</tt></dt> -<dd><p>The arcs are pie-slice filled. -</p></dd> -<dt> <tt>x:Arc-Chord</tt></dt> -<dd><p>The arcs are chord filled. -</p></dd> -</dl> -</dd></dl> - - -<hr size="6"> -<a name="Cursor"></a> -<a name="SEC9"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC7" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC10" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC7" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC10" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 5. Cursor </h1> - -<dl> -<dt><u>Function:</u> <b>x:create-cursor</b><i> display shape</i> -<a name="IDX131"></a> -</dt> -<dd><p>X provides a set of standard cursor shapes in a special font named -<a name="IDX132"></a> -<em>cursor</em>. Applications are encouraged to use this interface for -their cursors because the font can be customized for the individual -display type. The <var>shape</var> argument specifies which glyph of the standard -fonts to use. -</p> -<p>The hotspot comes from the information stored in the cursor font. The -initial colors of a cursor are a black foreground and a white background -(see X:Recolor-Cursor). The names of all cursor shapes are defined with -the prefix XC: in <tt>`x11.scm'</tt>. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-cursor</b><i> source-font source-char mask-font mask-char fgc bgc</i> -<a name="IDX133"></a> -</dt> -<dd><p>Creates a cursor from the source and mask bitmaps obtained from the -specified font glyphs. The integer <var>source-char</var> must be a defined -glyph in <var>source-font</var>. The integer <var>mask-char</var> must be a -defined glyph in <var>mask-font</var>. The origins of the <var>source-char</var> -and <var>mask-char</var> glyphs are positioned coincidently and define the -hotspot. The <var>source-char</var> and <var>mask-char</var> need not have the -same bounding box metrics, and there is no restriction on the placement -of the hotspot relative to the bounding boxes. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-cursor</b><i> source-font source-char #f #f fgc bgc</i> -<a name="IDX134"></a> -</dt> -<dd><p>If <var>mask-font</var> and <var>mask-char</var> are #f, all pixels of the source -are displayed. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-cursor</b><i> source-pixmap mask-pixmap fgc bgc origin</i> -<a name="IDX135"></a> -</dt> -<dd><p><var>mask-pixmap</var> must be the same size as the pixmap defined by the -<var>source-pixmap</var> argument. The foreground and background RGB values -must be specified using <var>foreground-color</var> and -<var>background-color</var>, even if the X server only has a x:Static-Gray or -x:Gray-Scale screen. The hotspot must be a point within the -<var>source-pixmap</var>. -</p> -<p><code>X:Create-Cursor</code> creates and returns a cursor. The -<var>foreground-color</var> is used for the pixels set to 1 in the source, -and the <var>background-color</var> is used for the pixels set to 0. Both -source and mask must have depth one but can have any root. The -<var>mask-pixmap</var> defines the shape of the cursor. The pixels set to 1 -in <var>mask-pixmap</var> define which source pixels are displayed, and the -pixels set to 0 define which pixels are ignored. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-cursor</b><i> source-pixmap #f fgc bgc origin</i> -<a name="IDX136"></a> -</dt> -<dd><p>If <var>mask-pixmap</var> is #f, all pixels of the source are displayed. -</p></dd></dl> - -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -<hr size="6"> -<a name="Colormap"></a> -<a name="SEC10"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC9" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC11" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC9" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC11" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 6. Colormap </h1> - -<p>A <em>colormap</em> maps pixel values to <em>RGB</em> color space values. -</p> -<dl> -<dt><u>Function:</u> <b>x:create-colormap</b><i> window visual alloc-policy</i> -<a name="IDX137"></a> -</dt> -<dd><p><var>window</var> specifies the window on whose screen you want to create a -colormap. <var>visual</var> specifies a visual type supported on the screen. -<var>alloc-policy</var> Specifies the colormap entries to be allocated. You -can pass <code>X:Alloc-None</code> or <code>X:Alloc-All</code>. -</p> -<p>The <code>X:Create-Colormap</code> function creates and returns a colormap of -the specified <var>visual</var> type for the screen on which <var>window</var> -resides. Note that <var>window</var> is used only to determine the screen. -</p> -<dl compact="compact"> -<dt> <samp>`X:Gray-Scale'</samp></dt> -<dt> <samp>`X:Pseudo-Color'</samp></dt> -<dt> <samp>`X:Direct-Color'</samp></dt> -<dd><p>The initial values of the colormap entries are undefined. -</p> -</dd> -<dt> <samp>`X:Static-Gray'</samp></dt> -<dt> <samp>`X:Static-Color'</samp></dt> -<dt> <samp>`X:True-Color'</samp></dt> -<dd><p>The entries have defined values, but those values are specific to -<var>visual</var> and are not defined by X. The <var>alloc-policy</var> must be -<samp>`X:Alloc-None'</samp>. -</p> -</dd> -</dl> - -<p>For the other visual classes, if <var>alloc-policy</var> is -<samp>`X:Alloc-None'</samp>, the colormap initially has no allocated entries, -and clients can allocate them. -</p> -<p>If <var>alloc-policy</var> is <samp>`X:Alloc-All'</samp>, the entire colormap is -allocated writable. The initial values of all allocated entries are -undefined. -</p> -<dl compact="compact"> -<dt> <samp>`X:Gray-Scale'</samp></dt> -<dt> <samp>`X:Pseudo-Color'</samp></dt> -<dd><p>The effect is as if an <code>XAllocColorCells</code> call returned all pixel -values from zero to N - 1, where N is the colormap entries value in -<var>visual</var>. -</p> -</dd> -<dt> <samp>`X:Direct-Color'</samp></dt> -<dd><p>The effect is as if an <code>XAllocColorPlanes</code> call returned a pixel -value of zero and red_mask, green_mask, and blue_mask values containing -the same bits as the corresponding masks in the specified visual. -</p></dd> -</dl> - -</dd></dl> - - -<p>To create a new colormap when the allocation out of a previously -shared colormap has failed because of resource exhaustion, use: -</p> -<dl> -<dt><u>Function:</u> <b>x:copy-colormap-and-free</b><i> colormap</i> -<a name="IDX138"></a> -</dt> -<dd><p>Creates and returns a colormap of the same visual type and for the same -screen as the specified <var>colormap</var>. It also moves all of the -client's existing allocation from the specified <var>colormap</var> to the -new colormap with their color values intact and their read-only or -writable characteristics intact and frees those entries in the specified -colormap. Color values in other entries in the new colormap are -undefined. If the specified colormap was created by the client with -alloc set to <samp>`X:Alloc-All'</samp>, the new colormap is also created with -<samp>`X:Alloc-All'</samp>, all color values for all entries are copied from the -specified <var>colormap</var>, and then all entries in the specified -<var>colormap</var> are freed. If the specified <var>colormap</var> was not -created by the client with <samp>`X:Alloc-All'</samp>, the allocations to be moved -are all those pixels and planes that have been allocated by the client -and that have not been freed since they were allocated. -</p> -</dd></dl> - -<p>A <em>colormap</em> maps pixel values to elements of the <em>RGB</em> -datatype. An <var>RGB</var> is a list or vector of 3 integers, describing -the red, green, and blue intensities respectively. The integers are in -the range 0 - 65535. -</p> -<dl> -<dt><u>Function:</u> <b>x:alloc-colormap-cells</b><i> colormap ncolors nplanes</i> -<a name="IDX139"></a> -</dt> -<dt><u>Function:</u> <b>x:alloc-colormap-cells</b><i> colormap ncolors nplanes contiguous?</i> -<a name="IDX140"></a> -</dt> -<dd><p>The <code>X:Alloc-Color-Cells</code> function allocates read/write color -cells. The number of colors, <var>ncolors</var> must be positive and the -number of planes, <var>nplanes</var> nonnegative. If <var>ncolors</var> and -nplanes are requested, then <var>ncolors</var> pixels and nplane plane masks -are returned. No mask will have any bits set to 1 in common with any -other mask or with any of the pixels. By ORing together each pixel with -zero or more masks, <var>ncolors</var> * 2^<var>nplanes</var> distinct pixels can -be produced. All of these are allocated writable by the request. -</p> -<dl compact="compact"> -<dt> <samp>`x:Gray-Scale'</samp></dt> -<dt> <samp>`x:Pseudo-Color'</samp></dt> -<dd><p>Each mask has exactly one bit set to 1. If <var>contiguous?</var> is -non-false and if all masks are ORed together, a single contiguous set of -bits set to 1 is formed. -</p></dd> -<dt> <samp>`x:Direct-Color'</samp></dt> -<dd><p>Each mask has exactly three bits set to 1. If <var>contiguous?</var> is -non-false and if all masks are ORed together, three contiguous sets of -bits set to 1 (one within each pixel subfield) is formed. -</p></dd> -</dl> - -<p>The RGB values of the allocated entries are undefined. -<code>X:Alloc-Color-Cells</code> returns a list of two uniform arrays if it -succeeded or #f if it failed. The first array has the pixels allocated -and the second has the plane-masks. -</p> - -<dl> -<dt><u>Function:</u> <b>x:alloc-colormap-cells</b><i> colormap ncolors rgb</i> -<a name="IDX141"></a> -</dt> -<dt><u>Function:</u> <b>x:alloc-colormap-cells</b><i> colormap ncolors rgb contiguous?</i> -<a name="IDX142"></a> -</dt> -<dd><p>The specified <var>ncolors</var> must be positive; and <var>rgb</var> a list or -vector of 3 nonnegative integers. If <var>ncolors</var> colors, <var>nreds</var> -reds, <var>ngreens</var> greens, and <var>nblues</var> blues are requested, -<var>ncolors</var> pixels are returned; and the masks have <var>nreds</var>, -<var>ngreens</var>, and <var>nblues</var> bits set to 1, respectively. If -<var>contiguous?</var> is non-false, each mask will have a contiguous set of -bits set to 1. No mask will have any bits set to 1 in common with any -other mask or with any of the pixels. -</p> -<p>Each mask will lie within the corresponding pixel subfield. By ORing -together subsets of masks with each pixel value, <var>ncolors</var> * -2(<var>nreds</var>+<var>ngreens</var>+<var>nblues</var>) distinct pixel values can be -produced. All of these are allocated by the request. However, in the -colormap, there are only <var>ncolors</var> * 2^<var>nreds</var> independent red -entries, <var>ncolors</var> * 2^<var>ngreens</var> independent green entries, and -<var>ncolors</var> * 2^<var>nblues</var> independent blue entries. -</p> -<p><code>X:Alloc-Color-Cells</code> returns a list if it succeeded or #f if it -failed. The first element of the list has an array of the pixels -allocated. The second, third, and fourth elements are the red, green, -and blue plane-masks. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:free-colormap-cells</b><i> colormap pixels planes</i> -<a name="IDX143"></a> -</dt> -<dt><u>Function:</u> <b>x:free-colormap-cells</b><i> colormap pixels</i> -<a name="IDX144"></a> -</dt> -<dd><p>Frees the cells represented by pixels whose values are in the -<var>pixels</var> unsigned-integer uniform-vector. The <var>planes</var> argument -should not have any bits set to 1 in common with any of the pixels. The -set of all pixels is produced by ORing together subsets of the -<var>planes</var> argument with the pixels. The request frees all of these -pixels that were allocated by the client. Note that freeing an -individual pixel obtained from <code>X:Alloc-Colormap-Cells</code> with a -planes argument may not actually allow it to be reused until all of its -related pixels are also freed. Similarly, a read-only entry is not -actually freed until it has been freed by all clients, and if a client -allocates the same read-only entry multiple times, it must free the -entry that many times before the entry is actually freed. -</p> -<p>All specified pixels that are allocated by the client in the -<var>colormap</var> are freed, even if one or more pixels produce an error. -It is an error if a specified pixel is not allocated by the client (that -is, is unallocated or is only allocated by another client) or if the -colormap was created with all entries writable (by passing -<samp>`x:Alloc-All'</samp> to <code>X:Create-Colormap</code>). If more than one pixel -is in error, the one that gets reported is arbitrary. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:colormap-find-color</b><i> colormap rgb</i> -<a name="IDX145"></a> -</dt> -<dd><p><var>rgb</var> is a list or vector of 3 integers, describing the red, green, -and blue intensities respectively; or an integer <samp>`#x<i>rrggbb</i>'</samp>, -packing red, green and blue intensities in the range 0 - 255. -</p> -<dl> -<dt><u>Function:</u> <b>x:colormap-find-color</b><i> colormap color-name</i> -<a name="IDX146"></a> -</dt> -<dd><p>The case-insensitive string <var>color_name</var> specifies the name of a -color (for example, <tt>`red'</tt>) -</p> -<p><code>X:Colormap-Find-Color</code> allocates a read-only colormap entry -corresponding to the closest RGB value supported by the hardware. -<code>X:Colormap-Find-Color</code> returns the pixel value of the color -closest to the specified <var>RGB</var> or <var>color_name</var> elements -supported by the hardware, if successful; otherwise -<code>X:Colormap-Find-Color</code> returns #f. -</p> -<p>Multiple clients that request the same effective RGB value can -be assigned the same read-only entry, thus allowing entries to be -shared. When the last client deallocates a shared cell, it is -deallocated. -</p> -</dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:color-ref</b><i> colormap pixel</i> -<a name="IDX147"></a> -</dt> -<dd><p>Returns a list of 3 integers, describing the red, green, -and blue intensities respectively of the <var>colormap</var> entry of the -cell indexed by <var>pixel</var>. -</p> -<p>The integer <var>pixel</var> must be a valid index into <var>colormap</var>. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>X:Color-Set!</b><i> colormap pixel rgb</i> -<a name="IDX148"></a> -</dt> -<dd><p><var>rgb</var> is a list or vector of 3 integers, describing the red, green, -and blue intensities respectively; or an integer <samp>`#x<i>rrggbb</i>'</samp>, -packing red, green and blue intensities in the range 0 - 255. -</p> -<dl> -<dt><u>Function:</u> <b>X:Color-Set!</b><i> colormap pixel color-name</i> -<a name="IDX149"></a> -</dt> -<dd><p>The case-insensitive string <var>color_name</var> specifies the name of a -color (for example, <tt>`red'</tt>) -</p> -<p>The integer <var>pixel</var> must be a valid index into <var>colormap</var>. -</p> -<p><code>X:Color-Set!</code> changes the <var>colormap</var> entry of the read/write -cell indexed by <var>pixel</var>. If the <var>colormap</var> is an installed map -for its screen, the changes are visible immediately. -</p> -</dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:install-colormap</b><i> colormap</i> -<a name="IDX150"></a> -</dt> -<dd><p>Installs the specified <var>colormap</var> for its associated screen. All -windows associated with <var>colormap</var> immediately display with true -colors. A colormap is associated with a window when the window is -created or its attributes changed. -</p> -<p>If the specified colormap is not already an installed colormap, the X -server generates a ColormapNotify event on each window that has that -colormap. -</p> -</dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:ccc</b><i> colormap</i> -<a name="IDX151"></a> -</dt> -<dd><p>Returns the Color-Conversion-Context of <var>colormap</var>. -</p></dd></dl> - - -</dd></dl> -</dd></dl> -</dd></dl> -<hr size="6"> -<a name="Rendering"></a> -<a name="SEC11"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC10" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC14" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC10" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC14" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 7. Rendering </h1> - -<dl> -<dt><u>Function:</u> <b>x:flush</b><i> display</i> -<a name="IDX152"></a> -</dt> -<dt><u>Function:</u> <b>x:flush</b><i> window</i> -<a name="IDX153"></a> -</dt> -<dd><p>Flushes the output buffer. Some client applications need not use this -function because the output buffer is automatically flushed as needed by -calls to X:Pending, X:Next-Event, and X:Window-Event. Events generated -by the server may be enqueued into the library's event queue. -</p> -<dl> -<dt><u>Function:</u> <b>x:flush</b><i> gc</i> -<a name="IDX154"></a> -</dt> -<dd><p>Forces sending of GC component changes. -</p> -<p>Xlib usually defers sending changes to the components of a GC to the -server until a graphics function is actually called with that GC. This -permits batching of component changes into a single server request. In -some circumstances, however, it may be necessary for the client to -explicitly force sending the changes to the server. An example might be -when a protocol extension uses the GC indirectly, in such a way that the -extension interface cannot know what GC will be used. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:clear-area</b><i> window (x-pos y-pos) (width height) expose?</i> -<a name="IDX155"></a> -</dt> -<dd><p>Paints a rectangular area in the specified <var>window</var> according to the -specified dimensions with the <var>window</var>'s background pixel or pixmap. -The subwindow-mode effectively is <samp>`x:Clip-By-Children'</samp>. If width -is zero, it is replaced with the current width of the <var>window</var> minus -x. If height is zero, it is replaced with the current height of the -<var>window</var> minus y. If the <var>window</var> has a defined background -tile, the rectangle clipped by any children is filled with this tile. -If the <var>window</var> has background x:None, the contents of the -<var>window</var> are not changed. In either case, if <var>expose?</var> is True, -one or more x:Expose events are generated for regions of the rectangle -that are either visible or are being retained in a backing store. If -you specify a <var>window</var> whose class is x:Input-Only, an error -results. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:fill-rectangle</b><i> window gcontext position size</i> -<a name="IDX156"></a> -</dt> -</dl> - -</dd></dl> -<a name="SEC12"></a> -<h2 class="heading"> Draw Strings </h2> - -<dl> -<dt><u>Function:</u> <b>x:draw-string</b><i> drawable gc position string</i> -<a name="IDX157"></a> -</dt> -<dd><p><var>Position</var> specifies coordinates relative to the origin of -<var>drawable</var> of the origin of the first character to be drawn. -</p> -<p><code>x:draw-string</code> draws the characters of <var>string</var>, starting at -<var>position</var>. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:image-string</b><i> drawable gc position string</i> -<a name="IDX158"></a> -</dt> -<dd><p><var>Position</var> specifies coordinates relative to the origin of -<var>drawable</var> of the origin of the first character to be drawn. -</p> -<p><code>x:image-string</code> draws the characters <em>and background</em> of -<var>string</var>, starting at <var>position</var>. -</p></dd></dl> - -<a name="SEC13"></a> -<h2 class="heading"> Draw Shapes </h2> - -<dl> -<dt><u>Function:</u> <b>x:draw-points</b><i> drawable gc position …</i> -<a name="IDX159"></a> -</dt> -<dd><p><var>Position</var> … specifies coordinates of the point to be drawn. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-points</b><i> drawable gc x y …</i> -<a name="IDX160"></a> -</dt> -<dd><p>(<var>x</var>, <var>y</var>) … specifies coordinates of the point to be -drawn. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-points</b><i> drawable gc point-array</i> -<a name="IDX161"></a> -</dt> -<dd><p><var>point-array</var> is a uniform short array of rank 2, whose rightmost -index spans a range of 2. -</p> -<p>The <code>X:Draw-Points</code> procedure uses the foreground pixel and -function components of the <var>gc</var> to draw points into <var>drawable</var> -at the positions (relative to the origin of <var>drawable</var>) specified. -</p> -<p><code>X:Draw-Points</code> uses these <var>gc</var> components: function, -planemask, foreground, subwindow-mode, clip-x-origin, clip-y-origin, and -clip-mask. -</p></dd></dl> - - -<dl> -<dt><u>Function:</u> <b>x:draw-segments</b><i> drawable gc pos1 pos2 …</i> -<a name="IDX162"></a> -</dt> -<dd><p><var>Pos1</var>, <var>pos2</var>, … specify coordinates to be connected by -segments. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-segments</b><i> drawable gc x1 y1 x2 y2 …</i> -<a name="IDX163"></a> -</dt> -<dd><p>(<var>x1</var>, <var>y1</var>), (<var>x2</var>, <var>y2</var>) … specify coordinates -to be connected by segments. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-segments</b><i> drawable gc point-array</i> -<a name="IDX164"></a> -</dt> -<dd><p><var>point-array</var> is a uniform short array of rank 2, whose rightmost -index spans a range of 2. -</p> -<p>The <code>X:Draw-Segments</code> procedure uses the components of the -specified <var>gc</var> to draw multiple unconnected lines between disjoint -adjacent pair of points passed as arguments. It draws the segments in -order and does not perform joining at coincident endpoints. For any -given line, <code>X:Draw-Segments</code> does not draw a pixel more than once. -If thin (zero line-width) segments intersect, the intersecting pixels -are drawn multiple times. If wide segments intersect, the intersecting -pixels are drawn only once, as though the entire PolyLine protocol -request were a single, filled shape. <code>X:Draw-Segments</code> treats all -coordinates as relative to the origin of <var>drawable</var>. -</p> -<p><code>X:Draw-Segments</code> uses these <var>gc</var> components: function, -plane-mask, line-width, line-style, cap-style, fill-style, -subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask, join-style. -It also use these <var>gc</var> mode-dependent components: foreground, -background, tile, stipple, tilestipple-x-origin, tile-stipple-y-origin, -dash-offset, and dash-list. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:draw-lines</b><i> drawable gc pos1 pos2 …</i> -<a name="IDX165"></a> -</dt> -<dd><p><var>Pos1</var>, <var>pos2</var>, … specify coordinates to be connected by -lines. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-lines</b><i> drawable gc x1 y1 x2 y2 …</i> -<a name="IDX166"></a> -</dt> -<dd><p>(<var>x1</var>, <var>y1</var>), (<var>x2</var>, <var>y2</var>) … specify coordinates -to be connected by lines. -</p> -<dl> -<dt><u>Function:</u> <b>x:draw-lines</b><i> drawable gc point-array</i> -<a name="IDX167"></a> -</dt> -<dd><p><var>point-array</var> is a uniform short array of rank 2, whose rightmost -index spans a range of 2. -</p> -<p>The <code>X:Draw-Lines</code> procedure uses the components of the specified -<var>gc</var> to draw lines between each adjacent pair of points passed as -arguments. It draws the lines in order. The lines join correctly at -all intermediate points, and if the first and last points coincide, the -first and last lines also join correctly. For any given line, -<code>X:Draw-Lines</code> does not draw a pixel more than once. If thin (zero -line-width) lines intersect, the intersecting pixels are drawn multiple -times. If wide lines intersect, the intersecting pixels are drawn only -once, as though the entire PolyLine protocol request were a single, -filled shape. <code>X:Draw-Lines</code> treats all coordinates as relative to -the origin of <var>drawable</var>. -</p> -<p><code>X:Draw-Lines</code> uses these <var>gc</var> components: function, -plane-mask, line-width, line-style, cap-style, fill-style, -subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask, join-style. -It also use these <var>gc</var> mode-dependent components: foreground, -background, tile, stipple, tilestipple-x-origin, tile-stipple-y-origin, -dash-offset, and dash-list. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:fill-polygon</b><i> drawable gc pos1 pos2 …</i> -<a name="IDX168"></a> -</dt> -<dd><p><var>Pos1</var>, <var>pos2</var>, … specify coordinates of the border path. -</p> -<dl> -<dt><u>Function:</u> <b>x:fill-polygon</b><i> drawable gc x1 y1 x2 y2 …</i> -<a name="IDX169"></a> -</dt> -<dd><p>(<var>x1</var>, <var>y1</var>), (<var>x2</var>, <var>y2</var>) … specify coordinates -of the border path. -</p> -<dl> -<dt><u>Function:</u> <b>x:fill-polygon</b><i> drawable gc point-array</i> -<a name="IDX170"></a> -</dt> -<dd><p><var>point-array</var> is a uniform short array of rank 2, whose rightmost -index spans a range of 2. -</p> -<p>The path is closed automatically if the last point in the list or -<var>point-array</var> does not coincide with the first point. -</p> -<p>The <code>X:Fill-Polygon</code> procedure uses the components of the specified -<var>gc</var> to fill the region closed by the specified path. -<code>X:Fill-Polygon</code> does not draw a pixel of the region more than -once. <code>X:Fill-Polygon</code> treats all coordinates as relative to the -origin of <var>drawable</var>. -</p> -<p><code>X:Fill-Polygon</code> uses these <var>gc</var> components: function, -planemask, fill-style, fill-rule, subwindow-mode, clip-x-origin, -clip-y-origin, and clip-mask. It also use these <var>gc</var> mode-dependent -components: foreground, background, tile, stipple, -tile-stipple-x-origin, and tile-stipple-y-origin. -</p></dd></dl> - -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -</dd></dl> -<hr size="6"> -<a name="Images"></a> -<a name="SEC14"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC11" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC15" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC11" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC15" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 8. Images </h1> - -<dl> -<dt><u>Function:</u> <b>x:read-bitmap-file</b><i> drawable file</i> -<a name="IDX171"></a> -</dt> -</dl> - -<hr size="6"> -<a name="Event"></a> -<a name="SEC15"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC14" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC14" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Next chapter"> >> </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="chapter"> 9. Event </h1> - - -<p>These three status routines always return immediately if there are -events already in the queue. -</p> -<dl> -<dt><u>Function:</u> <b>x:q-length</b><i> display</i> -<a name="IDX172"></a> -</dt> -<dd><p>Returns the length of the event queue for the connected <var>display</var>. -Note that there may be more events that have not been read into the -queue yet (see X:Events-Queued). -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:pending</b><i> display</i> -<a name="IDX173"></a> -</dt> -<dd><p>Returns the number of events that have been received from the X server -but have not been removed from the event queue. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:events-queued</b><i> display</i> -<a name="IDX174"></a> -</dt> -<dd><p>Returns the number of events already in the queue if the number is -nonzero. If there are no events in the queue, <code>X:Events-Queued</code> -attempts to read more events out of the application's connection without -flushing the output buffer and returns the number read. -</p></dd></dl> - - -<p>Both of these routines return an object of type <em>event</em>. -</p> -<dl> -<dt><u>Function:</u> <b>x:next-event</b><i> display</i> -<a name="IDX175"></a> -</dt> -<dd><p>Removes and returns the first event from the event queue. If the event -queue is empty, <code>X:Next-Event</code> flushes the output buffer and blocks -until an event is received. -</p></dd></dl> - -<dl> -<dt><u>Function:</u> <b>x:peek-event</b><i> display</i> -<a name="IDX176"></a> -</dt> -<dd><p>Returns the first event from the event queue, but it does not remove the -event from the queue. If the queue is empty, <code>X:Peek-Event</code> -flushes the output buffer and blocks until an event is received. -</p></dd></dl> - - -<p>Each event object has fields dependent on its sub-type. -</p> -<dl> -<dt><u>Function:</u> <b>x:event-ref</b><i> event field-name</i> -<a name="IDX177"></a> -</dt> -<dd><table> -<tr><td><p> window -</p></td><td> -<p>The window on which <var>event</var> was generated and is referred to as the -event window. -</p></td></tr> -<tr><td><p> root -</p></td><td> -<p>is the event window's root window. -</p></td></tr> -<tr><td><p> subwindow -</p></td><td> -<p>If the source window is an inferior of the event window, the -<var>subwindow</var> is the child of the event window that is the source -window or the child of the event window that is an ancestor of the -source window. Otherwise, <samp>`None'</samp>. -</p></td></tr> -<tr><td><p> X-event:type -</p></td><td> -<p>An integer: <var>x:Key-Press</var>, <var>x:Key-Release</var>, -<var>x:Button-Press</var>, <var>x:Button-Release</var>, <var>x:Motion-Notify</var>, -<var>x:Enter-Notify</var>, <var>x:Leave-Notify</var>, <var>x:Focus-In</var>, -<var>x:Focus-Out</var>, <var>x:Keymap-Notify</var>, <var>x:Expose</var>, -<var>x:Graphics-Expose</var>, <var>x:No-Expose</var>, <var>x:Visibility-Notify</var>, -<var>x:Create-Notify</var>, <var>x:Destroy-Notify</var>, <var>x:Unmap-Notify</var>, -<var>x:Map-Notify</var>, <var>x:Map-Request</var>, <var>x:Reparent-Notify</var>, -<var>x:Configure-Notify</var>, <var>x:Configure-Request</var>, -<var>x:Gravity-Notify</var>, <var>x:Resize-Request</var>, -<var>x:Circulate-Notify</var>, <var>x:Circulate-Request</var>, -<var>x:Property-Notify</var>, <var>x:Selection-Clear</var>, -<var>x:Selection-Request</var>, <var>x:Selection-Notify</var>, -<var>x:Colormap-Notify</var>, <var>x:Client-Message</var>, or -<var>x:Mapping-Notify</var>. -</p></td></tr> -<tr><td><p> X-event:serial -</p></td><td> -<p>The serial number of the protocol request that generated the <var>event</var>. -</p></td></tr> -<tr><td><p> X-event:send-event -</p></td><td> -<p>Boolean that indicates whether the event was sent by a different client. -</p></td></tr> -<tr><td><p> X-event:time -</p></td><td> -<p>The time when the <var>event</var> was generated expressed in milliseconds. -</p></td></tr> -<tr><td><p> X-event:x -</p></td></tr> -<tr><td><p> X-event:y -</p></td><td> -<p>For window entry/exit events the <var>x</var> and <var>y</var> members are set to -the coordinates of the pointer position in the event window. This -position is always the pointer's final position, not its initial -position. If the event window is on the same screen as the root window, -<var>x</var> and <var>y</var> are the pointer coordinates relative to the event -window's origin. Otherwise, <var>x</var> and <var>y</var> are set to zero. -</p> -<p>For expose events The <var>x</var> and <var>y</var> members are set to the -coordinates relative to the drawable's origin and indicate the -upper-left corner of the rectangle. -</p> -<p>For configure, create, gravity, and reparent events the <var>x</var> and -<var>y</var> members are set to the window's coordinates relative to the -parent window's origin and indicate the position of the upper-left -outside corner of the created window. -</p></td></tr> -<tr><td><p> X-event:x-root -</p></td></tr> -<tr><td><p> X-event:y-root -</p></td><td> -<p>The pointer's coordinates relative to the root window's origin at the -time of the <var>event</var>. -</p></td></tr> -<tr><td><p> X-event:state -</p></td><td> -<p>For keyboard, pointer and window entry/exit events, the state member is -set to indicate the logical state of the pointer buttons and modifier -keys just prior to the <var>event</var>, which is the bitwise inclusive OR of -one or more of the button or modifier key masks: <var>x:Button1-Mask</var>, -<var>x:Button2-Mask</var>, <var>x:Button3-Mask</var>, <var>x:Button4-Mask</var>, -<var>x:Button5-Mask</var>, <var>x:Shift-Mask</var>, <var>x:Lock-Mask</var>, -<var>x:Control-Mask</var>, <var>x:Mod1-Mask</var>, <var>x:Mod2-Mask</var>, -<var>x:Mod3-Mask</var>, <var>x:Mod4-Mask</var>, and <var>x:Mod5-Mask</var>. -</p> -<p>For visibility events, the state of the window's visibility: -<var>x:Visibility-Unobscured</var>, <var>x:Visibility-Partially-Obscured</var>, or -<var>x:Visibility-Fully-Obscured</var>. -</p> -<p>For colormap events, indicates whether the colormap is installed or -uninstalled: x:Colormap-Installed or x:Colormap-Uninstalled. -</p> -<p>For property events, indicates whether the property was changed to a new -value or deleted: x:Property-New-Value or x:Property-Delete. -</p></td></tr> -<tr><td><p> X-event:keycode -</p></td><td> -<p>An integer that represents a physical key on the keyboard. -</p></td></tr> -<tr><td><p> X-event:same-screen -</p></td><td> -<p>Indicates whether the event window is on the same screen as the root -window. If #t, the event and root windows are on the same screen. If -#f, the event and root windows are not on the same screen. -</p></td></tr> -<tr><td><p> X-event:button -</p></td><td> -<p>The pointer button that changed state; can be the <var>x:Button1</var>, -<var>x:Button2</var>, <var>x:Button3</var>, <var>x:Button4</var>, or <var>x:Button5</var> -value. -</p></td></tr> -<tr><td><p> X-event:is-hint -</p></td><td> -<p>Detail of motion-notify events: <var>x:Notify-Normal</var> or -<var>x:Notify-Hint</var>. -</p></td></tr> -<tr><td><p> X-event:mode -</p></td><td> -<p>Indicates whether the <var>event</var> is a normal event, pseudo-motion event -when a grab activates, or a pseudo-motion event when a grab deactivates: -<var>x:Notify-Normal</var>, <var>x:Notify-Grab</var>, or <var>x:Notify-Ungrab</var>. -</p></td></tr> -<tr><td><p> X-event:detail -</p></td><td> -<p>Indicates the notification detail: <var>x:Notify-Ancestor</var>, -<var>x:Notify-Virtual</var>, <var>x:Notify-Inferior</var>, -<var>x:Notify-Nonlinear</var>, or <var>x:Notify-Nonlinear-Virtual</var>. -</p></td></tr> -<tr><td><p> X-event:focus -</p></td><td> -<p>If the event window is the focus window or an inferior of the focus -window, #t; otherwise #f. -</p></td></tr> -<tr><td><p> X-event:width -</p></td></tr> -<tr><td><p> X-event:height -</p></td><td> -<p>The size (extent) of the rectangle. -</p></td></tr> -<tr><td><p> X-event:count -</p></td><td> -<p>For mapping events is the number of keycodes altered. -</p> -<p>For expose events Is the number of Expose or GraphicsExpose events that -are to follow. If count is zero, no more Expose events follow for this -window. However, if count is nonzero, at least that number of Expose -events (and possibly more) follow for this window. Simple applications -that do not want to optimize redisplay by distinguishing between -subareas of its window can just ignore all Expose events with nonzero -counts and perform full redisplays on events with zero counts. -</p></td></tr> -<tr><td><p> X-event:major-code -</p></td><td> -<p>The major_code member is set to the graphics request initiated by the -client and can be either X_CopyArea or X_CopyPlane. If it is -X_CopyArea, a call to XCopyArea initiated the request. If it is -X_CopyPlane, a call to XCopyPlane initiated the request. -</p></td></tr> -<tr><td><p> X-event:minor-code -</p></td><td> -<p>Not currently used. -</p></td></tr> -<tr><td><p> X-event:border-width -</p></td><td> -<p>For configure events, the width of the window's border, in pixels. -</p></td></tr> -<tr><td><p> X-event:override-redirect -</p></td><td> -<p>The override-redirect attribute of the window. Window manager clients -normally should ignore this window if it is #t. -</p></td></tr> -<tr><td><p> X-event:from-configure -</p></td><td> -<p>True if the event was generated as a result of a resizing of the -window's parent when the window itself had a win-gravity of -x:Unmap-Gravity. -</p></td></tr> -<tr><td><p> X-event:value-mask -</p></td><td> -<p>Indicates which components were specified in the ConfigureWindow -protocol request. The corresponding values are reported as given in the -request. The remaining values are filled in from the current geometry -of the window, except in the case of above (sibling) and detail -(stack-mode), which are reported as None and Above, respectively, if -they are not given in the request. -</p></td></tr> -<tr><td><p> X-event:place -</p></td><td> -<p>The window's position after the restack occurs and is either -x:Place-On-Top or x:Place-On-Bottom. If it is x:Place-On-Top, the -window is now on top of all siblings. If it is x:Place-On-Bottom, the -window is now below all siblings. -</p></td></tr> -<tr><td><p> X-event:new -</p></td><td> -<p>indicate whether the colormap for the specified window was changed or -installed or uninstalled and can be True or False. If it is True, the -colormap was changed. If it is False, the colormap was installed or -uninstalled. -</p></td></tr> -<tr><td><p> X-event:format -</p></td><td> -<p>Is 8, 16, or 32 and specifies whether the data should be viewed as a -list of bytes, shorts, or longs -</p></td></tr> -<tr><td><p> X-event:request -</p></td><td> -<p>Indicates the kind of mapping change that occurred and can be -<var>x:Mapping-Modifier</var>, <var>x:Mapping-Keyboard</var>, or -<var>x:Mapping-Pointer</var>. If it is <var>x:Mapping-Modifier</var>, the -modifier mapping was changed. If it is <var>x:Mapping-Keyboard</var>, the -keyboard mapping was changed. If it is <var>x:Mapping-Pointer</var>, the -pointer button mapping was changed. -</p></td></tr> -<tr><td><p> X-event:first-keycode -</p></td><td> -<p>The X-event:first-keycode is set only if the X-event:request was set to -<var>x:Mapping-Keyboard</var>. The number in X-event:first-keycode -represents the first number in the range of the altered mapping, and -X-event:count represents the number of keycodes altered. -</p></td></tr> -</table> -</dd></dl> - -<hr size="6"> -<a name="Indexes"></a> -<a name="SEC16"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC15" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC17" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC15" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[ >> ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1 class="unnumbered"> Indexes </h1> - -<table class="menu" border="0" cellspacing="0"> -<tr><td align="left" valign="top"><a href="#SEC17">Procedure and Macro Index</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC18">Variable Index</a></td><td> </td><td align="left" valign="top"> -</td></tr> -<tr><td align="left" valign="top"><a href="#SEC19">Concept Index</a></td><td> </td><td align="left" valign="top"> -</td></tr> -</table> - -<hr size="6"> -<a name="Procedure-and-Macro-Index"></a> -<a name="SEC17"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC16" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC18" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC16" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[ >> ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="unnumberedsec"> Procedure and Macro Index </h2> - -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC17_0" class="summary-letter"><b>H</b></a> - -<a href="#SEC17_1" class="summary-letter"><b>X</b></a> - -</td></tr></table> -<table border="0" class="index-fn"> -<tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC17_0">H</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX4"><code>hostname:number.screen-number</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC17_1">X</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX139"><code>x:alloc-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX140"><code>x:alloc-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX141"><code>x:alloc-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX142"><code>x:alloc-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX151"><code>x:ccc</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX155"><code>x:clear-area</code></a></td><td valign="top"><a href="#SEC11">7. Rendering</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX5"><code>x:close</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX63"><code>x:close</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX64"><code>x:close</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX147"><code>x:color-ref</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX148"><code>X:Color-Set!</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX149"><code>X:Color-Set!</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX145"><code>x:colormap-find-color</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX146"><code>x:colormap-find-color</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX138"><code>x:copy-colormap-and-free</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX104"><code>x:copy-gc-fields!</code></a></td><td valign="top"><a href="#SEC7">4. Graphics Context</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX137"><code>x:create-colormap</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX131"><code>x:create-cursor</code></a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX133"><code>x:create-cursor</code></a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX134"><code>x:create-cursor</code></a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX135"><code>x:create-cursor</code></a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX136"><code>x:create-cursor</code></a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX102"><code>x:create-gc</code></a></td><td valign="top"><a href="#SEC7">4. Graphics Context</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX61"><code>x:create-pixmap</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX62"><code>x:create-pixmap</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX59"><code>x:create-window</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX60"><code>x:create-window</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX17"><code>x:default-ccc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX18"><code>x:default-ccc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX19"><code>x:default-ccc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX14"><code>x:default-colormap</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX15"><code>x:default-colormap</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX16"><code>x:default-colormap</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX20"><code>x:default-gc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX21"><code>x:default-gc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX22"><code>x:default-gc</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX10"><code>x:default-screen</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX26"><code>x:default-visual</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX27"><code>x:default-visual</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX28"><code>x:default-visual</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX165"><code>x:draw-lines</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX166"><code>x:draw-lines</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX167"><code>x:draw-lines</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX159"><code>x:draw-points</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX160"><code>x:draw-points</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX161"><code>x:draw-points</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX162"><code>x:draw-segments</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX163"><code>x:draw-segments</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX164"><code>x:draw-segments</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX157"><code>x:draw-string</code></a></td><td valign="top"><a href="#SEC12">Draw Strings</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX177"><code>x:event-ref</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX174"><code>x:events-queued</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX168"><code>x:fill-polygon</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX169"><code>x:fill-polygon</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX170"><code>x:fill-polygon</code></a></td><td valign="top"><a href="#SEC13">Draw Shapes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX156"><code>x:fill-rectangle</code></a></td><td valign="top"><a href="#SEC11">7. Rendering</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX152"><code>x:flush</code></a></td><td valign="top"><a href="#SEC11">7. Rendering</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX153"><code>x:flush</code></a></td><td valign="top"><a href="#SEC11">7. Rendering</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX154"><code>x:flush</code></a></td><td valign="top"><a href="#SEC11">7. Rendering</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX143"><code>x:free-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX144"><code>x:free-colormap-cells</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX105"><code>x:gc-ref</code></a></td><td valign="top"><a href="#SEC7">4. Graphics Context</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX103"><code>x:gc-set!</code></a></td><td valign="top"><a href="#SEC7">4. Graphics Context</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX91"><code>x:get-window-property</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX92"><code>x:get-window-property</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX158"><code>x:image-string</code></a></td><td valign="top"><a href="#SEC12">Draw Strings</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX150"><code>x:install-colormap</code></a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX93"><code>x:list-properties</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX31"><code>x:make-visual</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX32"><code>x:make-visual</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX99"><code>x:map-subwindows</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX98"><code>x:map-window</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX175"><code>x:next-event</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX3"><code>x:open-display</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX176"><code>x:peek-event</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX173"><code>x:pending</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX6"><code>x:protocol-version</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX172"><code>x:q-length</code></a></td><td valign="top"><a href="#SEC15">9. Event</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX171"><code>x:read-bitmap-file</code></a></td><td valign="top"><a href="#SEC14">8. Images</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX11"><code>x:root-window</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX12"><code>x:root-window</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX13"><code>x:root-window</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX56"><code>x:screen-black</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX57"><code>x:screen-black</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX58"><code>x:screen-black</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX39"><code>x:screen-cells</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX40"><code>x:screen-cells</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX41"><code>x:screen-cells</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX9"><code>x:screen-count</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX42"><code>x:screen-depth</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX43"><code>x:screen-depth</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX44"><code>x:screen-depth</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX45"><code>x:screen-depth</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX23"><code>x:screen-depths</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX24"><code>x:screen-depths</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX25"><code>x:screen-depths</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX50"><code>x:screen-dimensions</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX51"><code>x:screen-dimensions</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX52"><code>x:screen-dimensions</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX47"><code>x:screen-size</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX48"><code>x:screen-size</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX49"><code>x:screen-size</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX53"><code>x:screen-white</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX54"><code>x:screen-white</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX55"><code>x:screen-white</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX7"><code>x:server-vendor</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX101"><code>x:unmap-subwindows</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX100"><code>x:unmap-window</code></a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX8"><code>x:vendor-release</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX33"><code>x:visual-class</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX34"><code>x:visual-class</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX35"><code>x:visual-class</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX36"><code>x:visual-geometry</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX37"><code>x:visual-geometry</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX38"><code>x:visual-geometry</code></a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX65"><code>x:window-geometry</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX66"><code>x:window-geometry-set!</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX90"><code>x:window-ref</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX74"><code>x:window-set!</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -</table> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC17_0" class="summary-letter"><b>H</b></a> - -<a href="#SEC17_1" class="summary-letter"><b>X</b></a> - -</td></tr></table> - -<hr size="6"> -<a name="Variable-Index"></a> -<a name="SEC18"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC17" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[<a href="#SEC19" title="Next section in reading order"> > </a>]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC16" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[ >> ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="unnumberedsec"> Variable Index </h2> - -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC18_0" class="summary-letter"><b>X</b></a> - -</td></tr></table> -<table border="0" class="index-vr"> -<tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC18_0">X</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX76"><code>x:CW-Back-Pixel</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX75"><code>x:CW-Back-Pixmap</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX83"><code>x:CW-Backing-Pixel</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX82"><code>x:CW-Backing-Planes</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX81"><code>x:CW-Backing-Store</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX79"><code>x:CW-Bit-Gravity</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX78"><code>x:CW-Border-Pixel</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX77"><code>x:CW-Border-Pixmap</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX71"><code>x:CW-Border-Width</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX88"><code>x:CW-Colormap</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX89"><code>x:CW-Cursor</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX87"><code>x:CW-Dont-Propagate</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX86"><code>x:CW-Event-Mask</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX70"><code>x:CW-Height</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX84"><code>x:CW-Override-Redirect</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX85"><code>x:CW-Save-Under</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX72"><code>x:CW-Sibling</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX73"><code>x:CW-Stack-Mode</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX69"><code>x:CW-Width</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX80"><code>x:CW-Win-Gravity</code></a></td><td valign="top"><a href="#SEC5">3.2 Window Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX67"><code>x:CWX</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX68"><code>x:CWY</code></a></td><td valign="top"><a href="#SEC4">3.1 Windows and Pixmaps</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX130"><code>x:GC-Arc-Mode</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX109"><code>x:GC-Background</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX112"><code>x:GC-Cap-Style</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX125"><code>x:GC-Clip-Mask</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX123"><code>x:GC-Clip-X-Origin</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX124"><code>x:GC-Clip-Y-Origin</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX129"><code>x:GC-Dash-List</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX128"><code>x:GC-Dash-Offset</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX115"><code>x:GC-Fill-Rule</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX114"><code>x:GC-Fill-Style</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX120"><code>x:GC-Font</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX108"><code>x:GC-Foreground</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX106"><code>x:GC-Function</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX122"><code>x:GC-Graphics-Exposures</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX113"><code>x:GC-Join-Style</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX111"><code>x:GC-Line-Style</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX110"><code>x:GC-Line-Width</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX107"><code>x:GC-Plane-Mask</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX117"><code>x:GC-Stipple</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX121"><code>x:GC-Subwindow-Mode</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX116"><code>x:GC-Tile</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX118"><code>x:GC-Tile-Stip-X-Origin</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX119"><code>x:GC-Tile-Stip-Y-Origin</code></a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -</table> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC18_0" class="summary-letter"><b>X</b></a> - -</td></tr></table> - -<hr size="6"> -<a name="Concept-Index"></a> -<a name="SEC19"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC18" title="Previous section in reading order"> < </a>]</td> -<td valign="middle" align="left">[ > ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC16" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[ >> ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h2 class="unnumberedsec"> Concept Index </h2> - -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC19_0" class="summary-letter"><b>C</b></a> - -<a href="#SEC19_1" class="summary-letter"><b>D</b></a> - -<a href="#SEC19_2" class="summary-letter"><b>M</b></a> - -<a href="#SEC19_3" class="summary-letter"><b>N</b></a> - -<a href="#SEC19_4" class="summary-letter"><b>R</b></a> - -<a href="#SEC19_5" class="summary-letter"><b>U</b></a> - -<a href="#SEC19_6" class="summary-letter"><b>V</b></a> - -<a href="#SEC19_7" class="summary-letter"><b>X</b></a> - -</td></tr></table> -<table border="0" class="index-cp"> -<tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_0">C</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#SEC10">colormap</a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX132">cursor</a></td><td valign="top"><a href="#SEC9">5. Cursor</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_1">D</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX46">depth</a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#SEC3">drawable</a></td><td valign="top"><a href="#SEC3">3. Drawables</a></td></tr> -<tr><td></td><td valign="top"><a href="#SEC3">Drawable</a></td><td valign="top"><a href="#SEC3">3. Drawables</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_2">M</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX94">map</a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX96">mapped</a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_3">N</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX127">none</a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_4">R</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#SEC10">RGB</a></td><td valign="top"><a href="#SEC10">6. Colormap</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_5">U</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX95">unmap</a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX97">unmapped</a></td><td valign="top"><a href="#SEC6">3.3 Window Properties and Visibility</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_6">V</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX29">visual</a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX30">Visual</a></td><td valign="top"><a href="#SEC2">2. Display and Screens</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -<tr><th><a name="SEC19_7">X</a></th><td></td><td></td></tr> -<tr><td></td><td valign="top"><a href="#IDX1">X</a></td><td valign="top"><a href="#SEC1">1. XlibScm</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX126">x:None</a></td><td valign="top"><a href="#SEC8">GC Attributes</a></td></tr> -<tr><td></td><td valign="top"><a href="#IDX2"><code>Xlib</code></a></td><td valign="top"><a href="#SEC1">1. XlibScm</a></td></tr> -<tr><td colspan="3"> <hr></td></tr> -</table> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC19_0" class="summary-letter"><b>C</b></a> - -<a href="#SEC19_1" class="summary-letter"><b>D</b></a> - -<a href="#SEC19_2" class="summary-letter"><b>M</b></a> - -<a href="#SEC19_3" class="summary-letter"><b>N</b></a> - -<a href="#SEC19_4" class="summary-letter"><b>R</b></a> - -<a href="#SEC19_5" class="summary-letter"><b>U</b></a> - -<a href="#SEC19_6" class="summary-letter"><b>V</b></a> - -<a href="#SEC19_7" class="summary-letter"><b>X</b></a> - -</td></tr></table> - -<hr size="6"> -<a name="SEC_Contents"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1>Table of Contents</h1> -<div class="contents"> - -<ul class="toc"> - <li><a name="TOC1" href="#SEC1">1. XlibScm</a></li> - <li><a name="TOC2" href="#SEC2">2. Display and Screens</a></li> - <li><a name="TOC3" href="#SEC3">3. Drawables</a> - <ul class="toc"> - <li><a name="TOC4" href="#SEC4">3.1 Windows and Pixmaps</a></li> - <li><a name="TOC5" href="#SEC5">3.2 Window Attributes</a></li> - <li><a name="TOC6" href="#SEC6">3.3 Window Properties and Visibility</a></li> - </ul></li> - <li><a name="TOC7" href="#SEC7">4. Graphics Context</a></li> - <li><a name="TOC8" href="#SEC9">5. Cursor</a></li> - <li><a name="TOC9" href="#SEC10">6. Colormap</a></li> - <li><a name="TOC10" href="#SEC11">7. Rendering</a></li> - <li><a name="TOC11" href="#SEC14">8. Images</a></li> - <li><a name="TOC12" href="#SEC15">9. Event</a></li> - <li><a name="TOC13" href="#SEC16">Indexes</a> - <ul class="toc"> - <li><a name="TOC14" href="#SEC17">Procedure and Macro Index</a></li> - <li><a name="TOC15" href="#SEC18">Variable Index</a></li> - <li><a name="TOC16" href="#SEC19">Concept Index</a></li> - </ul> -</li> -</ul> -</div> -<hr size="1"> -<a name="SEC_About"></a> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#SEC_Top" title="Cover (top) of document">Top</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td> -<td valign="middle" align="left">[<a href="#SEC16" title="Index">Index</a>]</td> -<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td> -</tr></table> -<h1>About This Document</h1> -<p> - This document was generated by <em>Neil Williams</em> on <em>July, 17 2007</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>. -</p> -<p> - The buttons in the navigation panels have the following meaning: -</p> -<table border="1"> - <tr> - <th> Button </th> - <th> Name </th> - <th> Go to </th> - <th> From 1.2.3 go to</th> - </tr> - <tr> - <td align="center"> [ < ] </td> - <td align="center">Back</td> - <td>previous section in reading order</td> - <td>1.2.2</td> - </tr> - <tr> - <td align="center"> [ > ] </td> - <td align="center">Forward</td> - <td>next section in reading order</td> - <td>1.2.4</td> - </tr> - <tr> - <td align="center"> [ << ] </td> - <td align="center">FastBack</td> - <td>beginning of this chapter or previous chapter</td> - <td>1</td> - </tr> - <tr> - <td align="center"> [ Up ] </td> - <td align="center">Up</td> - <td>up section</td> - <td>1.2</td> - </tr> - <tr> - <td align="center"> [ >> ] </td> - <td align="center">FastForward</td> - <td>next chapter</td> - <td>2</td> - </tr> - <tr> - <td align="center"> [Top] </td> - <td align="center">Top</td> - <td>cover (top) of document</td> - <td> </td> - </tr> - <tr> - <td align="center"> [Contents] </td> - <td align="center">Contents</td> - <td>table of contents</td> - <td> </td> - </tr> - <tr> - <td align="center"> [Index] </td> - <td align="center">Index</td> - <td>index</td> - <td> </td> - </tr> - <tr> - <td align="center"> [ ? ] </td> - <td align="center">About</td> - <td>about (help)</td> - <td> </td> - </tr> -</table> - -<p> - where the <strong> Example </strong> assumes that the current position is at <strong> Subsubsection One-Two-Three </strong> of a document of the following structure: -</p> - -<ul> - <li> 1. Section One - <ul> - <li>1.1 Subsection One-One - <ul> - <li>...</li> - </ul> - </li> - <li>1.2 Subsection One-Two - <ul> - <li>1.2.1 Subsubsection One-Two-One</li> - <li>1.2.2 Subsubsection One-Two-Two</li> - <li>1.2.3 Subsubsection One-Two-Three - <strong><== Current Position </strong></li> - <li>1.2.4 Subsubsection One-Two-Four</li> - </ul> - </li> - <li>1.3 Subsection One-Three - <ul> - <li>...</li> - </ul> - </li> - <li>1.4 Subsection One-Four</li> - </ul> - </li> -</ul> - -<hr size="1"> -<p> - <font size="-1"> - This document was generated by <em>Neil Williams</em> on <em>July, 17 2007</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>. - </font> - <br> - -</p> -</body> -</html> diff --git a/Xlibscm.info b/Xlibscm.info index 606fe3a..76b614a 100644 --- a/Xlibscm.info +++ b/Xlibscm.info @@ -2,7 +2,7 @@ This is Xlibscm.info, produced by makeinfo version 4.8 from Xlibscm.texi. This manual documents the X Interface for SCM Language (version -5e3, October 2006). +5e4, November 2007). Copyright (C) 1999 Free Software Foundation, Inc. @@ -32,7 +32,7 @@ XlibScm ******* This manual documents the X Interface for SCM Language (version -5e3, October 2006). +5e4, November 2007). Copyright (C) 1999 Free Software Foundation, Inc. @@ -1417,7 +1417,7 @@ blue intensities respectively. The integers are in the range 0 - 65535. of 3 nonnegative integers. If NCOLORS colors, NREDS reds, NGREENS greens, and NBLUES blues are requested, NCOLORS pixels are returned; and the masks have NREDS, NGREENS, and NBLUES bits set - to 1, respectively. If CONTIGUOUS? is non-false, each mask will + to 1, respectively. If CONTIGUOUS? is non-false, each mask will have a contiguous set of bits set to 1. No mask will have any bits set to 1 in common with any other mask or with any of the pixels. @@ -2114,22 +2114,22 @@ Concept Index Tag Table: -Node: Top1053 -Node: XlibScm2136 -Node: Display and Screens4930 -Node: Drawables11972 -Node: Windows and Pixmaps12237 -Node: Window Attributes19339 -Node: Window Properties and Visibility35344 -Node: Graphics Context39816 -Node: Cursor55556 -Node: Colormap58067 -Node: Rendering67963 -Node: Images75543 -Node: Event75689 -Node: Indexes90176 -Node: Procedure and Macro Index90332 -Node: Variable Index95784 -Node: Concept Index99237 +Node: Top1054 +Node: XlibScm2138 +Node: Display and Screens4932 +Node: Drawables11974 +Node: Windows and Pixmaps12239 +Node: Window Attributes19341 +Node: Window Properties and Visibility35346 +Node: Graphics Context39818 +Node: Cursor55558 +Node: Colormap58069 +Node: Rendering67964 +Node: Images75544 +Node: Event75690 +Node: Indexes90177 +Node: Procedure and Macro Index90333 +Node: Variable Index95785 +Node: Concept Index99238 End Tag Table diff --git a/Xlibscm.texi b/Xlibscm.texi index a9d82fb..71e22ef 100644 --- a/Xlibscm.texi +++ b/Xlibscm.texi @@ -1548,7 +1548,7 @@ vector of 3 nonnegative integers. If @var{ncolors} colors, @var{nreds} reds, @var{ngreens} greens, and @var{nblues} blues are requested, @var{ncolors} pixels are returned; and the masks have @var{nreds}, @var{ngreens}, and @var{nblues} bits set to 1, respectively. If -@var{contiguous?} is non-false, each mask will have a contiguous set of +@var{contiguous?} is non-false, each mask will have a contiguous set of bits set to 1. No mask will have any bits set to 1 in common with any other mask or with any of the pixels. @@ -1,5 +1,21 @@ #! /bin/sh :;exec ./scmlit -no-init-file -f $0 -e"(bi)" build "$@" +;; +;; Copyright (C) 1994-2006 Free Software Foundation, Inc. +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this software; see the file COPYING. If not, write to +;; the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA. (require 'getopt) (require 'getopt-parameters) @@ -1,19 +1,19 @@ ;; "build.scm" Build database and program -*-scheme-*- -;; Copyright (C) 1994-2004 Aubrey Jaffer. +;; Copyright (C) 1994-2006 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2 of the License, or (at -;; your option) any later version. +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. ;; -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;; along with this software; see the file COPYING. If not, write to +;; the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA. (require 'parameters) (require 'databases) @@ -124,6 +124,7 @@ ("split.scm" Scheme test "example use of crs.c. Input, output, and diagnostic output directed to separate windows.") ("edline.c" c-source linkable "Gnu readline input editing (get ftp.sys.toronto.edu:/pub/rc/editline.shar).") ("Iedline.scm" Scheme optional "Gnu readline input editing.") + ("bytenumb.c" c-source linkable "Byte-number conversions.") ("differ.c" c-source linkable "Linear-space O(PN) sequence comparison.") ("Idiffer.scm" Scheme optional "Linear-space O(PN) sequence comparison.") ("record.c" c-source linkable "proposed `Record' user definable datatypes.") @@ -375,6 +376,11 @@ 'differ '((c-file "differ.c") (compiled-init "init_differ"))) +#;Byte/number conversions +(define-build-feature + 'byte-number + '((c-file "bytenumb.c") (compiled-init "init_bytenumb"))) + #;Microsoft Windows executable. (define-build-feature 'windows @@ -425,10 +431,10 @@ #;WB database with relational wrapper. (define-build-feature 'wb - '((c-file "../wb/blink.c" "../wb/blkio.c" "../wb/del.c" "../wb/ent.c" - "../wb/handle.c" "../wb/prev.c" "../wb/scan.c" "../wb/stats.c" - "../wb/wbsys.c" "../wb/db.c") - (scm-srcdir "../scm/") + '((c-file "../wb/blink.c" "../wb/blkio.c" "../wb/del.c" "../wb/ents.c" + "../wb/handle.c" "../wb/prev.c" "../wb/scan.c" "../wb/segs.c" + "../wb/stats.c" "../wb/wbsys.c" "../wb/db.c") + (scm-srcdir "../scm") (compiled-init "init_db"))) ;;;; The rest is about building on specific platforms. @@ -478,17 +484,17 @@ (amiga-dice-c m68000 amiga dcc ) ;dcc (amiga-gcc m68000 amiga gcc ) ;gcc (amiga-sas m68000 amiga lc ) ;link - (atari-st-gcc m68000 atari.st gcc ) ;gcc - (atari-st-turbo-c m68000 atari.st tcc ) ;tlink + (atari-st-gcc m68000 atari-st gcc ) ;gcc + (atari-st-turbo-c m68000 atari-st tcc ) ;tlink (borland-c i8086 ms-dos bcc ) ;bcc (gnu-win32 i386 unix gcc ) ;gcc (djgpp i386 ms-dos gcc ) ;gcc - (freebsd i386 unix cc ) ;cc + (freebsd *unknown* unix cc ) ;cc (gcc *unknown* unix gcc ) ;gcc (highc i386 ms-dos hc386 ) ;bind386 (hp-ux hp-risc hp-ux cc ) ;cc (irix mips irix gcc ) ;gcc - (linux i386 linux gcc ) ;gcc + (linux *unknown* linux gcc ) ;gcc (linux-aout i386 linux gcc ) ;gcc (linux-ia64 ia64 linux gcc ) ;gcc (darwin powerpc unix cc ) ;gcc @@ -535,14 +541,13 @@ (mysql *unknown* "-I/usr/include/mysql" "-L/usr/lib/mysql -lmysqlclient" "/usr/lib/mysql/libmysqlclient.a" () ()) - (m gnu-win32 "" "" "" () ()) - (c gnu-win32 "" "" "" () ()) + (m gnu-win32 "" "" #f () ()) + (c gnu-win32 "" "" #f () ()) (dlll gnu-win32 "-DSCM_WIN_DLL" "" #f () ("posix.c" "unix.c" "socket.c")) (m linux-aout "" "-lm" "/usr/lib/libm.sa" () ()) (c linux-aout "" "-lc" "/usr/lib/libc.sa" () ()) (dlll linux-aout "-DDLD -DDLD_DYNCM" "-ldld" #f () ("findexec.c")) - (regex linux-aout "" "" "" () ()) (curses linux-aout "-I/usr/include/ncurses" "-lncurses" "/usr/lib/libncurses.a" () ()) (nostart linux-aout "" "-nostartfiles" #f ("pre-crt0.c") ()) @@ -551,7 +556,7 @@ (m linux "" "-lm" "/lib/libm.so" () ()) (c linux "" "-lc" "/lib/libc.so" () ()) (dlll linux "-DSUN_DL" "-ldl" #f () ()) - (regex linux "" "" "" () ()) + (regex linux "" "" #f () ()) (graphics linux "-I/usr/include/X11 -DX11" "-L/usr/X11R6/lib -lX11" "/usr/X11R6/lib/libX11.so" () ()) (curses linux "" "-lcurses" "/lib/libncurses.so" () ()) @@ -561,7 +566,7 @@ (m linux-ia64 "" "-lm" "/lib/libm.so" () ()) (c linux-ia64 "" "-lc" "/lib/libc.so" () ()) (dlll linux-ia64 "-DSUN_DL" "-ldl" #f () ()) - (regex linux-ia64 "" "" "" () ()) + (regex linux-ia64 "" "" #f () ()) (graphics linux-ia64 "-I/usr/include/X11 -DX11" "-L/usr/X11R6/lib -lX11" "/usr/X11R6/lib/libX11.so" () ()) (curses linux-ia64 "" "-lcurses" "/lib/libncurses.so" () ()) @@ -1002,15 +1007,6 @@ ; (batch:rebuild-catalog parms) ; (string-append oname ".sl")))) -(defcommand compile-c-files linux-aout - (lambda (files parms) - (and (batch:try-chopped-command parms - "gcc" "-c" - (include-spec "-I" parms) - (c-includes parms) - (c-flags parms) - files) - (truncate-up-to (map c->o files) #\/)))) (defcommand compile-dll-c-files linux-aout (lambda (files parms) (and (batch:try-chopped-command @@ -1028,21 +1024,21 @@ (defcommand compile-c-files linux (lambda (files parms) - (and (batch:try-chopped-command - parms - "gcc" - ;;(if (member "-g" (c-includes parms)) "" "-O2") - "-c" (c-includes parms) - (include-spec "-I" parms) - (c-flags parms) - files) + (and (batch:try-chopped-command parms + "gcc" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (truncate-up-to (map c->o files) #\/)))) (defcommand compile-dll-c-files linux (lambda (files parms) (and - (batch:try-chopped-command - parms "gcc" "-fpic" "-c" - (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) + (batch:try-chopped-command parms "gcc" "-fpic" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let* ((platform (car (parameter-list-ref parms 'platform))) (fnames (truncate-up-to (map c-> files) #\/)) (fname.so (string-append (car fnames) ".so")) @@ -1061,8 +1057,7 @@ result)))) (defcommand make-dll-archive linux (lambda (oname objects libs parms) - (let ((platform (car (parameter-list-ref - parms 'platform)))) + (let ((platform (car (parameter-list-ref parms 'platform)))) (and (batch:try-command parms "gcc" "-shared" "-o" @@ -1274,8 +1269,7 @@ (list (string-append (car fnames) ".so"))))))) (defcommand make-dll-archive osf1 (lambda (oname objects libs parms) - (let ((platform (car (parameter-list-ref - parms 'platform)))) + (let ((platform (car (parameter-list-ref parms 'platform)))) (and (batch:try-command parms "cc" "-shared" "-o" @@ -1874,10 +1868,10 @@ (define (look platform) (let ((ans (getter thing platform))) (cond (ans ans) - ((eq? '*unknown* platform) - ;;(slib:warn "Couldn't find: " plat thing) - '()) - (else (look '*unknown*))))) + (else (let ((os (platform->os platform))) + (cond ((eq? os platform) (look '*unknown*)) + ((eq? platform '*unknown*) '()) + (else (look os)))))))) (look plat))) (define (build:command rdb) @@ -2108,7 +2102,8 @@ (define build:initializer (lambda (rdb) - (set! build:c-libraries (open-table rdb 'c-libraries)) + (set! build:c-libraries + (open-table rdb 'c-libraries)) (set! build:lib-cc-flag (make-defaulting-platform-lookup (build:c-libraries 'get 'compiler-flags))) @@ -2121,8 +2116,8 @@ (set! build:c-suppress (make-defaulting-platform-lookup (build:c-libraries 'get 'suppress-files))) - (set! platform->os ((open-table rdb 'platform) - 'get 'operating-system)) + (set! platform->os + ((open-table rdb 'platform) 'get 'operating-system)) (set! plan-command (let ((lookup (make-defaulting-platform-lookup ((open-table rdb 'compile-commands) @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ SCM scm_make_bytes(k, n) dst = UCHARS(res); if (!UNBNDP(n)) { ASRTER(INUMP(n) && 0 <= n && n <= MAKINUM(255), n, ARG2, s_make_bytes); - for(i--;i >= 0;i--) dst[i] = INUM(n); + for (i--;i >= 0;i--) dst[i] = INUM(n); } return res; } @@ -71,7 +71,7 @@ SCM scm_bytes(ints) ASRTER(i >= 0, ints, ARG1, s_bytes); res = makstr(i); data = UCHARS(res); - for(;NNULLP(ints);ints = CDR(ints)) { + for (;NNULLP(ints);ints = CDR(ints)) { int n = INUM(CAR(ints)); ASRTER(INUMP(CAR(ints)) && 0 <= n && n <= 255, ints, ARG1, s_bytes); *data++ = n; @@ -107,7 +107,7 @@ SCM scm_bytes2list(str) unsigned char *src; ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_bytes2list); src = UCHARS(str); - for(i = LENGTH(str)-1;i >= 0;i--) res = cons((SCM)MAKINUM(src[i]), res); + for (i = LENGTH(str)-1;i >= 0;i--) res = cons((SCM)MAKINUM(src[i]), res); return res; } static char s_bt_reverse[] = "bytes-reverse!"; @@ -119,7 +119,7 @@ SCM scm_bytes_reverse(str) ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_bt_reverse); len = LENGTH(str); dst = CHARS(str); - for(k = (len - 1)/2;k >= 0;k--) { + for (k = (len - 1)/2;k >= 0;k--) { int tmp = dst[k]; dst[k] = dst[len - k - 1]; dst[len - k - 1] = tmp; diff --git a/bytenumb.c b/bytenumb.c new file mode 100644 index 0000000..ba7e584 --- /dev/null +++ b/bytenumb.c @@ -0,0 +1,469 @@ +/* "bytenumb.scm" Byte integer and IEEE floating-point conversions. */ +/* Copyright (C) 2007 Aubrey Jaffer */ +/* */ +/* Permission to copy this software, to modify it, to redistribute it, */ +/* to distribute modified versions, and to use it for any purpose is */ +/* granted, subject to the following restrictions and understandings. */ +/* */ +/* 1. Any copy made of this software must include this copyright notice */ +/* in full. */ +/* */ +/* 2. I have made no warranty or representation that the operation of */ +/* this software will be error-free, and I am under no obligation to */ +/* provide any services, by way of maintenance, update, or otherwise. */ +/* */ +/* 3. In conjunction with products arising from the use of this */ +/* material, there shall be no use of my name in any advertising, */ +/* promotional, or sales literature without prior written consent in */ +/* each case. */ + +/* For documentation see: */ +/* http://cvs.savannah.gnu.org/viewcvs/slib/slib/bytenumb.scm?view=markup */ + +#include <stdlib.h> +#include <math.h> + +#include "scm.h" + +int get_bytes_length(obj) + SCM obj; +{ + array_dim *s; + if (IMP(obj)) return -1; + switch (TYP7(obj)) { + case tc7_string: + case tc7_VfixN8: + case tc7_VfixZ8: + return LENGTH(obj); + case tc7_smob: + if (!ARRAYP(obj)) return -1; + if (1 != ARRAY_NDIM(obj)) return -1; + s = ARRAY_DIMS(obj); + if (1 != s[0].inc) return -1; + return s[0].ubnd - s[0].lbnd; + default: return -1; + } +} + +static char s_wrong_length[] = "wrong length"; +static SCM list_of_0; + +char * get_bytes(obj, minlen, s_name) + SCM obj; + int minlen; + const char *s_name; +{ + ASRTER(NIMP(obj) && (TYP7(obj)==tc7_string || + TYP7(obj)==tc7_VfixN8 || + TYP7(obj)==tc7_VfixZ8), + obj, ARG1, s_name); + { + int byvlen = get_bytes_length(obj); + ASRTER(byvlen >= minlen, obj, s_wrong_length, s_name); + return (char*)scm_addr(cons(obj, list_of_0), s_name); + } +} + +static char s_bytes_to_integer[] = "bytes->integer"; +SCM scm_bytes_to_integer(sbyts, sn) + SCM sbyts; + SCM sn; +{ + long n = INUM(sn); + if (!(n)) return INUM0; + { + int cnt = abs(n); + char *byts = get_bytes(sbyts, cnt, s_bytes_to_integer); + int iu = 0, id = cnt - sizeof(BIGDIG); + sizet ndigs = (cnt + sizeof(BIGDIG) - 1) / sizeof(BIGDIG); + int negp = (0x80 & byts[0]) && (0 > n); + SCM retval = mkbig(ndigs, negp); + BIGDIG *digs = BDIGITS(retval), carry = 1; + if (negp) + for (; iu < ndigs; iu++) { + int j = 0; + unsigned long dig = 0; + for (; j < sizeof(BIGDIG); j++) { + dig = (dig<<8) + + (0xFF ^ ((id + j >= 0) ? (((unsigned char *)byts)[id + j]) : 255)); + /* printf("byts[%d + %d] = %lx\n", id, j, 0xFF & dig); */ + } + dig = dig + carry; + digs[iu] = dig; + carry = dig >> (8 * sizeof(BIGDIG)); + /* printf("id = %d; iu = %d; dig = %04lx\n", id, iu, dig); */ + id = id - sizeof(BIGDIG); + } else + for (; iu < ndigs; iu++) { + int j = 0; + BIGDIG dig = 0; + for (; j < sizeof(BIGDIG); j++) { + dig = (dig<<8) + + ((id + j >= 0) ? (((unsigned char *)byts)[id + j]) : 0); + } + digs[iu] = dig; + /* printf("id = %d; iu = %d; dig = %04x\n", id, iu, dig); */ + id = id - sizeof(BIGDIG); + } + return normbig(retval); + } +} + +static char s_integer_to_bytes[] = "integer->bytes"; +SCM scm_integer_to_bytes(sn, slen) + SCM sn; + SCM slen; +{ + ASRTER(INUMP(slen), slen, ARG2, s_integer_to_bytes); + { + int len = INUM(slen); + SCM sbyts = make_string(scm_iabs(slen), MAKICHR(0)); + char *byts = CHARS(sbyts); + if (INUMP(sn)) { + int idx = -1 + (abs(len)); + long n = num2long(sn, (char *)ARG1, s_integer_to_bytes); + if ((0 > n) && (0 > len)) { + long res = -1 - n; + while (!(0 > idx)) { + byts[idx--] = 0xFF ^ (res % 0x100); + res = res>>8; + } + } + else { + unsigned long res = n; + while (!(0 > idx)) { + byts[idx--] = res % 0x100; + res = res>>8; + } + } + } else { + ASRTER(NIMP(sn) && BIGP(sn), sn, ARG1, s_integer_to_bytes); + { + BIGDIG *digs = BDIGITS(sn), borrow = 1; + sizet ndigs = NUMDIGS(sn); + int iu = 0, id = abs(len) - 1; + unsigned long dig; + if ((0 > len) && (TYP16(sn)==tc16_bigneg)) + for (; 0 <= id ; iu++) { + sizet j = sizeof(BIGDIG); + dig = (iu < ndigs) ? digs[iu] : 0; + dig = dig ^ ((1 << (8 * sizeof(BIGDIG))) - 1); + /* printf("j = %d; id = %d; iu = %d; dig = %04x; borrow = %d\n", j, id, iu, dig, borrow); */ + for (; 0 < j-- && 0 <= id;) { + /* printf("byts[%d] = %02x\n", id, 0xFF & dig); */ + int dg = (0xFF & dig) + borrow; + borrow = dg >> 8; + ((unsigned char *)byts)[id--] = dg; + dig = (dig)>>8; + } + } + else + for (; 0 <= id ; iu++) { + BIGDIG dig = (iu < ndigs) ? digs[iu] : 0; + sizet j = sizeof(BIGDIG); + /* printf("j = %d; id = %d; iu = %d; dig = %04x\n", j, id, iu, dig); */ + for (; 0 < j-- && 0 <= id;) { + /* printf("byts[%d] = %02x\n", id, 0xFF & dig); */ + ((unsigned char *)byts)[id--] = 0xFF & dig; + dig = (dig>>8); + } + } + } + } + return sbyts; + } +} + +static char s_bytes_to_ieee_float[] = "bytes->ieee-float"; +SCM scm_bytes_to_ieee_float(sbyts) + SCM sbyts; +{ + char *byts = get_bytes(sbyts, 4, s_bytes_to_ieee_float); + int len = LENGTH(sbyts); + int s = (1<<(7)) & ((((unsigned char*)(byts))[0])); + int e = ((0x7f&((((unsigned char*)(byts))[0])))<<1) + + ((0x80&((((unsigned char*)(byts))[1])))>>7); + float f = (((unsigned char*)(byts))[ -1 + (len)]); + int idx = -2 + (len); + while (!((idx)<=1)) { + { + int T_idx = -1 + (idx); + f = ((((unsigned char*)(byts))[idx])) + ((f) / 0x100); + idx = T_idx; + } + } + f = ((0x7f&((((unsigned char*)(byts))[1]))) + ((f) / 0x100)) / 0x80; + if ((0<(e)) + && ((e)<0xff)) + return makdbl(ldexpf((s ? -1 : 1) * (1 + (f)), (e) - 0x7f), 0.0); + else if (!(e)) + if (!(f)) return flo0; + else return makdbl(ldexpf((s ? -1 : 1) * (f), -126), 0.0); + else if (f) + return scm_narn; + else return makdbl((s ? -(1.0) : 1.0) / 0.0, 0.0); +} + +static char s_bytes_to_ieee_double[] = "bytes->ieee-double"; +SCM scm_bytes_to_ieee_double(sbyts) + SCM sbyts; +{ + char *byts = get_bytes(sbyts, 8, s_bytes_to_ieee_double); + int len = LENGTH(sbyts); + int s = (1<<(7)) & ((((unsigned char*)(byts))[0])); + int e = ((0x7f&((((unsigned char*)(byts))[0])))<<4) + + ((0xf0&((((unsigned char*)(byts))[1])))>>4); + double f = (((unsigned char*)(byts))[ -1 + (len)]); + int idx = -2 + (len); + while (!((idx)<=1)) { + { + int T_idx = -1 + (idx); + f = ((((unsigned char*)(byts))[idx])) + ((f) / 0x100); + idx = T_idx; + } + } + f = ((0xf&((((unsigned char*)(byts))[1]))) + ((f) / 0x100)) / 0x10; + if ((0<(e)) + && ((e)<0x7ff)) + return makdbl(ldexp((s ? -1 : 1) * (1 + (f)), (e) - 0x3ff), 0.0); + else if (!(e)) + if (!(f)) return flo0; + else return makdbl(ldexp((s ? -1 : 1) * (f), -1022), 0.0); + else if (f) + return scm_narn; + else return makdbl((s ? -(1.0) : 1.0) / 0.0, 0.0); +} + +static char s_ieee_float_to_bytes[] = "ieee-float->bytes"; +SCM scm_ieee_float_to_bytes(in_flt) + SCM in_flt; +{ + double dbl = num2dbl(in_flt, (char *)ARG1, s_ieee_float_to_bytes); + float flt = (float) dbl; + SCM sbyts = make_string(MAKINUM(4), MAKICHR(0)); + char *byts = CHARS(sbyts); + int s = flt < 0.0; + int scl = 0x7f; + flt = fabs(flt); + if (0.0==flt) { + if (s) + byts[0] = 0x80; + return sbyts; + } + else if (flt != flt) { + byts[0] = 0x7f; + byts[1] = 0xc0; + return sbyts; + } + else goto L_scale; + L_out: + { + float T_flt = 0x80 * (flt); + int val = (int)(floor(0x80 * (flt))); + int idx = 1; + float flt = T_flt; + while (!((idx) > 3)) { + byts[idx] = val; + { + float T_flt = 0x100 * ((flt) - (val)); + int T_val = (int)(floor(0x100 * ((flt) - (val)))); + idx = 1 + (idx); + flt = T_flt; + val = T_val; + } + } + byts[1] = (0x80 & (scl<<7)) | (0x7f & (((unsigned char*)(byts))[1])); + byts[0] = (s ? 0x80 : 0) + ((scl)>>1); + return sbyts; + } + L_scale: + if (!(scl)) { + flt = (flt)/2; + goto L_out; + } + else if ((flt)>=0x10) { + float flt16 = (flt) / 0x10; + if ((flt16)==(flt)) { + byts[0] = s ? 0xff : 0x7f; + byts[1] = 0x80; + return sbyts; + } + else { + flt = flt16; + scl = (scl) + 4; + goto L_scale; + } + } + else if ((flt) >= 2) { + flt = (flt) / 2; + scl = (scl) + 1; + goto L_scale; + } + else if (((scl) >= 4) && ((0x10 * (flt))<1)) { + flt = (flt) * 0x10; + scl = (scl)+ -4; + goto L_scale; + } + else if ((flt)<1) { + flt = (flt) * 2; + scl = (scl) + -1; + goto L_scale; + } + else { + flt = -1+(flt); + goto L_out; + } +} + +static char s_ieee_double_to_bytes[] = "ieee-double->bytes"; +SCM scm_ieee_double_to_bytes(in_flt) + SCM in_flt; +{ + double flt = num2dbl(in_flt, (char *)ARG1, s_ieee_double_to_bytes); + SCM sbyts = make_string(MAKINUM(8), MAKICHR(0)); + char *byts = CHARS(sbyts); + int s = flt < 0.0; + int scl = 0x3ff; + flt = fabs(flt); + if (0.0==flt) { + if (s) + byts[0] = 0x80; + return sbyts; + } + else if (flt != flt) { + byts[0] = 0x7f; + byts[1] = 0xf8; + return sbyts; + } + else goto L_scale; + L_out: + { + double T_flt = 0x10 * (flt); + int val = (int)(floor(0x10 * (flt))); + int idx = 1; + double flt = T_flt; + while (!((idx) > 7)) { + byts[idx] = val; + { + double T_flt = 0x100 * (flt - val); + int T_val = (int)floor(0x100 * (flt - val)); + idx = 1 + (idx); + flt = T_flt; + val = T_val; + } + } + byts[1] = (0xf0 & (scl<<4)) | (0x0f & (((unsigned char*)(byts))[1])); + byts[0] = (s ? 0x80 : 0) + ((scl)>>4); + return sbyts; + } + L_scale: + if (!(scl)) { + flt = (flt) / 2; + goto L_out; + } + else if ((flt) >= 0x10) { + double flt16 = (flt) / 0x10; + if ((flt16)==(flt)) { + byts[0] = s ? 0xff : 0x7f; + byts[1] = 0xf0; + return sbyts; + } + else { + flt = flt16; + scl = (scl) + 4; + goto L_scale; + } + } + else if ((flt) >= 2) { + flt = (flt) / 2; + scl = (scl) + 1; + goto L_scale; + } + else if (((scl) >= 4) && ((0x10 * flt) < 1)) { + flt = (flt) * 0x10; + scl = (scl) + -4; + goto L_scale; + } + else if ((flt) < 1) { + flt = (flt) * 2; + scl = (scl) + -1; + goto L_scale; + } + else { + flt = -1 + (flt); + goto L_out; + } +} + +static char s_integer_byte_collate_M[] = "integer-byte-collate!"; +SCM scm_integer_byte_collate_M(byte_vector) + SCM byte_vector; +{ + char* bv = get_bytes(byte_vector, 1, s_integer_byte_collate_M); + bv[0] = 0x80^(bv[0]); + return byte_vector; +} + +static char s_ieee_byte_collate_M[] = "ieee-byte-collate!"; +SCM scm_ieee_byte_collate_M(byte_vector) + SCM byte_vector; +{ + char* byv = get_bytes(byte_vector, 4, s_ieee_byte_collate_M); + int byvlen = get_bytes_length(byte_vector); + if (0x80&(byv[0])) { + int idx = -1 + byvlen; + while (!(0 > (idx))) { + byv[idx] = 0xff^(byv[idx]); + idx = -1+(idx); + } + } + else + byv[0] = 0x80^(byv[0]); + return byte_vector; +} + +static char s_ieee_byte_decollate_M[] = "ieee-byte-decollate!"; +SCM scm_ieee_byte_decollate_M(byte_vector) + SCM byte_vector; +{ + char* byv = get_bytes(byte_vector, 4, s_ieee_byte_collate_M); + int byvlen = get_bytes_length(byte_vector); + if (!(0x80&(byv[0]))) { + int idx = -1 + byvlen; + while (!(0 > (idx))) { + byv[idx] = 0xff^(byv[idx]); + idx = -1+(idx); + } + } + else + byv[0] = 0x80^(byv[0]); + return byte_vector; +} + +static iproc subr1s[] = { + {s_bytes_to_ieee_float, scm_bytes_to_ieee_float}, + {s_bytes_to_ieee_double, scm_bytes_to_ieee_double}, + {s_ieee_float_to_bytes, scm_ieee_float_to_bytes}, + {s_ieee_double_to_bytes, scm_ieee_double_to_bytes}, + {s_integer_byte_collate_M, scm_integer_byte_collate_M}, + {s_ieee_byte_collate_M, scm_ieee_byte_collate_M}, + {s_ieee_byte_decollate_M, scm_ieee_byte_decollate_M}, + {0, 0}}; + +void init_bytenumb() +{ + list_of_0 = cons(INUM0, EOL); + scm_gc_protect(list_of_0); + make_subr(s_bytes_to_integer, tc7_subr_2, scm_bytes_to_integer); + make_subr(s_integer_to_bytes, tc7_subr_2, scm_integer_to_bytes); + init_iprocs(subr1s, tc7_subr_1); + scm_ldstr("\n\ +(define (integer-byte-collate byte-vector)\n\ + (integer-byte-collate! (bytes-copy byte-vector)))\n\ +(define (ieee-byte-collate byte-vector)\n\ + (ieee-byte-collate! (bytes-copy byte-vector)))\n\ +(define (ieee-byte-decollate byte-vector)\n\ + (ieee-byte-decollate! (bytes-copy byte-vector)))\n\ +"); + /* add_feature("byte-number"); */ +} @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +85,7 @@ typedef long STACKITEM; # define STACK_GROWS_UP #endif #ifdef __hppa__ -# define STACK_GROWS_UP +# define STACK_GROW_UP #endif /* James Clark came up with this neat one instruction fix for diff --git a/debian/changelog b/debian/changelog index 7c050e8..1566562 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,27 @@ -scm (5e3-6.1) unstable; urgency=low +scm (5e4-1) unstable; urgency=low - * Non-maintainer upload. - * Split doc-base file into two files, add missing 'Index' fields for 'info' - sections (closes: #369576). - Thanks to Robert Luberda for the patch. - * Remove from rules/postinst/postrm any manually doc-base handling code, - since dh_installdocs supports doc-base on its own. - Thanks to Robert Luberda for the patch. + * New upstream release. + * debian/control: Require at least version 3a5 of slib. + + * debian/postrm: New file to remove /usr/lib/scm/implcat and + /usr/lib/scm/slibcat upon purge. (Closes: #455124). Thanks to Kumar + Appaiah for the fix. + + * debian/control (Architecture): Add armel and armeb. (Closes: #408792). + + * debian/rules (install): Don't use -s when installing. dh_strip should + be sufficient, and this should make the nostrip build option work. + (Closes: #438004). - -- Neil Williams <codehelp@debian.org> Sun, 15 Jul 2007 21:14:17 +0100 + * continue.h: Repeat change from 5e1-2. + + * xgen.scm: Repeat change from 5e2-4. + + * scm.1: Repeat change from 5e2-4. + + * build.scm: Repeat change from 5e3-5. + + -- Thomas Bushnell, BSG <tb@debian.org> Fri, 28 Dec 2007 15:56:00 -0800 scm (5e3-6) unstable; urgency=medium diff --git a/debian/control b/debian/control index dff94c3..cca40a5 100644 --- a/debian/control +++ b/debian/control @@ -3,13 +3,13 @@ Section: interpreters Priority: optional Maintainer: Thomas Bushnell, BSG <tb@debian.org> Standards-Version: 3.7.2 -Build-Depends: slib (>> 3a4), libncurses5-dev, libreadline5-dev, texi2html, texinfo, libx11-dev, debhelper (>= 5) +Build-Depends: slib (>> 3a5), libncurses5-dev, libreadline5-dev, texi2html, texinfo, libx11-dev, debhelper (>= 5) Package: scm -Architecture: alpha amd64 arm hppa i386 hurd-i386 m68k mips mipsel powerpc ppc64 sparc ia64 +Architecture: alpha amd64 arm hppa i386 hurd-i386 m68k mips mipsel powerpc ppc64 sparc ia64 armel armeb Section: interpreters Priority: optional -Depends: slib (>> 3a4), ${shlibs:Depends} +Depends: slib (>> 3a5), ${shlibs:Depends} Description: A Scheme language interpreter Scm conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification. diff --git a/debian/doc-base b/debian/doc-base index d883c0d..c3c3a7e 100644 --- a/debian/doc-base +++ b/debian/doc-base @@ -5,10 +5,15 @@ Abstract: This manual describes the scheme interpreter scm. Section: Apps/Programming Format: info -Index: /usr/share/info/scm.info.gz Files: /usr/share/info/scm.info.gz +Format: info +Files: /usr/share/info/Xlibscm.info.gz + Format: HTML Index: /usr/share/doc/scm/scm.html Files: /usr/share/doc/scm/scm.html +Format: HTML +Index: /usr/share/doc/scm/Xlibscm.html +Files: /usr/share/doc/scm/Xlibscm.html diff --git a/debian/doc-base.scm-xlib b/debian/doc-base.scm-xlib deleted file mode 100644 index c73ba3a..0000000 --- a/debian/doc-base.scm-xlib +++ /dev/null @@ -1,13 +0,0 @@ -Document: scm-xlib -Title: X Interface for SCM scheme interpreter -Author: Aubrey Jaffer -Abstract: This manual describes the X Interface for scheme interpreter SCM. -Section: Apps/Programming - -Format: info -Index: /usr/share/info/Xlibscm.info.gz -Files: /usr/share/info/Xlibscm.info.gz - -Format: HTML -Index: /usr/share/doc/scm/Xlibscm.html -Files: /usr/share/doc/scm/Xlibscm.html diff --git a/debian/postinst b/debian/postinst index d93fe02..aa235c4 100644 --- a/debian/postinst +++ b/debian/postinst @@ -11,6 +11,12 @@ install-info --quiet --section "The Algorithmic Language Scheme" \ --description="SCM Language X Interface" \ /usr/share/info/Xlibscm.info.gz +# doc base support +if [ "$1" = configure ]; then + if test -x /usr/sbin/install-docs >/dev/null 2>&1; then + /usr/sbin/install-docs -i /usr/share/doc-base/scm + fi +fi rm -f /usr/lib/scm/slibcat /usr/bin/scm -c "(require 'new-catalog)" diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..70022ef --- /dev/null +++ b/debian/postrm @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = purge ] && [ -e /usr/lib/scm/implcat ] && [ -e /usr/lib/scm/slibcat ]; then + rm -f /usr/lib/scm/implcat /usr/lib/scm/slibcat +fi + +#DEBHELPER# diff --git a/debian/prerm b/debian/prerm index c2c654c..37960c3 100644 --- a/debian/prerm +++ b/debian/prerm @@ -6,6 +6,12 @@ if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/scm ]; then rm -f /usr/doc/scm fi +# doc base support +if [ "$1" = remove -o "$1" = upgrade ]; then + if test -x /usr/sbin/install-docs >/dev/null 2>&1; then + /usr/sbin/install-docs -r scm + fi +fi install-info --quiet --remove /usr/share/info/scm.info.gz diff --git a/debian/rules b/debian/rules index 4074fc5..37527c0 100755 --- a/debian/rules +++ b/debian/rules @@ -119,7 +119,7 @@ install: build # binaries $(INSTALL_DIR) debian/scm/usr/bin - $(INSTALL_PROGRAM) -s scm debian/scm/usr/bin + $(INSTALL_PROGRAM) scm debian/scm/usr/bin # library $(INSTALL_DIR) debian/scm/usr/lib/scm @@ -148,6 +148,9 @@ install: build $(INSTALL_DATA) Xlibscm.html debian/scm/usr/share/doc/scm $(INSTALL_DATA) debian/copyright debian/scm/usr/share/doc/scm + $(INSTALL_DIR) debian/scm/usr/share/doc-base + $(INSTALL_DATA) debian/doc-base debian/scm/usr/share/doc-base/scm + # examples $(INSTALL_DIR) debian/scm/usr/share/doc/scm/examples $(INSTALL_DATA) r4rstest.scm debian/scm/usr/share/doc/scm/examples @@ -135,7 +135,7 @@ static SCM prinhead(x, port, writing) int writing; { lputc('(', port); - iprin1(CAR(x), port, writing); + scm_iprin1(CAR(x), port, writing); lputc(' ', port); return CDR(x); } @@ -148,7 +148,7 @@ static void prinbindings(names, inits, init_env, lputc('(', port); while (NIMP(names) && NIMP(inits)) { lputc('(', port); - iprin1(CAR(names), port, writing); + scm_iprin1(CAR(names), port, writing); lputc(' ', port); scm_princode(CAR(inits), init_env, port, writing); if (NIMP(steps)) { @@ -170,7 +170,7 @@ void scm_princode(code, env, port, writing) { SCM oenv = env, name, init, bdgs, x = code; if (UNBNDP(env)) { - iprin1(code, port, writing); + scm_iprin1(code, port, writing); return; } tail: @@ -180,19 +180,19 @@ void scm_princode(code, env, port, writing) name = scm_env_rlookup(x, env, "princode"); if (FALSEP(name)) goto gencase; lputs("#@", port); - iprin1(name, port, writing); + scm_iprin1(name, port, writing); return; } else goto gencase; } if (SCM_GLOCP(x)) { - iprin1(x, port, writing); + scm_iprin1(x, port, writing); return; } switch (TYP7(x)) { default: gencase: - iprin1(x, port, writing); + scm_iprin1(x, port, writing); return; gencode: case tcs_cons_gloc: @@ -209,7 +209,7 @@ void scm_princode(code, env, port, writing) for (; NNULLP(x); x = CDR(x)) { if (IMP(x) || NECONSP(x)) { lputs(" . ", port); - iprin1(x, port, writing); + scm_iprin1(x, port, writing); break; } lputc(' ', port); @@ -222,19 +222,19 @@ void scm_princode(code, env, port, writing) env = CAR(x); bdgs = SCM_ENV_FORMALS(env); if (IMP(bdgs) || NECONSP(bdgs)) - iprin1(bdgs, port, writing); + scm_iprin1(bdgs, port, writing); else { lputc('(', port); while (!0) { if (NECONSP(bdgs)) break; - iprin1(CAR(bdgs), port, writing); + scm_iprin1(CAR(bdgs), port, writing); if (NIMP(bdgs = CDR(bdgs))) lputc(' ', port); else break; } if (NIMP(bdgs)) { lputs(". ", port); - iprin1(bdgs, port, writing); + scm_iprin1(bdgs, port, writing); } lputc(')', port); } @@ -259,7 +259,7 @@ void scm_princode(code, env, port, writing) bdgs = CDR(bdgs); env = CAR(bdgs); lputc('(', port); - iprin1(SCM_ENV_FORMALS(env), port, writing); + scm_iprin1(SCM_ENV_FORMALS(env), port, writing); lputc(' ', port); scm_princode(init, oenv, port, writing); oenv = env; @@ -320,7 +320,7 @@ void scm_princlosure(proc, port, writing) env = CAR(proc); #ifdef CAUTIOUS if (NIMP(env=scm_env_getprop(SCM_ENV_PROCNAME, env))) { - iprin1(CAR(env), port, 1); + scm_iprin1(CAR(env), port, 1); lputc(' ', port); env = CDR(env); if (NIMP(env) && SCM_LINUMP(CAR(env))) @@ -333,9 +333,9 @@ void scm_princlosure(proc, port, writing) scm_line_msg(CAR(env), linum, port); #endif env = CAR(proc); - iprin1(SCM_ENV_FORMALS(env), port, writing); + scm_iprin1(SCM_ENV_FORMALS(env), port, writing); if (writing) { - for(proc = CDR(proc); NIMP(proc); proc = CDR(proc)) { + for (proc = CDR(proc); NIMP(proc); proc = CDR(proc)) { lputc(' ', port); scm_princode(CAR(proc), env, port, writing); } @@ -451,7 +451,7 @@ SCM stacktrace1(estk, i) /* The usual C setjmp, not SCM's setjump. */ if (0==setjmp(SAFEP_JMPBUF(sys_safep))) { lputc('\n', cur_errp); - intprint((long)n, -10, sys_safep); + scm_intprint((long)n, -10, sys_safep); lputs("; ", sys_safep); scm_princode(ste, env, sys_safep, 1); } @@ -572,7 +572,7 @@ SCM scm_scope_trace(env) if (NCONSP(env)) { badenv: lputs("\n; corrupted environment ", cur_errp); - iprin1(env, cur_errp, 1); + scm_iprin1(env, cur_errp, 1); return UNSPECIFIED; } ef = CAR(env); @@ -589,19 +589,19 @@ SCM scm_scope_trace(env) default: break; case SCM_ENV_PROCNAME: lputs(" procedure ", cur_errp); - iprin1(CAR(env), cur_errp, 1); + scm_iprin1(CAR(env), cur_errp, 1); break; } #endif } else if (NIMP(ef) && CONSP(ef) && NIMP(CAR(ef)) && CONSP(CAR(ef))) { lputs("\n; ", cur_errp); - iprin1(CAR(ef), cur_errp, 1); + scm_iprin1(CAR(ef), cur_errp, 1); lputs(" syntax bindings", cur_errp); } else { lputs("\n; ", cur_errp); - iprin1(ef, cur_errp, 1); + scm_iprin1(ef, cur_errp, 1); } } #ifdef CAUTIOUS @@ -609,7 +609,7 @@ SCM scm_scope_trace(env) lputs("\n; defined by ", cur_errp); if (NIMP(file) && STRINGP(file)) lputs("load: ", cur_errp); - iprin1(file, cur_errp, 1); + scm_iprin1(file, cur_errp, 1); lputc('\n', cur_errp); } #endif @@ -60,7 +60,7 @@ void listundefs() int i; char **undefs = dld_list_undefined_sym(); puts(" undefs:"); - for(i = dld_undefined_sym_count;i--;) { + for (i = dld_undefined_sym_count;i--;) { putc('"', stdout); fputs(undefs[i], stdout); puts("\""); @@ -181,7 +181,7 @@ int prinshl(exp, port, writing) SCM exp; SCM port; int writing; { lputs("#<shl ", port); - intprint(CDR(exp), -16, port); + scm_intprint(CDR(exp), -16, port); lputc('>', port); return 1; } @@ -379,7 +379,7 @@ int prinshl(exp, port, writing) SCM exp; SCM port; int writing; { lputs("#<shl ", port); - intprint(CDR(exp), -16, port); + scm_intprint(CDR(exp), -16, port); lputc('>', port); return 1; } @@ -405,7 +405,7 @@ SCM l_dyn_link(fname) lputs(s_link, cur_errp); lputs(": ", cur_errp); lputs(dlr, cur_errp); - newline(cur_errp); + scm_newline(cur_errp); }} return BOOL_F; } @@ -432,7 +432,7 @@ SCM l_dyn_call(symb, shl) lputs(s_call, cur_errp); lputs(": ", cur_errp); lputs(dlr, cur_errp); - newline(cur_errp); + scm_newline(cur_errp); } return BOOL_F; } @@ -448,7 +448,7 @@ SCM l_dyn_main_call(symb, shl, args) { int i; int (*func)P((int argc, const char **argv)) = 0; - const char **argv; + char **argv; /* SCM oloadpath = *loc_loadpath; */ ASRTER(NIMP(symb) && STRINGP(symb), symb, ARG1, s_main_call); ASRTER(NIMP(shl) && CAR(shl)==tc16_shl, shl, ARG2, s_main_call); @@ -461,7 +461,7 @@ SCM l_dyn_main_call(symb, shl, args) lputs(s_main_call, cur_errp); lputs(": ", cur_errp); lputs(dlr, cur_errp); - newline(cur_errp); + scm_newline(cur_errp); } return BOOL_F; } @@ -529,7 +529,7 @@ int prinshl(exp, port, writing) SCM exp; SCM port; int writing; { lputs("#<shl ", port); - intprint(CDR(exp), 16, port); + scm_intprint(CDR(exp), 16, port); lputc('>', port); return 1; } @@ -673,7 +673,7 @@ int prinshl(exp, port, writing) SCM exp; SCM port; int writing; { lputs("#<shl ", port); - intprint(CDR(exp), 16, port); + scm_intprint(CDR(exp), 16, port); lputc('>', port); return 1; } @@ -356,7 +356,7 @@ static void debug_env_warn(fnam, line, what) { lputs(fnam, cur_errp); lputc(':', cur_errp); - intprint(line+0L, 10, cur_errp); + scm_intprint(line+0L, 10, cur_errp); lputs(": unprotected ", cur_errp); lputs(what, cur_errp); lputs(" of ecache value\n", cur_errp); @@ -415,7 +415,7 @@ SCM *ilookup(iloc) /* shortcut the two most common cases. */ if (iloc==MAKILOC(0, 0)) return &CAR(CAR(er)); if (iloc==MAKILOC(0, 1)) return &CAR(CDR(CAR(er))); - for(;0 != ir;--ir) er = CDR(er); + for (;0 != ir;--ir) er = CDR(er); eloc = &CAR(er); for (ir = IDIST(iloc); 0 != ir; --ir) eloc = &CDR(*eloc); @@ -436,7 +436,7 @@ SCM *farlookup(farloc) return &CAR(CAR(er)); } er = CAR(er); - for(--ir;0 != ir;--ir) er = CDR(er); + for (--ir;0 != ir;--ir) er = CDR(er); if (IM_FARLOC_CDR==CAR(farloc)) return &CDR(er); return &CAR(CDR(er)); } @@ -813,13 +813,13 @@ static void ecache_undefs(x) SCM x; { static SCM argv[10] = {UNDEFINED, UNDEFINED, UNDEFINED, - UNDEFINED, UNDEFINED, UNDEFINED, + UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED}; int imax = sizeof(argv)/sizeof(SCM); int i = 0; - + scm_env_tmp = EOL; while NIMP(x) { if (imax==i) { @@ -1390,7 +1390,7 @@ static SCM iqq(form) long i = LENGTH(form); SCM *data = VELTS(form); tmp = EOL; - for(;--i >= 0;) tmp = cons(data[i], tmp); + for (;--i >= 0;) tmp = cons(data[i], tmp); return vector(iqq(tmp)); } if (NCONSP(form)) return form; @@ -1413,9 +1413,9 @@ static SCM m_iqq(form, depth, env, ctxt) long i = LENGTH(form); SCM *data = VELTS(form); tmp = EOL; - for(;--i >= 0;) tmp = cons(data[i], tmp); + for (;--i >= 0;) tmp = cons(data[i], tmp); tmp = m_iqq(tmp, depth, env, ctxt); - for(i = 0; i < LENGTH(form); i++) { + for (i = 0; i < LENGTH(form); i++) { data[i] = CAR(tmp); tmp = CDR(tmp); } @@ -2219,7 +2219,7 @@ static SCM ceval_1(x) EXTEND_VALENV; x = CDR(CDR(x)); while (proc = CAR(x), FALSEP(EVALCAR(proc))) { - for(proc = CAR(CDR(x));NIMP(proc);proc = CDR(proc)) { + for (proc = CAR(CDR(x));NIMP(proc);proc = CDR(proc)) { arg1 = CAR(proc); /* body */ SIDEVAL_1(arg1); } @@ -2872,7 +2872,7 @@ SCM nconc2copy(lst) #endif last = CAR(*lloc); *lloc = EOL; - for(; NIMP(last); last=CDR(last)) { + for (; NIMP(last); last=CDR(last)) { *lloc = cons(CAR(last), EOL); lloc = &CDR(*lloc); } @@ -2886,7 +2886,7 @@ SCM scm_cp_list(lst, minlen) { SCM res, *lloc = &res; res = EOL; - for(; NIMP(lst) && CONSP(lst); lst = CDR(lst)) { + for (; NIMP(lst) && CONSP(lst); lst = CDR(lst)) { *lloc = cons(CAR(lst), EOL); lloc = &CDR(*lloc); minlen--; @@ -2900,7 +2900,7 @@ SCM scm_v2lst(n, v, end) SCM *v, end; { SCM res = end; - for(n--; n >= 0; n--) res = cons(v[n], res); + for (n--; n >= 0; n--) res = cons(v[n], res); return res; } SCM apply(proc, arg1, args) @@ -3214,7 +3214,7 @@ static int prinprom(exp, port, writing) lputs("#<promise", port); if ((2L<<16) & CAR(exp)) lputc('*', port); lputc(' ', port); - iprin1(CDR(exp), port, writing); + scm_iprin1(CDR(exp), port, writing); lputc('>', port); return !0; } @@ -3312,7 +3312,7 @@ static int prinmacro(exp, port, writing) } if (MAC_TYPE(exp) & MAC_MEMOIZING) lputc('!', port); lputc(' ', port); - iprin1(CDR(exp), port, writing); + scm_iprin1(CDR(exp), port, writing); lputc('>', port); return !0; } @@ -3322,8 +3322,8 @@ static int prinenv(exp, port, writing) int writing; { lputs("#<environment ", port); - intprint((long)exp, -16, port); - /* iprin1(CDR(exp), port, writing); */ + scm_intprint((long)exp, -16, port); + /* scm_iprin1(CDR(exp), port, writing); */ lputc('>', port); return !0; } @@ -3336,9 +3336,9 @@ static int prinid(exp, port, writing) SCM s = IDENT_PARENT(exp); while (M_IDENTP(s)) s = IDENT_PARENT(s); lputs("#<id ", port); - iprin1(s, port, writing); + scm_iprin1(s, port, writing); lputc(':', port); - intprint((long)exp, -16, port); + scm_intprint((long)exp, -16, port); lputc('>', port); return !0; } diff --git a/features.txi b/features.txi index 1df8107..83afb22 100644 --- a/features.txi +++ b/features.txi @@ -18,6 +18,10 @@ Large precision integers. @cindex byte Treating strings as byte-vectors. +@item byte-number +@cindex byte-number +Byte/number conversions + @item careful-interrupt-masking @cindex careful-interrupt-masking Define this for extra checking of interrupt masking and some simple @@ -43,6 +43,7 @@ Wed Feb 21 23:06:35 1996 Aubrey Jaffer # include <sys/param.h> # endif # ifdef linux +# include <string.h> # include <stdlib.h> # include <sys/stat.h> # include <unistd.h> /* for X_OK define */ @@ -63,7 +64,7 @@ Wed Feb 21 23:06:35 1996 Aubrey Jaffer # include <u.h> # include <libc.h> # define getcwd getwd -# define MAXPATHLEN 256 /* arbitrary? */ +# define MAXPATHLEN 256 /* arbitrary? */ # define X_OK AEXEC # else # include <strings.h> @@ -80,18 +81,30 @@ Wed Feb 21 23:06:35 1996 Aubrey Jaffer # endif # ifdef __FreeBSD__ /* This might be same for 44bsd derived system. */ -# include <sys/types.h> +# include <stdlib.h> +# include <string.h> +# include <unistd.h> +# include <sys/stat.h> +# endif +# ifdef __DragonflyBSD__ +/* This might be same for 44bsd derived system. */ +# include <stdlib.h> +# include <string.h> +# include <unistd.h> # include <sys/stat.h> # endif # ifdef __NetBSD__ # include <stdlib.h> +# include <string.h> # include <unistd.h> +# include <sys/stat.h> # endif # ifdef __OpenBSD__ /* This might be same for 44bsd derived system. */ # include <stdlib.h> # include <unistd.h> -# include <sys/types.h> +# include <string.h> +/* # include <sys/types.h> */ # include <sys/stat.h> # endif # ifdef __alpha diff --git a/hobbit.info b/hobbit.info index 7dae5f2..423e7c1 100644 --- a/hobbit.info +++ b/hobbit.info @@ -1,7 +1,7 @@ This is hobbit.info, produced by makeinfo version 4.8 from hobbit.texi. -This manual is for the Hobbit compiler for SCM (version 5e3, October -2006), +This manual is for the Hobbit compiler for SCM (version 5e4, November +2007), Copyright (C) 2002 Free Software Foundation @@ -30,8 +30,8 @@ File: hobbit.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) Hobbit ****** -This manual is for the Hobbit compiler for SCM (version 5e3, October -2006), +This manual is for the Hobbit compiler for SCM (version 5e4, November +2007), Copyright (C) 2002 Free Software Foundation @@ -160,7 +160,7 @@ File: hobbit.info, Node: Compiling And Linking, Next: Error Detection, Prev: (lambda (fp) (for-each (lambda (string) (write-line string fp)) - '("#define IMPLINIT \"Init5e3.scm\"" + '("#define IMPLINIT \"Init5e4.scm\"" "#define BIGNUMS" "#define FLOATS" "#define ARRAYS" @@ -212,7 +212,7 @@ File: hobbit.info, Node: Compiling And Linking, Next: Error Detection, Prev: (lambda (fp) (for-each (lambda (string) (write-line string fp)) - '("#define IMPLINIT \"Init5e3.scm\"" + '("#define IMPLINIT \"Init5e4.scm\"" "#define COMPILED_INITS init_example();" "#define CCLO" "#define FLOATS")))) @@ -310,7 +310,7 @@ File: hobbit.info, Node: Hobbit Options, Next: CC Optimizations, Prev: Error initialized, during its work or later via the interpreter. Hobbit checks the compiled source and whenever some variable bar is - defined as a procedure, but is later redefined, or set! is applied + defined as a procedure, but is later redefined, or set! is applied to bar, then hobbit assumes thas this particular variable bar is redefinable. bar may be a primitive (eg `car') or a name of a compiled procedure. @@ -1784,8 +1784,9 @@ hobbit4b: @ alum.mit.edu). * A bug occurring in case arguments are evaluated right-to-left, - which happens with Hobbit compiled by gcc on Linux. Reported - and patched by George K. Bronnikov (goga@bronnikov.msk.su) + which happens with Hobbit compiled by gcc on GNU/Linux. + Reported and patched by George K. Bronnikov + (goga@bronnikov.msk.su) * A closure-building bug sometimes leading to a serious loss of efficiency (liftability not recognized), reported by @@ -1952,46 +1953,46 @@ Index Tag Table: -Node: Top1023 -Node: Introduction2111 -Node: Compiling with Hobbit3427 -Node: Compiling And Linking3685 -Node: Error Detection8371 -Node: Hobbit Options9677 -Node: CC Optimizations16410 -Node: The Language Compiled17366 -Node: Macros18025 -Node: SCM Primitive Procedures18629 -Node: SLIB Logical Procedures19551 -Node: Fast Integer Calculations20706 -Node: Force and Delay21840 -Node: Suggestions for writing fast code22425 -Node: Performance of Compiled Code32624 -Node: Gain in Speed32884 -Node: Benchmarks34469 -Node: Benchmark Sources37569 -Node: Destruct37915 -Node: Recfib39502 -Node: div-iter and div-rec39757 -Node: Hanoi40843 -Node: Tak41424 -Node: Ctak41779 -Node: Takl42759 -Node: Cpstak43415 -Node: Pi44194 -Node: Principles of Compilation45327 -Node: Macro-Expansion and Analysis45753 -Node: Building Closures49558 -Node: Lambda-lifting52449 -Node: Statement-lifting55180 -Node: Higher-order Arglists56288 -Node: Typing and Constants58094 -Node: About Hobbit59358 -Node: The Aims of Developing Hobbit59618 -Node: Manifest60509 -Node: Author and Contributors60968 -Node: Future Improvements62023 -Node: Release History62788 -Node: Index69577 +Node: Top1024 +Node: Introduction2113 +Node: Compiling with Hobbit3429 +Node: Compiling And Linking3687 +Node: Error Detection8373 +Node: Hobbit Options9679 +Node: CC Optimizations16411 +Node: The Language Compiled17367 +Node: Macros18026 +Node: SCM Primitive Procedures18630 +Node: SLIB Logical Procedures19552 +Node: Fast Integer Calculations20707 +Node: Force and Delay21841 +Node: Suggestions for writing fast code22426 +Node: Performance of Compiled Code32625 +Node: Gain in Speed32885 +Node: Benchmarks34470 +Node: Benchmark Sources37570 +Node: Destruct37916 +Node: Recfib39503 +Node: div-iter and div-rec39758 +Node: Hanoi40844 +Node: Tak41425 +Node: Ctak41780 +Node: Takl42760 +Node: Cpstak43416 +Node: Pi44195 +Node: Principles of Compilation45328 +Node: Macro-Expansion and Analysis45754 +Node: Building Closures49559 +Node: Lambda-lifting52450 +Node: Statement-lifting55181 +Node: Higher-order Arglists56289 +Node: Typing and Constants58095 +Node: About Hobbit59359 +Node: The Aims of Developing Hobbit59619 +Node: Manifest60510 +Node: Author and Contributors60969 +Node: Future Improvements62024 +Node: Release History62789 +Node: Index69591 End Tag Table @@ -6,7 +6,7 @@ ; 2002-04-11
;
; Copyright (C) 1992-1997: Tanel Tammet
-; Copyright (C) 1998-2002: Free Software Foundation
+; Copyright (C) 1998-2006: Free Software Foundation
;
; tammet@staff.ttu.ee, tammet@cs.chalmers.se
;
@@ -228,7 +228,7 @@ errjmp-ok ints-disabled sig-deferred alrm-deferred han-sig han-alrm
must-malloc ilength s-read s-write s-newline s-make-string
s-make-vector s-list s-string s-vector repl-driver newsmob lthrow repl
- gc-end gc-start growth-mon iprin1 intprint iprlist lputc lputs
+ gc-end gc-start growth-mon scm_iprin1 scm_intprint scm_iprlist lputc lputs
lfwrite time-in-msec my-time init-tables init-storage init-subrs
init-features init-iprocs init- init-scl init-io init-repl init-time
init-signals ignore-signals unignore-signals init-eval init-sc2
@@ -259,8 +259,9 @@ ;;; eval
throwval quit input-portp output-portp
cur-input-port cur-output-port open-file open-pipe close-port
- close-pipe lread read-char peek-char eof-objectp lwrite display
- newline write-char file-position file-set-position lgetenv prog-args
+ close-pipe read-char peek-char eof-objectp scm_write scm_display
+ scm_newline scm_write-char
+ file-position file-set-position scm_file-position lgetenv prog-args
makacro makmacro makmmacro
remove ash round array-ref array_ref
sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh sqrt expt
@@ -2115,7 +2116,7 @@ ;; (display-c-newline))
((eq? 'if (car term))
(display-c-indent n)
- (display-c "if(")
+ (display-c "if (")
(display-c-expression (cadr term) #t)
(display-c #\))
(cond ((not (pair? (caddr term)))
@@ -2170,7 +2171,7 @@ (display-c-statement (car (cdddr term)) n))))
((eq? (car term) *do-not*)
(display-c-indent n)
- (display-c "for(")
+ (display-c "for (")
(let ((lst1 (map (lambda (x) (list 'set! (car x) (cadr x)))
(cadr term)))
(lst2 (map (lambda (x) (list 'set! (car x) (caddr x)))
@@ -2561,12 +2562,12 @@ (read "scm_read" 1)
(read-char "scm_read_char" 1)
- (peek-char "peek_char" 1)
+ (peek-char "scm_peek_char" 1)
(eof-object? "eof_objectp" 1)
- (write "lwrite" 2)
- (display "display" 2)
- (newline "newline" 1)
- (write-char "write_char" 2)
+ (write "scm_write" 2)
+ (display "scm_display" 2)
+ (newline "scm_newline" 1)
+ (write-char "scm_write_char" 2)
(input-port? "input_portp" 1)
(output-port? "output_portp" 1)
diff --git a/hobbit.texi b/hobbit.texi index 0e59bf3..a04c8f8 100644 --- a/hobbit.texi +++ b/hobbit.texi @@ -351,7 +351,7 @@ procedures are redefined, neither before the compiled program is initialized, during its work or later via the interpreter. Hobbit checks the compiled source and whenever some variable bar is -defined as a procedure, but is later redefined, or @t{set!} is applied +defined as a procedure, but is later redefined, or @t{set!} is applied to bar, then hobbit assumes thas this particular variable bar is redefinable. bar may be a primitive (eg @samp{car}) or a name of a compiled procedure. @@ -2080,7 +2080,7 @@ A bug in the liftability analysis, reported by A. Jaffer (agj @@ alum.mit.edu). @item A bug occurring in case arguments are evaluated right-to-left, -which happens with Hobbit compiled by gcc on Linux. +which happens with Hobbit compiled by gcc on GNU/Linux. Reported and patched by George K. Bronnikov (goga@@bronnikov.msk.su) @item A closure-building bug sometimes leading to a serious loss of diff --git a/indexes.texi b/indexes.texi index 0aff554..758700a 100644 --- a/indexes.texi +++ b/indexes.texi @@ -1,6 +1,6 @@ @ifhtml -@node Index, , The Implementation, Top +@node Index, Procedure and Macro Index, The Implementation, Top @unnumbered Index @end ifhtml @@ -14,36 +14,36 @@ @end ifnotinfo @ifnotinfo -@node Procedure and Macro Index, Variable Index, Indexes, Indexes +@node Procedure and Macro Index, Variable Index, Index, Index @end ifnotinfo -@unnumberedsec Procedure and Macro Index +@unnumbered Procedure and Macro Index @c This is an alphabetical list of all the procedures and macros in SCM. @printindex fn @ifnotinfo -@node Variable Index, Type Index, Procedure and Macro Index, Indexes +@node Variable Index, Type Index, Procedure and Macro Index, Index @end ifnotinfo -@unnumberedsec Variable Index +@unnumbered Variable Index @c This is an alphabetical list of all the global variables in SCM. @printindex vr @ifnotinfo -@node Type Index, Concept Index, Variable Index, Indexes +@node Type Index, Concept Index, Variable Index, Index @end ifnotinfo -@unnumberedsec Type Index +@unnumbered Type Index @c This is an alphabetical list of data types and feature names in SCM. @printindex tp @ifnotinfo -@node Concept Index, , Type Index, Indexes +@node Concept Index, , Type Index, Index @end ifnotinfo -@unnumberedsec Concept Index +@unnumbered Concept Index @c This is an alphabetical list of concepts introduced in this manual. @@ -193,49 +193,8 @@ static char s_write_line[] = "write-line"; SCM l_write_line(obj, port) SCM obj, port; { - display(obj, port); - return newline(port); -} - -static char s_file_position[] = "file-position", - s_file_set_pos[] = "file-set-position"; -SCM file_position(port) - SCM port; -{ - long ans; - ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_position); - SYSCALL(ans = ftell(STREAM(port));); - if (CRDYP(port)) ans--; - return MAKINUM(ans); - } -SCM file_set_position(port, pos) - SCM port, pos; -{ - SCM ans; - ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_set_pos); -#ifndef RECKLESS - if (TRACKED & SCM_PORTFLAGS(port)) { - if (INUM0==pos) { - int i = SCM_PORTNUM(port); - scm_port_table[i].line = 1L; - scm_port_table[i].col = 1; - } - else { - if (2 <= verbose) - scm_warn("Setting file position for tracked port: ", "", port); - SCM_PORTFLAGS(port) &= (~TRACKED); - } - } -#endif - CLRDY(port); /* Clear ungetted char */ - SYSCALL(ans = (fseek(STREAM(port), INUM(pos), 0)) ? BOOL_F : BOOL_T;); -#ifdef HAVE_PIPE -# ifdef ESPIPE - if (!OPIOPORTP(port)) - ASRTER(ESPIPE != errno, port, ARG1, s_file_set_pos); -# endif -#endif - return ans; + scm_display(obj, port); + return scm_newline(port); } static char s_reopen_file[] = "reopen-file"; @@ -792,7 +751,6 @@ SCM l_putenv(str) #endif static iproc subr1s[] = { - {s_file_position, file_position}, {s_fileno, l_fileno}, #ifndef MCH_AMIGA # ifndef vms @@ -877,7 +835,6 @@ SCM scm_try_create_file(fname, modes, perms) #endif static iproc subr2os[] = { - {s_file_set_pos, file_set_position}, {s_read_line1, read_line1}, {s_write_line, l_write_line}, {0, 0}}; diff --git a/mkimpcat.scm b/mkimpcat.scm index 02d1323..ad39438 100644 --- a/mkimpcat.scm +++ b/mkimpcat.scm @@ -184,6 +184,8 @@ (in-implementation-vicinity "gsubr" link:able-suffix)) (add-link 'array-for-each (in-implementation-vicinity "ramap" link:able-suffix)) + (add-link 'byte-number + (in-implementation-vicinity "bytenumb" link:able-suffix)) ) (display* ")") ) @@ -4,11 +4,11 @@ # for alpha release, "b" for beta release, "c", and so on), and the # trailing number is the patchlevel. */ # /* This next line sets VERSION when included from the Makefile */ -VERSION=5e3 +VERSION=5e4 #endif #ifndef SCMVERSION -# define SCMVERSION "5e3" +# define SCMVERSION "5e4" #endif #ifdef nosve # define INIT_FILE_NAME "Init"SCMVERSION"_scm"; diff --git a/platform.txi b/platform.txi index ef3d033..199e0df 100644 --- a/platform.txi +++ b/platform.txi @@ -13,18 +13,18 @@ amiga-aztec m68000 amiga cc amiga-dice-c m68000 amiga dcc amiga-gcc m68000 amiga gcc amiga-sas m68000 amiga lc -atari-st-gcc m68000 atari.st gcc -atari-st-turbo-c m68000 atari.st tcc +atari-st-gcc m68000 atari-st gcc +atari-st-turbo-c m68000 atari-st tcc borland-c i8086 ms-dos bcc darwin powerpc unix cc djgpp i386 ms-dos gcc -freebsd i386 unix cc +freebsd *unknown* unix cc gcc *unknown* unix gcc gnu-win32 i386 unix gcc highc i386 ms-dos hc386 hp-ux hp-risc hp-ux cc irix mips irix gcc -linux i386 linux gcc +linux *unknown* linux gcc linux-aout i386 linux gcc linux-ia64 ia64 linux gcc microsoft-c i8086 ms-dos cl @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1998, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/r4rstest.scm b/r4rstest.scm index 5025733..95298f0 100644 --- a/r4rstest.scm +++ b/r4rstest.scm @@ -1,4 +1,4 @@ -;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by the @@ -180,6 +180,7 @@ (test 34 'let x) (test 6 'let (let () (define x 6) x)) (test 34 'let x) +(test 34 'let (let ((x x)) x)) (test 7 'let* (let* ((x 3)) (define x 7) x)) (test 34 'let* x) (test 8 'let* (let* () (define x 8) x)) @@ -248,6 +249,12 @@ (test 6 'define (add3 3)) (define first car) (test 1 'define (first '(1 2))) +(define foo (lambda () 9)) +(test 9 'define (foo)) +(define foo foo) +(test 9 'define (foo)) +(define foo (let ((foo foo)) (lambda () (+ 1 (foo))))) +(test 10 'define (foo)) (define old-+ +) (begin (begin (begin) (begin (begin (begin) (define + (lambda (x y) (list y x))) @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1546,6 +1546,77 @@ SCM array_for_each(proc, ra0, lra) } } +static char s_array_index_for_each[] = "array-index-for-each"; +SCM scm_array_index_for_each(ra, proc) + SCM ra, proc; +{ + SCM hp_av, hp_indv, auto_av[5]; + SCM *av = &auto_av[0]; + long auto_indv[5]; + long *indv = &auto_indv[0]; + sizet i; + ASRTER(NIMP(ra), ra, ARG1, s_array_index_for_each); + i = INUM(array_rank(ra)); +#ifndef RECKLESS + scm_arity_check(proc, i+0L, s_array_index_for_each); +#endif + if (i >= 5) { + scm_protect_temp(&hp_av); + scm_protect_temp(&hp_indv); + hp_av = make_vector(MAKINUM(i), BOOL_F); + av = VELTS(hp_av); + hp_indv = make_uve(i+0L, MAKINUM(-32L)); + indv = (long *)VELTS(hp_indv); + } + switch TYP7(ra) { + default: badarg: wta(ra, (char *)ARG1, s_array_index_for_each); + case tc7_vector: { + for (i = 0; i < LENGTH(ra); i++) { + av[0] = MAKINUM(i); + scm_cvapply(proc, 1L, av); + } + return UNSPECIFIED; + } + case tcs_uves: + for (i = 0; i < LENGTH(ra); i++) { + av[0] = MAKINUM(i); + scm_cvapply(proc, 1L, auto_av); + } + return UNSPECIFIED; + case tc7_smob: ASRTGO(ARRAYP(ra), badarg); + { + int j, k, kmax = ARRAY_NDIM(ra) - 1; + if (kmax < 0) + return apply(proc, EOL, EOL); + for (k = 0; k <= kmax; k++) + indv[k] = ARRAY_DIMS(ra)[k].lbnd; + k = kmax; + do { + if (k==kmax) { + indv[k] = ARRAY_DIMS(ra)[k].lbnd; + i = cind(ra, indv); + for (; indv[k] <= ARRAY_DIMS(ra)[k].ubnd; indv[k]++) { + for (j = kmax+1; j--;) + av[j] = MAKINUM(indv[j]); + scm_cvapply(proc, kmax+1L, av); + i += ARRAY_DIMS(ra)[k].inc; + } + k--; + continue; + } + if (indv[k] < ARRAY_DIMS(ra)[k].ubnd) { + indv[k]++; + k++; + continue; + } + indv[k] = ARRAY_DIMS(ra)[k].lbnd - 1; + k--; + } while (k >= 0); + return UNSPECIFIED; + } + } +} + static char s_array_imap[] = "array-index-map!"; SCM array_imap(ra, proc) SCM ra, proc; @@ -1788,12 +1859,13 @@ static iproc lsubr2s[] = { {s_sarray_map, array_map}, {s_array_for_each, array_for_each}, {s_array_imap, array_imap}, + {s_array_index_for_each, scm_array_index_for_each}, {0, 0}}; static void init_raprocs(subra) ra_iproc *subra; { - for(; subra->name; subra++) + for (; subra->name; subra++) subra->sproc = CDR(sysintern(subra->name, UNDEFINED)); } @@ -133,7 +133,7 @@ SCM rec_constr(rtd, flds) i = ilength(flds); ASRTER(i>=0, flds, ARG2, s_rec_constr); indices = MAKE_REC_INDS(i); - for(i = 0; NIMP(flds); i++, flds = CDR(flds)) { + for (i = 0; NIMP(flds); i++, flds = CDR(flds)) { fld = CAR(flds); ASRTER(NIMP(fld) && SYMBOLP(fld), fld, ARG2, s_rec_constr); flst = RTD_FIELDS(rtd); @@ -319,26 +319,26 @@ static int recprin1(exp, port, writing) } names = RTD_FIELDS(REC_RTD(exp)); lputs("#s(", port); - iprin1(RTD_NAME(REC_RTD(exp)), port, 0); + scm_iprin1(RTD_NAME(REC_RTD(exp)), port, 0); if (writing) { lputc(':', port); - intprint(((long)REC_RTD(exp))>>1, 16, port); + scm_intprint(((long)REC_RTD(exp))>>1, 16, port); } for (i = 1; i < NUMDIGS(exp); i++) { lputc(' ', port); - iprin1(CAR(names), port, 0); + scm_iprin1(CAR(names), port, 0); names = CDR(names); lputc(' ', port); - iprin1(VELTS(exp)[i], port, writing); + scm_iprin1(VELTS(exp)[i], port, writing); } lputc(')', port); /* lputs("#<record <", port); - iprin1(RTD_NAME(REC_RTD(exp)), port, 0); + scm_iprin1(RTD_NAME(REC_RTD(exp)), port, 0); lputc('>', port); - for(i = 1; i < NUMDIGS(exp); i++) { + for (i = 1; i < NUMDIGS(exp); i++) { lputc(' ', port); - iprin1(VELTS(exp)[i], port, writing); + scm_iprin1(VELTS(exp)[i], port, writing); } lputc('>', port); */ @@ -350,11 +350,11 @@ SCM rec_rtdprin1(rtd, port, writing_p) SCM rtd, port, writing_p; { lputs("#s(record-type ", port); - iprin1(RTD_NAME(rtd), port, 0); + scm_iprin1(RTD_NAME(rtd), port, 0); lputc(':', port); - intprint(((long)rtd)>>1, 16, port); + scm_intprint(((long)rtd)>>1, 16, port); lputs(" fields ", port); - iprin1(RTD_FIELDS(rtd), port, 0); + scm_iprin1(RTD_FIELDS(rtd), port, 0); if (NIMP(RTD_PRINTER(rtd))) lputs(" P)", port); else @@ -1,4 +1,4 @@ -/* Copyright (C) 1990-2002 Free Software Foundation, Inc. +/* Copyright (C) 1990-2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +67,10 @@ void scm_fill_freelist P((void)); # include <ctype.h> #endif +#ifdef linux +# include <ctype.h> +#endif + #ifdef ARM_ULIB # include <termio.h> int set_erase() @@ -88,8 +92,8 @@ unsigned char uppers[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; void init_tables() { int i; - for(i = 0;i<CHAR_CODE_LIMIT;i++) upcase[i] = downcase[i] = i; - for(i = 0;i<sizeof lowers/sizeof(char);i++) { + for (i = 0;i<CHAR_CODE_LIMIT;i++) upcase[i] = downcase[i] = i; + for (i = 0;i<sizeof lowers/sizeof(char);i++) { upcase[lowers[i]] = uppers[i]; downcase[uppers[i]] = lowers[i]; } @@ -155,15 +159,16 @@ static char s_freshline[] = "freshline"; static char s_eofin[] = "end of file in "; static char s_unknown_sharp[] = "unknown # object"; -static SCM lread1 P((SCM port, int flgs, const char *what)); -static SCM lreadr P((SCM tok_buf, SCM port, int flgs)); -static SCM lreadpr P((SCM tok_buf, SCM port, int flgs)); -static SCM lreadparen P((SCM tok_buf, SCM port, int flgs, char *name)); -static SCM lread_rec P((SCM tok_buf, SCM port)); -static sizet read_token P((int ic, SCM tok_buf, SCM port)); +static SCM scm_lread1 P((SCM port, int flgs, const char *what)); +static SCM scm_lreadr P((SCM tok_buf, SCM port, int flgs)); +static SCM scm_lreadpr P((SCM tok_buf, SCM port, int flgs)); +static SCM scm_lreadparen P((SCM tok_buf, SCM port, int flgs, char *name)); +static SCM scm_lread_rec P((SCM tok_buf, SCM port)); +static sizet scm_read_token P((int ic, SCM tok_buf, SCM port, int flgs)); static void err_head P((char *str)); +extern int case_sensitize_symbols; /* 0 or 8 */ -void intprint(n, radix, port) +void scm_intprint(n, radix, port) long n; int radix; SCM port; @@ -172,7 +177,7 @@ void intprint(n, radix, port) lfwrite(num_buf, (sizet)sizeof(char), iint2str(n, radix, num_buf), port); } -void ipruk(hdr, ptr, port) +void scm_ipruk(hdr, ptr, port) char *hdr; SCM ptr; SCM port; @@ -181,17 +186,17 @@ void ipruk(hdr, ptr, port) lputs(hdr, port); if (scm_cell_p(ptr)) { lputs(" (0x", port); - intprint(CAR(ptr), -16, port); + scm_intprint(CAR(ptr), -16, port); lputs(" . 0x", port); - intprint(CDR(ptr), -16, port); + scm_intprint(CDR(ptr), -16, port); lputs(") @", port); } lputs(" 0x", port); - intprint(ptr, -16, port); + scm_intprint(ptr, -16, port); lputc('>', port); } -void iprlist(hdr, exp, tlr, port, writing) +void scm_iprlist(hdr, exp, tlr, port, writing) char *hdr, tlr; SCM exp; SCM port; @@ -199,32 +204,32 @@ void iprlist(hdr, exp, tlr, port, writing) { lputs(hdr, port); /* CHECK_INTS; */ - iprin1(CAR(exp), port, writing); + scm_iprin1(CAR(exp), port, writing); exp = GCCDR(exp); /* CDR(exp); */ - for(;NIMP(exp);exp = GCCDR(exp) /* CDR(exp)*/) { + for (;NIMP(exp);exp = GCCDR(exp) /* CDR(exp)*/) { if (!scm_cell_p(~1L & exp)) break; if (NECONSP(exp)) break; lputc(' ', port); /* CHECK_INTS; */ - iprin1(CAR(exp), port, writing); + scm_iprin1(CAR(exp), port, writing); } if (NNULLP(exp)) { lputs(" . ", port); - iprin1(exp, port, writing); + scm_iprin1(exp, port, writing); } lputc(tlr, port); } -void iprin1(exp, port, writing) +void scm_iprin1(exp, port, writing) SCM exp; SCM port; int writing; { register long i; taloop: - switch (7 & (int)exp) { + switch (7 & PTR2INT(exp)) { case 2: case 6: - intprint(INUM(exp), 10, port); + scm_intprint(INUM(exp), 10, port); break; case 4: if (ICHRP(exp)) { @@ -237,27 +242,27 @@ taloop: lputs(charnames[(sizeof charnames/sizeof(char *))-1], port); #endif /* ndef EBCDIC */ else if (i > '\177') - intprint(i, -8, port); + scm_intprint(i, -8, port); else lputc((int)i, port); } else if (SCM_LINUMP(exp)) { lputs("#<line ", port); - intprint(SCM_LINUM(exp), -10, port); + scm_intprint(SCM_LINUM(exp), -10, port); lputc('>', port); } else if (IFLAGP(exp) && (ISYMNUM(exp)<(sizeof isymnames/sizeof(char *)))) lputs(ISYMCHARS(exp), port); else if (ILOCP(exp)) { lputs("#@", port); - intprint((long)IFRAME(exp), -10, port); + scm_intprint((long)IFRAME(exp), -10, port); lputc(ICDRP(exp)?'-':'+', port); - intprint((long)IDIST(exp), -10, port); + scm_intprint((long)IDIST(exp), -10, port); } else goto idef; break; case 1: /* gloc */ if (!scm_cell_p(exp-1)) { - ipruk("gloc", exp, port); + scm_ipruk("gloc", exp, port); break; } lputs("#@", port); @@ -270,11 +275,11 @@ taloop: goto taloop; default: idef: - ipruk("immediate", exp, port); + scm_ipruk("immediate", exp, port); break; case 0: if (!scm_cell_p(exp)) { - ipruk("heap", exp, port); + scm_ipruk("heap", exp, port); break; } switch TYP7(exp) { @@ -282,8 +287,8 @@ taloop: if (CAR(exp) != IM_LET) { lputs("(#@call ", port); exp = CDR(exp); - iprin1(CAR(exp), port, writing); - iprlist(" ", CAR(CDR(exp)), ')', port, writing); + scm_iprin1(CAR(exp), port, writing); + scm_iprlist(" ", CAR(CDR(exp)), ')', port, writing); break; } /* else fall through */ @@ -297,7 +302,7 @@ taloop: case tcs_cons_chflag: case tcs_cons_gloc: case tcs_cons_nimcar: - iprlist("(", exp, ')', port, writing); + scm_iprlist("(", exp, ')', port, writing); break; case tcs_closures: scm_princlosure(exp, port, writing); @@ -305,7 +310,7 @@ taloop: case tc7_string: if (writing) { lputc('\"', port); - for(i = 0;i<LENGTH(exp);++i) switch (CHARS(exp)[i]) { + for (i = 0;i<LENGTH(exp);++i) switch (CHARS(exp)[i]) { case '\"': case '\\': lputc('\\', port); @@ -317,14 +322,16 @@ taloop: } case tcs_symbols: if (writing) { /* slashified symbol */ - for(i = 0;i<LENGTH(exp);++i) switch (CHARS(exp)[i]) { - case '\\': case '\"': case '\'': case '(': case ')': case '#': + for (i = 0;i<LENGTH(exp);++i) switch (CHARS(exp)[i]) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': + if (case_sensitize_symbols) goto skipit; + case '\\': case '\"': case '\'': case '(': case ')': case '#': lputc('\\', port); + skipit: default: lputc(CHARS(exp)[i], port); } @@ -335,14 +342,14 @@ taloop: break; case tc7_vector: lputs("#(", port); - for(i = 0;i+1<LENGTH(exp);++i) { + for (i = 0;i+1<LENGTH(exp);++i) { /* CHECK_INTS; */ - iprin1(VELTS(exp)[i], port, writing); + scm_iprin1(VELTS(exp)[i], port, writing); lputc(' ', port); } if (i<LENGTH(exp)) { /* CHECK_INTS; */ - iprin1(VELTS(exp)[i], port, writing); + scm_iprin1(VELTS(exp)[i], port, writing); } lputc(')', port); break; @@ -360,9 +367,9 @@ taloop: #ifdef CCLO if (tc16_cclo==TYP16(exp)) { lputs("#<compiled-closure ", port); - iprin1(CCLO_SUBR(exp), port, writing); + scm_iprin1(CCLO_SUBR(exp), port, writing); lputc(' ', port); - iprin1(VELTS(exp)[1], port, writing); + scm_iprin1(VELTS(exp)[1], port, writing); lputc('>', port); break; } @@ -373,9 +380,9 @@ taloop: break; case tc7_contin: lputs("#<continuation ", port); - intprint(LENGTH(exp), -10, port); + scm_intprint(LENGTH(exp), -10, port); lputs(" @ ", port); - intprint((long)CHARS(exp), -16, port); + scm_intprint((long)CHARS(exp), -16, port); lputc('>', port); break; case tc7_port: @@ -393,7 +400,7 @@ taloop: if (i<numsmob && smobs[i].print && (smobs[i].print)(exp, port, writing)) break; goto punk; - default: punk: ipruk("type", exp, port); + default: punk: scm_ipruk("type", exp, port); } } } @@ -605,8 +612,8 @@ int scm_io_error(port, what) lputs(";;", cur_errp); lputs(what, cur_errp); lputs(": closing pipe ", cur_errp); - iprin1(port, cur_errp, 1); - newline(cur_errp); + scm_iprin1(port, cur_errp, 1); + scm_newline(cur_errp); } close_port(port); if (*loc_broken_pipe && NIMP(*loc_broken_pipe)) @@ -623,47 +630,41 @@ int scm_io_error(port, what) return 0; /* squelch warning */ } -static char s_fflush[] = "fflush"; void lfflush(port) /* internal SCM call */ SCM port; { sizet i = PTOBNUM(port); while ((ptobs[i].fflush)(STREAM(port)) && - scm_io_error(port, s_fflush)) + scm_io_error(port, "lfflush")) ; } -static char s_flush[] = "force-output"; -SCM lflush(port) /* user accessible as force-output */ +static char s_force_output[] = "force-output"; +SCM scm_force_output(port) SCM port; { - if (UNBNDP(port)) port = cur_outp; - else ASRTER(NIMP(port) && OPOUTPORTP(port), port, ARG1, s_flush); - { - sizet i = PTOBNUM(port); - while ((ptobs[i].fflush)(STREAM(port)) && - scm_io_error(port, s_fflush)) - ; - return UNSPECIFIED; - } + if (UNBNDP(port)) port = cur_outp; + else ASRTER(NIMP(port) && OPOUTPORTP(port), port, ARG1, s_force_output); + lfflush(port); + return UNSPECIFIED; } -SCM lwrite(obj, port) +SCM scm_write(obj, port) SCM obj, port; { if (UNBNDP(port)) port = cur_outp; else ASRTER(NIMP(port) && OPOUTPORTP(port), port, ARG2, s_write); - iprin1(obj, port, 1); + scm_iprin1(obj, port, 1); return UNSPECIFIED; } -SCM display(obj, port) +SCM scm_display(obj, port) SCM obj, port; { if (UNBNDP(port)) port = cur_outp; else ASRTER(NIMP(port) && OPOUTPORTP(port), port, ARG2, s_display); - iprin1(obj, port, 0); + scm_iprin1(obj, port, 0); return UNSPECIFIED; } -SCM newline(port) +SCM scm_newline(port) SCM port; { if (UNBNDP(port)) port = cur_outp; @@ -672,7 +673,7 @@ SCM newline(port) if (port==cur_outp) lfflush(port); return UNSPECIFIED; } -SCM write_char(chr, port) +SCM scm_write_char(chr, port) SCM chr, port; { if (UNBNDP(port)) port = cur_outp; @@ -745,7 +746,7 @@ sizet lfwrite(ptr, size, nitems, port) sizet ret, i = PTOBNUM(port); do { ret = (ptobs[i].fwrite)(ptr, size, nitems, STREAM(port)); - } while(nitems != ret && scm_io_error(port, "fwrite")); + } while(nitems != ret && scm_io_error(port, "fwrite")); if (CRDY & CAR(port)) { sizet j; i = SCM_PORTNUM(port); @@ -823,7 +824,7 @@ SCM scm_read_char(port) if (EOF==c) return EOF_VAL; return MAKICHR(c); } -SCM peek_char(port) +SCM scm_peek_char(port) SCM port; { int c; @@ -873,42 +874,42 @@ static char s_read_numbered[] = "read-numbered"; SCM scm_read(port) SCM port; { - return lread1(port, 0, s_read); + return scm_lread1(port, case_sensitize_symbols, s_read); } SCM scm_read_for_load(port) SCM port; { - return lread1(port, 4, s_read_for_load); + return scm_lread1(port, 4 | case_sensitize_symbols, s_read_for_load); } #ifndef MEMOIZE_LOCALS SCM scm_read_numbered(port) SCM port; { - return lread1(port, 6, s_read_numbered); + return scm_lread1(port, 6 | case_sensitize_symbols, s_read_numbered); } #endif -static SCM lread1(port, flgs, what) +static SCM scm_lread1(port, flgs, what) SCM port; int flgs; const char *what; { - int c; - SCM tok_buf; - if (UNBNDP(port)) port = cur_inp; - ASRTER(NIMP(port) && OPINPORTP(port), port, ARG1, what); - do { - c = flush_ws(port); - if (EOF==c) return EOF_VAL; - lungetc(c, port); - tok_buf = makstr(30L); - } while (EOF_VAL==(tok_buf = lreadr(tok_buf, port, flgs))); - return tok_buf; + int c; + SCM tok_buf; + if (UNBNDP(port)) port = cur_inp; + ASRTER(NIMP(port) && OPINPORTP(port), port, ARG1, what); + do { + c = flush_ws(port); + if (EOF==c) return EOF_VAL; + lungetc(c, port); + tok_buf = makstr(30L); + } while (EOF_VAL==(tok_buf = scm_lreadr(tok_buf, port, flgs))); + return tok_buf; } static SCM *loc_loadsharp = 0, *loc_readsharp = 0, *loc_charsharp = 0; -static SCM lreadpr(tok_buf, port, flgs) +static SCM scm_lreadpr(tok_buf, port, flgs) SCM tok_buf; SCM port; int flgs; @@ -916,7 +917,7 @@ static SCM lreadpr(tok_buf, port, flgs) int c; sizet j; SCM p; - if (2==(3&flgs)) return lread_rec(tok_buf, port); + if (2==(3 & flgs)) return scm_lread_rec(tok_buf, port); tryagain: c = flush_ws(port); switch (c) { @@ -924,15 +925,15 @@ static SCM lreadpr(tok_buf, port, flgs) #ifdef BRACKETS_AS_PARENS case '[': #endif - case '(': return lreadparen(tok_buf, port, flgs, s_list); + case '(': return scm_lreadparen(tok_buf, port, flgs, s_list); #ifdef BRACKETS_AS_PARENS case ']': #endif case ')': return UNDEFINED; /* goto tryagain; */ case '\'': return cons2(i_quote, - lreadr(tok_buf, port, flgs), EOL); + scm_lreadr(tok_buf, port, flgs), EOL); case '`': return cons2(i_quasiquote, - lreadr(tok_buf, port, flgs), EOL); + scm_lreadr(tok_buf, port, flgs), EOL); case ',': c = lgetc(port); if ('@'==c) p = i_uq_splicing; @@ -940,7 +941,7 @@ static SCM lreadpr(tok_buf, port, flgs) lungetc(c, port); p = i_unquote; } - return cons2(p, lreadr(tok_buf, port, flgs), EOL); + return cons2(p, scm_lreadr(tok_buf, port, flgs), EOL); case '#': c = lgetc(port); switch (c) { @@ -948,7 +949,7 @@ static SCM lreadpr(tok_buf, port, flgs) case '[': #endif case '(': - p = lreadparen(tok_buf, port, flgs, s_vector); + p = scm_lreadparen(tok_buf, port, flgs, s_vector); return NULLP(p) ? nullvect : vector(p); case 't': case 'T': return BOOL_T; case 'f': case 'F': return BOOL_F; @@ -959,7 +960,7 @@ static SCM lreadpr(tok_buf, port, flgs) c = '#'; goto num; case '*': - j = read_token(c, tok_buf, port); + j = scm_read_token(c, tok_buf, port, flgs); p = istr2bve(CHARS(tok_buf)+1, (long)(j-1)); if (NFALSEP(p)) return p; else goto unkshrp; @@ -968,11 +969,11 @@ static SCM lreadpr(tok_buf, port, flgs) if ('\\'==c) { CHARS(tok_buf)[0] = c; j = 1; - } else j = read_token(c, tok_buf, port); + } else j = scm_read_token(c, tok_buf, port, flgs); if (j==1) return MAKICHR(c); for (c = 0;c<sizeof charnames/sizeof(char *);c++) if (charnames[c] - && (0==strcmp(charnames[c], CHARS(tok_buf)))) + && (0==strcasecmp(charnames[c], CHARS(tok_buf)))) return MAKICHR(charnums[c]); if (loc_charsharp && NIMP(*loc_charsharp)) { resizuve(tok_buf, MAKINUM(j)); @@ -1002,11 +1003,11 @@ static SCM lreadpr(tok_buf, port, flgs) { SCM reader = #ifndef MEMOIZE_LOCALS - (3&flgs) ? p_read_numbered : + (3 & flgs) ? p_read_numbered : #endif - ((4&flgs) ? p_read_for_load : p_read); + ((4 & flgs) ? p_read_for_load : p_read); SCM args = cons2(MAKICHR(c), port, cons(reader, EOL)); - if ((4&flgs) && loc_loadsharp && NIMP(*loc_loadsharp)) { + if ((4 & flgs) && loc_loadsharp && NIMP(*loc_loadsharp)) { p = apply(*loc_loadsharp, args, EOL); if (UNSPECIFIED==p) goto tryagain; return p; @@ -1046,7 +1047,7 @@ static SCM lreadpr(tok_buf, port, flgs) case DIGITS: case '.': case '-': case '+': num: - j = read_token(c, tok_buf, port); + j = scm_read_token(c, tok_buf, port, flgs); p = istring2number(CHARS(tok_buf), (long)j, 10L); if (NFALSEP(p)) return p; if (c=='#') { @@ -1059,36 +1060,36 @@ static SCM lreadpr(tok_buf, port, flgs) } goto tok; default: - j = read_token(c, tok_buf, port); + j = scm_read_token(c, tok_buf, port, flgs); tok: p = intern(CHARS(tok_buf), j); return CAR(p); } } -static SCM lreadr(tok_buf, port, flgs) +static SCM scm_lreadr(tok_buf, port, flgs) SCM tok_buf; SCM port; int flgs; { - SCM ans = lreadpr(tok_buf, port, flgs); + SCM ans = scm_lreadpr(tok_buf, port, flgs); switch (ans) { case UNDEFINED: scm_warn("unexpected \")\"", "", port); - return lreadpr(tok_buf, port, flgs); + return scm_lreadpr(tok_buf, port, flgs); } return ans; } -static SCM lread_rec(tok_buf, port) +static SCM scm_lread_rec(tok_buf, port) SCM tok_buf; SCM port; { SCM line, form; int c = flush_ws(port); - switch(c) { + switch (c) { default: lungetc(c, port); line = scm_port_line(port); - form = lreadpr(tok_buf, port, 5); + form = scm_lreadpr(tok_buf, port, 5); if (NFALSEP(line) && NIMP(form) && (CONSP(form) || VECTORP(form))) { return cons(SCM_MAKE_LINUM(INUM(line)), form); @@ -1105,37 +1106,38 @@ static SCM lread_rec(tok_buf, port) #ifdef _UNICOS _Pragma("noopt"); /* # pragma _CRI noopt */ #endif -static sizet read_token(ic, tok_buf, port) +static sizet scm_read_token(ic, tok_buf, port, flgs) int ic; SCM tok_buf; SCM port; + int flgs; { - register sizet j = 1; - register int c = ic; - register char *p = CHARS(tok_buf); - p[0] = '\\'==c ? lgetc(port) : downcase[c]; - while(1) { - if (j+1 >= LENGTH(tok_buf)) p = grow_tok_buf(tok_buf); - switch (c = lgetc(port)) { + register sizet j = 1; + register int c = ic; + register char *p = CHARS(tok_buf); + p[0] = '\\'==c ? lgetc(port) : 8 & flgs ? c : downcase[c]; + while(1) { + if (j+1 >= LENGTH(tok_buf)) p = grow_tok_buf(tok_buf); + switch (c = lgetc(port)) { #ifdef BRACKETS_AS_PARENS - case '[': case ']': + case '[': case ']': #endif - case '(': case ')': case '\"': case ';': - case ',': case '`': - /* case '#': */ - case WHITE_SPACES: - case LINE_INCREMENTORS: - lungetc(c, port); - case EOF: - p[j] = 0; - return j; - case '\\': /* slashified symbol */ - p[j++] = lgetc(port); - break; - default: - p[j++] = downcase[c]; - } - } + case '(': case ')': case '\"': case ';': + case ',': case '`': + /* case '#': */ + case WHITE_SPACES: + case LINE_INCREMENTORS: + lungetc(c, port); + case EOF: + p[j] = 0; + return j; + case '\\': /* slashified symbol */ + p[j++] = lgetc(port); + break; + default: + p[j++] = 8 & flgs ? c : downcase[c]; + } + } } #ifdef _UNICOS _Pragma("opt"); /* # pragma _CRI opt */ @@ -1150,28 +1152,28 @@ _Pragma("opt"); /* # pragma _CRI opt */ /* 5 - top level read when adding line-numbers. Uses LOAD:SHARP */ /* 6 - recursive read when adding line-numbers. Uses LOAD:SHARP */ -static SCM lreadparen(tok_buf, port, flgs, name) +static SCM scm_lreadparen(tok_buf, port, flgs, name) SCM tok_buf; SCM port; int flgs; char *name; { SCM lst, fst, - tmp = lreadpr(tok_buf, port, (4&flgs) | ((3&flgs) ? 2 : 0)); + tmp = scm_lreadpr(tok_buf, port, (0xC & flgs) | ((3 & flgs) ? 2 : 0)); if (UNDEFINED==tmp) return EOL; if (i_dot==tmp) { - fst = lreadr(tok_buf, port, (4&flgs) | ((3&flgs) ? 1 : 0)); + fst = scm_lreadr(tok_buf, port, (0xC & flgs) | ((3 & flgs) ? 1 : 0)); closeit: - tmp = lreadpr(tok_buf, port, 0); + tmp = scm_lreadpr(tok_buf, port, 0); if (UNDEFINED != tmp) wta(UNDEFINED, "missing close paren", name); return fst; } fst = lst = cons(tmp, EOL); while (UNDEFINED != - (tmp = lreadpr(tok_buf, port, (4&flgs) | ((3&flgs) ? 2 : 0)))) { + (tmp = scm_lreadpr(tok_buf, port, (0xC & flgs) | ((3 & flgs) ? 2 : 0)))) { if (EOF_VAL==tmp) wta(lst, s_eofin, s_list); if (i_dot==tmp) { - CDR(lst) = lreadr(tok_buf, port, (4&flgs) | ((3&flgs) ? 1 : 0)); + CDR(lst) = scm_lreadr(tok_buf, port, (0xC & flgs) | ((3 & flgs) ? 1 : 0)); goto closeit; } lst = (CDR(lst) = cons(tmp, EOL)); @@ -1233,7 +1235,7 @@ static int prinarb(exp, port, writing) { lputs("#<arbiter ", port); if (CAR(exp) & (1L<<16)) lputs("locked ", port); - iprin1(CDR(exp), port, writing); + scm_iprin1(CDR(exp), port, writing); lputc('>', port); return !0; } @@ -1359,7 +1361,7 @@ SCM scm_top_level(initpath, toplvl_fun) if (i) i = UNCOOK(i); #endif drloop: - switch ((int)i) { + switch (PTR2INT(i)) { default: { char *name = errmsgs[i-WNA].s_response; @@ -1376,7 +1378,7 @@ SCM scm_top_level(initpath, toplvl_fun) exitval = MAKINUM(EXIT_SUCCESS); errjmp_bad = (char *)0; errjmp_recursive = 0; - lflush(sys_errp); + if (NIMP(sys_errp) && OPOUTPORTP(sys_errp)) lfflush(sys_errp); errno = 0; SIG_deferred = 0; deferred_proc = 0; @@ -1404,7 +1406,7 @@ SCM scm_top_level(initpath, toplvl_fun) ints_disabled = 1; errjmp_bad = (char *)0; errjmp_recursive = 0; - lflush(sys_errp); + if (NIMP(sys_errp) && OPOUTPORTP(sys_errp)) lfflush(sys_errp); SIG_deferred = 0; deferred_proc = 0; gc_hook_active = 0; @@ -1416,8 +1418,8 @@ SCM scm_top_level(initpath, toplvl_fun) if (NIMP(loadports) && OPINPORTP(CAR(loadports))) { if (scm_verbose > 1) { lputs("; Aborting load (closing): ", cur_errp); - display(*loc_loadpath, cur_errp); - newline(cur_errp); + scm_display(*loc_loadpath, cur_errp); + scm_newline(cur_errp); } close_port(CAR(loadports)); /* close loading file. */ } @@ -1436,8 +1438,8 @@ SCM scm_top_level(initpath, toplvl_fun) dowinds(EOL); if (MAKINUM(EXIT_SUCCESS) != exitval) { lputs("; program args: ", cur_errp); - lwrite(progargs, cur_errp); - newline(cur_errp); + scm_write(progargs, cur_errp); + scm_newline(cur_errp); } return exitval; case -3: /* restart. */ @@ -1506,6 +1508,50 @@ SCM scm_port_col(port) } return MAKINUM(col); } + +static char s_file_position[] = "file-position"; +SCM scm_file_position(port, pos) + SCM port, pos; +{ + ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_position); + if (UNBNDP(pos) || FALSEP(pos)) { + long ans; + SYSCALL(ans = ftell(STREAM(port));); + if (ans < 0) return BOOL_F; + if (CRDYP(port)) ans--; + return MAKINUM(ans); + } + ASRTER((INUMP(pos) && (INUM(pos) >= 0)) + || (NIMP(pos) && (TYP16(pos)==tc16_bigpos)), + port, ARG2, s_file_position); +#ifndef RECKLESS + if (TRACKED & SCM_PORTFLAGS(port)) { + if (INUM0==pos) { + int i = SCM_PORTNUM(port); + scm_port_table[i].line = 1L; + scm_port_table[i].col = 1; + } + else { + if (2 <= verbose) + scm_warn("Setting file position for tracked port: ", "", port); + SCM_PORTFLAGS(port) &= (~TRACKED); + } + } +#endif + { + int ans; + CLRDY(port); /* Clear ungetted char */ + SYSCALL(ans = fseek(STREAM(port), INUM(pos), 0);); +#ifdef HAVE_PIPE +# ifdef ESPIPE + if (!OPIOPORTP(port)) + ASRTER(ESPIPE != errno, port, ARG1, s_file_position); +# endif +#endif + return ans ? BOOL_F : BOOL_T; + } +} + static char s_port_filename[] = "port-filename"; SCM scm_port_filename(port) SCM port; @@ -1535,7 +1581,7 @@ void growth_mon(obj, size, units, grewp) lputs((grewp ? "; grew " : "; shrank "), sys_errp); lputs(obj, sys_errp); lputs(" to ", sys_errp); - intprint(size, -10, sys_errp); + scm_intprint(size, -10, sys_errp); lputc(' ', sys_errp); lputs(units, sys_errp); if ((verbose > 4) && (obj==s_heap)) heap_report(); @@ -1563,15 +1609,15 @@ void gc_end() gc_rt = INUM(my_time()) - gc_rt; gc_time_taken = gc_time_taken + gc_rt; if (verbose > 4) { - intprint(time_in_msec(gc_rt), -10, sys_errp); + scm_intprint(time_in_msec(gc_rt), -10, sys_errp); lputs(".ms cpu, ", sys_errp); - intprint(gc_cells_collected, -10, sys_errp); + scm_intprint(gc_cells_collected, -10, sys_errp); lputs(" cells, ", sys_errp); - intprint(gc_malloc_collected, -10, sys_errp); + scm_intprint(gc_malloc_collected, -10, sys_errp); lputs(" malloc, ", sys_errp); - intprint(gc_syms_collected, -10, sys_errp); + scm_intprint(gc_syms_collected, -10, sys_errp); lputs(" syms, ", sys_errp); - intprint(gc_ports_collected, -10, sys_errp); + scm_intprint(gc_ports_collected, -10, sys_errp); lputs(" ports collected\n", sys_errp); } } @@ -1590,26 +1636,26 @@ void repl_report() if (verbose > 2) { lfflush(cur_outp); lputs(";Evaluation took ", cur_errp); - intprint(time_in_msec(INUM(my_time())-rt), -10, cur_errp); + scm_intprint(time_in_msec(INUM(my_time())-rt), -10, cur_errp); lputs(".ms (", cur_errp); - intprint(time_in_msec(gc_time_taken), -10, cur_errp); + scm_intprint(time_in_msec(gc_time_taken), -10, cur_errp); lputs(".ms in gc) ", cur_errp); - intprint(cells_allocated - lcells_allocated, -10, cur_errp); + scm_intprint(cells_allocated - lcells_allocated, -10, cur_errp); lputs(" cells work, ", cur_errp); scm_env_work += scm_ecache_len - scm_ecache_index; - intprint(scm_env_work, -10, cur_errp); + scm_intprint(scm_env_work, -10, cur_errp); lputs(" env, ", cur_errp); - intprint(mallocated - lmallocated, -10, cur_errp); + scm_intprint(mallocated - lmallocated, -10, cur_errp); lputs(".B other\n", cur_errp); if (verbose > 3) { lputc(';', cur_errp); - intprint(scm_gcs, -10, cur_errp); + scm_intprint(scm_gcs, -10, cur_errp); lputs( " gc, ", cur_errp); - intprint(scm_egcs, -10, cur_errp); + scm_intprint(scm_egcs, -10, cur_errp); lputs( " ecache gc, ", cur_errp); - intprint(scm_clo_moved, -10, cur_errp); + scm_intprint(scm_clo_moved, -10, cur_errp); lputs(" env migrated from closures, ", cur_errp); - intprint(scm_stk_moved, -10, cur_errp); + scm_intprint(scm_stk_moved, -10, cur_errp); lputs(" from stack\n", cur_errp); } lfflush(cur_errp); @@ -1631,18 +1677,18 @@ void scm_brk_report() dif2 = (scm_curbrk - scm_dumped_brk)/1024; lputs("initial brk = 0x", cur_errp); - intprint(scm_init_brk, -16, cur_errp); + scm_intprint(scm_init_brk, -16, cur_errp); if (dumped) { lputs(", dumped = 0x", cur_errp); - intprint(scm_dumped_brk, -16, cur_errp); + scm_intprint(scm_dumped_brk, -16, cur_errp); } lputs(", current = 0x", cur_errp); - intprint(scm_curbrk, -16, cur_errp); + scm_intprint(scm_curbrk, -16, cur_errp); lputs("; ", cur_errp); - intprint(dif1, 10, cur_errp); + scm_intprint(dif1, 10, cur_errp); if (dumped) { lputs(dif2 < 0 ? " - " : " + ", cur_errp); - intprint(dif2 < 0 ? -dif2 : dif2, 10, cur_errp); + scm_intprint(dif2 < 0 ? -dif2 : dif2, 10, cur_errp); } lputs(".kiB\n", cur_errp); } @@ -1650,13 +1696,13 @@ void scm_brk_report() SCM lroom(opt) SCM opt; { - intprint(cells_allocated, -10, cur_errp); + scm_intprint(cells_allocated, -10, cur_errp); lputs(" out of ", cur_errp); - intprint(heap_cells, -10, cur_errp); + scm_intprint(heap_cells, -10, cur_errp); lputs(" cells in use, ", cur_errp); - intprint(mallocated, -10, cur_errp); + scm_intprint(mallocated, -10, cur_errp); lputs(".B allocated (of ", cur_errp); - intprint(mtrigger, 10, cur_errp); + scm_intprint(mtrigger, 10, cur_errp); lputs(")\n", cur_errp); if (!UNBNDP(opt)) { #ifndef LACK_SBRK @@ -1671,20 +1717,20 @@ SCM lroom(opt) } void scm_ecache_report() { - intprint(scm_estk_size, 10 , cur_errp); + scm_intprint(scm_estk_size, 10 , cur_errp); lputs(" env stack items, ", cur_errp); - intprint(scm_ecache_len - scm_ecache_index, 10, cur_errp); + scm_intprint(scm_ecache_len - scm_ecache_index, 10, cur_errp); lputs(" out of ", cur_errp); - intprint(scm_ecache_len, 10, cur_errp); + scm_intprint(scm_ecache_len, 10, cur_errp); lputs(" env cells in use.\n", cur_errp); } void exit_report() { if (verbose > 2) { lputs(";Totals: ", cur_errp); - intprint(time_in_msec(INUM(my_time())), -10, cur_errp); + scm_intprint(time_in_msec(INUM(my_time())), -10, cur_errp); lputs(".ms my time, ", cur_errp); - intprint(time_in_msec(INUM(your_time())), -10, cur_errp); + scm_intprint(time_in_msec(INUM(your_time())), -10, cur_errp); lputs(".ms your time\n", cur_errp); } } @@ -1737,8 +1783,8 @@ SCM repl() #ifdef __MSDOS__ if ('\n' != CGETUN(cur_inp)) if (OPOUTPORTP(cur_inp)) /* This case for curses window */ - {lfflush(cur_outp); newline(cur_inp);} - else newline(cur_outp); + {lfflush(cur_outp); scm_newline(cur_inp);} + else scm_newline(cur_outp); #endif if (NIMP(x)) { x = CONSP(x) ? @@ -1751,13 +1797,13 @@ SCM repl() if (IMP(x)) {if (verbose > 2) lputs(";;no values\n", cur_outp);} else if (IMP(CDR(x))) { - iprin1(CAR(x), cur_outp, 1); + scm_iprin1(CAR(x), cur_outp, 1); lputc('\n', cur_outp); } else while (NIMP(x)) { lputc(' ', cur_outp); - iprin1(CAR(x), cur_outp, 1); + scm_iprin1(CAR(x), cur_outp, 1); lputc('\n', cur_outp); x = CDR(x); } @@ -1918,10 +1964,10 @@ SCM scm_load_string(str) void scm_line_msg(file, linum, port) SCM file, linum, port; { - iprin1(file, port, 1); + scm_iprin1(file, port, 1); if (SCM_LINUMP(linum)) { lputs(", line ", port); - intprint(SCM_LINUM(linum), -10, port); + scm_intprint(SCM_LINUM(linum), -10, port); } lputs(": ", port); } @@ -1955,9 +2001,9 @@ static void err_head(str) if (NIMP(lps)) { lputs("\n;In file loaded from ", cur_errp); for (; NIMP(lps); lps = CDR(lps)) { - iprin1(scm_port_filename(CAR(lps)), cur_errp, 0); + scm_iprin1(scm_port_filename(CAR(lps)), cur_errp, 0); lputs(":", cur_errp); - iprin1(scm_port_line(CAR(lps)), cur_errp, 1); + scm_iprin1(scm_port_line(CAR(lps)), cur_errp, 1); lputs(IMP(CDR(lps)) ? ":" : ",\n; loaded from ", cur_errp); } } @@ -1980,7 +2026,7 @@ void scm_warn(str1, str2, obj) lputc('\n', cur_errp); } if (!UNBNDP(obj)) { - iprin1(obj, cur_errp, 1); + scm_iprin1(obj, cur_errp, 1); lputc('\n', cur_errp); } lfflush(cur_errp); @@ -2017,7 +2063,7 @@ static void def_err_response() lputs("RECURSIVE ERROR: ", def_errp); if (badport || TYP16(cur_errp)==tc16_sfport) { lputs("reverting from ", def_errp); - iprin1(cur_errp, def_errp, 2); + scm_iprin1(cur_errp, def_errp, 2); lputs("to default error port\n", def_errp); cur_errp = def_errp; errjmp_recursive = 0; @@ -2061,7 +2107,7 @@ static void def_err_response() if (reset_safeport(sys_safep, 55, cur_errp)) if (0==setjmp(SAFEP_JMPBUF(sys_safep))) { if (codep) scm_princode(obj, EOL, sys_safep, writing); - else iprin1(obj, sys_safep, writing); + else scm_iprin1(obj, sys_safep, writing); } if (UNBNDP(err_exp)) goto getout; if (NIMP(err_exp)) { @@ -2070,9 +2116,9 @@ static void def_err_response() lputs("\n; in expression: ", cur_errp); if (NCONSP(err_exp)) scm_princode(err_exp, env, sys_safep, writing); else if (UNDEFINED==CDR(err_exp)) - iprin1(CAR(err_exp), sys_safep, writing); + scm_iprin1(CAR(err_exp), sys_safep, writing); else { - if (UNBNDP(env)) iprlist("(... ", err_exp, ')', sys_safep, writing); + if (UNBNDP(env)) scm_iprlist("(... ", err_exp, ')', sys_safep, writing); else scm_princode(err_exp, env, sys_safep, writing); } } @@ -2188,9 +2234,11 @@ static char s_isatty[] = "isatty?"; SCM l_isatty(port) SCM port; { + int fn; ASRTER(NIMP(port) && OPPORTP(port), port, ARG1, s_isatty); if (tc16_fport != TYP16(port)) return BOOL_F; - return isatty(fileno(STREAM(port)))?BOOL_T:BOOL_F; + fn = fileno(STREAM(port)); + return (fn >= 0 && isatty(fn)) ? BOOL_T : BOOL_F; } static iproc subr0s[] = { @@ -2221,10 +2269,10 @@ static iproc subr1s[] = { static iproc subr1os[] = { {s_read_char, scm_read_char}, - {s_peek_char, peek_char}, - {s_newline, newline}, + {s_peek_char, scm_peek_char}, + {s_newline, scm_newline}, {s_freshline, scm_freshline}, - {s_flush, lflush}, + {s_force_output, scm_force_output}, {s_char_readyp, char_readyp}, {"quit", quit}, {"verbose", prolixity}, @@ -2233,10 +2281,11 @@ static iproc subr1os[] = { {0, 0}}; static iproc subr2os[] = { - {s_write, lwrite}, - {s_display, display}, - {s_write_char, write_char}, + {s_write, scm_write}, + {s_display, scm_display}, + {s_write_char, scm_write_char}, {s_tryload, tryload}, + {s_file_position, scm_file_position}, #ifdef CAN_DUMP {s_unexec, scm_unexec}, #endif @@ -2274,6 +2323,9 @@ void init_repl( iverbose ) make_subr(s_read, tc7_subr_1o, scm_read); i_eval_string = CAR(sysintern(s_eval_string, UNDEFINED)); i_load_string = CAR(sysintern(s_load_string, UNDEFINED)); + scm_ldstr("\n\ +(define file-set-position file-position)\n\ +"); #ifdef CAN_DUMP add_feature("dump"); scm_ldstr("\ diff --git a/requires.scm b/requires.scm index cad8db0..3703bf9 100644 --- a/requires.scm +++ b/requires.scm @@ -2,12 +2,12 @@ (define library-vicinity (let* ((vl (case (software-type) - ((AMIGA) '(#\: #\/)) - ((MS-DOS WINDOWS ATARIST OS/2) '(#\\ #\/)) - ((MACOS THINKC) '(#\:)) - ((NOSVE) '(#\: #\.)) - ((UNIX COHERENT PLAN9) '(#\/)) - ((VMS) '(#\: #\])))) + ((amiga) '(#\: #\/)) + ((ms-dos windows atarist os/2) '(#\\ #\/)) + ((macos thinkc) '(#\:)) + ((nosve) '(#\: #\.)) + ((unix coherent plan9) '(#\/)) + ((vms) '(#\: #\])))) (iv (implementation-vicinity)) (vc (and (positive? (string-length iv)) (string-ref iv (+ -1 (string-length iv))))) @@ -55,7 +55,7 @@ #endif static char rcsid[] = - "$Id: rgx.c,v 1.16 2002/11/25 20:34:31 jaffer Exp $"; + "$Id: rgx.c,v 1.18 2007/11/24 19:56:56 jaffer Exp $"; #ifdef HAVE_ALLOCA # include <alloca.h> @@ -135,9 +135,9 @@ int prinregex(exp, port, writing) SCM exp; SCM port; int writing; { lputs("#<regex ", port); - intprint(CDR(exp), -16, port); + scm_intprint(CDR(exp), -16, port); lputc(' ', port); - iprin1(RGX_PATTERN(exp), port, writing); + scm_iprin1(RGX_PATTERN(exp), port, writing); lputc('>', port); return 1; } @@ -201,12 +201,12 @@ SCM lregcomp(pattern, flags) info=(regex_info*)CHARS(z); prog = &(info->rgx); #ifdef __REGEXP_LIBRARY_H__ - for(i=sizeof(regex_t);i--;((char *)prog)[i] = 0); + for (i=sizeof(regex_t);i--;((char *)prog)[i] = 0); # ifndef _GNU_SOURCE { regex_t *prog2; prog2 = &(info->rgx_anchored); - for(i=sizeof(regex_t);i--;((char *)prog2)[i] = 0); + for (i=sizeof(regex_t);i--;((char *)prog2)[i] = 0); } # endif #endif @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,7 +121,7 @@ unsigned long num2ulong(num, pos, s_caller) sizet l = NUMDIGS(num); ASRTGO(DIGSPERLONG >= l, errout); res = 0; - for(;l--;) res = BIGUP(res) + BDIGITS(num)[l]; + for (;l--;) res = BIGUP(res) + BDIGITS(num)[l]; return res; } #endif @@ -152,7 +152,7 @@ long num2long(num, pos, s_caller) sizet l = NUMDIGS(num); ASRTGO(DIGSPERLONG >= l, errout); res = 0; - for(;l--;) res = BIGUP(res) + BDIGITS(num)[l]; + for (;l--;) res = BIGUP(res) + BDIGITS(num)[l]; ASRTGO(0<res, errout); return (tc16_bigpos==TYP16(num) ? res : -res); } @@ -219,7 +219,7 @@ SCM makfromstrs(argc, argv) { int i = argc; SCM lst = EOL; - if (0 > i) for(i = 0; argv[i]; i++); + if (0 > i) for (i = 0; argv[i]; i++); while (i--) lst = cons(makfrom0str(argv[i]), lst); return lst; } @@ -232,7 +232,7 @@ char **makargvfrmstrs(args, s_name) char ** argv; int argc = ilength(args); argv = (char **)must_malloc((1L+argc)*sizeof(char *), s_vector); - for(argc = 0; NNULLP(args); args=CDR(args), ++argc) { + for (argc = 0; NNULLP(args); args=CDR(args), ++argc) { ASRTER(NIMP(CAR(args)) && STRINGP(CAR(args)), CAR(args), ARG2, s_name); { sizet len = 1 + LENGTH(CAR(args)); @@ -246,10 +246,10 @@ char **makargvfrmstrs(args, s_name) return argv; } void must_free_argv(argv) - const char * const *argv; + char **argv; { sizet i; - for(i = 0; argv[i]; i++) { + for (i = 0; argv[i]; i++) { must_free(argv[i], 1+strlen(argv[i])); } must_free((char *)argv, i*sizeof(char *)); @@ -295,7 +295,7 @@ int scm_ldprog(path) long aind P((SCM ra, SCM args, const char *what)); unsigned long scm_addr(args, s_name) SCM args; - char *s_name; + const char *s_name; { long pos; unsigned long ptr = 0; /* gratuitous assignment squelches cc warn. */ @@ -356,7 +356,7 @@ unsigned long scm_addr(args, s_name) } unsigned long scm_base_addr(v, s_name) SCM v; - char *s_name; + const char *s_name; { long pos = 0; unsigned long ptr = 0; /* gratuitous assignment squelches cc warn. */ @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2005, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -350,7 +350,7 @@ static SCM big2str(b, radix) } ch = s[0]=='-' ? 1 : 0; /* jeh */ if (ch < j) { /* jeh */ - for(i = j;j < LENGTH(ss);j++) s[ch+j-i] = s[j]; /* jeh */ + for (i = j;j < LENGTH(ss);j++) s[ch+j-i] = s[j]; /* jeh */ resizuve(ss, (SCM)MAKINUM(ch+LENGTH(ss)-i)); /* jeh */ } return ss; @@ -405,7 +405,7 @@ int floprint(sexp, port, writing) return !0; } else #endif - ipruk("float", sexp, port); + scm_ipruk("float", sexp, port); return !0; } int bigprint(exp, port, writing) @@ -420,7 +420,7 @@ int bigprint(exp, port, writing) return !0; } else #endif - ipruk("bignum", exp, port); + scm_ipruk("bignum", exp, port); return !0; } /*** END nums->strs ***/ @@ -884,7 +884,7 @@ SCM eqv(x, y) SCM memv(x, lst) /* m.borza 12.2.91 */ SCM x, lst; { - for(;NIMP(lst);lst = CDR(lst)) { + for (;NIMP(lst);lst = CDR(lst)) { ASRTGO(CONSP(lst), badlst); if (NFALSEP(eqv(CAR(lst), x))) return lst; } @@ -898,7 +898,7 @@ SCM assv(x, alist) /* m.borza 12.2.91 */ SCM x, alist; { SCM tmp; - for(;NIMP(alist);alist = CDR(alist)) { + for (;NIMP(alist);alist = CDR(alist)) { ASRTGO(CONSP(alist), badlst); tmp = CAR(alist); ASRTGO(NIMP(tmp) && CONSP(tmp), badlst); @@ -933,7 +933,7 @@ SCM string2list(str) unsigned char *src; ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_str2list); src = UCHARS(str); - for(i = LENGTH(str)-1;i >= 0;i--) res = cons((SCM)MAKICHR(src[i]), res); + for (i = LENGTH(str)-1;i >= 0;i--) res = cons((SCM)MAKICHR(src[i]), res); return res; } SCM string_copy(str) @@ -951,7 +951,7 @@ SCM string_fill(str, chr) ASRTER(ICHRP(chr), chr, ARG2, s_st_fill); c = ICHR(chr); dst = CHARS(str); - for(k = LENGTH(str)-1;k >= 0;k--) dst[k] = c; + for (k = LENGTH(str)-1;k >= 0;k--) dst[k] = c; return UNSPECIFIED; } SCM vector2list(v) @@ -962,7 +962,7 @@ SCM vector2list(v) SCM *data; ASRTER(NIMP(v) && VECTORP(v), v, ARG1, s_vect2list); data = VELTS(v); - for(i = LENGTH(v)-1;i >= 0;i--) res = cons(data[i], res); + for (i = LENGTH(v)-1;i >= 0;i--) res = cons(data[i], res); return res; } SCM vector_fill(v, fill) @@ -972,14 +972,14 @@ SCM vector_fill(v, fill) register SCM *data; ASRTER(NIMP(v) && VECTORP(v), v, ARG1, s_ve_fill); data = VELTS(v); - for(i = LENGTH(v)-1;i >= 0;i--) data[i] = fill; + for (i = LENGTH(v)-1;i >= 0;i--) data[i] = fill; return UNSPECIFIED; } static SCM vector_equal(x, y) SCM x, y; { long i; - for(i = LENGTH(x)-1;i >= 0;i--) + for (i = LENGTH(x)-1;i >= 0;i--) if (FALSEP(equal(VELTS(x)[i], VELTS(y)[i]))) return BOOL_F; return BOOL_T; } @@ -2697,7 +2697,7 @@ unsigned long hasher(obj, n, d) unsigned long n; sizet d; { - switch (7 & (int) obj) { + switch (7 & PTR2INT(obj)) { case 2: case 6: /* INUMP(obj) */ return INUM(obj) % n; case 4: @@ -12,7 +12,9 @@ scm \- a Scheme Language Interpreter [--version] [--help] .br -[[-]-no-init-file] [-p +[[-]-no-init-file] [--no-symbol-case-fold] +.br +[-p .I int ] [-r .I feature @@ -80,9 +82,12 @@ should allocate an initial heapsize of .I kbytes. This option, if present, must be the first on the command line. .TP -.BI -no-init-file +.BI --no-init-file Inhibits the loading of "ScmInit.scm" as described above. .TP +.BI --no-symbol-case-fold +Symbol (and identifier) names are case-sensitive. +.TP .BI -e expression .TP .BI -c expression @@ -1,4 +1,4 @@ -/* Copyright (C) 1990-2002 Free Software Foundation, Inc. +/* Copyright (C) 1990-2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ #include "patchlvl.h" #ifdef _WIN32 -#include <io.h> +# include <io.h> #endif #ifdef __IBMC__ @@ -111,7 +111,7 @@ void final_repl P((void)); void init_banner() { - fputs("SCM version "SCMVERSION", Copyright (C) 1990-2002 \ + fputs("SCM version "SCMVERSION", Copyright (C) 1990-2006 \ Free Software Foundation.\n\ SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.\n\ This is free software, and you are welcome to redistribute it\n\ @@ -175,19 +175,22 @@ SCM scm_init_extensions() #endif #define SIGNAL_BASE HUP_SIGNAL -#define NUM_SIGNALS (sizeof(sigdesc)/sizeof(sigdesc[0])) /* PROF_SIGNAL appears below because it is the last signal defined in scm.h and in errmsgs in repl.c */ static struct { int signo; SIGRETTYPE (*osig)(); SIGRETTYPE (*nsig)(); } sigdesc[PROF_SIGNAL - SIGNAL_BASE + 1]; + +#define NUM_SIGNALS (sizeof(sigdesc)/sizeof(sigdesc[0])) + void process_signals() { int i, n; unsigned long mask = 1L; + /* printf("process_signals; output_deferred=%d\n", output_deferred); fflush(stdout); */ if (output_deferred) { output_deferred = 0; - lflush(sys_errp); + /* if (NIMP(sys_errp) && OPOUTPORTP(sys_errp)) lfflush(sys_errp); */ } for (n = 0; SIG_deferred && n < NUM_SIGNALS; n++) { if (SIG_deferred & mask) { @@ -289,11 +292,10 @@ static SIGRETTYPE scmable_signal(sig) if (sig == sigdesc[i].signo) break; ASRTER(i >= 0, MAKINUM(sig), s_unksig, ""); #ifdef WINSIGNALS - if (SIGINT == sig) - signal(sig, win32_sigint); + if (SIGINT == sig) signal(sig, win32_sigint); else #endif - signal(sig, scmable_signal); + signal(sig, scmable_signal); if (ints_disabled) { deferred_proc = process_signals; SIG_deferred |= (1L << i); @@ -503,6 +505,7 @@ SCM lticks(i) static SIGRETTYPE (*oldpipe) (); #endif +int case_sensitize_symbols = 0; /* set to 8 to read case-sensitive symbols */ int dumped = 0; /* Is this an invocation of unexec exe? */ #ifdef SHORT_ALIGN @@ -684,20 +687,16 @@ void scm_init_from_argv(argc, argv, script_arg, iverbose, buf0stdin) int buf0stdin; { long i = 0L; - if ((2 <= argc) && argv[1] && (0==strncmp("-a", argv[1], 2))) { - const char *str = (0==argv[1][2] && 3 <= argc && argv[2]) ?argv[2]:&argv[1][2]; - do { - switch (*str) { - case DIGITS: - i = i * 10 + (*str - '0'); - if (i <= 10000L) continue; /* the size limit should match Init.scm */ - default: - i = 0L; - } + int j = 0; + if ((2 <= argc) && argv[1] && (0==strncmp("-a", argv[1], 2))) + i = atol((0==argv[1][2] && 3 <= argc && argv[2]) ? argv[2] : &argv[1][2]); + init_scm(iverbose, buf0stdin, (0 >= i) ? 0L : 1024L * i); /* size in kB */ + for (j = 0; argv[j]; j++) { + if (0==strcmp(argv[j], "--no-symbol-case-fold")) { + case_sensitize_symbols = 8; break; - } while (* ++str); + } } - init_scm(iverbose, buf0stdin, (0 >= i) ? 0L : 1024L * i); /* size in kB */ progargs = EOL; progargs = makfromstrs(argc, argv); sysintern("*script*", script_arg ? makfrom0str(script_arg) : BOOL_F); @@ -7,7 +7,8 @@ NAME SYNOPSIS scm [-a kbytes ] [-muvqib] [--version] [--help] - [[-]-no-init-file] [-p int ] [-r feature ] [-h feature ] + [[-]-no-init-file] [--no-symbol-case-fold] + [-p int ] [-r feature ] [-h feature ] [-d filename ] [-f filename ] [-l filename ] [-c expression ] [-e expression ] [-o dumpname ] [-- | - | -s] [ filename ] [ arguments ... ] @@ -38,9 +39,12 @@ OPTIONS specifies that scm should allocate an initial heapsize of kbytes. This option, if present, must be the first on the command line. - -no-init-file + --no-init-file Inhibits the loading of "ScmInit.scm" as described above. + --no-symbol-case-fold + Symbol (and identifier) names are case-sensitive. + -eexpression -cexpression @@ -1,4 +1,4 @@ -/* Copyright (C) 1990-1999 Free Software Foundation, Inc. +/* Copyright (C) 1990-2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,30 +169,30 @@ typedef struct {SCM type;double *real;} dbl; /* Conditionals should always expect immediates */ /* GCC __builtin_expect() is stubbed in scmfig.h */ -#define IMP(x) SCM_EXPECT_TRUE(6 & (int)(x)) +#define IMP(x) SCM_EXPECT_TRUE(6 & PTR2INT(x)) #define NIMP(x) (!IMP(x)) -#define INUMP(x) SCM_EXPECT_TRUE(2 & (int)(x)) +#define INUMP(x) SCM_EXPECT_TRUE(2 & PTR2INT(x)) #define NINUMP(x) (!INUMP(x)) #define INUM0 ((SCM) 2) -#define ICHRP(x) ((0xff & (int)(x))==0xf4) +#define ICHRP(x) ((0xff & PTR2INT(x))==0xf4) #define ICHR(x) ((unsigned char)((x)>>8)) #define MAKICHR(x) (((x)<<8)+0xf4L) #define ILOC00 (0x000000fcL) -#define ILOCP(n) ((0xff & (int)(n))==(int)ILOC00) +#define ILOCP(n) ((0xff & PTR2INT(n))==PTR2INT(ILOC00)) #define MAKILOC(if, id) (ILOC00 + (((long)id)<<8) + (((long)if)<<16)) -#define IDIST(n) (((int)(n)>>8) & 0x7f) -#define IFRAME(n) (((int)(n)>>16)) +#define IDIST(n) ((PTR2INT(n)>>8) & 0x7f) +#define IFRAME(n) ((PTR2INT(n)>>16)) #define ICDRP(n) (ICDR & (n)) #define ICDR (1L<<15) /* ISYMP tests for ISPCSYM and ISYM */ -#define ISYMP(n) ((0x187 & (int)(n))==4) +#define ISYMP(n) ((0x187 & PTR2INT(n))==4) /* IFLAGP tests for ISPCSYM, ISYM and IFLAG */ -#define IFLAGP(n) ((0x87 & (int)(n))==4) -#define ISYMNUM(n) (((int)((n)>>9)) & 0x7f) -#define ISYMVAL(n) ((int)((n)>>16)) +#define IFLAGP(n) ((0x87 & PTR2INT(n))==4) +#define ISYMNUM(n) ((PTR2INT((n)>>9)) & 0x7f) +#define ISYMVAL(n) (PTR2INT((n)>>16)) #define MAKISYMVAL(isym, val) ((isym) | ((long)(val) <<16)) #define ISYMCHARS(n) (isymnames[ISYMNUM(n)]) #define MAKSPCSYM(n) (((n)<<9)+((n)<<3)+4L) @@ -299,26 +299,26 @@ SCM_EXPORT SCM i_dot, i_quote, i_quasiquote, i_unquote, i_uq_splicing; #define NNULLP(x) (EOL != (x)) #define UNBNDP(x) (UNDEFINED==(x)) #define CELLP(x) (!NCELLP(x)) -#define NCELLP(x) ((sizeof(cell)-1) & (int)(x)) +#define NCELLP(x) ((sizeof(cell)-1) & PTR2INT(x)) -#define GCMARKP(x) (1 & (int)CDR(x)) -#define GC8MARKP(x) (0x80 & (int)CAR(x)) +#define GCMARKP(x) (1 & PTR2INT(CDR(x))) +#define GC8MARKP(x) (0x80 & PTR2INT(CAR(x))) #define SETGCMARK(x) CDR(x) |= 1; #define CLRGCMARK(x) CDR(x) &= ~1L; #define SETGC8MARK(x) CAR(x) |= 0x80; #define CLRGC8MARK(x) CAR(x) &= ~0x80L; -#define TYP3(x) (7 & (int)CAR(x)) -#define TYP7(x) (0x7f & (int)CAR(x)) -#define TYP7S(x) (0x7d & (int)CAR(x)) -#define TYP16(x) (0xffff & (int)CAR(x)) -#define TYP16S(x) (0xfeff & (int)CAR(x)) -#define GCTYP16(x) (0xff7f & (int)CAR(x)) - -#define NCONSP(x) (1 & (int)CAR(x)) +#define TYP3(x) (7 & PTR2INT(CAR(x))) +#define TYP7(x) (0x7f & PTR2INT(CAR(x))) +#define TYP7S(x) (0x7d & PTR2INT(CAR(x))) +#define TYP16(x) (0xffff & PTR2INT(CAR(x))) +#define TYP16S(x) (0xfeff & PTR2INT(CAR(x))) +#define GCTYP16(x) (0xff7f & PTR2INT(CAR(x))) + +#define NCONSP(x) (1 & PTR2INT(CAR(x))) #define CONSP(x) (!NCONSP(x)) #define ECONSP(x) (CONSP(x) || (1==TYP3(x))) #define NECONSP(x) (NCONSP(x) && (1 != TYP3(x))) -#define SCM_GLOCP(x) (tc3_cons_gloc==(7 & (int)(x))) +#define SCM_GLOCP(x) (tc3_cons_gloc==(7 & PTR2INT(x))) #define CAR(x) (((cell *)(SCM2PTR(x)))->car) #define CDR(x) (((cell *)(SCM2PTR(x)))->cdr) @@ -425,9 +425,9 @@ SCM_EXPORT long tc16_env, tc16_ident; # define NUMBERP INUMP # endif #endif -#define NUMP(x) ((0xfcff & (int)CAR(x))==tc7_smob) +#define NUMP(x) ((0xfcff & PTR2INT(CAR(x)))==tc7_smob) #define BIGP(x) (TYP16S(x)==tc16_bigpos) -#define BIGSIGN(x) (0x0100 & (int)CAR(x)) +#define BIGSIGN(x) (0x0100 & PTR2INT(CAR(x))) #define BDIGITS(x) ((BIGDIG *)(CDR(x))) #define NUMDIGS(x) ((sizet)(((unsigned long)CAR(x))>>16)) #define MAKE_NUMDIGS(v, t) ((((v)+0L)<<16)+(t)) @@ -462,7 +462,7 @@ SCM_EXPORT long tc16_array; /*#define ARRAY_NDIM(x) NUMDIGS(x)*/ #define ARRAY_NDIM(x) ((sizet)(CAR(x)>>17)) #define ARRAY_CONTIGUOUS 0x10000 -#define ARRAY_CONTP(x) (ARRAY_CONTIGUOUS & (int)CAR(x)) +#define ARRAY_CONTP(x) (ARRAY_CONTIGUOUS & PTR2INT(CAR(x))) #define ARRAY_BASE(a) (((array *)CDR(a))->base) #define ARRAY_DIMS(a) ((array_dim *)(CHARS(a)+sizeof(array))) @@ -728,7 +728,8 @@ SCM_EXPORT SCM obunhash P((SCM obj)); SCM_EXPORT unsigned long strhash P((unsigned char *str, sizet len, unsigned long n)); SCM_EXPORT unsigned long hasher P((SCM obj, unsigned long n, sizet d)); SCM_EXPORT SCM lroom P((SCM args)); -SCM_EXPORT SCM lflush P((SCM port)); +SCM_EXPORT void lfflush P((SCM port)); +SCM_EXPORT SCM scm_force_output P((SCM port)); SCM_EXPORT void scm_init_gra P((scm_gra *gra, sizet eltsize, sizet len, sizet maxlen, const char *what)); SCM_EXPORT int scm_grow_gra P((scm_gra *gra, char *elt)); @@ -760,9 +761,9 @@ SCM_EXPORT SCM scm_scope_trace P((SCM env)); SCM_EXPORT SCM scm_frame_trace P((SCM contin, SCM nf)); SCM_EXPORT SCM scm_frame2env P((SCM contin, SCM nf)); SCM_EXPORT SCM scm_frame_eval P((SCM contin, SCM nf, SCM expr)); -SCM_EXPORT void iprin1 P((SCM exp, SCM port, int writing)); -SCM_EXPORT void intprint P((long n, int radix, SCM port)); -SCM_EXPORT void iprlist P((char *hdr, SCM exp, int tlr, SCM port, int writing)); +SCM_EXPORT void scm_iprin1 P((SCM exp, SCM port, int writing)); +SCM_EXPORT void scm_intprint P((long n, int radix, SCM port)); +SCM_EXPORT void scm_iprlist P((char *hdr, SCM exp, int tlr, SCM port, int writing)); SCM_EXPORT SCM scm_env_lookup P((SCM var, SCM stenv)); SCM_EXPORT SCM scm_env_rlookup P((SCM addr, SCM stenv, const char *what)); SCM_EXPORT SCM scm_env_getprop P((SCM prop, SCM env)); @@ -861,6 +862,7 @@ SCM_EXPORT SCM assoc P((SCM x, SCM alist)); SCM_EXPORT SCM symbolp P((SCM x)); SCM_EXPORT SCM symbol2string P((SCM s)); SCM_EXPORT SCM string2symbol P((SCM s)); +SCM_EXPORT SCM string_copy P((SCM s)); SCM_EXPORT SCM numberp P((SCM x)); SCM_EXPORT SCM exactp P((SCM x)); SCM_EXPORT SCM inexactp P((SCM x)); @@ -916,7 +918,7 @@ SCM_EXPORT int bigprint P((SCM exp, SCM port, int writing)); SCM_EXPORT int floprint P((SCM sexp, SCM port, int writing)); SCM_EXPORT SCM istr2int P((char *str, long len, long radix)); SCM_EXPORT SCM istr2bve P((char *str, long len)); -SCM_EXPORT void ipruk P((char *hdr, SCM ptr, SCM port)); +SCM_EXPORT void scm_ipruk P((char *hdr, SCM ptr, SCM port)); SCM_EXPORT SCM charp P((SCM x)); SCM_EXPORT SCM char_lessp P((SCM x, SCM y)); SCM_EXPORT SCM chci_eq P((SCM x, SCM y)); @@ -978,15 +980,18 @@ SCM_EXPORT SCM try_open_file P((SCM filename, SCM modes)); SCM_EXPORT SCM open_file P((SCM filename, SCM modes)); SCM_EXPORT SCM open_pipe P((SCM pipestr, SCM modes)); SCM_EXPORT SCM close_port P((SCM port)); +SCM_EXPORT SCM scm_file_position P((SCM port, SCM pos)); +#define file_position(port) scm_file_position(port, BOOL_F) +#define file_set_position scm_file_position SCM_EXPORT SCM scm_read P((SCM port)); SCM_EXPORT SCM scm_read_char P((SCM port)); -SCM_EXPORT SCM peek_char P((SCM port)); +SCM_EXPORT SCM scm_peek_char P((SCM port)); SCM_EXPORT SCM eof_objectp P((SCM x)); SCM_EXPORT int scm_io_error P((SCM port, const char *what)); -SCM_EXPORT SCM lwrite P((SCM obj, SCM port)); -SCM_EXPORT SCM display P((SCM obj, SCM port)); -SCM_EXPORT SCM newline P((SCM port)); -SCM_EXPORT SCM write_char P((SCM chr, SCM port)); +SCM_EXPORT SCM scm_write P((SCM obj, SCM port)); +SCM_EXPORT SCM scm_display P((SCM obj, SCM port)); +SCM_EXPORT SCM scm_newline P((SCM port)); +SCM_EXPORT SCM scm_write_char P((SCM chr, SCM port)); SCM_EXPORT SCM scm_port_line P((SCM port)); SCM_EXPORT SCM scm_port_col P((SCM port)); SCM_EXPORT void scm_line_msg P((SCM file, SCM linum, SCM port)); @@ -1040,22 +1045,23 @@ SCM_EXPORT SCM scm_copybitfield P((SCM to, SCM start, SCM rest)); SCM_EXPORT SCM long2num P((long n)); SCM_EXPORT SCM ulong2num P((unsigned long n)); SCM_EXPORT unsigned char num2uchar P((SCM num, char *pos, char *s_caller)); +SCM_EXPORT signed char num2char P((SCM num, char *pos, char *s_caller)); SCM_EXPORT unsigned short num2ushort P((SCM num, char *pos, char *s_caller)); +SCM_EXPORT short num2short P((SCM num, char *pos, char *s_caller)); SCM_EXPORT unsigned long num2ulong P((SCM num, char *pos, char *s_caller)); SCM_EXPORT long num2long P((SCM num, char *pos, char *s_caller)); -SCM_EXPORT short num2short P((SCM num, char *pos, char *s_caller)); SCM_EXPORT double num2dbl P((SCM num, char *pos, char *s_caller)); SCM_EXPORT SCM makfromstr P((const char *src, sizet len)); SCM_EXPORT SCM makfromstrs P((int argc, const char * const *argv)); SCM_EXPORT SCM makfrom0str P((const char *scr)); SCM_EXPORT char **makargvfrmstrs P((SCM args, const char *s_v)); -SCM_EXPORT void must_free_argv P((const char * const *argv)); +SCM_EXPORT void must_free_argv P((char **argv)); SCM_EXPORT SCM scm_evstr P((char *str)); SCM_EXPORT void scm_ldstr P((char *str)); SCM_EXPORT int scm_ldfile P((char *path)); SCM_EXPORT int scm_ldprog P((char *path)); -SCM_EXPORT unsigned long scm_addr P((SCM args, char *name)); -SCM_EXPORT unsigned long scm_base_addr P((SCM v, char *name)); +SCM_EXPORT unsigned long scm_addr P((SCM args, const char *name)); +SCM_EXPORT unsigned long scm_base_addr P((SCM v, const char *name)); SCM_EXPORT int scm_cell_p P((SCM x)); #ifdef FLOATS @@ -1,24 +1,24 @@ This is scm.info, produced by makeinfo version 4.8 from scm.texi. -This manual is for SCM (version 5e3, October 2006), and algorithmic | -language Scheme implementation. | - | -Copyright (C) 1990-2006 Free Software Foundation, Inc. | - | - Permission is granted to make and distribute verbatim copies of | - this manual provided the copyright notice and this permission | - notice are preserved on all copies. | - | - Permission is granted to copy and distribute modified versions of | - this manual under the conditions for verbatim copying, provided | - that the entire resulting derived work is distributed under the | - terms of a permission notice identical to this one. | - | - Permission is granted to copy and distribute translations of this | - manual into another language, under the above conditions for | - modified versions, except that this permission notice may be | - stated in a translation approved by the author. | - | +This manual is for SCM (version 5e4, November 2007), and algorithmic | +language Scheme implementation. + +Copyright (C) 1990-2007 Free Software Foundation, Inc. | + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission + notice are preserved on all copies. + + Permission is granted to copy and distribute modified versions of + this manual under the conditions for verbatim copying, provided + that the entire resulting derived work is distributed under the + terms of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this + manual into another language, under the above conditions for + modified versions, except that this permission notice may be + stated in a translation approved by the author. + INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY * SCM: (scm). A Scheme interpreter. @@ -27,27 +27,27 @@ END-INFO-DIR-ENTRY File: scm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) -SCM | -*** | +SCM +*** -This manual is for SCM (version 5e3, October 2006), and algorithmic | -language Scheme implementation. | +This manual is for SCM (version 5e4, November 2007), and algorithmic | +language Scheme implementation. -Copyright (C) 1990-2006 Free Software Foundation, Inc. | +Copyright (C) 1990-2007 Free Software Foundation, Inc. | - Permission is granted to make and distribute verbatim copies of | - this manual provided the copyright notice and this permission | - notice are preserved on all copies. | + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission + notice are preserved on all copies. - Permission is granted to copy and distribute modified versions of | - this manual under the conditions for verbatim copying, provided | - that the entire resulting derived work is distributed under the | - terms of a permission notice identical to this one. | + Permission is granted to copy and distribute modified versions of + this manual under the conditions for verbatim copying, provided + that the entire resulting derived work is distributed under the + terms of a permission notice identical to this one. - Permission is granted to copy and distribute translations of this | - manual into another language, under the above conditions for | - modified versions, except that this permission notice may be | - stated in a translation approved by the author. | + Permission is granted to copy and distribute translations of this + manual into another language, under the above conditions for + modified versions, except that this permission notice may be + stated in a translation approved by the author. * Menu: @@ -104,8 +104,8 @@ File: scm.info, Node: SCM Features, Next: SCM Authors, Prev: Overview, Up: O `copy-tree', `acons', and `eval'. * `Char-code-limit', `most-positive-fixnum', `most-negative-fixnum', - `and internal-time-units-per-second' constants. `slib:features' | - and `*load-pathname*' variables. | + `and internal-time-units-per-second' constants. `slib:features' + and `*load-pathname*' variables. * Arrays and bit-vectors. String ports and software emulation ports. I/O extensions providing ANSI C and POSIX.1 facilities. @@ -256,7 +256,7 @@ File: scm.info, Node: SIOD copyright, Prev: The SCM License, Up: Copying -------------------- - COPYRIGHT (C) 1989 BY | + COPYRIGHT (C) 1989 BY PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS. ALL RIGHTS RESERVED @@ -377,7 +377,7 @@ File: scm.info, Node: Making SCM, Next: SLIB, Prev: Installing SCM, Up: Inst The SCM distribution has "Makefile" which contains rules for making "scmlit", a "bare-bones" version of SCM sufficient for running `build'. `build' is used to compile (or create scripts to compile) full -featured versions. +featured versions (*note Building SCM::). | Makefiles are not portable to the majority of platforms. If `Makefile' works for you, good; If not, I don't want to hear about it. If you @@ -406,18 +406,16 @@ SLIB is not _neccessary_ to run SCM, I strongly suggest you obtain and install it. Bug reports about running SCM without SLIB have very low priority. SLIB is available from the same sites as SCM: - * swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz | - - * ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz | + * swiss.csail.mit.edu:/pub/scm/slib3a5.tar.gz | - * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz | + * ftp.gnu.org:/pub/gnu/jacal/slib3a5.tar.gz | -Unpack SLIB (`tar xzf slib3a4.tar.gz' or `unzip -ao slib3a4.zip') in an | +Unpack SLIB (`tar xzf slib3a5.tar.gz' or `unzip -ao slib3a5.zip') in an | appropriate directory for your system; both `tar' and `unzip' will create the directory `slib'. Then create a file `require.scm' in the SCM "implementation-vicinity" -(this is the same directory as where the file `Init5e3.scm' is | +(this is the same directory as where the file `Init5e4.scm' is | installed). `require.scm' should have the contents: (define (library-vicinity) "/usr/local/lib/slib/") @@ -489,7 +487,7 @@ script with the `arrays', `inexact', and `bignums' options as defaults. # unix (linux) script created by SLIB/batch # ================ Write file with C defines rm -f scmflags.h - echo '#define IMPLINIT "Init5e3.scm"'>>scmflags.h | + echo '#define IMPLINIT "Init5e4.scm"'>>scmflags.h | echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h echo '#define ARRAYS'>>scmflags.h @@ -508,7 +506,7 @@ in the `-p' or `--platform=' option. # unix (darwin) script created by SLIB/batch # ================ Write file with C defines rm -f scmflags.h - echo '#define IMPLINIT "Init5e3.scm"'>>scmflags.h | + echo '#define IMPLINIT "Init5e4.scm"'>>scmflags.h | # ================ Compile C source files cc -O3 -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c # ================ Link C object files @@ -549,20 +547,20 @@ the SCM command line options. amiga-dice-c m68000 amiga dcc amiga-gcc m68000 amiga gcc amiga-sas m68000 amiga lc - atari-st-gcc m68000 atari.st gcc - atari-st-turbo-c m68000 atari.st tcc + atari-st-gcc m68000 atari-st gcc | + atari-st-turbo-c m68000 atari-st tcc | borland-c i8086 ms-dos bcc darwin powerpc unix cc djgpp i386 ms-dos gcc - freebsd i386 unix cc + freebsd *unknown* unix cc | gcc *unknown* unix gcc gnu-win32 i386 unix gcc highc i386 ms-dos hc386 hp-ux hp-risc hp-ux cc irix mips irix gcc - linux i386 linux gcc + linux *unknown* linux gcc | linux-aout i386 linux gcc - linux-ia64 ia64 linux gcc | + linux-ia64 ia64 linux gcc microsoft-c i8086 ms-dos cl microsoft-c-nt i386 ms-dos cl microsoft-quick-c i8086 ms-dos qcl @@ -642,7 +640,7 @@ the SCM command line options. -- Build Option: -s PATHNAME -- Build Option: --scheme-initial=PATHNAME specifies that PATHNAME should be the default location of the SCM - initialization file `Init5e3.scm'. SCM tries several likely | + initialization file `Init5e4.scm'. SCM tries several likely | locations before resorting to PATHNAME (*note File-System Habitat::). If not specified, the current directory (where build is building) is used. @@ -725,6 +723,9 @@ the SCM command line options. "byte" Treating strings as byte-vectors. + "byte-number" | + Byte/number conversions | + | "careful-interrupt-masking" Define this for extra checking of interrupt masking and some simple checks for proper use of malloc and free. This is for @@ -756,18 +757,18 @@ the SCM command line options. For the "curses" screen management package. "debug" - Turns on the features `cautious' and | - `careful-interrupt-masking'; uses `-g' flags for debugging | - SCM source code. | + Turns on the features `cautious' and + `careful-interrupt-masking'; uses `-g' flags for debugging + SCM source code. "differ" Sequence comparison - "dont-memoize-locals" | - SCM normally converts references to local variables to ILOCs, | - which make programs run faster. If SCM is badly broken, try | - using this option to disable the MEMOIZE_LOCALS feature. | - | + "dont-memoize-locals" + SCM normally converts references to local variables to ILOCs, + which make programs run faster. If SCM is badly broken, try + using this option to disable the MEMOIZE_LOCALS feature. + "dump" Convert a running scheme program into an executable file. @@ -854,7 +855,7 @@ the SCM command line options. "socket" BSD "socket" interface. Socket addr functions require inexacts or bignums for 32-bit precision. - | + "tick-interrupts" Use if you want the ticks and ticks-interrupt functions. @@ -900,7 +901,7 @@ link your file at compile time, use the `-c' and `-i' options to build: -| #! /bin/sh rm -f scmflags.h - echo '#define IMPLINIT "/home/jaffer/scm/Init5e3.scm"'>>scmflags.h | + echo '#define IMPLINIT "/home/jaffer/scm/Init5e4.scm"'>>scmflags.h | echo '#define COMPILED_INITS init_foo();'>>scmflags.h echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h @@ -916,7 +917,7 @@ To make a dynamically loadable object file use the `-t dll' option: -| #! /bin/sh rm -f scmflags.h - echo '#define IMPLINIT "/home/jaffer/scm/Init5e3.scm"'>>scmflags.h | + echo '#define IMPLINIT "/home/jaffer/scm/Init5e4.scm"'>>scmflags.h | echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h echo '#define ARRAYS'>>scmflags.h @@ -943,9 +944,9 @@ format. For notes about porting to MS-Windows and finishing the port to VMS *Note VMS Dynamic Linking::. "DLD" is a library package of C functions that performs "dynamic link -editing" on Linux, VAX (Ultrix), Sun 3 (SunOS 3.4 and 4.0), -SPARCstation (SunOS 4.0), Sequent Symmetry (Dynix), and Atari ST. It is -available from: +editing" on GNU/Linux, VAX (Ultrix), Sun 3 (SunOS 3.4 and 4.0), | +SPARCstation (SunOS 4.0), Sequent Symmetry (Dynix), and Atari ST. It | +is available from: | * ftp.gnu.org:pub/gnu/dld-3.3.tar.gz @@ -1036,36 +1037,36 @@ No modifications to the emacs source code were required to use or `unexelf.c' don't work for you, try using the appropriate `unex*.c' file from emacs. -The `dscm4' and `dscm5' targets in the SCM `Makefile' save images from | -`udscm4' and `udscm5' executables respectively. | - | -Recent Linux innovations interfere with `dump'. For: | - | -Fedora-Core-1 | - Remove the `#' from the line `#SETARCH = setarch i386' in the | - `Makefile'. | - | -Fedora-Core-3 | - `http://jamesthornton.com/writing/emacs-compile.html' writes: [For | - FC3] combreloc has become the default for recent GNU ld, which | - breaks the unexec/undump on all versions of both Emacs and | - XEmacs... | - | - Override by adding the following to `udscm5.opt': | - `--linker-options="-z nocombreloc"' | - | -Kernels later than 2.6.11 | - `http://www.opensubscriber.com/message/emacs-devel@gnu.org/1007118.html' | - mentions the "exec-shield" feature. Kernels later than 2.6.11 | - must do (as root): | - | - echo 0 > /proc/sys/kernel/randomize_va_space | - | - before dumping. `Makefile' has this `randomize_va_space' stuffing | - scripted for targets `dscm4' and `dscm5'. You must either set | - `randomize_va_space' to 0 or run as root to dump. | - | - | +The `dscm4' and `dscm5' targets in the SCM `Makefile' save images from +`udscm4' and `udscm5' executables respectively. + +Recent GNU/Linux innovations interfere with `dump'. For: | + +Fedora-Core-1 + Remove the `#' from the line `#SETARCH = setarch i386' in the + `Makefile'. + +Fedora-Core-3 + `http://jamesthornton.com/writing/emacs-compile.html' writes: [For + FC3] combreloc has become the default for recent GNU ld, which + breaks the unexec/undump on all versions of both Emacs and + XEmacs... + + Override by adding the following to `udscm5.opt': + `--linker-options="-z nocombreloc"' + +Kernels later than 2.6.11 + `http://www.opensubscriber.com/message/emacs-devel@gnu.org/1007118.html' + mentions the "exec-shield" feature. Kernels later than 2.6.11 + must do (as root): + + echo 0 > /proc/sys/kernel/randomize_va_space + + before dumping. `Makefile' has this `randomize_va_space' stuffing + scripted for targets `dscm4' and `dscm5'. You must either set + `randomize_va_space' to 0 or run as root to dump. + + File: scm.info, Node: Automatic C Preprocessor Definitions, Next: Problems Compiling, Prev: Saving Images, Up: Installing SCM @@ -1107,11 +1108,12 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of AMIGA SAS/C 5.10 or Dice C on AMIGA __amigaos__ Gnu CC on AMIGA atarist ATARI-ST under Gnu CC + __DragonflyBSD__ DragonflyBSD | __FreeBSD__ FreeBSD GNUDOS DJGPP (obsolete in version 1.08) __GO32__ DJGPP (future?) hpux HP-UX - linux Linux + linux GNU/Linux | macintosh Macintosh (THINK_C and __MWERKS__ define) MCH_AMIGA Aztec_c 5.2a on AMIGA __MACH__ Apple Darwin @@ -1121,6 +1123,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of __MSDOS__ Turbo C, Borland C, and DJGPP __NetBSD__ NetBSD nosve Control Data NOS/VE + __OpenBSD__ OpenBSD | SVR2 System V Revision 2. sun SunOS __SVR4 SunOS @@ -1224,17 +1227,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files. recompile scm. add <FLAG> in scmfig.h and recompile scm. -ERROR: Init5e3.scm not found. Assign correct IMPLINIT in makefile | +ERROR: Init5e4.scm not found. Assign correct IMPLINIT in makefile | or scmfig.h. Define environment variable SCM_INIT_PATH to be the full - pathname of Init5e3.scm. | + pathname of Init5e4.scm. | WARNING: require.scm not found. Define environment variable SCHEME_LIBRARY_PATH to be the full pathname of the scheme library [SLIB]. Change library-vicinity in - Init5e3.scm to point to library or | + Init5e4.scm to point to library or | remove. Make sure the value of (library-vicinity) has a trailing @@ -1294,13 +1297,13 @@ Some symbol names print incorrectly. Change memory model option to C than HEAP_SEG_SIZE). ERROR: Rogue pointer in Heap. See above under machine crashes. Newlines don't appear correctly in Check file mode (define OPEN_... in -output files. `Init5e3.scm'). | +output files. `Init5e4.scm'). | Spaces or control characters appear Check character defines in in symbol names. `scmfig.h'. Negative numbers turn positive. Check SRS in `scmfig.h'. -;ERROR: bignum: numerical overflow Increase NUMDIGS_MAX in `scmfig.h' | - and recompile. | -VMS: Couldn't unwind stack. #define CHEAP_CONTINUATIONS in | +;ERROR: bignum: numerical overflow Increase NUMDIGS_MAX in `scmfig.h' + and recompile. +VMS: Couldn't unwind stack. #define CHEAP_CONTINUATIONS in `scmfig.h'. VAX: botched longjmp. @@ -1368,7 +1371,8 @@ File: scm.info, Node: Invoking SCM, Next: SCM Options, Prev: Operational Feat ================ scm [-a kbytes] [-muvbiq] [-version] [-help] - [[-]-no-init-file] [-p int] [-r feature] [-h feature] + [[-]-no-init-file] [--no-symbol-case-fold] | + [-p int] [-r feature] [-h feature] | [-d filename] [-f filename] [-l filename] [-c expression] [-e expression] [-o dumpname] [-- | - | -s] [filename] [arguments ...] @@ -1379,7 +1383,7 @@ variable SCM_INIT_PATH. If SCM_INIT_PATH is not defined or if the file it names is not present, `scm' tries to find the directory containing the executable file. If it is able to locate the executable, `scm' looks for the initialization -file (usually `Init5e3.scm') in platform-dependent directories relative | +file (usually `Init5e4.scm') in platform-dependent directories relative | to this directory. See *Note File-System Habitat:: for a blow-by-blow description. @@ -1388,12 +1392,12 @@ compile parameter IMPLINIT (defined in the makefile or `scmfig.h') is tried. Unless the option `-no-init-file' or `--no-init-file' occurs in the -command line, or if `scm' is being invoked as a script, `Init5e3.scm' | -checks to see if there is file `ScmInit.scm' in the path specified by | -the environment variable HOME (or in the current directory if HOME is | -undefined). If it finds such a file, then it is loaded. | +command line, or if `scm' is being invoked as a script, `Init5e4.scm' | +checks to see if there is file `ScmInit.scm' in the path specified by +the environment variable HOME (or in the current directory if HOME is +undefined). If it finds such a file, then it is loaded. -`Init5e3.scm' then looks for command input from one of three sources: | +`Init5e4.scm' then looks for command input from one of three sources: | From an option on the command line, from a file named on the command line, or from standard input. @@ -1421,6 +1425,9 @@ The options are processed in the order specified on the command line. -- Command Option: --no-init-file Inhibits the loading of `ScmInit.scm' as described above. + -- Command Option: -no-symbol-case-fold | + Symbol (and identifier) names will be case sensitive. | + | -- Command Option: --help prints usage information and URI; then exit. @@ -1554,13 +1561,13 @@ File: scm.info, Node: SCM Variables, Next: SCM Session, Prev: Invocation Exam -- Environment Variable: SCM_INIT_PATH is the pathname where `scm' will look for its initialization code. - The default is the file `Init5e3.scm' in the source directory. | + The default is the file `Init5e4.scm' in the source directory. | -- Environment Variable: SCHEME_LIBRARY_PATH is the [SLIB] Scheme library directory. -- Environment Variable: HOME - is the directory where `Init5e3.scm' will look for the user | + is the directory where `Init5e4.scm' will look for the user | initialization file `ScmInit.scm'. -- Environment Variable: EDITOR @@ -1684,8 +1691,8 @@ File: scm.info, Node: Debugging Scheme Code, Next: Debugging Continuations, P 3.8 Debugging Scheme Code ========================= -The `cautious' option of `build' (*note Build Options::) supports | -debugging in Scheme. | +The `cautious' option of `build' (*note Build Options::) supports +debugging in Scheme. "CAUTIOUS" If SCM is built with the `CAUTIOUS' flag, then when an error @@ -1705,11 +1712,11 @@ debugging in Scheme. | with <C-c>, inspect or modify top-level values, trace or untrace procedures, and continue execution with `(continue)'. -If `verbose' (*note verbose: Internal State.) is called with an | -argument greater than 2, then the interpreter will check stack size | -periodically. If the size of stack in use exceeds the C #define | -`STACK_LIMIT' (default is `HEAP_SEG_SIZE'), SCM generates a `stack' | -`segment violation'. | +If `verbose' (*note verbose: Internal State.) is called with an +argument greater than 2, then the interpreter will check stack size +periodically. If the size of stack in use exceeds the C #define +`STACK_LIMIT' (default is `HEAP_SEG_SIZE'), SCM generates a `stack' +`segment violation'. There are several SLIB macros which so useful that SCM automatically loads the appropriate module from SLIB if they are invoked. @@ -1979,13 +1986,13 @@ warnings and errors. -- Function: warn arg1 arg2 arg3 ... Alias for *Note slib:warn: (slib)System. Outputs an error message - containing the arguments. `warn' is defined in `Init5e3.scm'. | + containing the arguments. `warn' is defined in `Init5e4.scm'. | -- Function: error arg1 arg2 arg3 ... Alias for *Note slib:error: (slib)System. Outputs an error message containing the arguments, aborts evaluation of the current form and resumes the top level read-eval-print loop. `Error' is - defined in `Init5e3.scm'. | + defined in `Init5e4.scm'. | If SCM is built with the `CAUTIOUS' flag, then when an error occurs, a "stack trace" of certain pending calls are printed as part of the @@ -2003,7 +2010,7 @@ with Lisp systems. -- Function: stack-trace Prints information describing the stack of partially evaluated expressions. `stack-trace' returns `#t' if any lines were printed - and `#f' otherwise. See `Init5e3.scm' for an example of the use | + and `#f' otherwise. See `Init5e4.scm' for an example of the use | of `stack-trace'. @@ -2028,10 +2035,10 @@ a convenient aid to locating bugs and untested expressions. * The names of identifiers which are not lexiallly bound but defined at top-level have #@ prepended. -For instance, `open-input-file' is defined as follows in `Init5e3.scm': | +For instance, `open-input-file' is defined as follows in `Init5e4.scm': | (define (open-input-file str) - (or (open-file str OPEN_READ) + (or (open-file str open_read) | (and (procedure? could-not-open) (could-not-open) #f) (error "OPEN-INPUT-FILE couldn't open file " str))) @@ -2077,7 +2084,7 @@ File: scm.info, Node: Internal State, Next: Scripting, Prev: Memoized Express *INTERACTIVE* is controlled directly by the command-line options `-b', `-i', and `-s' (*note Invoking SCM::). If none of these options are specified, the rules to determine interactivity are - more complicated; see `Init5e3.scm' for details. | + more complicated; see `Init5e4.scm' for details. | -- Function: abort Resumes the top level Read-Eval-Print loop. @@ -2111,8 +2118,8 @@ File: scm.info, Node: Internal State, Next: Scripting, Prev: Memoized Express >= 3 the CPU time is printed after each top level form evaluated; - notifications of heap growth printed; the interpreter checks | - stack depth periodically. | + notifications of heap growth printed; the interpreter checks + stack depth periodically. >= 4 a garbage collection summary is printed after each top level @@ -2132,7 +2139,7 @@ File: scm.info, Node: Internal State, Next: Scripting, Prev: Memoized Express #t)' also gives the hexadecimal heap segment and stack bounds. -- Constant: *scm-version* - Contains the version string (e.g. `5e3') of SCM. | + Contains the version string (e.g. `5e4') of SCM. | 3.12.1 Executable path ---------------------- @@ -2744,8 +2751,8 @@ File: scm.info, Node: Opening and Closing, Next: Port Properties, Prev: Files reading, writing, and both reading and writing respectively. Both input and output functions can be used with io-ports. An end - of file must be read or a file-set-position done on the port - between a read operation and a write operation or vice-versa. + of file must be read or a two-argument file-position done on the | + port between a read operation and a write operation or vice-versa. | -- Function: _ionbf modestr Returns a version of MODESTR which when `open-file' is called with @@ -2794,6 +2801,17 @@ File: scm.info, Node: Port Properties, Next: Port Redirection, Prev: Opening Returns the filename PORT was opened with. If PORT is not open to a file the result is unspecified. + -- Function: file-position port | + -- Function: file-position port #f | + Returns the current position of the character in PORT which will | + next be read or written. If PORT is open to a non-file then `#f' | + is returned. | + | + -- Function: file-position port k | + Sets the current position in PORT which will next be read or | + written. If successful, `#f' is returned. If PORT is open to a | + non-file, then `file-position' returns `#f'. | + | -- Function: port-line port -- Function: port-column port If PORT is a tracked port, return the current line (column) number, @@ -3050,13 +3068,13 @@ File: scm.info, Node: Common-Lisp Read Syntax, Next: Load Syntax, Prev: Lexic `m-' prefixes may be combined. -- Read syntax: #+ feature form - If feature is `provided?' then FORM is read as a scheme | - expression. If not, then FORM is treated as whitespace. | + If feature is `provided?' then FORM is read as a scheme + expression. If not, then FORM is treated as whitespace. Feature is a boolean expression composed of symbols and `and', `or', and `not' of boolean expressions. - For more information on `provided?', *Note Require: (slib)Require. | + For more information on `provided?', *Note Require: (slib)Require. -- Read syntax: #- feature form is equivalent to `#+(not feature) expression'. @@ -3707,7 +3725,7 @@ of load and ([SLIB]) require specified here are supported. The The LIB1 ... pathnames specify additional libraries which may be needed for object files not produced by the Hobbit compiler. For - instance, crs is linked on Linux by + instance, crs is linked on GNU/Linux by | (load (in-vicinity (implementation-vicinity) "crs.o") (usr:lib "ncurses") (usr:lib "c")) @@ -3908,35 +3926,35 @@ operations: (r5rs)Numerical operations. -- Function: atanh z Return the inverse hyperbolic sine, cosine, and tangent of Z - -- Function: real-sqrt x | - -- Function: real-exp x | - -- Function: real-ln x | - -- Function: real-sin x | - -- Function: real-cos x | - -- Function: real-tan x | - -- Function: real-asin x | - -- Function: real-acos x | - -- Function: real-atan x | - -- Function: real-sinh x | - -- Function: real-cosh x | - -- Function: real-tanh x | - -- Function: real-asinh x | - -- Function: real-acosh x | - -- Function: real-atanh x | + -- Function: real-sqrt x + -- Function: real-exp x + -- Function: real-ln x + -- Function: real-sin x + -- Function: real-cos x + -- Function: real-tan x + -- Function: real-asin x + -- Function: real-acos x + -- Function: real-atan x + -- Function: real-sinh x + -- Function: real-cosh x + -- Function: real-tanh x + -- Function: real-asinh x + -- Function: real-acosh x + -- Function: real-atanh x Real-only versions of these popular functions. The argument X must be a real number. It is an error if the value which should be returned by a call to these procedures is _not_ real. - -- Function: real-log10 x | + -- Function: real-log10 x Real-only base 10 logarithm. -- Function: $atan2 y x Computes `(angle (make-rectangular x y))' for real numbers Y and X. - -- Function: real-expt x1 x2 | + -- Function: real-expt x1 x2 Returns real number X1 raised to the real power X2. It is an - error if the value which should be returned by a call to | - `real-expt' is not real. | + error if the value which should be returned by a call to + `real-expt' is not real. File: scm.info, Node: Arrays, Next: Records, Prev: Numeric, Up: Packages @@ -4193,7 +4211,7 @@ SCM has some extra functions in feature `array-for-each': -- Function: array-equal? array0 array1 ... Returns `#t' iff all arguments are arrays with the same shape, the same type, and have corresponding elements which are either - `equal?' or `array-equal?'. This function differs from `equal?' + `equal?' or `array-equal?'. This function differs from `equal?' in that a one dimensional shared array may be ARRAY-EQUAL? but not EQUAL? to a vector or uniform vector. @@ -4309,18 +4327,7 @@ I/O: (slib)Line I/O, and the following functions are defined: -- Function: getpid Returns the process ID of the current process. - - -- Function: file-position port - Returns the current position of the character in PORT which will - next be read or written. If PORT is not open to a file the result - is unspecified. - - -- Function: file-set-position port integer - Sets the current position in PORT which will next be read or - written. If PORT is not open to a file the action of - `file-set-position' is unspecified. The result of - `file-set-position' is unspecified. - + | -- Function: try-create-file name modes perms If the file with name NAME already exists, return `#f', otherwise try to create and open the file like `try-open-file', *Note Files @@ -4383,7 +4390,7 @@ I/O: (slib)Line I/O, and the following functions are defined: "Link.scm" "Macro.scm" "Transcen.scm" - "Init5e3.scm" | + "Init5e4.scm" | -- Function: mkdir path mode The `mkdir' function creates a new, empty directory whose name is @@ -5626,9 +5633,9 @@ sockets for multiple connections without input blocking. (next (cdr con-list))) (else (for-each (lambda (con) - (file-set-position con 0) + (file-position con 0) | (write-char c con) - (file-set-position con 0)) + (file-position con 0)) connections) (cons con (next (cdr con-list))))))) (else (cons con (next (cdr con-list))))))))))))) @@ -5654,9 +5661,9 @@ you can use a client written in scheme: (ct (and actives (memq (current-input-port) actives) (read-char)))) (cond ((or (eof-object? cs) (eof-object? ct)) (close-port con)) (else (cond (cs (display cs))) - (cond (ct (file-set-position con 0) + (cond (ct (file-position con 0) | (display ct con) - (file-set-position con 0))) + (file-position con 0))) | (go))))) (cond (con (display "Connecting to ") (display (getpeername con)) @@ -5968,34 +5975,34 @@ memory allocated by `malloc'. Returns the C array of `char's or as `unsigned char's holding the elements of string X or its length, respectively. - -- Header: tc7_Vbool | + -- Header: tc7_Vbool uniform vector of booleans (bit-vector) - -- Header: tc7_VfixZ32 | + -- Header: tc7_VfixZ32 uniform vector of integers - -- Header: tc7_VfixN32 | + -- Header: tc7_VfixN32 uniform vector of non-negative integers - -- Header: tc7_VfixN16 | - uniform vector of non-negative short integers | - | - -- Header: tc7_VfixZ16 | + -- Header: tc7_VfixN16 + uniform vector of non-negative short integers + + -- Header: tc7_VfixZ16 uniform vector of short integers - -- Header: tc7_VfixN8 | - uniform vector of non-negative bytes | - | - -- Header: tc7_VfixZ8 | - uniform vector of signed bytes | - | - -- Header: tc7_VfloR32 | + -- Header: tc7_VfixN8 + uniform vector of non-negative bytes + + -- Header: tc7_VfixZ8 + uniform vector of signed bytes + + -- Header: tc7_VfloR32 uniform vector of short inexact real numbers - -- Header: tc7_VfloR64 | + -- Header: tc7_VfloR64 uniform vector of double precision inexact real numbers - -- Header: tc7_VfloC64 | + -- Header: tc7_VfloC64 uniform vector of double precision inexact complex numbers -- Header: tc7_contin @@ -6052,11 +6059,11 @@ type `SCM'. enabled, the `CDR' should be a function which takes and returns type `double'. Conversions are handled in the interpreter. - `floor', `ceiling', `truncate', `round', `real-sqrt', `real-exp', | - `real-ln', `real-sin', `real-cos', `real-tan', `real-asin', | - `real-acos', `real-atan', `real-sinh', `real-cosh', `real-tanh', | - `real-asinh', `real-acosh', `real-atanh', and `exact->inexact' are | - defined this way. | + `floor', `ceiling', `truncate', `round', `real-sqrt', `real-exp', + `real-ln', `real-sin', `real-cos', `real-tan', `real-asin', + `real-acos', `real-atan', `real-sinh', `real-cosh', `real-tanh', + `real-asinh', `real-acosh', `real-atanh', and `exact->inexact' are + defined this way. If the `CDR' is `0' (`NULL'), the name string of the procedure is used to control traversal of its list structure argument. @@ -6237,8 +6244,8 @@ Defining Smobs::). These are the initial smobs: Conventional Arrays have a pointer to a vector for their `CDR'. Uniform Arrays have a pointer to a Uniform Vector type (string, - Vbool, VfixZ32, VfixN32, VfloR32, VfloR64, or VfloC64) in their | - `CDR'. | + Vbool, VfixZ32, VfixN32, VfloR32, VfloR64, or VfloC64) in their + `CDR'. File: scm.info, Node: Data Type Representations, Prev: Smob Cells, Up: Data Types @@ -6268,34 +6275,34 @@ ssymbol .........long length....G0000101 ..........char *chars........... msymbol .........long length....G0000111 ..........char *chars........... string .........long length....G0001101 ..........char *chars........... vector .........long length....G0001111 ...........SCM **elts........... -Vbool .........long length....G0010101 ..........long *words........... | - spare 00010111 | -VfixN8 .........long length....G0011101 ......unsigned char *words...... | -VfixZ8 .........long length....G0011111 ..........char *words........... | -VfixN16 .........long length....G0100101 ......unsigned short *words..... | -VfixZ16 .........long length....G0100111 ........ short *words........... | -VfixN32 .........long length....G0101101 ......unsigned long *words...... | -VfixZ32 .........long length....G0101111 ..........long *words........... | -VfloR32 .........long length....G0110101 .........float *words........... | -VfloC32 .........long length....G0110111 .........float *words........... | -VfloR64 .........long length....G0111101 ........double *words........... | -VfloC64 .........long length....G0111111 ........double *words........... | - - spare 01000101 | -contin .........long length....G1001101 .............*regs.............. | -specfun ................xxxxxxxxG1001111 ...........SCM name............. | -cclo ..short length..xxxxxx10G1001111 ...........SCM **elts........... | +Vbool .........long length....G0010101 ..........long *words........... + spare 00010111 +VfixN8 .........long length....G0011101 ......unsigned char *words...... +VfixZ8 .........long length....G0011111 ..........char *words........... +VfixN16 .........long length....G0100101 ......unsigned short *words..... +VfixZ16 .........long length....G0100111 ........ short *words........... +VfixN32 .........long length....G0101101 ......unsigned long *words...... +VfixZ32 .........long length....G0101111 ..........long *words........... +VfloR32 .........long length....G0110101 .........float *words........... +VfloC32 .........long length....G0110111 .........float *words........... +VfloR64 .........long length....G0111101 ........double *words........... +VfloC64 .........long length....G0111111 ........double *words........... + + spare 01000101 +contin .........long length....G1001101 .............*regs.............. +specfun ................xxxxxxxxG1001111 ...........SCM name............. +cclo ..short length..xxxxxx10G1001111 ...........SCM **elts........... PTOBs - port int portnum.CwroxxxxxxxxG1000111 ..........FILE *stream.......... | - socket int portnum.C001xxxxxxxxG1000111 ..........FILE *stream.......... | - inport int portnum.C011xxxxxxxxG1000111 ..........FILE *stream.......... | -outport int portnum.0101xxxxxxxxG1000111 ..........FILE *stream.......... | - ioport int portnum.C111xxxxxxxxG1000111 ..........FILE *stream.......... | -fport int portnum.C 00000000G1000111 ..........FILE *stream.......... | -pipe int portnum.C 00000001G1000111 ..........FILE *stream.......... | -strport 00000000000.0 00000010G1000111 ..........FILE *stream.......... | -sfport int portnum.C 00000011G1000111 ..........FILE *stream.......... | - SUBRs | + port int portnum.CwroxxxxxxxxG1000111 ..........FILE *stream.......... + socket int portnum.C001xxxxxxxxG1000111 ..........FILE *stream.......... + inport int portnum.C011xxxxxxxxG1000111 ..........FILE *stream.......... +outport int portnum.0101xxxxxxxxG1000111 ..........FILE *stream.......... + ioport int portnum.C111xxxxxxxxG1000111 ..........FILE *stream.......... +fport int portnum.C 00000000G1000111 ..........FILE *stream.......... +pipe int portnum.C 00000001G1000111 ..........FILE *stream.......... +strport 00000000000.0 00000010G1000111 ..........FILE *stream.......... +sfport int portnum.C 00000011G1000111 ..........FILE *stream.......... + SUBRs subr_0 ..........int hpoff.....01010101 ...........SCM (*f)()........... subr_1 ..........int hpoff.....01010111 ...........SCM (*f)()........... cxr ..........int hpoff.....01011101 .........double (*f)().......... @@ -6397,7 +6404,7 @@ symbols, "symhash". mark bit in OBJ, then calls `gc_mark()' on any SCM components of OBJ. The last call to `gc_mark()' is tail-called (looped). - -- Function: void mark_locations (STACKITEM X[], sizet LEN) | + -- Function: void mark_locations (STACKITEM X[], sizet LEN) The function `mark_locations' is used for marking segments of C-stack or saved segments of C-stack (marked continuations). The argument LEN is the size of the stack in units of size @@ -6722,12 +6729,12 @@ To add a package of new procedures to scm (see `crs.c' for example): add_feature("foo"); - will append a symbol `'foo' to the (list) value of `slib:features'. | + will append a symbol `'foo' to the (list) value of `slib:features'. 7. put any scheme code which needs to be run as part of your package into `Ifoo.scm'. - 8. put an `if' into `Init5e3.scm' which loads `Ifoo.scm' if your | + 8. put an `if' into `Init5e4.scm' which loads `Ifoo.scm' if your | package is included: (if (defined? twiddle-bits!) @@ -7027,7 +7034,7 @@ SCM, then you can replace `scm_find_implpath'. environment variable is defined, its value will be returned from `scm_find_implpath'. Otherwise find_impl_file() is called with the arguments EXECPATH, GENERIC_NAME (default "scm"), INIT_FILE_NAME - (default "Init5e3_scm"), and the directory separator string | + (default "Init5e4_scm"), and the directory separator string | DIRSEP. If find_impl_file() returns 0 and IMPLINIT is defined, then a copy of the string IMPLINIT is returned. @@ -7150,7 +7157,7 @@ Here is a minimal embedding program `libtest.c': -| dld_find_executable(./libtest): /home/jaffer/scm/libtest - implpath: /home/jaffer/scm/Init5e3.scm | + implpath: /home/jaffer/scm/Init5e4.scm | This is libtest_init_user_scm hello world @@ -7166,7 +7173,7 @@ The source code for these routines are found in `rope.c'. -- Function: int scm_ldfile (char *FILE) Loads the Scheme source file FILE. Returns 0 if successful, non-0 if not. This function is used to load SCM's initialization file - `Init5e3.scm'. | + `Init5e4.scm'. | -- Function: int scm_ldprog (char *FILE) Loads the Scheme source file `(in-vicinity (program-vicinity) @@ -7586,7 +7593,7 @@ File: scm.info, Node: Executable Pathname, Next: Script Support, Prev: File-S 6.3.2 Executable Pathname ------------------------- -For purposes of finding `Init5e3.scm', dumping an executable, and | +For purposes of finding `Init5e4.scm', dumping an executable, and | dynamic linking, a SCM session needs the pathname of its executable image. @@ -7831,24 +7838,24 @@ with a VMS system needs to finish and debug it. File: scm.info, Node: Index, Prev: The Implementation, Up: Top -Index | -***** | +Index +***** -Procedure and Macro Index | -========================= | +Procedure and Macro Index +************************* * Menu: * #!: Unix Scheme Scripts. (line 40) * #': Common-Lisp Read Syntax. - (line 49) | + (line 49) * #+: Common-Lisp Read Syntax. (line 16) * #-: Common-Lisp Read Syntax. - (line 25) | + (line 25) * #.: Common-Lisp Read Syntax. - (line 38) | + (line 38) * #;text-till-end-of-line: Documentation and Comments. (line 31) * #?column: Load Syntax. (line 12) @@ -7857,58 +7864,59 @@ Procedure and Macro Index | * #\token: Common-Lisp Read Syntax. (line 7) * #|: Common-Lisp Read Syntax. - (line 28) | -* $atan2: Numeric. (line 59) | -* -: SCM Options. (line 108) -* ---: SCM Options. (line 109) -* ---c-source-files=: Build Options. (line 134) | -* ---compiler-options=: Build Options. (line 119) | -* ---defines=: Build Options. (line 112) | -* ---features=: Build Options. (line 192) | -* ---help: SCM Options. (line 20) -* ---initialization=: Build Options. (line 142) | -* ---libraries=: Build Options. (line 104) | -* ---linker-options=: Build Options. (line 122) | + (line 28) +* $atan2: Numeric. (line 59) +* -: SCM Options. (line 111) +* ---: SCM Options. (line 112) +* ---c-source-files=: Build Options. (line 134) +* ---compiler-options=: Build Options. (line 119) +* ---defines=: Build Options. (line 112) +* ---features=: Build Options. (line 192) +* ---help: SCM Options. (line 23) +* ---initialization=: Build Options. (line 142) +* ---libraries=: Build Options. (line 104) +* ---linker-options=: Build Options. (line 122) * ---no-init-file: SCM Options. (line 17) -* ---object-files=: Build Options. (line 138) | -* ---outname=: Build Options. (line 98) | +* ---object-files=: Build Options. (line 138) +* ---outname=: Build Options. (line 98) * ---platform=: Build Options. (line 12) -* ---scheme-initial=: Build Options. (line 126) | -* ---type=: Build Options. (line 147) | -* ---version: SCM Options. (line 23) -* --batch-dialect=: Build Options. (line 165) | -* --script-name=: Build Options. (line 187) | +* ---scheme-initial=: Build Options. (line 126) +* ---type=: Build Options. (line 147) +* ---version: SCM Options. (line 26) +* --batch-dialect=: Build Options. (line 165) +* --no-symbol-case-fold: SCM Options. (line 20) +* --script-name=: Build Options. (line 187) * -a: SCM Options. (line 9) -* -b: SCM Options. (line 98) -* -c <1>: SCM Options. (line 46) -* -c: Build Options. (line 133) | -* -d: SCM Options. (line 42) -* -D: Build Options. (line 111) | -* -e: SCM Options. (line 45) -* -f: SCM Options. (line 37) -* -F: Build Options. (line 191) | -* -f: Build Options. (line 69) | -* -h <1>: SCM Options. (line 33) -* -h: Build Options. (line 164) | -* -i <1>: SCM Options. (line 88) -* -i: Build Options. (line 141) | -* -j: Build Options. (line 137) | -* -l <1>: SCM Options. (line 36) -* -l: Build Options. (line 103) | -* -m: SCM Options. (line 75) +* -b: SCM Options. (line 101) +* -c <1>: SCM Options. (line 49) +* -c: Build Options. (line 133) +* -d: SCM Options. (line 45) +* -D: Build Options. (line 111) +* -e: SCM Options. (line 48) +* -f: SCM Options. (line 40) +* -F: Build Options. (line 191) +* -f: Build Options. (line 69) +* -h <1>: SCM Options. (line 36) +* -h: Build Options. (line 164) +* -i <1>: SCM Options. (line 91) +* -i: Build Options. (line 141) +* -j: Build Options. (line 137) +* -l <1>: SCM Options. (line 39) +* -l: Build Options. (line 103) +* -m: SCM Options. (line 78) * -no-init-file: SCM Options. (line 16) -* -o <1>: SCM Options. (line 52) -* -o: Build Options. (line 97) | -* -p <1>: SCM Options. (line 62) +* -o <1>: SCM Options. (line 55) +* -o: Build Options. (line 97) +* -p <1>: SCM Options. (line 65) * -p: Build Options. (line 11) -* -q: SCM Options. (line 71) -* -r: SCM Options. (line 26) -* -s <1>: SCM Options. (line 103) -* -s: Build Options. (line 125) | -* -t: Build Options. (line 146) | -* -u: SCM Options. (line 82) -* -v: SCM Options. (line 66) -* -w: Build Options. (line 186) | +* -q: SCM Options. (line 74) +* -r: SCM Options. (line 29) +* -s <1>: SCM Options. (line 106) +* -s: Build Options. (line 125) +* -t: Build Options. (line 146) +* -u: SCM Options. (line 85) +* -v: SCM Options. (line 69) +* -w: Build Options. (line 186) * @apply: Environment Frames. (line 54) * @copy-tree: Storage. (line 16) * @macroexpand1: Syntactic Hooks for Hygienic Macros. @@ -7917,7 +7925,7 @@ Procedure and Macro Index | * _ionbf: Opening and Closing. (line 28) * _tracked: Opening and Closing. (line 35) * abort: Internal State. (line 15) -* access: I/O-Extensions. (line 181) +* access: I/O-Extensions. (line 170) * acct: Unix Extensions. (line 34) * acons: Storage. (line 21) * acosh: Numeric. (line 33) @@ -7959,25 +7967,25 @@ Procedure and Macro Index | * CAR: Cells. (line 23) * cbreak: Terminal Mode Setting. (line 12) -* CCLO_LENGTH: Header Cells. (line 110) | +* CCLO_LENGTH: Header Cells. (line 110) * CDR: Cells. (line 24) * char: Type Conversions. (line 27) -* char-ready: Port Properties. (line 39) +* char-ready: Port Properties. (line 50) * char-ready? <1>: Socket. (line 66) -* char-ready?: Port Properties. (line 37) +* char-ready?: Port Properties. (line 48) * char:sharp: Modifying Read Syntax. (line 23) * CHARS: Header Cells. (line 35) -* chdir: I/O-Extensions. (line 145) +* chdir: I/O-Extensions. (line 134) * CHEAP_CONTINUATIONS: Continuations. (line 37) -* chmod: I/O-Extensions. (line 160) +* chmod: I/O-Extensions. (line 149) * chown: Posix Extensions. (line 255) * clearok: Output Options Setting. (line 11) * close-port <1>: Window Manipulation. (line 24) * close-port <2>: Posix Extensions. (line 35) * close-port: Opening and Closing. (line 55) -* closedir: I/O-Extensions. (line 101) +* closedir: I/O-Extensions. (line 90) * CLOSEDP: Ptob Cells. (line 43) * CLOSUREP: Cells. (line 49) * CODE: Cells. (line 52) @@ -7988,7 +7996,7 @@ Procedure and Macro Index | * cosh: Numeric. (line 28) * could-not-open: Interrupts. (line 66) * current-error-port: Port Redirection. (line 7) -* current-input-port: Port Properties. (line 43) +* current-input-port: Port Properties. (line 54) * current-time: Time. (line 24) * default-input-port: Line Editing. (line 21) * default-output-port: Line Editing. (line 25) @@ -7998,11 +8006,11 @@ Procedure and Macro Index | * defmacro: Defmacro. (line 6) * defsyntax: Macro Primitives. (line 36) * defvar: Define and Set. (line 13) -* directory-for-each: I/O-Extensions. (line 105) +* directory-for-each: I/O-Extensions. (line 94) * display: Output. (line 9) * dld_find_executable: Executable Pathname. (line 18) * dump: Dump. (line 33) -* duplicate-port: I/O-Extensions. (line 78) +* duplicate-port: I/O-Extensions. (line 67) * dyn:call: Dynamic Linking. (line 79) * dyn:link: Dynamic Linking. (line 71) * dyn:main-call: Dynamic Linking. (line 91) @@ -8021,17 +8029,16 @@ Procedure and Macro Index | * eval: Eval and Load. (line 21) * eval-string: Eval and Load. (line 24) * exec-self: Internal State. (line 27) -* execl: I/O-Extensions. (line 207) -* execlp: I/O-Extensions. (line 208) -* execpath: Internal State. (line 79) | -* execv: I/O-Extensions. (line 218) -* execvp: I/O-Extensions. (line 219) +* execl: I/O-Extensions. (line 196) +* execlp: I/O-Extensions. (line 197) +* execpath: Internal State. (line 79) +* execv: I/O-Extensions. (line 207) +* execvp: I/O-Extensions. (line 208) * exit: SCM Session. (line 19) * extended-environment: Syntactic Hooks for Hygienic Macros. (line 113) -* file-position: I/O-Extensions. (line 56) -* file-set-position: I/O-Extensions. (line 61) -* fileno: I/O-Extensions. (line 177) +* file-position: Port Properties. (line 18) +* fileno: I/O-Extensions. (line 166) * final_scm: Embedding SCM. (line 117) * find_impl_file: File-System Habitat. (line 35) * force-output: Window Manipulation. (line 30) @@ -8044,8 +8051,8 @@ Procedure and Macro Index | * frame-trace: Debugging Continuations. (line 10) * free_continuation: Continuations. (line 79) -* freshline: Port Properties. (line 26) -* gc: Internal State. (line 58) | +* freshline: Port Properties. (line 37) +* gc: Internal State. (line 58) * gc-hook: Storage. (line 28) * gc_mark: Marking Cells. (line 27) * GCCDR: Marking Cells. (line 15) @@ -8053,7 +8060,7 @@ Procedure and Macro Index | * gentemp: Defmacro. (line 6) * get-internal-real-time: Time. (line 17) * get-internal-run-time: Time. (line 10) -* getcwd: I/O-Extensions. (line 150) +* getcwd: I/O-Extensions. (line 139) * getegid: Posix Extensions. (line 63) * geteuid: Posix Extensions. (line 66) * getgid: Posix Extensions. (line 60) @@ -8110,7 +8117,7 @@ Procedure and Macro Index | * integer->line-number: Line Numbers. (line 37) * INUM: Immediates. (line 26) * INUMP: Immediates. (line 21) -* isatty?: Port Properties. (line 33) +* isatty?: Port Properties. (line 44) * ISYMCHARS: Immediates. (line 93) * ISYMNUM: Immediates. (line 89) * ISYMP: Immediates. (line 86) @@ -8137,7 +8144,7 @@ Procedure and Macro Index | * macroexpand-1: Defmacro. (line 6) * main: Embedding SCM. (line 12) * makargvfrmstrs: Type Conversions. (line 76) -* makcclo: Header Cells. (line 105) | +* makcclo: Header Cells. (line 105) * make-arbiter: Process Synchronization. (line 35) * make-edited-line-port: Line Editing. (line 29) @@ -8159,7 +8166,7 @@ Procedure and Macro Index | * MAKSPCSYM: Immediates. (line 97) * mark_locations: Marking Cells. (line 33) * milli-alarm: Interrupts. (line 30) -* mkdir: I/O-Extensions. (line 131) +* mkdir: I/O-Extensions. (line 120) * mknod: Unix Extensions. (line 43) * must_free: Allocating memory. (line 43) * must_free_argv: Type Conversions. (line 84) @@ -8196,7 +8203,7 @@ Procedure and Macro Index | * open-output-pipe: Posix Extensions. (line 22) * open-pipe: Posix Extensions. (line 10) * open-ports: Opening and Closing. (line 48) -* opendir: I/O-Extensions. (line 88) +* opendir: I/O-Extensions. (line 77) * OPENP: Ptob Cells. (line 42) * OPFPORTP: Ptob Cells. (line 54) * OPINFPORTP: Ptob Cells. (line 55) @@ -8213,19 +8220,19 @@ Procedure and Macro Index | * pi/: Numeric. (line 24) * pipe: Posix Extensions. (line 40) * port-closed?: Port Properties. (line 7) -* port-column: Port Properties. (line 19) +* port-column: Port Properties. (line 30) * port-filename: Port Properties. (line 14) -* port-line: Port Properties. (line 18) +* port-line: Port Properties. (line 29) * port-type: Port Properties. (line 10) * PORTP: Ptob Cells. (line 33) * pp: Debugging Scheme Code. - (line 75) | + (line 75) * pprint: Debugging Scheme Code. - (line 62) | + (line 62) * print: Debugging Scheme Code. - (line 54) | + (line 54) * print-args: Debugging Scheme Code. - (line 80) | + (line 80) * procedure->identifier-macro: Macro Primitives. (line 14) * procedure->macro: Macro Primitives. (line 12) * procedure->memoizing-macro: Macro Primitives. (line 13) @@ -8235,38 +8242,38 @@ Procedure and Macro Index | * profile-alarm: Interrupts. (line 32) * profile-alarm-interrupt: Interrupts. (line 52) * program-arguments: SCM Session. (line 30) -* putenv: I/O-Extensions. (line 223) +* putenv: I/O-Extensions. (line 212) * qase: Define and Set. (line 45) * quit: SCM Session. (line 17) * raw: Terminal Mode Setting. (line 28) * read-char <1>: Input. (line 7) -* read-char: Port Properties. (line 40) +* read-char: Port Properties. (line 51) * read-for-load: Line Numbers. (line 47) * read-numbered: Line Numbers. (line 26) * read:sharp: Modifying Read Syntax. (line 7) -* readdir: I/O-Extensions. (line 92) +* readdir: I/O-Extensions. (line 81) * readlink: Unix Extensions. (line 19) -* real-acos: Numeric. (line 44) | -* real-acosh: Numeric. (line 50) | -* real-asin: Numeric. (line 43) | -* real-asinh: Numeric. (line 49) | -* real-atan: Numeric. (line 45) | -* real-atanh: Numeric. (line 51) | -* real-cos: Numeric. (line 41) | -* real-cosh: Numeric. (line 47) | -* real-exp: Numeric. (line 38) | -* real-expt: Numeric. (line 62) | -* real-ln: Numeric. (line 39) | -* real-log10: Numeric. (line 56) | -* real-sin: Numeric. (line 40) | -* real-sinh: Numeric. (line 46) | -* real-sqrt: Numeric. (line 37) | -* real-tan: Numeric. (line 42) | -* real-tanh: Numeric. (line 48) | +* real-acos: Numeric. (line 44) +* real-acosh: Numeric. (line 50) +* real-asin: Numeric. (line 43) +* real-asinh: Numeric. (line 49) +* real-atan: Numeric. (line 45) +* real-atanh: Numeric. (line 51) +* real-cos: Numeric. (line 41) +* real-cosh: Numeric. (line 47) +* real-exp: Numeric. (line 38) +* real-expt: Numeric. (line 62) +* real-ln: Numeric. (line 39) +* real-log10: Numeric. (line 56) +* real-sin: Numeric. (line 40) +* real-sinh: Numeric. (line 46) +* real-sqrt: Numeric. (line 37) +* real-tan: Numeric. (line 42) +* real-tanh: Numeric. (line 48) * record-printer-set!: Records. (line 10) -* redirect-port!: I/O-Extensions. (line 83) +* redirect-port!: I/O-Extensions. (line 72) * refresh: Window Manipulation. (line 29) * regcomp: Regular Expression Pattern Matching. (line 12) @@ -8286,20 +8293,20 @@ Procedure and Macro Index | (line 52) * release-arbiter: Process Synchronization. (line 43) -* rename-file: I/O-Extensions. (line 155) +* rename-file: I/O-Extensions. (line 144) * renamed-identifier: Syntactic Hooks for Hygienic Macros. (line 26) * renaming-transformer: Syntactic Hooks for Hygienic Macros. (line 142) -* reopen-file: I/O-Extensions. (line 74) +* reopen-file: I/O-Extensions. (line 63) * require: Dynamic Linking. (line 11) * resetty: Terminal Mode Setting. (line 58) * restart: Internal State. (line 18) * restore_signals: Embedding SCM. (line 90) -* rewinddir: I/O-Extensions. (line 97) -* rmdir: I/O-Extensions. (line 140) -* room: Internal State. (line 62) | +* rewinddir: I/O-Extensions. (line 86) +* rmdir: I/O-Extensions. (line 129) +* room: Internal State. (line 62) * savetty: Terminal Mode Setting. (line 59) * scalar->array: Array Mapping. (line 51) @@ -8381,11 +8388,11 @@ Procedure and Macro Index | * touchline: Window Manipulation. (line 55) * touchwin: Window Manipulation. (line 54) * trace: Debugging Scheme Code. - (line 37) | + (line 37) * transpose-array: Conventional Arrays. (line 21) * try-arbiter: Process Synchronization. (line 39) -* try-create-file: I/O-Extensions. (line 67) +* try-create-file: I/O-Extensions. (line 56) * try-load <1>: Line Numbers. (line 12) * try-load: Eval and Load. (line 7) * try-open-file: Opening and Closing. (line 8) @@ -8395,16 +8402,16 @@ Procedure and Macro Index | * TYP7: Cells. (line 28) * UCHARS: Header Cells. (line 36) * ulong2num: Type Conversions. (line 11) -* umask: I/O-Extensions. (line 172) +* umask: I/O-Extensions. (line 161) * uname: Posix Extensions. (line 172) * unctrl: Curses Miscellany. (line 30) * uniform-array-read!: Uniform Array. (line 67) * uniform-array-write: Uniform Array. (line 79) * untrace: Debugging Scheme Code. - (line 45) | + (line 45) * user-interrupt: Interrupts. (line 49) * usr:lib: Dynamic Linking. (line 18) -* utime: I/O-Extensions. (line 167) +* utime: I/O-Extensions. (line 156) * vector-set-length!: Storage. (line 7) * VECTORP: Header Cells. (line 16) * VELTS: Header Cells. (line 21) @@ -8414,7 +8421,7 @@ Procedure and Macro Index | * vms-debug: SCM Session. (line 41) * void: Sweeping the Heap. (line 15) * wadd: Output. (line 11) -* wait-for-input: Port Properties. (line 55) +* wait-for-input: Port Properties. (line 66) * waitpid: Posix Extensions. (line 124) * warn: Errors. (line 109) * wclear: Output. (line 41) @@ -8436,7 +8443,7 @@ Procedure and Macro Index | * x:lib: Dynamic Linking. (line 23) Variable Index -============== | +************** * Menu: @@ -8448,7 +8455,7 @@ Variable Index * *interactive*: SCM Variables. (line 36) * *load-pathname*: Eval and Load. (line 15) * *load-reader*: Line Numbers. (line 50) -* *scm-version*: Internal State. (line 67) | +* *scm-version*: Internal State. (line 67) * *slib-load-reader*: Line Numbers. (line 51) * *syntax-rules*: SCM Variables. (line 30) * af_inet: Host and Other Inquiries. @@ -8481,7 +8488,7 @@ Variable Index * UNSPECIFIED: Immediates. (line 78) Type Index -========== | +********** * Menu: @@ -8539,40 +8546,40 @@ Type Index * tc3_closure: Cells. (line 39) * tc3_cons: Cells. (line 32) * tc7_asubr: Subr Cells. (line 12) -* tc7_contin: Header Cells. (line 85) | +* tc7_contin: Header Cells. (line 85) * tc7_cxr: Subr Cells. (line 22) -* tc7_lsubr: Subr Cells. (line 63) | -* tc7_lsubr_2: Subr Cells. (line 60) | +* tc7_lsubr: Subr Cells. (line 63) +* tc7_lsubr_2: Subr Cells. (line 60) * tc7_msymbol: Header Cells. (line 29) -* tc7_rpsubr: Subr Cells. (line 48) | -* tc7_specfun: Header Cells. (line 88) | +* tc7_rpsubr: Subr Cells. (line 48) +* tc7_specfun: Header Cells. (line 88) * tc7_ssymbol: Header Cells. (line 26) * tc7_string: Header Cells. (line 41) * tc7_subr_0: Subr Cells. (line 16) * tc7_subr_1: Subr Cells. (line 19) -* tc7_subr_1o: Subr Cells. (line 52) | -* tc7_subr_2: Subr Cells. (line 45) | -* tc7_subr_2o: Subr Cells. (line 56) | -* tc7_subr_3: Subr Cells. (line 42) | -* tc7_Vbool: Header Cells. (line 55) | +* tc7_subr_1o: Subr Cells. (line 52) +* tc7_subr_2: Subr Cells. (line 45) +* tc7_subr_2o: Subr Cells. (line 56) +* tc7_subr_3: Subr Cells. (line 42) +* tc7_Vbool: Header Cells. (line 55) * tc7_vector: Header Cells. (line 13) -* tc7_VfixN16: Header Cells. (line 64) | -* tc7_VfixN32: Header Cells. (line 61) | -* tc7_VfixN8: Header Cells. (line 70) | -* tc7_VfixZ16: Header Cells. (line 67) | -* tc7_VfixZ32: Header Cells. (line 58) | -* tc7_VfixZ8: Header Cells. (line 73) | -* tc7_VfloC64: Header Cells. (line 82) | -* tc7_VfloR32: Header Cells. (line 76) | -* tc7_VfloR64: Header Cells. (line 79) | +* tc7_VfixN16: Header Cells. (line 64) +* tc7_VfixN32: Header Cells. (line 61) +* tc7_VfixN8: Header Cells. (line 70) +* tc7_VfixZ16: Header Cells. (line 67) +* tc7_VfixZ32: Header Cells. (line 58) +* tc7_VfixZ8: Header Cells. (line 73) +* tc7_VfloC64: Header Cells. (line 82) +* tc7_VfloR32: Header Cells. (line 76) +* tc7_VfloR64: Header Cells. (line 79) * tc_dblc: Smob Cells. (line 33) * tc_dblr: Smob Cells. (line 30) * tc_free_cell: Smob Cells. (line 15) * turtle-graphics: Dynamic Linking. (line 56) * unexec: Dump. (line 6) - | + Concept Index -============= | +************* * Menu: @@ -8586,32 +8593,33 @@ Concept Index * #!.bat: MS-DOS Compatible Scripts. (line 8) * array <1>: Conventional Arrays. (line 9) -* array: Build Options. (line 196) | -* array-for-each: Build Options. (line 199) | -* arrays: Build Options. (line 202) | -* bignums: Build Options. (line 205) | -* build: Building SCM. (line 6) | -* build.scm: Building SCM. (line 6) | -* byte: Build Options. (line 208) | +* array: Build Options. (line 196) +* array-for-each: Build Options. (line 199) +* arrays: Build Options. (line 202) +* bignums: Build Options. (line 205) +* build: Building SCM. (line 6) +* build.scm: Building SCM. (line 6) +* byte: Build Options. (line 208) +* byte-number: Build Options. (line 211) * callbacks: Callbacks. (line 6) -* careful-interrupt-masking: Build Options. (line 211) | -* cautious: Build Options. (line 217) | -* cheap-continuations: Build Options. (line 226) | -* compiled-closure: Build Options. (line 235) | +* careful-interrupt-masking: Build Options. (line 214) +* cautious: Build Options. (line 220) +* cheap-continuations: Build Options. (line 229) +* compiled-closure: Build Options. (line 238) * continuations: Continuations. (line 6) -* curses: Build Options. (line 238) | -* debug: Build Options. (line 241) | -* differ: Build Options. (line 246) | +* curses: Build Options. (line 241) +* debug: Build Options. (line 244) +* differ: Build Options. (line 249) * documentation string: Documentation and Comments. (line 13) -* dont-memoize-locals: Build Options. (line 249) | -* dump: Build Options. (line 254) | -* dynamic-linking: Build Options. (line 257) | +* dont-memoize-locals: Build Options. (line 252) +* dump: Build Options. (line 257) +* dynamic-linking: Build Options. (line 260) * ecache: Memory Management for Environments. (line 6) -* edit-line: Build Options. (line 260) | +* edit-line: Build Options. (line 263) * Embedding SCM: Embedding SCM. (line 6) -* engineering-notation: Build Options. (line 263) | +* engineering-notation: Build Options. (line 266) * environments: Memory Management for Environments. (line 6) * exchanger: Process Synchronization. @@ -8621,186 +8629,186 @@ Concept Index (line 13) * foo.c: Compiling and Linking Custom Files. (line 13) -* generalized-c-arguments: Build Options. (line 268) | +* generalized-c-arguments: Build Options. (line 271) * graphics: Packages. (line 23) * hobbit: Packages. (line 23) -* i/o-extensions: Build Options. (line 271) | +* i/o-extensions: Build Options. (line 274) * IEEE: Bibliography. (line 7) -* inexact: Build Options. (line 275) | +* inexact: Build Options. (line 278) * JACAL: Bibliography. (line 49) -* lit: Build Options. (line 278) | -* macro: Build Options. (line 281) | +* lit: Build Options. (line 281) +* macro: Build Options. (line 284) * memory management: Memory Management for Environments. (line 6) -* mysql: Build Options. (line 285) | -* no-heap-shrink: Build Options. (line 288) | +* mysql: Build Options. (line 288) +* no-heap-shrink: Build Options. (line 291) * NO_ENV_CACHE: Memory Management for Environments. (line 89) -* none: Build Options. (line 293) | +* none: Build Options. (line 296) * posix: Posix Extensions. (line 6) * Posix: Posix Extensions. (line 6) -* posix: Build Options. (line 296) | +* posix: Build Options. (line 299) * R4RS: Bibliography. (line 11) * R5RS: Bibliography. (line 18) -* reckless: Build Options. (line 301) | -* record: Build Options. (line 306) | -* regex: Build Options. (line 310) | -* rev2-procedures: Build Options. (line 313) | +* reckless: Build Options. (line 304) +* record: Build Options. (line 309) +* regex: Build Options. (line 313) +* rev2-procedures: Build Options. (line 316) * rope <1>: Type Conversions. (line 6) * rope: Callbacks. (line 6) * SchemePrimer: Bibliography. (line 39) -* SICP: Build Options. (line 319) | -* sicp: Build Options. (line 317) | +* SICP: Build Options. (line 322) +* sicp: Build Options. (line 320) * SICP: Bibliography. (line 30) * signals: Signals. (line 6) * Simply: Bibliography. (line 35) -* single-precision-only: Build Options. (line 331) | +* single-precision-only: Build Options. (line 334) * SLIB: Bibliography. (line 43) -* socket: Build Options. (line 337) | -* tick-interrupts: Build Options. (line 341) | -* turtlegr: Build Options. (line 344) | +* socket: Build Options. (line 340) +* tick-interrupts: Build Options. (line 344) +* turtlegr: Build Options. (line 347) * unix: Unix Extensions. (line 6) * Unix: Unix Extensions. (line 6) -* unix: Build Options. (line 348) | -* wb: Build Options. (line 352) | -* windows: Build Options. (line 355) | +* unix: Build Options. (line 351) +* wb: Build Options. (line 355) +* windows: Build Options. (line 358) * X: Packages. (line 23) * x <1>: Packages. (line 23) -* x: Build Options. (line 358) | +* x: Build Options. (line 361) * xlib: Packages. (line 23) * Xlib: Packages. (line 23) -* xlib: Build Options. (line 361) | +* xlib: Build Options. (line 364) * xlibscm: Packages. (line 23) * Xlibscm: Packages. (line 23) Tag Table: -Node: Top1723 -Node: Overview3323 -Node: SCM Features3638 -Node: SCM Authors5713 -Node: Copying6614 -Node: The SCM License6943 -Node: SIOD copyright10867 -Node: Bibliography12253 -Node: Installing SCM14129 -Node: Making SCM14648 -Node: SLIB15573 -Node: Building SCM17489 -Node: Invoking Build18071 -Node: Build Options20408 -Node: Compiling and Linking Custom Files34079 -Node: Installing Dynamic Linking36075 -Node: Configure Module Catalog37861 -Node: Saving Images39869 -Node: Automatic C Preprocessor Definitions42952 -Node: Problems Compiling46727 -Node: Problems Linking48388 -Node: Problems Running48661 -Node: Testing50779 -Node: Reporting Problems54096 -Node: Operational Features54948 -Node: Invoking SCM55344 -Node: SCM Options57078 -Node: Invocation Examples61447 -Node: SCM Variables62407 -Node: SCM Session63887 -Node: Editing Scheme Code65418 -Node: Debugging Scheme Code67436 -Node: Debugging Continuations71888 -Node: Errors74448 -Node: Memoized Expressions78766 -Node: Internal State81130 -Node: Scripting84409 -Node: Unix Scheme Scripts84713 -Node: MS-DOS Compatible Scripts87745 -Node: Unix Shell Scripts89600 -Node: The Language91741 -Node: Standards Compliance92363 -Node: Storage94786 -Node: Time97266 -Node: Interrupts98282 -Node: Process Synchronization101915 -Node: Files and Ports103444 -Node: Opening and Closing103785 -Node: Port Properties106276 -Node: Port Redirection108962 -Node: Soft Ports110454 -Node: Eval and Load112236 -Node: Line Numbers113652 -Node: Lexical Conventions116075 -Node: Common-Lisp Read Syntax116337 -Node: Load Syntax118369 -Node: Documentation and Comments118989 -Node: Modifying Read Syntax120213 -Node: Syntax121936 -Node: Define and Set122840 -Node: Defmacro126374 -Node: Syntax-Rules127454 -Node: Macro Primitives129260 -Node: Environment Frames130899 -Node: Syntactic Hooks for Hygienic Macros133319 -Node: Packages140293 -Node: Dynamic Linking141173 -Node: Dump145848 -Node: Numeric149869 -Node: Arrays152669 -Node: Conventional Arrays152887 -Node: Uniform Array156426 -Node: Bit Vectors161238 -Node: Array Mapping162546 -Node: Records165240 -Node: I/O-Extensions166112 -Node: Posix Extensions174744 -Node: Unix Extensions184296 -Node: Sequence Comparison186197 -Node: Regular Expression Pattern Matching186527 -Node: Line Editing190505 -Node: Curses191866 -Node: Output Options Setting192801 -Node: Terminal Mode Setting195468 -Node: Window Manipulation198569 -Node: Output202054 -Node: Input205706 -Node: Curses Miscellany206750 -Node: Sockets208191 -Node: Host and Other Inquiries208554 -Node: Internet Addresses and Socket Names211695 -Node: Socket213268 -Node: SCMDB220501 -Node: The Implementation220739 -Node: Data Types221002 -Node: Immediates221831 -Node: Cells226213 -Node: Header Cells228331 -Node: Subr Cells232539 -Node: Ptob Cells234935 -Node: Smob Cells236504 -Node: Data Type Representations239806 -Node: Operations244944 -Node: Garbage Collection245538 -Node: Marking Cells246171 -Node: Sweeping the Heap248311 -Node: Memory Management for Environments249273 -Node: Signals253842 -Node: C Macros255403 -Node: Changing Scm256540 -Node: Defining Subrs261011 -Node: Defining Smobs262871 -Node: Defining Ptobs265928 -Node: Allocating memory267117 -Node: Embedding SCM269447 -Node: Callbacks277161 -Node: Type Conversions278982 -Node: Continuations283031 -Node: Evaluation287269 -Node: Program Self-Knowledge292452 -Node: File-System Habitat292706 -Node: Executable Pathname296319 -Node: Script Support297957 -Node: Improvements To Make299292 -Node: VMS Dynamic Linking301510 -Node: Index306223 +Node: Top1099 +Node: Overview2318 +Node: SCM Features2633 +Node: SCM Authors4656 +Node: Copying5557 +Node: The SCM License5886 +Node: SIOD copyright9810 +Node: Bibliography11163 +Node: Installing SCM13039 +Node: Making SCM13558 +Node: SLIB14544 +Node: Building SCM16379 +Node: Invoking Build16961 +Node: Build Options19298 +Node: Compiling and Linking Custom Files32922 +Node: Installing Dynamic Linking34918 +Node: Configure Module Catalog36795 +Node: Saving Images38803 +Node: Automatic C Preprocessor Definitions40567 +Node: Problems Compiling44555 +Node: Problems Linking46216 +Node: Problems Running46489 +Node: Testing48607 +Node: Reporting Problems51876 +Node: Operational Features52728 +Node: Invoking SCM53124 +Node: SCM Options54916 +Node: Invocation Examples59525 +Node: SCM Variables60485 +Node: SCM Session61965 +Node: Editing Scheme Code63496 +Node: Debugging Scheme Code65514 +Node: Debugging Continuations69779 +Node: Errors72339 +Node: Memoized Expressions76657 +Node: Internal State79064 +Node: Scripting82290 +Node: Unix Scheme Scripts82594 +Node: MS-DOS Compatible Scripts85626 +Node: Unix Shell Scripts87481 +Node: The Language89622 +Node: Standards Compliance90244 +Node: Storage92667 +Node: Time95147 +Node: Interrupts96163 +Node: Process Synchronization99796 +Node: Files and Ports101325 +Node: Opening and Closing101666 +Node: Port Properties104184 +Node: Port Redirection107750 +Node: Soft Ports109242 +Node: Eval and Load111024 +Node: Line Numbers112440 +Node: Lexical Conventions114863 +Node: Common-Lisp Read Syntax115125 +Node: Load Syntax117112 +Node: Documentation and Comments117732 +Node: Modifying Read Syntax118956 +Node: Syntax120679 +Node: Define and Set121583 +Node: Defmacro125117 +Node: Syntax-Rules126197 +Node: Macro Primitives128003 +Node: Environment Frames129642 +Node: Syntactic Hooks for Hygienic Macros132062 +Node: Packages139036 +Node: Dynamic Linking139916 +Node: Dump144630 +Node: Numeric148651 +Node: Arrays150467 +Node: Conventional Arrays150685 +Node: Uniform Array154224 +Node: Bit Vectors159036 +Node: Array Mapping160344 +Node: Records163037 +Node: I/O-Extensions163909 +Node: Posix Extensions172155 +Node: Unix Extensions181707 +Node: Sequence Comparison183608 +Node: Regular Expression Pattern Matching183938 +Node: Line Editing187916 +Node: Curses189277 +Node: Output Options Setting190212 +Node: Terminal Mode Setting192879 +Node: Window Manipulation195980 +Node: Output199465 +Node: Input203117 +Node: Curses Miscellany204161 +Node: Sockets205602 +Node: Host and Other Inquiries205965 +Node: Internet Addresses and Socket Names209106 +Node: Socket210679 +Node: SCMDB217950 +Node: The Implementation218188 +Node: Data Types218451 +Node: Immediates219280 +Node: Cells223662 +Node: Header Cells225780 +Node: Subr Cells229076 +Node: Ptob Cells231373 +Node: Smob Cells232942 +Node: Data Type Representations236165 +Node: Operations241044 +Node: Garbage Collection241638 +Node: Marking Cells242271 +Node: Sweeping the Heap244392 +Node: Memory Management for Environments245354 +Node: Signals249923 +Node: C Macros251484 +Node: Changing Scm252621 +Node: Defining Subrs257085 +Node: Defining Smobs258945 +Node: Defining Ptobs262002 +Node: Allocating memory263191 +Node: Embedding SCM265521 +Node: Callbacks273235 +Node: Type Conversions275056 +Node: Continuations279105 +Node: Evaluation283343 +Node: Program Self-Knowledge288526 +Node: File-System Habitat288780 +Node: Executable Pathname292393 +Node: Script Support294031 +Node: Improvements To Make295366 +Node: VMS Dynamic Linking297584 +Node: Index302297 End Tag Table @@ -0,0 +1,477 @@ +; Install SCM on Windows for current user
+; Basic script generated by the HM NIS Edit Script Wizard.
+; Augmented by Jerry van Dijk, february 2007
+; placed in the public domain
+
+; *** version numbers ***
+!define PRODUCT_VERSION "5e4-1"
+!define REQ_SLIB_VERSION "3a5-1"
+
+; ----------------[ NO CHANGES BELOW ]----------------
+
+; *** unless files are added or removed ***
+; *** remember to edit both 'file' and 'delete' sections!
+
+; *** registry settings ***
+!define KEY_VERSION "version"
+!define SCM_KEY "Software\Voluntocracy\scm"
+!define SLIB_KEY "Software\Voluntocracy\slib"
+
+; HM NIS Edit Wizard helper defines
+!define PRODUCT_NAME "SCM"
+!define PRODUCT_COMPANY "Voluntocracy"
+!define PRODUCT_PUBLISHER "Aubrey Jaffer"
+!define PRODUCT_WEB_SITE "http://swissnet.ai.mit.edu/~jaffer/SCM.html"
+!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\scm-${PRODUCT_VERSION}.exe"
+!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+!define PRODUCT_UNINST_ROOT_KEY "HKLM"
+!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
+
+; MUI 1.67 compatible ------
+!include "MUI.nsh"
+
+; MUI Settings
+!define MUI_ABORTWARNING
+!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
+!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+
+; Welcome page
+!insertmacro MUI_PAGE_WELCOME
+
+; License page
+!insertmacro MUI_PAGE_LICENSE "COPYING"
+
+; Directory page
+!insertmacro MUI_PAGE_DIRECTORY
+
+; Start menu page
+var ICONS_GROUP
+!define MUI_STARTMENUPAGE_NODISABLE
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "scm"
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
+!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
+
+; Instfiles page
+!insertmacro MUI_PAGE_INSTFILES
+
+; Finish page
+!insertmacro MUI_PAGE_FINISH
+
+; Uninstaller pages
+!insertmacro MUI_UNPAGE_INSTFILES
+
+; Language files
+!insertmacro MUI_LANGUAGE "English"
+
+; MUI end ------
+
+Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
+OutFile "SCM-${PRODUCT_VERSION}.exe"
+InstallDir "$PROGRAMFILES\scm"
+InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" ""
+ShowInstDetails show
+ShowUnInstDetails show
+
+; Check that the correct slib is installed, and no other scm version is present
+Function .onInit
+; Check that slib is installed
+ ClearErrors
+ ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${SLIB_KEY}" "${KEY_VERSION}"
+ IfErrors 0 +3
+ MessageBox MB_OK|MB_ICONSTOP "No SLIB found. Please install SLIB before installing SCM."
+ Abort
+
+; Check that the correct slib is installed
+ StrCmp $0 ${REQ_SLIB_VERSION} +3 0
+ MessageBox MB_OK|MB_ICONSTOP "Found SLIB version $0. SCM ${PRODUCT_VERSION} requires SLIB ${REQ_SLIB_VERSION}. Please install this SLIB version first."
+ Abort
+
+; Check for older scm installed
+ ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${SCM_KEY}" "${KEY_VERSION}"
+ StrCmp $0 '' +4 0
+ StrCmp $0 ${PRODUCT_VERSION} +3 0
+ MessageBox MB_OK|MB_ICONSTOP "You already have SCM version $0 installed. Please uninstall this SCM first."
+ Abort
+
+FunctionEnd
+
+Section "MainSection" SEC01
+ SetOutPath "$INSTDIR"
+ SetOverwrite try
+ File "SCM.lnk"
+ File "scm.exe"
+ File "scm.html"
+ File "Init5e4.scm"
+ File "Transcen.scm"
+ File "mkimpcat.scm"
+ File "hobbit.scm"
+ File "scmhob.scm"
+ File "hobbit.html"
+ File "wbtab.scm"
+ File "rwb-isam.scm"
+ File "r4rstest.scm"
+ File "pi.scm"
+
+; Shortcuts
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ CreateShortCut "$DESKTOP\SCM.lnk" "$INSTDIR\scm.lnk"
+ CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\SCM Manual.lnk" "$INSTDIR\scm.html"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\SCM.lnk" "$INSTDIR\SCM.lnk"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Hobbit Manual.lnk" "$INSTDIR\hobbit.html"
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+; Jaffer scm registry settings
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${SCM_KEY}" "${KEY_VERSION}" "${PRODUCT_VERSION}"
+
+; Jaffer scm path settings
+ Push "$INSTDIR\"
+ Call AddToPath
+
+SectionEnd
+
+Section -AdditionalIcons
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
+ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
+ !insertmacro MUI_STARTMENU_WRITE_END
+SectionEnd
+
+Section -Post
+ WriteUninstaller "$INSTDIR\uninst.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\scm-${PRODUCT_VERSION}.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\scm-${PRODUCT_VERSION}.exe"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
+ WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
+SectionEnd
+
+Function .onInstSuccess
+ IfRebootFlag 0 noreboot
+ MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON1 "A reboot is required to finish the installation. Do you wish to reboot now?" IDNO noreboot
+ Reboot
+ noreboot:
+FunctionEnd
+
+Function un.onUninstSuccess
+ HideWindow
+ MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
+FunctionEnd
+
+Function un.onInit
+ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
+ Abort
+FunctionEnd
+
+Section Uninstall
+ !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
+ Delete "$INSTDIR\${PRODUCT_NAME}.url"
+ Delete "$INSTDIR\uninst.exe"
+ Delete "$INSTDIR\pi.scm"
+ Delete "$INSTDIR\r4rstest.scm"
+ Delete "$INSTDIR\rwb-isam.scm"
+ Delete "$INSTDIR\wbtab.scm"
+ Delete "$INSTDIR\hobbit.html"
+ Delete "$INSTDIR\scmhob.scm"
+ Delete "$INSTDIR\hobbit.scm"
+ Delete "$INSTDIR\mkimpcat.scm"
+ Delete "$INSTDIR\Transcen.scm"
+ Delete "$INSTDIR\Init5e4.scm"
+ Delete "$INSTDIR\scm.html"
+ Delete "$INSTDIR\scm.exe"
+ Delete "$INSTDIR\SCM.lnk"
+
+ Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
+ Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
+ Delete "$SMPROGRAMS\$ICONS_GROUP\SCM.lnk"
+ Delete "$SMPROGRAMS\$ICONS_GROUP\SCM Manual.lnk"
+ Delete "$SMPROGRAMS\$ICONS_GROUP\Hobbit Manual.lnk"
+ Delete "$DESKTOP\SCM.lnk"
+
+ RMDir "$SMPROGRAMS\$ICONS_GROUP"
+ RMDir "$INSTDIR"
+
+ # remove from the path
+ Push "$INSTDIR\"
+ Call un.RemoveFromPath
+
+ ; remove Jaffer registry entries
+ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${SCM_KEY}"
+
+ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}"
+ SetAutoClose true
+
+SectionEnd
+
+; ----------------[ ENVIRONMENT MANIPULATION ]----------------
+
+!ifndef WriteEnvStr_RegKey
+ !ifdef ALL_USERS
+ !define WriteEnvStr_RegKey \
+ 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
+ !else
+ !define WriteEnvStr_RegKey 'HKCU "Environment"'
+ !endif
+!endif
+
+
+; ----------------[ EXECUTABLE PATH MANIPULATION ]----------------
+
+; AddToPath - Adds the given dir to the search path.
+; Input - head of the stack
+; Note - Win9x systems requires reboot
+
+Function AddToPath
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+
+ # don't add if the path doesn't exist
+ IfFileExists "$0\*.*" "" AddToPath_done
+
+ ReadEnvStr $1 PATH
+ Push "$1;"
+ Push "$0;"
+ Call StrStr
+ Pop $2
+ StrCmp $2 "" "" AddToPath_done
+ Push "$1;"
+ Push "$0\;"
+ Call StrStr
+ Pop $2
+ StrCmp $2 "" "" AddToPath_done
+ GetFullPathName /SHORT $3 $0
+ Push "$1;"
+ Push "$3;"
+ Call StrStr
+ Pop $2
+ StrCmp $2 "" "" AddToPath_done
+ Push "$1;"
+ Push "$3\;"
+ Call StrStr
+ Pop $2
+ StrCmp $2 "" "" AddToPath_done
+
+ Call IsNT
+ Pop $1
+ StrCmp $1 1 AddToPath_NT
+ ; Not on NT
+ StrCpy $1 $WINDIR 2
+ FileOpen $1 "$1\autoexec.bat" a
+ FileSeek $1 -1 END
+ FileReadByte $1 $2
+ IntCmp $2 26 0 +2 +2 # DOS EOF
+ FileSeek $1 -1 END # write over EOF
+ FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
+ FileClose $1
+ SetRebootFlag true
+ Goto AddToPath_done
+
+ AddToPath_NT:
+ ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
+ StrCmp $1 "" AddToPath_NTdoIt
+ Push $1
+ Call Trim
+ Pop $1
+ StrCpy $0 "$1;$0"
+ AddToPath_NTdoIt:
+ WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
+ AddToPath_done:
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+; RemoveFromPath - Remove a given dir from the path
+; Input: head of the stack
+
+Function un.RemoveFromPath
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+
+ IntFmt $6 "%c" 26 # DOS EOF
+
+ Call un.IsNT
+ Pop $1
+ StrCmp $1 1 unRemoveFromPath_NT
+ ; Not on NT
+ StrCpy $1 $WINDIR 2
+ FileOpen $1 "$1\autoexec.bat" r
+ GetTempFileName $4
+ FileOpen $2 $4 w
+ GetFullPathName /SHORT $0 $0
+ StrCpy $0 "SET PATH=%PATH%;$0"
+ Goto unRemoveFromPath_dosLoop
+
+ unRemoveFromPath_dosLoop:
+ FileRead $1 $3
+ StrCpy $5 $3 1 -1 # read last char
+ StrCmp $5 $6 0 +2 # if DOS EOF
+ StrCpy $3 $3 -1 # remove DOS EOF so we can compare
+ StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
+ StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
+ StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
+ StrCmp $3 "" unRemoveFromPath_dosLoopEnd
+ FileWrite $2 $3
+ Goto unRemoveFromPath_dosLoop
+ unRemoveFromPath_dosLoopRemoveLine:
+ SetRebootFlag true
+ Goto unRemoveFromPath_dosLoop
+
+ unRemoveFromPath_dosLoopEnd:
+ FileClose $2
+ FileClose $1
+ StrCpy $1 $WINDIR 2
+ Delete "$1\autoexec.bat"
+ CopyFiles /SILENT $4 "$1\autoexec.bat"
+ Delete $4
+ Goto unRemoveFromPath_done
+
+ unRemoveFromPath_NT:
+ ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
+ StrCpy $5 $1 1 -1 # copy last char
+ StrCmp $5 ";" +2 # if last char != ;
+ StrCpy $1 "$1;" # append ;
+ Push $1
+ Push "$0;"
+ Call un.StrStr ; Find `$0;` in $1
+ Pop $2 ; pos of our dir
+ StrCmp $2 "" unRemoveFromPath_done
+ ; else, it is in path
+ # $0 - path to add
+ # $1 - path var
+ StrLen $3 "$0;"
+ StrLen $4 $2
+ StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
+ StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
+ StrCpy $3 $5$6
+
+ StrCpy $5 $3 1 -1 # copy last char
+ StrCmp $5 ";" 0 +2 # if last char == ;
+ StrCpy $3 $3 -1 # remove last char
+
+ WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
+ unRemoveFromPath_done:
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+; ----------------[ OS TYPE DETERMINATION ]----------------
+
+#
+# [un.]IsNT - Pushes 1 if running on NT, 0 if not
+#
+# Example:
+# Call IsNT
+# Pop $0
+# StrCmp $0 1 +3
+# MessageBox MB_OK "Not running on NT!"
+# Goto +2
+# MessageBox MB_OK "Running on NT!"
+#
+!macro IsNT UN
+Function ${UN}IsNT
+ Push $0
+ ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+ StrCmp $0 "" 0 IsNT_yes
+ ; we are not NT.
+ Pop $0
+ Push 0
+ Return
+
+ IsNT_yes:
+ ; NT!!!
+ Pop $0
+ Push 1
+FunctionEnd
+!macroend
+!insertmacro IsNT ""
+!insertmacro IsNT "un."
+
+; ----------------[ STRING MANIPULATION ]----------------
+
+; StrStr
+; input, top of stack = string to search for
+; top of stack-1 = string to search in
+; output, top of stack (replaces with the portion of the string remaining)
+; modifies no other variables.
+;
+; Usage:
+; Push "this is a long ass string"
+; Push "ass"
+; Call StrStr
+; Pop $R0
+; ($R0 at this point is "ass string")
+
+!macro StrStr un
+Function ${un}StrStr
+Exch $R1 ; st=haystack,old$R1, $R1=needle
+ Exch ; st=old$R1,haystack
+ Exch $R2 ; st=old$R1,old$R2, $R2=haystack
+ Push $R3
+ Push $R4
+ Push $R5
+ StrLen $R3 $R1
+ StrCpy $R4 0
+ ; $R1=needle
+ ; $R2=haystack
+ ; $R3=len(needle)
+ ; $R4=cnt
+ ; $R5=tmp
+ loop:
+ StrCpy $R5 $R2 $R3 $R4
+ StrCmp $R5 $R1 done
+ StrCmp $R5 "" done
+ IntOp $R4 $R4 + 1
+ Goto loop
+done:
+ StrCpy $R1 $R2 "" $R4
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Exch $R1
+FunctionEnd
+!macroend
+!insertmacro StrStr ""
+!insertmacro StrStr "un."
+
+Function Trim ; Added by Pelaca
+ Exch $R1
+ Push $R2
+Loop:
+ StrCpy $R2 "$R1" 1 -1
+ StrCmp "$R2" " " RTrim
+ StrCmp "$R2" "$\n" RTrim
+ StrCmp "$R2" "$\r" RTrim
+ StrCmp "$R2" ";" RTrim
+ GoTo Done
+RTrim:
+ StrCpy $R1 "$R1" -1
+ Goto Loop
+Done:
+ Pop $R2
+ Exch $R1
+FunctionEnd
@@ -1,5 +1,5 @@ %define name scm -%define version 5e3 +%define version 5e4 %define release 1 %define implpath %{prefix}/lib/scm %define slibpath %{prefix}/lib/slib @@ -169,7 +169,7 @@ rm -f %{prefix}/bin/scm %{prefix}/lib/scm/keysymdef.scm %{prefix}/lib/scm/r4rstest.scm %{prefix}/lib/scm/byte.so -%{prefix}/lib/scm/db.so +# %{prefix}/lib/scm/db.so %{prefix}/lib/scm/wbtab.scm %{prefix}/lib/scm/rwb-isam.scm %{prefix}/lib/scm/COPYING @@ -16,7 +16,7 @@ This manual is for SCM (version @value{SCMVERSION}, @value{SCMDATE}), and algorithmic language Scheme implementation. @noindent -Copyright @copyright{} 1990-2006 Free Software Foundation, Inc. +Copyright @copyright{} 1990-2007 Free Software Foundation, Inc. @quotation Permission is granted to make and distribute verbatim copies of @@ -154,6 +154,7 @@ timing information printed interactively (the @code{verbose} function). @code{Restart}, @code{quit}, and @code{exec}. @end itemize + @node SCM Authors, Copying, SCM Features, Overview @section Authors @@ -179,6 +180,7 @@ C-stack and being able to garbage collect off the C-stack There are many other contributors to SCM. They are acknowledged in the file @file{ChangeLog}, a log of changes that have been made to scm. + @node Copying, Bibliography, SCM Authors, Overview @section Copyright @@ -310,6 +312,7 @@ Paradigm Associates Inc Cambridge, MA 02138 @end flushleft + @node Bibliography, , Copying, Overview @section Bibliography @@ -334,8 +337,7 @@ Revised(4) Report on the Algorithmic Language Scheme. pp. 1-55. @ifinfo -@ref{Top, , , r4rs, Revised(4) Report on the Algorithmic Language -Scheme}. +@ref{Top, , , r4rs, Revised(4) Report on the Algorithmic Language Scheme}. @end ifinfo @item [R5RS] @@ -353,8 +355,7 @@ pp. 7-105, and @cite{ACM SIGPLAN Notices} 33(9), September 1998. @ifinfo -@ref{Top, , , r5rs, Revised(5) Report on the Algorithmic Language -Scheme}. +@ref{Top, , , r5rs, Revised(5) Report on the Algorithmic Language Scheme}. @end ifinfo @item [Exrename] @@ -455,6 +456,7 @@ include @code{scm} in other programs. Documentation of the Xlib - SCM Language X Interface. @end table + @node Installing SCM, Operational Features, Overview, Top @chapter Installing SCM @@ -476,10 +478,10 @@ Documentation of the Xlib - SCM Language X Interface. @node Making SCM, SLIB, Installing SCM, Installing SCM @section Making SCM -The SCM distribution has @dfn{Makefile} which contains rules for making -@dfn{scmlit}, a ``bare-bones'' version of SCM sufficient for running -@file{build}. @file{build} is used to compile (or create scripts to -compile) full featured versions. +The SCM distribution has @dfn{Makefile} which contains rules for +making @dfn{scmlit}, a ``bare-bones'' version of SCM sufficient for +running @file{build}. @file{build} is used to compile (or create +scripts to compile) full featured versions (@pxref{Building SCM}). Makefiles are not portable to the majority of platforms. If @file{Makefile} works for you, good; If not, I don't want to hear about @@ -517,34 +519,28 @@ low priority. SLIB is available from the same sites as SCM: @ifclear html @itemize @bullet @item -swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz -@item -ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz +swiss.csail.mit.edu:/pub/scm/slib3a5.tar.gz @item -ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz +ftp.gnu.org:/pub/gnu/jacal/slib3a5.tar.gz @end itemize @end ifclear @ifset html @itemize @bullet @item -<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib3a4.zip"> -http://swiss.csail.mit.edu/ftpdir/scm/slib3a4.zip +<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib3a5.zip"> +http://swiss.csail.mit.edu/ftpdir/scm/slib3a5.zip </A> @item -<A HREF="ftp://ftp.gnu.org/pub/gnu/jacal/slib3a4.tar.gz"> -ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz -</A> -@item -<A HREF="ftp://ftp.cs.indiana.edu/pub/scheme-repository/code/lib/slib3a4.tar.gz"> -ftp.cs.indiana.edu:/pub/scheme-repository/code/lib/slib3a4.tar.gz +<A HREF="ftp://ftp.gnu.org/pub/gnu/jacal/slib3a5.tar.gz"> +ftp.gnu.org:/pub/gnu/jacal/slib3a5.tar.gz </A> @end itemize @end ifset @noindent -Unpack SLIB (@samp{tar xzf slib3a4.tar.gz} or @samp{unzip -ao -slib3a4.zip}) in an appropriate directory for your system; both +Unpack SLIB (@samp{tar xzf slib3a5.tar.gz} or @samp{unzip -ao +slib3a5.zip}) in an appropriate directory for your system; both @code{tar} and @code{unzip} will create the directory @file{slib}. @noindent @@ -835,6 +831,7 @@ features are: @end table @end deffn + @node Compiling and Linking Custom Files, , Build Options, Building SCM @subsection Compiling and Linking Custom Files @@ -895,6 +892,7 @@ dynamic-loading), you can load the compiled file with the Scheme command @code{(load "./foo.so")}. See @ref{Configure Module Catalog} for how to add a compiled dll file to SLIB's catalog. + @node Installing Dynamic Linking, Configure Module Catalog, Building SCM, Installing SCM @section Installing Dynamic Linking @@ -907,10 +905,10 @@ proposed POSIX standard and may be available on other machines with finishing the port to VMS @ref{VMS Dynamic Linking}. @noindent -@dfn{DLD} is a library package of C functions that performs @dfn{dynamic -link editing} on Linux, VAX (Ultrix), Sun 3 (SunOS 3.4 and 4.0), -SPARCstation (SunOS 4.0), Sequent Symmetry (Dynix), and Atari ST. It is -available from: +@dfn{DLD} is a library package of C functions that performs +@dfn{dynamic link editing} on GNU/Linux, VAX (Ultrix), Sun 3 (SunOS +3.4 and 4.0), SPARCstation (SunOS 4.0), Sequent Symmetry (Dynix), and +Atari ST. It is available from: @ifclear html @itemize @bullet @@ -1005,6 +1003,7 @@ will be @code{load}ed. An unspecified value is returned. Remember to delete the file @file{slibcat} after modifying the file @file{mkimpcat.scm} in order to force SLIB to rebuild its cache. + @node Saving Images, Automatic C Preprocessor Definitions, Configure Module Catalog, Installing SCM @section Saving Images @@ -1023,7 +1022,7 @@ The @samp{dscm4} and @samp{dscm5} targets in the SCM @file{Makefile} save images from @file{udscm4} and @file{udscm5} executables respectively. -Recent Linux innovations interfere with @code{dump}. For: +Recent GNU/Linux innovations interfere with @code{dump}. For: @table @asis @item Fedora-Core-1 @@ -1054,6 +1053,7 @@ either set @file{randomize_va_space} to 0 or run as root to dump. @end table + @node Automatic C Preprocessor Definitions, Problems Compiling, Saving Images, Installing SCM @section Automatic C Preprocessor Definitions @@ -1093,11 +1093,12 @@ __APPLE__ Apple Darwin AMIGA SAS/C 5.10 or Dice C on AMIGA __amigaos__ Gnu CC on AMIGA atarist ATARI-ST under Gnu CC +__DragonflyBSD__ DragonflyBSD __FreeBSD__ FreeBSD GNUDOS DJGPP (obsolete in version 1.08) __GO32__ DJGPP (future?) hpux HP-UX -linux Linux +linux GNU/Linux macintosh Macintosh (THINK_C and __MWERKS__ define) MCH_AMIGA Aztec_c 5.2a on AMIGA __MACH__ Apple Darwin @@ -1107,6 +1108,7 @@ _MSDOS Microsoft CLARM and CLTHUMB compilers. __MSDOS__ Turbo C, Borland C, and DJGPP __NetBSD__ NetBSD nosve Control Data NOS/VE +__OpenBSD__ OpenBSD SVR2 System V Revision 2. sun SunOS __SVR4 SunOS @@ -1146,6 +1148,7 @@ vax VAX processor __x86_64 AMD Opteron @end example + @node Problems Compiling, Problems Linking, Automatic C Preprocessor Definitions, Installing SCM @section Problems Compiling @@ -1200,6 +1203,7 @@ __x86_64 AMD Opteron @tab @t{#define SYSTNAME} to your system type in scl.c (softtype). @end multitable + @node Problems Linking, Problems Running, Problems Compiling, Installing SCM @section Problems Linking @@ -1210,6 +1214,7 @@ __x86_64 AMD Opteron @tab Uncomment @t{LIBS} in makefile. @end multitable + @node Problems Running, Testing, Problems Linking, Installing SCM @section Problems Running @@ -1248,6 +1253,7 @@ __x86_64 AMD Opteron @tab Make sure the value of @t{(library-vicinity)} has a trailing file separator (like @t{/} or @t{\}). @end multitable + @node Testing, Reporting Problems, Problems Running, Installing SCM @section Testing @@ -1334,6 +1340,7 @@ exacerbated by using lots of call-with-current-continuations. A possible fix for dynthrow() is commented out in @file{continue.c}. @end table + @node Reporting Problems, , Testing, Installing SCM @section Reporting Problems @@ -1361,6 +1368,7 @@ and date of that distribution. In this case, corresponding with the vendor is recommended. @end enumerate + @node Operational Features, The Language, Installing SCM, Top @chapter Operational Features @@ -1384,7 +1392,8 @@ vendor is recommended. @example @exdent @b{ scm } [-a @i{kbytes}] [-muvbiq] @w{[--version]} @w{[--help]} -@w{[[-]-no-init-file]} @w{[-p @i{int}]} @w{[-r @i{feature}]} @w{[-h @i{feature}]} +@w{[[-]-no-init-file]} @w{[--no-symbol-case-fold]} +@w{[-p @i{int}]} @w{[-r @i{feature}]} @w{[-h @i{feature}]} @w{[-d @i{filename}]} @w{[-f @i{filename}]} @w{[-l @i{filename}]} @w{[-c @i{expression}]} @w{[-e @i{expression}]} @w{[-o @i{dumpname}]} @w{[-- | - | -s]} @w{[@i{filename}]} @w{[@i{arguments} @dots{}]} @@ -1428,6 +1437,7 @@ This explanation applies to SCMLIT or other builds of SCM. Scheme-code files can also invoke SCM and its variants. @xref{Lexical Conventions, #!}. + @node SCM Options, Invocation Examples, Invoking SCM, Operational Features @section Options @@ -1447,6 +1457,10 @@ file @file{setjump.h} which the distribution sets at Inhibits the loading of @file{ScmInit.scm} as described above. @end deffn +@deffn {Command Option} --no-symbol-case-fold +Symbol (and identifier) names will be case sensitive. +@end deffn + @deffn {Command Option} ---help prints usage information and URI; then exit. @end deffn @@ -1556,6 +1570,7 @@ aguments. specifies that further options are to be treated as program aguments. @end deffn + @node Invocation Examples, SCM Variables, SCM Options, Operational Features @section Invocation Examples @@ -1588,6 +1603,7 @@ enters interactive (with macros) session. Like above but @code{rev4-optional-procedures} are also loaded. @end table + @node SCM Variables, SCM Session, Invocation Examples, Operational Features @section Environment Variables @@ -1633,14 +1649,15 @@ command line. This can be overridden by subsequent @code{-i} and @code{-b} options. @end defvar + @node SCM Session, Editing Scheme Code, SCM Variables, Operational Features @section SCM Session @itemize @bullet @item Options, file loading and features can be specified from the command -line. @xref{System interface, , , scm, SCM}. @xref{Require, , , slib, -SLIB}. +line. +@xref{System interface, , , scm, SCM}. @xref{Require, , , slib, SLIB}. @item Typing the end-of-file character at the top level session (while SCM is not waiting for parenthesis closure) causes SCM to exit. @@ -1654,8 +1671,8 @@ and resumes the top level read-eval-print loop. @defunx exit @defunx exit n Aliases for @code{exit} (@pxref{System, exit, , slib, SLIB}). On many -systems, SCM can also tail-call another program. @xref{I/O-Extensions, -execp}. +systems, SCM can also tail-call another program. +@xref{I/O-Extensions, execp}. @end defun @deffn {Callback procedure} boot-tail dumped? @@ -1755,9 +1772,10 @@ expressions. Also as the result of the @samp{CAUTIOUS} flag, both @code{error} and @code{user-interrupt} (invoked by @key{C-c}) to print stack traces and -conclude by calling @code{breakpoint} (@pxref{Breakpoints, , , slib, -SLIB}) instead of aborting to top level. Under either condition, -program execution can be resumed by @code{(continue)}. +conclude by calling @code{breakpoint} +(@pxref{Breakpoints, , , slib, SLIB}) instead of aborting to top +level. Under either condition, program execution can be resumed by +@code{(continue)}. In this configuration one can interrupt a running Scheme program with @key{C-c}, inspect or modify top-level values, trace or untrace @@ -1858,6 +1876,7 @@ ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz @end lisp + @node Debugging Continuations, Errors, Debugging Scheme Code, Operational Features @section Debugging Continuations @@ -2075,9 +2094,9 @@ expressions. @noindent Also as the result of the @samp{CAUTIOUS} flag, both @code{error} and @code{user-interrupt} (invoked by @key{C-c}) are defined to print stack -traces and conclude by calling @code{breakpoint} (@pxref{Breakpoints, , -, slib, SLIB}). This allows the user to interract with SCM as with Lisp -systems. +traces and conclude by calling @code{breakpoint} +(@pxref{Breakpoints, , , slib, SLIB}). This allows the user to +interract with SCM as with Lisp systems. @defun stack-trace Prints information describing the stack of partially evaluated @@ -2086,6 +2105,7 @@ printed and @code{#f} otherwise. See @file{Init@value{SCMVERSION}.scm} for an example of the use of @code{stack-trace}. @end defun + @node Memoized Expressions, Internal State, Errors, Operational Features @section Memoized Expressions @@ -2117,7 +2137,7 @@ For instance, @code{open-input-file} is defined as follows in @example (define (open-input-file str) - (or (open-file str OPEN_READ) + (or (open-file str open_read) (and (procedure? could-not-open) (could-not-open) #f) (error "OPEN-INPUT-FILE couldn't open file " str))) @end example @@ -2254,8 +2274,8 @@ is returned. @end defun @noindent -For other configuration constants and procedures @xref{Configuration, , -, slib, SLIB}. +For other configuration constants and procedures +@xref{Configuration, , , slib, SLIB}. @node Scripting, , Internal State, Operational Features @@ -2533,8 +2553,7 @@ and </A> @end ifset @ifinfo -@ref{Top, , , r5rs, Revised(5) Report on the Algorithmic Language -Scheme}. +@ref{Top, , , r5rs, Revised(5) Report on the Algorithmic Language Scheme}. @end ifinfo All the required features of these specifications are supported. Many of the optional features are supported as well. @@ -2728,6 +2747,7 @@ seconds. @xref{Time and Date, current-time, , slib, SLIB}. @code{current-time} used in @ref{Time and Date, , , slib, SLIB}. @end defun + @node Interrupts, Process Synchronization, Time, The Language @section Interrupts @@ -2908,8 +2928,8 @@ Contain modes strings specifying that a file is to be opened for reading, writing, and both reading and writing respectively. Both input and output functions can be used with io-ports. An end of -file must be read or a file-set-position done on the port between a read -operation and a write operation or vice-versa. +file must be read or a two-argument file-position done on the port +between a read operation and a write operation or vice-versa. @end defvr @defun _ionbf modestr @@ -2965,6 +2985,18 @@ Returns the filename @var{port} was opened with. If @var{port} is not open to a file the result is unspecified. @end defun +@defun file-position port +@defunx file-position port #f +Returns the current position of the character in @var{port} which will +next be read or written. If @var{port} is open to a non-file then +@code{#f} is returned. + +@defunx file-position port k +Sets the current position in @var{port} which will next be read or +written. If successful, @code{#f} is returned. If @var{port} is open +to a non-file, then @code{file-position} returns @code{#f}. +@end defun + @defun port-line port @defunx port-column port If @var{port} is a tracked port, return the current line (column) number, @@ -3094,9 +3126,9 @@ procedures. For an input-only port only elements 3 and 4 need be procedures. Thunks 2 and 4 can instead be @code{#f} if there is no useful operation for them to perform. -If thunk 3 returns @code{#f} or an @code{eof-object} (@pxref{Input, -eof-object?, ,r5rs, Revised(5) Scheme}) it indicates that the port has -reached end-of-file. For example: +If thunk 3 returns @code{#f} or an @code{eof-object} +(@pxref{Input, eof-object?, ,r5rs, Revised(5) Scheme}) it indicates +that the port has reached end-of-file. For example: If it is necessary to explicitly close the port when it is garbage collected, (@pxref{Interrupts, add-finalizer}). @@ -3117,7 +3149,6 @@ collected, (@pxref{Interrupts, add-finalizer}). @end defun - @node Eval and Load, Lexical Conventions, Files and Ports, The Language @section Eval and Load @@ -3528,7 +3559,6 @@ expansion. @code{defconst} constants should be defined before use. @end defspec - @node Defmacro, Syntax-Rules, Define and Set, Syntax @subsection Defmacro @@ -3758,15 +3788,16 @@ Thus a mutable environment can be treated as both a list and local bindings. @end defspec + @node Syntactic Hooks for Hygienic Macros, , Environment Frames, Syntax @subsection Syntactic Hooks for Hygienic Macros SCM provides a synthetic identifier type for efficient implementation of -hygienic macros (for example, @code{syntax-rules} @pxref{Macros, , , -r5rs, Revised(5) Scheme}) A synthetic identifier may be inserted in -Scheme code by a macro expander in any context where a symbol would -normally be used. Collectively, symbols and synthetic identifiers are -@emph{identifiers}. +hygienic macros (for example, @code{syntax-rules} +@pxref{Macros, , , r5rs, Revised(5) Scheme}) A synthetic identifier +may be inserted in Scheme code by a macro expander in any context +where a symbol would normally be used. Collectively, symbols and +synthetic identifiers are @emph{identifiers}. @defun identifier? obj Returns @code{#t} if @var{obj} is a symbol or a synthetic @@ -3929,6 +3960,7 @@ identifier renamed in the definition environment of the new syntax. both denote the same binding in the usage environment of the new syntax. @end defspec + @node Packages, The Implementation, The Language, Top @chapter Packages @@ -4009,7 +4041,7 @@ will load/link @file{sc2.o} if it exists. The @var{lib1} @dots{} pathnames specify additional libraries which may be needed for object files not produced by the Hobbit compiler. For -instance, crs is linked on Linux by +instance, crs is linked on GNU/Linux by @example (load (in-vicinity (implementation-vicinity) "crs.o") @@ -4027,8 +4059,8 @@ or (require 'turtle-graphics) @ftindex turtle-graphics @end example -And the string regular expression (@pxref{Regular Expression Pattern -Matching}) package is linked by: +And the string regular expression +(@pxref{Regular Expression Pattern Matching}) package is linked by: @example (load (in-vicinity (implementation-vicinity) "rgx") (usr:lib "c")) @@ -4205,6 +4237,7 @@ bash$ ./rscm -lpi.scm -e"(pi (random 200) 5)" bash$ @end example + @node Numeric, Arrays, Dump, Packages @section Numeric @@ -4223,8 +4256,8 @@ The ratio of the circumference to the diameter of a circle. @end defvr @noindent -These procedures augment the standard capabilities in @ref{Numerical -operations, , ,r5rs, Revised(5) Scheme}. +These procedures augment the standard capabilities in +@ref{Numerical operations, , ,r5rs, Revised(5) Scheme}. @defun pi* z @code{(* pi @var{z})} @@ -4282,6 +4315,7 @@ an error if the value which should be returned by a call to @code{real-expt} is not real. @end defun + @node Arrays, Records, Numeric, Packages @section Arrays @@ -4400,8 +4434,8 @@ are equivalent to (and can't be distinguished from) strings. @noindent Unshared uniform boolean 0-based arrays of rank 1 (dimension) are -equivalent to (and can't be distinguished from) @ref{Bit Vectors, -bit-vectors}. +equivalent to (and can't be distinguished from) +@ref{Bit Vectors, bit-vectors}. @example (make-array '#1at() 3) @result{} #*000 @equiv{} @@ -4505,6 +4539,7 @@ if the array element is not an exact integer or if @var{val} is not boolean. @end defun + @node Bit Vectors, Array Mapping, Uniform Array, Arrays @subsection Bit Vectors @@ -4573,9 +4608,9 @@ Same as @code{array:copy!} but guaranteed to copy in row-major order. @end defun @defun array-equal? array0 array1 @dots{} -Returns @code{#t} iff all arguments are arrays with the same shape, the -same type, and have corresponding elements which are either -@code{equal?} or @code{array-equal?}. This function differs from +Returns @code{#t} iff all arguments are arrays with the same shape, +the same type, and have corresponding elements which are either +@code{equal?} or @code{array-equal?}. This function differs from @code{equal?} in that a one dimensional shared array may be @var{array-equal?} but not @var{equal?} to a vector or uniform vector. @end defun @@ -4641,6 +4676,7 @@ A @var{printer} value of #f means use the default printer. Only the default printer will be used when printing error messages. @end defun + @node I/O-Extensions, Posix Extensions, Records, Packages @section I/O-Extensions @@ -4688,19 +4724,6 @@ Last file status change time Returns the process ID of the current process. @end defun -@defun file-position port -Returns the current position of the character in @var{port} which will -next be read or written. If @var{port} is not open to a file the result -is unspecified. -@end defun - -@defun file-set-position port integer -Sets the current position in @var{port} which will next be read or -written. If @var{port} is not open to a file the action of -@code{file-set-position} is unspecified. The result of -@code{file-set-position} is unspecified. -@end defun - @defun try-create-file name modes perms If the file with name @var{name} already exists, return @code{#f}, otherwise try to create and open the file like @code{try-open-file}, @@ -4781,8 +4804,9 @@ Applies @var{proc} only to those filenames for which @defun mkdir path mode The @code{mkdir} function creates a new, empty directory whose name is @var{path}. The integer argument @var{mode} specifies the file -permissions for the new directory. @xref{The Mode Bits for Access -Permission, , , libc, Gnu C Library}, for more information about this. +permissions for the new directory. +@xref{The Mode Bits for Access Permission, , , libc, Gnu C Library}, +for more information about this. @code{mkdir} returns if successful, @code{#f} if not. @end defun @@ -4901,10 +4925,11 @@ invariably uppercase. @code{execl}, @code{execlp}, @code{execv}, @code{execvp}, @code{system}, or @code{open-pipe} (@pxref{Posix Extensions, open-pipe}). -To access environment variables, use @code{getenv} (@pxref{System -Interface, getenv, , slib, SLIB}). +To access environment variables, use @code{getenv} +(@pxref{System Interface, getenv, , slib, SLIB}). @end defun + @node Posix Extensions, Unix Extensions, I/O-Extensions, Packages @section Posix Extensions @@ -4963,8 +4988,8 @@ process's @code{fork} returns 0. @end defun @noindent -For a discussion of @dfn{ID}s @xref{Process Persona, , , GNU C Library, -libc}. +For a discussion of @dfn{ID}s +@xref{Process Persona, , , GNU C Library, libc}. @defun getppid Returns the process ID of the parent of the current process. @@ -5219,6 +5244,7 @@ string containing the file name of termainal device; otherwise @code{#f}. @end defun + @node Unix Extensions, Sequence Comparison, Posix Extensions, Packages @section Unix Extensions @@ -5282,7 +5308,6 @@ writing is done. The value returned is unspecified. @end defun - @node Sequence Comparison, Regular Expression Pattern Matching, Unix Extensions, Packages @section Sequence Comparison @@ -5300,8 +5325,8 @@ These functions are defined in @file{rgx.c} using a POSIX or GNU @dfn{regex} library. If your computer does not support regex, a package is available via ftp from @file{ftp.gnu.org:/pub/gnu/regex-0.12.tar.gz}. For a description of -regular expressions, @xref{syntax, , , regex, "regex" regular expression -matching library}. +regular expressions, +@xref{syntax, , , regex, "regex" regular expression matching library}. @defun regcomp @var{pattern} [@var{flags}] Compile a @dfn{regular expression}. Return a compiled regular @@ -5416,6 +5441,7 @@ to perform one substitution. @end table @end defun + @node Line Editing, Curses, Regular Expression Pattern Matching, Packages @section Line Editing @@ -5424,8 +5450,9 @@ These procedures provide input line editing and recall. @noindent These functions are defined in @file{edline.c} and @file{Iedline.scm} -using the @dfn{editline} or GNU @dfn{readline} (@pxref{Top, , Overview -,readline ,GNU Readline Library}) libraries available from: +using the @dfn{editline} or GNU @dfn{readline} +(@pxref{Top, , Overview ,readline ,GNU Readline Library}) libraries +available from: @itemize @bullet @item @@ -5476,6 +5503,7 @@ input and output ports to an edited line port and returns the previous value of @code{(line-editing)}. @end defun + @node Curses, Sockets, Line Editing, Packages @section Curses @@ -5494,8 +5522,7 @@ A program should call @code{endwin} before exiting or escaping from curses mode temporarily, to do a system call, for example. This routine will restore termio modes, move the cursor to the lower left corner of the screen and reset the terminal into the proper non-visual mode. To -resume after a temporary escape, call @ref{Window Manipulation, -refresh}. +resume after a temporary escape, call @ref{Window Manipulation, refresh}. @end defun @menu @@ -5566,6 +5593,7 @@ ready, wgetch will return an eof-object. If disabled, wgetch will hang until a key is pressed. @end defun + @node Terminal Mode Setting, Window Manipulation, Output Options Setting, Curses @subsection Terminal Mode Setting @@ -5635,6 +5663,7 @@ These routines save and restore the state of the terminal modes. @code{savetty}. @end defun + @node Window Manipulation, Output, Terminal Mode Setting, Curses @subsection Window Manipulation @@ -5712,6 +5741,7 @@ specified is relative to the upper left corner of the window @var{win}, which is (0, 0). @end defun + @node Output, Input, Window Manipulation, Curses @subsection Output @@ -5752,10 +5782,10 @@ This routine copies blanks to every position in the window @var{win}. @end defun @defun wclear win -This routine is like @code{werase}, but it also calls @ref{Output -Options Setting, clearok}, arranging that the screen will be cleared -completely on the next call to @code{refresh} or @code{force-output} for -window @var{win}, and repainted from scratch. +This routine is like @code{werase}, but it also calls +@ref{Output Options Setting, clearok}, arranging that the screen will +be cleared completely on the next call to @code{refresh} or +@code{force-output} for window @var{win}, and repainted from scratch. @end defun @defun wclrtobot win @@ -5802,6 +5832,7 @@ is stdscr and the scrolling region is the entire window, the physical screen will be scrolled at the same time. @end defun + @node Input, Curses Miscellany, Output, Curses @subsection Input @@ -5829,6 +5860,7 @@ A list of the y and x coordinates of the cursor position of the window @var{win} is returned @end defun + @node Curses Miscellany, , Input, Curses @subsection Curses Miscellany @@ -5865,6 +5897,7 @@ displayed in the @kbd{C-x} notation. Printing characters are displayed as is. @end defun + @node Sockets, SCMDB, Curses, Packages @section Sockets @@ -5989,6 +6022,7 @@ between calls to getserv. Otherwise, the table stays open. When called without an argument, the service table is closed. @end defun + @node Internet Addresses and Socket Names, Socket, Host and Other Inquiries, Sockets @subsection Internet Addresses and Socket Names @@ -6125,9 +6159,9 @@ port) if successful, @code{#f} if not. @defun char-ready? listen-socket The input port returned by a successful call to @code{socket:listen} can -be polled for connections by @code{char-ready?} (@pxref{Files and Ports, -char-ready?}). This avoids blocking on connections by -@code{socket:accept}. +be polled for connections by @code{char-ready?} +(@pxref{Files and Ports, char-ready?}). This avoids blocking on +connections by @code{socket:accept}. @end defun @defun socket:accept socket @@ -6184,9 +6218,9 @@ sockets for multiple connections without input blocking. (next (cdr con-list))) (else (for-each (lambda (con) - (file-set-position con 0) + (file-position con 0) (write-char c con) - (file-set-position con 0)) + (file-position con 0)) connections) (cons con (next (cdr con-list))))))) (else (cons con (next (cdr con-list))))))))))))) @@ -6217,9 +6251,9 @@ or you can use a client written in scheme: (ct (and actives (memq (current-input-port) actives) (read-char)))) (cond ((or (eof-object? cs) (eof-object? ct)) (close-port con)) (else (cond (cs (display cs))) - (cond (ct (file-set-position con 0) + (cond (ct (file-position con 0) (display ct con) - (file-set-position con 0))) + (file-position con 0))) (go))))) (cond (con (display "Connecting to ") (display (getpeername con)) @@ -6229,6 +6263,7 @@ or you can use a client written in scheme: (newline))) @end example + @node SCMDB, , Sockets, Packages @section SCMDB @@ -6485,6 +6520,7 @@ A @dfn{CAR Immediate} is an Immediate point which can only occur in the @code{CAR}s of evaluated code (as a result of @code{ceval}'s memoization process). + @node Cells, Header Cells, Immediates, Data Types @subsection Cells @@ -6555,6 +6591,7 @@ Returns the a lower bound on the number of required arguments to closure @end deftp + @node Header Cells, Subr Cells, Cells, Data Types @subsection Header Cells @@ -6691,6 +6728,7 @@ Expands to the length of @var{cclo}. @end defmac @end deftp + @node Subr Cells, Ptob Cells, Header Cells, Data Types @subsection Subr Cells @@ -6767,16 +6805,18 @@ C function of 2 arguments and a list of (rest of) @code{SCM} arguments. C function of list of @code{SCM} arguments. @end deftp + @node Ptob Cells, Smob Cells, Subr Cells, Data Types @subsection Ptob Cells @noindent A @dfn{ptob} is a port object, capable of delivering or accepting @tindex ptob -characters. @xref{Ports, , , r5rs, Revised(5) Report on the Algorithmic -Language Scheme}. Unlike the types described so far, new varieties of -ptobs can be defined dynamically (@pxref{Defining Ptobs}). These are -the initial ptobs: +characters. +@xref{Ports, , , r5rs, Revised(5) Report on the Algorithmic Language Scheme}. +Unlike the types described so far, new varieties of ptobs can be +defined dynamically (@pxref{Defining Ptobs}). These are the initial +ptobs: @deftp ptob tc16_inport input port. @@ -6838,6 +6878,7 @@ Returns non-zero if @var{x} is a port, open port, open input-port, or open output-port, respectively. @end defmac + @node Smob Cells, Data Type Representations, Ptob Cells, Data Types @subsection Smob Cells @@ -7027,6 +7068,7 @@ macro 000000000000000mxxxxxxxxG1111111 ...........SCM name............. array ...short rank..cxxxxxxxxG1111111 ............*array..............} @end format + @node Operations, Program Self-Knowledge, Data Types, The Implementation @section Operations @@ -7110,6 +7152,7 @@ used. This has not been a problem in practice and the advantage of using the c-stack far outweighs it. @end deftypefun + @node Sweeping the Heap, , Marking Cells, Garbage Collection @subsubsection Sweeping the Heap @@ -7132,6 +7175,7 @@ object is freed. If the type header of smob is collected, the smob's @code{free} procedure is called to free its storage. @end deftypefun + @node Memory Management for Environments, Signals, Garbage Collection, Operations @subsection Memory Management for Environments @@ -7246,8 +7290,6 @@ into garbage collection techniques about which a considerable amount of literature is available. - - @node Signals, C Macros, Memory Management for Environments, Operations @subsection Signals @cindex signals @@ -7290,6 +7332,7 @@ that this constraint is satisfied @code{#define CAREFUL_INTS} in @file{scmfig.h}. @end defmac + @node C Macros, Changing Scm, Signals, Operations @subsection C Macros @@ -7559,6 +7602,7 @@ void init_gsubr211() @end example @end defun + @node Defining Smobs, Defining Ptobs, Defining Subrs, Operations @subsection Defining Smobs @@ -7633,6 +7677,7 @@ provide examples of SMOBs. There are a maximum of 256 SMOBs. Smobs that must allocate blocks of memory should use, for example, @code{must_malloc} rather than @code{malloc} @xref{Allocating memory}. + @node Defining Ptobs, Allocating memory, Defining Smobs, Operations @subsection Defining Ptobs @@ -7665,6 +7710,7 @@ for examples of how to define ptobs. Ptobs that must allocate blocks of memory should use, for example, @code{must_malloc} rather than @code{malloc} @xref{Allocating memory}. + @node Allocating memory, Embedding SCM, Defining Ptobs, Operations @subsection Allocating memory SCM maintains a count of bytes allocated using malloc, and calls the @@ -7713,7 +7759,6 @@ instead. @end deftypefun - @node Embedding SCM, Callbacks, Allocating memory, Operations @subsection Embedding SCM @cindex Embedding SCM @@ -7944,8 +7989,8 @@ Loads the Scheme source file @code{(in-vicinity (program-vicinity) This function is useful for compiled code init_ functions to load non-compiled Scheme (source) files. @code{program-vicinity} is the -directory from which the calling code was loaded (@pxref{Vicinity, , , -slib, SLIB}). +directory from which the calling code was loaded +(@pxref{Vicinity, , , slib, SLIB}). @end deftypefun @deftypefun SCM scm_evstr (char *@var{str}) @@ -7980,7 +8025,6 @@ can use a wrapper like this for your Scheme procedures: Calls to procedures so wrapped will return even if an error occurs. - @node Type Conversions, Continuations, Callbacks, Operations @subsection Type Conversions @@ -8071,6 +8115,7 @@ Frees the storage allocated to create @var{argv} by a call to @code{makargvfrmstrs}. @end deftypefun + @node Continuations, Evaluation, Type Conversions, Operations @subsection Continuations @cindex continuations @@ -8079,8 +8124,8 @@ Frees the storage allocated to create @var{argv} by a call to The source files @file{continue.h} and @file{continue.c} are designed to function as an independent resource for programs wishing to use continuations, but without all the rest of the SCM machinery. The -concept of continuations is explained in @ref{Control features, -call-with-current-continuation, , r5rs, Revised(5) Scheme}. +concept of continuations is explained in +@ref{Control features, call-with-current-continuation, , r5rs, Revised(5) Scheme}. @noindent The C constructs @code{jmp_buf}, @code{setjmp}, and @code{longjmp} @@ -8184,6 +8229,7 @@ the saved stack is copied back into it's original position. @end itemize @end deftypefun + @node Evaluation, , Continuations, Operations @subsection Evaluation @@ -8294,6 +8340,7 @@ environment. @code{eval} copies @code{expression} so that memoization does not modify @code{expression}. @end deftypefun + @node Program Self-Knowledge, Improvements To Make, Operations, The Implementation @section Program Self-Knowledge @@ -8435,6 +8482,7 @@ executable file. in any of the directories listed in @code{PATH}. @end deftypefun + @node Script Support, , Executable Pathname, Program Self-Knowledge @subsection Script Support @@ -1,4 +1,4 @@ -/* Copyright (C) 1990-1999 Free Software Foundation, Inc. +/* Copyright (C) 1990-2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -417,6 +417,16 @@ rgx.c init_rgx(); regcomp and regexec. */ # define WHITE_SPACES ' ':case '\t':case '\r':case '\f' #endif +#ifdef __ia64__ +# define PTR2INT(x) ((long)(x)) +#else +# ifdef __x86_64 +# define PTR2INT(x) ((long)(x)) +# else +# define PTR2INT(x) ((int)(x)) +# endif +#endif + /* Define BIGDIG to an integer type whose size is smaller than long if you want bignums. BIGRAD is one greater than the biggest BIGDIG. */ /* Define DIGSTOOBIG if the digits equivalent to a long won't fit in a long. */ @@ -765,6 +775,14 @@ typedef SCM *SCMPTR; # include <unistd.h> #endif +#ifdef __FreeBSD__ +# include <unistd.h> +#endif + +#ifdef linux +# include <unistd.h> +#endif + /* On VMS, GNU C's errno.h contains a special hack to get link attributes for errno correct for linking with libc. */ @@ -795,7 +813,7 @@ typedef SCM *SCMPTR; #ifdef _WIN32 // Windows doesn't set errno = EINTR -# define SYSCALL(line) do{ line; while(GetLastError() == ERROR_OPERATION_ABORTED){SetLastError(0);Sleep(10);line};}while(0) +# define SYSCALL(line) do{line;while(GetLastError() == ERROR_OPERATION_ABORTED){SetLastError(0);Sleep(10);line};}while(0) #else # define SYSCALL(line) do{errno = 0;line}while(SCM_INTERRUPTED(errno)) #endif @@ -1,5 +1,5 @@ /* scmhob.h is a header file for scheme source compiled with hobbit5x - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Tanel Tammet + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Tanel Tammet This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -76,9 +76,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. #define BOOLEAN_P(x) ((x)==BOOL_T || (x)==BOOL_F) #define CHAR_P ICHRP -#define SYMBOL_P(x) (ISYMP(x) || (!(IMP(x)) && SYMBOLP(x))) -#define VECTOR_P(x) (!(IMP(x)) && VECTORP(x)) -#define PAIR_P(x) (!(IMP(x)) && CONSP(x)) +#define SYMBOL_P(x) (ISYMP(x) || (!(IMP(x)) && SYMBOLP(x))) +#define VECTOR_P(x) (!(IMP(x)) && VECTORP(x)) +#define PAIR_P(x) (!(IMP(x)) && CONSP(x)) #define NUMBER_P INUMP #define INTEGER_P INUMP #define STRING_P(x) (!(IMP(x)) && STRINGP(x)) @@ -224,7 +224,7 @@ char *find_impl_file(exec_path, generic_name, initname, sep) /* Look for initname in peer directories "lib" and "src" in subdirectory with the name of the executable (sans any type extension like .EXE). */ - for(peer="lib";!0;peer="src") { + for (peer="lib";!0;peer="src") { path = scm_cat_path(0L, exec_path, extptr - exec_path + 0L); if (path) { strncpy(path + sepind - 4, peer, 3); @@ -239,7 +239,7 @@ char *find_impl_file(exec_path, generic_name, initname, sep) /* Look for initname in peer directories "lib" and "src" in subdirectory with the generic name. */ - for(peer="lib";!0;peer="src") { + for (peer="lib";!0;peer="src") { path = scm_cat_path(0L, exec_path, sepind); if (path) { strncpy(path + sepind - 4, peer, 3); @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -173,7 +173,7 @@ SCM l_hostinfo(name) ve[ 3] = MAKINUM(entry->h_length + 0L); if (sizeof(struct in_addr) != entry->h_length) {ve[ 4] = BOOL_F; return ans;} - for(argv = entry->h_addr_list; argv[i]; i++); + for (argv = entry->h_addr_list; argv[i]; i++); while (i--) { inad = *(struct in_addr *)argv[i]; lst = cons(ulong2num(ntohl(inad.s_addr)), lst); @@ -535,11 +535,11 @@ int sknm_print(exp, port, writing) lputs("inet-addr ", port); lputs(inet_ntoa(((struct sockaddr_in *)CDR(exp))->sin_addr), port); lputc(':', port); - intprint(0L + ntohs(((struct sockaddr_in *)CDR(exp))->sin_port), 10, port); + scm_intprint(0L + ntohs(((struct sockaddr_in *)CDR(exp))->sin_port), 10, port); break; default: lputs(s_unkfam, port); lputc(' ', port); - intprint(0L+((struct sockaddr *)CDR(exp))->sa_family, 10, port); + scm_intprint(0L+((struct sockaddr *)CDR(exp))->sa_family, 10, port); } lputc('>', port); return !0; @@ -186,7 +186,7 @@ SCM append(args) return res; } ASRTER(CONSP(args), args, ARGn, s_append); - for(;NIMP(arg);arg = CDR(arg)) { + for (;NIMP(arg);arg = CDR(arg)) { ASRTER(CONSP(arg), arg, ARGn, s_append); *lloc = cons(CAR(arg), EOL); lloc = &CDR(*lloc); @@ -199,7 +199,7 @@ SCM reverse(lst) { SCM res = EOL; SCM p = lst; - for(;NIMP(p);p = CDR(p)) { + for (;NIMP(p);p = CDR(p)) { ASRTER(CONSP(p), lst, ARG1, s_reverse); res = cons(CAR(p), res); } @@ -224,7 +224,7 @@ erout: ASRTER(NIMP(lst) && CONSP(lst), SCM memq(x, lst) SCM x, lst; { - for(;NIMP(lst);lst = CDR(lst)) { + for (;NIMP(lst);lst = CDR(lst)) { ASRTER(CONSP(lst), lst, ARG2, s_memq); if (CAR(lst)==x) return lst; } @@ -234,7 +234,7 @@ SCM memq(x, lst) SCM member(x, lst) SCM x, lst; { - for(;NIMP(lst);lst = CDR(lst)) { + for (;NIMP(lst);lst = CDR(lst)) { ASRTER(CONSP(lst), lst, ARG2, s_member); if (NFALSEP(equal(CAR(lst), x))) return lst; } @@ -245,7 +245,7 @@ SCM assq(x, alist) SCM x, alist; { SCM tmp; - for(;NIMP(alist);alist = CDR(alist)) { + for (;NIMP(alist);alist = CDR(alist)) { ASRTER(CONSP(alist), alist, ARG2, s_assq); tmp = CAR(alist); ASRTER(NIMP(tmp) && CONSP(tmp), alist, ARG2, s_assq); @@ -258,7 +258,7 @@ SCM assoc(x, alist) SCM x, alist; { SCM tmp; - for(;NIMP(alist);alist = CDR(alist)) { + for (;NIMP(alist);alist = CDR(alist)) { ASRTER(CONSP(alist), alist, ARG2, s_assoc); tmp = CAR(alist); ASRTER(NIMP(tmp) && CONSP(tmp), alist, ARG2, s_assoc); @@ -933,6 +933,7 @@ static char s_logand[] = "logand", s_lognot[] = "lognot", s_copybit[] = "copy-bit", s_copybitfield[] = "copy-bit-field", s_ash[] = "ash", s_logcount[] = "logcount", + s_bitwise_bit_count[] = "bitwise-bit-count", s_intlength[] = "integer-length", s_bitfield[] = "bit-field", s_bitif[] = "bitwise-if"; @@ -1312,7 +1313,7 @@ SCM scm_copybitfield(to, from, rest) } char logtab[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; -SCM scm_logcount(n) +SCM scm_bitwise_bit_count(n) SCM n; { register unsigned long c = 0; @@ -1320,18 +1321,42 @@ SCM scm_logcount(n) #ifdef BIGDIG if (NINUMP(n)) { sizet i; BIGDIG *ds, d; - ASRTER(NIMP(n) && BIGP(n), n, ARG1, s_logcount); - if (BIGSIGN(n)) return scm_logcount(difference(MAKINUM(-1L), n)); + ASRTER(NIMP(n) && BIGP(n), n, ARG1, s_bitwise_bit_count); + if (BIGSIGN(n)) + return scm_lognot(scm_bitwise_bit_count(difference(MAKINUM(-1L), n))); ds = BDIGITS(n); - for(i = NUMDIGS(n); i--; ) - for(d = ds[i]; d; d >>= 4) c += logtab[15 & d]; + for (i = NUMDIGS(n); i--; ) + for (d = ds[i]; d; d >>= 4) c += logtab[15 & d]; + if (BIGSIGN(n)) + return MAKINUM(-1 - c); return MAKINUM(c); } #else + ASRTER(INUMP(n), n, ARG1, s_bitwise_bit_count); +#endif + if ((nn = INUM(n)) < 0) nn = -1 - nn; + for (; nn; nn >>= 4) c += logtab[15 & nn]; + if (n < 0) + return MAKINUM(-1 - c); + return MAKINUM(c); +} + +SCM scm_logcount(n) + SCM n; +{ + register unsigned long c = 0; + register long nn; +#ifdef BIGDIG + if (NINUMP(n)) { + ASRTER(NIMP(n) && BIGP(n), n, ARG1, s_logcount); + if (BIGSIGN(n)) return scm_bitwise_bit_count(difference(MAKINUM(-1L), n)); + return scm_bitwise_bit_count(n); + } +#else ASRTER(INUMP(n), n, ARG1, s_logcount); #endif if ((nn = INUM(n)) < 0) nn = -1 - nn; - for(; nn; nn >>= 4) c += logtab[15 & nn]; + for (; nn; nn >>= 4) c += logtab[15 & nn]; return MAKINUM(c); } @@ -1349,14 +1374,14 @@ SCM scm_intlength(n) if (BIGSIGN(n)) return scm_intlength(difference(MAKINUM(-1L), n)); ds = BDIGITS(n); d = ds[c = NUMDIGS(n)-1]; - for(c *= BITSPERDIG; d; d >>= 4) {c += 4; l = ilentab[15 & d];} + for (c *= BITSPERDIG; d; d >>= 4) {c += 4; l = ilentab[15 & d];} return MAKINUM(c - 4 + l); } #else ASRTER(INUMP(n), n, ARG1, s_intlength); #endif if ((nn = INUM(n)) < 0) nn = -1 - nn; - for(;nn; nn >>= 4) {c += 4; l = ilentab[15 & nn];} + for (;nn; nn >>= 4) {c += 4; l = ilentab[15 & nn];} return MAKINUM(c - 4 + l); } @@ -1500,7 +1525,7 @@ SCM string(chrs) ASRTER(i >= 0, chrs, ARG1, s_string); res = makstr(i); data = UCHARS(res); - for(;NNULLP(chrs);chrs = CDR(chrs)) { + for (;NNULLP(chrs);chrs = CDR(chrs)) { ASRTER(ICHRP(CAR(chrs)), chrs, ARG1, s_string); *data++ = ICHR(CAR(chrs)); } @@ -1518,7 +1543,7 @@ SCM make_string(k, chr) dst = UCHARS(res); if (!UNBNDP(chr)) { ASRTER(ICHRP(chr), chr, ARG2, s_make_string); - for(i--;i >= 0;i--) dst[i] = ICHR(chr); + for (i--;i >= 0;i--) dst[i] = ICHR(chr); } return res; } @@ -1587,7 +1612,7 @@ SCM st_lessp(s1, s2) if (len>i) i = len; c1 = UCHARS(s1); c2 = UCHARS(s2); - for(i = 0;i<len;i++) { + for (i = 0;i<len;i++) { c = (*c1++ - *c2++); if (c>0) return BOOL_F; if (c<0) return BOOL_T; @@ -1622,7 +1647,7 @@ SCM stci_lessp(s1, s2) if (len>i) i=len; c1 = UCHARS(s1); c2 = UCHARS(s2); - for(i = 0;i<len;i++) { + for (i = 0;i<len;i++) { c = (upcase[*c1++] - upcase[*c2++]); if (c>0) return BOOL_F; if (c<0) return BOOL_T; @@ -1664,7 +1689,7 @@ SCM st_append(args) register long i = 0; register SCM l, s; register unsigned char *data; - for(l = args;NIMP(l);) { + for (l = args;NIMP(l);) { ASRTER(CONSP(l), l, ARGn, s_st_append); s = CAR(l); ASRTER(NIMP(s) && STRINGP(s), s, ARGn, s_st_append); @@ -1674,9 +1699,9 @@ SCM st_append(args) ASRTER(NULLP(l), args, ARGn, s_st_append); res = makstr(i); data = UCHARS(res); - for(l = args;NIMP(l);l = CDR(l)) { + for (l = args;NIMP(l);l = CDR(l)) { s = CAR(l); - for(i = 0;i<LENGTH(s);i++) *data++ = UCHARS(s)[i]; + for (i = 0;i<LENGTH(s);i++) *data++ = UCHARS(s)[i]; } return res; } @@ -1702,7 +1727,7 @@ SCM vector(l) ASRTER(i >= 0, l, ARG1, s_vector); res = make_vector(MAKINUM(i), UNSPECIFIED); data = VELTS(res); - for(;NIMP(l);l = CDR(l)) *data++ = CAR(l); + for (;NIMP(l);l = CDR(l)) *data++ = CAR(l); return res; } SCM vector_ref(v, k) @@ -2073,7 +2098,7 @@ SCM divbigbig(x, nx, y, ny, sgn, modes) } while (--j >= ny); switch (modes) { case 3: /* check that remainder==0 */ - for(j = ny;j && !zds[j-1];--j) ; if (j) return 0; + for (j = ny;j && !zds[j-1];--j) ; if (j) return 0; case 2: /* move quotient down in z */ j = (nx==ny ? nx+2 : nx+1) - ny; for (i = 0;i < j;i++) zds[i] = zds[i+ny]; @@ -2091,7 +2116,7 @@ SCM divbigbig(x, nx, y, ny, sgn, modes) if (d) divbigdig(zds, ny, d); } doadj: - for(j = ny;j && !zds[j-1];--j) ; + for (j = ny;j && !zds[j-1];--j) ; if (j * BITSPERDIG <= sizeof(SCM)*CHAR_BIT) if (INUMP(z = big2inum(z, j))) return z; return adjbig(z, j); @@ -2126,6 +2151,7 @@ static iproc subr1s[] = { {s_evenp, evenp}, {s_lognot, scm_lognot}, {s_logcount, scm_logcount}, + {s_bitwise_bit_count, scm_bitwise_bit_count}, {s_intlength, scm_intlength}, {"char?", charp}, {s_ch_alphap, char_alphap}, @@ -2226,7 +2252,7 @@ void init_iprocs(subra, type) iproc *subra; int type; { - for(;subra->string; subra++) + for (;subra->string; subra++) make_subr(subra->string, type, subra->cproc); @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,6 @@ #endif void igc P((const char *what, SCM basecont)); -void lfflush P((SCM port)); /* internal SCM call */ SCM *loc_open_file; /* for open-file callback */ SCM *loc_try_create_file; @@ -352,6 +351,7 @@ SCM del_fil(str) void prinport(exp, port, type) SCM exp; SCM port; char *type; { + int filn = fileno(STREAM(exp)); lputs("#<", port); if (CLOSEDP(exp)) lputs("closed-", port); else { @@ -366,8 +366,11 @@ void prinport(exp, port, type) # ifndef AMIGA # ifndef macintosh # ifndef PLAN9 - if (OPENP(exp) && tc16_fport==TYP16(exp) && isatty(fileno(STREAM(exp)))) - lputs(ttyname(fileno(STREAM(exp))), port); + if (OPENP(exp) && tc16_fport==TYP16(exp) && filn >= 0 && isatty(filn)) { + char *ttyn = ttyname(filn); + if (ttyn) lputs(ttyn, port); + else goto punt; + } else # endif # endif @@ -375,19 +378,20 @@ void prinport(exp, port, type) # endif # endif #endif + punt: { SCM s = PORTP(exp) ? SCM_PORTDATA(exp) : UNDEFINED; if (NIMP(s) && STRINGP(s)) - iprin1(s, port, 1); + scm_iprin1(s, port, 1); else if (OPFPORTP(exp)) - intprint((long)fileno(STREAM(exp)), 10, port); + scm_intprint((long)filn, 10, port); else - intprint(CDR(exp), -16, port); + scm_intprint(CDR(exp), -16, port); if (TRACKED & SCM_PORTFLAGS(exp)) { - lputs(" L", port); - intprint(scm_port_table[SCM_PORTNUM(exp)].line, 10, port); - lputs(" C", port); - intprint(scm_port_table[SCM_PORTNUM(exp)].col+0L, 10, port); + lputs(" L", port); + scm_intprint(scm_port_table[SCM_PORTNUM(exp)].line, 10, port); + lputs(" C", port); + scm_intprint(scm_port_table[SCM_PORTNUM(exp)].col+0L, 10, port); } } lputc('>', port); @@ -496,7 +500,7 @@ sizet pwrite(ptr, size, nitems, port) { sizet len = size * nitems; sizet i = 0; - for(;i < len;i++) putc(ptr[i], port); + for (;i < len;i++) putc(ptr[i], port); return len; } # define ffwrite pwrite @@ -521,6 +525,7 @@ static ptobfuns fptob = { fflush, fgetc, fclose}; + ptobfuns pipob = { 0, mark0, @@ -537,6 +542,7 @@ ptobfuns pipob = { #endif fflush, fgetc}; + static ptobfuns stptob = { s_string, markcdr, @@ -695,6 +701,7 @@ static int tc16_sysport; #define SYS_ERRP_SIZE 480 static char errbuf[SYS_ERRP_SIZE]; static sizet errbuf_end = 0; + static sizet syswrite(str, siz, num, p) sizet siz, num; char *str; FILE *p; @@ -709,11 +716,11 @@ static sizet syswrite(str, siz, num, p) errbuf_end = dst; } else { - if (NIMP(cur_outp)) lflush(cur_outp); + /* if (NIMP(cur_errp) && OPOUTPORTP(cur_errp)) lfflush(cur_errp); */ if (errbuf_end > 0) { if (errbuf_end > SYS_ERRP_SIZE) { scm_warn("output buffer", " overflowed", UNDEFINED); - intprint((long)errbuf_end, 10, cur_errp); + scm_intprint((long)errbuf_end, 10, cur_errp); lputs(" chars needed\n", cur_errp); errbuf_end = errbuf_end % SYS_ERRP_SIZE; lfwrite(&errbuf[errbuf_end], 1, @@ -723,7 +730,7 @@ static sizet syswrite(str, siz, num, p) errbuf_end = 0; } num = lfwrite(str, siz, num, cur_errp); - lflush(cur_errp); + /* if (NIMP(cur_errp) && OPOUTPORTP(cur_errp)) lfflush(cur_errp); */ } errno = 0; return num; @@ -741,12 +748,6 @@ static int sysputc(c, p) syswrite(&cc, 1, 1, p); return c; } -static int sysflush(p) - FILE *p; -{ - syswrite(0, 0, 0, p); - return 0; -} static ptobfuns sysptob = { 0, mark0, @@ -756,7 +757,7 @@ static ptobfuns sysptob = { sysputc, sysputs, syswrite, - sysflush, + noop0, noop0, noop0}; @@ -828,7 +829,7 @@ static int safeputc(c, p) static int safeflush(p) safeport *p; { - lflush(p->port); + if (p && NIMP(p->port) && OPOUTPORTP(p->port)) lfflush(p->port); return 0; } static SCM marksafep(ptr) @@ -860,7 +861,7 @@ static int freeprint(exp, port, writing) { if (tc_broken_heart==CAR(exp)) { lputs("#<GC-FORWARD->", port); - iprin1(CDR(exp), port, writing); + scm_iprin1(CDR(exp), port, writing); } else { if (NIMP(CDR(exp)) && tc7_smob==CAR(CDR(exp))) { @@ -868,10 +869,10 @@ static int freeprint(exp, port, writing) } else { lputs("#<NEW-CELL . ", port); - iprin1(CDR(exp), port, writing); + scm_iprin1(CDR(exp), port, writing); } lputs(" @0x", port); - intprint((long)exp, -16, port); + scm_intprint((long)exp, -16, port); } lputc('>', port); return !0; @@ -1390,7 +1391,7 @@ SCM sym2vcell(sym) SCM lsym, z; sizet hash = strhash(UCHARS(sym), (sizet)LENGTH(sym), (unsigned long)symhash_dim); - for(lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { + for (lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { z = CAR(lsym); if (CAR(z)==sym) return z; } @@ -1408,12 +1409,12 @@ SCM intern(name, len) sizet hash = strhash(tmp, i, (unsigned long)symhash_dim); /* printf("intern %s len=%d\n",name,len); fflush(stdout); */ DEFER_INTS; - for(lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { + for (lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { z = CAR(lsym); z = CAR(z); tmp = UCHARS(z); if (LENGTH(z) != len) goto trynext; - for(i = len;i--;) if (((unsigned char *)name)[i] != tmp[i]) goto trynext; + for (i = len;i--;) if (((unsigned char *)name)[i] != tmp[i]) goto trynext; ALLOW_INTS; return CAR(lsym); trynext: ; @@ -1439,12 +1440,12 @@ SCM sysintern(name, val) register sizet i = len; register unsigned char *tmp = (unsigned char *)name; sizet hash = strhash(tmp, i, (unsigned long)symhash_dim); - for(lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { + for (lsym = VELTS(symhash)[hash];NIMP(lsym);lsym = CDR(lsym)) { z = CAR(lsym); z = CAR(z); tmp = UCHARS(z); if (LENGTH(z) != len) goto trynext; - for(i = len;i--;) if (((unsigned char *)name)[i] != tmp[i]) goto trynext; + for (i = len;i--;) if (((unsigned char *)name)[i] != tmp[i]) goto trynext; lsym = CAR(lsym); if (!UNBNDP(val)) CDR(lsym) = val; else if (UNBNDP(CDR(lsym)) && tc7_msymbol==TYP7(CAR(lsym))) @@ -1593,11 +1594,11 @@ void stack_report() { STACKITEM stack; lputs(";; stack: 0x", cur_errp); - intprint((long)CONT(rootcont)->stkbse, -16, cur_errp); + scm_intprint((long)CONT(rootcont)->stkbse, -16, cur_errp); lputs(" - 0x", cur_errp); - intprint((long)&stack, -16, cur_errp); + scm_intprint((long)&stack, -16, cur_errp); lputs("; ", cur_errp); - intprint(stack_size(CONT(rootcont)->stkbse)*sizeof(STACKITEM), 10, cur_errp); + scm_intprint(stack_size(CONT(rootcont)->stkbse)*sizeof(STACKITEM), 10, cur_errp); lputs(" bytes\n", cur_errp); } @@ -1813,13 +1814,13 @@ void heap_report() { long seg_cells = CELL_DN(hplims[i+1]) - CELL_UP(hplims[i]); lputs("\n; 0x", sys_errp); - intprint((long)hplims[i++], -16, sys_errp); + scm_intprint((long)hplims[i++], -16, sys_errp); lputs(" - 0x", sys_errp); - intprint((long)hplims[i++], -16, sys_errp); + scm_intprint((long)hplims[i++], -16, sys_errp); lputs("; ", sys_errp); - intprint(seg_cells, 10, sys_errp); + scm_intprint(seg_cells, 10, sys_errp); lputs(" cells; ", sys_errp); - intprint(seg_cells / (1024 / sizeof(CELLPTR)), 10, sys_errp); + scm_intprint(seg_cells / (1024 / sizeof(CELLPTR)), 10, sys_errp); lputs(".kiB", sys_errp); }} } @@ -1967,9 +1968,9 @@ void scm_free_gra(gra) void gra_report1(gra) scm_gra *gra; { - intprint((long)gra->len, -10, cur_errp); + scm_intprint((long)gra->len, -10, cur_errp); lputs(" (of ", cur_errp); - intprint((long)gra->alloclen, -10, cur_errp); + scm_intprint((long)gra->alloclen, -10, cur_errp); lputs(") ", cur_errp); lputs(gra->what, cur_errp); lputs("; ", cur_errp); @@ -2049,7 +2050,7 @@ SCM scm_open_ports() { SCM p, res = EOL; int k; - for(k = scm_port_table_len - 1; k > 0; k--) { + for (k = scm_port_table_len - 1; k > 0; k--) { p = scm_port_table[k].port; if (NIMP(p) && OPPORTP(p)) res = cons(p, res); @@ -2462,7 +2463,7 @@ void free_storage() gc_end(); ALLOW_INTS; /* A really bad idea, but printing does it anyway. */ exit_report(); - lflush(sys_errp); + lfflush(sys_errp); scm_free_gra(&ptobs_gra); lmallocated = mallocated = 0; /* Can't do gc_end() here because it uses ptobs which have been freed */ @@ -2655,7 +2656,7 @@ static void gc_sweep(contin_bad) while (i < hplim_ind) { ptr = CELL_UP(hplims[i++]); seg_cells = CELL_DN(hplims[i++]) - ptr; - for(j = seg_cells; j--; ++ptr) { + for (j = seg_cells; j--; ++ptr) { #ifdef POINTERS_MUNGED scmptr = PTR2SCM(ptr); #endif @@ -2814,7 +2815,7 @@ static void gc_sweep(contin_bad) /* must_free((char *)hplims[i-2], sizeof(cell) * (hplims[i-1] - hplims[i-2])); */ hplims[i-2] = 0; - for(j = i;j < hplim_ind;j++) hplims[j-2] = hplims[j]; + for (j = i;j < hplim_ind;j++) hplims[j-2] = hplims[j]; hplim_ind -= 2; i -= 2; /* need to scan segment just moved. */ nfreelist = freelist; @@ -2976,7 +2977,7 @@ static void sweep_port_table() { int k; /* tmp_errp gets entry 0, so we never clear its flags. */ - for(k = scm_port_table_len - 1; k > 0; k--) { + for (k = scm_port_table_len - 1; k > 0; k--) { if (scm_port_table[k].flags & 1) scm_port_table[k].flags &= (~1L); else { @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1338,12 +1338,12 @@ SCM lcount(item, seq) w <<= LONG_BIT-1-(ubnd%LONG_BIT); w >>= LONG_BIT-1-(ubnd%LONG_BIT); /* There may be only a partial word. */ while (imin < i--) { - for(;w;w >>= 4) cnt += cnt_tab[w & 0x0f]; + for (;w;w >>= 4) cnt += cnt_tab[w & 0x0f]; w = VELTS(seq)[i]; if (FALSEP(item)) w = ~w; } w >>= (lbnd%LONG_BIT); - for(;w;w >>= 4) cnt += cnt_tab[w & 0x0f]; + for (;w;w >>= 4) cnt += cnt_tab[w & 0x0f]; return MAKINUM(cnt); case tc7_smob: ASRTGO(ARRAYP(seq) && 1==ARRAY_NDIM(seq) && 0==enclosed++, badarg2); @@ -1526,7 +1526,7 @@ SCM bit_count(v, kv, obj) k = VELTS(kv)[i] & (obj ? VELTS(v)[i] : ~VELTS(v)[i]); k <<= LONG_BIT-1-((LENGTH(v)-1)%LONG_BIT); while (!0) { - for(;k;k >>= 4) count += cnt_tab[k & 0x0f]; + for (;k;k >>= 4) count += cnt_tab[k & 0x0f]; if (0==i--) return MAKINUM(count); k = VELTS(kv)[i] & (obj ? VELTS(v)[i] : ~VELTS(v)[i]); } @@ -1825,11 +1825,11 @@ static void rapr1(ra, j, k, port, writing) case tc7_smob: if (enclosed++) { ARRAY_BASE(ra) = j; - if (n-- > 0) iprin1(ra, port, writing); + if (n-- > 0) scm_iprin1(ra, port, writing); for (j += inc; n-- > 0; j += inc) { lputc(' ', port); ARRAY_BASE(ra) = j; - iprin1(ra, port, writing); + scm_iprin1(ra, port, writing); } break; } @@ -1858,18 +1858,18 @@ static void rapr1(ra, j, k, port, writing) ra = ARRAY_V(ra); goto tail; default: - if (n-- > 0) iprin1(cvref(ra, j, UNDEFINED), port, writing); + if (n-- > 0) scm_iprin1(cvref(ra, j, UNDEFINED), port, writing); for (j += inc; n-- > 0; j += inc) { lputc(' ', port); - iprin1(cvref(ra, j, UNDEFINED), port, writing); + scm_iprin1(cvref(ra, j, UNDEFINED), port, writing); } break; case tc7_string: - if (n-- > 0) iprin1(MAKICHR(CHARS(ra)[j]), port, writing); + if (n-- > 0) scm_iprin1(MAKICHR(CHARS(ra)[j]), port, writing); if (writing) for (j += inc; n-- > 0; j += inc) { lputc(' ', port); - iprin1(MAKICHR(CHARS(ra)[j]), port, writing); + scm_iprin1(MAKICHR(CHARS(ra)[j]), port, writing); } else for (j += inc; n-- > 0; j += inc) @@ -1877,20 +1877,20 @@ static void rapr1(ra, j, k, port, writing) break; case tc7_VfixN32: if (errjmp_bad) { - ipruk("VfixN32", ra, port); + scm_ipruk("VfixN32", ra, port); break; } - if (n-- > 0) intprint(VELTS(ra)[j], -10, port); + if (n-- > 0) scm_intprint(VELTS(ra)[j], -10, port); for (j += inc; n-- > 0; j += inc) { lputc(' ', port); - intprint(VELTS(ra)[j], -10, port); + scm_intprint(VELTS(ra)[j], -10, port); } break; case tc7_VfixZ32: - if (n-- > 0) intprint(VELTS(ra)[j], 10, port); + if (n-- > 0) scm_intprint(VELTS(ra)[j], 10, port); for (j += inc; n-- > 0; j += inc) { lputc(' ', port); - intprint(VELTS(ra)[j], 10, port); + scm_intprint(VELTS(ra)[j], 10, port); } break; # ifdef FLOATS @@ -1932,7 +1932,7 @@ int raprin1(exp, port, writing) return 1; } else { - intprint(ndim, 10, port); + scm_intprint(ndim, 10, port); goto tail; } } @@ -1940,9 +1940,9 @@ int raprin1(exp, port, writing) if (exp==v) { /* a uve, not an array */ register long i, j, w; lputc('*', port); - for(i = 0;i<(LENGTH(exp))/LONG_BIT;i++) { + for (i = 0;i<(LENGTH(exp))/LONG_BIT;i++) { w = VELTS(exp)[i]; - for(j = LONG_BIT;j;j--) { + for (j = LONG_BIT;j;j--) { lputc(w&1?'1':'0', port); w >>= 1; } @@ -1950,7 +1950,7 @@ int raprin1(exp, port, writing) j = LENGTH(exp)%LONG_BIT; if (j) { w = VELTS(exp)[LENGTH(exp)/LONG_BIT]; - for(;j;j--) { + for (;j;j--) { lputc(w&1?'1':'0', port); w >>= 1; } @@ -1992,7 +1992,7 @@ int raprin1(exp, port, writing) } if ((v != exp) && 0==ARRAY_NDIM(exp)) { lputc(' ', port); - iprin1(aref(exp, EOL), port, writing); + scm_iprin1(aref(exp, EOL), port, writing); } else { lputc('(', port); diff --git a/version.txi b/version.txi index 4f3847d..16a9b55 100644 --- a/version.txi +++ b/version.txi @@ -1,2 +1,2 @@ -@set SCMVERSION 5e3 -@set SCMDATE October 2006 +@set SCMVERSION 5e4 +@set SCMDATE November 2007 @@ -2317,7 +2317,7 @@ static int print_xwindow(exp, f, writing) { lputs(CLOSEDP(exp) ? "#<closed-X " : "#<X ", f); lputs((CAR(exp) & PXMP) ? "pixmap #x" : "window #x", f); - intprint((long) XWINDOW(exp), 16, f); + scm_intprint((long) XWINDOW(exp), 16, f); lputc('>', f); return 1; } @@ -2327,7 +2327,7 @@ static int print_xcursor(exp, f, writing) int writing; { lputs("#<X cursor #x", f); - intprint((long) XCURSOR(exp), 16, f); + scm_intprint((long) XCURSOR(exp), 16, f); lputc('>', f); return 1; } @@ -2347,7 +2347,7 @@ static int print_xcolormap(exp, f, writing) int writing; { lputs("#<X colormap ID #x", f); - intprint((long) XCOLORMAP(exp), 16, f); + scm_intprint((long) XCOLORMAP(exp), 16, f); lputc('>', f); return 1; } @@ -2357,8 +2357,8 @@ static int print_xgcontext(exp, f, writing) int writing; { lputs("#<X graphics context, ID #x", f); - /* intprint((long) GCONTEXT(exp)->gid, 16, f); skimu */ - intprint((long) XGContextFromGC(XGCONTEXT(exp)), 16, f); + /* scm_intprint((long) GCONTEXT(exp)->gid, 16, f); skimu */ + scm_intprint((long) XGContextFromGC(XGCONTEXT(exp)), 16, f); lputc('>', f); return 1; } @@ -2384,13 +2384,13 @@ static int print_xvisual(exp, f, writing) { XVisualInfo *xvi = XVISUALINFO(exp); lputs("#<X visual #x", f); - intprint((long) xvi->visualid, 16, f); + scm_intprint((long) xvi->visualid, 16, f); lputs(" ", f); lputs(xvisualclass2name(xvi->class), f); lputc(' ', f); - intprint((long) xvi->depth, 10, f); + scm_intprint((long) xvi->depth, 10, f); lputc('x', f); - intprint((long) xvi->colormap_size, 10, f); + scm_intprint((long) xvi->colormap_size, 10, f); lputc('>', f); return 1; } |