Rename 'bytes' I/O to 'octets'.
authorChris Hanson <org/chris-hanson/cph>
Sat, 26 Jul 2008 05:45:36 +0000 (05:45 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 26 Jul 2008 05:45:36 +0000 (05:45 +0000)
v7/src/runtime/runtime.pkg
v7/src/runtime/stringio.scm
v7/src/runtime/unicode.scm
v7/src/ssp/mod-lisp.scm
v7/src/ssp/xmlrpc.scm
v7/src/xml/xml-output.scm

index b6c21b128ba6037841365b15feff817da38dbede..749b04b1e53bc7dcbdc7f672622fe1fd367eb15e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.651 2008/07/26 05:12:20 cph Exp $
+$Id: runtime.pkg,v 14.652 2008/07/26 05:45:35 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -4100,18 +4100,18 @@ USA.
          (open-wide-input-string open-input-string)
          (string->input-port open-input-string)
          (with-string-output-port call-with-narrow-output-string)
-         call-with-input-bytes
+         call-with-input-octets
          call-with-input-string
          call-with-narrow-output-string
-         call-with-output-bytes
+         call-with-output-octets
          call-with-truncated-output-string
          call-with-wide-output-string
          get-output-string
          get-output-string!
-         open-input-bytes
+         open-input-octets
          open-input-string
          open-narrow-output-string
-         open-output-bytes
+         open-output-octets
          open-wide-output-string
          with-input-from-string
          with-output-to-string
index 374b4a019bb5bd94e04088fd592f99417bfa4322..1d6298fc6112f4c534801fc93a3f1da4047b9075 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: stringio.scm,v 14.2 2008/07/26 05:12:20 cph Exp $
+$Id: stringio.scm,v 14.3 2008/07/26 05:45:36 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -331,25 +331,25 @@ USA.
 \f
 ;;;; Input as byte vector
 
-(define (call-with-input-bytes bytes procedure)
-  (let ((port (open-input-bytes bytes)))
+(define (call-with-input-octets octets procedure)
+  (let ((port (open-input-octets octets)))
     (let ((value (procedure port)))
       (close-input-port port)
       value)))
 
-(define (open-input-bytes bytes #!optional start end)
-  (guarantee-xstring bytes 'OPEN-INPUT-BYTES)
+(define (open-input-octets octets #!optional start end)
+  (guarantee-xstring octets 'OPEN-INPUT-OCTETS)
   (receive (start end)
-      (check-index-limits start end (xstring-length bytes) 'OPEN-INPUT-BYTES)
+      (check-index-limits start end (xstring-length octets) 'OPEN-INPUT-OCTETS)
     (let ((port
-          (make-generic-i/o-port (make-bytes-source bytes start end)
+          (make-generic-i/o-port (make-octets-source octets start end)
                                  #f
-                                 bytes-input-type)))
+                                 octets-input-type)))
       (port/set-coding port 'ISO-8859-1)
       (port/set-line-ending port 'NEWLINE)
       port)))
 
-(define (make-bytes-source string start end)
+(define (make-octets-source string start end)
   (let ((index start))
     (make-non-channel-port-source
      (lambda ()
@@ -361,7 +361,7 @@ USA.
           (set! index limit))
         n)))))
 
-(define (make-bytes-input-type)
+(define (make-octets-input-type)
   (make-port-type `((WRITE-SELF
                     ,(lambda (port output-port)
                        port
@@ -552,26 +552,26 @@ USA.
                   (loop index)))))
       (xsubstring-find-previous-char string start end #\newline)))
 \f
-;;;; Output as bytes
+;;;; Output as octets
 
-(define (call-with-output-bytes generator)
-  (let ((port (open-output-bytes)))
+(define (call-with-output-octets generator)
+  (let ((port (open-output-octets)))
     (generator port)
     (get-output-string port)))
 
-(define (open-output-bytes)
+(define (open-output-octets)
   (let ((port
         (let ((os (make-ostate (make-vector-8b 16) 0 #f)))
           (make-generic-i/o-port #f
                                  (make-byte-sink os)
-                                 bytes-output-type
+                                 octets-output-type
                                  os))))
     (port/set-line-ending port 'NEWLINE)
     port))
 
 (define (make-byte-sink os)
   (make-non-channel-port-sink
-   (lambda (bytes start end)
+   (lambda (octets start end)
      (let ((index (ostate-index os)))
        (let ((n (fix:+ index (fix:- end start))))
         (let ((buffer (ostate-buffer os)))
@@ -586,55 +586,55 @@ USA.
                              (loop (fix:+ m m)))))))
                  (substring-move! buffer 0 index new 0)
                  new))))
-        (substring-move! bytes start end (ostate-buffer os) index)
+        (substring-move! octets start end (ostate-buffer os) index)
         (set-ostate-index! os n)
         (fix:- end start))))))
 
-(define (make-bytes-output-type)
-  (make-port-type `((EXTRACT-OUTPUT ,bytes-out/extract-output)
-                   (EXTRACT-OUTPUT! ,bytes-out/extract-output!)
-                   (POSITION ,bytes-out/position)
-                   (WRITE-SELF ,bytes-out/write-self))
+(define (make-octets-output-type)
+  (make-port-type `((EXTRACT-OUTPUT ,octets-out/extract-output)
+                   (EXTRACT-OUTPUT! ,octets-out/extract-output!)
+                   (POSITION ,octets-out/position)
+                   (WRITE-SELF ,octets-out/write-self))
                  (generic-i/o-port-type #f #t)))
 
-(define (bytes-out/extract-output port)
+(define (octets-out/extract-output port)
   (output-port/flush-output port)
-  (let ((os (output-bytes-port/os port)))
+  (let ((os (output-octets-port/os port)))
     (string-head (ostate-buffer os) (ostate-index os))))
 
-(define (bytes-out/extract-output! port)
+(define (octets-out/extract-output! port)
   (output-port/flush-output port)
-  (let ((os (output-bytes-port/os port)))
-    (let ((bytes (ostate-buffer os)))
-      (set-string-maximum-length! bytes (ostate-index os))
+  (let ((os (output-octets-port/os port)))
+    (let ((octets (ostate-buffer os)))
+      (set-string-maximum-length! octets (ostate-index os))
       (set-ostate-buffer! os (make-vector-8b 16))
       (set-ostate-index! os 0)
-      bytes)))
+      octets)))
 
-(define (bytes-out/position port)
+(define (octets-out/position port)
   (output-port/flush-output port)
-  (ostate-index (output-bytes-port/os port)))
+  (ostate-index (output-octets-port/os port)))
 
-(define (bytes-out/write-self port output-port)
+(define (octets-out/write-self port output-port)
   port
   (write-string " to byte vector" output-port))
 \f
 (define narrow-input-type)
 (define wide-input-type)
 (define external-input-type)
-(define bytes-input-type)
+(define octets-input-type)
 (define narrow-output-type)
 (define wide-output-type)
-(define bytes-output-type)
-(define output-bytes-port/os)
+(define octets-output-type)
+(define output-octets-port/os)
 
 (define (initialize-package!)
   (set! narrow-input-type (make-narrow-input-type))
   (set! wide-input-type (make-wide-input-type))
   (set! external-input-type (make-external-input-type))
-  (set! bytes-input-type (make-bytes-input-type))
+  (set! octets-input-type (make-octets-input-type))
   (set! narrow-output-type (make-narrow-output-type))
   (set! wide-output-type (make-wide-output-type))
-  (set! bytes-output-type (make-bytes-output-type))
-  (set! output-bytes-port/os (generic-i/o-port-accessor 0))
+  (set! octets-output-type (make-octets-output-type))
+  (set! output-octets-port/os (generic-i/o-port-accessor 0))
   unspecific)
\ No newline at end of file
index e1c0620b8e51e0c400fade27c535a19852544368..aa32cc7d7125e1a78f372ded3ed47f1e7b67874f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: unicode.scm,v 1.38 2008/07/19 01:41:17 cph Exp $
+$Id: unicode.scm,v 1.39 2008/07/26 05:45:36 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -125,14 +125,14 @@ USA.
 \f
 (define (coded-input-opener coding)
   (lambda (string #!optional start end)
-    (let ((port (open-input-bytes string start end)))
+    (let ((port (open-input-octets string start end)))
       (port/set-coding port coding)
       (port/set-line-ending port 'NEWLINE)
       port)))
 
 (define (coded-output-opener coding)
   (lambda ()
-    (let ((port (open-output-bytes)))
+    (let ((port (open-output-octets)))
       (port/set-coding port coding)
       (port/set-line-ending port 'NEWLINE)
       port)))
@@ -750,11 +750,11 @@ Not used at the moment.
       (utf32-le-string-length string start end)))
 
 (define (utf32-be-string-length string #!optional start end)
-  (%utf32-string-length string start end "32BE" utf32-be-bytes->code-point
+  (%utf32-string-length string start end "32BE" utf32-be-octets->code-point
                        'UTF32-BE-STRING-LENGTH))
 
 (define (utf32-le-string-length string #!optional start end)
-  (%utf32-string-length string start end "32LE" utf32-le-bytes->code-point
+  (%utf32-string-length string start end "32LE" utf32-le-octets->code-point
                        'UTF32-LE-STRING-LENGTH))
 
 (define (%utf32-string-length string start end type combiner caller)
@@ -769,11 +769,11 @@ Not used at the moment.
       (utf32-le-string-valid? string start end)))
 
 (define (utf32-be-string-valid? string #!optional start end)
-  (%utf32-string-valid? string start end utf32-be-bytes->code-point
+  (%utf32-string-valid? string start end utf32-be-octets->code-point
                        'UTF32-BE-STRING-VALID?))
 
 (define (utf32-le-string-valid? string #!optional start end)
-  (%utf32-string-valid? string start end utf32-le-bytes->code-point
+  (%utf32-string-valid? string start end utf32-le-octets->code-point
                        'UTF32-LE-STRING-VALID?))
 
 (define (%utf32-string-valid? string start end combiner caller)
@@ -782,13 +782,13 @@ Not used at the moment.
       (lambda (string start end)
        (validate-utf32-char string start end combiner)))))
 
-(define-integrable (utf32-be-bytes->code-point b0 b1 b2 b3)
+(define-integrable (utf32-be-octets->code-point b0 b1 b2 b3)
   (+ (* b0 #x01000000)
      (fix:lsh b1 16)
      (fix:lsh b2 8)
      b3))
 
-(define-integrable (utf32-le-bytes->code-point b0 b1 b2 b3)
+(define-integrable (utf32-le-octets->code-point b0 b1 b2 b3)
   (+ (* b3 #x01000000)
      (fix:lsh b2 16)
      (fix:lsh b1 8)
@@ -897,11 +897,11 @@ Not used at the moment.
       (utf16-le-string-length string start end)))
 
 (define (utf16-be-string-length string #!optional start end)
-  (%utf16-string-length string start end "16BE" be-bytes->digit16
+  (%utf16-string-length string start end "16BE" be-octets->digit16
                        'UTF16-BE-STRING-LENGTH))
 
 (define (utf16-le-string-length string #!optional start end)
-  (%utf16-string-length string start end "16LE" le-bytes->digit16
+  (%utf16-string-length string start end "16LE" le-octets->digit16
                        'UTF16-LE-STRING-LENGTH))
 
 (define (%utf16-string-length string start end type combiner caller)
@@ -916,11 +916,11 @@ Not used at the moment.
       (utf16-le-string-valid? string start end)))
 
 (define (utf16-be-string-valid? string #!optional start end)
-  (%utf16-string-valid? string start end be-bytes->digit16
+  (%utf16-string-valid? string start end be-octets->digit16
                        'UTF16-BE-STRING-VALID?))
 
 (define (utf16-le-string-valid? string #!optional start end)
-  (%utf16-string-valid? string start end le-bytes->digit16
+  (%utf16-string-valid? string start end le-octets->digit16
                        'UTF16-LE-STRING-VALID?))
 
 (define (%utf16-string-valid? string start end combiner caller)
@@ -945,10 +945,10 @@ Not used at the moment.
                      (fix:+ start 2)))))
       start))
 
-(define (be-bytes->digit16 b0 b1)
+(define (be-octets->digit16 b0 b1)
   (fix:or (fix:lsh b0 8) b1))
 
-(define (le-bytes->digit16 b0 b1)
+(define (le-octets->digit16 b0 b1)
   (fix:or (fix:lsh b1 8) b0))
 
 (define-integrable (high-surrogate? n)
index 40b1902cbeb1f1605af078fa6b0ab13f03a84b80..a976b3443433c6e69ad46da265d01d87a3f7946a 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: mod-lisp.scm,v 1.39 2008/07/19 01:41:17 cph Exp $
+$Id: mod-lisp.scm,v 1.40 2008/07/26 05:45:36 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -385,26 +385,26 @@ USA.
   (set-status-header response code)
   (set-content-type-header response 'text/html)
   (set-entity response
-             (call-with-output-bytes
-               (lambda (port)
-                 (write-xml
-                  (let ((message (status-message code)))
-                    (html:html #f
-                               "\n"
-                               (html:head #f
-                                          "\n"
-                                          (html:title #f code " " message)
-                                          "\n")
-                               "\n"
-                               (html:body #f
-                                          "\n"
-                                          (html:h1 #f message)
-                                          "\n"
-                                          extra
-                                          "\n")
-                               "\n"))
-                  port)
-                 (newline port)))))
+             (call-with-output-octets
+              (lambda (port)
+                (write-xml
+                 (let ((message (status-message code)))
+                   (html:html #f
+                              "\n"
+                              (html:head #f
+                                         "\n"
+                                         (html:title #f code " " message)
+                                         "\n")
+                              "\n"
+                              (html:body #f
+                                         "\n"
+                                         (html:h1 #f message)
+                                         "\n"
+                                         extra
+                                         "\n")
+                              "\n"))
+                 port)
+                (newline port)))))
 
 (define (set-status-header message code)
   (set-header message
index 049e2998f518bf59eeaf5e51c1e6bfe80bc94dfd..e6ff72e5248016871df97f4e53f42a0754b4bbee 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: xmlrpc.scm,v 1.17 2008/07/19 01:41:17 cph Exp $
+$Id: xmlrpc.scm,v 1.18 2008/07/26 05:45:36 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -33,7 +33,7 @@ USA.
   (if (eq? (http-request-method) 'post)
       (let ((entity (http-request-entity)))
        (if entity
-           (let ((document (read-xml (open-input-bytes entity))))
+           (let ((document (read-xml (open-input-octets entity))))
              (if document
                  (write-xml (process-xmlrpc-request document pathname) port)
                  (http-status-response 400 "Ill-formed XML entity")))
index da27f715df8f091a8f398d87d53794b2723396cc..09865a99271d5f8ebe64b7b5df2c5d677c629956 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: xml-output.scm,v 1.44 2008/07/19 01:41:17 cph Exp $
+$Id: xml-output.scm,v 1.45 2008/07/26 05:45:36 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -40,10 +40,10 @@ USA.
       (write-xml-1 xml port options))))
 
 (define (xml->string xml . options)
-  (call-with-output-bytes
-    (lambda (port)
-      (set-coding xml port)
-      (write-xml-1 xml port options))))
+  (call-with-output-octets
+   (lambda (port)
+     (set-coding xml port)
+     (write-xml-1 xml port options))))
 
 (define (xml->wide-string xml . options)
   (call-with-wide-output-string