;;; -*-Scheme-*-
;;;
-;;; $Id: fileio.scm,v 1.123 1995/01/06 01:07:23 cph Exp $
+;;; $Id: fileio.scm,v 1.124 1995/01/31 19:35:11 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
;;;
(and *translate-file-data-on-input?*
(let ((translation (pathname-newline-translation truename)))
(and translation
- (make-input-buffer channel
- 4096
- translation
- (pathname-end-of-file-marker/input
- truename)))))))
+ (make-input-buffer channel 4096 translation))))))
(bind-condition-handler (list condition-type:allocation-failure)
(lambda (condition)
condition
#| -*-Scheme-*-
-$Id: dosprm.scm,v 1.24 1995/01/06 00:39:44 cph Exp $
+$Id: dosprm.scm,v 1.25 1995/01/31 19:34:24 cph Exp $
Copyright (c) 1992-95 Massachusetts Institute of Technology
(define (os/default-end-of-line-translation)
"\r\n")
-(define (os/default-end-of-file-marker/input)
- #f)
-
-(define (os/default-end-of-file-marker/output)
- #f)
-
(define (initialize-system-primitives!)
(let ((reset!
(lambda ()
#| -*-Scheme-*-
-$Id: dospth.scm,v 1.21 1995/01/06 00:39:50 cph Exp $
+$Id: dospth.scm,v 1.22 1995/01/31 19:34:38 cph Exp $
Copyright (c) 1992-95 Massachusetts Institute of Technology
(declare (usual-integrations))
\f
(define hook/dos/end-of-line-string)
-(define hook/dos/end-of-file-marker/input)
-(define hook/dos/end-of-file-marker/output)
(define sub-directory-delimiters
;; Allow forward slashes as well as backward slashes so that
dos/user-homedir-pathname
dos/init-file-pathname
dos/pathname-simplify
- dos/end-of-line-string
- dos/end-of-file-marker/input
- dos/end-of-file-marker/output))
+ dos/end-of-line-string))
(define (initialize-package!)
(set! hook/dos/end-of-line-string default/dos/end-of-line-string)
- (set! hook/dos/end-of-file-marker/input default/dos/end-of-file-marker/input)
- (set! hook/dos/end-of-file-marker/output
- default/dos/end-of-file-marker/output)
(add-pathname-host-type! 'DOS make-dos-host-type))
\f
;;;; Pathname Parser
(define (default/dos/end-of-line-string pathname)
pathname ; ignored
- (os/default-end-of-line-translation))
-
-(define (dos/end-of-file-marker/input pathname)
- (hook/dos/end-of-file-marker/input pathname))
-
-(define (default/dos/end-of-file-marker/input pathname)
- pathname ; ignored
- (os/default-end-of-file-marker/input))
-
-(define (dos/end-of-file-marker/output pathname)
- (hook/dos/end-of-file-marker/output pathname))
-
-(define (default/dos/end-of-file-marker/output pathname)
- pathname ; ignored
- (os/default-end-of-file-marker/output))
\ No newline at end of file
+ (os/default-end-of-line-translation))
\ No newline at end of file
#| -*-Scheme-*-
-$Id: fileio.scm,v 1.8 1994/11/20 05:04:35 cph Exp $
+$Id: fileio.scm,v 1.9 1995/01/31 19:34:39 cph Exp $
-Copyright (c) 1991-94 Massachusetts Institute of Technology
+Copyright (c) 1991-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(make-file-state
(make-input-buffer channel
input-buffer-size
- (pathname-newline-translation pathname)
- (pathname-end-of-file-marker/input pathname))
+ (pathname-newline-translation pathname))
false
pathname))))
(set-channel-port! channel port)
false
(make-output-buffer channel
output-buffer-size
- (pathname-newline-translation pathname)
- (pathname-end-of-file-marker/output pathname))
+ (pathname-newline-translation pathname))
pathname))))
(set-channel-port! channel port)
port))
(port/copy
i/o-file-template
(make-file-state
- (make-input-buffer channel
- input-buffer-size
- translation
- (pathname-end-of-file-marker/input pathname))
- (make-output-buffer channel
- output-buffer-size
- translation
- (pathname-end-of-file-marker/output pathname))
+ (make-input-buffer channel input-buffer-size translation)
+ (make-output-buffer channel output-buffer-size translation)
pathname))))
(set-channel-port! channel port)
port))
(port/copy input-file-template
(make-file-state (make-input-buffer channel
input-buffer-size
- false
false)
false
pathname))))
(make-file-state false
(make-output-buffer channel
output-buffer-size
- false
false)
pathname))))
(set-channel-port! channel port)
(port/copy i/o-file-template
(make-file-state (make-input-buffer channel
input-buffer-size
- false
false)
(make-output-buffer channel
output-buffer-size
- false
false)
pathname))))
(set-channel-port! channel port)
#| -*-Scheme-*-
-$Id: io.scm,v 14.41 1995/01/06 00:44:47 cph Exp $
+$Id: io.scm,v 14.42 1995/01/31 19:34:41 cph Exp $
Copyright (c) 1988-95 Massachusetts Institute of Technology
string
position
line-translation ; string that newline maps to
- logical-size
- end-marker)
+ logical-size)
(define (output-buffer-sizes translation buffer-size)
(let ((logical-size
(fix:+ logical-size
(fix:- (string-length translation) 1))))))
-(define (make-output-buffer channel buffer-size
- #!optional line-translation end-marker)
+(define (make-output-buffer channel buffer-size #!optional line-translation)
(let ((translation
(if (default-object? line-translation)
(os/default-end-of-line-translation)
(make-string string-size))
0
translation
- logical-size
- (if (default-object? end-marker)
- (os/default-end-of-file-marker/output)
- end-marker))))))
+ logical-size)))))
(define (output-buffer/close buffer)
- (cond ((output-buffer/end-marker buffer)
- => (lambda (marker)
- (output-buffer/write-char-block buffer marker))))
(output-buffer/drain-block buffer)
(channel-close (output-buffer/channel buffer)))
;; END-INDEX is zero iff CHANNEL is closed.
end-index
line-translation ; string that maps to newline
- real-end
- end-marker)
+ real-end)
(define (input-buffer-size translation buffer-size)
(cond ((not translation)
(else
buffer-size)))
-(define (make-input-buffer channel buffer-size
- #!optional line-translation end-marker)
+(define (make-input-buffer channel buffer-size #!optional line-translation)
(let* ((translation
(if (default-object? line-translation)
(os/default-end-of-line-translation)
string-size
string-size
translation
- string-size
- (if (default-object? end-marker)
- (os/default-end-of-file-marker/input)
- end-marker))))
+ string-size)))
(define (input-buffer/close buffer)
(without-interrupts
(let ((n-read
(channel-read channel string delta (string-length string))))
(and n-read
- (let ((n-read
- (let ((marker (input-buffer/end-marker buffer)))
- (let ((index
- (and marker
- (channel-type=file? channel)
- (substring-find-next-char
- string
- delta
- (fix:+ delta n-read)
- marker))))
- (if index
- (begin
- (channel-close channel)
- (fix:- index delta))
- (begin
- (if (fix:= n-read 0)
- (channel-close channel))
- n-read))))))
- (let ((end-index (fix:+ delta n-read)))
- (set-input-buffer/start-index! buffer 0)
- (set-input-buffer/end-index! buffer end-index)
- (set-input-buffer/real-end! buffer end-index)
- (if (and (input-buffer/line-translation buffer)
- (not (fix:= end-index 0)))
- (input-buffer/translate! buffer)
- end-index))))))))
+ (let ((end-index (fix:+ delta n-read)))
+ (if (fix:= n-read 0)
+ (channel-close channel))
+ (set-input-buffer/start-index! buffer 0)
+ (set-input-buffer/end-index! buffer end-index)
+ (set-input-buffer/real-end! buffer end-index)
+ (if (and (input-buffer/line-translation buffer)
+ (not (fix:= end-index 0)))
+ (input-buffer/translate! buffer)
+ end-index)))))))
(define-integrable (input-buffer/fill* buffer)
(let ((n (input-buffer/fill buffer)))
(and (channel-open? channel)
(channel-type=file? channel)
(not (input-buffer/line-translation buffer))
- (not (input-buffer/end-marker buffer))
(let ((n
(fix:- (channel-file-length channel)
(channel-file-position channel))))
#| -*-Scheme-*-
-$Id: os2prm.scm,v 1.3 1995/01/06 00:39:38 cph Exp $
+$Id: os2prm.scm,v 1.4 1995/01/31 19:34:44 cph Exp $
-Copyright (c) 1994 Massachusetts Institute of Technology
+Copyright (c) 1994-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(define (os/default-end-of-line-translation)
"\r\n")
-
-(define (os/default-end-of-file-marker/input)
- #f)
-
-(define (os/default-end-of-file-marker/output)
- #f)
\f
(define (initialize-system-primitives!)
(discard-select-registry-result-vectors!)
#| -*-Scheme-*-
-$Id: pathnm.scm,v 14.29 1994/12/19 21:03:26 cph Exp $
+$Id: pathnm.scm,v 14.30 1995/01/31 19:34:47 cph Exp $
-Copyright (c) 1988-94 Massachusetts Institute of Technology
+Copyright (c) 1988-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(let ((pathname (->pathname pathname)))
((host-operation/end-of-line-string (%pathname-host pathname))
pathname)))
-
-(define (pathname-end-of-file-marker/input pathname)
- (let ((pathname (->pathname pathname)))
- ((host-operation/end-of-file-marker/input (%pathname-host pathname))
- pathname)))
-
-(define (pathname-end-of-file-marker/output pathname)
- (let ((pathname (->pathname pathname)))
- ((host-operation/end-of-file-marker/output (%pathname-host pathname))
- pathname)))
\f
(define (pathname=? x y)
(let ((x (->pathname x))
(operation/user-homedir-pathname false read-only true)
(operation/init-file-pathname false read-only true)
(operation/pathname-simplify false read-only true)
- (operation/end-of-line-string false read-only true)
- (operation/end-of-file-marker/input false read-only true)
- (operation/end-of-file-marker/output false read-only true))
+ (operation/end-of-line-string false read-only true))
(define-structure (host (type vector)
(named ((ucode-primitive string->symbol)
(define (host-operation/end-of-line-string host)
(host-type/operation/end-of-line-string (host/type host)))
-
-(define (host-operation/end-of-file-marker/input host)
- (host-type/operation/end-of-file-marker/input (host/type host)))
-
-(define (host-operation/end-of-file-marker/output host)
- (host-type/operation/end-of-file-marker/output (host/type host)))
\f
;;;; File System Stuff
(let ((fail
(lambda arguments
(error "Unimplemented host type:" name arguments))))
- (make-host-type index name
- fail fail fail fail fail
- fail fail fail fail fail
- fail fail fail))))
+ (make-host-type index name fail fail fail fail fail fail fail fail fail
+ fail fail))))
(define (reset-package!)
(let ((host-type (host-name->type microcode-id/operating-system))
#| -*-Scheme-*-
-$Id: unxprm.scm,v 1.32 1995/01/06 00:39:31 cph Exp $
+$Id: unxprm.scm,v 1.33 1995/01/31 19:34:50 cph Exp $
Copyright (c) 1988-95 Massachusetts Institute of Technology
(define (os/default-end-of-line-translation)
#f)
-
-(define (os/default-end-of-file-marker/input)
- #f)
-
-(define (os/default-end-of-file-marker/output)
- #f)
\f
;;; Queues after-restart daemon to clean up environment space
#| -*-Scheme-*-
-$Id: unxpth.scm,v 14.16 1994/11/28 05:45:12 cph Exp $
+$Id: unxpth.scm,v 14.17 1995/01/31 19:34:54 cph Exp $
-Copyright (c) 1988-94 Massachusetts Institute of Technology
+Copyright (c) 1988-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
unix/user-homedir-pathname
unix/init-file-pathname
unix/pathname-simplify
- unix/end-of-line-string
- unix/end-of-file-marker/input
- unix/end-of-file-marker/output))
+ unix/end-of-line-string))
(define (initialize-package!)
(add-pathname-host-type! 'UNIX make-unix-host-type))
(define (unix/end-of-line-string pathname)
pathname ; ignored
- "\n")
-
-(define (unix/end-of-file-marker/input pathname)
- pathname ; ignored
- false)
-
-(define (unix/end-of-file-marker/output pathname)
- pathname ; ignored
- false)
\ No newline at end of file
+ "\n")
\ No newline at end of file