compat: Add shims for the 'shell' module.
* gash/compat.scm [mes] (X_OK): New variable. [mes] (program-arguments): New procedure. [mes] (delete-duplicates!): New procedure. [mes] (flush-all-ports): New procedure. [mes] (file-port?): New procedure. [mes] (input-port?): New procedure. [mes] (output-port?): New procedure. [mes] (dup): Redefine to support an optional 'new' argument.
This commit is contained in:
parent
83f3369603
commit
309f9a8893
|
@ -89,7 +89,14 @@
|
||||||
the-eof-object
|
the-eof-object
|
||||||
noop
|
noop
|
||||||
make-prompt-tag
|
make-prompt-tag
|
||||||
canonicalize-path)
|
canonicalize-path
|
||||||
|
X_OK
|
||||||
|
program-arguments
|
||||||
|
delete-duplicates!
|
||||||
|
flush-all-ports
|
||||||
|
file-port?
|
||||||
|
input-port?
|
||||||
|
output-port?)
|
||||||
|
|
||||||
(define-macro (define-inlinable . rest)
|
(define-macro (define-inlinable . rest)
|
||||||
`(define ,@rest))
|
`(define ,@rest))
|
||||||
|
@ -127,4 +134,26 @@
|
||||||
(list stem))
|
(list stem))
|
||||||
|
|
||||||
;; XXX: Actually implement this.
|
;; XXX: Actually implement this.
|
||||||
(define (canonicalize-path path) path))
|
(define (canonicalize-path path) path)
|
||||||
|
|
||||||
|
(define X_OK 1)
|
||||||
|
|
||||||
|
(define program-arguments command-line)
|
||||||
|
|
||||||
|
(define delete-duplicates! (@ (srfi srfi-1) delete-duplicates))
|
||||||
|
|
||||||
|
;; Mes does not have port buffers.
|
||||||
|
(define flush-all-ports noop)
|
||||||
|
|
||||||
|
;; Mes uses raw file descriptors for file ports.
|
||||||
|
(define file-port? number?)
|
||||||
|
|
||||||
|
;; This is probably OK...?
|
||||||
|
(define (input-port? port) #f)
|
||||||
|
(define (output-port? port) #f)
|
||||||
|
|
||||||
|
;; Fix 'dup' interface.
|
||||||
|
(let ((mes/dup dup))
|
||||||
|
(define* (guile/dup fd #:optional new)
|
||||||
|
(if new (dup2 fd new) (mes/dup fd)))
|
||||||
|
(set! dup guile/dup)))
|
||||||
|
|
Loading…
Reference in New Issue