#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.591 2006/08/02 18:18:12 cph Exp $
+$Id: runtime.pkg,v 14.592 2006/08/09 05:48:53 savannah-arthur Exp $
Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
get-output-string!
(make-accumulator-output-port open-output-string)
open-output-string
+ port-position
(with-string-output-port call-with-output-string)
with-output-to-string)
(initialization (initialize-package!)))
#| -*-Scheme-*-
-$Id: strout.scm,v 14.23 2005/12/14 05:44:49 cph Exp $
+$Id: strout.scm,v 14.24 2006/08/09 05:48:53 savannah-arthur Exp $
Copyright 1988,1990,1993,1999,2000,2001 Massachusetts Institute of Technology
Copyright 2003,2004,2005 Massachusetts Institute of Technology
\f
(define (open-output-string)
(make-port accumulator-output-port-type
- (receive (sink extract extract!) (make-accumulator-sink)
- (make-gstate #f sink 'ISO-8859-1 'NEWLINE extract extract!))))
+ (receive (sink extract extract! position) (make-accumulator-sink)
+ (make-gstate #f
+ sink
+ 'ISO-8859-1
+ 'NEWLINE
+ extract
+ extract!
+ position))))
(define (get-output-string port)
((port/operation port 'EXTRACT-OUTPUT) port))
(define (get-output-string! port)
((port/operation port 'EXTRACT-OUTPUT!) port))
+(define (port-position port)
+ ((port/operation port 'POSITION) port))
+
(define (call-with-output-string generator)
(let ((port (open-output-string)))
(generator port)
(initial-offset 4) ;must match "genio.scm"
(constructor #f))
extract
- extract!)
+ extract!
+ position)
(define accumulator-output-port-type)
(define (initialize-package!)
,(lambda (port)
(output-port/flush-output port)
((astate-extract! (port/state port)))))
+ (POSITION
+ ,(lambda (port)
+ (output-port/flush-output port)
+ ((astate-position (port/state port)))))
(WRITE-SELF
,(lambda (port output-port)
port
(set! index 0)
(set-string-maximum-length! s index)
s)
- (make-string 0))))))))
\ No newline at end of file
+ (make-string 0)))))
+ (lambda ()
+ (without-interrupts
+ (lambda () index))))))
\ No newline at end of file