diff options
author | Thomas Bushnell <tb@debian.org> | 2006-10-23 23:31:59 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:35 -0800 |
commit | 906cc4f0899080f1b832af98b7ccbcc257b8a64e (patch) | |
tree | 14e3ec231debdca4da9c1a3ccc0536033c1c8a4b | |
parent | 3d573fa54db0fdcae8b2a20356faa46c8e335206 (diff) | |
parent | 50eb784bfcf15ee3c6b0b53d747db92673395040 (diff) | |
download | scm-debian/5e3-1.tar.gz scm-debian/5e3-1.zip |
Import Debian changes 5e3-1debian/5e3-1
scm (5e3-1) unstable; urgency=low
* New upstream release.
* debian/control (Architecture): Add ia64 to list of supported archs. Now
everything but s390 is listed. (Closes: #335980)
(Build-Depends): Require at least version 3a4 of slib.
* Change to continue.h from version 5e1-2 repeated here.
* Change to xgen.scm from version 5e2-4 repeated here.
* Change to scm.1 from version 5e2-4 repeated here.
-rw-r--r-- | ANNOUNCE | 237 | ||||
-rw-r--r-- | ChangeLog | 274 | ||||
-rw-r--r-- | Init5e3.scm (renamed from Init5e2.scm) | 148 | ||||
-rw-r--r-- | Makefile | 143 | ||||
-rw-r--r-- | README | 27 | ||||
-rw-r--r-- | Transcen.scm | 170 | ||||
-rw-r--r-- | Xlibscm.html | 3326 | ||||
-rw-r--r-- | Xlibscm.info | 136 | ||||
-rw-r--r-- | Xlibscm.texi | 126 | ||||
-rw-r--r-- | bench.scm | 2 | ||||
-rw-r--r-- | build.scm | 43 | ||||
-rw-r--r-- | byte.c | 23 | ||||
-rw-r--r-- | continue-ia64.S | 365 | ||||
-rw-r--r-- | continue.c | 44 | ||||
-rw-r--r-- | continue.h | 131 | ||||
-rw-r--r-- | debian/changelog | 15 | ||||
-rw-r--r-- | debian/control | 4 | ||||
-rw-r--r-- | disarm.scm | 2 | ||||
-rw-r--r-- | eval.c | 191 | ||||
-rw-r--r-- | features.txi | 18 | ||||
-rw-r--r-- | get-contoffset-ia64.c | 107 | ||||
-rw-r--r-- | hobbit.info | 157 | ||||
-rw-r--r-- | hobbit.scm | 30 | ||||
-rw-r--r-- | hobbit.texi | 93 | ||||
-rw-r--r-- | indexes.texi | 50 | ||||
-rw-r--r-- | mkimpcat.scm | 36 | ||||
-rw-r--r-- | patchlvl.h | 4 | ||||
-rw-r--r-- | platform.txi | 1 | ||||
-rw-r--r-- | posix.c | 2 | ||||
-rw-r--r-- | r4rstest.scm | 124 | ||||
-rw-r--r-- | ramap.c | 300 | ||||
-rw-r--r-- | repl.c | 24 | ||||
-rw-r--r-- | rope.c | 48 | ||||
-rw-r--r-- | scl.c | 115 | ||||
-rw-r--r-- | scm.1 | 12 | ||||
-rw-r--r-- | scm.c | 2 | ||||
-rw-r--r-- | scm.doc | 15 | ||||
-rw-r--r-- | scm.h | 43 | ||||
-rw-r--r-- | scm.info | 865 | ||||
-rw-r--r-- | scm.spec | 8 | ||||
-rw-r--r-- | scm.texi | 354 | ||||
-rw-r--r-- | scmfig.h | 19 | ||||
-rw-r--r-- | setjump.mar | 13 | ||||
-rw-r--r-- | subr.c | 5 | ||||
-rw-r--r-- | sys.c | 91 | ||||
-rw-r--r-- | time.c | 47 | ||||
-rw-r--r-- | ugsetjump.s | 35 | ||||
-rw-r--r-- | unif.c | 424 | ||||
-rw-r--r-- | version.txi | 4 | ||||
-rw-r--r-- | x.c | 8 |
50 files changed, 3344 insertions, 5117 deletions
@@ -1,4 +1,4 @@ -This message announces the availability of Scheme release scm5e2. +This message announces the availability of Scheme release scm5e3. SCM conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification. SCM is written in C and runs under @@ -18,119 +18,132 @@ Links to distributions of SCM and related softwares are at the end of this message. -=-=- -scm5e2 news: - -Hinting GCC branch-predictions nets 10% speed improvement for SCM -running the JACAL symbolic mathematics system. - - * scmfig.h (SCM_EXPECT_TRUE, SCM_EXPECT_FALSE): Added. - (POSFIXABLE, NEGFIXABLE, UNEGFIXABLE): SCM_EXPECT_TRUE. - * scmfig.h (__builtin_expect): Added stub for non-gcc compilers. - - * scm.h: SCM_EXPECT_TRUE and SCM_EXPECT_FALSE replace - __builtin_expect(). - (ASRTER, ASRTGO): SCM_EXPECT_FALSE. - * scm.h (INUMP, IMP, SINGP): Added __builtin_expect() netting more - than 9% speed improvement in JACAL. - - * Makefile (scm5.opt, udscm4.opt): Commented out - -fno-guess-branch-probability flag. - * Makefile (udscm4.opt, scm5.opt): Condition - -fno-guess-branch-probability on `type gcc'. - * Makefile (scm5.opt, udscm4.opt): -fno-guess-branch-probability - improves benchmark speed 10% on i686. - (hfiles): Moved to top of file so that dependencies work. - - * byte.c, continue.c, crs.c, dynl.c, eval.c, gsubr.c, ioext.c, - posix.c, ramap.c, record.c, repl.c, rope.c, sc2.c, scl.c, scm.c, - scm.h, socket.c, subr.c, sys.c, time.c, unif.c, unix.c, x.c: - Regularized `if' syntax. - - * scm.c (l_pause): __CYGWIN__ now has pause(). - * scmfig.h (LACK_FTIME): __CYGWIN__ now has ftime(). - * socket.c (l_lna, l_hostinfo, l_netinfo, l_setnet): Made - conditional on __CYGWIN__. - * ioext.c: __CYGWIN__ has <unistd.h>. - - * scl.c (lasinh, lacosh, latanh): Replaced by libc functions. - * scl.c (sum, difference, divide): Added BIGDIG* cast to &z. - * scl.c (numident): Don't bomb given bignums. - * scl.c (makdbl): (+ -1/0 +5i) ==> -1/0; not 0/0. - * scl.c (apx_log10): Removed unused variable. - * scl.c (scm_magnitude): Renamed from magnitude(). - (scm_abs): Added, real-only. - * scl.c (safe_add_1): Replaces add1. - (scm_truncate): Renamed from ltrunc. - * scm.h (scm_truncate): Renamed from ltrunc. - (scm_floor, scm_ceiling): Added. - * subr.c (absval): Moved to scl.c. - * rope.c (num2dbl): Handle 0/0. - * scl.c (inf2str): Changed to "+inf.0" and "-inf.0". - (istr2flo): Parse "+inf.0", "-inf.0", and - COMPACT_INFINITY_NOTATION. - (istr2flo, inf2str): COMPACT_INFINITY_NOTATION flag enables +/0 - and -/0 infinity notations. - - * Transcen.scm (quo, rem, mod): New names for inexact quotient, - remainder, and modulo. - * Init5e1.scm (abs): Is no longer synonym for magnitude. - * Transcen.scm (exact-round, exact-floor, exact-ceiling) - (exact-truncate): Added SRFI-70 convenience functions. - (limit): Removed. - * Transcen.scm (sequence->limit): Removed use of 1/0 literal. - * Transcen.scm (expt): 0^0 ==> 1. - * scl.c (scm_intexpt): 0^0 ==> 1. - * Transcen.scm, Init5e1.scm (infinite?, finite?): Added. - * scl.c (makdbl, init_scl): Don't bother with scm_narn for MSC. - (scm_finitep): Removed to Transcen.scm and Init5e1.scm. - * scm.h (scm_narn): Renamed from infi. - - * r4rstest.scm (SECTION 6 5 5): Restored 0^0 test. - - * hobbit.scm (*c-keywords*): absval --> scm_abs; magnitude --> - scm_magnitude. - - * rope.c, scm.c, scm.texi, scmmain.c, script.c, socket.c: Added - const to argv. - * scmmain.c, scm.h, scm.c, rope.c, repl.c: Added const decls. - - * build.scm (build:command): Comment to script: [-p <platform>]. - * Makefile (turfiles): Added turtle-graphics files. - * Makefile (DOSCM): Abstracted DOS zip creation. - - * unexelf.c: Imported from emacs-22.0.50 to fix FC4 build. - - * differ.c (diff_mid_split): Unused `m' argument removed. - - * scm.spec (slibpath, dumparch): Added. - -From: Steve VanDevender - * scmfig.h (SHORT_INT, CDR_DOUBLES): For __x86_64 (AMD Opteron). - -From: Thomas Bushnell - * scm.doc, scm.1: Corrected spelling errors. +scm5e3 news: + +Richard Harke ported SCM to the Linux-ia64. + +SRFI-94 Type-Restricted Numerical Functions. + +SRFI-63 uniform array type support expanded to: + + 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 + +Radey Shouman has changed LETREC to behave like LETREC*: + + * 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); -=-=- SCM source is available from: - http://swissnet.ai.mit.edu/ftpdir/scm/scm5e2.zip - swissnet.ai.mit.edu:/pub/scm/scm5e2.zip - http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e2-1.src.rpm - swissnet.ai.mit.edu:/pub/scm/scm-5e2-1.src.rpm + 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 Also available as i386 binary RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e2-1.i386.rpm - swissnet.ai.mit.edu:/pub/scm/scm-5e2-1.i386.rpm + http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e3-1.i386.rpm + swissnet.ai.mit.edu:/pub/scm/scm-5e3-1.i386.rpm SLIB is a portable Scheme library which SCM uses: - http://swissnet.ai.mit.edu/ftpdir/scm/slib3a3.zip - swissnet.ai.mit.edu:/pub/scm/slib3a3.zip + http://swissnet.ai.mit.edu/ftpdir/scm/slib3a4.zip + swissnet.ai.mit.edu:/pub/scm/slib3a4.zip Also available as RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/slib-3a3-1.noarch.rpm - swissnet.ai.mit.edu:/pub/scm/slib-3a3-1.noarch.rpm + http://swissnet.ai.mit.edu/ftpdir/scm/slib-3a4-1.noarch.rpm + swissnet.ai.mit.edu:/pub/scm/slib-3a4-1.noarch.rpm JACAL is a symbolic math system written in Scheme: - http://swissnet.ai.mit.edu/ftpdir/scm/jacal1b6.zip - swissnet.ai.mit.edu:/pub/scm/jacal1b6.zip + http://swissnet.ai.mit.edu/ftpdir/scm/jacal1b7.zip + swissnet.ai.mit.edu:/pub/scm/jacal1b7.zip SLIB-PSD is a portable debugger for Scheme (requires emacs editor): http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz @@ -158,13 +171,13 @@ SCM (similar to XSCM). 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/wb1c2.zip - swissnet.ai.mit.edu:/pub/scm/wb1c2.zip - http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c2-1.src.rpm - swissnet.ai.mit.edu:/pub/scm/wb-1c2-1.src.rpm + 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 Also available as i386 binary RPM: - http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c2-1.i386.rpm - swissnet.ai.mit.edu:/pub/scm/wb-1c2-1.i386.rpm + http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c3-1.i386.rpm + swissnet.ai.mit.edu:/pub/scm/wb-1c3-1.i386.rpm SIMSYNCH is a digital logic simulation system written in SCM. http://swissnet.ai.mit.edu/ftpdir/scm/synch1b0.zip @@ -177,7 +190,7 @@ 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 slib3a3 and scm5e2 above. +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 @@ -189,4 +202,4 @@ Note: SCM.EXE still requires slib3a3 and scm5e2 above. Programs for printing and viewing TexInfo documentation (which SCM has) come with GNU Emacs or can be obtained via ftp from: - ftp.gnu.org:pub/gnu/texinfo/texinfo-4.0.tar.gz + ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.8.tar.gz @@ -1,3 +1,277 @@ +2006-10-21 Aubrey Jaffer <jaffer@aubrey.jaffer> + + * patchlvl.h (SCMVERSION): Bumped from 5e2 to 5e3. + +2006-10-20 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi (Testing): Fixed typo in CHEAP_CONTINUATIONS. + + * Transcen.scm (real-functions): Define real-* in terms of $* for + legacy executables. + + * Makefile (checklit): No longer does test-cont. + (scmflags.h): Fixed crucial typo in CHEAP_CONTINUATIONS. + +2006-10-20 Richard Harke + + * continue-ia64.S: Update. + + * build.scm (link-c-program linux-ia64): Added. "continue-ia64.o". + +2006-10-03 Radey Shouman <shouman@comcast.net> + + * 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. + +2006-09-26 Aubrey Jaffer <agj@alum.mit.edu> + + * byte.c (subbytes): Added. + +2006-09-21 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi (Index): Replaced nodes under Indexes with node Index + when in info mode; fixes indexing in Emacs 21.4.1. + + * 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. + +2006-09-19 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.h (BYTESP): Added. + + * byte.c (scm_subbytes_read, scm_subbytes_write): Renamed from + substring. + +2006-09-18 Aubrey Jaffer <agj@alum.mit.edu> + + * Init5e2.scm (integer-log): Added from SRFI-94. + +2006-08-28 Aubrey Jaffer <agj@alum.mit.edu> + + * continue.h (FLUSH_REGISTER_WINDOWS): Undid __ia64__ hack. + + * sys.c (igc): Call mark_regs_ia64() for __ia64__. + + * scl.c: real-atan replaces $atan. + + * Transcen.scm (atan): real-atan replaces $atan. + +2006-08-27 Aubrey Jaffer <agj@alum.mit.edu> + + * Transcen.scm: Aliases defined for `$' prefixes replaced by + `real-'. + + * scm.texi (Numeric, Subr Cells): Most Scheme name `$' prefixes + changed to `real-'. + + * hobbit.texi (Hobbit Options, SCM Primitive Procedures): Added + `real-' prefixed names. + + * hobbit.scm (*float-recognize-ops*, *standard-s->c-fun-table*): + Added `real-' prefixed names. + + * scl.c (cxrs): Most Scheme name `$' prefixes changed to `real-'. + + * eval.c (scm_apply_cxr): Pulled common code out of ceval_1, + apply, and scm_cvapply which applies tc7_cxr. Now signals error + if function returns 0/0. + + * Init5e2.scm (integer-sqrt): Added. + +2006-08-23 Aubrey Jaffer <agj@alum.mit.edu> + + * continue.h, continue.c: Added conditionals for ia64 port. + + * sys.c (igc): Changed second argument to type SCM so it works + with Richard Harke's Linux-ia64 port. + + * get-contoffset-ia64.c (main): Don't try to wrap jmpbuf. + + * Transcen.scm (ln): Added synonym for log. + (quo, rem, mod): Simplified. + +2006-08-16 Aubrey Jaffer <agj@alum.mit.edu> + + * unif.c, sys.c, scl.c, rope.c, repl.c: Added support for + tc7_VfixN8 and tc7_VfixZ8. + + * scm.h, scm.texi (Data Type Representations): Reassigned. + (tc7_VfixN8, tc7_VfixZ8): Added byte arrays. + + * unif.c (aset): VfixN16 use num2ushort. + + * ramap.c (array_copy): Corrected cast. + + * scm.texi (Data Type Representations): Corrected pattern for + specfun and cclo. + + * unif.c, sys.c, scl.c, rope.c, repl.c: Added support for + tc7_VfixN16. + + * scm.h, scm.texi (tc7_VfixN16): Added; reordered tc7 assignments. + +2006-08-15 Aubrey Jaffer <agj@alum.mit.edu> + + * ramap.c, repl.c, rope.c, scl.c, sys.c, unif.c: Added support for + tc7_VfloC32. + + * scm.h, scm.texi (tc7_VfloC32): Added; reordered tc7 assignments. + + * scm.texi (Header Cells, Data Type Representations): Renamed + uniform vector types similarly to SRFI-63. + + * scm.h (tc7_Vbool, tc7_VfixZ16, tc7_VfixN32, tc7_VfixZ32) + (tc7_VfloR32, tc7_VfloR64, tc7_VfloC64): Renamed uniform vector + types similarly to SRFI-63. + + * Makefile (dscm4, dscm5): != is string operator in shell. + "mv -f" for previous scm, slibcat, and implcat. + +2006-08-11 Aubrey Jaffer <agj@alum.mit.edu> + + * Init5e2.scm (provide, slib:load-compiled): Modified to ease + transition from *FEATURES* to SLIB:FEATURES. + + * Makefile (dscm4, dscm5): Added randomize_va_space machinations. + +2006-08-10 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi (Saving Images): Explains recent Linux machinations. + + * Makefile (dvi, pdf): New tetex-3.0(-20.FC5) broke them -- fixed. + +2006-08-09 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (SETARCH): Workarounds allow dumping in recent Linux. + + * time.c (linux): defined CLKTCK to (sysconf(_SC_CLK_TCK)). + +2006-07-20 Aubrey Jaffer <agj@alum.mit.edu> + + * eval.c (m_body): Removed gratuitous CAUTIOUS conditional. + + * build.scm (manifest): Corrected "get-contoffset-ia64.c". + +2006-06-26 Aubrey Jaffer <agj@alum.mit.edu> + + * build.scm (link-c-program linux-ia64): Create include file and + assemble "continue-ia64.S". + + * get-contoffset-ia64.c: Small program to write ia64 assembly + include file "contoffset-ia64.S" with C offsets from Richard + Harke. Modified to take output filename as argument. + +2006-06-03 Aubrey Jaffer <agj@alum.mit.edu> + + * scm.texi (Debugging Scheme Code): Updated about stack checking. + + * build.scm (stack-limit): Removed feature. + + * scmfig.h (STACK_LIMIT): Always defined. + (CHECK_STACK): Condition on scm_verbose. + + * sys.c (stack_check): Always present. + +2006-06-02 Aubrey Jaffer <agj@alum.mit.edu> + + * continue.h (FLUSH_REGISTER_WINDOWS): Use to mark multiple stacks + on __ia64__. + + * Makefile (sfiles): Added getoffs.c. + (scmflags): CHEAP_CONTIUATIONS for scmlit. + + * build.scm (stack-limit): HEAP_SEG_SIZE/2 was too small on FC2; + now HEAP_SEG_SIZE. + +2006-05-21 Aubrey Jaffer <agj@alum.mit.edu> + + * sys.c (igc): Moved FLUSH_REGISTER_WINDOWS to after setjump(). + + * repl.c (scm_read_numbered): Don't #ifndef MEMOIZED_LOCALS. + + * build.scm (dont-memoize-locals): Added feature. + +2006-05-14 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (docs): Added target to make all documentation files; + then invoke xdvi. + + * scm.texi: Converted to use @copying. + (Indexes): Reorganized. + +2006-05-13 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (5 2 1): Expose Bigloo tprint redefinition bug. + +2006-05-07 Richard Harke + + * continue-ia64.S: Added. + + * continue.c (make_root_continuation, make_continuation) + (dynthrow): #ifndef __ia64__. + +2006-05-07 Aubrey Jaffer <agj@alum.mit.edu> + + * ugsetjmp.s (_setjump, _longjump): For Ultrix VAX circa 1997. + + * Makefile (sfiles): Renamed from vfiles; added continue-ia64.S + and ugsetjump.s. + + * subr.c (mkbig, adjbig): Improved overflow message. + +2006-04-24 Radey Shouman <shouman@comcast.net> + + * 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. + +2006-04-19 Aubrey Jaffer <agj@alum.mit.edu> + + * Init5e2.scm (boot-tail): Don't load ScmInit.scm if *script*. + +2006-03-24 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (test-bignum): Convert test bignums from strings. + + * Init5e2.scm (string-index, read-line): Defined for + login->home-directory, which may be called before require defined. + + * mkimpcat.scm (wbtab, rwb-isam): moved to "Simple associations". + (add-source): Use 'source form and check file's existence. + +2006-03-23 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (have-bignums?): Check bignum arithmetic works. + (test-inexact): Do complex tests only if non-real numbers are + supported. + +2006-03-18 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (test-inexact): Added equal? tests. + +2006-03-17 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (test-inexact): Test for -0.0 lossage. + +2006-03-14 Aubrey Jaffer <agj@alum.mit.edu> + + * r4rstest.scm (test-inexact): Check that / and magnitude work for + very large and very small complex numbers (1e300; 1e-300); + +2006-03-13 Aubrey Jaffer <agj@alum.mit.edu> + + * scl.c (scm_magnitude): Extend dynamic range by eliminating + intermediate expression swell. + +2006-03-12 Aubrey Jaffer <agj@alum.mit.edu> + + * scl.c (divide): Use "Smith's formula" to extend dynamic range; + but makes an insignificant difference when compiled with -O3. + 2006-02-19 Aubrey Jaffer <agj@alum.mit.edu> * scl.c (atanh, acosh, asinh): define if #ifndef HAVE_ATANH. diff --git a/Init5e2.scm b/Init5e3.scm index 447e721..305cea0 100644 --- a/Init5e2.scm +++ b/Init5e3.scm @@ -1,4 +1,4 @@ -;; Copyright (C) 1991-2005 Free Software Foundation, Inc. +;; Copyright (C) 1991-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 @@ -42,7 +42,7 @@ ;;; Author: Aubrey Jaffer. (define (scheme-implementation-type) 'SCM) -(define (scheme-implementation-version) "5e2") +(define (scheme-implementation-version) "5e3") (define (scheme-implementation-home-page) "http://swiss.csail.mit.edu/~jaffer/SCM") @@ -113,15 +113,16 @@ thunk (lambda () (exchange old))))))) -(set! *features* +(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 + vicinity srfi-59 srfi-23 srfi-94 srfi-60) ;logical - *features*)) + (if (defined? *features*) *features* slib:features))) +(if (defined? *features*) (set! *features* slib:features)) (define eval (let ((@eval @eval) @@ -531,7 +532,7 @@ (perror "WARN") (errno 0) (display "WARN:" cep) - (for-each (lambda (x) (display #\ cep) (write x cep)) args) + (for-each (lambda (x) (display #\space cep) (write x cep)) args) (newline cep) (force-output cep)) @@ -541,7 +542,7 @@ (perror "ERROR") (errno 0) (display "ERROR:" cep) - (for-each (lambda (x) (display #\ cep) (write x cep)) args) + (for-each (lambda (x) (display #\space cep) (write x cep)) args) (newline cep) (force-output cep) (abort)) @@ -552,7 +553,7 @@ (define (print . args) (define result #f) - (for-each (lambda (x) (set! result x) (write x) (display #\ )) args) + (for-each (lambda (x) (set! result x) (write x) (display #\space)) args) (newline) result) (define (pprint . args) @@ -612,7 +613,7 @@ (define cep (current-error-port)) (cond ((> (verbose) 1) (display - (string-append ";" (make-string load:indent #\ ) "loading " file) + (string-append ";" (make-string load:indent #\space) "loading " file) cep) (set! load:indent (modulo (+ 2 load:indent) 16)) (newline cep))) @@ -623,7 +624,7 @@ (errno 0) (cond ((> (verbose) 1) (set! load:indent (modulo (+ -2 load:indent) 16)) - (display (string-append ";" (make-string load:indent #\ ) + (display (string-append ";" (make-string load:indent #\space) "done loading " filesuf) cep) (newline cep) @@ -692,6 +693,28 @@ ;;; customize a computer environment for a user. (define home-vicinity #f) +(if (not (defined? getpw)) + (define read-line + (if (defined? read-line) + read-line + (lambda port + (let* ((chr (apply read-char port))) + (if (eof-object? chr) + chr + (do ((chr chr (apply read-char port)) + (clist '() (cons chr clist))) + ((or (eof-object? chr) (char=? #\newline chr)) + (list->string (reverse clist)))))))))) +(if (not (defined? getpw)) + (define string-index + (if (defined? string-index) + string-index + (lambda (str chr) + (define len (string-length str)) + (do ((pos 0 (+ 1 pos))) + ((or (>= pos len) (char=? chr (string-ref str pos))) + (and (< pos len) pos))))))) + (define (login->home-directory login) (cond ((defined? getpw) (let ((pwvect (getpw login))) @@ -700,8 +723,6 @@ (else (call-with-input-file "/etc/passwd" (lambda (iprt) - (require 'string-search) - (require 'line-i/o) (let tryline () (define line (read-line iprt)) (define (get-field) @@ -780,12 +801,19 @@ (defined? vms:dynamic-link-call)) (load (in-vicinity (implementation-vicinity) "Link")))) +;;; Redefine to ease transition from *features* to slib:features. +(define (provide feature) + (cond ((not (memq feature slib:features)) + (set! slib:features (cons feature slib:features)) + (if (defined? *features*) (set! *features* slib:features))))) + (cond ((defined? link:link) (define (slib:load-compiled . args) (cond ((symbol? (car args)) (require (car args)) (apply slib:load-compiled (cdr args))) - ((apply link:link args)) + ((apply link:link args) + (if (defined? *features*) (set! slib:features *features*))) (else (error "Couldn't link files " args)))) (provide 'compiled))) @@ -1075,7 +1103,7 @@ (define (scm:print-binding sexp frame) (cond ((not (null? (cdr sexp))) (display "In") - (for-each (lambda (exp) (display #\ ) (display exp)) (cdr sexp)) + (for-each (lambda (exp) (display #\space) (display exp)) (cdr sexp)) (display ": "))) (do ((vars (car frame) (cdr vars)) (vals (cdr frame) (cdr vals))) @@ -1122,7 +1150,7 @@ (display "ERROR: " cep) (if (not (null? args)) (begin (display (car args) cep) - (for-each (lambda (x) (display #\ cep) (write x cep)) + (for-each (lambda (x) (display #\space cep) (write x cep)) (cdr args)))) (newline cep) (cond ((stack-trace) (newline cep))) @@ -1172,6 +1200,50 @@ (do ((num q (* 2 num)) (den (- q q -1) (* 2 den))) ((integer? num) den))) +;@ +(define (integer-log base k) + (define (ilog m b k) + (cond ((< k b) k) + (else + (set! n (+ n m)) + (let ((q (ilog (+ m m) (* b b) (quotient k b)))) + (cond ((< q b) q) + (else (set! n (+ m n)) + (quotient q b))))))) + (define n 1) + (define (eigt? k j) (and (exact? k) (integer? k) (> k j))) + (cond ((not (and (eigt? base 1) (eigt? k 0))) + (slib:error 'integer-log base k)) + ((< k base) 0) + (else (ilog 1 base (quotient k base)) n))) + +;;;; http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/isqrt/isqrt.txt +;;; Akira Kurihara +;;; School of Mathematics +;;; Japan Women's University +;@ +(define integer-sqrt + (let ((table '#(0 + 1 1 1 + 2 2 2 2 2 + 3 3 3 3 3 3 3 + 4 4 4 4 4 4 4 4 4)) + (square (lambda (x) (* x x)))) + (lambda (n) + (define (isqrt n) + (if (> n 24) + (let* ((len/4 (quotient (- (integer-length n) 1) 4)) + (top (isqrt (ash n (* -2 len/4)))) + (init (ash top len/4)) + (q (quotient n init)) + (iter (quotient (+ init q) 2))) + (cond ((odd? q) iter) + ((< (remainder n init) (square (- iter init))) (- iter 1)) + (else iter))) + (vector-ref table n))) + (if (and (exact? n) (integer? n) (not (negative? n))) + (isqrt n) + (type-error 'integer-sqrt n))))) (if (defined? array?) (begin @@ -1240,28 +1312,28 @@ ;;; New SRFI-58 names ;; flonums -(define A:floC128b ac64) -(define A:floC64b ac64) -(define A:floC32b ac32) -(define A:floC16b ac32) -(define A:floR128b ar64) -(define A:floR64b ar64) -(define A:floR32b ar32) -(define A:floR16b ar32) +(define A:floC128b Ac64) +(define A:floC64b Ac64) +(define A:floC32b Ac32) +(define A:floC16b Ac32) +(define A:floR128b Ar64) +(define A:floR64b Ar64) +(define A:floR32b Ar32) +(define A:floR16b Ar32) ;; decimal flonums -(define A:floQ128d ar64) -(define A:floQ64d ar64) -(define A:floQ32d ar32) +(define A:floQ128d Ar64) +(define A:floQ64d Ar64) +(define A:floQ32d Ar32) ;; fixnums -(define A:fixZ64b as64) -(define A:fixZ32b as32) -(define A:fixZ16b as16) -(define A:fixZ8b as8) -(define A:fixN64b au64) -(define A:fixN32b au32) -(define A:fixN16b au16) -(define A:fixN8b au8) -(define A:bool at1) +(define A:fixZ64b As64) +(define A:fixZ32b As32) +(define A:fixZ16b As16) +(define A:fixZ8b As8) +(define A:fixN64b Au64) +(define A:fixN32b Au32) +(define A:fixN16b Au16) +(define A:fixN8b Au8) +(define A:bool At1) (define (array-shape a) (let ((dims (array-dimensions a))) @@ -1297,6 +1369,7 @@ ;;;; Initialize statically linked add-ons (cond ((defined? scm_init_extensions) (scm_init_extensions) + (if (defined? *features*) (set! slib:features *features*)) (set! scm_init_extensions #f))) ;;; Use *argv* instead of (program-arguments), to allow option @@ -1325,7 +1398,8 @@ ;;; This loads the user's initialization file, or files named in ;;; program arguments. - (or (eq? (software-type) 'THINKC) + (or *script* + (eq? (software-type) 'THINKC) (member "-no-init-file" (program-arguments)) (member "--no-init-file" (program-arguments)) (try-load (in-vicinity (or (home-vicinity) (user-vicinity)) @@ -1391,7 +1465,7 @@ (define (usage preopt opt postopt success?) (define cep (if success? (current-output-port) (current-error-port))) - (define indent (make-string 6 #\ )) + (define indent (make-string 6 #\space)) (define i 3) (cond ((char? opt) (set! opt (string opt))) ;;((symbol? opt) (set! opt (symbol->string opt))) @@ -55,9 +55,21 @@ SHOBJS = *.so #BUILD = ./build -hsystem -p svr4-gcc-sun-ld BUILD = ./build -hsystem -# Workaround for unexec on Fedora Linux i386 +# Workaround for unexec on Fedora Core 1 Linux i386 #SETARCH = setarch i386 +# http://jamesthornton.com/writing/emacs-compile.html +# [For FC3] combreloc has become the default for recent GNU ld, which +# breaks the unexec/undump on all versions of both Emacs and +# XEmacs... +# +# Add the following to udscm5.opt: +#--linker-options="-z nocombreloc" + +# http://www.opensubscriber.com/message/emacs-devel@gnu.org/1007118.html +# Kernels later than 2.6.11 must do (as root) before dumping: +#echo 0 > /proc/sys/kernel/randomize_va_space + #for RPMs RELEASE = 1 @@ -95,7 +107,7 @@ cfiles = scmmain.c scm.c time.c repl.c ioext.c scl.c sys.c eval.c \ findexec.c script.c debug.c byte.c differ.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 -# ramap.o +# 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 @@ -120,6 +132,7 @@ scmflags: echo "#ifndef IMPLINIT" > newflags.h echo "#define IMPLINIT \"$(IMPLINIT)\"" >> newflags.h echo "#endif" >> newflags.h + echo "#define CHEAP_CONTINUATIONS" >> newflags.h echo "#define CAUTIOUS" >> newflags.h -if (cmp -s newflags.h scmflags.h) then rm newflags.h; \ else mv newflags.h scmflags.h; fi @@ -138,6 +151,10 @@ time.o: time.c scm.h scmfig.h scmflags.h subr.o: subr.c scm.h scmfig.h scmflags.h rope.o: rope.c scm.h scmfig.h scmflags.h continue.o: continue.c continue.h setjump.h scm.h scmfig.h scmflags.h +continue-ia64.o: continue-ia64.S get-contoffset-ia64.c + gcc -o get-contoffset-ia64 get-contoffset-ia64.c + ./get-contoffset-ia64 contoffset-ia64.S + gcc -c -o continue-ia64.o continue-ia64.S # Simple build with bignums for running JACAL scm: scmlit @@ -165,23 +182,40 @@ udscm4: $(cfiles) $(hfiles) build.scm build udscm4.opt $(BUILD) -f udscm4.opt -o udscm4 -s $(IMPLPATH) rm $(ofiles) scmmain.o dscm4: udscm4 $(ifiles) require.scm - -rm slibcat implcat + if [ -f /proc/sys/kernel/randomize_va_space -a\ + "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\ + cat /proc/sys/kernel/randomize_va_space > randomize_va_space.tmp;\ + echo 0 > /proc/sys/kernel/randomize_va_space;\ + } fi + -rm -f slibcat implcat scm~ -mv scm scm~ echo "(quit)" | $(SETARCH) ./udscm4 -no-init-file -o scm + if [ -f randomize_va_space.tmp ]; then {\ + cat randomize_va_space.tmp > /proc/sys/kernel/randomize_va_space;\ + rm randomize_va_space.tmp;\ + } fi # dumpable R5RS interpreter udscm5.opt: $(MAKE) udscm4.opt cat udscm4.opt >> udscm5.opt echo "-F macro" >> udscm5.opt -# echo "-DNO_SYM_GC" >> udscm5.opt -udscm5: $(cfiles) $(hfiles) build.scm build Makefile udscm5.opt +udscm5: $(cfiles) $(hfiles) build.scm build udscm5.opt $(BUILD) -f udscm5.opt -o udscm5 -s $(IMPLPATH) rm $(ofiles) scmmain.o dscm5: udscm5 $(ifiles) require.scm - -rm slibcat implcat + if [ -f /proc/sys/kernel/randomize_va_space -a\ + "`cat /proc/sys/kernel/randomize_va_space`" != "0" ]; then {\ + cat /proc/sys/kernel/randomize_va_space > randomize_va_space.tmp;\ + echo 0 > /proc/sys/kernel/randomize_va_space;\ + } fi + -rm -f slibcat implcat scm~ -mv scm scm~ echo "(quit)" | $(SETARCH) ./udscm5 -no-init-file -r5 -o scm + if [ -f randomize_va_space.tmp ]; then {\ + cat randomize_va_space.tmp > /proc/sys/kernel/randomize_va_space;\ + rm randomize_va_space.tmp;\ + } fi $(MAKE) check $(MAKE) checkmacro @@ -226,19 +260,19 @@ dlls.opt: echo "--compiler-options=-Wall" >> dlls.opt echo "--linker-options=-Wall" >> dlls.opt mydlls: dlls.opt - if [ -f /usr/lib/libreadline.so ]; \ - then $(BUILD) -t dll -f dlls.opt -F edit-line; fi - $(BUILD) -t dll -f dlls.opt -F curses - $(BUILD) -t dll -f dlls.opt -c sc2.c - $(BUILD) -t dll -f dlls.opt -c rgx.c + $(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 + $(BUILD) -t dll -f dlls.opt -c byte.c + $(BUILD) -t dll -f dlls.opt -c sc2.c $(BUILD) -t dll -f dlls.opt -c ioext.c $(BUILD) -t dll -f dlls.opt -c posix.c - $(BUILD) -t dll -f dlls.opt -c unix.c $(BUILD) -t dll -f dlls.opt -c socket.c - $(BUILD) -t dll -f dlls.opt -c ramap.c - $(BUILD) -t dll -f dlls.opt -c byte.c + $(BUILD) -t dll -f dlls.opt -c unix.c + $(BUILD) -t dll -f dlls.opt -F curses + $(BUILD) -t dll -f dlls.opt -c rgx.c + if [ -f /usr/lib/libreadline.so ]; \ + then $(BUILD) -t dll -f dlls.opt -F edit-line; fi rwb-isam.scm wbtab.scm: ../wb/rwb-isam.scm ../wb/wbtab.scm cp ../wb/rwb-isam.scm ../wb/wbtab.scm ./ @@ -270,7 +304,7 @@ x.h: x.c xevent.h # Check SCM; SCMLIT function. checklit: - $(SCMLIT) -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \ + $(SCMLIT) -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)' \ @@ -320,51 +354,36 @@ implcat: $(SHOBJS) mkimpcat.scm $(SCMLIT) -lmkimpcat.scm htmldir=../public_html/ -dvidir=../dvi/ -dvi: $(dvidir)scm.dvi $(dvidir)Xlibscm.dvi $(dvidir)hobbit.dvi -$(dvidir)scm.dvi: version.txi scm.texi platform.txi features.txi\ - $(dvidir)scm.fn Makefile -# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)scm.texi - -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex scm.??) - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)scm.texi -$(dvidir)scm.fn: - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)scm.texi -$(dvidir)Xlibscm.dvi: version.txi Xlibscm.texi $(dvidir)Xlibscm.fn Makefile -# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)Xlibscm.texi - -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex Xlibscm.??) - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)Xlibscm.texi -$(dvidir)Xlibscm.fn: - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)Xlibscm.texi -$(dvidir)hobbit.dvi: version.txi hobbit.texi $(dvidir)hobbit.fn Makefile -# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)hobbit.texi - -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex hobbit.??) - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)hobbit.texi -$(dvidir)hobbit.fn: - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)hobbit.texi -xdvi: $(dvidir)scm.dvi - xdvi -s 3 $(dvidir)scm.dvi -Xdvi: $(dvidir)Xlibscm.dvi - xdvi -s 3 $(dvidir)Xlibscm.dvi -hobdvi: $(dvidir)hobbit.dvi - xdvi -s 3 $(dvidir)hobbit.dvi +dvi: scm.dvi Xlibscm.dvi hobbit.dvi +scm.dvi: version.txi scm.texi platform.txi features.txi Makefile + texi2dvi -b -c $(srcdir)scm.texi +Xlibscm.dvi: version.txi Xlibscm.texi Makefile + texi2dvi -b -c $(srcdir)Xlibscm.texi +hobbit.dvi: version.txi hobbit.texi Makefile + texi2dvi -b -c $(srcdir)hobbit.texi +xdvi: scm.dvi + xdvi scm.dvi +Xdvi: Xlibscm.dvi + xdvi Xlibscm.dvi +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\ - $(dvidir)scm.fn Makefile - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)scm.texi - mv $(dvidir)scm.pdf $(htmldir) -$(htmldir)Xlibscm.pdf: version.txi Xlibscm.texi $(dvidir)Xlibscm.fn Makefile - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)Xlibscm.texi - mv $(dvidir)Xlibscm.pdf $(htmldir) -$(htmldir)hobbit.pdf: version.txi hobbit.texi $(dvidir)hobbit.fn Makefile - cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)hobbit.texi - mv $(dvidir)hobbit.pdf $(htmldir) +$(htmldir)scm.pdf: version.txi scm.texi platform.txi features.txi Makefile + texi2pdf -b -c $(srcdir)scm.texi + mv scm.pdf $(htmldir) +$(htmldir)Xlibscm.pdf: version.txi Xlibscm.texi Makefile + texi2pdf -b -c $(srcdir)Xlibscm.texi + mv Xlibscm.pdf $(htmldir) +$(htmldir)hobbit.pdf: version.txi hobbit.texi Makefile + texi2pdf -b -c $(srcdir)hobbit.texi + mv hobbit.pdf $(htmldir) xpdf: $(htmldir)scm.pdf - xpdf -z 3 $(htmldir)scm.pdf + xpdf $(htmldir)scm.pdf Xpdf: $(htmldir)Xlibscm.pdf - xpdf -z 3 $(htmldir)Xlibscm.pdf + xpdf $(htmldir)Xlibscm.pdf hobpdf: $(htmldir)hobbit.pdf - xpdf -z 3 $(htmldir)hobbit.pdf + xpdf $(htmldir)hobbit.pdf PREVDOCS = prevdocs/ html: $(htmldir)scm_toc.html $(htmldir)Xlibscm_toc.html $(htmldir)hobbit_toc.html @@ -399,7 +418,7 @@ $(PREVDOCS)scm.info: srcdir.mk Makefile ################ INSTALL DEFINITIONS ################ -rpm_prefix=/usr/src/redhat/ +rpm_prefix=$(HOME)/rpmbuild/ prefix = /usr/local/ exec_prefix = $(prefix) @@ -497,6 +516,11 @@ uninstallinfo: scm.doc: scm.1 nroff -man $< | ul -tunknown >$@ +docs: $(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 + #### Stuff for maintaining SCM below #### ver = $(VERSION) @@ -523,10 +547,11 @@ dfiles = ANNOUNCE README COPYING scm.1 scm.doc QUICKREF \ version.txi platform.txi features.txi ChangeLog mfiles = Makefile build.scm build build.bat requires.scm \ .gdbinit mkimpcat.scm disarm.scm scm.spec -vfiles = setjump.mar setjump.s +sfiles = setjump.mar setjump.s ugsetjump.s continue-ia64.S \ + get-contoffset-ia64.c wbfiles = wbtab.scm rwb-isam.scm afiles = $(dfiles) $(cfiles) $(hfiles) $(ifiles) $(tfiles) $(mfiles) \ - $(hobfiles) $(vfiles) $(ufiles) $(xfiles) $(turfiles) $(wbfiles) + $(hobfiles) $(sfiles) $(ufiles) $(xfiles) $(turfiles) $(wbfiles) makedev = make -f $(HOME)/makefile.dev CHPAT=$(HOME)/bin/chpat @@ -681,7 +706,7 @@ ctagfiles = $(hfiles) $(cfiles) $(xfiles) ctags: $(ctagfiles) etags $(ctagfiles) -TAGFILES = $(hfiles) $(cfiles) $(ifiles) $(vfiles)\ +TAGFILES = $(hfiles) $(cfiles) $(ifiles) $(sfiles)\ version.txi scm.texi Xlibscm.texi hobbit.texi build $(xfiles) $(mfiles)\ hobbit.scm # # $(ufiles) ChangeLog @@ -1,4 +1,4 @@ -This directory contains the distribution of scm5e2. Scm conforms to +This directory contains the distribution of scm5e3. 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. @@ -27,6 +27,8 @@ NOS/VE, Unicos, VMS, Unix and similar systems. `build.scm' database for compiling and linking new SCM programs. `byte.c' strings as bytes. `compile.scm' Hobbit compilation to C. +`continue-ia64.S'replaces make_root_continuation(), make_continuation(), + and dynthrow() in continue.c `continue.c' continuations. `continue.h' continuations. `crs.c' interactive terminal control. @@ -40,6 +42,7 @@ NOS/VE, Unicos, VMS, Unix and similar systems. `eval.c' evaluator, apply, map, and foreach. `example.scm' example from R4RS which uses inexact numbers. `findexec.c' find the executable file function. +`get-contoffset-ia64.c'makes contoffset-ia64.S for inclusion by continue-ia64.S `gmalloc.c' Gnu malloc(); used for unexec. `gsubr.c' make_gsubr for arbitrary (< 11) arguments to C functions. @@ -104,18 +107,18 @@ 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/slib3a3.tar.gz + * swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz - * ftp.gnu.org:/pub/gnu/jacal/slib3a3.tar.gz + * ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz - * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a3.tar.gz + * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz -Unpack SLIB (`tar xzf slib3a3.tar.gz' or `unzip -ao slib3a3.zip') in an +Unpack SLIB (`tar xzf slib3a4.tar.gz' or `unzip -ao slib3a4.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 `Init5e2.scm' is +(this is the same directory as where the file `Init5e3.scm' is installed). `require.scm' should have the contents: (define (library-vicinity) "/usr/local/lib/slib/") @@ -280,17 +283,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files. recompile scm. add <FLAG> in scmfig.h and recompile scm. -ERROR: Init5e2.scm not found. Assign correct IMPLINIT in makefile +ERROR: Init5e3.scm not found. Assign correct IMPLINIT in makefile or scmfig.h. Define environment variable SCM_INIT_PATH to be the full - pathname of Init5e2.scm. + pathname of Init5e3.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 - Init5e2.scm to point to library or + Init5e3.scm to point to library or remove. Make sure the value of (library-vicinity) has a trailing @@ -351,11 +354,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. `Init5e2.scm'). +output files. `Init5e3.scm'). Spaces or control characters appear Check character defines in in symbol names. `scmfig.h'. Negative numbers turn positive. Check SRS in `scmfig.h'. -VMS: Couldn't unwind stack. #define CHEAP_CONTIUATIONS 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. diff --git a/Transcen.scm b/Transcen.scm index 3b87837..fe0330d 100644 --- a/Transcen.scm +++ b/Transcen.scm @@ -1,4 +1,4 @@ -;; Copyright (C) 1992, 1993, 1995, 1997, 2005 Free Software Foundation, Inc. +;; Copyright (C) 1992, 1993, 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 @@ -45,122 +45,162 @@ (define compile-allnumbers #t) ;for HOBBIT compiler -(define $pi (* 4 ($atan 1))) +;;;; Legacy real function names +(cond + ((defined? $exp) + (define real-sqrt $sqrt) + (define real-exp $exp) + (define real-expt $expt) + (define real-ln $log) + (define real-log10 $log10) + + (define real-sin $sin) + (define real-cos $cos) + (define real-tan $tan) + (define real-asin $asin) + (define real-acos $acos) + (define real-atan $atan) + + (define real-sinh $sinh) + (define real-cosh $cosh) + (define real-tanh $tanh) + (define real-asinh $asinh) + (define real-acosh $acosh) + (define real-atanh $atanh)) + + (else + (define $sqrt real-sqrt) + (define $exp real-exp) + (define $expt real-expt) + (define $log real-ln) + (define $log10 real-log10) + + (define $sin real-sin) + (define $cos real-cos) + (define $tan real-tan) + (define $asin real-asin) + (define $acos real-acos) + (define $atan real-atan) + + (define $sinh real-sinh) + (define $cosh real-cosh) + (define $tanh real-tanh) + (define $asinh real-asinh) + (define $acosh real-acosh) + (define $atanh real-atanh))) + +(define $pi (* 4 (real-atan 1))) (define pi $pi) (define (pi* z) (* $pi z)) (define (pi/ z) (/ $pi z)) +;;;; Complex functions + (define (exp z) - (if (real? z) ($exp z) - (make-polar ($exp (real-part z)) (imag-part z)))) + (if (real? z) (real-exp z) + (make-polar (real-exp (real-part z)) (imag-part z)))) -(define (log z) +(define (ln z) (if (and (real? z) (>= z 0)) - ($log z) - (make-rectangular ($log (magnitude z)) (angle z)))) + (real-ln z) + (make-rectangular (real-ln (magnitude z)) (angle z)))) +(define log ln) (define (sqrt z) (if (real? z) - (if (negative? z) (make-rectangular 0 ($sqrt (- z))) - ($sqrt z)) - (make-polar ($sqrt (magnitude z)) (/ (angle z) 2)))) + (if (negative? z) (make-rectangular 0 (real-sqrt (- z))) + (real-sqrt z)) + (make-polar (real-sqrt (magnitude z)) (/ (angle z) 2)))) (define (sinh z) - (if (real? z) ($sinh z) + (if (real? z) (real-sinh z) (let ((x (real-part z)) (y (imag-part z))) - (make-rectangular (* ($sinh x) ($cos y)) - (* ($cosh x) ($sin y)))))) + (make-rectangular (* (real-sinh x) (real-cos y)) + (* (real-cosh x) (real-sin y)))))) (define (cosh z) - (if (real? z) ($cosh z) + (if (real? z) (real-cosh z) (let ((x (real-part z)) (y (imag-part z))) - (make-rectangular (* ($cosh x) ($cos y)) - (* ($sinh x) ($sin y)))))) + (make-rectangular (* (real-cosh x) (real-cos y)) + (* (real-sinh x) (real-sin y)))))) (define (tanh z) - (if (real? z) ($tanh z) + (if (real? z) (real-tanh z) (let* ((x (* 2 (real-part z))) (y (* 2 (imag-part z))) - (w (+ ($cosh x) ($cos y)))) - (make-rectangular (/ ($sinh x) w) (/ ($sin y) w))))) + (w (+ (real-cosh x) (real-cos y)))) + (make-rectangular (/ (real-sinh x) w) (/ (real-sin y) w))))) (define (asinh z) - (if (real? z) ($asinh z) + (if (real? z) (real-asinh z) (log (+ z (sqrt (+ (* z z) 1)))))) (define (acosh z) (if (and (real? z) (>= z 1)) - ($acosh z) + (real-acosh z) (log (+ z (sqrt (- (* z z) 1)))))) (define (atanh z) (if (and (real? z) (> z -1) (< z 1)) - ($atanh z) + (real-atanh z) (/ (log (/ (+ 1 z) (- 1 z))) 2))) (define (sin z) - (if (real? z) ($sin z) + (if (real? z) (real-sin z) (let ((x (real-part z)) (y (imag-part z))) - (make-rectangular (* ($sin x) ($cosh y)) - (* ($cos x) ($sinh y)))))) + (make-rectangular (* (real-sin x) (real-cosh y)) + (* (real-cos x) (real-sinh y)))))) (define (cos z) - (if (real? z) ($cos z) + (if (real? z) (real-cos z) (let ((x (real-part z)) (y (imag-part z))) - (make-rectangular (* ($cos x) ($cosh y)) - (- (* ($sin x) ($sinh y))))))) + (make-rectangular (* (real-cos x) (real-cosh y)) + (- (* (real-sin x) (real-sinh y))))))) (define (tan z) - (if (real? z) ($tan z) + (if (real? z) (real-tan z) (let* ((x (* 2 (real-part z))) (y (* 2 (imag-part z))) - (w (+ ($cos x) ($cosh y)))) - (make-rectangular (/ ($sin x) w) (/ ($sinh y) w))))) + (w (+ (real-cos x) (real-cosh y)))) + (make-rectangular (/ (real-sin x) w) (/ (real-sinh y) w))))) (define (asin z) (if (and (real? z) (>= z -1) (<= z 1)) - ($asin z) + (real-asin z) (* -i (asinh (* +i z))))) (define (acos z) (if (and (real? z) (>= z -1) (<= z 1)) - ($acos z) + (real-acos z) (+ (/ (angle -1) 2) (* +i (asinh (* +i z)))))) (define (atan z . y) (if (null? y) - (if (real? z) ($atan z) + (if (real? z) + (real-atan z) (/ (log (/ (- +i z) (+ +i z))) +2i)) ($atan2 z (car y)))) ;;;; SRFI-70 -(define expt - (let ((integer-expt integer-expt)) - (lambda (z1 z2) - (cond ((and (exact? z2) (not (and (zero? z1) (negative? z2)))) - (integer-expt z1 z2)) - ((zero? z2) (+ 1 (* z1 z2))) - ((and (real? z2) (real? z1) (positive? z1)) - ($expt z1 z2)) - (else - (exp (* (if (zero? z1) (real-part z2) z2) (log z1)))))))) - -(define quo - (let ((integer-quotient quotient)) - (lambda (x1 x2) - (if (and (exact? x1) (exact? x2)) - (integer-quotient x1 x2) - (truncate (/ x1 x2)))))) - -(define rem - (let ((integer-remainder remainder)) - (lambda (x1 x2) - (if (and (exact? x1) (exact? x2)) - (integer-remainder x1 x2) - (- x1 (* x2 (quotient x1 x2))))))) - -(define mod - (let ((integer-modulo modulo)) - (lambda (x1 x2) - (if (and (exact? x1) (exact? x2)) - (integer-modulo x1 x2) - (- x1 (* x2 (floor (/ x1 x2)))))))) +(define (expt z1 z2) + (cond ((and (exact? z2) (not (and (zero? z1) (negative? z2)))) + (integer-expt z1 z2)) + ((zero? z2) (+ 1 (* z1 z2))) + ((and (real? z2) (real? z1) (positive? z1)) + (real-expt z1 z2)) + (else + (exp (* (if (zero? z1) (real-part z2) z2) (log z1)))))) + +(define (quo x1 x2) + (if (and (exact? x1) (exact? x2)) + (quotient x1 x2) + (truncate (/ x1 x2)))) + +(define (rem x1 x2) + (if (and (exact? x1) (exact? x2)) + (remainder x1 x2) + (- x1 (* x2 (quo x1 x2))))) + +(define (mod x1 x2) + (if (and (exact? x1) (exact? x2)) + (modulo x1 x2) + (- x1 (* x2 (floor (/ x1 x2)))))) (define (exact-round x) (inexact->exact (round x))) (define (exact-floor x) (inexact->exact (floor x))) diff --git a/Xlibscm.html b/Xlibscm.html deleted file mode 100644 index a33b38b..0000000 --- a/Xlibscm.html +++ /dev/null @@ -1,3326 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> -<html> -<!-- Created on September, 12 2006 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: Top</title> - -<meta name="description" content="Xlibscm: Top"> -<meta name="keywords" content="Xlibscm: Top"> -<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> -<table cellpadding="1" cellspacing="1" border="0"> -<tr><td valign="middle" align="left">[<a href="#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> - - - -<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">Procedure and Macro Index</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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="#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="Index"></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="#Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC17" 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="#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"> Procedure and Macro Index </h1> - -<p>This is an alphabetical list of all the procedures and macros in Xlibscm. -</p> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC16_0" class="summary-letter"><b>H</b></a> - -<a href="#SEC16_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="SEC16_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="SEC16_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="#SEC16_0" class="summary-letter"><b>H</b></a> - -<a href="#SEC16_1" class="summary-letter"><b>X</b></a> - -</td></tr></table> - -<hr size="6"> -<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="#Top" title="Up section"> Up </a>]</td> -<td valign="middle" align="left">[<a href="#SEC18" 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="#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"> Variable Index </h1> - -<p>This is an alphabetical list of all the global variables in Xlibscm. -</p> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC17_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="SEC17_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="#SEC17_0" class="summary-letter"><b>X</b></a> - -</td></tr></table> - -<p>This is an alphabetical list of concepts introduced in this manual. -</p> -<hr size="6"> -<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">[ > ]</td> -<td valign="middle" align="left"> </td> -<td valign="middle" align="left">[<a href="#SEC17" title="Beginning of this chapter or previous chapter"> << </a>]</td> -<td valign="middle" align="left">[<a href="#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="#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"> Concept Index </h1> -<table><tr><th valign="top">Jump to: </th><td><a href="#SEC18_0" class="summary-letter"><b>C</b></a> - -<a href="#SEC18_1" class="summary-letter"><b>D</b></a> - -<a href="#SEC18_2" class="summary-letter"><b>M</b></a> - -<a href="#SEC18_3" class="summary-letter"><b>N</b></a> - -<a href="#SEC18_4" class="summary-letter"><b>R</b></a> - -<a href="#SEC18_5" class="summary-letter"><b>U</b></a> - -<a href="#SEC18_6" class="summary-letter"><b>V</b></a> - -<a href="#SEC18_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="SEC18_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="SEC18_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="SEC18_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="SEC18_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="SEC18_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="SEC18_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="SEC18_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="SEC18_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="#SEC18_0" class="summary-letter"><b>C</b></a> - -<a href="#SEC18_1" class="summary-letter"><b>D</b></a> - -<a href="#SEC18_2" class="summary-letter"><b>M</b></a> - -<a href="#SEC18_3" class="summary-letter"><b>N</b></a> - -<a href="#SEC18_4" class="summary-letter"><b>R</b></a> - -<a href="#SEC18_5" class="summary-letter"><b>U</b></a> - -<a href="#SEC18_6" class="summary-letter"><b>V</b></a> - -<a href="#SEC18_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="#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">Procedure and Macro Index</a></li> - <li><a name="TOC14" href="#SEC17">Variable Index</a></li> - <li><a name="TOC15" href="#SEC18">Concept Index</a></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="#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>Thomas Bushnell BSG</em> on <em>September, 12 2006</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>Thomas Bushnell BSG</em> on <em>September, 12 2006</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 7223702..606fe3a 100644 --- a/Xlibscm.info +++ b/Xlibscm.info @@ -1,38 +1,58 @@ -This is Xlibscm.info, produced by makeinfo version 4.7 from +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). + +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. + INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY -* Xlibscm: (Xlibscm). SCM Language X Interface. +* XlibScm: (XlibScm). SCM Language X Interface. END-INFO-DIR-ENTRY -File: Xlibscm.info, Node: Top, Next: Xlibscm, Prev: (dir), Up: (dir) +File: Xlibscm.info, Node: Top, Next: XlibScm, Prev: (dir), Up: (dir) -This manual documents the X - SCM Language X Interface. The most recent -information about SCM can be found on SCM's "WWW" home page: +XlibScm +******* - `http://swiss.csail.mit.edu/~jaffer/SCM' +This manual documents the X Interface for SCM Language (version +5e3, October 2006). -Copyright (C) 1990-1999 Free Software Foundation +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 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: -* Xlibscm:: +* XlibScm:: * Display and Screens:: * Drawables:: * Graphics Context:: @@ -41,15 +61,15 @@ approved by the author. * Rendering:: * Images:: * Event:: -* Index:: +* Indexes:: -File: Xlibscm.info, Node: Xlibscm, Next: Display and Screens, Prev: Top, Up: Top +File: Xlibscm.info, Node: XlibScm, Next: Display and Screens, Prev: Top, Up: Top -1 Xlibscm +1 XlibScm ********* -"Xlibscm" is a SCM interface to "X". The X Window System is a +"XlibScm" is a SCM interface to "X". The X Window System is a network-transparent window system that was designed at MIT. SCM is a portable Scheme implementation written in C. The interface can be compiled into SCM or, on those platforms supporting dynamic linking, @@ -108,7 +128,7 @@ the suitability of this documentation for any purpose. It is provided "as is" without express or implied warranty. -File: Xlibscm.info, Node: Display and Screens, Next: Drawables, Prev: Xlibscm, Up: Top +File: Xlibscm.info, Node: Display and Screens, Next: Drawables, Prev: XlibScm, Up: Top 2 Display and Screens ********************* @@ -1673,7 +1693,7 @@ File: Xlibscm.info, Node: Images, Next: Event, Prev: Rendering, Up: Top -- Function: x:read-bitmap-file drawable file -File: Xlibscm.info, Node: Event, Next: Index, Prev: Images, Up: Top +File: Xlibscm.info, Node: Event, Next: Indexes, Prev: Images, Up: Top 9 Event ******* @@ -1913,13 +1933,22 @@ Each event object has fields dependent on its sub-type. altered. -File: Xlibscm.info, Node: Index, Prev: Event, Up: Top +File: Xlibscm.info, Node: Indexes, Prev: Event, Up: Top -Procedure and Macro Index -************************* +Indexes +******* + +* Menu: -This is an alphabetical list of all the procedures and macros in -Xlibscm. +* Procedure and Macro Index:: +* Variable Index:: +* Concept Index:: + + +File: Xlibscm.info, Node: Procedure and Macro Index, Next: Variable Index, Prev: Indexes, Up: Indexes + +Procedure and Macro Index +========================= * Menu: @@ -1997,10 +2026,11 @@ Xlibscm. * x:window-ref: Window Attributes. (line 280) * x:window-set!: Window Attributes. (line 7) -Variable Index -************** + +File: Xlibscm.info, Node: Variable Index, Next: Concept Index, Prev: Procedure and Macro Index, Up: Indexes -This is an alphabetical list of all the global variables in Xlibscm. +Variable Index +============== * Menu: @@ -2051,10 +2081,11 @@ This is an alphabetical list of all the global variables in Xlibscm. * x:GC-Tile-Stip-X-Origin: Graphics Context. (line 272) * x:GC-Tile-Stip-Y-Origin: Graphics Context. (line 273) -This is an alphabetical list of concepts introduced in this manual. + +File: Xlibscm.info, Node: Concept Index, Prev: Variable Index, Up: Indexes Concept Index -************* +============= * Menu: @@ -2076,26 +2107,29 @@ Concept Index (line 18) * Visual: Display and Screens. (line 110) * visual: Display and Screens. (line 110) -* X: Xlibscm. (line 6) +* X: XlibScm. (line 6) * x:None: Graphics Context. (line 311) -* Xlib: Xlibscm. (line 10) +* Xlib: XlibScm. (line 10) Tag Table: -Node: Top215 -Node: Xlibscm1330 -Node: Display and Screens4124 -Node: Drawables11166 -Node: Windows and Pixmaps11431 -Node: Window Attributes18533 -Node: Window Properties and Visibility34538 -Node: Graphics Context39010 -Node: Cursor54750 -Node: Colormap57261 -Node: Rendering67157 -Node: Images74737 -Node: Event74883 -Node: Index89368 +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 End Tag Table diff --git a/Xlibscm.texi b/Xlibscm.texi index 356877c..a9d82fb 100644 --- a/Xlibscm.texi +++ b/Xlibscm.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @c %**start of header -@setfilename Xlibscm.info -@settitle Xlibscm +@setfilename XlibScm.info +@settitle XlibScm @include version.txi @setchapternewpage on @c Choices for setchapternewpage are {on,off,odd}. @@ -10,28 +10,15 @@ @syncodeindex ft cp @c %**end of header -@dircategory The Algorithmic Language Scheme -@direntry -* Xlibscm: (Xlibscm). SCM Language X Interface. -@end direntry - -@iftex -@finalout -@c DL: lose the egregious vertical whitespace, esp. around examples -@c but paras in @defun-like things don't have parindent -@parskip 4pt plus 1pt -@end iftex - -@titlepage -@title Xlibscm -@subtitle SCM Language X Interface -@subtitle Version @value{SCMVERSION} -@author by Aubrey Jaffer +@copying +@noindent +This manual documents the X Interface for SCM Language (version +@value{SCMVERSION}, @value{SCMDATE}). -@page -@vskip 0pt plus 1filll -Copyright @copyright{} 1990-1999 Free Software Foundation +@noindent +Copyright @copyright{} 1999 Free Software Foundation, Inc. +@quotation 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. @@ -45,44 +32,41 @@ 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. -@end titlepage - -@node Top, Xlibscm, (dir), (dir) - - -@ifinfo -This manual documents the X - SCM Language X Interface. The most recent -information about SCM can be found on SCM's @dfn{WWW} home page: - -@center @url{http://swiss.csail.mit.edu/~jaffer/SCM} +@end quotation +@end copying +@dircategory The Algorithmic Language Scheme +@direntry +* XlibScm: (XlibScm). SCM Language X Interface. +@end direntry -Copyright (C) 1990-1999 Free Software Foundation +@iftex +@finalout +@c DL: lose the egregious vertical whitespace, esp. around examples +@c but paras in @defun-like things don't have parindent +@parskip 4pt plus 1pt +@end iftex -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. +@titlepage +@title XlibScm +@subtitle SCM Language X Interface +@subtitle Version @value{SCMVERSION} +@author Aubrey Jaffer +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +@contents -@end ignore -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. +@ifnottex +@node Top, XlibScm, (dir), (dir) +@top XlibScm -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. -@end ifinfo +@insertcopying @menu -* Xlibscm:: +* XlibScm:: * Display and Screens:: * Drawables:: * Graphics Context:: @@ -91,13 +75,14 @@ by the author. * Rendering:: * Images:: * Event:: -* Index:: +* Indexes:: @end menu +@end ifnottex -@node Xlibscm, Display and Screens, Top, Top -@chapter Xlibscm +@node XlibScm, Display and Screens, Top, Top +@chapter XlibScm -@dfn{Xlibscm} is a SCM interface to @dfn{X}. +@dfn{XlibScm} is a SCM interface to @dfn{X}. @cindex X The @ifset html @@ -187,7 +172,7 @@ the suitability of this documentation for any purpose. It is provided ``as is'' without express or implied warranty. -@node Display and Screens, Drawables, Xlibscm, Top +@node Display and Screens, Drawables, XlibScm, Top @chapter Display and Screens @defun x:open-display display-name @@ -1857,7 +1842,7 @@ tile-stipple-x-origin, and tile-stipple-y-origin. @end defun -@node Event, Index, Images, Top +@node Event, Indexes, Images, Top @chapter Event @noindent @@ -2091,25 +2076,28 @@ X-event:count represents the number of keycodes altered. @end multitable @end defun -@node Index, , Event, Top -@c @node Procedure and Macro Index, Variable Index, The Implementation, Top -@unnumbered Procedure and Macro Index +@node Indexes, , Event, Top +@unnumbered Indexes -This is an alphabetical list of all the procedures and macros in Xlibscm. +@menu +* Procedure and Macro Index:: +* Variable Index:: +* Concept Index:: +@end menu -@printindex fn +@node Procedure and Macro Index, Variable Index, Indexes, Indexes +@unnumberedsec Procedure and Macro Index -@c @node Variable Index, Type Index, Procedure and Macro Index, Top -@unnumbered Variable Index +@printindex fn -This is an alphabetical list of all the global variables in Xlibscm. +@node Variable Index, Concept Index, Procedure and Macro Index, Indexes +@unnumberedsec Variable Index @printindex vr -This is an alphabetical list of concepts introduced in this manual. +@node Concept Index, , Variable Index, Indexes +@unnumberedsec Concept Index -@unnumbered Concept Index @printindex cp -@contents @bye @@ -98,7 +98,7 @@ )))))) (define (prng samples modu sta) - (define sra (create-array (A:fixN32b) samples)) + (define sra (make-array (A:fixN32b) samples)) (do ((cnt (+ -1 samples) (+ -1 cnt)) (num (random modu sta) (random modu sta)) (sum 0 (+ sum num))) @@ -89,6 +89,8 @@ ("setjump.mar" Vax-asm platform-specific "provides setjump and longjump which do not use $unwind utility on VMS.") ("ugsetjump.s" gnu-as platform-specific "provides setjump and longjump which work on Ultrix VAX.") ("setjump.s" Cray-asm platform-specific "provides setjump and longjump for the Cray YMP.") + ("continue-ia64.S" gnu-as platform-specific "replaces make_root_continuation(), make_continuation(), and dynthrow() in continue.c") + ("get-contoffset-ia64.c" c-source platform-specific "makes contoffset-ia64.S for inclusion by continue-ia64.S") ("Init.scm" Scheme core "Scheme initialization.") ("Transcen.scm" Scheme core "inexact builtin procedures.") ("Link.scm" Scheme core "Dynamic link/loading.") @@ -197,12 +199,12 @@ 'careful-interrupt-masking '((define "CAREFUL_INTS"))) -#;Turns on the features @samp{cautious}, -#;@samp{careful-interrupt-masking}, and @samp{stack-limit}; uses +#;Turns on the features @samp{cautious} and +#;@samp{careful-interrupt-masking}; uses #;@code{-g} flags for debugging SCM source code. (define-build-feature 'debug - '((c-lib debug) (features cautious careful-interrupt-masking stack-limit))) + '((c-lib debug) (features cautious careful-interrupt-masking))) #;If your scheme code runs without any errors you can disable almost #;all error checking by compiling all files with @samp{reckless}. @@ -210,15 +212,6 @@ 'reckless '((define "RECKLESS"))) -#;Use to enable checking for stack overflow. Define value of the C -#;preprocessor variable @var{STACK_LIMIT} to be the size to which SCM -#;should allow the stack to grow. STACK_LIMIT should be less than the -#;maximum size the hardware can support, as not every routine checks the -#;stack. -(define-build-feature - 'stack-limit - '((define ("STACK_LIMIT" "(HEAP_SEG_SIZE/2)")))) - #;C level support for hygienic and referentially transparent macros #;(syntax-rules macros). (define-build-feature @@ -412,6 +405,13 @@ 'no-heap-shrink '((define "DONT_GC_FREE_SEGMENTS"))) +#;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. +(define-build-feature + 'dont-memoize-locals + '((define "DONT_MEMOIZE_LOCALS"))) + #;If you only need straight stack continuations, executables compile with #;this feature will run faster and use less storage than not having it. #;Machines with unusual stacks @emph{need} this. Also, if you incorporate @@ -440,6 +440,7 @@ ((also-runs processor-family)) ((*unknown* #f) (i8086 #f) + (ia64 #f) (acorn #f) (alpha #f) (cray #f) @@ -489,6 +490,7 @@ (irix mips irix gcc ) ;gcc (linux i386 linux gcc ) ;gcc (linux-aout i386 linux gcc ) ;gcc + (linux-ia64 ia64 linux gcc ) ;gcc (darwin powerpc unix cc ) ;gcc (microsoft-c i8086 ms-dos cl ) ;link (microsoft-c-nt i386 ms-dos cl ) ;link @@ -1073,6 +1075,21 @@ (append objects libs))) oname))) +(defcommand link-c-program linux-ia64 + (lambda (oname objects libs parms) + (and (and (batch:try-command + parms "gcc -o get-contoffset-ia64 get-contoffset-ia64.c") + (batch:try-command + parms "./get-contoffset-ia64 contoffset-ia64.S") + (batch:try-command + parms "gcc -c continue-ia64.S")) + (batch:try-command + parms "gcc" "-rdynamic" "-o" oname "continue-ia64.o" + (must-be-first + '("pre-crt0.o" "ecrt0.o" "/usr/lib/crt0.o") + (append objects libs))) + oname))) + (defcommand compile-c-files unicos (lambda (files parms) (and (batch:try-chopped-command @@ -2040,7 +2057,7 @@ (define (logger . args) (define cep (current-error-port)) - (for-each (lambda (x) (display #\ cep) (display x cep)) + (for-each (lambda (x) (display #\space cep) (display x cep)) (cond ((provided? 'bignum) (require 'posix-time) (let ((ct (ctime (current-time)))) @@ -149,8 +149,8 @@ SCM scm_read_byte(port) return MAKINUM(c); } -static char s_sub_rd[] = "substring-read!"; -SCM scm_substring_read(sstr, start, args) +static char s_sub_rd[] = "subbytes-read!"; +SCM scm_subbytes_read(sstr, start, args) SCM sstr, start, args; { SCM end, port; @@ -196,8 +196,8 @@ SCM scm_substring_read(sstr, start, args) } } -static char s_sub_wr[] = "substring-write"; -SCM scm_substring_write(sstr, start, args) +static char s_sub_wr[] = "subbytes-write"; +SCM scm_subbytes_write(sstr, start, args) SCM sstr, start, args; { SCM end, port; @@ -246,8 +246,8 @@ static iproc subr2os[] = { {0, 0}}; static iproc lsubr2s[] = { - {s_sub_rd, scm_substring_read}, - {s_sub_wr, scm_substring_write}, + {s_sub_rd, scm_subbytes_read}, + {s_sub_wr, scm_subbytes_write}, {0, 0}}; @@ -264,14 +264,15 @@ void init_byte() scm_ldstr("\n\ (define bytes-length string-length)\n\ (define bytes-copy string-copy)\n\ +(define subbytes substring)\n\ (define (bytes-reverse bytes)\n\ (bytes-reverse! (bytes-copy bytes)))\n\ (define (read-bytes n . port)\n\ (let* ((len (abs n))\n\ (byts (make-bytes len))\n\ (cnt (if (positive? n)\n\ - (apply substring-read! byts 0 n port)\n\ - (apply substring-read! byts (- n) 0 port))))\n\ + (apply subbytes-read! byts 0 n port)\n\ + (apply subbytes-read! byts (- n) 0 port))))\n\ (if (= cnt len)\n\ byts\n\ (if (positive? n)\n\ @@ -279,7 +280,9 @@ void init_byte() (substring byts (- len cnt) len)))))\n\ (define (write-bytes bytes n . port)\n\ (if (positive? n)\n\ - (apply substring-write bytes 0 n port)\n\ - (apply substring-write bytes (- n) 0 port)))\n\ + (apply subbytes-write bytes 0 n port)\n\ + (apply subbytes-write bytes (- n) 0 port)))\n\ +(define substring-read! subbytes-read!)\n\ +(define substring-write subbytes-write)\n\ "); } diff --git a/continue-ia64.S b/continue-ia64.S new file mode 100644 index 0000000..e9387fb --- /dev/null +++ b/continue-ia64.S @@ -0,0 +1,365 @@ +/* Copyright (C) 2006 Free Software Foundation, Inc. + * Author: Richard E. Harke (continue-ia64.S only) copyright assigned + * to Free Software Foundation, Inc. + * + * By including the following notice, I am agreeing to its terms, + * including the special exception for SCM. + * + * 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. + * + * As a special exception, the Free Software Foundation gives permission + * for additional uses of the text contained in its release of SCM. + * + * The exception is that, if you link the SCM library with other files + * to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the SCM library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the + * Free Software Foundation under the name SCM. If you copy + * code from other Free Software Foundation releases into a copy of + * SCM, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for SCM, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + */ + +/* +struct Continuation {jump_buf jmpbuf; + long thrwval; + long length; + STACKITEM *stkbse; +#ifdef __ia64__ + long *bspbse; + long bsplength; + long rnat; +#endif + CONTINUATION_OTHER other; + struct Continuation *parent; + }; +*/ +/* Define offsets for elements of a Continuation structure */ +#include "contoffset-ia64.S" + + + .global must_malloc + .text + .align 32 + .global make_root_continuation + .proc make_root_continuation +make_root_continuation: + .prologue + .save ar.pfs,r33 + alloc r33 = ar.pfs,1,3,2,0 + .save rp,r34 + mov r34 = b0 + .body + addl r14 = @ltoffx(s_call_cc), r1 + mov out0 = cont_size + mov loc2 = gp + ;; + ld8.mov r14 = [r14], s_call_cc + ;; + adds out1 = 18, r14 + ;; + br.call.sptk.many b0=must_malloc + ;; + mov gp = r35 + cmp.eq p6,p0 = r8,r0 + adds r14 = stkbse_off,r8 + adds r15 = bspbse_off,r8 + (p6) br.cond.dpnt mrcexit + ;; + flushrs + st8 [r14] = r12 + ;; + mov r31 = ar.bsp + ;; + adds r14 = length_off,r8 + st8 [r15] = r31 + adds r16 = bsplength_off,r8 + ;; + st8 [r14] = r0 + st8 [r16] = r0 + adds r15 = parent_off,r8 + ;; + st8 [r15] = r8 +mrcexit: + mov ar.pfs = r33 + mov b0 = r34 + ;; + br.ret.sptk.many b0 + .endp make_root_continuation + + /* + register usage + r32 - r39 used in modulo loop (requires multiple of 8) + r40 save r32 from input + r41 save return - b0 + r42 ar.pfs + r43 save gp (r1) + r44 ar.bsp + r45 out0 + r46 out1 + */ + .global make_continuation + .proc make_continuation +make_continuation: + .prologue + .save ar.pfs, r42 + alloc r42 = ar.pfs, 1,12, 2, 8 + mov r43 = r1 + .save rp, r41 + mov r41 = b0 + mov r40 = r32 + ;; + .body + adds r14 = bspbse_off,r40 + adds r17 = stkbse_off,r40 + ;; + mov r44 = ar.bsp + ld8 r15 = [r14] // bspbse from parent + ld8 r18 = [r17] // stkbse from parent + ;; + sub r16 = r44,r15 // length of bsp to save + sub r19 = r18,r12 // length of stack to save + addl r15 = @ltoffx(s_call_cc), r1 + ;; + add r45 = r16,r19 // bsp len plus stack len + ld8.mov r14 = [r15], s_call_cc + ;; + adds r14 = 18, r14 + adds r45 = cont_size, r45 // add in length of continuation struct + ;; + mov r46 = r14 + br.call.sptk.many b0 = must_malloc + mov r1 = r43 + cmp.eq p6, p7 = 0, r8 + (p6) br.cond.dptk .L5 + ;; +.L1: + flushrs + adds r14 = bspbse_off,r40 + adds r17 = stkbse_off,r40 + ;; + mov r31 = ar.rsc + ld8 r15 = [r14] // bsp in parent + ld8 r18 = [r17] // stack base in parent + ;; + and r30 = ~0x3,r31 + sub r16 = r44,r15 // length of bsp to save + sub r19 = r18,r12 // length of stack to save + ;; + mov ar.rsc = r30 // set enforced idle + shr r16 = r16,3 // number of longs not bytes + adds r21 = length_off,r8 + adds r22 = bsplength_off,r8 + shr r19 = r19,3 // number of longs not bytes + ;; + mov r30 = ar.rnat + add r20 = r16,r19 // total length to save + st8 [r22] = r16 // store the bsp length + adds r14 = bspbse_off,r8 + adds r17 = stkbse_off,r8 + ;; + st8 [r14] = r44 // save current bsp + st8 [r17] = r18 // stkbse same as parent stkbse + adds r22 = parent_off,r8 + st8 [r21] = r20 // store the length + ;; + adds r21 = rnat_off,r8 + st8 [r22] = r40 // store parent continuation + mov r29 = ar.lc // need to preserve ar.lc + mov r28 = pr // need to preserve pr.rot + adds r16 = -1,r16 + ;; + st8 [r21] = r30 // store rnat's + mov ar.lc = r16 + mov ar.ec = 3 + mov pr.rot = 0x10000 + adds r27 = cont_size,r8 + adds r19 = -1,r19 + ;; +.L6: + (p16) ld8 r32 = [r15],8 + (p18) st8 [r27] = r34,8 + br.ctop.sptk.few .L6 + ;; + mov r26 = r12 + clrrrb + ;; + mov ar.ec = 3 + mov pr.rot = 0x10000 + mov ar.lc = r19 + ;; +.L7: + (p16) ld8 r32 = [r26],8 + (p18) st8 [r27] = r34,8 + br.ctop.sptk.few .L7 + ;; + mov ar.lc = r29 // restore ar.lc + mov pr = r28,0x1003e // restore pr + mov ar.rsc = r31 // restore ar.rsc + ;; +.L5: + mov ar.pfs = r42 + mov b0 = r41 + br.ret.sptk.many b0 + .endp make_continuation + + + .global thrown_value + .global longjmp + .global dynthrow + .proc dynthrow +dynthrow: + .prologue + .save ar.pfs, r42 + alloc r42 = ar.pfs, 1,12, 2, 8 + mov r43 = r1 + .save rp, r44 + mov r44 = b0 + ld8 r40 = [r32],8 + mov r31 = ar.rsc + movl r2 = ~0x3fff0003 + ;; +.L3: + flushrs + adds r14 = bspbse_off,r40 + adds r17 = stkbse_off,r40 + and r30 = r2,r31 + ;; + ld8 r41 = [r32] + ld8 r15 = [r14] // bsp + ld8 r18 = [r17] // stack base + mov ar.rsc = r30 // set enforced idle + ;; +.L2: + loadrs + adds r21 = length_off,r40 + adds r22 = bsplength_off,r40 + ;; + mov ar.bspstore = r15 + ld8 r16 = [r21] // get total length (number of longs) + ld8 r17 = [r22] // get bsp length (number of longs) + ;; + sub r20 = r16,r17 // compute stack length + shl r25 = r17,3 + ;; + mov r29 = ar.lc // need to preserve ar.lc + mov r28 = pr // need to preserve pr.rot + sub r15 = r15,r25 // adjust bsp beginning + shl r14 = r20,3 + adds r17 = -1,r17 + adds r21 = rnat_off,r40 + ;; + sub r18 = r18,r14 // adjust stack to lowest + mov ar.lc = r17 + mov ar.ec = 3 + mov pr.rot = 0x10000 + adds r27 = cont_size,r40 + adds r20 = -1,r20 + ;; +.L8: + (p16) ld8 r32 = [r27],8 + (p18) st8 [r15] = r34,8 + br.ctop.sptk.few .L8 + ;; + ld8 r14 = [r21] // get the rnat's + clrrrb + ;; + mov ar.ec = 3 + mov pr.rot = 0x10000 + mov ar.lc = r20 + ;; +.L9: + (p16) ld8 r32 = [r27],8 + (p18) st8 [r18] = r34,8 + br.ctop.sptk.few .L9 + ;; + mov ar.rnat = r14 + mov ar.lc = r29 // restore ar.lc + mov pr = r28,0x1003e // restore pr + addl r26 = @gprel(thrown_value),gp + ;; + mov ar.rsc = r31 // restore ar.rsc + st8 [r26] = r41 + mov r45 = r40 + mov r46 = 1 + ;; + br.call.sptk.many b0 = longjmp +// the following should not be executed + mov r1 = r43 + mov ar.pfs = r42 + mov b0 = r44 + br.ret.sptk.many b0 + .endp dynthrow + + .global mark_locations + .global mark_regs_ia64 + .proc mark_regs_ia64 +mark_regs_ia64: + .prologue + .save ar.pfs, r35 + alloc r35 = ar.pfs, 1, 4, 2, 0 + .save rp, r33 + mov r33 = b0 + mov r36 = r1 + mov r34 = r12 + adds r17 = stkbse_off, r32 + ;; + adds r12 = -32, r12 + ld8 r19 = [r17] + ;; + adds r18 = 16,r12 + ;; + sub r38 = r19, r18 + ;; + st8 [r18] = r4, 8 + shr r38 = r38, 3 + ;; + st8 [r18] = r5, 8 + ;; + st8 [r18] = r6, 8 + ;; + st8 [r18] = r7 + mov r37 = r12 + br.call.sptk.many b0 = mark_locations + flushrs + mov r1 = r36 + adds r17 = bspbse_off, r32 + ;; + mov r20 = ar.bsp + ;; + ld8 r37 = [r17] + ;; + sub r38 = r20, r37 + ;; + shr r38 = r38, 3 + br.call.sptk.many b0 = mark_locations + mov r1 = r36 + mov r12 = r34 + mov ar.pfs = r35 + mov b0 = r33 + br.ret.sptk.many b0 + .endp mark_regs_ia64 @@ -84,6 +84,7 @@ long stack_size(start) to `setjump(new_continuation->jmpbuf)' in order to complete the capture of this continuation. */ +#ifndef __ia64__ CONTINUATION *make_root_continuation(stack_base) STACKITEM *stack_base; { @@ -111,12 +112,12 @@ CONTINUATION *make_continuation(parent_cont) CONTINUATION *parent_cont; { CONTINUATION *cont; -#ifdef CHEAP_CONTINUATIONS +# ifdef CHEAP_CONTINUATIONS cont = (CONTINUATION *)malloc(sizeof(CONTINUATION)); if (!cont) return 0; cont->length = 0; cont->stkbse = parent_cont->stkbse; -#else +# else long j; register STACKITEM *src, *dst; FLUSH_REGISTER_WINDOWS; @@ -126,17 +127,18 @@ CONTINUATION *make_continuation(parent_cont) cont->length = j; cont->stkbse = parent_cont->stkbse; src = cont->stkbse; -# ifdef STACK_GROWS_UP +# ifdef STACK_GROWS_UP src += parent_cont->length; -# else +# else src -= parent_cont->length + cont->length; -# endif/* ndef STACK_GROWS_UP */ +# endif/* ndef STACK_GROWS_UP */ dst = (STACKITEM *)(cont + 1); for (j = cont->length; 0 <= --j; ) *dst++ = *src++; -#endif /* ndef CHEAP_CONTINUATIONS */ +# endif /* ndef CHEAP_CONTINUATIONS */ cont->parent = parent_cont; return cont; } +#endif /* free_continuation() is trivial, but who knows what the future holds. */ @@ -177,40 +179,41 @@ void free_continuation(cont) /* SCM_GROWTH is how many `long's to grow the stack by when we need room. */ #define SCM_GROWTH 100 +#ifndef __ia64__ void dynthrow(a) long *a; { register CONTINUATION *cont = (CONTINUATION *)(a[0]); long val = a[1]; -#ifndef CHEAP_CONTINUATIONS +# ifndef CHEAP_CONTINUATIONS register long j; register STACKITEM *src, *dst = cont->stkbse; -# ifdef STACK_GROWS_UP -# ifndef hpux +# ifdef STACK_GROWS_UP +# ifndef hpux if (a[2] && (a - ((long *)a[3]) < SCM_GROWTH)) puts("grow_throw: check if long growth[]; being optimized out"); -# endif +# endif /* if (a[2]) fprintf(stderr, " ct = %ld, dist = %ld\n", a[2], (((long *)a[3]) - a)); */ if (PTR_GE(dst + (cont->length), (STACKITEM *)&a)) grow_throw(a); -# else -# ifndef hpux +# else +# ifndef hpux if (a[2] && (((long *)a[3]) - a < SCM_GROWTH)) puts("grow_throw: check if long growth[]; being optimized out"); -# endif +# endif /* if (a[2]) fprintf(stderr, " ct = %ld, dist = %ld\n", a[2], (((long *)a[3]) - a)); */ dst -= cont->length; if (PTR_LE(dst, (STACKITEM *)&a)) grow_throw(a); -# endif/* def STACK_GROWS_UP */ +# endif/* def STACK_GROWS_UP */ FLUSH_REGISTER_WINDOWS; src = (STACKITEM *)(cont + 1); for (j = cont->length;0 <= --j;) *dst++ = *src++; -#endif /* ndef CHEAP_CONTINUATIONS */ -#ifdef SHORT_INT +# endif /* ndef CHEAP_CONTINUATIONS */ +# ifdef SHORT_INT thrown_value = val; longjump(cont->jmpbuf, 1); -#else +# else longjump(cont->jmpbuf, val); -#endif +# endif } /* grow_throw() grows the stack by SCM_GROWTH long words. If the @@ -221,7 +224,7 @@ void dynthrow(a) so the compiler won't be able to guess that the growth array isn't all used. */ -#ifndef CHEAP_CONTINUATIONS +# ifndef CHEAP_CONTINUATIONS void grow_throw(a) /* Grow the stack so that there is room */ long *a; /* to copy in the continuation. Then */ { /* retry the throw. */ @@ -233,7 +236,8 @@ void grow_throw(a) /* Grow the stack so that there is room */ growth[SCM_GROWTH-1] = sizeof growth; dynthrow(growth); } -#endif /* ndef CHEAP_CONTINUATIONS */ +# endif /* ndef CHEAP_CONTINUATIONS */ +#endif /* throw_to_continuation() restores the stack in effect when @var{cont} was made and resumes @var{cont}'s processor state. If @@ -42,12 +42,68 @@ /* "continue.h" Scheme Continuations for C. Author: Aubrey Jaffer. */ +/* If stack is not longword aligned then */ + +/* #define SHORT_ALIGN */ +#ifdef THINK_C +# define SHORT_ALIGN +#endif +#ifdef __MWERKS__ +# ifdef __MC68K__ +# define SHORT_ALIGN +# endif +#endif +#ifdef MSDOS +# ifndef _M_ARM +/* arm processors need DWORD aligned data access */ +# define SHORT_ALIGN +# endif +#endif +#ifdef atarist +# define SHORT_ALIGN +#endif + +#ifdef SHORT_ALIGN +typedef short STACKITEM; +#else +typedef long STACKITEM; +#endif + +/* If stacks grow up then */ + +/* #define STACK_GROWS_UP */ +#ifdef hp9000s800 +# define STACK_GROWS_UP +#endif +#ifdef pyr +# define STACK_GROWS_UP +#endif +#ifdef nosve +# define STACK_GROWS_UP +#endif +#ifdef _UNICOS +# define STACK_GROWS_UP +#endif +#ifdef __hppa__ +# define STACK_GROWS_UP +#endif + +/* James Clark came up with this neat one instruction fix for + continuations on the SPARC. It flushes the register windows so + that all the state of the process is contained in the stack. */ + +#ifdef sparc +# define FLUSH_REGISTER_WINDOWS asm("ta 3") +#else +# define FLUSH_REGISTER_WINDOWS /* empty */ +#endif + #ifdef vax # ifndef CHEAP_CONTINUATIONS - typedef int jump_buf[17]; - extern int setjump(jump_buf env); - extern int longjump(jump_buf env, int ret); +typedef int jump_buf[17]; +extern int setjump(jump_buf env); +extern int longjump(jump_buf env, int ret); # else # include <setjmp.h> @@ -58,9 +114,9 @@ #else /* ndef vax */ # ifdef _CRAY1 - typedef int jump_buf[112]; - extern int setjump(jump_buf env); - extern int longjump(jump_buf env, int ret); +typedef int jump_buf[112]; +extern int setjump(jump_buf env); +extern int longjump(jump_buf env, int ret); # else /* ndef _CRAY1 */ # ifndef PLAN9 @@ -75,7 +131,7 @@ # define jump_buf jmp_buf # define setjump setjmp # define longjump longjmp -# endif /* ndef HAVE_SIGSETJMP */ +# endif /* ndef SIG_UNBLOCK */ # endif /* ndef _CRAY1 */ #endif /* ndef vax */ @@ -86,37 +142,15 @@ # define CONTINUATION_OTHER int #endif -/* If stack is not longword aligned then */ - -/* #define SHORT_ALIGN */ -#ifdef THINK_C -# define SHORT_ALIGN -#endif -#ifdef __MWERKS__ -# ifdef __MC68K__ -# define SHORT_ALIGN -# endif -#endif -#ifdef MSDOS -# ifndef _M_ARM -/* arm processors need DWORD aligned data access */ -# define SHORT_ALIGN -# endif -#endif -#ifdef atarist -# define SHORT_ALIGN -#endif - -#ifdef SHORT_ALIGN -typedef short STACKITEM; -#else -typedef long STACKITEM; -#endif - struct Continuation {jump_buf jmpbuf; long thrwval; long length; STACKITEM *stkbse; +#ifdef __ia64__ + long *bspbse; + long bsplength; + long rnat; +#endif CONTINUATION_OTHER other; struct Continuation *parent; }; @@ -170,32 +204,3 @@ void throw_to_continuation P((CONTINUATION *cont, long val, #define PTR_GT(x, y) PTR_LT(y, x) #define PTR_LE(x, y) (!PTR_GT(x, y)) #define PTR_GE(x, y) (!PTR_LT(x, y)) - -/* James Clark came up with this neat one instruction fix for - continuations on the SPARC. It flushes the register windows so - that all the state of the process is contained in the stack. */ - -#ifdef sparc -# define FLUSH_REGISTER_WINDOWS asm("ta 3") -#else -# define FLUSH_REGISTER_WINDOWS /* empty */ -#endif - -/* If stacks grow up then */ - -/* #define STACK_GROWS_UP */ -#ifdef hp9000s800 -# define STACK_GROWS_UP -#endif -#ifdef pyr -# define STACK_GROWS_UP -#endif -#ifdef nosve -# define STACK_GROWS_UP -#endif -#ifdef _UNICOS -# define STACK_GROWS_UP -#endif -#ifdef __hppa__ -# define STACK_GROWS_UP -#endif diff --git a/debian/changelog b/debian/changelog index 2c3b541..5be7a7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +scm (5e3-1) unstable; urgency=low + + * New upstream release. + * debian/control (Architecture): Add ia64 to list of supported archs. Now + everything but s390 is listed. (Closes: #335980) + (Build-Depends): Require at least version 3a4 of slib. + + * Change to continue.h from version 5e1-2 repeated here. + + * Change to xgen.scm from version 5e2-4 repeated here. + + * Change to scm.1 from version 5e2-4 repeated here. + + -- Thomas Bushnell, BSG <tb@debian.org> Mon, 23 Oct 2006 23:31:59 -0700 + scm (5e2-5) unstable; urgency=low * debian/rules (binary-arch): Depend on install. Whoops! diff --git a/debian/control b/debian/control index ab2978d..6a2fc77 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,10 @@ Section: interpreters Priority: optional Maintainer: Thomas Bushnell, BSG <tb@debian.org> Standards-Version: 3.7.2 -Build-Depends: slib (>> 3a3), libncurses5-dev, libreadline5-dev, texi2html, texinfo, libx11-dev, debhelper (>= 5) +Build-Depends: slib (>> 3a4), 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 +Architecture: alpha amd64 arm hppa i386 hurd-i386 m68k mips mipsel powerpc ppc64 sparc ia64 Section: interpreters Priority: optional Depends: slib, ${shlibs:Depends} @@ -43,7 +43,7 @@ (define (disarm name) (lambda args - ;;(if (memq? name *features*) (set! *features* (remove name *features))) + ;;(if (memq? name slib:features) (set! slib:features (remove name *features))) (error name 'disabled))) (define abort quit) @@ -1,4 +1,4 @@ -/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 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 @@ -781,6 +781,12 @@ SCM eval_args(l) return res; } +/* + Evaluate each expression in argument list x, + and return a list allocated in the ecache of the + results. + The result is left in scm_env_tmp. +*/ static void ecache_evalx(x) SCM x; { @@ -798,6 +804,34 @@ static void ecache_evalx(x) ENV_V2LST((long)i, argv); } +/* + Allocate a list of UNDEFINED in the ecache, one + for each element of the argument list x. + The result is left in scm_env_tmp. +*/ +static void ecache_undefs(x) + SCM x; +{ + static SCM argv[10] = {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) { + ecache_undefs(x); + break; + } + i++; + x = CDR(x); + } + ENV_V2LST((long)i, argv); +} + /* result is 1 if right number of arguments, 0 otherwise, environment frame is put in scm_env_tmp */ static int ecache_eval_args(proc, arg1, arg2, arg3, x) @@ -1645,11 +1679,7 @@ static SCM m_body(xorig, env, ctxt) break; } } -#ifdef CAUTIOUS - ASSYNT(ilength(x) > 0, xorig, s_body, what); -#else ASSYNT(ilength(x) > 0, xorig, s_body, what); -#endif if (IMP(defs)) return x; return cons(m_letrec1(IM_DEFINE, cons2(i_define, defs, x), env, ctxt), EOL); } @@ -2046,6 +2076,48 @@ SCM scm_eval_values(x, env, valenv) return res; } +SCM scm_apply_cxr(proc, arg1) + SCM proc, arg1; +{ + double y; +#ifdef FLOATS + if (SUBRF(proc)) { + if (INUMP(arg1)) { + y = DSUBRF(proc)((double) INUM(arg1)); + goto ret; + } + ASRTGO(NIMP(arg1), floerr); + if (REALP(arg1)) { + y = DSUBRF(proc)(REALPART(arg1)); + ret: + if (y==y) return makdbl(y, 0.0); + goto floerr; + } +# ifdef BIGDIG + if (BIGP(arg1)) { + y = DSUBRF(proc)(big2dbl(arg1)); + goto ret; + } +# endif + floerr: + wta(arg1, (char *)ARG1, SNAME(proc)); + } +#endif + { + int op = CXR_OP(proc); +#ifndef RECKLESS + SCM x = arg1; +#endif + while (op) { + ASRTER(NIMP(arg1) && CONSP(arg1), + x, ARG1, SNAME(proc)); + arg1 = (1 & op ? CAR(arg1) : CDR(arg1)); + op >>= 2; + } + return arg1; + } +} + #ifdef __GNUC__ # define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) /* __GNUC_PATCHLEVEL__ */ @@ -2184,12 +2256,30 @@ static SCM ceval_1(x) TRACE(x); x = CDR(x); STATIC_ENV = CAR(x); +#if 0 /* + The block below signals an error if any variable + bound in a LETREC is referenced in any init. + */ scm_env_tmp = undefineds; EXTEND_VALENV; x = CDR(x); ecache_evalx(CAR(x)); EGC_ROOT(scm_env); CAR(scm_env) = scm_env_tmp; + +#else /* The block below implements LETREC* */ + ecache_undefs(CAR(CAR(x))); + EXTEND_VALENV; + x = CDR(x); + proc = CAR(x); + while (NIMP(proc)) { + arg1 = EVALCAR(proc); + proc = CDR(proc); + DEFER_INTS_EGC; + CAR(scm_env_tmp) = arg1; + scm_env_tmp = CDR(scm_env_tmp); + } +#endif scm_env_tmp = EOL; goto cdrxbegin; case (127 & IM_LETSTAR): @@ -2308,7 +2398,13 @@ static SCM ceval_1(x) x = acro_call(x, STATIC_ENV); goto loop; case (ISYMNUM(IM_LINUM)): +#ifndef MEMOIZE_LOCALS + x = CDR(x); /* For non-memoizing case, + just throw away line number. */ + goto loop; +#else goto expand; +#endif case (ISYMNUM(IM_DEFINE)): x = toplevel_define(x, STATIC_ENV); goto retx; @@ -2459,34 +2555,7 @@ evap1: case tc7_subr_1o: return SUBRF(proc)(arg1); case tc7_cxr: -#ifdef FLOATS - if (SUBRF(proc)) { - if (INUMP(arg1)) - return makdbl(DSUBRF(proc)((double) INUM(arg1)), 0.0); - ASRTGO(NIMP(arg1), floerr); - if (REALP(arg1)) - return makdbl(DSUBRF(proc)(REALPART(arg1)), 0.0); -# ifdef BIGDIG - if (BIGP(arg1)) - return makdbl(DSUBRF(proc)(big2dbl(arg1)), 0.0); -# endif - floerr: - wta(arg1, (char *)ARG1, SNAME(proc)); - } -#endif - { - int op = CXR_OP(proc); -#ifndef RECKLESS - x = arg1; -#endif - while (op) { - ASRTER(NIMP(arg1) && CONSP(arg1), - x, ARG1, SNAME(proc)); - arg1 = (1 & op ? CAR(arg1) : CDR(arg1)); - op >>= 2; - } - return arg1; - } + return scm_apply_cxr(proc, arg1); case tc7_rpsubr: return BOOL_T; case tc7_asubr: @@ -2873,34 +2942,7 @@ SCM apply(proc, arg1, args) return SUBRF(proc)(arg1); case tc7_cxr: ASRTGO(NULLP(args), wrongnumargs); -#ifdef FLOATS - if (SUBRF(proc)) { - if (INUMP(arg1)) - return makdbl(DSUBRF(proc)((double) INUM(arg1)), 0.0); - ASRTGO(NIMP(arg1), floerr); - if (REALP(arg1)) - return makdbl(DSUBRF(proc)(REALPART(arg1)), 0.0); -# ifdef BIGDIG - if (BIGP(arg1)) - return makdbl(DSUBRF(proc)(big2dbl(arg1)), 0.0); -# endif - floerr: - wta(arg1, (char *)ARG1, SNAME(proc)); - } -#endif - { - int op = CXR_OP(proc); -#ifndef RECKLESS - args = arg1; -#endif - while (op) { - ASRTER(NIMP(arg1) && CONSP(arg1), - args, ARG1, SNAME(proc)); - arg1 = (1 & op ? CAR(arg1) : CDR(arg1)); - op >>= 2; - } - return arg1; - } + return scm_apply_cxr(proc, arg1); case tc7_subr_3: ASRTGO(NIMP(args) && NIMP(CDR(args)) && NULLP(CDR(CDR(args))), wrongnumargs); @@ -2977,32 +3019,7 @@ SCM scm_cvapply(proc, n, argv) case tc7_subr_1: return SUBRF(proc)(argv[0]); case tc7_cxr: -#ifdef FLOATS - if (SUBRF(proc)) { - if (INUMP(argv[0])) - return makdbl(DSUBRF(proc)((double) INUM(argv[0])), 0.0); - ASRTGO(NIMP(argv[0]), floerr); - if (REALP(argv[0])) - return makdbl(DSUBRF(proc)(REALPART(argv[0])), 0.0); -# ifdef BIGDIG - if (BIGP(argv[0])) - return makdbl(DSUBRF(proc)(big2dbl(argv[0])), 0.0); -# endif - floerr: - wta(argv[0], (char *)ARG1, SNAME(proc)); - } -#endif - { - int op = CXR_OP(proc); - res = argv[0]; - while (op) { - ASRTER(NIMP(res) && CONSP(res), - argv[0], ARG1, SNAME(proc)); - res = (1 & op ? CAR(res) : CDR(res)); - op >>= 2; - } - return res; - } + return scm_apply_cxr(proc, argv[0]); case tc7_subr_3: return SUBRF(proc)(argv[0], argv[1], argv[2]); case tc7_lsubr: diff --git a/features.txi b/features.txi index c7e94fb..1df8107 100644 --- a/features.txi +++ b/features.txi @@ -53,14 +53,20 @@ For the @dfn{curses} screen management package. @item debug @cindex debug -Turns on the features @samp{cautious}, -@samp{careful-interrupt-masking}, and @samp{stack-limit}; uses +Turns on the features @samp{cautious} and +@samp{careful-interrupt-masking}; uses @code{-g} flags for debugging SCM source code. @item differ @cindex differ Sequence comparison +@item dont-memoize-locals +@cindex 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. + @item dump @cindex dump Convert a running scheme program into an executable file. @@ -169,14 +175,6 @@ This does not affect complex numbers. BSD @dfn{socket} interface. Socket addr functions require inexacts or bignums for 32-bit precision. -@item stack-limit -@cindex stack-limit -Use to enable checking for stack overflow. Define value of the C -preprocessor variable @var{STACK_LIMIT} to be the size to which SCM -should allow the stack to grow. STACK_LIMIT should be less than the -maximum size the hardware can support, as not every routine checks the -stack. - @item tick-interrupts @cindex tick-interrupts Use if you want the ticks and ticks-interrupt functions. diff --git a/get-contoffset-ia64.c b/get-contoffset-ia64.c new file mode 100644 index 0000000..4e3612c --- /dev/null +++ b/get-contoffset-ia64.c @@ -0,0 +1,107 @@ +/* Copyright (C) 2006 Free Software Foundation, Inc. + * Author: Richard E. Harke (get-contoffset-ia64.c only) copyright assigned + * to Free Software Foundation, Inc. + * + * By including the following notice, I am agreeing to its terms, + * including the special exception for SCM. + * + * 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. + * + * As a special exception, the Free Software Foundation gives permission + * for additional uses of the text contained in its release of SCM. + * + * The exception is that, if you link the SCM library with other files + * to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the SCM library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the + * Free Software Foundation under the name SCM. If you copy + * code from other Free Software Foundation releases into a copy of + * SCM, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for SCM, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + */ + +/* The .o of this file does not get linked into SCM. + * It is a utility used to create an include file + * for continue-ia64.S to get offsets into struct jump_buf + * and be sure they are correct for the current compiler. + * + * create get-contoffset-ia64 program by: + * gcc -o get-contoffset-ia64 get-contoffset-ia64.c + * create ASM include file by: + * ./get-contoffset-ia64 contoffset-ia64.S + */ +#include <stddef.h> +#include <stdio.h> + +#define IN_CONTINUE_C +#include "setjump.h" + +int +main(int argc, char ** argv) +{ + struct Continuation taco; + long jmpbuf_off = 10L; + long thrwval_off; + long length_off; + long stkbse_off; + long bspbse_off; + long bsplength_off; + long rnat_off; + long other_off; + long parent_off; + long cont_size; + FILE *prt; + + switch (argc) { + case 1: prt = stdout; break; + case 2: prt = fopen(argv[1], "w"); break; + default: return !0; + } + jmpbuf_off = &((struct Continuation *)0)->jmpbuf; + thrwval_off = &((struct Continuation *)0)->thrwval; + length_off = &((struct Continuation *)0)->length; + stkbse_off = &((struct Continuation *)0)->stkbse; + bspbse_off = &((struct Continuation *)0)->bspbse; + bsplength_off = &((struct Continuation *)0)->bsplength; + rnat_off = &((struct Continuation *)0)->rnat; + other_off = &((struct Continuation *)0)->other; + parent_off = &((struct Continuation *)0)->parent; + cont_size = sizeof(struct Continuation); + + fprintf(prt, " jmpbuf_off = %ld\n", jmpbuf_off); + fprintf(prt, " thrwval_off = %ld\n", thrwval_off); + fprintf(prt, " length_off = %ld\n", length_off); + fprintf(prt, " stkbse_off = %ld\n", stkbse_off); + fprintf(prt, " bspbse_off = %ld\n", bspbse_off); + fprintf(prt, " bsplength_off = %ld\n", bsplength_off); + fprintf(prt, " rnat_off = %ld\n", rnat_off); + fprintf(prt, " other_off = %ld\n", other_off); + fprintf(prt, " parent_off = %ld\n", parent_off); + fprintf(prt, " cont_size = %ld\n", cont_size); + fclose(prt); + return 0; +} diff --git a/hobbit.info b/hobbit.info index 9f124f3..7dae5f2 100644 --- a/hobbit.info +++ b/hobbit.info @@ -1,4 +1,23 @@ -This is hobbit.info, produced by makeinfo version 4.7 from hobbit.texi. +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), + +Copyright (C) 2002 Free Software Foundation + + 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 @@ -8,8 +27,27 @@ END-INFO-DIR-ENTRY File: hobbit.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) -Hobbit is an optimizing R4RS-Scheme to C compiler written by Tanel -Tammet. +Hobbit +****** + +This manual is for the Hobbit compiler for SCM (version 5e3, October +2006), + +Copyright (C) 2002 Free Software Foundation + + 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. * Menu: @@ -21,22 +59,6 @@ Tammet. * About Hobbit:: * Index:: -Copyright (C) 1990-1999, 2002 Free Software Foundation - -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. - File: hobbit.info, Node: Introduction, Next: Compiling with Hobbit, Prev: Top, Up: Top @@ -138,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 \"Init5e2.scm\"" + '("#define IMPLINIT \"Init5e3.scm\"" "#define BIGNUMS" "#define FLOATS" "#define ARRAYS" @@ -190,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 \"Init5e2.scm\"" + '("#define IMPLINIT \"Init5e3.scm\"" "#define COMPILED_INITS init_example();" "#define CCLO" "#define FLOATS")))) @@ -260,8 +282,8 @@ File: hobbit.info, Node: Hobbit Options, Next: CC Optimizations, Prev: Error By default hobbit assumes that only immediate (ie small, up to 30 bits) integers are used. It will automatically assume general arithmetics in case it finds any non-immediate numbers like 1.2 or - 10000000000000 or real-only procedures like $sin anywhere in the - source. + 10000000000000 or real-only procedures like real-sin anywhere in + the source. Another way to make Hobbit assume that generic arithmetic supported by SCM (ie exact and/or inexact reals, bignums) is also used, is to @@ -509,8 +531,9 @@ procedures, but a combination of internal SCM procedures, guaranteeing exact correspondence with the SCM interpreter while hindering the speed): - $sqrt $abs $exp $log $sin $cos $tan $asin $acos - $atan $sinh $cosh $tanh $asinh $acosh $atanh $expt + real-sqrt real-exp real-ln real-expt real-sin real-cos real-tan + real-asin real-acos real-atan real-sinh real-cosh real-tanh real-asinh + real-acosh real-atanh _Note Bene:_ These procedures are compiled to faster code than the corresponding generic versions sqrt, abs, ... expt. @@ -1204,7 +1227,7 @@ File: hobbit.info, Node: Pi, Prev: Cpstak, Up: Benchmark Sources (do ((l (string-length s) (+ 1 l))) ((>= l d) (display s)) (display #\0))) - (if (zero? (modulo j 10)) (newline) (display #\ ))) + (if (zero? (modulo j 10)) (newline) (display #\space))) (newline))) @@ -1929,46 +1952,46 @@ Index Tag Table: -Node: Top199 -Node: Introduction1227 -Node: Compiling with Hobbit2543 -Node: Compiling And Linking2801 -Node: Error Detection7487 -Node: Hobbit Options8793 -Node: CC Optimizations15522 -Node: The Language Compiled16478 -Node: Macros17137 -Node: SCM Primitive Procedures17741 -Node: SLIB Logical Procedures18600 -Node: Fast Integer Calculations19755 -Node: Force and Delay20889 -Node: Suggestions for writing fast code21474 -Node: Performance of Compiled Code31673 -Node: Gain in Speed31933 -Node: Benchmarks33518 -Node: Benchmark Sources36618 -Node: Destruct36964 -Node: Recfib38551 -Node: div-iter and div-rec38806 -Node: Hanoi39892 -Node: Tak40473 -Node: Ctak40828 -Node: Takl41808 -Node: Cpstak42464 -Node: Pi43243 -Node: Principles of Compilation44372 -Node: Macro-Expansion and Analysis44798 -Node: Building Closures48603 -Node: Lambda-lifting51494 -Node: Statement-lifting54225 -Node: Higher-order Arglists55333 -Node: Typing and Constants57139 -Node: About Hobbit58403 -Node: The Aims of Developing Hobbit58663 -Node: Manifest59554 -Node: Author and Contributors60013 -Node: Future Improvements61068 -Node: Release History61833 -Node: Index68622 +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 End Tag Table @@ -209,7 +209,9 @@ tcs-cons-imcar tcs-cons-nimcar tcs-cons-gloc tcs-closures tcs-subrs
tc7-asubr tcs-symbols tc7-ssymbol tcs-bignums tc16-bigpos tc3-cons
tc3-cons-gloc tc3-closure tc7-ssymbol tc7-msymbol tc7-string
- tc7-vector tc7-bvect tc7-ivect tc7-uvect tc7-fvect tc7-dvect tc7-cvect
+ tc7-vector tc7-Vbool
+ tc7-VfixZ32 tc7-VfixN32 tc7-VfixZ16 tc7-VfixN16 tc7-VfixZ8 tc7-VfixN8
+ tc7-VfloR32 tc7-VfloC32 tc7-VfloR64 tc7-VfloC64
tc7-contin tc7-cclo tc7-asubr
;;; tc7-subr-0 tc7-subr-1
tc7-cxr
@@ -2382,7 +2384,7 @@ atanh sqrt expt integer-expt))
(define *interpreter-defined-vars* '())
-;; '(*features*
+;; '(slib:features
;; most-positive-fixnum most-negative-fixnum))
;; defs in *extra-hobbit-primitive-defs* are used when the extra primitive
@@ -2507,6 +2509,13 @@ ($atanh "ATANH_FUN" 1)
($sqrt "SQRT_FUN" 1) ($expt "EXPT_FUN" 2)
($log "LOG_FUN" 1) ($abs "ABS_FUN" 1) ($exp "EXP_FUN" 1)
+ (real-sin "SIN_FUN" 1) (real-cos "COS_FUN" 1) (real-tan "TAN_FUN" 1)
+ (real-asin "ASIN_FUN" 1) (real-acos "ACOS_FUN" 1) (real-atan "ATAN_FUN" 1)
+ (real-sinh "SINH_FUN" 1) (real-cosh "COSH_FUN" 1)
+ (real-tanh "TANH_FUN" 1) (real-asinh "ASINH_FUN" 1) (real-acosh "ACOSH_FUN" 1)
+ (real-atanh "ATANH_FUN" 1)
+ (real-sqrt "SQRT_FUN" 1) (real-expt "EXPT_FUN" 2)
+ (real-ln "LOG_FUN" 1) (real-exp "EXP_FUN" 1)
(inexact->exact "in2ex" 1)
(make-rectangular "makrect" 2) (make-polar "makpolar" 2)
@@ -6028,13 +6037,18 @@ #f))
(else #f)))
-
(define *float-recognize-ops*
- '($sin $cos $tan $asin $acos $atan $sinh $cosh $tanh $asinh $tanh
- $asinh $acosh $atanh $sqrt $expt $log $abs $exp
- sin cos tan asin acos atan sinh cosh tanh asinh tanh
- asinh acosh atanh))
-
+ '(ln sqrt log exp
+ sin cos tan asin acos atan
+ sinh cosh tanh asinh acosh atanh
+ real-sin real-cos real-tan
+ real-asin real-acos real-atan
+ real-sinh real-cosh real-tanh
+ real-asinh real-acosh real-atanh
+ real-sqrt real-expt real-ln real-exp
+ $sin $cos $tan $asin $acos $atan
+ $sinh $cosh $tanh $asinh $acosh $atanh
+ $sqrt $expt $log $abs $exp))
(define *check-redefining-passed* '())
diff --git a/hobbit.texi b/hobbit.texi index 1afa9c4..0e59bf3 100644 --- a/hobbit.texi +++ b/hobbit.texi @@ -8,6 +8,31 @@ @paragraphindent 0 @c %**end of header +@copying +@noindent +This manual is for the Hobbit compiler for SCM (version +@value{SCMVERSION}, @value{SCMDATE}), + +@noindent +Copyright @copyright{} 2002 Free Software Foundation + +@quotation +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. +@end quotation +@end copying + @dircategory The Algorithmic Language Scheme @direntry * hobbit: (hobbit). SCM Compiler. @@ -24,40 +49,22 @@ @title Hobbit @subtitle SCM Compiler @subtitle Version @value{SCMVERSION} -@author by Tanel Tammet +@author Tanel Tammet @author Department of Computing Science @author Chalmers University of Technology @author University of Go"teborg @author S-41296 Go"teborg Sweden - @page -This Hobbit documentation was converted to texinfo format by Aubrey -Jaffer; and released as part of the SCM @value{SCMVERSION} distribution -@value{SCMDATE}. - -@vskip 0pt plus 1filll -Copyright @copyright{} 1990-1999, 2002 Free Software Foundation - -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. +@insertcopying @end titlepage +@contents + +@ifnottex @node Top, Introduction, (dir), (dir) +@top Hobbit -@ifinfo -Hobbit is an optimizing R4RS-Scheme to C compiler written by Tanel -Tammet. +@insertcopying @menu * Introduction:: @@ -68,31 +75,7 @@ Tammet. * About Hobbit:: * Index:: @end menu - -Copyright (C) 1990-1999, 2002 Free Software Foundation - -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. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -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. -@end ifinfo - +@end ifnottex @node Introduction, Compiling with Hobbit, Top, Top @chapter Introduction @@ -334,7 +317,7 @@ Selecting the type of arithmetics. By default hobbit assumes that only immediate (ie small, up to 30 bits) integers are used. It will automatically assume general arithmetics in case it finds any non-immediate numbers like 1.2 or 10000000000000 or -real-only procedures like @t{$sin} anywhere in the source. +real-only procedures like @t{real-sin} anywhere in the source. Another way to make Hobbit assume that generic arithmetic supported by SCM (ie exact and/or inexact reals, bignums) is also used, is to @@ -636,8 +619,9 @@ correspondence with the SCM interpreter while hindering the speed): @example @group -$sqrt $abs $exp $log $sin $cos $tan $asin $acos -$atan $sinh $cosh $tanh $asinh $acosh $atanh $expt +real-sqrt real-exp real-ln real-expt real-sin real-cos real-tan +real-asin real-acos real-atan real-sinh real-cosh real-tanh real-asinh +real-acosh real-atanh @end group @end example @@ -1429,7 +1413,7 @@ Puzzle | 0.28 0.41 | 0.46(0.22 gc) 0.03 (do ((l (string-length s) (+ 1 l))) ((>= l d) (display s)) (display #\0))) - (if (zero? (modulo j 10)) (newline) (display #\ ))) + (if (zero? (modulo j 10)) (newline) (display #\space))) (newline))) @end group @end example @@ -2281,5 +2265,4 @@ the first release @printindex fn -@contents @bye diff --git a/indexes.texi b/indexes.texi new file mode 100644 index 0000000..0aff554 --- /dev/null +++ b/indexes.texi @@ -0,0 +1,50 @@ + +@ifhtml +@node Index, , The Implementation, Top +@unnumbered Index +@end ifhtml + +@ifnotinfo +@menu +* Procedure and Macro Index:: +* Variable Index:: +* Type Index:: +* Concept Index:: +@end menu +@end ifnotinfo + +@ifnotinfo +@node Procedure and Macro Index, Variable Index, Indexes, Indexes +@end ifnotinfo +@unnumberedsec 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 +@end ifnotinfo +@unnumberedsec 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 +@end ifnotinfo +@unnumberedsec 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 +@end ifnotinfo +@unnumberedsec Concept Index + +@c This is an alphabetical list of concepts introduced in this manual. + +@printindex cp diff --git a/mkimpcat.scm b/mkimpcat.scm index c745cfc..02d1323 100644 --- a/mkimpcat.scm +++ b/mkimpcat.scm @@ -1,4 +1,4 @@ -;; Copyright (C) 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2003, 2004, 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 @@ -73,7 +73,13 @@ (display " " op) (write (cons from to) op) (newline op)) - (define (add-source feature filename) (add-alias feature filename)) + (define (add-source feature filename) + (cond ((file-exists? filename) + (display " " op) + (write (list feature 'source filename) op) + (newline op) + #t) + (else #f))) (define (add-links feature usr:lib x:lib link:able-suffix) (display* "#+" feature) (display* "(") @@ -120,14 +126,7 @@ (in-wb-vicinity "blkio" link:able-suffix) (in-wb-vicinity "scan" link:able-suffix) (usr:lib "c"))) - (add-source 'wb-table - (in-implementation-vicinity "wbtab")) - (add-source 'wb-table - (in-wb-vicinity "wbtab")) - (add-source 'rwb-isam - (in-implementation-vicinity "rwb-isam")) - (add-source 'rwb-isam - (in-wb-vicinity "rwb-isam")) + ;; wbtab and rwb-isam moved to "Simple associations" (add-alias 'wb 'db))) (cond ((add-link 'mysql (in-implementation-vicinity "database" @@ -217,12 +216,27 @@ (add-source 'build (in-implementation-vicinity "build")) (add-source 'compile (in-implementation-vicinity (string-append "compile" (scheme-file-suffix)))) + (or + (add-source 'wb-table + (in-implementation-vicinity + (string-append "wbtab" (scheme-file-suffix)))) + (add-source 'wb-table + (in-wb-vicinity + (string-append "wbtab" (scheme-file-suffix))))) + (or + (add-source 'rwb-isam + (in-implementation-vicinity + (string-append "rwb-isam" (scheme-file-suffix)))) + (add-source 'rwb-isam + (in-wb-vicinity + (string-append "rwb-isam" (scheme-file-suffix))))) (display* ")") ) (display* "#+" 'primitive-hygiene) (display* "(") - (add-source 'macro (in-implementation-vicinity "Macro")) + (add-source 'macro (in-implementation-vicinity + (string-append "Macro" (scheme-file-suffix)))) (display* ")") (add-links 'dld @@ -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=5e2 +VERSION=5e3 #endif #ifndef SCMVERSION -# define SCMVERSION "5e2" +# define SCMVERSION "5e3" #endif #ifdef nosve # define INIT_FILE_NAME "Init"SCMVERSION"_scm"; diff --git a/platform.txi b/platform.txi index d7b3d13..ef3d033 100644 --- a/platform.txi +++ b/platform.txi @@ -26,6 +26,7 @@ hp-ux hp-risc hp-ux cc irix mips irix gcc linux i386 linux gcc linux-aout i386 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 @@ -154,7 +154,7 @@ SCM scm_getgroups() The length needs not be exactly right */ grps = must_malloc_cell((0L + ngroups) * sizeof(gid_t), MAKE_LENGTH(((0L + ngroups) * sizeof(gid_t))/sizeof(long), - tc7_uvect), + tc7_VfixN32), scm_s_getgroups); ALLOW_INTS; { diff --git a/r4rstest.scm b/r4rstest.scm index d0842c5..5025733 100644 --- a/r4rstest.scm +++ b/r4rstest.scm @@ -88,7 +88,7 @@ (list #t #f #\a '() 9739 '(test) record-error "test" "" 'test '#() '#(a b c) )) (define i 1) -(for-each (lambda (x) (display (make-string i #\ )) +(for-each (lambda (x) (display (make-string i #\space)) (set! i (+ 3 i)) (write x) (newline)) @@ -242,6 +242,8 @@ (test '(list 3 4) 'quasiquote (quasiquote (list (unquote (+ 1 2)) 4))) (test '`(list ,(+ 1 2) 4) 'quasiquote '(quasiquote (list (unquote (+ 1 2)) 4))) (SECTION 5 2 1) +(define (tprint x) #t) +(test #t 'tprint (tprint 56)) (define add3 (lambda (x) (+ x 3))) (test 6 'define (add3 3)) (define first car) @@ -341,7 +343,7 @@ (record-error (list #f #t (list 'test-eq?-eqv?-agreement obj1 obj2))) (display "eqv? and eq? disagree about ") (write obj1) - (display #\ ) + (display #\space) (write obj2) (newline))))) @@ -605,6 +607,8 @@ (define f0.0 (string->number "0.0")) (define f0.8 (string->number "0.8")) (define f1.0 (string->number "1.0")) + (define f1e300 (and (string->number "1+3i") (string->number "1e300"))) + (define f1e-300 (and (string->number "1+3i") (string->number "1e-300"))) (define wto write-test-obj) (define lto load-test-obj) (newline) @@ -613,7 +617,27 @@ (SECTION 6 2) (test #f eqv? 1 f1.0) (test #f eqv? 0 f0.0) + (test #t eqv? f0.0 f0.0) + (cond ((= f0.0 (- f0.0)) + (test #t eqv? f0.0 (- f0.0)) + (test #t equal? f0.0 (- f0.0)))) + (cond ((= f0.0 (* -5 f0.0)) + (test #t eqv? f0.0 (* -5 f0.0)) + (test #t equal? f0.0 (* -5 f0.0)))) (SECTION 6 5 5) + (and f1e300 + (let ((f1e300+1e300i (make-rectangular f1e300 f1e300))) + (test f1.0 'magnitude (/ (magnitude f1e300+1e300i) + (* f1e300 (sqrt 2)))) + (test f.25 / f1e300+1e300i (* 4 f1e300+1e300i)))) + (and f1e-300 + (let ((f1e-300+1e-300i (make-rectangular f1e-300 f1e-300))) + (test f1.0 'magnitude (round (/ (magnitude f1e-300+1e-300i) + (* f1e-300 (sqrt 2))))) + (test f.25 / f1e-300+1e-300i (* 4 f1e-300+1e-300i)))) + (test #t = f0.0 f0.0) + (test #t = f0.0 (- f0.0)) + (test #t = f0.0 (* -5 f0.0)) (test #t inexact? f3.9) (test #t 'max (inexact? (max f3.9 4))) (test f4.0 max f3.9 4) @@ -642,18 +666,18 @@ ;;(test f0.0 expt f0.0 f-3.25) (test (atan 1) atan 1 1) - (set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely. + (set! write-test-obj (list f.25 f-3.25)) ;.25 inexact errors less likely. (set! load-test-obj (list 'define 'foo (list 'quote write-test-obj))) (test #t call-with-output-file - "tmp3" - (lambda (test-file) - (write-char #\; test-file) - (display #\; test-file) - (display ";" test-file) - (write write-test-obj test-file) - (newline test-file) - (write load-test-obj test-file) - (output-port? test-file))) + "tmp3" + (lambda (test-file) + (write-char #\; test-file) + (display #\; test-file) + (display ";" test-file) + (write write-test-obj test-file) + (newline test-file) + (write load-test-obj test-file) + (output-port? test-file))) (check-test-file "tmp3") (set! write-test-obj wto) (set! load-test-obj lto) @@ -748,43 +772,55 @@ (lambda (n1 n2) (= n1 (+ (* n2 (quotient n1 n2)) (remainder n1 n2))))) + (define b3-3 (string->number "33333333333333333333")) + (define b3-2 (string->number "33333333333333333332")) + (define b3-0 (string->number "33333333333333333330")) + (define b2-0 (string->number "2177452800")) (newline) (display ";testing bignums; ") (newline) (SECTION 6 5 7) - (test 0 modulo 33333333333333333333 3) - (test 0 modulo 33333333333333333333 -3) - (test 0 remainder 33333333333333333333 3) - (test 0 remainder 33333333333333333333 -3) - (test 2 modulo 33333333333333333332 3) - (test -1 modulo 33333333333333333332 -3) - (test 2 remainder 33333333333333333332 3) - (test 2 remainder 33333333333333333332 -3) - (test 1 modulo -33333333333333333332 3) - (test -2 modulo -33333333333333333332 -3) - (test -2 remainder -33333333333333333332 3) - (test -2 remainder -33333333333333333332 -3) - - (test 3 modulo 3 33333333333333333333) - (test 33333333333333333330 modulo -3 33333333333333333333) - (test 3 remainder 3 33333333333333333333) - (test -3 remainder -3 33333333333333333333) - (test -33333333333333333330 modulo 3 -33333333333333333333) - (test -3 modulo -3 -33333333333333333333) - (test 3 remainder 3 -33333333333333333333) - (test -3 remainder -3 -33333333333333333333) - - (test 0 modulo -2177452800 86400) - (test 0 modulo 2177452800 -86400) - (test 0 modulo 2177452800 86400) - (test 0 modulo -2177452800 -86400) - (test 0 modulo 0 -2177452800) - (test #t 'remainder (tb 281474976710655325431 65535)) - (test #t 'remainder (tb 281474976710655325430 65535)) + (test 0 modulo b3-3 3) + (test 0 modulo b3-3 -3) + (test 0 remainder b3-3 3) + (test 0 remainder b3-3 -3) + (test 2 modulo b3-2 3) + (test -1 modulo b3-2 -3) + (test 2 remainder b3-2 3) + (test 2 remainder b3-2 -3) + (test 1 modulo (- b3-2) 3) + (test -2 modulo (- b3-2) -3) + (test -2 remainder (- b3-2) 3) + (test -2 remainder (- b3-2) -3) + + (test 3 modulo 3 b3-3) + (test b3-0 modulo -3 b3-3) + (test 3 remainder 3 b3-3) + (test -3 remainder -3 b3-3) + (test (- b3-0) modulo 3 (- b3-3)) + (test -3 modulo -3 (- b3-3)) + (test 3 remainder 3 (- b3-3)) + (test -3 remainder -3 (- b3-3)) + + (test 0 modulo (- b2-0) 86400) + (test 0 modulo b2-0 -86400) + (test 0 modulo b2-0 86400) + (test 0 modulo (- b2-0) -86400) + (test 0 modulo 0 (- b2-0)) + (test #t 'remainder (tb (string->number "281474976710655325431") 65535)) + (test #t 'remainder (tb (string->number "281474976710655325430") 65535)) + + (let ((n (string->number + "30414093201713378043612608166064768844377641568960512"))) + (and n (exact? n) + (do ((pow3 1 (* 3 pow3)) + (cnt 21 (+ -1 cnt))) + ((negative? cnt) + (zero? (modulo n pow3)))))) (SECTION 6 5 8) - (test 281474976710655325431 string->number "281474976710655325431") - (test "281474976710655325431" number->string 281474976710655325431) + (test "281474976710655325431" number->string + (string->number "281474976710655325431")) (report-errs)) (define (test-numeric-predicates) @@ -831,7 +867,7 @@ (test #t eqv? #\space '#\Space) (test #t char? #\a) (test #t char? #\() -(test #t char? #\ ) +(test #t char? #\space) (test #t char? '#\newline) (test #f char=? #\A #\B) @@ -132,11 +132,12 @@ int ra_matchp(ra0, ras) break; case tc7_smob: if (!ARRAYP(ra1)) goto scalar; - if (ndim != ARRAY_NDIM(ra1)) + if (ndim != ARRAY_NDIM(ra1)) { if (0==ARRAY_NDIM(ra1)) goto scalar; else return 0; + } s1 = ARRAY_DIMS(ra1); if (bas0 != ARRAY_BASE(ra1)) exact = 3; for (i = 0; i < ndim; i++) @@ -309,7 +310,7 @@ static int racp(src, dst) for (; n-- > 0; i_s += inc_s, i_d += inc_d) CHARS(dst)[i_d] = CHARS(src)[i_s]; break; - case tc7_bvect: if (tc7_bvect != TYP7(src)) goto gencase; + case tc7_Vbool: if (tc7_Vbool != TYP7(src)) goto gencase; if (1==inc_d && 1==inc_s && i_s%LONG_BIT==i_d%LONG_BIT && n>=LONG_BIT) { long *sv = (long *)VELTS(src); long *dv = (long *)VELTS(dst); @@ -324,8 +325,8 @@ static int racp(src, dst) IVDEP(src != dst, for (; n >= LONG_BIT; n -= LONG_BIT, sv++, dv++) *dv = *sv;) - if (n) /* trailing partial word */ - *dv = (*dv & (~0L<<n)) | (*sv & ~(~0L<<n)); + if (n) /* trailing partial word */ + *dv = (*dv & (~0L<<n)) | (*sv & ~(~0L<<n)); } else { for (; n-- > 0; i_s += inc_s, i_d += inc_d) @@ -335,15 +336,15 @@ static int racp(src, dst) VELTS(dst)[i_d/LONG_BIT] &= ~(1L << (i_d%LONG_BIT)); } break; - case tc7_uvect: - case tc7_ivect: { + case tc7_VfixN32: + case tc7_VfixZ32: { long *d = (long *)VELTS(dst), *s = (long *)VELTS(src); if (TYP7(src)==TYP7(dst)) { IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = s[i_s];) - } - else if (tc7_ivect==TYP7(dst)) + } + else if (tc7_VfixZ32==TYP7(dst)) for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = num2long(cvref(src, i_s, UNDEFINED), (char *)ARG2, s_array_copy); @@ -354,86 +355,135 @@ static int racp(src, dst) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *d = (float *)VELTS(dst); float *s = (float *)VELTS(src); switch TYP7(src) { default: goto gencase; - case tc7_ivect: case tc7_uvect: + case tc7_VfixZ32: case tc7_VfixN32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = ((long *)s)[i_s]; ) - break; - case tc7_fvect: + break; + case tc7_VfloR32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = s[i_s]; ) - break; - case tc7_dvect: + break; + case tc7_VfloR64: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = ((double *)s)[i_s]; ) - break; + break; } break; } - case tc7_dvect: { + case tc7_VfloR64: { double *d = (double *)VELTS(dst); double *s = (double *)VELTS(src); switch TYP7(src) { default: goto gencase; - case tc7_ivect: case tc7_uvect: + case tc7_VfixZ32: case tc7_VfixN32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = ((long *)s)[i_s]; ) - break; - case tc7_fvect: + break; + case tc7_VfloR32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = ((float *)s)[i_s];) - break; - case tc7_dvect: + break; + case tc7_VfloR64: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) d[i_d] = s[i_s];) - break; + break; } break; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*d)[2] = (float (*)[2])VELTS(dst); + float (*s)[2] = (float (*)[2])VELTS(src); + switch TYP7(src) { + default: goto gencase; + case tc7_VfixZ32: case tc7_VfixN32: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = ((long *)s)[i_s]; + d[i_d][1] = 0.0; + }) + break; + case tc7_VfloR32: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = ((float *)s)[i_s]; + d[i_d][1] = 0.0; + }) + break; + case tc7_VfloR64: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = ((double *)s)[i_s]; + d[i_d][1] = 0.0; + }) + break; + case tc7_VfloC32: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = s[i_s][0]; + d[i_d][1] = s[i_s][1]; + }) + break; + case tc7_VfloC64: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = ((double (*)[2])s)[i_s][0]; + d[i_d][1] = ((double (*)[2])s)[i_s][1]; + }) + break; + } + } + case tc7_VfloC64: { double (*d)[2] = (double (*)[2])VELTS(dst); double (*s)[2] = (double (*)[2])VELTS(src); switch TYP7(src) { default: goto gencase; - case tc7_ivect: case tc7_uvect: + case tc7_VfixZ32: case tc7_VfixN32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) { d[i_d][0] = ((long *)s)[i_s]; d[i_d][1] = 0.0; }) - break; - case tc7_fvect: + break; + case tc7_VfloR32: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) { d[i_d][0] = ((float *)s)[i_s]; d[i_d][1] = 0.0; }) - break; - case tc7_dvect: + break; + case tc7_VfloR64: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) { d[i_d][0] = ((double *)s)[i_s]; d[i_d][1] = 0.0; }) - break; - case tc7_cvect: + break; + case tc7_VfloC32: + IVDEP(src != dst, + for (; n-- > 0; i_s += inc_s, i_d += inc_d) { + d[i_d][0] = ((float (*)[2])s)[i_s][0]; + d[i_d][1] = ((float (*)[2])s)[i_s][1]; + }) + break; + case tc7_VfloC64: IVDEP(src != dst, for (; n-- > 0; i_s += inc_s, i_d += inc_d) { d[i_d][0] = s[i_s][0]; d[i_d][1] = s[i_s][1]; }) + break; } - break; } # endif /* FLOATS */ } @@ -463,7 +513,7 @@ SCM ra2contig(ra, copy) len *= ARRAY_DIMS(ra)[k].ubnd - ARRAY_DIMS(ra)[k].lbnd + 1; k = ARRAY_NDIM(ra); if (ARRAY_CONTP(ra) && ((0==k) || (1==ARRAY_DIMS(ra)[k-1].inc))) { - if (tc7_bvect != TYP7(ARRAY_V(ra))) + if (tc7_Vbool != TYP7(ARRAY_V(ra))) return ra; if ((len==LENGTH(ARRAY_V(ra)) && 0==ARRAY_BASE(ra) % LONG_BIT && @@ -541,30 +591,31 @@ SCM sc2array(s, ra, prot) switch TYP7(ARRAY_V(res)) { case tc7_vector: break; - case tc7_bvect: + case tc7_Vbool: if (BOOL_T==s || BOOL_F==s) break; goto mismatch; case tc7_string: if (ICHRP(s)) break; goto mismatch; - case tc7_uvect: + case tc7_VfixN32: if (INUMP(s) && INUM(s)>=0) break; #ifdef BIGDIG if (NIMP(s) && tc16_bigpos==TYP16(s) && NUMDIGS(s)<=DIGSPERLONG) break; #endif goto mismatch; - case tc7_ivect: + case tc7_VfixZ32: if (INUMP(s)) break; #ifdef BIGDIG if (NIMP(s) && BIGP(s) && NUMDIGS(s)<=DIGSPERLONG) break; #endif goto mismatch; #ifdef FLOATS - case tc7_fvect: - case tc7_dvect: + case tc7_VfloR32: + case tc7_VfloR64: if (NUMBERP(s) && !(NIMP(s) && CPLXP(s))) break; goto mismatch; - case tc7_cvect: + case tc7_VfloC32: + case tc7_VfloC64: if (NUMBERP(s)) break; goto mismatch; #endif @@ -597,26 +648,33 @@ int ra_eqp(ra0, ras) BVE_CLR(ra0, i0); break; } - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (VELTS(ra1)[i1] != VELTS(ra2)[i2]) BVE_CLR(ra0, i0); break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (((float *)VELTS(ra1))[i1] != ((float *)VELTS(ra2))[i2]) BVE_CLR(ra0, i0); break; - case tc7_dvect: + case tc7_VfloR64: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (((double *)VELTS(ra1))[i1] != ((double *)VELTS(ra2))[i2]) BVE_CLR(ra0, i0); break; - case tc7_cvect: + case tc7_VfloC32: + for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) + if (BVE_REF(ra0, i0)) + if (((float *)VELTS(ra1))[2*i1] != ((float *)VELTS(ra2))[2*i2] || + ((float *)VELTS(ra1))[2*i1+1] != ((float *)VELTS(ra2))[2*i2+1]) + BVE_CLR(ra0, i0); + break; + case tc7_VfloC64: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (((double *)VELTS(ra1))[2*i1] != ((double *)VELTS(ra2))[2*i2] || @@ -651,7 +709,7 @@ static int ra_compare(ra0, ra1, ra2, opt) BVE_CLR(ra0, i0); break; } - case tc7_uvect: + case tc7_VfixN32: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) { if (BVE_REF(ra0, i0)) if (opt ? @@ -660,7 +718,7 @@ static int ra_compare(ra0, ra1, ra2, opt) BVE_CLR(ra0, i0); } break; - case tc7_ivect: + case tc7_VfixZ32: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) { if (BVE_REF(ra0, i0)) if (opt ? @@ -670,7 +728,7 @@ static int ra_compare(ra0, ra1, ra2, opt) } break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (opt ? @@ -678,7 +736,7 @@ static int ra_compare(ra0, ra1, ra2, opt) ((float *)VELTS(ra1))[i1] >= ((float *)VELTS(ra2))[i2]) BVE_CLR(ra0, i0); break; - case tc7_dvect: + case tc7_VfloR64: for (; n-- > 0; i0 += inc0, i1 += inc1, i2 += inc2) if (BVE_REF(ra0, i0)) if (opt ? @@ -732,7 +790,7 @@ int ra_sum(ra0, ras) MAKINUM(i0)); break; } - case tc7_uvect: { + case tc7_VfixN32: { unsigned long r; unsigned long *v0 = (unsigned long *)VELTS(ra0); unsigned long *v1 = (unsigned long *)VELTS(ra1); @@ -744,7 +802,7 @@ int ra_sum(ra0, ras) } ); break; } - case tc7_ivect: { + case tc7_VfixZ32: { long r, *v0 = (long *)VELTS(ra0), *v1 = (long *)VELTS(ra1); IVDEP(ra0 != ra1, for (; n-- > 0; i0 += inc0, i1 += inc1) { @@ -755,7 +813,7 @@ int ra_sum(ra0, ras) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); float *v1 = (float *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -763,7 +821,7 @@ int ra_sum(ra0, ras) v0[i0] += v1[i1]); break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); double *v1 = (double *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -771,7 +829,17 @@ int ra_sum(ra0, ras) v0[i0] += v1[i1]); break; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*v0)[2] = (float (*)[2])VELTS(ra0); + float (*v1)[2] = (float (*)[2])VELTS(ra1); + IVDEP(ra0 != ra1, + for (; n-- > 0; i0 += inc0, i1 += inc1) { + v0[i0][0] += v1[i1][0]; + v0[i0][1] += v1[i1][1]; + }); + break; + } + case tc7_VfloC64: { double (*v0)[2] = (double (*)[2])VELTS(ra0); double (*v1)[2] = (double (*)[2])VELTS(ra1); IVDEP(ra0 != ra1, @@ -802,26 +870,34 @@ int ra_difference(ra0, ras) aset(ra0, difference(RVREF(ra0, i0, e0), UNDEFINED), MAKINUM(i0)); break; } - case tc7_ivect: { + case tc7_VfixZ32: { long *v0 = VELTS(ra0); for (; n-- > 0; i0 += inc0) v0[i0] = -v0[i0]; break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); for (; n-- > 0; i0 += inc0) v0[i0] = -v0[i0]; break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); for (; n-- > 0; i0 += inc0) v0[i0] = -v0[i0]; break; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*v0)[2] = (float (*)[2])VELTS(ra0); + for (; n-- > 0; i0 += inc0) { + v0[i0][0] = -v0[i0][0]; + v0[i0][1] = -v0[i0][1]; + } + break; + } + case tc7_VfloC64: { double (*v0)[2] = (double (*)[2])VELTS(ra0); for (; n-- > 0; i0 += inc0) { v0[i0][0] = -v0[i0][0]; @@ -845,7 +921,7 @@ int ra_difference(ra0, ras) aset(ra0, difference(RVREF(ra0, i0, e0), RVREF(ra1, i1, e1)), MAKINUM(i0)); break; } - case tc7_uvect: { + case tc7_VfixN32: { unsigned long r; unsigned long *v0 = (unsigned long *)VELTS(ra0); unsigned long *v1 = (unsigned long*)VELTS(ra1); @@ -857,7 +933,7 @@ int ra_difference(ra0, ras) } ); break; } - case tc7_ivect: { + case tc7_VfixZ32: { long r, *v0 = VELTS(ra0), *v1 = VELTS(ra1); IVDEP(ra0 != ra1, for (; n-- > 0; i0 += inc0, i1 += inc1) { @@ -868,7 +944,7 @@ int ra_difference(ra0, ras) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); float *v1 = (float *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -876,7 +952,7 @@ int ra_difference(ra0, ras) v0[i0] -= v1[i1]); break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); double *v1 = (double *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -884,7 +960,17 @@ int ra_difference(ra0, ras) v0[i0] -= v1[i1]); break; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*v0)[2] = (float (*)[2])VELTS(ra0); + float (*v1)[2] = (float (*)[2])VELTS(ra1); + IVDEP(ra0 != ra1, + for (; n-- > 0; i0 += inc0, i1 += inc1) { + v0[i0][0] -= v1[i1][0]; + v0[i0][1] -= v1[i1][1]; + }) + break; + } + case tc7_VfloC64: { double (*v0)[2] = (double (*)[2])VELTS(ra0); double (*v1)[2] = (double (*)[2])VELTS(ra1); IVDEP(ra0 != ra1, @@ -921,7 +1007,7 @@ int ra_product(ra0, ras) MAKINUM(i0)); break; } - case tc7_uvect: { + case tc7_VfixN32: { unsigned long r; unsigned long *v0 = (unsigned long *)VELTS(ra0); unsigned long *v1 = (unsigned long *)VELTS(ra1); @@ -933,7 +1019,7 @@ int ra_product(ra0, ras) } ); break; } - case tc7_ivect: { + case tc7_VfixZ32: { long r, *v0 = VELTS(ra0), *v1 =VELTS(ra1); IVDEP(ra0 != ra1, for (; n-- > 0; i0 += inc0, i1 += inc1) { @@ -944,7 +1030,7 @@ int ra_product(ra0, ras) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); float *v1 = (float *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -952,7 +1038,7 @@ int ra_product(ra0, ras) v0[i0] *= v1[i1]); break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); double *v1 = (double *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -960,7 +1046,19 @@ int ra_product(ra0, ras) v0[i0] *= v1[i1]); break; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*v0)[2] = (float (*)[2])VELTS(ra0); + register double r; + float (*v1)[2] = (float (*)[2])VELTS(ra1); + IVDEP(ra0 != ra1, + for (; n-- > 0; i0 += inc0, i1 += inc1) { + r = v0[i0][0]*v1[i1][0] - v0[i0][1]*v1[i1][1]; + v0[i0][1] = v0[i0][0]*v1[i1][1] + v0[i0][1]*v1[i1][0]; + v0[i0][0] = r; + }); + break; + } + case tc7_VfloC64: { double (*v0)[2] = (double (*)[2])VELTS(ra0); register double r; double (*v1)[2] = (double (*)[2])VELTS(ra1); @@ -993,19 +1091,29 @@ int ra_divide(ra0, ras) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); for (; n-- > 0; i0 += inc0) v0[i0] = 1.0/v0[i0]; break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); for (; n-- > 0; i0 += inc0) v0[i0] = 1.0/v0[i0]; break; } - case tc7_cvect: { + case tc7_VfloC32: { + register double d; + float (*v0)[2] = (float (*)[2])VELTS(ra0); + for (; n-- > 0; i0 += inc0) { + d = v0[i0][0]*v0[i0][0] + v0[i0][1]*v0[i0][1]; + v0[i0][0] /= d; + v0[i0][1] /= -d; + } + break; + } + case tc7_VfloC64: { register double d; double (*v0)[2] = (double (*)[2])VELTS(ra0); for (; n-- > 0; i0 += inc0) { @@ -1031,7 +1139,7 @@ int ra_divide(ra0, ras) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0); float *v1 = (float *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -1039,7 +1147,7 @@ int ra_divide(ra0, ras) v0[i0] /= v1[i1]); break; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0); double *v1 = (double *)VELTS(ra1); IVDEP(ra0 != ra1, @@ -1047,7 +1155,20 @@ int ra_divide(ra0, ras) v0[i0] /= v1[i1]); break; } - case tc7_cvect: { + case tc7_VfloC32: { + register double d, r; + float (*v0)[2] = (float (*)[2])VELTS(ra0); + float (*v1)[2] = (float (*)[2])VELTS(ra1); + IVDEP(ra0 != ra1, + for (; n-- > 0; i0 += inc0, i1 += inc1) { + d = v1[i1][0]*v1[i1][0] + v1[i1][1]*v1[i1][1]; + r = (v0[i0][0]*v1[i1][0] + v0[i0][1]*v1[i1][1])/d; + v0[i0][1] = (v0[i0][1]*v1[i1][0] - v0[i0][0]*v1[i1][1])/d; + v0[i0][0] = r; + }) + break; + } + case tc7_VfloC64: { register double d, r; double (*v0)[2] = (double (*)[2])VELTS(ra0); double (*v1)[2] = (double (*)[2])VELTS(ra1); @@ -1118,32 +1239,32 @@ static int ramap_cxr(ra0, proc, ras) } break; # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *dst = (float *)VELTS(ra0); switch TYP7(ra1) { default: goto gencase; - case tc7_fvect: + case tc7_VfloR32: for (; n-- > 0; i0 += inc0, i1 += inc1) dst[i0] = DSUBRF(proc)((double)((float *)VELTS(ra1))[i1]); break; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: for (; n-- > 0; i0 += inc0, i1 += inc1) dst[i0] = DSUBRF(proc)((double)VELTS(ra1)[i1]); break; } break; } - case tc7_dvect: { + case tc7_VfloR64: { double *dst = (double *)VELTS(ra0); switch TYP7(ra1) { default: goto gencase; - case tc7_dvect: + case tc7_VfloR64: for (; n-- > 0; i0 += inc0, i1 += inc1) dst[i0] = DSUBRF(proc)(((double *)VELTS(ra1))[i1]); break; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: for (; n-- > 0; i0 += inc0, i1 += inc1) dst[i0] = DSUBRF(proc)((double)VELTS(ra1)[i1]); break; @@ -1536,11 +1657,11 @@ static int raeql_1(ra0, as_equal, ra1) if (*v0 != *v1) return 0; return 1; } - case tc7_bvect: + case tc7_Vbool: for (; n--; i0 += inc0, i1 += inc1) if (BVE_REF(ra0, i0) != BVE_REF(ra1, i1)) return 0; return 1; - case tc7_uvect: case tc7_ivect: { + case tc7_VfixN32: case tc7_VfixZ32: { long *v0 = (long *)VELTS(ra0) + i0; long *v1 = (long *)VELTS(ra1) + i1; for (; n--; v0 += inc0, v1 += inc1) @@ -1548,21 +1669,30 @@ static int raeql_1(ra0, as_equal, ra1) return 1; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *v0 = (float *)VELTS(ra0) + i0; float *v1 = (float *)VELTS(ra1) + i1; for (; n--; v0 += inc0, v1 += inc1) if (*v0 != *v1) return 0; return 1; } - case tc7_dvect: { + case tc7_VfloR64: { double *v0 = (double *)VELTS(ra0) + i0; double *v1 = (double *)VELTS(ra1) + i1; for (; n--; v0 += inc0, v1 += inc1) if (*v0 != *v1) return 0; return 1; } - case tc7_cvect: { + case tc7_VfloC32: { + float (*v0)[2]= (float (*)[2])VELTS(ra0) + i0; + float (*v1)[2] = (float (*)[2])VELTS(ra1) + i1; + for (; n--; v0 += inc0, v1 += inc1) { + if ((*v0)[0] != (*v1)[0]) return 0; + if ((*v0)[1] != (*v1)[1]) return 0; + } + return 1; + } + case tc7_VfloC64: { double (*v0)[2]= (double (*)[2])VELTS(ra0) + i0; double (*v1)[2] = (double (*)[2])VELTS(ra1) + i1; for (; n--; v0 += inc0, v1 += inc1) { @@ -44,7 +44,7 @@ #include "scm.h" #include "setjump.h" -void igc P((const char *what, STACKITEM *stackbase)); +void igc P((const char *what, SCM rootcont)); void unexec P((char *new_name, char *a_name, unsigned data_start, unsigned bss_start, unsigned entry_address)); void scm_fill_freelist P((void)); @@ -346,9 +346,9 @@ taloop: } lputc(')', port); break; - case tc7_bvect: - case tc7_ivect: case tc7_uvect: case tc7_svect: - case tc7_fvect: case tc7_dvect: case tc7_cvect: + case tc7_Vbool: case tc7_VfixN8: case tc7_VfixZ8: + case tc7_VfixN16: case tc7_VfixZ16: case tc7_VfixN32: case tc7_VfixZ32: + case tc7_VfloR32: case tc7_VfloC32: case tc7_VfloR64: case tc7_VfloC64: raprin1(exp, port, writing); break; case tcs_subrs: @@ -863,10 +863,13 @@ static int flush_ws(port) } /* Top-level readers */ -static SCM p_read_numbered, p_read_for_load, p_read; +static SCM p_read_for_load, p_read; static char s_read[] = "read"; static char s_read_for_load[] = "read-for-load"; +#ifndef MEMOIZE_LOCALS +static SCM p_read_numbered; static char s_read_numbered[] = "read-numbered"; +#endif SCM scm_read(port) SCM port; { @@ -879,11 +882,13 @@ SCM scm_read_for_load(port) return lread1(port, 4, s_read_for_load); } +#ifndef MEMOIZE_LOCALS SCM scm_read_numbered(port) SCM port; { return lread1(port, 6, s_read_numbered); } +#endif static SCM lread1(port, flgs, what) SCM port; @@ -995,7 +1000,10 @@ static SCM lreadpr(tok_buf, port, flgs) goto tryagain; default: callshrp: { - SCM reader = (3&flgs) ? p_read_numbered : + SCM reader = +#ifndef MEMOIZE_LOCALS + (3&flgs) ? p_read_numbered : +#endif ((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)) { @@ -1440,7 +1448,7 @@ SCM scm_top_level(initpath, toplvl_fun) DEFER_INTS; scm_estk_reset(0); scm_egc(); - igc(s_unexec, (STACKITEM *)0); + igc(s_unexec, BOOL_F); ALLOW_INTS; dumped = 1; # ifdef linux @@ -2256,8 +2264,10 @@ void init_repl( iverbose ) add_feature(s_char_readyp); make_subr(s_swapcar, tc7_subr_2, swapcar); make_subr(s_wfi, tc7_lsubr, wait_for_input); +#ifndef MEMOIZE_LOCALS p_read_numbered = make_subr(s_read_numbered, tc7_subr_1, scm_read_numbered); +#endif p_read_for_load = make_subr(s_read_for_load, tc7_subr_1, scm_read_for_load); p_read = @@ -168,6 +168,15 @@ short num2short(num, pos, s_caller) if (INUMP(num) && lres==res) return res; wta(num, pos, s_caller); } +signed char num2char(num, pos, s_caller) + SCM num; + char *pos, *s_caller; +{ + long lres = INUM((long)num); + char res = lres; + if (INUMP(num) && lres==res) return res; + wta(num, pos, s_caller); +} #ifdef FLOATS double num2dbl(num, pos, s_caller) SCM num; @@ -318,21 +327,25 @@ unsigned long scm_addr(args, s_name) break; # ifdef FLOATS # ifdef SINGLES - case tc7_fvect: - ptr = (unsigned long)&(((float *)CDR(v))[pos]); + case tc7_VfloC32: pos = 2 * pos; + case tc7_VfloR32: ptr = (unsigned long)&(((float *)CDR(v))[pos]); break; # endif - case tc7_cvect: pos = 2 * pos; - case tc7_dvect: ptr = (unsigned long)&(((double *)CDR(v))[pos]); + case tc7_VfloC64: pos = 2 * pos; + case tc7_VfloR64: ptr = (unsigned long)&(((double *)CDR(v))[pos]); break; # endif - case tc7_bvect: ASRTGO(0==(pos%LONG_BIT), outrng); + case tc7_Vbool: ASRTGO(0==(pos%LONG_BIT), outrng); pos = pos/LONG_BIT; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: case tc7_vector: ptr = (unsigned long)&(VELTS(v)[pos]); break; - case tc7_svect: ptr = (unsigned long)&(((short *)CDR(v))[pos]); + case tc7_VfixN16: + case tc7_VfixZ16: ptr = (unsigned long)&(((short *)CDR(v))[pos]); + break; + case tc7_VfixN8: + case tc7_VfixZ8: ptr = (unsigned long)&(((char *)CDR(v))[pos]); break; outrng: wta(MAKINUM(pos), (char *)OUTOFRANGE, s_name); default: @@ -358,21 +371,26 @@ unsigned long scm_base_addr(v, s_name) break; # ifdef FLOATS # ifdef SINGLES - case tc7_fvect: + case tc7_VfloC32: pos = 2 * pos; + case tc7_VfloR32: ptr = (unsigned long)&(((float *)CDR(v))[pos]); break; # endif - case tc7_cvect: pos = 2 * pos; - case tc7_dvect: ptr = (unsigned long)&(((double *)CDR(v))[pos]); + case tc7_VfloC64: pos = 2 * pos; + case tc7_VfloR64: ptr = (unsigned long)&(((double *)CDR(v))[pos]); break; # endif - case tc7_bvect: ASRTGO(0==(pos%LONG_BIT), outrng); + case tc7_Vbool: ASRTGO(0==(pos%LONG_BIT), outrng); pos = pos/LONG_BIT; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: case tc7_vector: ptr = (unsigned long)&(VELTS(v)[pos]); break; - case tc7_svect: ptr = (unsigned long)&(((short *)CDR(v))[pos]); + case tc7_VfixN16: + case tc7_VfixZ16: ptr = (unsigned long)&(((short *)CDR(v))[pos]); + break; + case tc7_VfixN8: + case tc7_VfixZ8: ptr = (unsigned long)&(((char *)CDR(v))[pos]); break; outrng: wta(MAKINUM(pos), (char *)OUTOFRANGE, s_name); default: @@ -64,7 +64,7 @@ static char s_makrect[] = "make-rectangular", s_makpolar[] = "make-polar", s_real_part[] = "real-part", s_imag_part[] = "imag-part", s_in2ex[] = "inexact->exact",s_ex2in[] = "exact->inexact"; -static char s_expt[] = "$expt", s_atan2[] = "$atan2"; +static char s_expt[] = "real-expt", s_atan2[] = "$atan2"; #endif static char s_memv[] = "memv", s_assv[] = "assv"; @@ -585,11 +585,9 @@ SCM istr2flo(str, len, radix) } if (i==len) return BOOL_F; /* bad if lone `+' or `-' */ -# ifdef FLOATS if (6==len && ('+'==str[0] || '-'==str[0])) if (0==strcmp(str_inf0, &str[1])) return makdbl(1./0. * ('+'==str[0] ? 1 : -1), 0.0); -# endif if (str[i]=='i' || str[i]=='I') { /* handle `+i' and `-i' */ if (lead_sgn==0.0) return BOOL_F; /* must have leading sign */ @@ -1029,9 +1027,9 @@ SCM equal(x, y) if (smobs[i].equalp) return (smobs[i].equalp)(x, y); else return BOOL_F; } - case tc7_bvect: - case tc7_uvect: case tc7_ivect: case tc7_svect: - case tc7_fvect: case tc7_cvect: case tc7_dvect: { + case tc7_Vbool: case tc7_VfixN8: case tc7_VfixZ8: + case tc7_VfixN16: case tc7_VfixZ16: case tc7_VfixN32: case tc7_VfixZ32: + case tc7_VfloR32: case tc7_VfloC32: case tc7_VfloC64: case tc7_VfloR64: { SCM (*pred)() = smobs[0x0ff & (tc16_array>>8)].equalp; if (pred) return (*pred)(x, y); else return BOOL_F; @@ -1942,11 +1940,15 @@ SCM product(x, y) return y; } } + /* Use "Smith's formula" to extend dynamic range */ + /* David Goldberg + What Every Computer Scientist Should Know About Floating-Point Arithmetic + http://cch.loria.fr/documentation/IEEE754/ACM/goldberg.pdf */ SCM divide(x, y) SCM x, y; { #ifdef FLOATS - double d, r, i, a; + double den, a = 1.0; if (NINUMP(x)) { # ifndef RECKLESS if (!(NIMP(x))) @@ -1956,10 +1958,14 @@ SCM divide(x, y) # ifdef BIGDIG if (BIGP(x)) return makdbl(1.0/big2dbl(x), 0.0); # endif + /* reciprocal */ ASRTGO(INEXP(x), badx); if (REALP(x)) return makdbl(1.0/REALPART(x), 0.0); - r = REAL(x); i = IMAG(x); d = r*r+i*i; - return makdbl(r/d, -i/d); + { + y = x; + a = 1.0; + goto real_over_complex; + } } # ifdef BIGDIG if (BIGP(x)) { @@ -1999,7 +2005,7 @@ SCM divide(x, y) } # endif ASRTGO(INEXP(x), badx); - if (INUMP(y)) {d = INUM(y); goto basic_div;} + if (INUMP(y)) {den = INUM(y); goto basic_div;} # ifdef BIGDIG ASRTGO(NIMP(y), bady); if (BIGP(y)) return bigdblop('\\', y, REALPART(x), CPLXP(x) ? IMAG(x) : 0.0); @@ -2008,13 +2014,28 @@ SCM divide(x, y) ASRTGO(NIMP(y) && INEXP(y), bady); # endif if (REALP(y)) { - d = REALPART(y); - basic_div: return makdbl(REALPART(x)/d, CPLXP(x)?IMAG(x)/d:0.0); + den = REALPART(y); + basic_div: return makdbl(REALPART(x)/den, CPLXP(x)?IMAG(x)/den:0.0); } a = REALPART(x); - if (REALP(x)) goto complex_div; - r = REAL(y); i = IMAG(y); d = r*r+i*i; - return makdbl((a*r+IMAG(x)*i)/d, (IMAG(x)*r-a*i)/d); + if (REALP(x)) goto real_over_complex; + /* Both x and y are complex */ + /* Use "Smith's formula" to extend dynamic range */ + { + double b = IMAG(x); + double c = REALPART(y); + double d = IMAG(y); + if ((d > 0 ? d : -d) < (c > 0 ? c : -c)) { + double r = d/c; + double i = c + d*r; + return makdbl((a + b*r)/i, (b - a*r)/i); + } + { + double r = c/d; + double i = d + c*r; + return makdbl((b + a*r)/i, (-a + b*r)/i); + } + } } if (UNBNDP(y)) { if ((MAKINUM(1L)==x) || (MAKINUM(-1L)==x)) return x; @@ -2036,9 +2057,23 @@ SCM divide(x, y) # endif if (REALP(y)) return makdbl(INUM(x)/REALPART(y), 0.0); a = INUM(x); - complex_div: - r = REAL(y); i = IMAG(y); d = r*r+i*i; - return makdbl((a*r)/d, (-a*i)/d); + real_over_complex: + /* Both x and y are complex */ + /* Use "Smith's formula" to extend dynamic range */ + { + double c = REALPART(y); + double d = IMAG(y); + if ((d > 0 ? d : -d) < (c > 0 ? c : -c)) { + double r = d/c; + double i = c + d*r; + return makdbl((a)/i, (- a*r)/i); + } + { + double r = c/d; + double i = d + c*r; + return makdbl((a*r)/i, (-a)/i); + } + } } #else # ifdef BIGDIG @@ -2370,7 +2405,17 @@ SCM scm_magnitude(z) if (CPLXP(z)) { double i = IMAG(z), r = REAL(z); - return makdbl(sqrt(i*i+r*r), 0.0); + if (i < 0) i = -i; + if (r < 0) r = -r; + if (i < r) { + double q = i / r; + return makdbl(r * sqrt(1 + q * q), 0.0); + } + if (0.0==i) return i; + { + double q = r / i; + return makdbl(i * sqrt(1 + q * q), 0.0); + } } return makdbl(fabs(REALPART(z)), 0.0); } @@ -2848,23 +2893,23 @@ static dblproc cxrs[] = { {"ceiling", ceil}, {"truncate", scm_truncate}, {"round", scm_round}, - {"$sqrt", sqrt}, {"$abs", fabs}, - {"$exp", exp}, - {"$log", log}, - {"$log10", log10}, - {"$sin", sin}, - {"$cos", cos}, - {"$tan", tan}, - {"$asin", asin}, - {"$acos", acos}, - {"$atan", atan}, - {"$sinh", sinh}, - {"$cosh", cosh}, - {"$tanh", tanh}, - {"$asinh", asinh}, - {"$acosh", acosh}, - {"$atanh", atanh}, + {"real-sqrt", sqrt}, + {"real-exp", exp}, + {"real-ln", log}, + {"real-log10", log10}, + {"real-sin", sin}, + {"real-cos", cos}, + {"real-tan", tan}, + {"real-asin", asin}, + {"real-acos", acos}, + {"real-atan", atan}, + {"real-sinh", sinh}, + {"real-cosh", cosh}, + {"real-tanh", tanh}, + {"real-asinh", asinh}, + {"real-acosh", acosh}, + {"real-atanh", atanh}, {0, 0}}; #endif @@ -1,5 +1,5 @@ .\" dummy line -.TH SCM 1 "Jan 4 2000" +.TH SCM 1 "April 2006" .UC 4 .SH NAME scm \- a Scheme Language Interpreter @@ -59,10 +59,12 @@ Unless the option .I -no-init-file or .I --no-init-file -occurs in the command line, "Init.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 it is loaded. +occurs in the command line or if +.I scm +is being invoked as a script, "Init.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. "Init.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 @@ -1018,7 +1018,7 @@ void add_feature(str) } void init_features() { - loc_features = &CDR(sysintern("*features*", EOL)); + loc_features = &CDR(sysintern("slib:features", EOL)); init_iprocs(subr0s, tc7_subr_0); init_iprocs(subr1s, tc7_subr_1); make_subr(s_execpath, tc7_subr_1o, scm_execpath); @@ -1,4 +1,4 @@ -SCM(Jan 4 2000) SCM(Jan 4 2000) +SCM(April 2006) SCM(April 2006) @@ -21,9 +21,10 @@ DESCRIPTION set IMPLINIT to "Init.scm" in the source directory. Unless the option -no-init-file or --no-init-file occurs in the command - line, "Init.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 it is loaded. + line or if scm is being invoked as a script, "Init.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. "Init.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, @@ -197,8 +198,8 @@ FEATURES Available add-on packages including an interactive debugger, database, X-window graphics, BGI graphics, Motif, and Open-Windows packages. - A compiler (HOBBIT, available separately) and dynamic linking of - compiled modules. + A compiler (HOBBIT, available separately) and dynamic linking of com- + piled modules. Setable levels of monitoring and timing information printed interac- tively (the ‘verbose’ function). Restart, quit, and exec. @@ -238,4 +239,4 @@ SEE ALSO -4th Berkeley Distribution SCM(Jan 4 2000) +4th Berkeley Distribution SCM(April 2006) @@ -443,6 +443,7 @@ SCM_EXPORT long tc16_env, tc16_ident; #define SYMBOLP(x) (TYP7S(x)==tc7_ssymbol) #define STRINGP(x) (TYP7(x)==tc7_string) #define NSTRINGP(x) (!STRINGP(x)) +#define BYTESP(x) (TYP7(x)==tc7_VfixN8) #define VECTORP(x) (TYP7(x)==tc7_vector) #define NVECTORP(x) (!VECTORP(x)) #define LENGTH(x) (((unsigned long)CAR(x))>>8) @@ -520,9 +521,9 @@ SCM_EXPORT long tc16_array; case tc7_subr_2o:case tc7_lsubr_2:case tc7_lsubr #define tcs_symbols tc7_ssymbol:case tc7_msymbol #define tcs_bignums tc16_bigpos:case tc16_bigneg -#define tcs_uves tc7_string:case tc7_bvect:\ - case tc7_uvect:case tc7_ivect:case tc7_svect:\ - case tc7_fvect:case tc7_dvect:case tc7_cvect +#define tcs_uves tc7_string:case tc7_Vbool:case tc7_VfixN8:case tc7_VfixZ8:\ + case tc7_VfixN16:case tc7_VfixZ16:case tc7_VfixN32:case tc7_VfixZ32:\ + case tc7_VfloR32:case tc7_VfloC32:case tc7_VfloR64:case tc7_VfloC64 #define tc3_cons_nimcar 0 #define tc3_cons_imcar 2:case 4:case 6 @@ -534,20 +535,28 @@ SCM_EXPORT long tc16_array; #define tc7_msymbol 7 #define tc7_string 13 #define tc7_vector 15 -#define tc7_bvect 21 -/* spare 23 */ -#define tc7_ivect 29 -#define tc7_uvect 31 -#define tc7_svect 37 -/* spare 39 */ -#define tc7_fvect 45 -#define tc7_dvect 47 -#define tc7_cvect 53 -#define tc7_port 55 -#define tc7_contin 61 -#define tc7_specfun 63 - -/* spare 69 71 77 79 */ +#define tc7_Vbool 21 + +/* 23 */ + +#define tc7_VfixN8 29 +#define tc7_VfixZ8 31 +#define tc7_VfixN16 37 +#define tc7_VfixZ16 39 +#define tc7_VfixN32 45 +#define tc7_VfixZ32 47 + +#define tc7_VfloR32 53 +#define tc7_VfloC32 55 +#define tc7_VfloR64 61 +#define tc7_VfloC64 63 + +/* 69 */ + +#define tc7_port 71 +#define tc7_contin 77 +#define tc7_specfun 79 + #define tc7_subr_0 85 #define tc7_subr_1 87 #define tc7_cxr 93 @@ -1,5 +1,24 @@ -This is scm.info, produced by makeinfo version 4.7 from scm.texi. - +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. | + | INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY * SCM: (scm). A Scheme interpreter. @@ -8,27 +27,27 @@ END-INFO-DIR-ENTRY File: scm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) -This manual documents the SCM Scheme implementation. SCM version -5e2 was released February 2006. The most recent information about SCM | -can be found on SCM's "WWW" home page: | +SCM | +*** | - `http://swiss.csail.mit.edu/~jaffer/SCM' +This manual is for SCM (version 5e3, October 2006), and algorithmic | +language Scheme implementation. | -Copyright (C) 1990-1999 Free Software Foundation +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 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: @@ -85,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. `*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. @@ -237,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 @@ -387,18 +406,18 @@ 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/slib3a3.tar.gz | + * swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz | - * ftp.gnu.org:/pub/gnu/jacal/slib3a3.tar.gz | + * ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz | - * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a3.tar.gz | + * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz | -Unpack SLIB (`tar xzf slib3a3.tar.gz' or `unzip -ao slib3a3.zip') in an | +Unpack SLIB (`tar xzf slib3a4.tar.gz' or `unzip -ao slib3a4.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 `Init5e2.scm' is | +(this is the same directory as where the file `Init5e3.scm' is | installed). `require.scm' should have the contents: (define (library-vicinity) "/usr/local/lib/slib/") @@ -470,7 +489,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 "Init5e2.scm"'>>scmflags.h | + echo '#define IMPLINIT "Init5e3.scm"'>>scmflags.h | echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h echo '#define ARRAYS'>>scmflags.h @@ -489,7 +508,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 "Init5e2.scm"'>>scmflags.h | + echo '#define IMPLINIT "Init5e3.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 @@ -543,6 +562,7 @@ the SCM command line options. irix mips irix gcc linux i386 linux gcc linux-aout i386 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 @@ -622,7 +642,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 `Init5e2.scm'. SCM tries several likely | + initialization file `Init5e3.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. @@ -736,13 +756,18 @@ the SCM command line options. For the "curses" screen management package. "debug" - Turns on the features `cautious', - `careful-interrupt-masking', and `stack-limit'; 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. | + | "dump" Convert a running scheme program into an executable file. @@ -829,14 +854,7 @@ the SCM command line options. "socket" BSD "socket" interface. Socket addr functions require inexacts or bignums for 32-bit precision. - - "stack-limit" - Use to enable checking for stack overflow. Define value of - the C preprocessor variable STACK_LIMIT to be the size to - which SCM should allow the stack to grow. STACK_LIMIT should - be less than the maximum size the hardware can support, as - not every routine checks the stack. - + | "tick-interrupts" Use if you want the ticks and ticks-interrupt functions. @@ -882,7 +900,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/Init5e2.scm"'>>scmflags.h | + echo '#define IMPLINIT "/home/jaffer/scm/Init5e3.scm"'>>scmflags.h | echo '#define COMPILED_INITS init_foo();'>>scmflags.h echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h @@ -898,7 +916,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/Init5e2.scm"'>>scmflags.h | + echo '#define IMPLINIT "/home/jaffer/scm/Init5e3.scm"'>>scmflags.h | echo '#define BIGNUMS'>>scmflags.h echo '#define FLOATS'>>scmflags.h echo '#define ARRAYS'>>scmflags.h @@ -1018,6 +1036,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. | + | + | File: scm.info, Node: Automatic C Preprocessor Definitions, Next: Problems Compiling, Prev: Saving Images, Up: Installing SCM @@ -1037,7 +1085,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of ARM_ULIB Huw Rogers free unix library for acorn archimedes AZTEC_C Aztec_C 5.2a __CYGWIN__ Cygwin - __CYGWIN32__ Cygwin | + __CYGWIN32__ Cygwin _DCC Dice C on AMIGA __GNUC__ Gnu CC (and DJGPP) __EMX__ Gnu C port (gcc/emx 0.8e) to OS/2 2.0 @@ -1067,7 +1115,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of macintosh Macintosh (THINK_C and __MWERKS__ define) MCH_AMIGA Aztec_c 5.2a on AMIGA __MACH__ Apple Darwin - __MINGW32__ MinGW - Minimalist GNU for Windows | + __MINGW32__ MinGW - Minimalist GNU for Windows MSDOS Microsoft C 5.10 and 6.00A _MSDOS Microsoft CLARM and CLTHUMB compilers. __MSDOS__ Turbo C, Borland C, and DJGPP @@ -1109,7 +1157,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of sequent Sequent computer tahoe CCI Tahoe processor vax VAX processor - __x86_64 AMD Opteron | + __x86_64 AMD Opteron File: scm.info, Node: Problems Compiling, Next: Problems Linking, Prev: Automatic C Preprocessor Definitions, Up: Installing SCM @@ -1176,17 +1224,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files. recompile scm. add <FLAG> in scmfig.h and recompile scm. -ERROR: Init5e2.scm not found. Assign correct IMPLINIT in makefile | +ERROR: Init5e3.scm not found. Assign correct IMPLINIT in makefile | or scmfig.h. Define environment variable SCM_INIT_PATH to be the full - pathname of Init5e2.scm. | + pathname of Init5e3.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 - Init5e2.scm to point to library or | + Init5e3.scm to point to library or | remove. Make sure the value of (library-vicinity) has a trailing @@ -1246,11 +1294,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. `Init5e2.scm'). | +output files. `Init5e3.scm'). | Spaces or control characters appear Check character defines in in symbol names. `scmfig.h'. Negative numbers turn positive. Check SRS in `scmfig.h'. -VMS: Couldn't unwind stack. #define CHEAP_CONTIUATIONS 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. @@ -1329,7 +1379,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 `Init5e2.scm') in platform-dependent directories relative | +file (usually `Init5e3.scm') in platform-dependent directories relative | to this directory. See *Note File-System Habitat:: for a blow-by-blow description. @@ -1338,12 +1388,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, `Init5e2.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 it is loaded. +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. | -`Init5e2.scm' then looks for command input from one of three sources: | +`Init5e3.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. @@ -1504,13 +1554,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 `Init5e2.scm' in the source directory. | + The default is the file `Init5e3.scm' in the source directory. | -- Environment Variable: SCHEME_LIBRARY_PATH is the [SLIB] Scheme library directory. -- Environment Variable: HOME - is the directory where `Init5e2.scm' will look for the user | + is the directory where `Init5e3.scm' will look for the user | initialization file `ScmInit.scm'. -- Environment Variable: EDITOR @@ -1634,8 +1684,8 @@ File: scm.info, Node: Debugging Scheme Code, Next: Debugging Continuations, P 3.8 Debugging Scheme Code ========================= -The `cautious' and `stack-limit' options of `build' (*note Build -Options::) support 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 @@ -1655,15 +1705,11 @@ Options::) support debugging in Scheme. with <C-c>, inspect or modify top-level values, trace or untrace procedures, and continue execution with `(continue)'. -"STACK_LIMIT" - If SCM is built with the `STACK_LIMIT' flag, the interpreter will - check stack size periodically. If the size of stack exceeds a - certain amount (default is `HEAP_SEG_SIZE/2'), SCM generates a - `segment violation' interrupt. - - The usefulness of `STACK_LIMIT' depends on the user. I don't use - it; but the user I added this feature for got primarily this type - of error. +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. @@ -1933,13 +1979,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 `Init5e2.scm'. | + containing the arguments. `warn' is defined in `Init5e3.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 `Init5e2.scm'. | + defined in `Init5e3.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 @@ -1957,7 +2003,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 `Init5e2.scm' for an example of the use | + and `#f' otherwise. See `Init5e3.scm' for an example of the use | of `stack-trace'. @@ -1982,7 +2028,7 @@ 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 `Init5e2.scm': | +For instance, `open-input-file' is defined as follows in `Init5e3.scm': | (define (open-input-file str) (or (open-file str OPEN_READ) @@ -2031,7 +2077,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 `Init5e2.scm' for details. | + more complicated; see `Init5e3.scm' for details. | -- Function: abort Resumes the top level Read-Eval-Print loop. @@ -2065,7 +2111,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. + notifications of heap growth printed; the interpreter checks | + stack depth periodically. | >= 4 a garbage collection summary is printed after each top level @@ -2085,7 +2132,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. `5e2') of SCM. | + Contains the version string (e.g. `5e3') of SCM. | 3.12.1 Executable path ---------------------- @@ -3003,14 +3050,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?' (by `*features*') 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?' and `*features*', *Note - Require: (slib)Require. + For more information on `provided?', *Note Require: (slib)Require. | -- Read syntax: #- feature form is equivalent to `#+(not feature) expression'. @@ -3710,7 +3756,7 @@ an example of their use. -- Function: dyn:main-call name link-token arg1 ... LINK-TOKEN should be the value returned by a call to `dyn:link'. NAME should be the name of C function of 2 arguments, `(int argc, - const char **argv)', defined in the file named FILENAME which was | + const char **argv)', defined in the file named FILENAME which was succesfully `dyn:link'ed in the current SCM session. The `dyn:main-call' procedure calls the C function corresponding to NAME with `argv' style arguments, such as are given to C `main' @@ -3862,36 +3908,35 @@ operations: (r5rs)Numerical operations. -- Function: atanh z Return the inverse hyperbolic sine, cosine, and tangent of Z - -- Function: $sqrt x - -- Function: $abs x - -- Function: $exp x - -- Function: $log x - -- Function: $sin x - -- Function: $cos x - -- Function: $tan x - -- Function: $asin x - -- Function: $acos x - -- Function: $atan x - -- Function: $sinh x - -- Function: $cosh x - -- Function: $tanh x - -- Function: $asinh x - -- Function: $acosh x - -- Function: $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: $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: $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 `$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 @@ -4338,7 +4383,7 @@ I/O: (slib)Line I/O, and the following functions are defined: "Link.scm" "Macro.scm" "Transcen.scm" - "Init5e2.scm" | + "Init5e3.scm" | -- Function: mkdir path mode The `mkdir' function creates a new, empty directory whose name is @@ -5923,25 +5968,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_bvect + -- Header: tc7_Vbool | uniform vector of booleans (bit-vector) - -- Header: tc7_ivect + -- Header: tc7_VfixZ32 | uniform vector of integers - -- Header: tc7_uvect + -- Header: tc7_VfixN32 | uniform vector of non-negative integers - -- Header: tc7_svect + -- Header: tc7_VfixN16 | + uniform vector of non-negative short integers | + | + -- Header: tc7_VfixZ16 | uniform vector of short integers - -- Header: tc7_fvect + -- 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_dvect + -- Header: tc7_VfloR64 | uniform vector of double precision inexact real numbers - -- Header: tc7_cvect + -- Header: tc7_VfloC64 | uniform vector of double precision inexact complex numbers -- Header: tc7_contin @@ -5998,10 +6052,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', `$sqrt', `$abs', `$exp', - `$log', `$sin', `$cos', `$tan', `$asin', `$acos', `$atan', - `$sinh', `$cosh', `$tanh', `$asinh', `$acosh', `$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. @@ -6182,7 +6237,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, - bvect, ivect, uvect, fvect, dvect, or cvect) 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 @@ -6212,32 +6268,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........... -bvect .........long length....G0010101 ..........long *words........... - spare G0010111 -ivect .........long length....G0011101 ..........long *words........... -uvect .........long length....G0011111 ......unsigned long *words...... - spare G0100101 -svect .........long length....G0100111 ........ short *words........... -fvect .........long length....G0101101 .........float *words........... -dvect .........long length....G0101111 ........double *words........... -cvect .........long length....G0110101 ........double *words........... - -contin .........long length....G0111101 .............*regs.............. -specfun ................xxxxxxxxG1111111 ...........SCM name............. -cclo ..short length..xxxxxx10G1111111 ...........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.CwroxxxxxxxxG0110111 ..........FILE *stream.......... - socket int portnum.C001xxxxxxxxG0110111 ..........FILE *stream.......... - inport int portnum.C011xxxxxxxxG0110111 ..........FILE *stream.......... -outport int portnum.0101xxxxxxxxG0110111 ..........FILE *stream.......... - ioport int portnum.C111xxxxxxxxG0110111 ..........FILE *stream.......... -fport int portnum.C 00000000G0110111 ..........FILE *stream.......... -pipe int portnum.C 00000001G0110111 ..........FILE *stream.......... -strport 00000000000.0 00000010G0110111 ..........FILE *stream.......... -sfport int portnum.C 00000011G0110111 ..........FILE *stream.......... - SUBRs - spare 010001x1 - spare 010011x1 + 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)().......... @@ -6339,7 +6397,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 @@ -6664,12 +6722,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 `*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 `Init5e2.scm' which loads `Ifoo.scm' if your | + 8. put an `if' into `Init5e3.scm' which loads `Ifoo.scm' if your | package is included: (if (defined? twiddle-bits!) @@ -6969,7 +7027,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 "Init5e2_scm"), and the directory separator string | + (default "Init5e3_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. @@ -7072,7 +7130,7 @@ Here is a minimal embedding program `libtest.c': int main(argc, argv) int argc; - const char **argv; | + const char **argv; { SCM retval; char *implpath, *execpath; @@ -7092,7 +7150,7 @@ Here is a minimal embedding program `libtest.c': -| dld_find_executable(./libtest): /home/jaffer/scm/libtest - implpath: /home/jaffer/scm/Init5e2.scm | + implpath: /home/jaffer/scm/Init5e3.scm | This is libtest_init_user_scm hello world @@ -7108,7 +7166,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 - `Init5e2.scm'. | + `Init5e3.scm'. | -- Function: int scm_ldprog (char *FILE) Loads the Scheme source file `(in-vicinity (program-vicinity) @@ -7528,7 +7586,7 @@ File: scm.info, Node: Executable Pathname, Next: Script Support, Prev: File-S 6.3.2 Executable Pathname ------------------------- -For purposes of finding `Init5e2.scm', dumping an executable, and | +For purposes of finding `Init5e3.scm', dumping an executable, and | dynamic linking, a SCM session needs the pathname of its executable image. @@ -7547,7 +7605,7 @@ the full pathname for the associated executable file. for the first occurrence. Thus, it is advisable to invoke `dld_init' as: - main (int argc, const char **argv) | + main (int argc, const char **argv) { ... if (dld_init (dld_find_executable (argv[0]))) { @@ -7773,23 +7831,24 @@ with a VMS system needs to finish and debug it. File: scm.info, Node: Index, Prev: The Implementation, Up: Top -Procedure and Macro Index -************************* +Index | +***** | -This is an alphabetical list of all the procedures and macros in SCM. +Procedure and Macro Index | +========================= | * Menu: * #!: Unix Scheme Scripts. (line 40) * #': Common-Lisp Read Syntax. - (line 50) + (line 49) | * #+: Common-Lisp Read Syntax. (line 16) * #-: Common-Lisp Read Syntax. - (line 26) + (line 25) | * #.: Common-Lisp Read Syntax. - (line 39) + (line 38) | * #;text-till-end-of-line: Documentation and Comments. (line 31) * #?column: Load Syntax. (line 12) @@ -7798,76 +7857,58 @@ This is an alphabetical list of all the procedures and macros in SCM. * #\token: Common-Lisp Read Syntax. (line 7) * #|: Common-Lisp Read Syntax. - (line 29) -* $abs: Numeric. (line 38) -* $acos: Numeric. (line 45) -* $acosh: Numeric. (line 51) -* $asin: Numeric. (line 44) -* $asinh: Numeric. (line 50) -* $atan: Numeric. (line 46) -* $atan2: Numeric. (line 60) -* $atanh: Numeric. (line 52) -* $cos: Numeric. (line 42) -* $cosh: Numeric. (line 48) -* $exp: Numeric. (line 39) -* $expt: Numeric. (line 63) -* $log: Numeric. (line 40) -* $log10: Numeric. (line 57) -* $sin: Numeric. (line 41) -* $sinh: Numeric. (line 47) -* $sqrt: Numeric. (line 37) -* $tan: Numeric. (line 43) -* $tanh: Numeric. (line 49) + (line 28) | +* $atan2: Numeric. (line 59) | * -: SCM Options. (line 108) * ---: SCM Options. (line 109) -* ---c-source-files=: Build Options. (line 133) -* ---compiler-options=: Build Options. (line 118) -* ---defines=: Build Options. (line 111) -* ---features=: Build Options. (line 191) +* ---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 141) -* ---libraries=: Build Options. (line 103) -* ---linker-options=: Build Options. (line 121) +* ---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 137) -* ---outname=: Build Options. (line 97) +* ---object-files=: Build Options. (line 138) | +* ---outname=: Build Options. (line 98) | * ---platform=: Build Options. (line 12) -* ---scheme-initial=: Build Options. (line 125) -* ---type=: Build Options. (line 146) +* ---scheme-initial=: Build Options. (line 126) | +* ---type=: Build Options. (line 147) | * ---version: SCM Options. (line 23) -* --batch-dialect=: Build Options. (line 164) -* --script-name=: Build Options. (line 186) +* --batch-dialect=: Build Options. (line 165) | +* --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 132) +* -c: Build Options. (line 133) | * -d: SCM Options. (line 42) -* -D: Build Options. (line 110) +* -D: Build Options. (line 111) | * -e: SCM Options. (line 45) * -f: SCM Options. (line 37) -* -F: Build Options. (line 190) -* -f: Build Options. (line 68) +* -F: Build Options. (line 191) | +* -f: Build Options. (line 69) | * -h <1>: SCM Options. (line 33) -* -h: Build Options. (line 163) +* -h: Build Options. (line 164) | * -i <1>: SCM Options. (line 88) -* -i: Build Options. (line 140) -* -j: Build Options. (line 136) +* -i: Build Options. (line 141) | +* -j: Build Options. (line 137) | * -l <1>: SCM Options. (line 36) -* -l: Build Options. (line 102) +* -l: Build Options. (line 103) | * -m: SCM Options. (line 75) * -no-init-file: SCM Options. (line 16) * -o <1>: SCM Options. (line 52) -* -o: Build Options. (line 96) +* -o: Build Options. (line 97) | * -p <1>: SCM Options. (line 62) * -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 124) -* -t: Build Options. (line 145) +* -s: Build Options. (line 125) | +* -t: Build Options. (line 146) | * -u: SCM Options. (line 82) * -v: SCM Options. (line 66) -* -w: Build Options. (line 185) +* -w: Build Options. (line 186) | * @apply: Environment Frames. (line 54) * @copy-tree: Storage. (line 16) * @macroexpand1: Syntactic Hooks for Hygienic Macros. @@ -7918,7 +7959,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * CAR: Cells. (line 23) * cbreak: Terminal Mode Setting. (line 12) -* CCLO_LENGTH: Header Cells. (line 101) +* CCLO_LENGTH: Header Cells. (line 110) | * CDR: Cells. (line 24) * char: Type Conversions. (line 27) * char-ready: Port Properties. (line 39) @@ -7982,7 +8023,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * exec-self: Internal State. (line 27) * execl: I/O-Extensions. (line 207) * execlp: I/O-Extensions. (line 208) -* execpath: Internal State. (line 78) +* execpath: Internal State. (line 79) | * execv: I/O-Extensions. (line 218) * execvp: I/O-Extensions. (line 219) * exit: SCM Session. (line 19) @@ -8004,7 +8045,7 @@ This is an alphabetical list of all the procedures and macros in SCM. (line 10) * free_continuation: Continuations. (line 79) * freshline: Port Properties. (line 26) -* gc: Internal State. (line 57) +* gc: Internal State. (line 58) | * gc-hook: Storage. (line 28) * gc_mark: Marking Cells. (line 27) * GCCDR: Marking Cells. (line 15) @@ -8096,7 +8137,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * macroexpand-1: Defmacro. (line 6) * main: Embedding SCM. (line 12) * makargvfrmstrs: Type Conversions. (line 76) -* makcclo: Header Cells. (line 96) +* makcclo: Header Cells. (line 105) | * make-arbiter: Process Synchronization. (line 35) * make-edited-line-port: Line Editing. (line 29) @@ -8178,13 +8219,13 @@ This is an alphabetical list of all the procedures and macros in SCM. * port-type: Port Properties. (line 10) * PORTP: Ptob Cells. (line 33) * pp: Debugging Scheme Code. - (line 79) + (line 75) | * pprint: Debugging Scheme Code. - (line 66) + (line 62) | * print: Debugging Scheme Code. - (line 58) + (line 54) | * print-args: Debugging Scheme Code. - (line 84) + (line 80) | * procedure->identifier-macro: Macro Primitives. (line 14) * procedure->macro: Macro Primitives. (line 12) * procedure->memoizing-macro: Macro Primitives. (line 13) @@ -8207,6 +8248,23 @@ This is an alphabetical list of all the procedures and macros in SCM. (line 7) * readdir: I/O-Extensions. (line 92) * 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) | * record-printer-set!: Records. (line 10) * redirect-port!: I/O-Extensions. (line 83) * refresh: Window Manipulation. (line 29) @@ -8241,7 +8299,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * restore_signals: Embedding SCM. (line 90) * rewinddir: I/O-Extensions. (line 97) * rmdir: I/O-Extensions. (line 140) -* room: Internal State. (line 61) +* room: Internal State. (line 62) | * savetty: Terminal Mode Setting. (line 59) * scalar->array: Array Mapping. (line 51) @@ -8323,7 +8381,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * touchline: Window Manipulation. (line 55) * touchwin: Window Manipulation. (line 54) * trace: Debugging Scheme Code. - (line 41) + (line 37) | * transpose-array: Conventional Arrays. (line 21) * try-arbiter: Process Synchronization. (line 39) @@ -8343,7 +8401,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * uniform-array-read!: Uniform Array. (line 67) * uniform-array-write: Uniform Array. (line 79) * untrace: Debugging Scheme Code. - (line 49) + (line 45) | * user-interrupt: Interrupts. (line 49) * usr:lib: Dynamic Linking. (line 18) * utime: I/O-Extensions. (line 167) @@ -8378,9 +8436,7 @@ This is an alphabetical list of all the procedures and macros in SCM. * x:lib: Dynamic Linking. (line 23) Variable Index -************** - -This is an alphabetical list of all the global variables in SCM. +============== | * Menu: @@ -8392,7 +8448,7 @@ This is an alphabetical list of all the global variables in SCM. * *interactive*: SCM Variables. (line 36) * *load-pathname*: Eval and Load. (line 15) * *load-reader*: Line Numbers. (line 50) -* *scm-version*: Internal State. (line 66) +* *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. @@ -8425,9 +8481,7 @@ This is an alphabetical list of all the global variables in SCM. * UNSPECIFIED: Immediates. (line 78) Type Index -********** - -This is an alphabetical list of data types and feature names in SCM. +========== | * Menu: @@ -8485,39 +8539,40 @@ This is an alphabetical list of data types and feature names in SCM. * tc3_closure: Cells. (line 39) * tc3_cons: Cells. (line 32) * tc7_asubr: Subr Cells. (line 12) -* tc7_bvect: Header Cells. (line 55) -* tc7_contin: Header Cells. (line 76) -* tc7_cvect: Header Cells. (line 73) +* tc7_contin: Header Cells. (line 85) | * tc7_cxr: Subr Cells. (line 22) -* tc7_dvect: Header Cells. (line 70) -* tc7_fvect: Header Cells. (line 67) -* tc7_ivect: Header Cells. (line 58) -* tc7_lsubr: Subr Cells. (line 62) -* tc7_lsubr_2: Subr Cells. (line 59) +* tc7_lsubr: Subr Cells. (line 63) | +* tc7_lsubr_2: Subr Cells. (line 60) | * tc7_msymbol: Header Cells. (line 29) -* tc7_rpsubr: Subr Cells. (line 47) -* tc7_specfun: Header Cells. (line 79) +* 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 51) -* tc7_subr_2: Subr Cells. (line 44) -* tc7_subr_2o: Subr Cells. (line 55) -* tc7_subr_3: Subr Cells. (line 41) -* tc7_svect: Header Cells. (line 64) -* tc7_uvect: Header Cells. (line 61) +* 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) | * 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) - -This is an alphabetical list of concepts introduced in this manual. - + | Concept Index -************* +============= | * Menu: @@ -8531,29 +8586,32 @@ Concept Index * #!.bat: MS-DOS Compatible Scripts. (line 8) * array <1>: Conventional Arrays. (line 9) -* array: Build Options. (line 195) -* array-for-each: Build Options. (line 198) -* arrays: Build Options. (line 201) -* bignums: Build Options. (line 204) -* byte: Build Options. (line 207) +* 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) | * callbacks: Callbacks. (line 6) -* careful-interrupt-masking: Build Options. (line 210) -* cautious: Build Options. (line 216) -* cheap-continuations: Build Options. (line 225) -* compiled-closure: Build Options. (line 234) +* careful-interrupt-masking: Build Options. (line 211) | +* cautious: Build Options. (line 217) | +* cheap-continuations: Build Options. (line 226) | +* compiled-closure: Build Options. (line 235) | * continuations: Continuations. (line 6) -* curses: Build Options. (line 237) -* debug: Build Options. (line 240) -* differ: Build Options. (line 245) +* curses: Build Options. (line 238) | +* debug: Build Options. (line 241) | +* differ: Build Options. (line 246) | * documentation string: Documentation and Comments. (line 13) -* dump: Build Options. (line 248) -* dynamic-linking: Build Options. (line 251) +* dont-memoize-locals: Build Options. (line 249) | +* dump: Build Options. (line 254) | +* dynamic-linking: Build Options. (line 257) | * ecache: Memory Management for Environments. (line 6) -* edit-line: Build Options. (line 254) +* edit-line: Build Options. (line 260) | * Embedding SCM: Embedding SCM. (line 6) -* engineering-notation: Build Options. (line 257) +* engineering-notation: Build Options. (line 263) | * environments: Memory Management for Environments. (line 6) * exchanger: Process Synchronization. @@ -8563,187 +8621,186 @@ Concept Index (line 13) * foo.c: Compiling and Linking Custom Files. (line 13) -* generalized-c-arguments: Build Options. (line 262) +* generalized-c-arguments: Build Options. (line 268) | * graphics: Packages. (line 23) * hobbit: Packages. (line 23) -* i/o-extensions: Build Options. (line 265) +* i/o-extensions: Build Options. (line 271) | * IEEE: Bibliography. (line 7) -* inexact: Build Options. (line 269) +* inexact: Build Options. (line 275) | * JACAL: Bibliography. (line 49) -* lit: Build Options. (line 272) -* macro: Build Options. (line 275) +* lit: Build Options. (line 278) | +* macro: Build Options. (line 281) | * memory management: Memory Management for Environments. (line 6) -* mysql: Build Options. (line 279) -* no-heap-shrink: Build Options. (line 282) +* mysql: Build Options. (line 285) | +* no-heap-shrink: Build Options. (line 288) | * NO_ENV_CACHE: Memory Management for Environments. (line 89) -* none: Build Options. (line 287) +* none: Build Options. (line 293) | * posix: Posix Extensions. (line 6) * Posix: Posix Extensions. (line 6) -* posix: Build Options. (line 290) +* posix: Build Options. (line 296) | * R4RS: Bibliography. (line 11) * R5RS: Bibliography. (line 18) -* reckless: Build Options. (line 295) -* record: Build Options. (line 300) -* regex: Build Options. (line 304) -* rev2-procedures: Build Options. (line 307) +* reckless: Build Options. (line 301) | +* record: Build Options. (line 306) | +* regex: Build Options. (line 310) | +* rev2-procedures: Build Options. (line 313) | * rope <1>: Type Conversions. (line 6) * rope: Callbacks. (line 6) * SchemePrimer: Bibliography. (line 39) -* SICP: Build Options. (line 313) -* sicp: Build Options. (line 311) +* SICP: Build Options. (line 319) | +* sicp: Build Options. (line 317) | * SICP: Bibliography. (line 30) * signals: Signals. (line 6) * Simply: Bibliography. (line 35) -* single-precision-only: Build Options. (line 325) +* single-precision-only: Build Options. (line 331) | * SLIB: Bibliography. (line 43) -* socket: Build Options. (line 331) -* stack-limit: Build Options. (line 335) -* tick-interrupts: Build Options. (line 342) -* turtlegr: Build Options. (line 345) +* socket: Build Options. (line 337) | +* tick-interrupts: Build Options. (line 341) | +* turtlegr: Build Options. (line 344) | * unix: Unix Extensions. (line 6) * Unix: Unix Extensions. (line 6) -* unix: Build Options. (line 349) -* wb: Build Options. (line 353) -* windows: Build Options. (line 356) +* unix: Build Options. (line 348) | +* wb: Build Options. (line 352) | +* windows: Build Options. (line 355) | * X: Packages. (line 23) * x <1>: Packages. (line 23) -* x: Build Options. (line 359) +* x: Build Options. (line 358) | * xlib: Packages. (line 23) * Xlib: Packages. (line 23) -* xlib: Build Options. (line 362) +* xlib: Build Options. (line 361) | * xlibscm: Packages. (line 23) * Xlibscm: Packages. (line 23) Tag Table: -Node: Top203 -Node: Overview1498 -Node: SCM Features1813 -Node: SCM Authors3833 -Node: Copying4734 -Node: The SCM License5063 -Node: SIOD copyright8987 -Node: Bibliography10340 -Node: Installing SCM12216 -Node: Making SCM12735 -Node: SLIB13660 -Node: Building SCM15576 -Node: Invoking Build16158 -Node: Build Options18495 -Node: Compiling and Linking Custom Files31870 -Node: Installing Dynamic Linking33866 -Node: Configure Module Catalog35652 -Node: Saving Images37660 -Node: Automatic C Preprocessor Definitions38343 -Node: Problems Compiling42241 -Node: Problems Linking43902 -Node: Problems Running44175 -Node: Testing46293 -Node: Reporting Problems49437 -Node: Operational Features50289 -Node: Invoking SCM50685 -Node: SCM Options52339 -Node: Invocation Examples56708 -Node: SCM Variables57668 -Node: SCM Session59148 -Node: Editing Scheme Code60679 -Node: Debugging Scheme Code62697 -Node: Debugging Continuations67109 -Node: Errors69669 -Node: Memoized Expressions73987 -Node: Internal State76351 -Node: Scripting79518 -Node: Unix Scheme Scripts79822 -Node: MS-DOS Compatible Scripts82854 -Node: Unix Shell Scripts84709 -Node: The Language86850 -Node: Standards Compliance87472 -Node: Storage89895 -Node: Time92375 -Node: Interrupts93391 -Node: Process Synchronization97024 -Node: Files and Ports98553 -Node: Opening and Closing98894 -Node: Port Properties101385 -Node: Port Redirection104071 -Node: Soft Ports105563 -Node: Eval and Load107345 -Node: Line Numbers108761 -Node: Lexical Conventions111184 -Node: Common-Lisp Read Syntax111446 -Node: Load Syntax113473 -Node: Documentation and Comments114093 -Node: Modifying Read Syntax115317 -Node: Syntax117040 -Node: Define and Set117944 -Node: Defmacro121478 -Node: Syntax-Rules122558 -Node: Macro Primitives124364 -Node: Environment Frames126003 -Node: Syntactic Hooks for Hygienic Macros128423 -Node: Packages135397 -Node: Dynamic Linking136277 -Node: Dump140961 -Node: Numeric144982 -Node: Arrays146748 -Node: Conventional Arrays146966 -Node: Uniform Array150505 -Node: Bit Vectors155317 -Node: Array Mapping156625 -Node: Records159319 -Node: I/O-Extensions160191 -Node: Posix Extensions168823 -Node: Unix Extensions178375 -Node: Sequence Comparison180276 -Node: Regular Expression Pattern Matching180606 -Node: Line Editing184584 -Node: Curses185945 -Node: Output Options Setting186880 -Node: Terminal Mode Setting189547 -Node: Window Manipulation192648 -Node: Output196133 -Node: Input199785 -Node: Curses Miscellany200829 -Node: Sockets202270 -Node: Host and Other Inquiries202633 -Node: Internet Addresses and Socket Names205774 -Node: Socket207347 -Node: SCMDB214580 -Node: The Implementation214818 -Node: Data Types215081 -Node: Immediates215910 -Node: Cells220292 -Node: Header Cells222410 -Node: Subr Cells225492 -Node: Ptob Cells227733 -Node: Smob Cells229302 -Node: Data Type Representations232510 -Node: Operations237171 -Node: Garbage Collection237765 -Node: Marking Cells238398 -Node: Sweeping the Heap240520 -Node: Memory Management for Environments241482 -Node: Signals246051 -Node: C Macros247612 -Node: Changing Scm248749 -Node: Defining Subrs253210 -Node: Defining Smobs255070 -Node: Defining Ptobs258127 -Node: Allocating memory259316 -Node: Embedding SCM261646 -Node: Callbacks269411 -Node: Type Conversions271232 -Node: Continuations275281 -Node: Evaluation279519 -Node: Program Self-Knowledge284702 -Node: File-System Habitat284956 -Node: Executable Pathname288569 -Node: Script Support290242 -Node: Improvements To Make291577 -Node: VMS Dynamic Linking293795 -Node: Index298508 +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 End Tag Table @@ -1,5 +1,5 @@ %define name scm -%define version 5e2 +%define version 5e3 %define release 1 %define implpath %{prefix}/lib/scm %define slibpath %{prefix}/lib/slib @@ -10,15 +10,15 @@ Name: %{name} Release: %{release} Version: %{version} -Packager: Radey Shouman <shouman@ne.mediaone.net> +Packager: Aubrey Jaffer <agj @ alum.mit.edu> -Copyright: GPL +License: GPL Vendor: Aubrey Jaffer <agj @ alum.mit.edu> Group: Development/Languages Provides: scm Requires: slib -Summary: SCM Scheme implementation. +Summary: SCM Scheme implementation Source: ftp://swiss.csail.mit.edu/pub/scm/scm%{version}.zip URL: http://swiss.csail.mit.edu/~jaffer/SCM BuildRoot: %{_tmppath}/%{name}%{version} @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename scm.info -@settitle SCM +@settitle scm @include version.txi @setchapternewpage on @c Choices for setchapternewpage are {on,off,odd}. @@ -10,6 +10,31 @@ @syncodeindex ft tp @c %**end of header +@copying +@noindent +This manual is for SCM (version @value{SCMVERSION}, @value{SCMDATE}), +and algorithmic language Scheme implementation. + +@noindent +Copyright @copyright{} 1990-2006 Free Software Foundation, Inc. + +@quotation +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. +@end quotation +@end copying + @dircategory The Algorithmic Language Scheme @direntry * SCM: (scm). A Scheme interpreter. @@ -26,61 +51,19 @@ @title SCM @subtitle Scheme Implementation @subtitle Version @value{SCMVERSION} -@author by Aubrey Jaffer - +@author Aubrey Jaffer @page @vskip 0pt plus 1filll -Copyright @copyright{} 1990-1999 Free Software Foundation - -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. +@insertcopying @end titlepage -@node Top, Overview, (dir), (dir) - - -@ifinfo -This manual documents the SCM Scheme implementation. SCM version -@value{SCMVERSION} was released @value{SCMDATE}. The most recent -information about SCM can be found on SCM's @dfn{WWW} home page: - -@center @url{http://swiss.csail.mit.edu/~jaffer/SCM} - - -Copyright (C) 1990-1999 Free Software Foundation - -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. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +@contents -@end ignore -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. +@ifnottex +@node Top, Overview, (dir), (dir) +@top SCM -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. -@end ifinfo +@insertcopying @menu * Overview:: @@ -91,6 +74,7 @@ by the author. * The Implementation:: How it works. * Index:: @end menu +@end ifnottex @node Overview, Installing SCM, Top, Top @chapter Overview @@ -150,7 +134,7 @@ and @code{eval}. @item @code{Char-code-limit}, @code{most-positive-fixnum}, @code{most-negative-fixnum}, @code{and internal-time-units-per-second} -constants. @code{*Features*} and @code{*load-pathname*} variables. +constants. @code{slib:features} and @code{*load-pathname*} variables. @item Arrays and bit-vectors. String ports and software emulation ports. I/O extensions providing ANSI C and POSIX.1 facilities. @@ -293,7 +277,7 @@ OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @subsection SIOD copyright @sp 1 -@center COPYRIGHT (c) 1989 BY +@center COPYRIGHT @copyright{} 1989 BY @center PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS. @center ALL RIGHTS RESERVED @@ -533,34 +517,34 @@ low priority. SLIB is available from the same sites as SCM: @ifclear html @itemize @bullet @item -swiss.csail.mit.edu:/pub/scm/slib3a3.tar.gz +swiss.csail.mit.edu:/pub/scm/slib3a4.tar.gz @item -ftp.gnu.org:/pub/gnu/jacal/slib3a3.tar.gz +ftp.gnu.org:/pub/gnu/jacal/slib3a4.tar.gz @item -ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a3.tar.gz +ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a4.tar.gz @end itemize @end ifclear @ifset html @itemize @bullet @item -<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib3a3.zip"> -http://swiss.csail.mit.edu/ftpdir/scm/slib3a3.zip +<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib3a4.zip"> +http://swiss.csail.mit.edu/ftpdir/scm/slib3a4.zip </A> @item -<A HREF="ftp://ftp.gnu.org/pub/gnu/jacal/slib3a3.tar.gz"> -ftp.gnu.org:/pub/gnu/jacal/slib3a3.tar.gz +<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/slib3a3.tar.gz"> -ftp.cs.indiana.edu:/pub/scheme-repository/code/lib/slib3a3.tar.gz +<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> @end itemize @end ifset @noindent -Unpack SLIB (@samp{tar xzf slib3a3.tar.gz} or @samp{unzip -ao -slib3a3.zip}) in an appropriate directory for your system; both +Unpack SLIB (@samp{tar xzf slib3a4.tar.gz} or @samp{unzip -ao +slib3a4.zip}) in an appropriate directory for your system; both @code{tar} and @code{unzip} will create the directory @file{slib}. @noindent @@ -598,6 +582,8 @@ absolute pathnames are recommended. @node Building SCM, Installing Dynamic Linking, SLIB, Installing SCM @section Building SCM +@cindex build +@cindex build.scm The file @dfn{build} loads the file @dfn{build.scm}, which constructs a relational database of how to compile and link SCM executables. @file{build.scm} has information for the platforms which SCM has been @@ -1022,20 +1008,51 @@ Remember to delete the file @file{slibcat} after modifying the file @node Saving Images, Automatic C Preprocessor Definitions, Configure Module Catalog, Installing SCM @section Saving Images -@noindent In SCM, the ability to save running program images is called @dfn{dump} (@pxref{Dump}). In order to make @code{dump} available to SCM, build with feature @samp{dump}. @code{dump}ed executables are compatible with dynamic linking. -@noindent Most of the code for @dfn{dump} is taken from @file{emacs-19.34/src/unex*.c}. No modifications to the emacs source code were required to use @file{unexelf.c}. Dump has not been ported to all platforms. If @file{unexec.c} or @file{unexelf.c} don't work for you, try using the appropriate @file{unex*.c} file from emacs. +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: + +@table @asis +@item Fedora-Core-1 +Remove the @samp{#} from the line @samp{#SETARCH = setarch i386} in +the @file{Makefile}. + +@item Fedora-Core-3 +@url{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 @file{udscm5.opt}: +@samp{--linker-options="-z nocombreloc"} + +@item Kernels later than 2.6.11 +@url{http://www.opensubscriber.com/message/emacs-devel@@gnu.org/1007118.html} +mentions the @dfn{exec-shield} feature. Kernels later than 2.6.11 +must do (as root): + +@example +echo 0 > /proc/sys/kernel/randomize_va_space +@end example + +before dumping. @file{Makefile} has this @file{randomize_va_space} +stuffing scripted for targets @samp{dscm4} and @samp{dscm5}. You must +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 @@ -1298,8 +1315,10 @@ tracking effects of changes to SCM on performance. @tab Check character defines in @file{scmfig.h}. @item Negative numbers turn positive. @tab Check SRS in @file{scmfig.h}. +@item ;ERROR: bignum: numerical overflow +@tab Increase NUMDIGS_MAX in @file{scmfig.h} and recompile. @item VMS: Couldn't unwind stack. -@tab @t{#define CHEAP_CONTIUATIONS} in @file{scmfig.h}. +@tab @t{#define CHEAP_CONTINUATIONS} in @file{scmfig.h}. @item VAX: botched longjmp. @end multitable @@ -1391,10 +1410,11 @@ compile parameter @var{IMPLINIT} (defined in the makefile or @noindent Unless the option @code{-no-init-file} or @code{--no-init-file} occurs -in the command line, @file{Init@value{SCMVERSION}.scm} checks to see if -there is file @file{ScmInit.scm} in the path specified by the -environment variable @var{HOME} (or in the current directory if -@var{HOME} is undefined). If it finds such a file it is loaded. +in the command line, or if @code{scm} is being invoked as a script, +@file{Init@value{SCMVERSION}.scm} checks to see if there is file +@file{ScmInit.scm} in the path specified by the environment variable +@var{HOME} (or in the current directory if @var{HOME} is undefined). +If it finds such a file, then it is loaded. @noindent @file{Init@value{SCMVERSION}.scm} then looks for command input from one @@ -1721,8 +1741,8 @@ After editing, the modified file will be loaded. @section Debugging Scheme Code @noindent -The @code{cautious} and @code{stack-limit} options of @code{build} -(@pxref{Build Options}) support debugging in Scheme. +The @code{cautious} option of @code{build} +(@pxref{Build Options}) supports debugging in Scheme. @table @dfn @item CAUTIOUS @@ -1742,18 +1762,14 @@ 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 procedures, and continue execution with @code{(continue)}. - -@item STACK_LIMIT -If SCM is built with the @samp{STACK_LIMIT} flag, the interpreter will -check stack size periodically. If the size of stack exceeds a certain -amount (default is @code{HEAP_SEG_SIZE/2}), SCM generates a -@code{segment violation} interrupt. - -The usefulness of @samp{STACK_LIMIT} depends on the user. I don't use -it; but the user I added this feature for got primarily this type of -error. @end table +If @code{verbose} (@pxref{Internal State, verbose}) 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 +@code{STACK_LIMIT} (default is @code{HEAP_SEG_SIZE}), SCM generates a +@samp{stack} @code{segment violation}. + @noindent There are several SLIB macros which so useful that SCM automatically loads the appropriate module from SLIB if they are invoked. @@ -2191,7 +2207,8 @@ a prompt is printed. messages bracketing file loading are printed. @item >= 3 the CPU time is printed after each top level form evaluated; -notifications of heap growth printed. +notifications of heap growth printed; the interpreter checks stack +depth periodically. @item >= 4 a garbage collection summary is printed after each top level form evaluated; @@ -3240,14 +3257,13 @@ combined. @end deffn @deffn {Read syntax} #+ feature form -If feature is @code{provided?} (by @code{*features*}) then @var{form} is -read as a scheme expression. If not, then @var{form} is treated as -whitespace. +If feature is @code{provided?} then @var{form} is read as a scheme +expression. If not, then @var{form} is treated as whitespace. Feature is a boolean expression composed of symbols and @code{and}, @code{or}, and @code{not} of boolean expressions. -For more information on @code{provided?} and @code{*features*}, +For more information on @code{provided?}, @xref{Require, , , slib, SLIB}. @end deffn @@ -4230,29 +4246,28 @@ Return the hyperbolic sine, cosine, and tangent of @var{z} Return the inverse hyperbolic sine, cosine, and tangent of @var{z} @end defun -@defun $sqrt x -@defunx $abs x -@defunx $exp x -@defunx $log x -@defunx $sin x -@defunx $cos x -@defunx $tan x -@defunx $asin x -@defunx $acos x -@defunx $atan x - -@defunx $sinh x -@defunx $cosh x -@defunx $tanh x -@defunx $asinh x -@defunx $acosh x -@defunx $atanh x +@defun real-sqrt x +@defunx real-exp x +@defunx real-ln x +@defunx real-sin x +@defunx real-cos x +@defunx real-tan x +@defunx real-asin x +@defunx real-acos x +@defunx real-atan x + +@defunx real-sinh x +@defunx real-cosh x +@defunx real-tanh x +@defunx real-asinh x +@defunx real-acosh x +@defunx real-atanh x Real-only versions of these popular functions. The argument @var{x} must be a real number. It is an error if the value which should be returned by a call to these procedures is @emph{not} real. @end defun -@defun $log10 x +@defun real-log10 x Real-only base 10 logarithm. @end defun @@ -4261,9 +4276,9 @@ Computes @code{(angle (make-rectangular x y))} for real numbers @var{y} and @var{x}. @end defun -@defun $expt x1 x2 +@defun real-expt x1 x2 Returns real number @var{x1} raised to the real power @var{x2}. It is -an error if the value which should be returned by a call to @code{$expt} +an error if the value which should be returned by a call to @code{real-expt} is not real. @end defun @@ -6602,31 +6617,43 @@ the elements of string @var{x} or its length, respectively. @end defmac @end deftp -@deftp Header tc7_bvect +@deftp Header tc7_Vbool uniform vector of booleans (bit-vector) @end deftp -@deftp Header tc7_ivect +@deftp Header tc7_VfixZ32 uniform vector of integers @end deftp -@deftp Header tc7_uvect +@deftp Header tc7_VfixN32 uniform vector of non-negative integers @end deftp -@deftp Header tc7_svect +@deftp Header tc7_VfixN16 +uniform vector of non-negative short integers +@end deftp + +@deftp Header tc7_VfixZ16 uniform vector of short integers @end deftp -@deftp Header tc7_fvect +@deftp Header tc7_VfixN8 +uniform vector of non-negative bytes +@end deftp + +@deftp Header tc7_VfixZ8 +uniform vector of signed bytes +@end deftp + +@deftp Header tc7_VfloR32 uniform vector of short inexact real numbers @end deftp -@deftp Header tc7_dvect +@deftp Header tc7_VfloR64 uniform vector of double precision inexact real numbers @end deftp -@deftp Header tc7_cvect +@deftp Header tc7_VfloC64 uniform vector of double precision inexact complex numbers @end deftp @@ -6692,10 +6719,10 @@ These subrs are handled specially. If inexact numbers are enabled, the @code{double}. Conversions are handled in the interpreter. @code{floor}, @code{ceiling}, @code{truncate}, @code{round}, -@code{$sqrt}, @code{$abs}, @code{$exp}, @code{$log}, @code{$sin}, -@code{$cos}, @code{$tan}, @code{$asin}, @code{$acos}, @code{$atan}, -@code{$sinh}, @code{$cosh}, @code{$tanh}, @code{$asinh}, @code{$acosh}, -@code{$atanh}, and @code{exact->inexact} are defined this way. +@code{real-sqrt}, @code{real-exp}, @code{real-ln}, @code{real-sin}, +@code{real-cos}, @code{real-tan}, @code{real-asin}, @code{real-acos}, @code{real-atan}, +@code{real-sinh}, @code{real-cosh}, @code{real-tanh}, @code{real-asinh}, @code{real-acosh}, +@code{real-atanh}, and @code{exact->inexact} are defined this way. If the @code{CDR} is @code{0} (@code{NULL}), the name string of the procedure is used to control traversal of its list structure argument. @@ -6914,8 +6941,8 @@ as elements @pxref{Conventional Arrays}) and uniform arrays (those with elements of a uniform type @pxref{Uniform Array}). Conventional Arrays have a pointer to a vector for their @code{CDR}. -Uniform Arrays have a pointer to a Uniform Vector type (string, bvect, -ivect, uvect, fvect, dvect, or cvect) in their @code{CDR}. +Uniform Arrays have a pointer to a Uniform Vector type (string, Vbool, +VfixZ32, VfixN32, VfloR32, VfloR64, or VfloC64) in their @code{CDR}. @end deftp @@ -6945,33 +6972,35 @@ ssymbol .........long length....G0000101 ..........char *chars........... msymbol .........long length....G0000111 ..........char *chars........... string .........long length....G0001101 ..........char *chars........... vector .........long length....G0001111 ...........SCM **elts........... -bvect .........long length....G0010101 ..........long *words........... - spare G0010111 -ivect .........long length....G0011101 ..........long *words........... -uvect .........long length....G0011111 ......unsigned long *words...... - spare G0100101 -svect .........long length....G0100111 ........ short *words........... -fvect .........long length....G0101101 .........float *words........... -dvect .........long length....G0101111 ........double *words........... -cvect .........long length....G0110101 ........double *words........... - -contin .........long length....G0111101 .............*regs.............. -specfun ................xxxxxxxxG1111111 ...........SCM name............. -cclo ..short length..xxxxxx10G1111111 ...........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...........} @r{ PTOBs@:} -@t{ port int portnum.CwroxxxxxxxxG0110111 ..........FILE *stream.......... - socket int portnum.C001xxxxxxxxG0110111 ..........FILE *stream.......... - inport int portnum.C011xxxxxxxxG0110111 ..........FILE *stream.......... -outport int portnum.0101xxxxxxxxG0110111 ..........FILE *stream.......... - ioport int portnum.C111xxxxxxxxG0110111 ..........FILE *stream.......... -fport int portnum.C 00000000G0110111 ..........FILE *stream.......... -pipe int portnum.C 00000001G0110111 ..........FILE *stream.......... -strport 00000000000.0 00000010G0110111 ..........FILE *stream.......... -sfport int portnum.C 00000011G0110111 ..........FILE *stream..........} +@t{ 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..........} @r{ SUBRs@:} -@t{ spare 010001x1 - spare 010011x1 -subr_0 ..........int hpoff.....01010101 ...........SCM (*f)()........... +@t{subr_0 ..........int hpoff.....01010101 ...........SCM (*f)()........... subr_1 ..........int hpoff.....01010111 ...........SCM (*f)()........... cxr ..........int hpoff.....01011101 .........double (*f)().......... subr_3 ..........int hpoff.....01011111 ...........SCM (*f)()........... @@ -7066,7 +7095,7 @@ unmarked, gc_mark sets the mark bit in @var{obj}, then calls @code{gc_mark()} is tail-called (looped). @end deftypefun -@deftypefun void mark_locations (STACKITEM @var{x}[], sizet @var{len})) +@deftypefun void mark_locations (STACKITEM @var{x}[], sizet @var{len}) The function @code{mark_locations} is used for marking segments of C-stack or saved segments of C-stack (marked continuations). The argument @var{len} is the size of the stack in units of size @@ -7424,7 +7453,7 @@ add_feature("@i{foo}"); @end example will append a symbol @code{'@i{foo}} to the (list) value of -@code{*features*}. +@code{slib:features}. @item put any scheme code which needs to be run as part of your package into @file{I@i{foo}.scm}. @@ -8637,33 +8666,10 @@ that have been linked against it. @end enumerate - +@ifinfo @node Index, , The Implementation, Top -@c @node Procedure and Macro Index, Variable Index, The Implementation, Top -@unnumbered Procedure and Macro Index - -This is an alphabetical list of all the procedures and macros in SCM. - -@printindex fn - -@c @node Variable Index, Type Index, Procedure and Macro Index, Top -@unnumbered Variable Index - -This is an alphabetical list of all the global variables in SCM. - -@printindex vr - -@c @node Type Index, , Variable Index, Top -@unnumbered Type Index - -This is an alphabetical list of data types and feature names in SCM. - -@printindex tp - -This is an alphabetical list of concepts introduced in this manual. - -@unnumbered Concept Index -@printindex cp +@unnumbered Index +@end ifinfo -@contents +@include indexes.texi @bye @@ -122,8 +122,6 @@ rgx.c init_rgx(); regcomp and regexec. */ /* #define CAUTIOUS */ -/* #define STACK_LIMIT (HEAP_SEG_SIZE/2) */ - /* #define BIGNUMS */ /* #define ARRAYS */ @@ -192,7 +190,6 @@ rgx.c init_rgx(); regcomp and regexec. */ /* Define GC_FREE_SEGMENTS if you want segments of unused heap to be freed up after garbage collection. Don't define it if you never want the heap to shrink. */ - #ifndef DONT_GC_FREE_SEGMENTS # define GC_FREE_SEGMENTS #endif @@ -200,8 +197,10 @@ rgx.c init_rgx(); regcomp and regexec. */ /* MEMOIZE_LOCALS means to convert references to local variables to ILOCs, (relative lexical addresses into the environment). This memoization makes evaluated Scheme code harder to read, so you may want to undefine - this flag for debugging -- but SCM will run 3 to 5 times slower */ -#define MEMOIZE_LOCALS + this flag for debugging -- but SCM will run 3 to 6 times slower */ +#ifndef DONT_MEMOIZE_LOCALS +# define MEMOIZE_LOCALS +#endif /* #define CHEAP_CONTINUATIONS */ @@ -281,7 +280,7 @@ rgx.c init_rgx(); regcomp and regexec. */ #ifdef __alpha # define SHORT_INT #endif -#ifdef __ia64 +#ifdef __ia64__ # define SHORT_INT # define CDR_DOUBLES #endif @@ -521,12 +520,12 @@ extern ints_infot *ints_info; # endif #endif -#ifdef STACK_LIMIT -# define CHECK_STACK {stack_check();} -#else -# define CHECK_STACK /**/ +#ifndef STACK_LIMIT +# define STACK_LIMIT (HEAP_SEG_SIZE) #endif +#define CHECK_STACK {if (2 < scm_verbose) stack_check();} + /* Cray machines have pointers that are incremented once for each word, rather than each byte, the 3 most significant bits encode the byte within the word. The following macros deal with this by storing the diff --git a/setjump.mar b/setjump.mar index 2b49243..3fc223c 100644 --- a/setjump.mar +++ b/setjump.mar @@ -1,10 +1,11 @@ .title setjump and longjump -; The VAX C runtime library uses the $unwind utility for implementing -; longjmp. That fails if your program do not follow normal -; stack decipline. This is a dirty implementation of setjmp -; and longjmp that does not have that problem. -; the names longjmp and setjmp are avoided so that the code can be linked -; with the vax c runtime library without name clashes. + +; The VAX C runtime library uses the $unwind utility for +; implementing longjmp. That fails if your program does not +; follow normal stack decipline. This is a dirty implementation +; of setjmp and longjmp that does not have that problem. The +; names longjmp and setjmp are avoided so that the code can be +; linked with the vax c runtime library without name clashes. ; This code was contributed by an anonymous reviewer from ; comp.sources.reviewed. @@ -1745,13 +1745,14 @@ SCM make_vector(k, fill) return v; } #ifdef BIGDIG +char s_big_OVFLOW[] = "numerical overflow; NUMDIGS_MAX <"; char s_bignum[] = "bignum"; SCM mkbig(nlen, sign) sizet nlen; int sign; { SCM v; - if (NUMDIGS_MAX <= nlen) wta(MAKINUM(nlen), (char *)NALLOC, s_bignum); + if (NUMDIGS_MAX <= nlen) wta(MAKINUM(nlen), s_big_OVFLOW, s_bignum); DEFER_INTS; v = must_malloc_cell((0L+nlen)*sizeof(BIGDIG), MAKE_NUMDIGS(nlen, sign ? tc16_bigneg : tc16_bigpos), @@ -1779,7 +1780,7 @@ SCM adjbig(b, nlen) { long nsiz = nlen; if (((nsiz << 16) >> 16) != nlen) - wta(MAKINUM(nsiz), (char *)NALLOC, s_adjbig); + wta(MAKINUM(nsiz), s_big_OVFLOW, s_adjbig); DEFER_INTS; must_realloc_cell(b, (long)(NUMDIGS(b)*sizeof(BIGDIG)), (long)(nsiz*sizeof(BIGDIG)), s_adjbig); @@ -50,7 +50,7 @@ # include <io.h> #endif -void igc P((const char *what, STACKITEM *stackbase)); +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; @@ -1264,7 +1264,7 @@ static char *igc_for_alloc(where, olen, size, what) /* Check to see that heap is initialized */ ASRTER(heap_cells > 0, MAKINUM(size), NALLOC, what); /* printf("igc_for_alloc(%lx, %lu, %u, %s)\n", where, olen, size, what); fflush(stdout); */ - igc(what, CONT(rootcont)->stkbse); + igc(what, rootcont); nm = mallocated + size - olen; if (nm > mltrigger) { if (nm > mtrigger) grew_lim(nm + nm/2); @@ -1574,22 +1574,21 @@ SCM makcclo(proc, len) } #endif -#ifdef STACK_LIMIT void stack_check() { STACKITEM *start = CONT(rootcont)->stkbse; STACKITEM stack; -# ifdef STACK_GROWS_UP +#ifdef STACK_GROWS_UP if (&stack - start > STACK_LIMIT/sizeof(STACKITEM)) -# else +#else if (start - &stack > STACK_LIMIT/sizeof(STACKITEM)) -# endif /* def STACK_GROWS_UP */ +#endif /* def STACK_GROWS_UP */ { stack_report(); wta(UNDEFINED, (char *)SEGV_SIGNAL, "stack"); } } -#endif + void stack_report() { STACKITEM stack; @@ -2029,7 +2028,7 @@ SCM scm_port_entry(stream, ptype, flags) } } else { - igc(s_port_table, CONT(rootcont)->stkbse); + igc(s_port_table, rootcont); for (i = 0; i < scm_port_table_len; i++) if (0L==scm_port_table[i].flags) goto ret; wta(UNDEFINED, s_nogrow, s_port_table); @@ -2249,7 +2248,7 @@ SCM gc_for_newcell() SCM fl; int oints = ints_disabled; /* Temporary expedient */ if (!oints) ints_disabled = 1; - igc(s_cells, CONT(rootcont)->stkbse); + igc(s_cells, rootcont); if ((gc_cells_collected < MIN_GC_YIELD) || IMP(freelist)) { alloc_some_heap(); growth_mon(s_numheaps, (long)(hplim_ind/2), s_segs, !0); @@ -2264,13 +2263,13 @@ SCM gc_for_newcell() void gc_for_open_files() { - igc("open files", CONT(rootcont)->stkbse); + igc("open files", rootcont); } void scm_fill_freelist() { while IMP(freelist) { - igc(s_cells, CONT(rootcont)->stkbse); + igc(s_cells, rootcont); if ((gc_cells_collected < MIN_GC_YIELD) || IMP(freelist)) { alloc_some_heap(); growth_mon(s_numheaps, (long)(hplim_ind/2), s_segs, !0); @@ -2280,7 +2279,6 @@ void scm_fill_freelist() } static char s_bad_type[] = "unknown type in "; -jump_buf save_regs_gc_mark; void mark_locations P((STACKITEM x[], sizet n)); static void mark_syms P((SCM v)); static void mark_sym_values P((SCM v)); @@ -2297,7 +2295,7 @@ SCM gc(arg) { DEFER_INTS; if (UNBNDP(arg)) - igc("call", CONT(rootcont)->stkbse); + igc("call", rootcont); else scm_egc(); ALLOW_INTS; @@ -2346,12 +2344,13 @@ void scm_gc_hook () gc_hook_active = 0; } -void igc(what, stackbase) +void igc(what, basecont) const char *what; - STACKITEM *stackbase; + SCM basecont; { int j = num_protects; long oheap_cells = heap_cells; + STACKITEM * stackbase = IMP(basecont) ? 0 : CONT(basecont)->stkbse; #ifdef DEBUG_GMALLOC int err = check_frag_blocks(); if (err) wta(MAKINUM(err), "malloc corrupted", what); @@ -2373,6 +2372,10 @@ void igc(what, stackbase) mark_subrs(); egc_mark(); if (stackbase) { +#ifdef __ia64__ + mark_regs_ia64(CONT(basecont)); +#else + jump_buf save_regs_gc_mark; FLUSH_REGISTER_WINDOWS; /* This assumes that all registers are saved into the jump_buf */ setjump(save_regs_gc_mark); @@ -2382,22 +2385,23 @@ void igc(what, stackbase) { /* stack_len is long rather than sizet in order to guarantee that &stack_len is long aligned */ -#ifdef STACK_GROWS_UP -# ifdef nosve +# ifdef STACK_GROWS_UP +# ifdef nosve long stack_len = (STACKITEM *)(&stack_len) - stackbase; -# else +# else long stack_len = stack_size(stackbase); -# endif +# endif mark_locations(stackbase, (sizet)stack_len); -#else -# ifdef nosve - long stack_len = stackbase - (STACKITEM *)(&stack_len); # else +# ifdef nosve + long stack_len = stackbase - (STACKITEM *)(&stack_len); +# else long stack_len = stack_size(stackbase); -# endif +# endif mark_locations((stackbase - stack_len), (sizet)stack_len); -#endif +# endif } +#endif } while(j--) gc_mark(sys_protects[j]); @@ -2556,13 +2560,12 @@ void gc_mark(p) ASRTER(!(CHARS(ptr)[HUGE_LENGTH(ptr)]), MAKINUM(HUGE_LENGTH(ptr)), s_wrong_length, s_gc); case tc7_ssymbol: - case tc7_bvect: - case tc7_ivect: - case tc7_uvect: - case tc7_svect: - case tc7_fvect: - case tc7_dvect: - case tc7_cvect: + case tc7_Vbool: + case tc7_VfixZ32: case tc7_VfixN32: + case tc7_VfixZ16: case tc7_VfixN16: + case tc7_VfixN8: case tc7_VfixZ8: + case tc7_VfloR32: case tc7_VfloC32: + case tc7_VfloR64: case tc7_VfloC64: SETGC8MARK(ptr); case tcs_subrs: break; @@ -2679,28 +2682,38 @@ static void gc_sweep(contin_bad) must_free(CHARS(scmptr), minc); /* SETCHARS(scmptr, 0);*/ break; - case tc7_bvect: + case tc7_Vbool: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = sizeof(long)*((HUGE_LENGTH(scmptr)+LONG_BIT-1)/LONG_BIT); goto freechars; - case tc7_ivect: - case tc7_uvect: + case tc7_VfixZ32: + case tc7_VfixN32: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = HUGE_LENGTH(scmptr)*sizeof(long); goto freechars; - case tc7_svect: + case tc7_VfixN8: + case tc7_VfixZ8: + if (GC8MARKP(scmptr)) goto c8mrkcontinue; + minc = HUGE_LENGTH(scmptr)*sizeof(char); + goto freechars; + case tc7_VfixZ16: + case tc7_VfixN16: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = HUGE_LENGTH(scmptr)*sizeof(short); goto freechars; - case tc7_fvect: + case tc7_VfloR32: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = HUGE_LENGTH(scmptr)*sizeof(float); goto freechars; - case tc7_dvect: + case tc7_VfloC32: + if (GC8MARKP(scmptr)) goto c8mrkcontinue; + minc = HUGE_LENGTH(scmptr)*2*sizeof(float); + goto freechars; + case tc7_VfloR64: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = HUGE_LENGTH(scmptr)*sizeof(double); goto freechars; - case tc7_cvect: + case tc7_VfloC64: if (GC8MARKP(scmptr)) goto c8mrkcontinue; minc = HUGE_LENGTH(scmptr)*2*sizeof(double); goto freechars; @@ -3144,7 +3157,7 @@ void scm_egc() /* We need to make sure there are enough cells available to migrate the entire environment cache, gc does not work properly during ecache gc */ while (egc_need_gc()) { - igc("ecache", CONT(rootcont)->stkbse); + igc("ecache", rootcont); if ((gc_cells_collected < MIN_GC_YIELD) || (heap_cells - cells_allocated <= scm_ecache_len) || IMP(freelist)) { alloc_some_heap(); @@ -101,6 +101,9 @@ # include <sys/types.h> # include <sys/time.h> # include <sys/timeb.h> +# include <sys/times.h> +# include <unistd.h> +# define CLKTCK (sysconf(_SC_CLK_TCK)) # define USE_GETTIMEOFDAY #endif #ifdef __MACH__ @@ -153,8 +156,8 @@ # define LACK_FTIME #endif #ifdef PLAN9 -#define LACK_FTIME -#define LACK_TIMES +# define LACK_FTIME +# define LACK_TIMES #endif #ifdef nosve # define LACK_FTIME @@ -219,30 +222,32 @@ # define LACK_FTIME #endif -#ifdef CLK_TCK -# define CLKTCK CLK_TCK -# ifdef CLOCKS_PER_SEC -# ifdef HAVE_UNIX -# ifndef ARM_ULIB -# include <sys/times.h> -# endif -# define LACK_CLOCK +#ifndef CLKTCK +# ifdef CLK_TCK +# define CLKTCK CLK_TCK +# ifdef CLOCKS_PER_SEC +# ifdef HAVE_UNIX +# ifndef ARM_ULIB +# include <sys/times.h> +# endif +# define LACK_CLOCK /* This is because clock() might be POSIX rather than ANSI. This occurs on HP-UX machines */ +# endif # endif -# endif -#else -# ifdef CLOCKS_PER_SEC -# define CLKTCK CLOCKS_PER_SEC # else -# define LACK_CLOCK -# ifdef AMIGA -# include <stddef.h> -# define LACK_TIMES -# define LACK_FTIME -# define CLKTCK 1000 +# ifdef CLOCKS_PER_SEC +# define CLKTCK CLOCKS_PER_SEC # else -# define CLKTCK 60 +# define LACK_CLOCK +# ifdef AMIGA +# include <stddef.h> +# define LACK_TIMES +# define LACK_FTIME +# define CLKTCK 1000 +# else +# define CLKTCK 60 +# endif # endif # endif #endif diff --git a/ugsetjump.s b/ugsetjump.s new file mode 100644 index 0000000..e9e29f4 --- /dev/null +++ b/ugsetjump.s @@ -0,0 +1,35 @@ +#NO_APP +.text + .align 1 +.globl _setjump +_setjump: + .word 0x0 + movl 4(ap),r0 + movq r2,(r0)+ + movq r4,(r0)+ + movq r6,(r0)+ + movq r8,(r0)+ + movq r10,(r0)+ + movl fp,(r0)+ + movo 4(fp),(r0)+ + movq 20(fp),(r0) + clrl r0 + ret + ret + .align 1 +.globl _longjump +_longjump: + .word 0x0 + movl 4(ap),r0 + movq (r0)+,r2 + movq (r0)+,r4 + movq (r0)+,r6 + movq (r0)+,r8 + movq (r0)+,r10 + movl (r0)+,r1 + movo (r0)+,4(r1) + movq (r0),20(r1) + movl 8(ap),r0 + movl r1,fp + ret + ret @@ -45,12 +45,13 @@ The set of uniform vector types is: Vector of: Called: char string -boolean bvect -signed int ivect -unsigned int uvect -float fvect -double dvect -complex double cvect +boolean Vbool +signed int VfixZ32 +unsigned int VfixN32 +float VfloR32 +complex float VfloC32 +double VfloR64 +complex double VfloC64 */ #include "scm.h" @@ -85,24 +86,32 @@ SCM resizuve(vect, len) sz = sizeof(SCM); break; #ifdef ARRAYS - case tc7_bvect: + case tc7_Vbool: ol = (ol+LONG_BIT-1)/LONG_BIT; l = (l+LONG_BIT-1)/LONG_BIT; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: sz = sizeof(long); break; - case tc7_svect: + case tc7_VfixN16: + case tc7_VfixZ16: sz = sizeof(short); break; + case tc7_VfixN8: + case tc7_VfixZ8: + sz = sizeof(char); + break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: sz = sizeof(float); break; - case tc7_dvect: + case tc7_VfloC32: + sz = 2*sizeof(float); + break; + case tc7_VfloR64: sz = sizeof(double); break; - case tc7_cvect: + case tc7_VfloC64: sz = 2*sizeof(double); break; # endif @@ -150,24 +159,24 @@ long scm_prot2type(prot) { if (ICHRP(prot)) return tc7_string; switch (prot) { - case BOOL_T: return tc7_bvect; - case MAKINUM(8L): - case MAKINUM(16L): - case MAKINUM(32L): return tc7_uvect; - case MAKINUM(-32L): return tc7_ivect; - case MAKINUM(-16L): return tc7_svect; - case MAKINUM(-8L): return tc7_svect; - } - /* if (INUMP(prot)) return INUM(prot) > 0 ? tc7_uvect : tc7_ivect; */ + case BOOL_T: return tc7_Vbool; + case MAKINUM(8L): return tc7_VfixN8; + case MAKINUM(16L): return tc7_VfixN16; + case MAKINUM(32L): return tc7_VfixN32; + case MAKINUM(-32L): return tc7_VfixZ32; + case MAKINUM(-16L): return tc7_VfixZ16; + case MAKINUM(-8L): return tc7_VfixZ8; + } + /* if (INUMP(prot)) return INUM(prot) > 0 ? tc7_VfixN32 : tc7_VfixZ32; */ if (IMP(prot)) return tc7_vector; # ifdef FLOATS if (INEXP(prot)) { double x; - if (CPLXP(prot)) return tc7_cvect; + if (CPLXP(prot)) return (32.0==IMAG(prot)) ? tc7_VfloC32 : tc7_VfloC64; x = REALPART(prot); - if (32.0==x) return tc7_fvect; - if (64.0==x) return tc7_dvect; - return tc7_dvect; + if (32.0==x) return tc7_VfloR32; + if (64.0==x) return tc7_VfloR64; + return tc7_VfloR64; } # endif return tc7_vector; @@ -184,26 +193,35 @@ SCM make_uve(k, prot) default: case tc7_vector: /* Huge non-unif vectors are NOT supported. */ return make_vector(MAKINUM(k), UNDEFINED); /* no special vector */ - case tc7_bvect: + case tc7_Vbool: i = sizeof(long)*((k+LONG_BIT-1)/LONG_BIT); break; case tc7_string: i = sizeof(char)*(k + 1); break; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: i = sizeof(long)*k; break; - case tc7_svect: + case tc7_VfixN16: + case tc7_VfixZ16: i = sizeof(short)*k; + break; + case tc7_VfixN8: + case tc7_VfixZ8: + i = sizeof(char)*k; + break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: i = sizeof(float)*k; break; - case tc7_dvect: + case tc7_VfloC32: + i = 2*sizeof(float)*k; + break; + case tc7_VfloR64: i = sizeof(double)*k; break; - case tc7_cvect: + case tc7_VfloC64: i = 2*sizeof(double)*k; break; # endif @@ -232,14 +250,18 @@ SCM arrayp(v, prot) if (enclosed++) return BOOL_F; v = ARRAY_V(v); goto loop; - case tc7_bvect: + case tc7_Vbool: case tc7_string: - case tc7_uvect: - case tc7_ivect: - case tc7_svect: - case tc7_fvect: - case tc7_dvect: - case tc7_cvect: + case tc7_VfixN32: + case tc7_VfixZ32: + case tc7_VfixN16: + case tc7_VfixZ16: + case tc7_VfixN8: + case tc7_VfixZ8: + case tc7_VfloR32: + case tc7_VfloC32: + case tc7_VfloR64: + case tc7_VfloC64: case tc7_vector: if (UNBNDP(prot)) return BOOL_T; if (scm_prot2type(prot)==typ) return BOOL_T; @@ -399,7 +421,7 @@ int rafill(ra, fill, ignore) ve[i] = f; break; } - case tc7_bvect: { + case tc7_Vbool: { long *ve = (long *)VELTS(ra); if (1==inc && (n >= LONG_BIT || n==LENGTH(ra))) { i = base/LONG_BIT; @@ -432,11 +454,11 @@ int rafill(ra, fill, ignore) } break; } - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: { long *ve = VELTS(ra); - long f = (tc7_uvect==TYP7(ra) ? + long f = (tc7_VfixN32==TYP7(ra) ? num2ulong(fill, (char *)ARG2, s_array_fill) : num2long(fill, (char *)ARG2, s_array_fill)); for (i = base; n--; i += inc) @@ -444,21 +466,36 @@ int rafill(ra, fill, ignore) break; } # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *ve = (float *)VELTS(ra); float f = num2dbl(fill, (char *)ARG2, s_array_fill); for (i = base; n--; i += inc) ve[i] = f; break; } - case tc7_dvect: { + case tc7_VfloC32: { + float fr, fi=0.0; + float (*ve)[2] = (float (*)[2])VELTS(ra); + if (NIMP(fill) && CPLXP(fill)) { + fr = REAL(fill); + fi = IMAG(fill); + } + else + fr = num2dbl(fill, (char *)ARG2, s_array_fill); + for (i = base; n--; i += inc) { + ve[i][0] = fr; + ve[i][1] = fi; + } + break; + } + case tc7_VfloR64: { double *ve = (double *)VELTS(ra); double f = num2dbl(fill, (char *)ARG2, s_array_fill); for (i = base; n--; i += inc) ve[i] = f; break; } - case tc7_cvect: { + case tc7_VfloC64: { double fr, fi=0.0; double (*ve)[2] = (double (*)[2])VELTS(ra); if (NIMP(fill) && CPLXP(fill)) { @@ -515,11 +552,12 @@ SCM dims2ura(dims, prot, fill) switch TYP7(make_uve(0L, prot)) { default: bit = LONG_BIT; break; case tc7_vector: wta(dims, (char *)OUTOFRANGE, s_dims2ura); - case tc7_bvect: bit = 1; break; + case tc7_Vbool: bit = 1; break; case tc7_string: bit = CHAR_BIT; break; - case tc7_fvect: bit = sizeof(float)*CHAR_BIT/sizeof(char); break; - case tc7_dvect: bit = sizeof(double)*CHAR_BIT/sizeof(char); break; - case tc7_cvect: bit = 2*sizeof(double)*CHAR_BIT/sizeof(char); break; + case tc7_VfloR32: bit = sizeof(float)*CHAR_BIT/sizeof(char); break; + case tc7_VfloC32: bit = 2*sizeof(float)*CHAR_BIT/sizeof(char); break; + case tc7_VfloR64: bit = sizeof(double)*CHAR_BIT/sizeof(char); break; + case tc7_VfloC64: bit = 2*sizeof(double)*CHAR_BIT/sizeof(char); break; } ARRAY_BASE(ra) = (LONG_BIT + bit - 1)/bit; rlen += ARRAY_BASE(ra); @@ -859,30 +897,39 @@ SCM aref(v, args) } return res; } - case tc7_bvect: + case tc7_Vbool: if (VELTS(v)[pos/LONG_BIT]&(1L<<(pos%LONG_BIT))) return BOOL_T; else return BOOL_F; case tc7_string: return MAKICHR(CHARS(v)[pos]); - case tc7_svect: + case tc7_VfixN8: + return MAKINUM(((unsigned char *)CDR(v))[pos]); + case tc7_VfixZ8: + return MAKINUM(((signed char *)CDR(v))[pos]); + case tc7_VfixN16: + return MAKINUM(((unsigned short *)CDR(v))[pos]); + case tc7_VfixZ16: return MAKINUM(((short *)CDR(v))[pos]); # ifdef INUMS_ONLY - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: return MAKINUM(VELTS(v)[pos]); # else - case tc7_uvect: + case tc7_VfixN32: return ulong2num(VELTS(v)[pos]); - case tc7_ivect: + case tc7_VfixZ32: return long2num(VELTS(v)[pos]); # endif # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: return makflo(((float *)CDR(v))[pos]); - case tc7_dvect: + case tc7_VfloC32: + return makdbl(((float *)CDR(v))[2*pos], + ((float *)CDR(v))[2*pos+1]); + case tc7_VfloR64: return makdbl(((double *)CDR(v))[pos], 0.0); - case tc7_cvect: + case tc7_VfloC64: return makdbl(((double *)CDR(v))[2*pos], ((double *)CDR(v))[2*pos+1]); # endif @@ -906,26 +953,58 @@ SCM cvref(v, pos, last) { switch TYP7(v) { default: wta(v, (char *)ARG1, "PROGRAMMING ERROR: cvref"); - case tc7_bvect: + case tc7_smob: { /* enclosed array */ + int k = ARRAY_NDIM(v); + if (IMP(last) || (!ARRAYP(last))) { + last = make_ra(k); + ARRAY_V(last) = ARRAY_V(v); + ARRAY_BASE(last) = pos; + while (k--) { + ARRAY_DIMS(last)[k].ubnd = ARRAY_DIMS(v)[k].ubnd; + ARRAY_DIMS(last)[k].lbnd = ARRAY_DIMS(v)[k].lbnd; + ARRAY_DIMS(last)[k].inc = ARRAY_DIMS(v)[k].inc; + } + } + return last; + } + case tc7_Vbool: if (VELTS(v)[pos/LONG_BIT]&(1L<<(pos%LONG_BIT))) return BOOL_T; else return BOOL_F; case tc7_string: return MAKICHR(CHARS(v)[pos]); - case tc7_svect: + case tc7_VfixN8: + return MAKINUM(((unsigned char *)CDR(v))[pos]); + case tc7_VfixZ8: + return MAKINUM(((signed char *)CDR(v))[pos]); + case tc7_VfixN16: + return MAKINUM(((unsigned short *)CDR(v))[pos]); + case tc7_VfixZ16: return MAKINUM(((short *)CDR(v))[pos]); # ifdef INUMS_ONLY - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: return MAKINUM(VELTS(v)[pos]); # else - case tc7_uvect: + case tc7_VfixN32: return ulong2num(VELTS(v)[pos]); - case tc7_ivect: + case tc7_VfixZ32: return long2num(VELTS(v)[pos]); # endif # ifdef FLOATS - case tc7_fvect: + case tc7_VfloC32: + if (0.0 != ((float *)CDR(v))[2*pos+1]) { + if (NIMP(last) && tc_dblc==CAR(last)) { + REAL(last) = ((float *)CDR(v))[2*pos]; + IMAG(last) = ((float *)CDR(v))[2*pos+1]; + return last; + } + return makdbl(((float *)CDR(v))[2*pos], + ((float *)CDR(v))[2*pos+1]); + } + else pos *= 2; + /* Fall through */ + case tc7_VfloR32: # ifdef SINGLES if (NIMP(last) && (last != flo0) && (tc_flo==CAR(last))) { FLO(last) = ((float *)CDR(v))[pos]; @@ -939,7 +1018,7 @@ SCM cvref(v, pos, last) } return makdbl((double)((float *)CDR(v))[pos], 0.0); # endif - case tc7_cvect: + case tc7_VfloC64: if (0.0!=((double *)CDR(v))[2*pos+1]) { if (NIMP(last) && tc_dblc==CAR(last)) { REAL(last) = ((double *)CDR(v))[2*pos]; @@ -951,7 +1030,7 @@ SCM cvref(v, pos, last) } else pos *= 2; /* Fall through */ - case tc7_dvect: + case tc7_VfloR64: # ifdef CDR_DOUBLES if (NIMP(last) && (last != flo0) && (tc_flo==CAR(last))) { FLO(last) = ((double *)CDR(v))[pos]; @@ -961,31 +1040,17 @@ SCM cvref(v, pos, last) # ifdef SINGLES if (NIMP(last) && tc_dblr==CAR(last)) # else - if (NIMP(last) && (last != flo0) && (tc_dblr==CAR(last))) + if (NIMP(last) && (last != flo0) && (tc_dblr==CAR(last))) # endif - { - REAL(last) = ((double *)CDR(v))[pos]; - return last; - } + { + REAL(last) = ((double *)CDR(v))[pos]; + return last; + } # endif /* ndef CDR_DOUBLES */ return makdbl(((double *)CDR(v))[pos], 0.0); # endif /* def FLOATS */ case tc7_vector: return VELTS(v)[pos]; - case tc7_smob: { /* enclosed array */ - int k = ARRAY_NDIM(v); - if (IMP(last) || (!ARRAYP(last))) { - last = make_ra(k); - ARRAY_V(last) = ARRAY_V(v); - while (k--) { - ARRAY_DIMS(last)[k].ubnd = ARRAY_DIMS(v)[k].ubnd; - ARRAY_DIMS(last)[k].lbnd = ARRAY_DIMS(v)[k].lbnd; - ARRAY_DIMS(last)[k].inc = ARRAY_DIMS(v)[k].inc; - } - } - ARRAY_BASE(last) = pos; - return last; - } } } @@ -1017,7 +1082,7 @@ SCM aset(v, obj, args) wna: wta(UNDEFINED, (char *)WNA, s_aset); case tc7_smob: /* enclosed */ goto badarg1; - case tc7_bvect: + case tc7_Vbool: if (BOOL_F==obj) VELTS(v)[pos/LONG_BIT] &= ~(1L<<(pos%LONG_BIT)); else if (BOOL_T==obj) @@ -1027,25 +1092,41 @@ SCM aset(v, obj, args) case tc7_string: ASRTGO(ICHRP(obj), badarg2); CHARS(v)[pos] = ICHR(obj); break; - case tc7_svect: + case tc7_VfixN8: + ((unsigned char *)VELTS(v))[pos] = num2uchar(obj, (char *)ARG2, s_aset); break; + case tc7_VfixZ8: + ((signed char *)VELTS(v))[pos] = num2char(obj, (char *)ARG2, s_aset); break; + case tc7_VfixN16: + ((unsigned short *)VELTS(v))[pos] = num2ushort(obj, (char *)ARG2, s_aset); break; + case tc7_VfixZ16: ((short *)VELTS(v))[pos] = num2short(obj, (char *)ARG2, s_aset); break; # ifdef INUMS_ONLY - case tc7_uvect: + case tc7_VfixN32: ASRTGO(INUM(obj) >= 0, badarg2); - case tc7_ivect: + case tc7_VfixZ32: ASRTGO(INUMP(obj), badarg2); VELTS(v)[pos] = INUM(obj); break; # else - case tc7_uvect: + case tc7_VfixN32: VELTS(v)[pos] = num2ulong(obj, (char *)ARG2, s_aset); break; - case tc7_ivect: + case tc7_VfixZ32: VELTS(v)[pos] = num2long(obj, (char *)ARG2, s_aset); break; # endif # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: ((float*)VELTS(v))[pos] = (float)num2dbl(obj, (char *)ARG2, s_aset); break; - case tc7_dvect: + case tc7_VfloC32: + if (NIMP(obj) && CPLXP(obj)) { + ((float *)CDR(v))[2*pos] = REALPART(obj); + ((float *)CDR(v))[2*pos+1] = IMAG(obj); + } + else { + ((float *)CDR(v))[2*pos] = num2dbl(obj, (char *)ARG2, s_aset); + ((float *)CDR(v))[2*pos+1] = 0.0; + } + break; + case tc7_VfloR64: ((double*)VELTS(v))[pos] = num2dbl(obj, (char *)ARG2, s_aset); break; - case tc7_cvect: + case tc7_VfloC64: if (NIMP(obj) && CPLXP(obj)) { ((double *)CDR(v))[2*pos] = REALPART(obj); ((double *)CDR(v))[2*pos+1] = IMAG(obj); @@ -1081,7 +1162,7 @@ SCM array_contents(ra, strict) len *= ARRAY_DIMS(ra)[k].ubnd - ARRAY_DIMS(ra)[k].lbnd + 1; if (!UNBNDP(strict)) { if (ndim && (1 != ARRAY_DIMS(ra)[ndim-1].inc)) return BOOL_F; - if (tc7_bvect==TYP7(ARRAY_V(ra))) { + if (tc7_Vbool==TYP7(ARRAY_V(ra))) { if (ARRAY_BASE(ra)%LONG_BIT) return BOOL_F; if (len != LENGTH(ARRAY_V(ra)) && len%LONG_BIT) return BOOL_F; } @@ -1127,24 +1208,32 @@ SCM uve_read(v, port) case tc7_string: sz = sizeof(char); break; - case tc7_bvect: + case tc7_Vbool: len = (len+LONG_BIT-1)/LONG_BIT; start /= LONG_BIT; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: sz = sizeof(long); break; - case tc7_svect: + case tc7_VfixN16: + case tc7_VfixZ16: sz = sizeof(short); break; + case tc7_VfixN8: + case tc7_VfixZ8: + sz = sizeof(char); + break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: sz = sizeof(float); break; - case tc7_dvect: + case tc7_VfloC32: + sz = 2*sizeof(float); + break; + case tc7_VfloR64: sz = sizeof(double); break; - case tc7_cvect: + case tc7_VfloC64: sz = 2*sizeof(double); break; # endif @@ -1160,7 +1249,7 @@ SCM uve_read(v, port) len -= 1; } SYSCALL(ans = fread(CHARS(v)+start*sz, (sizet)sz, (sizet)len, STREAM(port));); - if (TYP7(v)==tc7_bvect) ans *= LONG_BIT; + if (TYP7(v)==tc7_Vbool) ans *= LONG_BIT; return MAKINUM(ans); } @@ -1192,30 +1281,38 @@ SCM uve_write(v, port) case tc7_string: sz = sizeof(char); break; - case tc7_bvect: + case tc7_Vbool: len = (len+LONG_BIT-1)/LONG_BIT; start /= LONG_BIT; - case tc7_uvect: - case tc7_ivect: + case tc7_VfixN32: + case tc7_VfixZ32: sz = sizeof(long); break; - case tc7_svect: + case tc7_VfixN16: + case tc7_VfixZ16: sz = sizeof(short); break; + case tc7_VfixN8: + case tc7_VfixZ8: + sz = sizeof(char); + break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: sz = sizeof(float); break; - case tc7_dvect: + case tc7_VfloC32: + sz = 2*sizeof(float); + break; + case tc7_VfloR64: sz = sizeof(double); break; - case tc7_cvect: + case tc7_VfloC64: sz = 2*sizeof(double); break; # endif } ans = lfwrite(CHARS(v)+start*sz, (sizet)sz, (sizet)len, port); - if (TYP7(v)==tc7_bvect) ans *= LONG_BIT; + if (TYP7(v)==tc7_Vbool) ans *= LONG_BIT; return MAKINUM(ans); } @@ -1232,7 +1329,7 @@ SCM lcount(item, seq) tail: switch TYP7(seq) { default: badarg2: wta(seq, (char *)ARG2, s_count); - case tc7_bvect: + case tc7_Vbool: if (lbnd>ubnd) return INUM0; i = ubnd/LONG_BIT; imin = lbnd/LONG_BIT; @@ -1293,7 +1390,7 @@ SCM bit_position(item, v, k) tail: switch TYP7(v) { default: badarg2: wta(v, (char *)ARG2, s_uve_pos); - case tc7_bvect: + case tc7_Vbool: ASRTER((pos <= len) && (pos >= 0), k, OUTOFRANGE, s_uve_pos); if (pos==len) return BOOL_F; if (0==len) return MAKINUM(-1L); @@ -1358,10 +1455,10 @@ SCM bit_set(v, kv, obj) ASRTGO(NIMP(kv), badarg2); switch TYP7(kv) { default: badarg2: wta(kv, (char *)ARG2, s_bit_set); - case tc7_uvect: + case tc7_VfixN32: switch TYP7(v) { default: badarg1: wta(v, (char *)ARG1, s_bit_set); - case tc7_bvect: + case tc7_Vbool: vlen = LENGTH(v); if (BOOL_F==obj) for (i = LENGTH(kv);i;) { k = VELTS(kv)[--i]; @@ -1377,8 +1474,8 @@ SCM bit_set(v, kv, obj) badarg3: wta(obj, (char *)ARG3, s_bit_set); } break; - case tc7_bvect: - ASRTGO(TYP7(v)==tc7_bvect && LENGTH(v)==LENGTH(kv), badarg1); + case tc7_Vbool: + ASRTGO(TYP7(v)==tc7_Vbool && LENGTH(v)==LENGTH(kv), badarg1); if (BOOL_F==obj) for (k = (LENGTH(v)+LONG_BIT-1)/LONG_BIT;k--;) VELTS(v)[k] &= ~(VELTS(kv)[k]); @@ -1401,10 +1498,10 @@ SCM bit_count(v, kv, obj) ASRTGO(NIMP(kv), badarg2); switch TYP7(kv) { default: badarg2: wta(kv, (char *)ARG2, s_bit_count); - case tc7_uvect: + case tc7_VfixN32: switch TYP7(v) { default: badarg1: wta(v, (char *)ARG1, s_bit_count); - case tc7_bvect: + case tc7_Vbool: vlen = LENGTH(v); if (BOOL_F==obj) for (i = LENGTH(kv);i;) { k = VELTS(kv)[--i]; @@ -1420,8 +1517,8 @@ SCM bit_count(v, kv, obj) badarg3: wta(obj, (char *)ARG3, s_bit_count); } break; - case tc7_bvect: - ASRTGO(TYP7(v)==tc7_bvect && LENGTH(v)==LENGTH(kv), badarg1); + case tc7_Vbool: + ASRTGO(TYP7(v)==tc7_Vbool && LENGTH(v)==LENGTH(kv), badarg1); if (0==LENGTH(v)) return INUM0; ASRTGO(BOOL_T==obj || BOOL_F==obj, badarg3); obj = (BOOL_T==obj); @@ -1445,7 +1542,7 @@ SCM bit_inv(v) ASRTGO(NIMP(v), badarg1); k = LENGTH(v); switch TYP7(v) { - case tc7_bvect: + case tc7_Vbool: for (k = (k+LONG_BIT-1)/LONG_BIT;k--;) VELTS(v)[k] = ~VELTS(v)[k]; break; @@ -1585,7 +1682,7 @@ SCM array2list(v) return ra2l(v, ARRAY_BASE(v), 0); case tc7_vector: return vector2list(v); case tc7_string: return string2list(v); - case tc7_bvect: { + case tc7_Vbool: { long *data = (long *)VELTS(v); register unsigned long mask; for (k = (LENGTH(v)-1)/LONG_BIT; k > 0; k--) @@ -1596,21 +1693,21 @@ SCM array2list(v) return res; } # ifdef INUMS_ONLY - case tc7_uvect: - case tc7_ivect: { + case tc7_VfixN32: + case tc7_VfixZ32: { long *data = (long *)VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(MAKINUM(data[k]), res); return res; } # else - case tc7_uvect: { + case tc7_VfixN32: { long *data = (long *)VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(ulong2num(data[k]), res); return res; } - case tc7_ivect: { + case tc7_VfixZ32: { long *data = (long *)VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(long2num(data[k]), res); @@ -1618,19 +1715,25 @@ SCM array2list(v) } # endif # ifdef FLOATS - case tc7_fvect: { + case tc7_VfloR32: { float *data = (float *)VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(makflo(data[k]), res); return res; } - case tc7_dvect: { + case tc7_VfloC32: { + float (*data)[2] = (float (*)[2])VELTS(v); + for (k = LENGTH(v) - 1; k >= 0; k--) + res = cons(makdbl(data[k][0], data[k][1]), res); + return res; + } + case tc7_VfloR64: { double *data = (double *)VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(makdbl(data[k], 0.0), res); return res; } - case tc7_cvect: { + case tc7_VfloC64: { double (*data)[2] = (double (*)[2])VELTS(v); for (k = LENGTH(v) - 1; k >= 0; k--) res = cons(makdbl(data[k][0], data[k][1]), res); @@ -1772,9 +1875,9 @@ static void rapr1(ra, j, k, port, writing) for (j += inc; n-- > 0; j += inc) lputc(CHARS(ra)[j], port); break; - case tc7_uvect: + case tc7_VfixN32: if (errjmp_bad) { - ipruk("uvect", ra, port); + ipruk("VfixN32", ra, port); break; } if (n-- > 0) intprint(VELTS(ra)[j], -10, port); @@ -1783,7 +1886,7 @@ static void rapr1(ra, j, k, port, writing) intprint(VELTS(ra)[j], -10, port); } break; - case tc7_ivect: + case tc7_VfixZ32: if (n-- > 0) intprint(VELTS(ra)[j], 10, port); for (j += inc; n-- > 0; j += inc) { lputc(' ', port); @@ -1791,9 +1894,10 @@ static void rapr1(ra, j, k, port, writing) } break; # ifdef FLOATS - case tc7_fvect: - case tc7_dvect: - case tc7_cvect: + case tc7_VfloR32: + case tc7_VfloC32: + case tc7_VfloR64: + case tc7_VfloC64: if (n-- > 0) { SCM z = cvref(ra, j, UNDEFINED); floprint(z, port, writing); @@ -1832,7 +1936,7 @@ int raprin1(exp, port, writing) goto tail; } } - case tc7_bvect: + case tc7_Vbool: if (exp==v) { /* a uve, not an array */ register long i, j, w; lputc('*', port); @@ -1856,24 +1960,32 @@ int raprin1(exp, port, writing) default: if (exp==v) lputc('1', port); switch TYP7(v) { - case tc7_bvect: + case tc7_Vbool: lputs("A:bool", port); break; case tc7_vector: lputc('A', port); break; case tc7_string: lputs("A:char", port); break; - case tc7_uvect: + case tc7_VfixN32: lputs("A:fixN32b", port); break; - case tc7_ivect: + case tc7_VfixZ32: lputs("A:fixZ32b", port); break; - case tc7_svect: + case tc7_VfixN16: + lputs("A:fixN16b", port); break; + case tc7_VfixZ16: lputs("A:fixZ16b", port); break; + case tc7_VfixN8: + lputs("A:fixN8b", port); break; + case tc7_VfixZ8: + lputs("A:fixZ8b", port); break; # ifdef FLOATS - case tc7_fvect: + case tc7_VfloR32: lputs("A:floR32b", port); break; - case tc7_dvect: + case tc7_VfloC32: + lputs("A:floC32b", port); break; + case tc7_VfloR64: lputs("A:floR64b", port); break; - case tc7_cvect: + case tc7_VfloC64: lputs("A:floC64b", port); break; # endif /*FLOATS*/ } @@ -1904,15 +2016,19 @@ SCM array_prot(ra) ra = ARRAY_V(ra); goto loop; case tc7_vector: return EOL; - case tc7_bvect: return BOOL_T; + case tc7_Vbool: return BOOL_T; case tc7_string: return MAKICHR('a'); - case tc7_uvect: return MAKINUM(32L); - case tc7_ivect: return MAKINUM(-32L); - case tc7_svect: return MAKINUM(-16L); + case tc7_VfixN32: return MAKINUM(32L); + case tc7_VfixZ32: return MAKINUM(-32L); + case tc7_VfixN16: return MAKINUM(16L); + case tc7_VfixZ16: return MAKINUM(-16L); + case tc7_VfixN8: return MAKINUM(8L); + case tc7_VfixZ8: return MAKINUM(-8L); # ifdef FLOATS - case tc7_fvect: return makflo(32.0); - case tc7_dvect: return makdbl(64.0, 0.0); - case tc7_cvect: return makdbl(0.0, 64.0); + case tc7_VfloR32: return makflo(32.0); + case tc7_VfloC32: return makdbl(0.0, 32.0); + case tc7_VfloR64: return makdbl(64.0, 0.0); + case tc7_VfloC64: return makdbl(0.0, 64.0); # endif } } diff --git a/version.txi b/version.txi index 00ff734..4f3847d 100644 --- a/version.txi +++ b/version.txi @@ -1,2 +1,2 @@ -@set SCMVERSION 5e2 -@set SCMDATE February 2006 +@set SCMVERSION 5e3 +@set SCMDATE October 2006 @@ -675,12 +675,12 @@ void scm2XPoint(signp, dat, ipr, pos, s_caller) x = VELTS(dat)[0]; y = VELTS(dat)[1]; break; - case tc7_uvect: case tc7_ivect: + case tc7_VfixN32: case tc7_VfixZ32: ASRTGO(2==LENGTH(dat), badarg); x = MAKINUM(((long *)VELTS(dat))[0]); y = MAKINUM(((long *)VELTS(dat))[1]); break; - case tc7_svect: + case tc7_VfixZ16: ASRTGO(2==LENGTH(dat), badarg); x = MAKINUM(((short *)VELTS(dat))[0]); y = MAKINUM(((short *)VELTS(dat))[1]); @@ -742,7 +742,7 @@ int scm2xpointslen(sara, s_caller) if (!((1==(adm[1].ubnd - adm[1].lbnd)) && (1==adm[1].inc) && ARRAY_CONTP(sara) - && (tc7_svect==TYP7(ARRAY_V(sara))))) return -1; + && (tc7_VfixZ16==TYP7(ARRAY_V(sara))))) return -1; len = 1 + adm[0].ubnd - adm[0].lbnd; if (len < 0) return 0; return len; @@ -1337,7 +1337,7 @@ SCM x_free_color_cells(scmap, spxls, sargs) unsigned int planes = 0; ASRTER(NIMP(scmap) && COLORMAPP(scmap), scmap, ARG1, s_x_free_color_cells); xcm = COLORMAP(scmap); - ASRTER(NIMP(spxls) && (TYP7(spxls)==tc7_uvect), spxls, ARG2, + ASRTER(NIMP(spxls) && (TYP7(spxls)==tc7_VfixN32), spxls, ARG2, s_x_free_color_cells); switch (ilength(sargs) + 2) { default: wta(sargs, (char *)WNA, s_x_free_color_cells); |