Changeset 5081
- Timestamp:
- Sep 3, 2006, 1:20:08 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/level-1/l1-streams.lisp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-1/l1-streams.lisp
r5066 r5081 1415 1415 (generic-character-read-vector stream vector start end)) 1416 1416 1417 1417 1418 (defmethod stream-read-vector ((stream fundamental-binary-input-stream) 1418 1419 vector start end) … … 1425 1426 (return i) 1426 1427 (setf (uvref vector i) b))))) 1428 1429 1427 1430 1428 1431 … … 1534 1537 (apply #'make-ioblock :stream stream args)) 1535 1538 1539 (defmethod stream-read-vector ((stream basic-character-input-stream) 1540 vector start end) 1541 (generic-character-read-vector stream vector start end)) 1542 1543 (defmethod stream-read-vector ((stream basic-binary-input-stream) 1544 vector start end) 1545 (declare (fixnum start end)) 1546 (do* ((i start (1+ i))) 1547 ((= i end) end) 1548 (declare (fixnum i)) 1549 (let* ((b (stream-read-byte stream))) 1550 (if (eq b :eof) 1551 (return i) 1552 (setf (uvref vector i) b))))) 1536 1553 1537 1554 (defun stream-is-closed (s) … … 2374 2391 (with-stream-ioblock-input (ioblock stream :speedy t) 2375 2392 (funcall (ioblock-read-byte-function ioblock) ioblock))) 2393 2394 (defmethod stream-read-byte ((stream basic-binary-input-stream)) 2395 (let* ((ioblock (basic-stream-ioblock stream))) 2396 (with-ioblock-input-locked (ioblock) 2397 (funcall (ioblock-read-byte-function ioblock) ioblock)))) 2376 2398 2377 2399 (defmethod stream-eofp ((stream buffered-input-stream-mixin)) … … 2600 2622 (%ioblock-force-output ioblock nil)))))))))) 2601 2623 2624 (defmethod stream-write-vector ((stream basic-binary-output-stream) 2625 vector start end) 2626 (declare (fixnum start end)) 2627 (let* ((ioblock (basic-stream-ioblock stream))) 2628 (with-ioblock-output-locked (ioblock) 2629 (let* ((out (ioblock-outbuf ioblock)) 2630 (buf (io-buffer-buffer out)) 2631 (written 0) 2632 (limit (io-buffer-limit out)) 2633 (total (- end start)) 2634 (buftype (typecode buf))) 2635 (declare (fixnum buftype written total limit)) 2636 (if (not (= (the fixnum (typecode vector)) buftype)) 2637 (do* ((i start (1+ i))) 2638 ((= i end)) 2639 (let ((byte (uvref vector i))) 2640 (when (characterp byte) 2641 (setq byte (char-code byte))) 2642 (%ioblock-write-byte ioblock byte))) 2643 (do* ((pos start (+ pos written)) 2644 (left total (- left written))) 2645 ((= left 0)) 2646 (declare (fixnum pos left)) 2647 (setf (ioblock-dirty ioblock) t) 2648 (let* ((index (io-buffer-idx out)) 2649 (count (io-buffer-count out)) 2650 (avail (- limit index))) 2651 (declare (fixnum index avail count)) 2652 (cond 2653 ((= (setq written avail) 0) 2654 (%ioblock-force-output ioblock nil)) 2655 (t 2656 (if (> written left) 2657 (setq written left)) 2658 (%copy-ivector-to-ivector 2659 vector 2660 (ioblock-elements-to-octets ioblock pos) 2661 buf 2662 (ioblock-elements-to-octets ioblock index) 2663 (ioblock-elements-to-octets ioblock written)) 2664 (setf (ioblock-dirty ioblock) t) 2665 (incf index written) 2666 (if (> index count) 2667 (setf (io-buffer-count out) index)) 2668 (setf (io-buffer-idx out) index) 2669 (if (= index limit) 2670 (%ioblock-force-output ioblock nil))))))))))) 2671 2672 (defmethod stream-read-vector ((stream basic-character-input-stream) 2673 vector start end) 2674 (declare (fixnum start end)) 2675 (if (not (typep vector 'simple-base-string)) 2676 (call-next-method) 2677 (let* ((ioblock (basic-stream-ioblock stream))) 2678 (with-ioblock-input-locked (ioblock) 2679 (%ioblock-character-read-vector ioblock vector start end))))) 2680 2681 (defmethod stream-read-vector ((stream basic-binary-input-stream) 2682 vector start end) 2683 (declare (fixnum start end)) 2684 (if (typep vector 'simple-base-string) 2685 (call-next-method) 2686 (let* ((ioblock (basic-stream-ioblock stream))) 2687 (with-ioblock-input-locked (ioblock) 2688 (%ioblock-binary-read-vector ioblock vector start end))))) 2689 2602 2690 (defmethod stream-read-vector ((stream buffered-character-input-stream-mixin) 2603 2691 vector start end) … … 2608 2696 (%ioblock-character-read-vector ioblock vector start end)))) 2609 2697 2698 2699 2610 2700 (defmethod stream-read-vector ((stream buffered-binary-input-stream-mixin) 2611 2701 vector start end) … … 2615 2705 (with-stream-ioblock-input (ioblock stream :speedy t) 2616 2706 (%ioblock-binary-read-vector ioblock vector start end)))) 2707 2708 2617 2709 2618 2710 (defloadvar *fd-set-size*
Note:
See TracChangeset
for help on using the changeset viewer.
