MAKE-GENERIC-I/O-PORT to take extra arguments.
#| -*-Scheme-*-
-$Id: genio.scm,v 1.58 2008/02/02 01:48:51 cph Exp $
+$Id: genio.scm,v 1.59 2008/02/02 02:02:48 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(declare (usual-integrations))
\f
-(define (make-generic-i/o-port source sink #!optional type)
+(define (make-generic-i/o-port source sink #!optional type . extra-state)
(if (not (or source sink))
(error "Missing arguments."))
(let ((port
(generic-i/o-port-type (source-type source)
(sink-type sink))
type)
- (make-gstate source sink 'TEXT 'TEXT))))
+ (apply make-gstate source sink 'TEXT 'TEXT extra-state))))
(let ((ib (port-input-buffer port)))
(if ib
((source/set-port (input-buffer-source ib)) port)))
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.632 2008/02/02 01:48:52 cph Exp $
+$Id: runtime.pkg,v 14.633 2008/02/02 02:02:49 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
output-buffer-using-binary-denormalizer?
port-input-buffer
port-output-buffer)
- (export (runtime string-input)
- make-gstate)
- (export (runtime string-output)
- make-gstate)
- (export (runtime truncated-string-output)
- make-gstate)
(initialization (initialize-package!)))
(define-package (runtime gensym)
#| -*-Scheme-*-
-$Id: strnin.scm,v 14.22 2008/02/02 01:48:54 cph Exp $
+$Id: strnin.scm,v 14.23 2008/02/02 02:02:51 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (open-input-string string #!optional start end)
(guarantee-string string 'OPEN-INPUT-STRING)
- (let* ((end
- (if (or (default-object? end) (not end))
- (string-length string)
- (guarantee-substring-end-index end (string-length string)
- 'OPEN-INPUT-STRING)))
- (start
- (if (or (default-object? start) (not start))
- 0
- (guarantee-substring-start-index start end 'OPEN-INPUT-STRING))))
- (make-port input-string-port-type
- (make-gstate (make-string-source string start end)
- #f
- 'ISO-8859-1
- 'NEWLINE))))
+ (let ((port
+ (let* ((end
+ (if (or (default-object? end) (not end))
+ (string-length string)
+ (guarantee-substring-end-index end (string-length string)
+ 'OPEN-INPUT-STRING)))
+ (start
+ (if (or (default-object? start) (not start))
+ 0
+ (guarantee-substring-start-index start end
+ 'OPEN-INPUT-STRING))))
+ (make-generic-i/o-port (make-string-source string start end)
+ #f
+ input-string-port-type))))
+ (port/set-coding port 'ISO-8859-1)
+ (port/set-line-ending port 'NEWLINE)
+ port))
(define (call-with-input-string string procedure)
(let ((port (open-input-string string)))
#| -*-Scheme-*-
-$Id: strott.scm,v 14.19 2008/02/02 01:48:55 cph Exp $
+$Id: strott.scm,v 14.20 2008/02/02 02:02:52 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(call-with-current-continuation
(lambda (k)
(let ((port
- (make-port output-string-port-type
- (receive (sink extract extract!)
- (make-accumulator-sink limit k)
- (make-gstate #f
- sink
- 'ISO-8859-1
- 'NEWLINE
- extract
- extract!)))))
+ (receive (sink extract extract!) (make-accumulator-sink limit k)
+ (make-generic-i/o-port #f
+ sink
+ output-string-port-type
+ extract
+ extract!))))
+ (port/set-coding port 'ISO-8859-1)
+ (port/set-line-ending port 'NEWLINE)
(generator port)
(cons #f (get-output-string port))))))
#| -*-Scheme-*-
-$Id: strout.scm,v 14.30 2008/02/02 01:48:56 cph Exp $
+$Id: strout.scm,v 14.31 2008/02/02 02:02:53 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(declare (usual-integrations))
\f
(define (open-output-string)
- (make-port accumulator-output-port-type
- (receive (sink extract extract! position) (make-accumulator-sink)
- (make-gstate #f
- sink
- 'ISO-8859-1
- 'NEWLINE
- extract
- extract!
- position))))
+ (let ((port
+ (receive (sink extract extract! position) (make-accumulator-sink)
+ (make-generic-i/o-port #f
+ sink
+ accumulator-output-port-type
+ extract
+ extract!
+ position))))
+ (port/set-coding port 'ISO-8859-1)
+ (port/set-line-ending port 'NEWLINE)
+ port))
(define (get-output-string port)
((port/operation port 'EXTRACT-OUTPUT) port))