From 16aabf03d4fbc4e5be1429c04321f87a529cdec7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 20 Nov 1994 05:06:56 +0000 Subject: [PATCH] Rename procedures: file-length => channel-file-length file-position => channel-file-position file-set-position => channel-file-set-position This is needed to free up `file-length' for use as a procedure that accepts a file name as argument and returns the file's length. --- v7/src/edwin/docstr.scm | 8 ++++---- v7/src/edwin/fileio.scm | 4 ++-- v7/src/runtime/fileio.scm | 6 +++--- v7/src/runtime/io.scm | 19 +++++++++++-------- v7/src/runtime/sfile.scm | 4 ++-- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/v7/src/edwin/docstr.scm b/v7/src/edwin/docstr.scm index 71aedb123..41f5c88fa 100644 --- a/v7/src/edwin/docstr.scm +++ b/v7/src/edwin/docstr.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: docstr.scm,v 1.1 1993/09/03 04:41:53 cph Exp $ +$Id: docstr.scm,v 1.2 1994/11/20 05:06:04 cph Exp $ -Copyright (c) 1993 Massachusetts Institute of Technology +Copyright (c) 1993-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -125,12 +125,12 @@ of that license should have been included along with this file. (guarantee-doc-string-state) (let* ((channel *doc-string-channel*) (buffer *doc-string-buffer*) - (flen (file-length channel)) + (flen (channel-file-length channel)) (nlen (string-length name)) (delta (fix:- flen (fix:+ posn 2)))) (if (fix:< delta 0) (out-of-range)) - (file-set-position channel posn) + (channel-file-set-position channel posn) (let ((blen (min doc-string-buffer-length delta))) (fill-buffer channel buffer 0 blen) (let* ((dslen (fix:+ (vector-8b-ref buffer 0) diff --git a/v7/src/edwin/fileio.scm b/v7/src/edwin/fileio.scm index 153062661..df42b7c70 100644 --- a/v7/src/edwin/fileio.scm +++ b/v7/src/edwin/fileio.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: fileio.scm,v 1.120 1994/05/04 22:56:34 cph Exp $ +;;; $Id: fileio.scm,v 1.121 1994/11/20 05:06:21 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology ;;; @@ -145,7 +145,7 @@ Each procedure is called with three arguments: (define (group-insert-file! group index truename) (let ((filename (->namestring truename))) (let ((channel (file-open-input-channel filename))) - (let ((length (file-length channel))) + (let ((length (channel-file-length channel))) (bind-condition-handler (list condition-type:allocation-failure) (lambda (condition) condition diff --git a/v7/src/runtime/fileio.scm b/v7/src/runtime/fileio.scm index ce3b2e301..8151b36a6 100644 --- a/v7/src/runtime/fileio.scm +++ b/v7/src/runtime/fileio.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: fileio.scm,v 1.7 1993/10/21 14:52:36 cph Exp $ +$Id: fileio.scm,v 1.8 1994/11/20 05:04:35 cph Exp $ -Copyright (c) 1991-1993 Massachusetts Institute of Technology +Copyright (c) 1991-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -258,7 +258,7 @@ MIT in each case. |# (pathname false read-only true)) (define (operation/length port) - (file-length (operation/input-channel port))) + (channel-file-length (operation/input-channel port))) (define (operation/pathname port) (file-state/pathname (port/state port))) diff --git a/v7/src/runtime/io.scm b/v7/src/runtime/io.scm index aa093170b..7185d848b 100644 --- a/v7/src/runtime/io.scm +++ b/v7/src/runtime/io.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: io.scm,v 14.38 1994/11/14 00:13:38 cph Exp $ +$Id: io.scm,v 14.39 1994/11/20 05:03:33 cph Exp $ -Copyright (c) 1988-1993 Massachusetts Institute of Technology +Copyright (c) 1988-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -357,13 +357,13 @@ MIT in each case. |# (define (file-open-append-channel filename) (file-open (ucode-primitive file-open-append-channel 1) filename)) -(define (file-length channel) +(define (channel-file-length channel) ((ucode-primitive file-length-new 1) (channel-descriptor channel))) -(define (file-position channel) +(define (channel-file-position channel) ((ucode-primitive file-position 1) (channel-descriptor channel))) -(define (file-set-position channel position) +(define (channel-file-set-position channel position) ((ucode-primitive file-set-position 2) (channel-descriptor channel) position)) @@ -846,8 +846,9 @@ MIT in each case. |# => (lambda (marker) (if (and (fix:> n-read 0) (channel-type=file? channel) - (fix:= (file-position channel) - (file-length channel)) + (fix:= + (channel-file-position channel) + (channel-file-length channel)) (char=? (string-ref string (+ delta @@ -881,7 +882,9 @@ MIT in each case. |# (channel-type=file? channel) (not (input-buffer/line-translation buffer)) ; Can't tell otherwise (not (input-buffer/end-marker buffer)) ; Can't tell otherwise - (let ((n (fix:- (file-length channel) (file-position channel)))) + (let ((n + (fix:- (channel-file-length channel) + (channel-file-position channel)))) (and (fix:>= n 0) (fix:+ (input-buffer/buffered-chars buffer) n)))))) diff --git a/v7/src/runtime/sfile.scm b/v7/src/runtime/sfile.scm index 7a6256fc4..eca51fa47 100644 --- a/v7/src/runtime/sfile.scm +++ b/v7/src/runtime/sfile.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: sfile.scm,v 14.13 1994/05/04 22:47:10 cph Exp $ +$Id: sfile.scm,v 14.14 1994/11/20 05:06:56 cph Exp $ Copyright (c) 1988-94 Massachusetts Institute of Technology @@ -73,7 +73,7 @@ MIT in each case. |# (file-open-output-channel output-filename))) unspecific) (lambda () - (let ((source-length (file-length input-channel)) + (let ((source-length (channel-file-length input-channel)) (buffer-length 8192)) (if (zero? source-length) 0 -- 2.25.1