From b0395b8de723675c0fe915e0ae327b2c455ca8f8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 10 Jan 2017 21:12:51 -0800 Subject: [PATCH] Rename source/sink custom operations for export. --- src/runtime/binary-port.scm | 15 ++++++++------- src/runtime/runtime.pkg | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/runtime/binary-port.scm b/src/runtime/binary-port.scm index c129ea01d..d6f5bf621 100644 --- a/src/runtime/binary-port.scm +++ b/src/runtime/binary-port.scm @@ -151,13 +151,14 @@ USA. (define (get-output-bytevector port) (guarantee bytevector-output-port? port 'get-output-bytevector) - ((sink-custom-ref (buffer-source/sink (port-output-buffer port)) 1))) + ((output-sink-custom-ref (buffer-source/sink (port-output-buffer port)) 1))) (define (bytevector-output-port? object) (and (binary-output-port? object) (let ((sink (buffer-source/sink (port-output-buffer object)))) - (and (fix:= (sink-custom-length sink) 2) - (eq? bytevector-output-port-tag (sink-custom-ref sink 0)))))) + (and (fix:= (output-sink-custom-length sink) 2) + (eq? bytevector-output-port-tag + (output-sink-custom-ref sink 0)))))) (define bytevector-output-port-tag (list 'bytevector-output-port-tag)) @@ -671,10 +672,10 @@ USA. (define (source-read-bytes! source bv bs be) ((vector-ref (source/sink-custom source) 1) bv bs be)) -(define (source-custom-length source) +(define (input-source-custom-length source) (fix:- (vector-length (source/sink-custom source)) 2)) -(define (source-custom-ref source index) +(define (input-source-custom-ref source index) (vector-ref (source/sink-custom source) (fix:+ index 2))) (define (make-channel-output-sink channel) @@ -688,8 +689,8 @@ USA. (define (sink-write-bytes sink bv bs be) ((vector-ref (source/sink-custom sink) 0) bv bs be)) -(define (sink-custom-length sink) +(define (output-sink-custom-length sink) (fix:- (vector-length (source/sink-custom sink)) 1)) -(define (sink-custom-ref sink index) +(define (output-sink-custom-ref sink index) (vector-ref (source/sink-custom sink) (fix:+ index 1))) \ No newline at end of file diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 7c4406c62..5c01f3dc3 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -2438,6 +2438,8 @@ USA. (export (runtime) (input-source-channel source/sink-channel) (output-source-channel source/sink-channel) + input-source-custom-length + input-source-custom-ref input-source? make-binary-i/o-port make-binary-input-port @@ -2446,6 +2448,8 @@ USA. make-channel-output-sink make-non-channel-input-source make-non-channel-output-sink + output-sink-custom-length + output-sink-custom-ref output-sink?) (export (runtime port) binary-i/o-port? -- 2.25.1