scsh-expect/scheme/packages.scm

57 lines
1.4 KiB
Scheme

(define-structure tty-utils
(export modify-tty echo-off echo-on raw raw-initialize)
(open scheme-with-scsh let-opt)
(files tty-utils))
(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
wait-task close-task
spawn* (spawn :syntax)
tsend tsend/cr
(expect :syntax)
expect*
interact*
(interact :syntax)
eof-pattern eof-pattern?
chat-abort chat-timeout chat-monitor
port->chat-logger file->chat-logger
(look-for :syntax)
(chat :syntax)
send send/cr)
(for-syntax (open scheme-with-scsh))
(open scheme-with-scsh formats structure-refs let-opt
receiving srfi-9 srfi-13 srfi-1 srfi-11
tty-utils fluids)
(files expect interact chat))
(define-structure printf-package
(export printf sprintf display/cr display/nl)
(open scheme-with-scsh formats)
(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))
))