(list->vector extra)))
(define-integrable (port-input-buffer port)
- (gstate-input-buffer (port/%state port)))
+ (gstate-input-buffer (port/state port)))
(define-integrable (port-output-buffer port)
- (gstate-output-buffer (port/%state port)))
+ (gstate-output-buffer (port/state port)))
(define (generic-i/o-port-accessor index)
(guarantee-index-fixnum index 'GENERIC-I/O-PORT-ACCESSOR)
(lambda (port)
- (let ((extra (gstate-extra (port/%state port))))
+ (let ((extra (gstate-extra (port/state port))))
(if (not (fix:< index (vector-length extra)))
(error "Accessor index out of range:" index))
(vector-ref extra index))))
(define (generic-i/o-port-modifier index)
(guarantee-index-fixnum index 'GENERIC-I/O-PORT-MODIFIER)
(lambda (port object)
- (let ((extra (gstate-extra (port/%state port))))
+ (let ((extra (gstate-extra (port/state port))))
(if (not (fix:< index (vector-length extra)))
(error "Accessor index out of range:" index))
(vector-set! extra index object))))
#t)
(define (generic-io/coding port)
- (gstate-coding (port/%state port)))
+ (gstate-coding (port/state port)))
(define (generic-io/set-coding port name)
- (let ((state (port/%state port)))
+ (let ((state (port/state port)))
(let ((ib (gstate-input-buffer state)))
(if ib
(set-input-buffer-coding! ib name)))
(else '())))
(define (generic-io/line-ending port)
- (gstate-line-ending (port/%state port)))
+ (gstate-line-ending (port/state port)))
(define (generic-io/set-line-ending port name)
- (let ((state (port/%state port)))
+ (let ((state (port/state port)))
(let ((ib (gstate-input-buffer state)))
(if ib
(set-input-buffer-line-ending!
(write-string " from string" output-port))
(define (internal-in/eof? port)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(not (fix:< (iistate-next ss) (iistate-end ss)))))
(define (internal-in/read-substring port string start end)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(let ((n
(move-chars! (iistate-string ss) (iistate-next ss) (iistate-end ss)
string start end)))
narrow-in/unread-char))
(define (narrow-in/peek-char port)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (fix:< (iistate-next ss) (iistate-end ss))
(string-ref (iistate-string ss) (iistate-next ss))
(make-eof-object port))))
(define (narrow-in/read-char port)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (fix:< (iistate-next ss) (iistate-end ss))
(let ((char (string-ref (iistate-string ss) (iistate-next ss))))
(set-iistate-next! ss (fix:+ (iistate-next ss) 1))
(make-eof-object port))))
(define (narrow-in/unread-char port char)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (not (fix:< (iistate-start ss) (iistate-next ss)))
(error "No char to unread:" port))
(let ((prev (fix:- (iistate-next ss) 1)))
wide-in/unread-char))
(define (wide-in/peek-char port)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (fix:< (iistate-next ss) (iistate-end ss))
(wide-string-ref (iistate-string ss) (iistate-next ss))
(make-eof-object port))))
(define (wide-in/read-char port)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (fix:< (iistate-next ss) (iistate-end ss))
(let ((char (wide-string-ref (iistate-string ss) (iistate-next ss))))
(set-iistate-next! ss (fix:+ (iistate-next ss) 1))
(make-eof-object port))))
(define (wide-in/unread-char port char)
- (let ((ss (port/%state port)))
+ (let ((ss (port/state port)))
(if (not (fix:< (iistate-start ss) (iistate-next ss)))
(error "No char to unread:" port))
(let ((prev (fix:- (iistate-next ss) 1)))
(define (narrow-out/write-char port char)
(if (not (fix:< (char->integer char) #x100))
(error:not-8-bit-char char))
- (let ((os (port/%state port)))
+ (let ((os (port/state port)))
(maybe-grow-buffer os 1)
(string-set! (ostate-buffer os) (ostate-index os) char)
(set-ostate-index! os (fix:+ (ostate-index os) 1))
1))
(define (narrow-out/extract-output port)
- (let ((os (port/%state port)))
+ (let ((os (port/state port)))
(string-head (ostate-buffer os) (ostate-index os))))
(define (narrow-out/extract-output! port)
- (let* ((os (port/%state port))
+ (let* ((os (port/state port))
(output (string-head! (ostate-buffer os) (ostate-index os))))
(reset-buffer! os)
output))
wide-out/extract-output!))
(define (wide-out/write-char port char)
- (let ((os (port/%state port)))
+ (let ((os (port/state port)))
(maybe-grow-buffer os 1)
(wide-string-set! (ostate-buffer os) (ostate-index os) char)
(set-ostate-index! os (fix:+ (ostate-index os) 1))
1))
(define (wide-out/extract-output port)
- (let ((os (port/%state port)))
+ (let ((os (port/state port)))
(wide-substring (ostate-buffer os) 0 (ostate-index os))))
(define (wide-out/extract-output! port)
- (let ((os (port/%state port)))
+ (let ((os (port/state port)))
(let ((output (wide-substring (ostate-buffer os) 0 (ostate-index os))))
(reset-buffer! os)
output)))
column)
(define (string-out/output-column port)
- (ostate-column (port/%state port)))
+ (ostate-column (port/state port)))
(define (string-out/position port)
- (ostate-index (port/%state port)))
+ (ostate-index (port/state port)))
(define (string-out/write-self port output-port)
port
(write-string " to string" output-port))
(define (string-out/write-substring port string start end)
- (let ((os (port/%state port))
+ (let ((os (port/state port))
(n (- end start)))
(maybe-grow-buffer os n)
(let* ((start* (ostate-index os))