first commit
This commit is contained in:
parent
d2cc08ac98
commit
6e1a33f071
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,160 @@
|
|||
;;Konstanten.
|
||||
//diese werden beim make durch die Konstanten aus curses.h expandiert.
|
||||
//Dazu erfolgt der Aufruf des C-Pre-Prozessors folgendermaßen:
|
||||
//cpp -P -imacros /usr/include/ncurses.h ncurses-constants.scm |
|
||||
// sed -e '/^ *$/d'
|
||||
// -e 's/refresh1/refresh/' -e 's/move1/move/' -e 's/clear1/clear/'
|
||||
// > ncurses-constants.scm
|
||||
//-P:
|
||||
//keine linemarker erzeugen.
|
||||
//-imacros file:
|
||||
//es wird zuerst file eingelesen. Die Ausgabe wird weggeworfen. Es sind jetzt
|
||||
//die Macros von dort verfügbar.
|
||||
//sed:
|
||||
//-e: Befehl ausführen (in diesem Fall reguläre Ausdrücke ersetzen)
|
||||
//-^:Zeilenanfang
|
||||
//- *:beliebig viele Leerzeichen
|
||||
//$:Zeilenende
|
||||
//d: löscht die Zeile
|
||||
//s: reguläre Ausdrücke ersetzen
|
||||
|
||||
|
||||
;Funktion um die Oktal-Zahlen aus der Headerdatei in scheme-integer
|
||||
;zu konvertieren
|
||||
(define make-oct-int
|
||||
(lambda (i)
|
||||
(string->number (string-append "#o"
|
||||
(number->string i)))))
|
||||
;
|
||||
;
|
||||
;;Farben
|
||||
;
|
||||
(define color-black COLOR_BLACK)
|
||||
(define color-red COLOR_RED)
|
||||
(define color-green COLOR_GREEN)
|
||||
(define color-yellow COLOR_YELLOW)
|
||||
(define color-blue COLOR_BLUE)
|
||||
(define color-magenta COLOR_MAGENTA)
|
||||
(define color-cyan COLOR_CYAN)
|
||||
(define color-white COLOR_WHITE)
|
||||
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//M-x replace-regexp
|
||||
//#define KEY_\(.*\).*0[0-9][0-9][0-9].**/
|
||||
//(define key-\1 KEY_\1)
|
||||
|
||||
|
||||
;
|
||||
;
|
||||
;;Sondertasten
|
||||
;
|
||||
(define key-code-yes (make-oct-int KEY_CODE_YES))
|
||||
(define key-min (make-oct-int KEY_MIN))
|
||||
(define key-break (make-oct-int KEY_BREAK))
|
||||
(define key-sreset (make-oct-int KEY_SRESET))
|
||||
(define key-reset (make-oct-int KEY_RESET))
|
||||
;
|
||||
(define key-down (make-oct-int KEY_DOWN))
|
||||
(define key-up (make-oct-int KEY_UP))
|
||||
(define key-left (make-oct-int KEY_LEFT))
|
||||
(define key-right (make-oct-int KEY_RIGHT))
|
||||
(define key-home (make-oct-int KEY_HOME))
|
||||
(define key-backspace (make-oct-int KEY_BACKSPACE))
|
||||
(define key-f0 (make-oct-int KEY_F0))
|
||||
;
|
||||
(define key-f1 (+ (make-oct-int KEY_F0) 1))
|
||||
(define key-f2 (+ (make-oct-int KEY_F0) 2))
|
||||
(define key-f3 (+ (make-oct-int KEY_F0) 3))
|
||||
(define key-f4 (+ (make-oct-int KEY_F0) 4))
|
||||
(define key-f5 (+ (make-oct-int KEY_F0) 5))
|
||||
(define key-f6 (+ (make-oct-int KEY_F0) 6))
|
||||
(define key-f7 (+ (make-oct-int KEY_F0) 7))
|
||||
(define key-f8 (+ (make-oct-int KEY_F0) 8))
|
||||
(define key-f9 (+ (make-oct-int KEY_F0) 9))
|
||||
(define key-f10 (+ (make-oct-int KEY_F0) 10))
|
||||
(define key-f11 (+ (make-oct-int KEY_F0) 11))
|
||||
(define key-f12 (+ (make-oct-int KEY_F0) 12))
|
||||
;
|
||||
(define key-dl (make-oct-int KEY_DL))
|
||||
(define key-il (make-oct-int KEY_IL))
|
||||
(define key-dc (make-oct-int KEY_DC))
|
||||
(define key-ic (make-oct-int KEY_IC))
|
||||
(define key-eic (make-oct-int KEY_EIC))
|
||||
(define key-clear1 (make-oct-int KEY_CLEAR))
|
||||
(define key-eos (make-oct-int KEY_EOS))
|
||||
(define key-eol (make-oct-int KEY_EOL))
|
||||
(define key-sf (make-oct-int KEY_SF))
|
||||
(define key-sr (make-oct-int KEY_SR))
|
||||
(define key-npage (make-oct-int KEY_NPAGE))
|
||||
(define key-ppage (make-oct-int KEY_PPAGE))
|
||||
(define key-stab (make-oct-int KEY_STAB))
|
||||
(define key-ctab (make-oct-int KEY_CTAB))
|
||||
(define key-catab (make-oct-int KEY_CATAB))
|
||||
(define key-enter (make-oct-int KEY_ENTER))
|
||||
(define key-print (make-oct-int KEY_PRINT))
|
||||
(define key-ll (make-oct-int KEY_LL))
|
||||
(define key-a1 (make-oct-int KEY_A1))
|
||||
(define key-a3 (make-oct-int KEY_A3))
|
||||
(define key-b2 (make-oct-int KEY_B2))
|
||||
(define key-c1 (make-oct-int KEY_C1))
|
||||
(define key-c3 (make-oct-int KEY_C3))
|
||||
(define key-btab (make-oct-int KEY_BTAB))
|
||||
(define key-beg (make-oct-int KEY_BEG))
|
||||
(define key-cancel (make-oct-int KEY_CANCEL))
|
||||
(define key-close (make-oct-int KEY_CLOSE))
|
||||
(define key-command (make-oct-int KEY_COMMAND))
|
||||
(define key-copy (make-oct-int KEY_COPY))
|
||||
(define key-create (make-oct-int KEY_CREATE))
|
||||
(define key-end (make-oct-int KEY_END))
|
||||
(define key-exit (make-oct-int KEY_EXIT))
|
||||
(define key-find (make-oct-int KEY_FIND))
|
||||
(define key-help (make-oct-int KEY_HELP))
|
||||
(define key-mark (make-oct-int KEY_MARK))
|
||||
(define key-message (make-oct-int KEY_MESSAGE))
|
||||
(define key-move1 (make-oct-int KEY_MOVE))
|
||||
(define key-next (make-oct-int KEY_NEXT))
|
||||
(define key-open (make-oct-int KEY_OPEN))
|
||||
(define key-options (make-oct-int KEY_OPTIONS))
|
||||
(define key-previous (make-oct-int KEY_PREVIOUS))
|
||||
(define key-redo (make-oct-int KEY_REDO))
|
||||
(define key-reference (make-oct-int KEY_REFERENCE))
|
||||
(define key-refresh1 (make-oct-int KEY_REFRESH))
|
||||
(define key-replace (make-oct-int KEY_REPLACE))
|
||||
(define key-restart (make-oct-int KEY_RESTART))
|
||||
(define key-resume (make-oct-int KEY_RESUME))
|
||||
(define key-save (make-oct-int KEY_SAVE))
|
||||
(define key-sbeg (make-oct-int KEY_SBEG))
|
||||
(define key-scancel (make-oct-int KEY_SCANCEL))
|
||||
(define key-scommand (make-oct-int KEY_SCOMMAND))
|
||||
(define key-scopy (make-oct-int KEY_SCOPY))
|
||||
(define key-screate (make-oct-int KEY_SCREATE))
|
||||
(define key-sdc (make-oct-int KEY_SDC))
|
||||
(define key-sdl (make-oct-int KEY_SDL))
|
||||
(define key-select (make-oct-int KEY_SELECT))
|
||||
(define key-send (make-oct-int KEY_SEND))
|
||||
(define key-seol (make-oct-int KEY_SEOL))
|
||||
(define key-sexit (make-oct-int KEY_SEXIT))
|
||||
(define key-sfind (make-oct-int KEY_SFIND))
|
||||
(define key-shelp (make-oct-int KEY_SHELP))
|
||||
(define key-shome (make-oct-int KEY_SHOME))
|
||||
(define key-sic (make-oct-int KEY_SIC))
|
||||
(define key-sleft (make-oct-int KEY_SLEFT))
|
||||
(define key-smessage (make-oct-int KEY_SMESSAGE))
|
||||
(define key-smove (make-oct-int KEY_SMOVE))
|
||||
(define key-snext (make-oct-int KEY_SNEXT))
|
||||
(define key-soptions (make-oct-int KEY_SOPTIONS))
|
||||
(define key-sprevious (make-oct-int KEY_SPREVIOUS))
|
||||
(define key-sprint (make-oct-int KEY_SPRINT))
|
||||
(define key-sredo (make-oct-int KEY_SREDO))
|
||||
(define key-sreplace (make-oct-int KEY_SREPLACE))
|
||||
(define key-sright (make-oct-int KEY_SRIGHT))
|
||||
(define key-srsume (make-oct-int KEY_SRSUME))
|
||||
(define key-ssave (make-oct-int KEY_SSAVE))
|
||||
(define key-ssuspend (make-oct-int KEY_SSUSPEND))
|
||||
(define key-sundo (make-oct-int KEY_SUNDO))
|
||||
(define key-suspend (make-oct-int KEY_SUSPEND))
|
||||
(define key-undo (make-oct-int KEY_UNDO))
|
||||
(define key-mouse (make-oct-int KEY_MOUSE))
|
||||
(define key-resize (make-oct-int KEY_RESIZE))
|
||||
(define key-event (make-oct-int KEY_EVENT))
|
|
@ -0,0 +1,132 @@
|
|||
;;Konstanten.
|
||||
;Funktion um die Oktal-Zahlen aus der Headerdatei in scheme-integer
|
||||
;zu konvertieren
|
||||
(define make-oct-int
|
||||
(lambda (i)
|
||||
(string->number (string-append "#o"
|
||||
(number->string i)))))
|
||||
;
|
||||
;
|
||||
;;Farben
|
||||
;
|
||||
(define color-black 0)
|
||||
(define color-red 1)
|
||||
(define color-green 2)
|
||||
(define color-yellow 3)
|
||||
(define color-blue 4)
|
||||
(define color-magenta 5)
|
||||
(define color-cyan 6)
|
||||
(define color-white 7)
|
||||
;
|
||||
;
|
||||
;;Sondertasten
|
||||
;
|
||||
(define key-code-yes (make-oct-int 0400))
|
||||
(define key-min (make-oct-int 0401))
|
||||
(define key-break (make-oct-int 0401))
|
||||
(define key-sreset (make-oct-int 0530))
|
||||
(define key-reset (make-oct-int 0531))
|
||||
;
|
||||
(define key-down (make-oct-int 0402))
|
||||
(define key-up (make-oct-int 0403))
|
||||
(define key-left (make-oct-int 0404))
|
||||
(define key-right (make-oct-int 0405))
|
||||
(define key-home (make-oct-int 0406))
|
||||
(define key-backspace (make-oct-int 0407))
|
||||
(define key-f0 (make-oct-int 0410))
|
||||
;
|
||||
(define key-f1 (+ (make-oct-int 0410) 1))
|
||||
(define key-f2 (+ (make-oct-int 0410) 2))
|
||||
(define key-f3 (+ (make-oct-int 0410) 3))
|
||||
(define key-f4 (+ (make-oct-int 0410) 4))
|
||||
(define key-f5 (+ (make-oct-int 0410) 5))
|
||||
(define key-f6 (+ (make-oct-int 0410) 6))
|
||||
(define key-f7 (+ (make-oct-int 0410) 7))
|
||||
(define key-f8 (+ (make-oct-int 0410) 8))
|
||||
(define key-f9 (+ (make-oct-int 0410) 9))
|
||||
(define key-f10 (+ (make-oct-int 0410) 10))
|
||||
(define key-f11 (+ (make-oct-int 0410) 11))
|
||||
(define key-f12 (+ (make-oct-int 0410) 12))
|
||||
;
|
||||
(define key-dl (make-oct-int 0510))
|
||||
(define key-il (make-oct-int 0511))
|
||||
(define key-dc (make-oct-int 0512))
|
||||
(define key-ic (make-oct-int 0513))
|
||||
(define key-eic (make-oct-int 0514))
|
||||
(define key-clear (make-oct-int 0515))
|
||||
(define key-eos (make-oct-int 0516))
|
||||
(define key-eol (make-oct-int 0517))
|
||||
(define key-sf (make-oct-int 0520))
|
||||
(define key-sr (make-oct-int 0521))
|
||||
(define key-npage (make-oct-int 0522))
|
||||
(define key-ppage (make-oct-int 0523))
|
||||
(define key-stab (make-oct-int 0524))
|
||||
(define key-ctab (make-oct-int 0525))
|
||||
(define key-catab (make-oct-int 0526))
|
||||
(define key-enter (make-oct-int 0527))
|
||||
(define key-print (make-oct-int 0532))
|
||||
(define key-ll (make-oct-int 0533))
|
||||
(define key-a1 (make-oct-int 0534))
|
||||
(define key-a3 (make-oct-int 0535))
|
||||
(define key-b2 (make-oct-int 0536))
|
||||
(define key-c1 (make-oct-int 0537))
|
||||
(define key-c3 (make-oct-int 0540))
|
||||
(define key-btab (make-oct-int 0541))
|
||||
(define key-beg (make-oct-int 0542))
|
||||
(define key-cancel (make-oct-int 0543))
|
||||
(define key-close (make-oct-int 0544))
|
||||
(define key-command (make-oct-int 0545))
|
||||
(define key-copy (make-oct-int 0546))
|
||||
(define key-create (make-oct-int 0547))
|
||||
(define key-end (make-oct-int 0550))
|
||||
(define key-exit (make-oct-int 0551))
|
||||
(define key-find (make-oct-int 0552))
|
||||
(define key-help (make-oct-int 0553))
|
||||
(define key-mark (make-oct-int 0554))
|
||||
(define key-message (make-oct-int 0555))
|
||||
(define key-move (make-oct-int 0556))
|
||||
(define key-next (make-oct-int 0557))
|
||||
(define key-open (make-oct-int 0560))
|
||||
(define key-options (make-oct-int 0561))
|
||||
(define key-previous (make-oct-int 0562))
|
||||
(define key-redo (make-oct-int 0563))
|
||||
(define key-reference (make-oct-int 0564))
|
||||
(define key-refresh (make-oct-int 0565))
|
||||
(define key-replace (make-oct-int 0566))
|
||||
(define key-restart (make-oct-int 0567))
|
||||
(define key-resume (make-oct-int 0570))
|
||||
(define key-save (make-oct-int 0571))
|
||||
(define key-sbeg (make-oct-int 0572))
|
||||
(define key-scancel (make-oct-int 0573))
|
||||
(define key-scommand (make-oct-int 0574))
|
||||
(define key-scopy (make-oct-int 0575))
|
||||
(define key-screate (make-oct-int 0576))
|
||||
(define key-sdc (make-oct-int 0577))
|
||||
(define key-sdl (make-oct-int 0600))
|
||||
(define key-select (make-oct-int 0601))
|
||||
(define key-send (make-oct-int 0602))
|
||||
(define key-seol (make-oct-int 0603))
|
||||
(define key-sexit (make-oct-int 0604))
|
||||
(define key-sfind (make-oct-int 0605))
|
||||
(define key-shelp (make-oct-int 0606))
|
||||
(define key-shome (make-oct-int 0607))
|
||||
(define key-sic (make-oct-int 0610))
|
||||
(define key-sleft (make-oct-int 0611))
|
||||
(define key-smessage (make-oct-int 0612))
|
||||
(define key-smove (make-oct-int 0613))
|
||||
(define key-snext (make-oct-int 0614))
|
||||
(define key-soptions (make-oct-int 0615))
|
||||
(define key-sprevious (make-oct-int 0616))
|
||||
(define key-sprint (make-oct-int 0617))
|
||||
(define key-sredo (make-oct-int 0620))
|
||||
(define key-sreplace (make-oct-int 0621))
|
||||
(define key-sright (make-oct-int 0622))
|
||||
(define key-srsume (make-oct-int 0623))
|
||||
(define key-ssave (make-oct-int 0624))
|
||||
(define key-ssuspend (make-oct-int 0625))
|
||||
(define key-sundo (make-oct-int 0626))
|
||||
(define key-suspend (make-oct-int 0627))
|
||||
(define key-undo (make-oct-int 0630))
|
||||
(define key-mouse (make-oct-int 0631))
|
||||
(define key-resize (make-oct-int 0632))
|
||||
(define key-event (make-oct-int 0633))
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,958 @@
|
|||
;;; The packages that scsh uses/defines.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
|
||||
;;; Note: field-reader package (fr.scm) and here docs use READ-LINE.
|
||||
;;; It is defined in rdelim.scm.
|
||||
|
||||
;;; You link up a scsh package by defining a package named OS-DEPENDENT
|
||||
;;; that satisfies the interfaces for packages
|
||||
;;; buffered-io-flags
|
||||
;;; posix-fdflags
|
||||
;;; posix-errno
|
||||
;;; posix-signals
|
||||
;;; Anything else it provides should be specified in an interface called
|
||||
;;; os-extras-interface. See the scsh structure below.
|
||||
;;; Then the scsh structure can be instantiated.
|
||||
;;;
|
||||
;;; The architecture directories, like next/ and irix/ and so forth,
|
||||
;;; provide packages that can serve as the os-dependent package. E.g.,
|
||||
;;; the next-defs package, defined in next/packages.
|
||||
;;;
|
||||
;;; This whole mechanism would be better solved with a functor.
|
||||
;;; -Olin
|
||||
|
||||
|
||||
;;; The LET-OPT package for optional argument parsing & defaulting
|
||||
;;; is found in the let-opt.scm file.
|
||||
|
||||
|
||||
(define-structure error-package (export error warn)
|
||||
(open signals)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
|
||||
(define-structure scsh-utilities scsh-utilities-interface
|
||||
(open bitwise error-package loopholes let-opt scheme define-record-types
|
||||
records
|
||||
threads threads-internal placeholders locks srfi-1)
|
||||
(files utilities)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
(define-structure weak-tables weak-tables-interface
|
||||
(open scheme
|
||||
weak
|
||||
tables)
|
||||
(files weaktables))
|
||||
|
||||
(define-structure string-collectors string-collectors-interface
|
||||
(open scheme
|
||||
defrec-package)
|
||||
(files stringcoll))
|
||||
|
||||
(define-structure delimited-readers delimited-readers-interface
|
||||
(open scheme
|
||||
byte-vectors
|
||||
signals ; ERROR
|
||||
let-opt
|
||||
receiving
|
||||
re-level-0 rx-syntax
|
||||
(subset srfi-14 (char-set x->char-set char-set-contains?))
|
||||
ascii
|
||||
i/o-internal ports)
|
||||
(files rdelim))
|
||||
|
||||
(define list-lib srfi-1)
|
||||
(define string-lib srfi-13)
|
||||
(define char-set-lib srfi-14)
|
||||
|
||||
|
||||
;;; This guy goes into the FOR-SYNTAX part of scsh's syntax exports.
|
||||
(define-structure scsh-syntax-helpers
|
||||
(export transcribe-extended-process-form)
|
||||
(open receiving ; receive
|
||||
error-package
|
||||
names ; generated? by JMG
|
||||
scsh-utilities ; check-arg
|
||||
scheme
|
||||
)
|
||||
(files syntax-helpers)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
|
||||
;;; The bufpol/{block, line, none} values
|
||||
(define-structure buffered-io-flags buffered-io-flags-interface
|
||||
(open defenum-package scheme)
|
||||
(files (machine bufpol))
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
|
||||
|
||||
(define-structures ((tty-flags tty-flags-interface)
|
||||
(scsh-internal-tty-flags scsh-internal-tty-flags-interface))
|
||||
(open scheme ascii bitwise)
|
||||
(files (machine tty-consts))
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
|
||||
(define-structure scsh-version scsh-version-interface
|
||||
(open scheme)
|
||||
(files scsh-version))
|
||||
|
||||
(define-structure scsh-endian scsh-endian-interface
|
||||
(open scheme
|
||||
bitwise)
|
||||
(files endian))
|
||||
|
||||
;;; The scsh-level-0 package is for implementation convenience.
|
||||
;;; The scsh startup and top-level modules need access to scsh
|
||||
;;; procedures, but they export procedures that are themselves
|
||||
;;; part of scsh. So scsh-level-0 is the core scsh stuff, which is
|
||||
;;; imported by these two modules. These modules all collectively
|
||||
;;; export the whole scsh enchilada.
|
||||
|
||||
(define-structures
|
||||
((scsh-level-0
|
||||
(compound-interface posix-fdflags-interface
|
||||
posix-errno-interface
|
||||
posix-signals-interface
|
||||
sockets-network-interface ; Standard Network Interface
|
||||
os-extras-interface ; Extra stuff from OS.
|
||||
scsh-delimited-readers-interface
|
||||
scsh-errors-interface
|
||||
scsh-io-interface
|
||||
scsh-file-interface
|
||||
scsh-process-interface
|
||||
scsh-process-state-interface
|
||||
scsh-user/group-db-interface
|
||||
scsh-command-line-interface
|
||||
scsh-signals-interface
|
||||
scsh-environment-interface
|
||||
scsh-home-interface
|
||||
scsh-string-interface
|
||||
scsh-file-names-interface
|
||||
scsh-misc-interface
|
||||
scsh-high-level-process-interface
|
||||
scsh-time-interface ; new in 0.2
|
||||
scsh-sockets-interface ; new in 0.3
|
||||
scsh-endian-interface
|
||||
tty-interface ; new in 0.4
|
||||
scsh-version-interface
|
||||
(interface-of srfi-14) ;; export this here for
|
||||
(export ->char-set) ;; this kludge
|
||||
signal-handler-interface
|
||||
;; This stuff would probably be better off kept
|
||||
;; in separate modules, but we'll toss it in for now.
|
||||
(interface-of ascii) ; char<->ascii
|
||||
string-ports-interface
|
||||
syslog-interface
|
||||
crypt-interface
|
||||
uname-interface
|
||||
))
|
||||
(scsh-level-0-internals (export set-command-line-args!
|
||||
init-scsh-hindbrain
|
||||
initialize-cwd
|
||||
init-scsh-vars))
|
||||
; (scsh-regexp-package scsh-regexp-interface)
|
||||
)
|
||||
(for-syntax (open scsh-syntax-helpers scheme))
|
||||
(access rts-sigevents sigevents threads)
|
||||
(open enumerated
|
||||
defenum-package
|
||||
external-calls ;JMG new FFI
|
||||
structure-refs
|
||||
receiving
|
||||
defrec-package
|
||||
define-record-types
|
||||
formats
|
||||
string-collectors
|
||||
delimited-readers
|
||||
os-dependent ; OS dependent stuff
|
||||
buffered-io-flags ; stdio dependent
|
||||
ascii
|
||||
records
|
||||
extended-ports
|
||||
ports
|
||||
build
|
||||
bigbit
|
||||
bitwise
|
||||
signals
|
||||
conditions
|
||||
(subset srfi-1 (filter reverse! fold delete any))
|
||||
scsh-utilities
|
||||
handle
|
||||
fluids thread-fluids
|
||||
weak-tables
|
||||
(subset srfi-1 (last drop-right))
|
||||
|
||||
srfi-14
|
||||
; scsh-regexp-package
|
||||
; scsh-regexp-internals
|
||||
scsh-version
|
||||
tty-flags
|
||||
scsh-internal-tty-flags ; Not exported
|
||||
|
||||
syslog
|
||||
|
||||
let-opt ; optional-arg parsing & defaulting
|
||||
|
||||
architecture ; Was this by JMG ??
|
||||
|
||||
re-level-0
|
||||
rx-syntax
|
||||
|
||||
srfi-13
|
||||
|
||||
thread-fluids ; For exec-path-list
|
||||
loopholes ; For my bogus CALL-TERMINALLY implementation.
|
||||
|
||||
(modify scheme (hide call-with-input-file
|
||||
call-with-output-file
|
||||
with-input-from-file
|
||||
with-output-to-file
|
||||
open-input-file
|
||||
open-output-file))
|
||||
|
||||
low-interrupt ; for sighandler and procobj
|
||||
;; all these seem to be for scsh-0.6 JMG
|
||||
i/o
|
||||
i/o-internal
|
||||
channels channel-i/o
|
||||
low-channels
|
||||
byte-vectors
|
||||
threads locks placeholders
|
||||
primitives
|
||||
escapes
|
||||
command-levels
|
||||
features
|
||||
general-tables
|
||||
simple-syntax
|
||||
exit-hooks
|
||||
display-conditions
|
||||
|
||||
scsh-endian)
|
||||
(for-syntax (open scsh-syntax-helpers scheme))
|
||||
(access interrupts
|
||||
sort
|
||||
command-processor
|
||||
escapes
|
||||
i/o ; S48's force-output
|
||||
exceptions ; signal-exception
|
||||
formats
|
||||
threads-internal
|
||||
records ; I don't think this is necessary. !!!
|
||||
scheme) ; For accessing the normal I/O operators.
|
||||
(files syntax
|
||||
scsh-condition
|
||||
syscalls
|
||||
fname
|
||||
rw
|
||||
newports
|
||||
fdports
|
||||
procobj ; New in release 0.4.
|
||||
(machine waitcodes) ; OS dependent code.
|
||||
filesys
|
||||
fileinfo
|
||||
glob
|
||||
filemtch
|
||||
time ; New in release 0.2.
|
||||
(machine time_dep)
|
||||
network ; New in release 0.3.
|
||||
flock ; New in release 0.4.
|
||||
tty ; New in release 0.4.
|
||||
pty ; New in release 0.4.
|
||||
sighandlers ; New in release 0.5.
|
||||
scsh
|
||||
; re
|
||||
)
|
||||
; (optimize auto-integrate)
|
||||
(begin
|
||||
;; work around for SRFI 14 naming fuckage
|
||||
(define ->char-set x->char-set))
|
||||
)
|
||||
|
||||
(define-structure defrec-package (export (define-record :syntax))
|
||||
(open records scheme)
|
||||
(for-syntax (open scheme error-package receiving))
|
||||
(files defrec)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
(define-structure defenum-package (export (define-enum-constant :syntax)
|
||||
(define-enum-constants :syntax)
|
||||
(define-enum-constants-from-zero
|
||||
:syntax))
|
||||
(open scheme)
|
||||
(files enumconst)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
;;; This code opens so many modules of gruesome, low-level S48 internals
|
||||
;;; that these two modules are segregated into separate packages, each
|
||||
;;; exporting just two definitions.
|
||||
|
||||
(define-structure scsh-startup-package (export dump-scsh-program
|
||||
dump-scsh
|
||||
make-scsh-starter
|
||||
scsh-stand-alone-resumer)
|
||||
(open scsh-level-0-internals ; init-scsh-* set-command-line-args!
|
||||
scsh-level-0 ; error-output-port command-line-arguments
|
||||
scsh-top-package ; parse-switches-and-execute
|
||||
handle ; with-handler
|
||||
command-levels ; user-context
|
||||
write-images ; write-image
|
||||
build-internals ; simple-condition-handler
|
||||
low-level ; flush-the-symbol-table!
|
||||
command-processor ; command-output
|
||||
package-commands-internal
|
||||
filenames ; translate
|
||||
usual-resumer ; usual-resumer
|
||||
environments ; with-interaction-environment
|
||||
fluids-internal ; JMG: get-dynamic-env
|
||||
threads threads-internal queues scheduler
|
||||
structure-refs
|
||||
scsh-utilities
|
||||
interrupts
|
||||
low-interrupt
|
||||
sigevents
|
||||
primitives
|
||||
(modify scheme (hide call-with-input-file
|
||||
call-with-output-file
|
||||
with-input-from-file
|
||||
with-output-to-file
|
||||
open-input-file
|
||||
open-output-file)))
|
||||
(access threads-internal)
|
||||
(files startup))
|
||||
|
||||
(define-structure scsh-top-package (export parse-switches-and-execute
|
||||
with-scsh-initialized)
|
||||
(open command-processor
|
||||
command-levels ; with-new-session
|
||||
conditions
|
||||
display-conditions
|
||||
ensures-loaded
|
||||
environments
|
||||
error-package
|
||||
evaluation
|
||||
extended-ports
|
||||
fluids
|
||||
interfaces
|
||||
sigevents
|
||||
low-interrupt
|
||||
fluids-internal ; JMG: get-dynamic-env
|
||||
handle ; JMG: with-handler
|
||||
; package-commands
|
||||
interrupts
|
||||
i/o
|
||||
package-commands-internal
|
||||
package-mutation
|
||||
packages
|
||||
receiving
|
||||
scsh-version
|
||||
scsh-level-0 ; with-current-input-port error-output-port
|
||||
; with-current-output-port exit
|
||||
scsh-level-0-internals ; set-command-line-args! init-scsh-vars
|
||||
threads
|
||||
lib-dirs
|
||||
lib-dirs-internal
|
||||
(subset srfi-14 (char-set
|
||||
char-set-complement!
|
||||
char-set-contains?
|
||||
string->char-set))
|
||||
root-scheduler ; scheme-exit-now
|
||||
exit-hooks
|
||||
scheme)
|
||||
(files top meta-arg))
|
||||
|
||||
(define-structure exit-hooks exit-hooks-interface
|
||||
(open scheme
|
||||
threads)
|
||||
(begin
|
||||
(define *exit-hooks* '())
|
||||
(define (add-exit-hook! thunk)
|
||||
(set! *exit-hooks* (cons thunk *exit-hooks*)))
|
||||
(define (call-exit-hooks!)
|
||||
(for-each (lambda (thunk) (thunk)) *exit-hooks*))
|
||||
|
||||
(define *narrowed-exit-hooks* '())
|
||||
(define (add-narrowed-exit-hook! thunk)
|
||||
(set! *narrowed-exit-hooks* (cons thunk *narrowed-exit-hooks*)))
|
||||
(define (call-narrowed-exit-hooks!)
|
||||
(for-each (lambda (thunk) (thunk)) *narrowed-exit-hooks*))
|
||||
|
||||
(define (call-exit-hooks-and-narrow thunk)
|
||||
(call-exit-hooks!)
|
||||
(narrow
|
||||
(lambda ()
|
||||
(call-narrowed-exit-hooks!)
|
||||
(thunk))))))
|
||||
|
||||
|
||||
(define-structure field-reader-package scsh-field-reader-interface
|
||||
(open receiving ; receive
|
||||
scsh-utilities ; deprecated-proc
|
||||
error-package ; error
|
||||
(subset srfi-13 (string-join))
|
||||
(subset srfi-14 (char-set?
|
||||
char-set:whitespace
|
||||
char-set
|
||||
x->char-set
|
||||
char-set-complement))
|
||||
delimited-readers
|
||||
re-exports
|
||||
let-opt ; optional-arg parsing & defaulting
|
||||
scheme
|
||||
)
|
||||
(files fr)
|
||||
;; Handle a little bit of backwards compatibility.
|
||||
(begin (define join-strings (deprecated-proc string-join 'join-strings
|
||||
"Use SRFI-13 STRING-JOIN.")))
|
||||
)
|
||||
|
||||
|
||||
(define-structures
|
||||
((awk-expander-package (export expand-awk expand-awk/obsolete))
|
||||
(awk-support-package (export next-range next-:range
|
||||
next-range: next-:range:)))
|
||||
(open receiving ; receive
|
||||
;; scsh-utilities
|
||||
(subset srfi-1 (any filter))
|
||||
error-package ; error
|
||||
; scsh-regexp-package
|
||||
; re-exports
|
||||
sre-syntax-tools
|
||||
scheme
|
||||
)
|
||||
(files awk)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
|
||||
(define-structure awk-package awk-interface
|
||||
(open awk-support-package ; These packages provide all the stuff
|
||||
re-exports ; that appears in the code produced by
|
||||
receiving ; an awk expansion.
|
||||
scheme)
|
||||
(for-syntax (open awk-expander-package scheme))
|
||||
(begin (define-syntax awk expand-awk)
|
||||
(define-syntax awk/posix-string expand-awk/obsolete)))
|
||||
|
||||
;;; Exports an AWK macro that is just AWK/POSIX-STRING.
|
||||
(define-structure obsolete-awk-package (export (awk :syntax))
|
||||
(open awk-package)
|
||||
(begin (define-syntax awk
|
||||
(syntax-rules () ((awk body ...) (awk/posix-string body ....))))))
|
||||
|
||||
(define-structure scsh
|
||||
(compound-interface (interface-of scsh-level-0)
|
||||
(interface-of scsh-startup-package)
|
||||
; scsh-regexp-interface
|
||||
re-exports-interface
|
||||
re-old-funs-interface
|
||||
scsh-field-reader-interface ; new in 0.3
|
||||
; scsh-dbm-interface
|
||||
awk-interface
|
||||
char-predicates-interface; Urk -- Some of this is R5RS!
|
||||
dot-locking-interface
|
||||
md5-interface
|
||||
configure-interface
|
||||
lib-dirs-interface
|
||||
)
|
||||
|
||||
(open structure-refs
|
||||
scsh-level-0
|
||||
scsh-level-0-internals
|
||||
re-exports
|
||||
re-old-funs
|
||||
; scsh-regexp-package
|
||||
scsh-startup-package
|
||||
; dbm
|
||||
awk-package
|
||||
field-reader-package
|
||||
char-predicates-lib ; Urk -- Some of this is R5RS!
|
||||
dot-locking
|
||||
md5
|
||||
configure
|
||||
lib-dirs
|
||||
scheme)
|
||||
|
||||
(access scsh-top-package)
|
||||
; (optimize auto-integrate)
|
||||
)
|
||||
|
||||
(define-structure scheme-with-scsh
|
||||
(compound-interface (interface-of scsh)
|
||||
(interface-of scheme))
|
||||
(open scsh
|
||||
(modify scheme (hide call-with-input-file
|
||||
call-with-output-file
|
||||
with-input-from-file
|
||||
with-output-to-file
|
||||
open-input-file
|
||||
open-output-file))))
|
||||
|
||||
(define-structure scsh-here-string-hax (export)
|
||||
(open reading
|
||||
receiving
|
||||
scsh ; Just need the delimited readers.
|
||||
features ; make-immutable!
|
||||
(subset srfi-14 (char-set))
|
||||
scheme)
|
||||
(files here))
|
||||
|
||||
(define-structure sigevents sigevents-interface
|
||||
(open scsh-level-0
|
||||
scheme
|
||||
structure-refs
|
||||
low-interrupt
|
||||
rts-sigevents)
|
||||
(files event))
|
||||
|
||||
(define-structure simple-syntax (export define-simple-syntax)
|
||||
(open scheme)
|
||||
(begin (define-syntax define-simple-syntax
|
||||
(syntax-rules ()
|
||||
((define-simple-syntax (name . pattern) result)
|
||||
(define-syntax name (syntax-rules () ((name . pattern) result))))))))
|
||||
|
||||
|
||||
(define-structure low-interrupt low-interrupt-interface
|
||||
(open scheme
|
||||
enumerated
|
||||
bigbit
|
||||
bitwise)
|
||||
(files low-interrupt))
|
||||
|
||||
;(define-structure test-package (export test-proc)
|
||||
; (open scsh-regexp-package scheme)
|
||||
; (begin (define (test-proc p)
|
||||
; (regexp-substitute p
|
||||
; (string-match "(foo)(.*)(bar)" "Hello foo Olin bar quux")
|
||||
; 'post 3 1 2 'pre))))
|
||||
|
||||
|
||||
(define-structure scsh-threads
|
||||
(export fork/thread
|
||||
fork/process
|
||||
wait/thread
|
||||
wait/process)
|
||||
(open structure-refs
|
||||
scheme)
|
||||
(access scsh-level-0
|
||||
threads
|
||||
threads-internal)
|
||||
(files threads))
|
||||
|
||||
(define-structure dot-locking dot-locking-interface
|
||||
(open scsh-level-0
|
||||
scheme
|
||||
let-opt
|
||||
threads ; sleep
|
||||
random)
|
||||
(files dot-locking))
|
||||
|
||||
(define-structures ((syslog syslog-interface)
|
||||
(syslog-channels syslog-channels-interface))
|
||||
(open scheme
|
||||
define-record-types finite-types enum-sets
|
||||
locks thread-fluids
|
||||
external-calls
|
||||
bitwise)
|
||||
(files syslog))
|
||||
|
||||
(define-structure libscsh (export dump-libscsh-image)
|
||||
(open scheme
|
||||
external-calls
|
||||
(subset i/o (current-error-port))
|
||||
(subset extended-ports (make-string-input-port))
|
||||
(subset handle (with-handler))
|
||||
(subset escapes (with-continuation))
|
||||
(subset environments (with-interaction-environment))
|
||||
(subset package-commands-internal (user-environment))
|
||||
(subset command-levels (user-context start-new-session))
|
||||
(subset command-processor (user-command-environment))
|
||||
(subset scsh-startup-package (dump-scsh-program)))
|
||||
(files libscsh))
|
||||
|
||||
(define-structure md5 md5-interface
|
||||
(open scheme
|
||||
ascii
|
||||
define-record-types
|
||||
bitwise
|
||||
(subset i/o (read-block))
|
||||
(subset srfi-13 (string-fold-right))
|
||||
signals
|
||||
external-calls)
|
||||
(files md5))
|
||||
|
||||
(define srfi-19 (make-srfi-19 scheme-with-scsh))
|
||||
|
||||
(define-structure configure configure-interface
|
||||
(open scheme
|
||||
re-level-0 rx-syntax
|
||||
(subset srfi-13 (string-join)))
|
||||
(files configure))
|
||||
|
||||
(define-structures ((lib-dirs lib-dirs-interface)
|
||||
(lib-dirs-internal lib-dirs-internal-interface))
|
||||
(open scsh-level-0
|
||||
scheme
|
||||
handle
|
||||
scsh-utilities
|
||||
(subset srfi-1 (any)))
|
||||
(files lib-dirs))
|
||||
|
||||
(define-structure curses
|
||||
(export init-screen
|
||||
newterm
|
||||
endwin
|
||||
isendwin
|
||||
delscreen
|
||||
unctrl
|
||||
keyname
|
||||
filter
|
||||
use_env
|
||||
putwin
|
||||
getwin
|
||||
delay-output
|
||||
start-color
|
||||
init-pair
|
||||
flushinp
|
||||
curses-version
|
||||
use-default-colors
|
||||
assume-default-colors
|
||||
define-key
|
||||
baudrate
|
||||
erasechar
|
||||
has_ic
|
||||
has_il
|
||||
killchar
|
||||
longname
|
||||
termname
|
||||
has-key
|
||||
start-color
|
||||
init-pair
|
||||
init-color
|
||||
has-colors
|
||||
can-change-colors
|
||||
color-pair
|
||||
cbreak
|
||||
nocbreak
|
||||
echo
|
||||
noecho
|
||||
halfdelay
|
||||
intrflush
|
||||
keypad
|
||||
meta
|
||||
nodelay
|
||||
raw
|
||||
noraw
|
||||
qiflush
|
||||
noqiflush
|
||||
beep
|
||||
flash
|
||||
def-prog-mode
|
||||
def-shell-mode
|
||||
reset-prog-mode
|
||||
reset-shell-mode
|
||||
resetty
|
||||
savetty
|
||||
curs-set
|
||||
napms
|
||||
mcprint
|
||||
is-term-resized
|
||||
resize-term
|
||||
resizeterm
|
||||
scr-dump
|
||||
scr-restore
|
||||
scr-init
|
||||
scr-set
|
||||
set-term
|
||||
newwin
|
||||
delwin
|
||||
mvwin
|
||||
subwin
|
||||
derwin
|
||||
mvderwin
|
||||
dupwin
|
||||
wsyncup
|
||||
wcursyncup
|
||||
wsyncdown
|
||||
syncok
|
||||
wrefresh
|
||||
wnoutrefresh
|
||||
redrawwin
|
||||
doupdate
|
||||
wredrawln
|
||||
;;getyx
|
||||
;;getparyx
|
||||
;;getbegyx
|
||||
;;getmaxyx
|
||||
gety
|
||||
getx
|
||||
getmaxy
|
||||
getmaxx
|
||||
wresize
|
||||
idlok
|
||||
leaveok
|
||||
scrollok
|
||||
idcok
|
||||
immedok
|
||||
wsetscrreg
|
||||
nl
|
||||
nonl
|
||||
waddch
|
||||
waddstr
|
||||
waddnstr
|
||||
winsch
|
||||
winsstr
|
||||
winsnstr
|
||||
wechochar
|
||||
wattroff
|
||||
wattron
|
||||
wattrset
|
||||
wstandend
|
||||
wstandout
|
||||
wbkgdset
|
||||
wbkgd
|
||||
getbkgd
|
||||
wborder
|
||||
box
|
||||
whline
|
||||
wvline
|
||||
scroll
|
||||
wscrl
|
||||
wmove
|
||||
wgetch
|
||||
wgetstr
|
||||
wgetnstr
|
||||
winch
|
||||
winstr
|
||||
winnstr
|
||||
werase
|
||||
wclear
|
||||
wclrtobot
|
||||
wclrtoeol
|
||||
clearok
|
||||
wdelch
|
||||
wdeleteln
|
||||
winsertln
|
||||
winsdelln
|
||||
overlay
|
||||
overwrite
|
||||
copywin
|
||||
touchline
|
||||
touchwin
|
||||
untouchwin
|
||||
wtouchln
|
||||
is-linetouched
|
||||
is-wintouched
|
||||
wprintw
|
||||
newpad
|
||||
subpad
|
||||
prefresh
|
||||
pnoutrefresh
|
||||
pechochar
|
||||
standard-screen
|
||||
COLS
|
||||
LINES
|
||||
A-NORMAL
|
||||
A-STANDOUT
|
||||
A-UNDERLINE
|
||||
A-REVERSE
|
||||
A-BLINK
|
||||
A-DIM
|
||||
A-BOLD
|
||||
A-PROTECT
|
||||
A-INVIS
|
||||
A-ALTCHARSET
|
||||
COLOR-BLACK
|
||||
COLOR-RED
|
||||
COLOR-GREEN
|
||||
COLOR-YELLOW
|
||||
COLOR-BLUE
|
||||
COLOR-MAGENTA
|
||||
COLOR-CYAN
|
||||
COLOR-WHITE
|
||||
refresh
|
||||
move
|
||||
setscrreg
|
||||
scrl
|
||||
printw
|
||||
clear
|
||||
addch
|
||||
echochar
|
||||
addstr
|
||||
addnstr
|
||||
insch
|
||||
insstr
|
||||
insnstr
|
||||
printw
|
||||
attroff
|
||||
attron
|
||||
attrset
|
||||
standend
|
||||
standout
|
||||
bkgdset
|
||||
bkgd
|
||||
border
|
||||
hline
|
||||
vline
|
||||
getch
|
||||
getstr
|
||||
getnstr
|
||||
erase
|
||||
clear
|
||||
clrtobot
|
||||
clrtoeol
|
||||
delch
|
||||
deleteln
|
||||
insdelln
|
||||
insertln
|
||||
mvwaddch
|
||||
mvwaddstr
|
||||
mvwaddnstr
|
||||
mvwinsch
|
||||
mvwinsstr
|
||||
mvwinsnstr
|
||||
mvwprintw
|
||||
mvwhline
|
||||
mvwvline
|
||||
mvwgetch
|
||||
mvwgetstr
|
||||
mvwgetnstr
|
||||
mvwdelch
|
||||
set-stdscr-internal
|
||||
set-standard-screen
|
||||
make-window
|
||||
window-c-pointer
|
||||
|
||||
color-black
|
||||
color-red
|
||||
color-green
|
||||
color-yellow
|
||||
color-blue
|
||||
color-magenta
|
||||
color-cyan
|
||||
color-white
|
||||
|
||||
key-code-yes
|
||||
key-min
|
||||
key-break
|
||||
key-sreset
|
||||
key-reset
|
||||
key-down
|
||||
key-up
|
||||
key-left
|
||||
key-right
|
||||
key-home
|
||||
key-backspace
|
||||
key-f0
|
||||
key-f1
|
||||
key-f2
|
||||
key-f3
|
||||
key-f4
|
||||
key-f5
|
||||
key-f6
|
||||
key-f7
|
||||
key-f8
|
||||
key-f9
|
||||
key-f10
|
||||
key-f11
|
||||
key-f12
|
||||
key-dl
|
||||
key-il
|
||||
key-dc
|
||||
key-ic
|
||||
key-eic
|
||||
key-clear
|
||||
key-eos
|
||||
key-eol
|
||||
key-sf
|
||||
key-sr
|
||||
key-npage
|
||||
key-ppage
|
||||
key-stab
|
||||
key-ctab
|
||||
key-catab
|
||||
key-enter
|
||||
key-print
|
||||
key-ll
|
||||
key-a1
|
||||
key-a3
|
||||
key-b2
|
||||
key-c1
|
||||
key-c3
|
||||
key-btab
|
||||
key-beg
|
||||
key-cancel
|
||||
key-close
|
||||
key-command
|
||||
key-copy
|
||||
key-create
|
||||
key-end
|
||||
key-exit
|
||||
key-find
|
||||
key-help
|
||||
key-mark
|
||||
key-message
|
||||
key-move
|
||||
key-next
|
||||
key-open
|
||||
key-options
|
||||
key-previous
|
||||
key-redo
|
||||
key-reference
|
||||
key-refresh
|
||||
key-replace
|
||||
key-restart
|
||||
key-resume
|
||||
key-save
|
||||
key-sbeg
|
||||
key-scancel
|
||||
key-scommand
|
||||
key-scopy
|
||||
key-screate
|
||||
key-sdc
|
||||
key-sdl
|
||||
key-select
|
||||
key-send
|
||||
key-seol
|
||||
key-sexit
|
||||
key-sfind
|
||||
key-shelp
|
||||
key-shome
|
||||
key-sic
|
||||
key-sleft
|
||||
key-smessage
|
||||
key-smove
|
||||
key-snext
|
||||
key-soptions
|
||||
key-sprevious
|
||||
key-sprint
|
||||
key-sredo
|
||||
key-sreplace
|
||||
key-sright
|
||||
key-srsume
|
||||
key-ssave
|
||||
key-ssuspend
|
||||
key-sundo
|
||||
key-suspend
|
||||
key-undo
|
||||
key-mouse
|
||||
key-resize
|
||||
key-event)
|
||||
(open scsh-level-0
|
||||
scheme
|
||||
external-calls
|
||||
define-record-types
|
||||
conditions
|
||||
signals
|
||||
handle)
|
||||
(files curses
|
||||
ncurses-constants))
|
Loading…
Reference in New Issue