/usr/share/scsh-0.6/scsh/libscsh.scm is in scsh-common-0.6 0.6.7-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ;;; This file is part of scsh.
(define (return-from-vm n)
(with-continuation (if #t #f) (lambda () n)))
(define (startup user-context)
(lambda (args)
(start-new-session user-context
(current-input-port)
(current-output-port)
(current-error-port)
args
#t) ;batch?
(with-interaction-environment
(user-environment)
(lambda ()
(return-from-vm 0)))))
(define (s48-command command-string)
(let* ((in (make-string-input-port command-string))
(s-exp (read in)))
(if (and (not (eof-object? s-exp))
(eof-object? (read in)))
(call-with-values
(lambda ()
(call-with-current-continuation
(lambda (k)
(with-handler
(lambda (cond more)
; (display "error is "(current-error-port))
; (display cond (current-error-port))
; (newline (current-error-port))
(k cond))
(lambda ()
(eval s-exp (user-command-environment)))))))
(lambda args
(cond ((null? args)
; (display "null as result"
; (current-error-port)))
((null? (cdr args))
; (display "evaluated to:" (current-error-port))
; (display (car args)(current-error-port))
; (newline (current-error-port))
(car args))
(else
(display "multiple return values in s48-command"
(current-error-port))
))))
(display "s48-command got not exactly one s-exp"
(current-error-port)))))
;; TODO write a procedure to be called time by time to let the
;; administrative threads run
;; must be called from a running command processor
(define (dump-libscsh-image filename)
(dump-scsh-program (startup (user-context)) filename))
(define-exported-binding "s48-command" s48-command)
|