summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/rnrs.scm5
-rw-r--r--module/rnrs/io/ports.scm8
2 files changed, 10 insertions, 3 deletions
diff --git a/module/rnrs.scm b/module/rnrs.scm
index e10967bb4..476a3ab2d 100644
--- a/module/rnrs.scm
+++ b/module/rnrs.scm
@@ -1,6 +1,6 @@
;;; rnrs.scm --- The R6RS composite library
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -165,7 +165,8 @@
make-transcoder transcoder-codec native-transcoder
latin-1-codec utf-8-codec utf-16-codec
- eof-object? port? input-port? output-port? eof-object port-transcoder
+ eof-object? port? input-port? output-port? eof-object port-eof?
+ port-transcoder
binary-port? transcoded-port port-position set-port-position!
port-has-port-position? port-has-set-port-position!?
close-port call-with-port
diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm
index 854ea0919..15d62bd3f 100644
--- a/module/rnrs/io/ports.scm
+++ b/module/rnrs/io/ports.scm
@@ -1,6 +1,6 @@
;;;; ports.scm --- R6RS port API -*- coding: utf-8 -*-
-;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@
;; input & output ports
port? input-port? output-port?
+ port-eof?
port-transcoder binary-port? transcoded-port
port-position set-port-position!
port-has-port-position? port-has-set-port-position!?
@@ -191,6 +192,11 @@
;; So far, we don't support transcoders other than the binary transcoder.
#t)
+(define (port-eof? port)
+ (eof-object? (if (binary-port? port)
+ (lookahead-u8 port)
+ (lookahead-char port))))
+
(define (transcoded-port port transcoder)
"Return a new textual port based on @var{port}, using
@var{transcoder} to encode and decode data written to or