Changeset 5256


Ignore:
Timestamp:
Sep 24, 2006, 7:00:51 PM (18 years ago)
Author:
Gary Byers
Message:

A little more u16 stuff. Remove line-termination slot from ioblock and corresponding
arg from functions which initialize it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-streams.lisp

    r5245 r5256  
    368368  (write-char-function 'ioblock-no-char-output)
    369369  (encoding nil)
    370   (line-termination nil)
     370  (pending-byte-order-mark nil)
    371371  (literal-char-code-limit 256)
    372372  (encode-output-function nil)
     
    380380  (write-byte-when-locked-function 'ioblock-no-binary-output)
    381381  (peek-char-function 'ioblock-no-char-input)
    382   (input-filter #'false)
    383   (output-filter #'false)
    384382  (reserved1 nil)
    385383  (reserved2 nil)
     
    666664)
    667665
    668 (declaim (inline %ioblock-read-swapped-u16-element))
    669 (defun %ioblock-read-swapped-u16-element (ioblock)
     666(declaim (inline %ioblock-read-swapped-u16-byte))
     667(defun %ioblock-read-swapped-u16-byte (ioblock)
    670668  (declare (optimize (speed 3) (safety 0)))
    671669  (let* ((buf (ioblock-inbuf ioblock))
     
    675673    (when (= idx limit)
    676674      (unless (%ioblock-advance ioblock t)
    677         (return-from %ioblock-read-swapped-u16-element :eof))
     675        (return-from %ioblock-read-swapped-u16-byte :eof))
    678676      (setq idx (io-buffer-idx buf)
    679677            limit (io-buffer-count buf)))
     
    854852    (%ioblock-read-u16-encoded-char ioblock)))
    855853
     854(declaim (inline %ioblock-read-swapped-u16-encoded-char))
     855(defun %ioblock-read-swapped-u16-encoded-char (ioblock)
     856  (declare (optimize (speed 3) (safety 0)))
     857  (let* ((ch (ioblock-untyi-char ioblock)))
     858    (if ch
     859      (prog1 ch
     860        (setf (ioblock-untyi-char ioblock) nil))
     861      (let* ((1st-unit (%ioblock-read-swapped-u16-byte ioblock)))
     862        (if (eq 1st-unit :eof)
     863          1st-unit
     864          (locally
     865              (declare (type (unsigned-byte 16) 1st-unit))
     866            (if (< 1st-unit
     867                   (the (mod #x110000) (ioblock-literal-char-code-limit ioblock)))
     868              (code-char 1st-unit)
     869              (funcall (ioblock-decode-input-function ioblock)
     870                       1st-unit
     871                       #'%ioblock-read-swapped-u16-byte
     872                       ioblock))))))))
     873
     874(defun %private-ioblock-read-swapped-u16-encoded-char (ioblock)
     875  (declare (optimize (speed 3) (safety 0)))
     876  (check-ioblock-owner ioblock)
     877  (%ioblock-read-swapped-u16-encoded-char ioblock))
     878
     879(defun %locked-ioblock-read-swapped-u16-encoded-char (ioblock)
     880  (declare (optimize (speed 3) (safety 0)))
     881  (with-ioblock-input-lock-grabbed (ioblock)
     882    (%ioblock-read-swapped-u16-encoded-char ioblock)))
    856883
    857884(declaim (inline %ioblock-tyi-no-hang))
     
    20812108                            character-p
    20822109                            encoding
    2083                             line-termination
    20842110                            &allow-other-keys)
    20852111  (declare (ignorable element-shift))
     
    21032129      (setf (ioblock-owner ioblock) *current-process*))
    21042130    (setf (ioblock-encoding ioblock) encoding)
    2105     (setf (ioblock-line-termination ioblock) line-termination)
    21062131    (setf (ioblock-literal-char-code-limit ioblock)
    21072132          (if encoding
     
    22152240                                           (subtypep element-type 'character)))
    22162241                          (basic nil)
    2217                           encoding
    2218                           line-termination)
     2242                          encoding)
    22192243  (when basic
    22202244    (setq class (map-to-basic-stream-class-name class))
     
    22422266                         :sharing sharing
    22432267                         :character-p character-p
    2244                          :encoding encoding
    2245                          :line-termination line-termination)))
     2268                         :encoding encoding)))
    22462269 
    22472270;;;  Fundamental streams.
Note: See TracChangeset for help on using the changeset viewer.