mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
Turn `(rnrs io ports)' into an R6RS library
* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular" Guile module, so the bookkeeping for #:re-export and #:replace is done automatically and we gain control over the imports from `(guile)'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
644c5165ee
commit
baa5705ca7
1 changed files with 25 additions and 23 deletions
|
@ -26,34 +26,34 @@
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(define-module (rnrs io ports)
|
(library (rnrs io ports (6))
|
||||||
#:version (6)
|
(export eof-object eof-object?
|
||||||
#:re-export (eof-object? port? input-port? output-port?)
|
|
||||||
#:export (eof-object
|
|
||||||
|
|
||||||
;; input & output ports
|
;; input & output ports
|
||||||
port-transcoder binary-port? transcoded-port
|
port? input-port? output-port?
|
||||||
port-position set-port-position!
|
port-transcoder binary-port? transcoded-port
|
||||||
port-has-port-position? port-has-set-port-position!?
|
port-position set-port-position!
|
||||||
call-with-port
|
port-has-port-position? port-has-set-port-position!?
|
||||||
|
call-with-port
|
||||||
|
|
||||||
;; input ports
|
;; input ports
|
||||||
open-bytevector-input-port
|
open-bytevector-input-port
|
||||||
open-string-input-port
|
open-string-input-port
|
||||||
make-custom-binary-input-port
|
make-custom-binary-input-port
|
||||||
|
|
||||||
;; binary input
|
;; binary input
|
||||||
get-u8 lookahead-u8
|
get-u8 lookahead-u8
|
||||||
get-bytevector-n get-bytevector-n!
|
get-bytevector-n get-bytevector-n!
|
||||||
get-bytevector-some get-bytevector-all
|
get-bytevector-some get-bytevector-all
|
||||||
|
|
||||||
;; output ports
|
;; output ports
|
||||||
open-bytevector-output-port
|
open-bytevector-output-port
|
||||||
open-string-output-port
|
open-string-output-port
|
||||||
make-custom-binary-output-port
|
make-custom-binary-output-port
|
||||||
|
|
||||||
;; binary output
|
;; binary output
|
||||||
put-u8 put-bytevector))
|
put-u8 put-bytevector)
|
||||||
|
(import (guile))
|
||||||
|
|
||||||
(load-extension (string-append "libguile-" (effective-version))
|
(load-extension (string-append "libguile-" (effective-version))
|
||||||
"scm_init_r6rs_ports")
|
"scm_init_r6rs_ports")
|
||||||
|
@ -121,4 +121,6 @@ as a string, and a thunk to retrieve the characters associated with that port."
|
||||||
(values port
|
(values port
|
||||||
(lambda () (get-output-string port)))))
|
(lambda () (get-output-string port)))))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
;;; ports.scm ends here
|
;;; ports.scm ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue