Added "See file COPYING." to all the copyright notices, so we can
do the open-source thing w/o larding up the source code.
This commit is contained in:
parent
442db87f66
commit
7e1ad158c7
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; AIX version by Chipsy Sperber
|
||||
|
||||
(define errno/2big 7) ; 2big is not a legit Scheme symbol. Lose, lose.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; AIX version by Chipsy Sperber
|
||||
|
||||
(define-enum-constants open
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Interfaces and packages for the machine specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; AIX version by Chipsy Sperber
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for AIX
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; AIX version by Chipsy Sperber
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for AIX 3.2.x,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; An awk loop, after the design of David Albertz and Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This uses the new RX SRE syntax. Defines a Clinger-Rees expander for
|
||||
;;; the old, pre-SRE syntax AWK, and one for the new SRE-syntax AWK.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1995 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are the correct values for BSD4.4-Lite-based systems
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom
|
||||
|
||||
(define-enum-constants open
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Interfaces and packages for the BSD4.4-Lite specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-interface bsd44lite-fdflags-extras-interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for BSD4.4-Lite
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-enum-constants signal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
;;; Constants from NetBSD header files substituted by Bill Sommerfeld
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are the correct values for a Harris NightHawk running CX/UX
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
(read 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; Interfaces and packages for the machine specific parts of scsh.
|
||||
;;; This is a specific to CX/UX
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-interface cxux-fdflags-extras-interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for "m88k-cxux"
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
;;POSIX only defined here.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; Very vanilla DBM processing code
|
||||
|
||||
;;; Copyright (c) 1995 by David Albertz (dalbertz@clark.lcs.mit.edu).
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; This code is freely available for use by anyone for any purpose,
|
||||
;;; so long as you don't charge money for it, remove this notice, or
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; DBM processing code
|
||||
|
||||
;;; Copyright (c) 1995 by David Albertz (dalbertz@clark.lcs.mit.edu).
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; This code is freely available for use by anyone for any purpose,
|
||||
;;; so long as you don't charge money for it, remove this notice, or
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Syntax for defining record types.
|
||||
;;; This implementation works with the Scheme48 system --
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Handy for defining random flags and constants.
|
||||
;;; (define-enum-constant "errno" intr 9) => (define errno/intr 9)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define (fd/port? x)
|
||||
(or (and (integer? x) (>= x 0))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1993, 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1993, 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; chase? true (the default) means if the file is a symlink, chase the link
|
||||
;;; and report on the file it references. chase? = #f means check the actual
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
;;; Copyright (c) 1994 by David Albertz (dalbertz@clark.lcs.mit.edu).
|
||||
;;; Copyright (c) 1994 by Olin Shivers (shivers@clark.lcs.mit.edu).
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; This code is freely available for use by anyone for any purpose,
|
||||
;;; so long as you don't charge money for it, remove this notice, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; Ops that create objects in the file system:
|
||||
;;; create-{directory,fifo,hard-link,symlink}
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This procedure nukes FNAME, whatever it may be: directory, file, fifo,
|
||||
;;; symlink.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
;;; Posix advisory record-locking for file descriptors.
|
||||
;;; These procs may only be applied to integer file descriptors;
|
||||
;;; they may not be applied to ports.
|
||||
;;; Copyright (c) 1995 by David Albertz and Olin Shivers.
|
||||
;;; Copyright (c) 1995 by David Albertz and Olin Shivers. See file COPYING.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; C syscall interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Field and record parsing utilities for scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Notes:
|
||||
;;; - Comment on the dependencies here...
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are the correct values for my SparcStation.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
(read 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; Interfaces and packages for the machine specific parts of scsh.
|
||||
;;; This is a generic version as a starting point, based on sunos.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-interface generic-fdflags-extras-interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for "generic"
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
;;POSIX only defined here.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
;;; Copyright (c) 1994 by David Albertz (dalbertz@clark.lcs.mit.edu).
|
||||
;;; Copyright (c) 1994 by Olin Shivers (shivers@clark.lcs.mit.edu).
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; This code is freely available for use by anyone for any purpose,
|
||||
;;; so long as you don't charge money for it, remove this notice, or
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; Here documents in Scheme for scsh scripts.
|
||||
;;; These are like "here documents" for sh and csh shell scripts
|
||||
;;; (i.e., the <<EOF redirection).
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; There are two kinds of here string, both introduced by the #< read macro.
|
||||
;;;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; HP-UX errno definitions. This file adapted from errno.h on an HP machine.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; NOTE: When the hp9000s500 symbol is set, errno.h defines ENOMSG to be 250
|
||||
;;; instead of 35. What to do? We go with 35 in this file.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
;; POSIX
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Interfaces and packages for the HP-UX specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-interface hpux-fdflags-extras-interface
|
||||
(export open/sync))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for HP-UX
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-enum-constants signal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for HP-UX,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1995 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are the correct values for my SparcStation.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
(read 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; Interfaces and packages for the machine specific parts of scsh.
|
||||
;;; This is the IRIX version.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-interface irix-fdflags-extras-interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for "irix"
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
;;POSIX only defined here.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for IRIX,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Job control code.
|
||||
;;; Job control code. See file COPYING.
|
||||
|
||||
;;; Fork off a process that runs in its own process group. The process
|
||||
;;; is (1) placed in its own process group and (2) suspended before
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; The signal-handling code in the last half of this file is obsolete. 8/23/96
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Job control code.
|
||||
|
||||
(foreign-source
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1995 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are the correct values for Linux systems.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom
|
||||
|
||||
(define-enum-constants open
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Interfaces and packages for the Linux specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-interface linux-fdflags-extras-interface
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for Linux
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-enum-constants signal
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for Solaris 2.x,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Meta-arg argv processor in Scheme.
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; This is a Scheme analog of the proc2.c meta-arg expander.
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; Very vanilla DBM processing code
|
||||
|
||||
;;; Copyright (c) 1995 by David Albertz (dalbertz@clark.lcs.mit.edu).
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; This code is freely available for use by anyone for any purpose,
|
||||
;;; so long as you don't charge money for it, remove this notice, or
|
||||
|
|
|
@ -57,6 +57,7 @@ scheme_value df_scheme_connect(long nargs, scheme_value *args)
|
|||
|
||||
scheme_value df_listen(long nargs, scheme_value *args)
|
||||
{
|
||||
|
||||
scheme_value ret1;
|
||||
int r1;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; Networking for the Scheme Shell
|
||||
;;; Copyright (c) 1994-1995 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; See file COPYING.
|
||||
|
||||
;;; Scheme48 implementation.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; A Unix file port system to completely replace S48 file ports.
|
||||
;;; We use S48 extensible ports.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-record fdport-data
|
||||
fd ; Unix file descriptor - integer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are the correct values for NextStep systems.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
;; POSIX
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Interfaces and packages for the NeXTSTEP specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-interface next-fdflags-extras-interface
|
||||
(export open/async
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Signal constant definitions for NextStep
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants signal
|
||||
;; POSIX
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom.
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for NeXTSTEP 3.x,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
|
|
|
@ -0,0 +1,303 @@
|
|||
;;; Static heaps for the Scheme Shell
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; based on Scheme48 implementation.
|
||||
;;; Copyright (c) 1993, 1994 by Richard Kelsey and Jonathan Rees.
|
||||
|
||||
;;; TODO
|
||||
;;; get it working
|
||||
|
||||
#!
|
||||
,config ,load vm/ps-interface.scm
|
||||
,config ,load vm/interfaces.scm
|
||||
,config ,load vm/package-defs.scm
|
||||
;; Undefined: (pre-scheme vm-utilities system-spec external)
|
||||
,config ,load vm/s48-package-defs.scm
|
||||
|
||||
,load-package bigbit
|
||||
,load-package destructuring
|
||||
|
||||
,load-package heap
|
||||
,in heap
|
||||
(define (newspace-begin) *newspace-begin*)
|
||||
(define (heap-pointer) *hp*)
|
||||
,structure heap-extra (export newspace-begin
|
||||
heap-pointer
|
||||
header-a-units
|
||||
d-vector?
|
||||
stob-type)
|
||||
|
||||
,config
|
||||
(define-structure static (export do-it
|
||||
make-static-heap
|
||||
test)
|
||||
(open scheme heap memory data stob struct
|
||||
heap-extra
|
||||
vm-architecture
|
||||
formats
|
||||
enumerated
|
||||
signals
|
||||
scsh)
|
||||
(files (scsh static)))
|
||||
|
||||
,user
|
||||
,load-package static
|
||||
,open static
|
||||
(test)
|
||||
!#
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define *scsh-image* "scsh/scsh.image") ; input file
|
||||
(define *scsh-image* "debug/tiny.image") ; input file
|
||||
(define *image-lib* "scsh.a") ; output file
|
||||
(define *temp-dir* (string-append
|
||||
"/tmp/"
|
||||
"scsh"
|
||||
(number->string
|
||||
(pid)))) ;; prefix for temp files - in their own dir
|
||||
(define *prefix* (string-append *temp-dir* "/"))
|
||||
|
||||
(define (make-static-heap image archive)
|
||||
(if (file-exists? *temp-dir*)
|
||||
(if (equal? 'directory (file-info:type (file-attributes *temp-dir*)))
|
||||
(with-cwd *temp-dir*
|
||||
(map delete-file (directory-files *temp-dir* #t)))
|
||||
(delete-file *temp-dir*)))
|
||||
(create-directory *temp-dir* #o755 #t)
|
||||
(let ((size (file-info:size (file-attributes image))))
|
||||
(do-it size image *prefix*)))
|
||||
|
||||
(define (test)
|
||||
(make-static-heap *scsh-image* *image-lib*))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
|
||||
; For example:
|
||||
; (do-it 100000 "~/s48/debug/little.image" "little-heap.c")
|
||||
;
|
||||
; The first argument to do-it should be somewhat larger than the size,
|
||||
; in bytes, of the image file to be converted (which you can obtain with
|
||||
; "ls -l").
|
||||
;
|
||||
; If the image contains 0-length stored objects, then the .c file will
|
||||
; have to be compiled by gcc, since 0-length arrays aren't allowed in
|
||||
; ANSI C. This wouldn't be difficult to work around.
|
||||
|
||||
(define *comments?* #f)
|
||||
|
||||
; 800,000 bytes => 200,000 words => at least 100,000 objects
|
||||
; 50 chunks => 16,000 bytes per chunk => 2,000 objects per chunk
|
||||
(define *chunk-size* 10000)
|
||||
|
||||
(define (do-it bytes infile prefix)
|
||||
(let ((start (init bytes infile)))
|
||||
(emit-area-declarations "p" immutable? "const " prefix)
|
||||
(emit-area-declarations "i" mutable? "" prefix)
|
||||
(emit-area-initializers "p" immutable? "const " prefix)
|
||||
(emit-area-initializers "i" mutable? "" prefix)
|
||||
(call-with-output-file (string-append prefix "entry.c")
|
||||
(lambda (port)
|
||||
(display "#include \"" port)
|
||||
(display prefix port)
|
||||
(display (descriptor-include start) port)
|
||||
(display ".h\"" port)
|
||||
(newline port)
|
||||
(display "const long entry = " port)
|
||||
(emit-descriptor start port)
|
||||
(write-char #\; port)
|
||||
(newline port)))))
|
||||
|
||||
(define (init bytes infile)
|
||||
(create-memory (quotient bytes 2) quiescent) ;Output of ls -l
|
||||
(initialize-heap (memory-begin) (memory-size))
|
||||
(let ((start (read-image infile 0)))
|
||||
(let ((n (nchunks)))
|
||||
(message n (if (= n 1) " chunk" " chunks")))
|
||||
start))
|
||||
|
||||
(define (nchunks) (+ (chunk-number (heap-pointer)) 1))
|
||||
|
||||
; emit struct declarations for areas
|
||||
|
||||
(define (emit-area-declarations name in-area? const prefix)
|
||||
(for-each-stored-object
|
||||
(string-append prefix name) ".h"
|
||||
(lambda (chunk port)
|
||||
(message name chunk " declaration")
|
||||
(format port "#define D(x) (long)(&x)+7~%")
|
||||
(format port "#define H unsigned long~%")
|
||||
(display "struct " port) (display name port) (display chunk port)
|
||||
(display " {" port) (newline port))
|
||||
(lambda (x port)
|
||||
(if (in-area? x)
|
||||
(emit-declaration x port)))
|
||||
(lambda (chunk port)
|
||||
(display "};" port)
|
||||
(newline port)
|
||||
(display const port)
|
||||
(display "extern struct " port)
|
||||
(display name port)
|
||||
(display chunk port)
|
||||
(write-char #\space port) (display name port) (display chunk port)
|
||||
(write-char #\; port) (newline port)
|
||||
chunk)))
|
||||
|
||||
(define (emit-declaration x port)
|
||||
(display " H x" port)
|
||||
(writex x port)
|
||||
(cond ((d-vector? x)
|
||||
(display "; long d" port)
|
||||
(writex x port)
|
||||
(write-char #\[ port)
|
||||
(write (d-vector-length x) port))
|
||||
((vm-string? x)
|
||||
(display "; char d" port)
|
||||
(writex x port)
|
||||
(write-char #\[ port)
|
||||
;; Ensure alignment (thanks Ian)
|
||||
(write (cells->bytes (bytes->cells (b-vector-length x)))
|
||||
port))
|
||||
(else
|
||||
(display "; unsigned char d" port)
|
||||
(writex x port)
|
||||
(write-char #\[ port)
|
||||
;; Ensure alignment
|
||||
(write (cells->bytes (bytes->cells (b-vector-length x)))
|
||||
port)))
|
||||
(display "];" port)
|
||||
(if *comments?*
|
||||
(begin (display " /* " port)
|
||||
(display (enumerand->name (stob-type x) stob) port)
|
||||
(display " */" port)))
|
||||
(newline port))
|
||||
|
||||
; Emit initializers for areas
|
||||
|
||||
(define (emit-area-initializers name in-area? const prefix)
|
||||
(for-each-stored-object
|
||||
(string-append prefix name) ".c"
|
||||
(lambda (chunk port)
|
||||
(message name chunk " initializer")
|
||||
(display const port)
|
||||
(display "struct " port) (display name port) (write chunk port)
|
||||
(write-char #\space port) (display name port) (write chunk port)
|
||||
(display " =" port) (newline port)
|
||||
|
||||
(write-char #\{ port) (newline port))
|
||||
(lambda (x port)
|
||||
(if (in-area? x)
|
||||
(emit-initializer x port)))
|
||||
(lambda (chunk port)
|
||||
(display "};" port) (newline port)))
|
||||
|
||||
(call-with-output-file
|
||||
(string-append prefix ".c")
|
||||
(lambda (port)
|
||||
(let ((n (nchunks)))
|
||||
(format port "const long ~a_count = ~s;~%" name n)
|
||||
(format port "~a long * const ~a_areas[~s] = {" const name n)
|
||||
(do ((i 0 (+ i 1)))
|
||||
((= i n))
|
||||
(format port "(~a long *)&~a~s, " const name i))
|
||||
(format port "};~%const long ~a_sizes[~s] = {" name n)
|
||||
(do ((i 0 (+ i 1)))
|
||||
((= i n))
|
||||
(format port "sizeof(~a~s), " name i))
|
||||
(format port "};~%")))))
|
||||
|
||||
|
||||
(define (message . stuff)
|
||||
(for-each display stuff) (newline))
|
||||
|
||||
(define (emit-initializer x port)
|
||||
(display " " port)
|
||||
(write (stob-header x) port)
|
||||
(write-char #\, port)
|
||||
(cond ((d-vector? x)
|
||||
(emit-d-vector-initializer x port))
|
||||
((vm-string? x)
|
||||
(write-char #\" port)
|
||||
(let ((len (vm-string-length x)))
|
||||
(do ((i 0 (+ i 1)))
|
||||
((= i len) (write-char #\" port))
|
||||
(let ((c (vm-string-ref x i)))
|
||||
(cond ((or (char=? c #\") (char=? c #\\))
|
||||
(write-char #\\ port))
|
||||
((char=? c #\newline)
|
||||
(display "\\n\\" port)))
|
||||
(write-char c port)))))
|
||||
(else
|
||||
(write-char #\{ port)
|
||||
(let ((len (b-vector-length x)))
|
||||
(do ((i 0 (+ i 1)))
|
||||
((= i len) (write-char #\} port))
|
||||
(write (b-vector-ref x i) port)
|
||||
(write-char #\, port)))))
|
||||
(write-char #\, port)
|
||||
(if *comments?*
|
||||
(begin (display " /* " port)
|
||||
(writex x port)
|
||||
(display " */" port)))
|
||||
(newline port))
|
||||
|
||||
(define (emit-d-vector-initializer x port)
|
||||
(write-char #\{ port)
|
||||
(let ((len (d-vector-length x)))
|
||||
(do ((i 0 (+ i 1)))
|
||||
((= i len) (write-char #\} port))
|
||||
(emit-descriptor (d-vector-ref x i) port)
|
||||
(write-char #\, port))))
|
||||
|
||||
(define (emit-descriptor x port)
|
||||
(if (stob? x)
|
||||
(begin (if (immutable? x)
|
||||
(display "D(p" port)
|
||||
(display "D(i" port))
|
||||
(display (chunk-number x) port)
|
||||
(display ".x" port)
|
||||
(writex x port)
|
||||
(write-char #\) port))
|
||||
(write x port)))
|
||||
|
||||
; hacked emit-descriptor returns chunk or #f
|
||||
(define (descriptor-include x)
|
||||
(if (stob? x)
|
||||
(string-append
|
||||
(if (immutable? x) "p" "i")
|
||||
(number->string (chunk-number x)))
|
||||
#f))
|
||||
|
||||
; Foo
|
||||
|
||||
(define (writex x port)
|
||||
(write (quotient (- (- x (memory-begin)) 7) 4) port))
|
||||
|
||||
(define (chunk-number x)
|
||||
(quotient (- (- x (memory-begin)) 7) *chunk-size*))
|
||||
|
||||
|
||||
; Image traversal utility
|
||||
|
||||
(define (for-each-stored-object suffix chunk-start proc chunk-end)
|
||||
(let ((limit (heap-pointer)))
|
||||
(let chunk-loop ((addr (newspace-begin))
|
||||
(i 0)
|
||||
(chunk (+ (newspace-begin) *chunk-size*)))
|
||||
(if (addr< addr limit)
|
||||
(begin
|
||||
(chunk-start i)
|
||||
(let loop ((addr addr))
|
||||
(if (and (addr< addr limit)
|
||||
(addr< addr chunk))
|
||||
(let ((d (fetch addr)))
|
||||
(if (not (header? d))
|
||||
(warn "heap is in an inconsistent state" d))
|
||||
(proc (address->stob-descriptor (addr1+ addr)))
|
||||
(loop (addr1+ (addr+ addr (header-a-units d)))))
|
||||
(begin (chunk-end i)
|
||||
(chunk-loop addr
|
||||
(+ i 1)
|
||||
(+ chunk *chunk-size*))))))))))
|
||||
|
||||
(define (mutable? x) (not (immutable? x)))
|
|
@ -1,5 +1,5 @@
|
|||
;;; Scsh top level
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Requires
|
||||
;;; From BUILD: build-image
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Unix wait & process objects for scsh
|
||||
;;; Copyright (c) 1993, 1994, 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1993, 1994, 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This is a GC'd abstraction for Unix process id's.
|
||||
;;; The problem with Unix pids is (a) they clutter up the kernel
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Pseudo terminals
|
||||
;;; Copyright (c) 1995 by Olin Shivers.
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; (fork-pty-session thunk)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Basic read and write
|
||||
;;; Copyright (c) 1993 by Olin Shivers.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Note: read ops should check to see if their string args are mutable.
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Scsh regular expressions
|
||||
Olin Shivers
|
||||
July 1998
|
||||
Last Update: 98/10/4
|
||||
Last Update: 99/7/12
|
||||
|
||||
* Todo
|
||||
Module naming and structuring.
|
||||
|
@ -505,7 +505,7 @@ We can *compute* a char class by writing the SRE
|
|||
,<cset-exp>
|
||||
where <cset-exp> is a Scheme expression producing a value that can be
|
||||
coerced to a character set: a character set, character, one-character
|
||||
string, or char-class regexp value. This regexp matches one character
|
||||
string, or char-class regexp value. This regexp matches any character
|
||||
from the set.
|
||||
|
||||
The char-class SRE ,@<cset-exp> is entirely equivalent to ,<cset-exp>
|
||||
|
@ -584,7 +584,7 @@ context in which the "a" is interpreted, making the SRE equivalent to
|
|||
|
||||
** Dynamic regexps
|
||||
|
||||
SRE notation allows you to compute parts of a regular expressions
|
||||
SRE notation allows you to compute parts of a regular expression
|
||||
at run time. The SRE
|
||||
,<exp>
|
||||
is a regexp whose body <exp> is a Scheme expression producing a
|
||||
|
@ -711,12 +711,11 @@ that is not supported by the current scsh reference implementation.]
|
|||
|
||||
*** Posix string notation
|
||||
|
||||
The SRE (posix-string <string>), where <string> is a string literal
|
||||
(*not* a general Scheme expression), allows one to use Posix string
|
||||
notation for a regexp. It's intended as backwards compatibility and
|
||||
is deprecated. Example: (posix-string "[aeiou]+|x*|y{3,5}") matches
|
||||
a string of vowels, a possibly empty string of x's, or three to five
|
||||
y's.
|
||||
The SRE (posix-string <string>), where <string> is a string literal (*not*
|
||||
a general Scheme expression that evaluates to a string), allows one to use
|
||||
Posix string notation for a regexp. It's intended as backwards compatibility
|
||||
and is deprecated. Example: (posix-string "[aeiou]+|x*|y{3,5}") matches a
|
||||
string of vowels, a possibly empty string of x's, or three to five y's.
|
||||
|
||||
Parens are used ambiguously in Posix notation -- both for grouping
|
||||
and submatch marking. The (posix-string <string>) form makes the
|
||||
|
@ -1270,7 +1269,7 @@ corresponding SRE is much more transparent:
|
|||
|
||||
*** ASCII nul and newline
|
||||
|
||||
Does . match a ASCII nul? Does it match a newline? Does [^x]? Unforunately,
|
||||
Does . match a ASCII nul? Does it match a newline? Does [^x]? Unfortunately,
|
||||
the same expressions have different meanings depending on the implementation
|
||||
and the flags passed to the pattern-compiler functions. In SRE notation,
|
||||
the behaviour of each element is unambiguously defined. No surprises; no
|
||||
|
@ -1422,18 +1421,18 @@ should not be used in new code.
|
|||
Same as above, except 'post item means recurse on post-match substring.
|
||||
If RE doesn't match STR, returns STR.
|
||||
|
||||
(regexp-foldl re kons knil s [finish start]) -> value
|
||||
(regexp-fold re kons knil s [finish start]) -> value
|
||||
The following definition is a bit unwieldy, but the intuition is
|
||||
simple: this procedure uses the regexp RE to divide up string S into
|
||||
non-matching/matching chunks, and then "folds" the procedure KONS
|
||||
across this sequence of chunks. It is useful when you wish to operate
|
||||
on a string in sub-units defined by some regular expression, as are
|
||||
the related REGEXP-FOLDR and REGEXP-FOR-EACH procedures.
|
||||
the related REGEXP-FOLD-RIGHT and REGEXP-FOR-EACH procedures.
|
||||
|
||||
Search from START (defaulting to 0) for a match to RE; call
|
||||
this match M. Let I be the index of the end of the match
|
||||
(that is, (match:end M 0)). Loop as follows:
|
||||
(regexp-foldl re kons (kons START M knil) s finish I)
|
||||
(regexp-fold re kons (kons START M knil) s finish I)
|
||||
If there is no match, return instead
|
||||
(finish START knil)
|
||||
FINISH defaults to (lambda (i knil) knil)
|
||||
|
@ -1457,7 +1456,7 @@ should not be used in new code.
|
|||
Hint: The LET-MATCH macro is frequently useful for operating on the
|
||||
match value M passed to the KONS function.
|
||||
|
||||
(regexp-foldr re kons knil s [finish start]) -> value
|
||||
(regexp-fold-right re kons knil s [finish start]) -> value
|
||||
This procedure repeatedly matches regexp RE across string S.
|
||||
This divides S up into a sequence of matching/non-matching chunks:
|
||||
NM0 M1 NM1 M2 NM2 ... Mk NMk
|
||||
|
@ -1475,9 +1474,9 @@ should not be used in new code.
|
|||
FINISH defaults to (lambda (i knil) knil)
|
||||
|
||||
Example: To pick out all the matches to RE in S, say
|
||||
(regexp-foldr re
|
||||
(lambda (m i lis) (cons (match:substring m 0) lis))
|
||||
'() s)
|
||||
(regexp-fold-right re
|
||||
(lambda (m i lis) (cons (match:substring m 0) lis))
|
||||
'() s)
|
||||
|
||||
Hint: The LET-MATCH macro is frequently useful for operating on the
|
||||
match value M passed to the KONS function.
|
||||
|
@ -1636,11 +1635,12 @@ explicit-renaming low-level macros.
|
|||
else. E.g., we might have a conditional form wherein if the
|
||||
test part of one arm is an SRE, it expands to a regexp match
|
||||
on some implied value, otherwise the form is evaluated as a boolean
|
||||
Scheme expression:
|
||||
Scheme expression. Here's an example of how a high-level macro could
|
||||
drop an expression bound to ?TEST-EXP into an IF-SRE-FORM:
|
||||
|
||||
(if-sre-form test-exp ; If TEST-EXP is a regexp,
|
||||
(regexp-search? (rx test-exp) line) ; match it against the line,
|
||||
test-exp) ; otw it's a boolean exp.
|
||||
(if-sre-form ?test-exp ; If ?TEST-EXP is a regexp,
|
||||
(regexp-search? (rx ?test-exp) line) ; match it against the line,
|
||||
?test-exp) ; otw it's a boolean exp.
|
||||
|
||||
(sre-form? form rename compare) -> boolean
|
||||
This procedure is for low-level macros doing things equivalent to
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1994 by Olin Shivers
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Add scsh conditions to s48.
|
||||
|
||||
;;; A syscall-error condition-type:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; The module interfaces for scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers and David Albertz.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom
|
||||
;;; See file COPYING.
|
||||
|
||||
(define-interface posix-fdflags-interface
|
||||
(export ((open/read
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; The packages that scsh uses/defines.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; Note: field-reader package (fr.scm) and here docs use READ-LINE.
|
||||
;;; It is defined in rdelim.scm.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; Copyright (c) 1993, 1994 by Olin Shivers.
|
||||
;;; Copyright (c) 1993, 1994 by Olin Shivers. See file COPYING.
|
||||
;;; #! comment read-macro
|
||||
;;; no case-folding
|
||||
;;; -flag is a symbol
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue