Rename procedures:
authorChris Hanson <org/chris-hanson/cph>
Sun, 20 Nov 1994 05:06:56 +0000 (05:06 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 20 Nov 1994 05:06:56 +0000 (05:06 +0000)
  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
v7/src/edwin/fileio.scm
v7/src/runtime/fileio.scm
v7/src/runtime/io.scm
v7/src/runtime/sfile.scm

index 71aedb123d60d9c7420ad2c0f4b9fcfb3cec0d3e..41f5c88fa6eddbb8ad26db5ab5c76922b29f2018 100644 (file)
@@ -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)
index 153062661d9679e58f7cb70f8fdd501f767493f6..df42b7c70ba47895a357c7bef6c2556079194155 100644 (file)
@@ -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
index ce3b2e301bbf5abad7802b4e978b58da063420c1..8151b36a6d5b65b902c80445e0db3c301c631b50 100644 (file)
@@ -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)))
index aa093170b7538cbb1f33e4fbc6c9f55f9575609f..7185d848b1351f84b55525c439d207ce0f36aa0e 100644 (file)
@@ -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))))))
 
index 7a6256fc424e97b305755cc2307654f3c4b90c33..eca51fa47bc4e5e94fe42813ba91a77a07a42fb7 100644 (file)
@@ -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