From: Chris Hanson Date: Thu, 18 Feb 1999 04:14:41 +0000 (+0000) Subject: Eliminate references to obsolete port operations. X-Git-Tag: 20090517-FFI~4614 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1111a23869af78e05e9b6b5b2cc8b499cae07f87;p=mit-scheme.git Eliminate references to obsolete port operations. --- diff --git a/v7/src/edwin/bufinp.scm b/v7/src/edwin/bufinp.scm index 0772879b5..ba9ff49ff 100644 --- a/v7/src/edwin/bufinp.scm +++ b/v7/src/edwin/bufinp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;;$Id: bufinp.scm,v 1.6 1999/02/16 20:12:24 cph Exp $ +;;;$Id: bufinp.scm,v 1.7 1999/02/18 04:14:41 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -29,7 +29,7 @@ value (receiver value - (let ((state (input-port/state port))) + (let ((state (port/state port))) (make-mark (buffer-input-port-state/group state) (buffer-input-port-state/current-index state)))))))) @@ -54,12 +54,12 @@ (define (operation/char-ready? port interval) interval ;ignore - (let ((state (input-port/state port))) + (let ((state (port/state port))) (< (buffer-input-port-state/current-index state) (buffer-input-port-state/end-index state)))) (define (operation/peek-char port) - (let ((state (input-port/state port))) + (let ((state (port/state port))) (let ((current-index (buffer-input-port-state/current-index state))) (if (< current-index (buffer-input-port-state/end-index state)) (group-right-char (buffer-input-port-state/group state) @@ -67,13 +67,13 @@ (make-eof-object port))))) (define (operation/discard-char port) - (let ((state (input-port/state port))) + (let ((state (port/state port))) (set-buffer-input-port-state/current-index! state (1+ (buffer-input-port-state/current-index state))))) (define (operation/read-char port) - (let ((state (input-port/state port))) + (let ((state (port/state port))) (let ((current-index (buffer-input-port-state/current-index state))) (if (< current-index (buffer-input-port-state/end-index state)) (let ((char @@ -85,7 +85,7 @@ (make-eof-object port))))) (define (operation/read-string port delimiters) - (let ((state (input-port/state port))) + (let ((state (port/state port))) (let ((current-index (buffer-input-port-state/current-index state)) (end-index (buffer-input-port-state/end-index state)) (group (buffer-input-port-state/group state))) @@ -101,7 +101,7 @@ string)))))) (define (operation/discard-chars port delimiters) - (let ((state (input-port/state port))) + (let ((state (port/state port))) (let ((current-index (buffer-input-port-state/current-index state)) (end-index (buffer-input-port-state/end-index state))) (if (< current-index end-index) @@ -118,7 +118,7 @@ (unparse-string state "from buffer at ") (unparse-object state - (let ((state (input-port/state port))) + (let ((state (port/state port))) (make-mark (buffer-input-port-state/group state) (buffer-input-port-state/current-index state))))) diff --git a/v7/src/edwin/tterm.scm b/v7/src/edwin/tterm.scm index 035b3b9d0..7d138479b 100644 --- a/v7/src/edwin/tterm.scm +++ b/v7/src/edwin/tterm.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: tterm.scm,v 1.29 1999/02/18 04:04:05 cph Exp $ +$Id: tterm.scm,v 1.30 1999/02/18 04:14:36 cph Exp $ Copyright (c) 1990-1999 Massachusetts Institute of Technology @@ -25,7 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (make-console-screen) (let ((description (console-termcap-description))) - (cond ((not (output-port/baud-rate console-output-port)) + (cond ((not (output-port/baud-rate console-i/o-port)) (error "standard output not a terminal")) ((not description) (error "terminal type not set")) @@ -37,9 +37,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ((not (no-undesirable-characteristics? description)) (error "terminal type has undesirable characteristics" (terminal-type-name description)))) - (let ((baud-rate (output-port/baud-rate console-output-port)) - (x-size (output-port/x-size console-output-port)) - (y-size (output-port/y-size console-output-port))) + (let ((baud-rate (output-port/baud-rate console-i/o-port)) + (x-size (output-port/x-size console-i/o-port)) + (y-size (output-port/y-size console-i/o-port))) (make-screen (with-values (lambda () (compute-scrolling-costs description @@ -86,7 +86,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (tty-set-interrupt-enables 1)) (define (output-port/baud-rate port) - (let ((channel (output-port/channel port))) + (let ((channel (port/output-channel port))) (and channel (channel-type=terminal? channel) (terminal-output-baud-rate channel)))) @@ -98,7 +98,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 0))) (define (output-port/y-size port) - ((output-port/custom-operation port 'Y-SIZE) port)) + ((output-port/operation port 'Y-SIZE) port)) (define (console-available?) (let ((description (console-termcap-description))) @@ -111,7 +111,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (set! console-description (let ((term (get-environment-variable "TERM"))) (and term - (or (and (output-port/baud-rate console-output-port) + (or (and (output-port/baud-rate console-i/o-port) (make-termcap-description term)) term))))) console-description) @@ -158,7 +158,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ))) (define (get-console-input-operations terminal-state) - (let ((channel (input-port/channel console-input-port)) + (let ((channel (port/input-channel console-i/o-port)) (string (make-string (* 3 input-buffer-size))) (start 0) (end 0) @@ -353,9 +353,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (bind-console-state false (lambda (get-outside-state) (terminal-operation terminal-raw-input - (input-port/channel console-input-port)) + (port/input-channel console-i/o-port)) (terminal-operation terminal-raw-output - (output-port/channel console-output-port)) + (port/output-channel console-i/o-port)) (tty-set-interrupt-enables 2) (receiver (lambda (thunk) @@ -378,14 +378,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (set-console-state! outside-state))))) (define (console-state) - (vector (channel-state (input-port/channel console-input-port)) - (channel-state (output-port/channel console-output-port)) + (vector (channel-state (port/input-channel console-i/o-port)) + (channel-state (port/output-channel console-i/o-port)) (tty-get-interrupt-enables))) (define (set-console-state! state) - (set-channel-state! (input-port/channel console-input-port) + (set-channel-state! (port/input-channel console-i/o-port) (vector-ref state 0)) - (set-channel-state! (output-port/channel console-output-port) + (set-channel-state! (port/output-channel console-i/o-port) (vector-ref state 1)) (tty-set-interrupt-enables (vector-ref state 2))) @@ -491,7 +491,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (exit-standout-mode screen) (exit-insert-mode screen) (maybe-output screen (ts-exit-termcap-mode description))) - (output-port/flush-output console-output-port)) + (output-port/flush-output console-i/o-port)) (define (console-modeline-event! screen window type) screen window type @@ -500,14 +500,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (console-wrap-update! screen thunk) screen (let ((finished? (thunk))) - (output-port/flush-output console-output-port) + (output-port/flush-output console-i/o-port) finished?)) (define (console-discretionary-flush screen) - (let ((n (output-port/buffered-chars console-output-port))) + (let ((n (output-port/buffered-chars console-i/o-port))) (if (fix:< 20 n) (begin - (output-port/flush-output console-output-port) + (output-port/flush-output console-i/o-port) (let ((baud-rate (screen-baud-rate screen))) (if (fix:< baud-rate 2400) (let ((msec (quotient (* n 10000) baud-rate))) @@ -522,7 +522,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (console-flush! screen) screen - (output-port/flush-output console-output-port)) + (output-port/flush-output console-i/o-port)) (define (console-write-cursor! screen x y) (move-cursor screen x y)) @@ -536,7 +536,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (exit-insert-mode screen) (move-cursor screen x y) (highlight-if-desired screen highlight) - (output-port/write-char console-output-port char) + (output-port/write-char console-i/o-port char) (record-cursor-after-output screen (fix:1+ x))))) (define (console-write-substring! screen x y string start end highlight) @@ -553,7 +553,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (screen-x-size screen)))) (fix:-1+ end) end))) - (output-port/write-substring console-output-port string start end) + (output-port/write-substring console-i/o-port string start end) (record-cursor-after-output screen (fix:+ x (fix:- end start))))))) (define (console-clear-line! screen x y first-unused-x) @@ -685,7 +685,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. first-unused-x))) (do ((x (screen-cursor-x screen) (fix:1+ x))) ((fix:= x first-unused-x)) - (output-port/write-char console-output-port #\space)) + (output-port/write-char console-i/o-port #\space)) (record-cursor-after-output screen first-unused-x))))))) (define (clear-multi-char screen n) @@ -710,7 +710,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. x-end)))) (do ((x cursor-x (fix:1+ x))) ((fix:= x x-end)) - (output-port/write-char console-output-port #\space)) + (output-port/write-char console-i/o-port #\space)) (record-cursor-after-output screen x-end)))))))) (define (insert-lines screen yl yu n) @@ -1031,7 +1031,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (output-n screen command 1)) (define-integrable (output-n screen command n-lines) - (output-port/write-string console-output-port + (output-port/write-string console-i/o-port (pad-string screen command n-lines))) (define (maybe-output screen command) @@ -1163,7 +1163,7 @@ Note that the multiply factors are in tenths of characters. |# (state (screen-state screen))) (if (not (terminal-state? state)) (editor-error "Not a terminal screen") - (let ((port console-output-port) + (let ((port console-i/o-port) (desc (terminal-state/description state))) (let ((x-size (output-port/x-size port)) (y-size (output-port/y-size port))) diff --git a/v7/src/runtime/dosproc.scm b/v7/src/runtime/dosproc.scm index 3572cc656..5506f4ae3 100644 --- a/v7/src/runtime/dosproc.scm +++ b/v7/src/runtime/dosproc.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: dosproc.scm,v 1.2 1999/01/02 06:11:34 cph Exp $ +$Id: dosproc.scm,v 1.3 1999/02/18 04:14:10 cph Exp $ Copyright (c) 1992-1999 Massachusetts Institute of Technology @@ -47,7 +47,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (lambda (port*) (recvr (channel-descriptor - (output-port/channel port*))))))) + (port/output-channel port*))))))) (call-with-input-file fname (lambda (input) (let ((string (read-string (char-set) input))) @@ -67,7 +67,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (lambda (port*) (recvr (channel-descriptor - (input-port/channel port*)))))))) + (port/input-channel port*)))))))) (define (with-output-channel in out) (cond ((default-object? stderr) @@ -76,7 +76,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (run in out -1)) ((not (output-port? stderr)) (error "run: stderr not an output port" stderr)) - ((output-port/channel stderr) + ((port/output-channel stderr) => (lambda (channel) (output-port/flush-output stderr) @@ -98,7 +98,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (with-output-channel in -1)) ((not (output-port? stdout)) (error "run: stdout not an output port" stdout)) - ((output-port/channel stdout) + ((port/output-channel stdout) => (lambda (channel) (output-port/flush-output stdout) @@ -113,7 +113,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (with-input-channel -1)) ((not (input-port? stdin)) (error "run: stdin not an input port" stdin)) - ((input-port/channel stdin) + ((port/input-channel stdin) => (lambda (channel) (with-input-channel (channel-descriptor channel)))) (else diff --git a/v7/src/runtime/strnin.scm b/v7/src/runtime/strnin.scm index acf10c638..536bf328a 100644 --- a/v7/src/runtime/strnin.scm +++ b/v7/src/runtime/strnin.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: strnin.scm,v 14.6 1999/02/16 20:11:55 cph Exp $ +$Id: strnin.scm,v 14.7 1999/02/18 04:14:22 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -68,16 +68,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (end #f read-only #t)) (define-integrable (input-port/string port) - (input-string-state/string (input-port/state port))) + (input-string-state/string (port/state port))) (define-integrable (input-port/start port) - (input-string-state/start (input-port/state port))) + (input-string-state/start (port/state port))) (define-integrable (set-input-port/start! port index) - (set-input-string-state/start! (input-port/state port) index)) + (set-input-string-state/start! (port/state port) index)) (define-integrable (input-port/end port) - (input-string-state/end (input-port/state port))) + (input-string-state/end (port/state port))) (define (operation/char-ready? port interval) interval diff --git a/v7/src/runtime/strott.scm b/v7/src/runtime/strott.scm index d2e2aedff..c84c6a1a3 100644 --- a/v7/src/runtime/strott.scm +++ b/v7/src/runtime/strott.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: strott.scm,v 14.7 1999/02/16 20:11:51 cph Exp $ +$Id: strott.scm,v 14.8 1999/02/18 04:14:19 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -54,7 +54,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. counter) (define (operation/write-char port char) - (let ((state (output-port/state port))) + (let ((state (port/state port))) (let ((accumulator (output-string-state/accumulator state)) (counter (output-string-state/counter state))) (if (zero? counter) @@ -67,7 +67,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (set-output-string-state/counter! state (-1+ counter))))))) (define (operation/write-substring port string start end) - (let ((state (output-port/state port))) + (let ((state (port/state port))) (let ((accumulator (cons (substring string start end) (output-string-state/accumulator state))) diff --git a/v7/src/runtime/strout.scm b/v7/src/runtime/strout.scm index a328611d8..3bebb239a 100644 --- a/v7/src/runtime/strout.scm +++ b/v7/src/runtime/strout.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: strout.scm,v 14.10 1999/02/16 20:11:47 cph Exp $ +$Id: strout.scm,v 14.11 1999/02/18 04:14:15 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -68,7 +68,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (operation/write-char port char) (without-interrupts (lambda () - (let* ((state (output-port/state port)) + (let* ((state (port/state port)) (n (output-string-state/counter state)) (n* (fix:+ n 1))) (if (fix:= (string-length (output-string-state/accumulator state)) n) @@ -79,7 +79,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (operation/write-substring port string start end) (without-interrupts (lambda () - (let* ((state (output-port/state port)) + (let* ((state (port/state port)) (n (output-string-state/counter state)) (n* (fix:+ n (fix:- end start)))) (if (fix:> n* (string-length (output-string-state/accumulator state))) diff --git a/v8/src/runtime/load.scm b/v8/src/runtime/load.scm index 1b05a5f6d..c418fdded 100644 --- a/v8/src/runtime/load.scm +++ b/v8/src/runtime/load.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: load.scm,v 14.53 1999/01/02 06:11:34 cph Exp $ +$Id: load.scm,v 14.54 1999/02/18 04:14:03 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -624,7 +624,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (with-binary-input-file file action) (with-binary-file-channel file action open-binary-input-file - input-port/channel + port/input-channel 'with-binary-input-file)) (define (with-binary-file-channel file action open extract-channel name)