From: Chris Hanson Date: Tue, 21 Dec 1999 19:05:20 +0000 (+0000) Subject: Implement READ-SUBSTRING!, and change definition of READ-STRING! so X-Git-Tag: 20090517-FFI~4398 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=abfef0bfffd03830ad02e3142228ab0ee5c3998d;p=mit-scheme.git Implement READ-SUBSTRING!, and change definition of READ-STRING! so that it no longer takes the substring range arguments. --- diff --git a/v7/src/runtime/blowfish.scm b/v7/src/runtime/blowfish.scm index cdeeb301d..9a127ecd1 100644 --- a/v7/src/runtime/blowfish.scm +++ b/v7/src/runtime/blowfish.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: blowfish.scm,v 1.17 1999/08/14 03:41:01 cph Exp $ +$Id: blowfish.scm,v 1.18 1999/12/21 19:05:18 cph Exp $ Copyright (c) 1997, 1999 Massachusetts Institute of Technology @@ -152,7 +152,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (make-string 8 #\NUL)) ((string=? blowfish-file-header-v2 line) (let ((init-vector (make-string 8))) - (if (not (= 8 (read-string! init-vector 0 8 port))) + (if (not (= 8 (read-substring! init-vector 0 8 port))) (error "Short read while getting init-vector:" port)) init-vector)) (else @@ -176,7 +176,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. unspecific) (lambda () (let loop () - (let ((n (read-string! buffer 0 4096 port))) + (let ((n (read-substring! buffer 0 4096 port))) (if (fix:= 0 n) (md5-final context) (begin diff --git a/v7/src/runtime/input.scm b/v7/src/runtime/input.scm index 588621267..b181b66fe 100644 --- a/v7/src/runtime/input.scm +++ b/v7/src/runtime/input.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: input.scm,v 14.19 1999/01/02 06:11:34 cph Exp $ +$Id: input.scm,v 14.20 1999/12/21 19:05:13 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -130,14 +130,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (current-input-port) (guarantee-input-port port)))) -(define (read-string! string #!optional start end port) +(define (read-string! string #!optional port) + (input-port/read-string! (if (default-object? port) + (current-input-port) + (guarantee-input-port port)) + string)) + +(define (read-substring! string start end #!optional port) (input-port/read-substring! (if (default-object? port) (current-input-port) (guarantee-input-port port)) - string - (if (default-object? start) - 0 - start) - (if (default-object? end) - (string-length string) - end))) \ No newline at end of file + string start end)) \ No newline at end of file diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 4df0d143b..ee3b9b36e 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.333 1999/12/16 22:06:35 cph Exp $ +$Id: runtime.pkg,v 14.334 1999/12/21 19:05:20 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -1198,7 +1198,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. read-char-no-hang read-line read-string - read-string!) + read-string! + read-substring!) (export (runtime primitive-io) eof-object))