63 lines
1.5 KiB
Scheme
63 lines
1.5 KiB
Scheme
(define-structure tty-utils
|
|
(export modify-tty echo-off echo-on raw raw-initialize)
|
|
(open scsh let-opt scheme)
|
|
(files tty-utils))
|
|
|
|
(define-structure expect-syntax-support
|
|
(export expand-expect)
|
|
(open scheme structure-refs
|
|
receiving) ; for making alien containers.
|
|
(access signals) ; for ERROR
|
|
(files expect-syntax))
|
|
|
|
(define-structure expect
|
|
(export task? make-task
|
|
task:process
|
|
task:in
|
|
task:out
|
|
task:buf set-task:buf!
|
|
task:pre-match set-task:pre-match!
|
|
|
|
port->monitor
|
|
|
|
user-task file->task ports->task close-task
|
|
spawn* (spawn :syntax)
|
|
tsend tsend-line
|
|
(expect :syntax))
|
|
(for-syntax (open expect-syntax-support scheme))
|
|
|
|
(open scsh formats structure-refs
|
|
receiving srfi-9 scheme srfi-13)
|
|
(access signals) ; for ERROR
|
|
|
|
(files expect))
|
|
|
|
(define-structure chat
|
|
(export chat-abort chat-timeout chat-monitor
|
|
port->chat-logger file->chat-logger
|
|
(look-for :syntax)
|
|
(chat :syntax)
|
|
send send/cr)
|
|
|
|
(open scsh expect fluids scheme)
|
|
|
|
(files chat))
|
|
|
|
(define-structure printf-package
|
|
(export printf sprintf display/cr display/nl)
|
|
(open scsh formats scheme)
|
|
|
|
(begin
|
|
|
|
(define (printf fmt . args) (apply format (current-output-port) fmt args))
|
|
(define (sprintf fmt . args) (apply format #f fmt args))
|
|
|
|
(define (display/cr str . maybe-port)
|
|
(apply display str maybe-port)
|
|
(apply write-string "\r" maybe-port))
|
|
|
|
(define (display/nl str . maybe-port)
|
|
(apply display str maybe-port)
|
|
(apply write-string "\n" maybe-port))
|
|
))
|