Changeset 5275


Ignore:
Timestamp:
Sep 27, 2006, 4:45:04 AM (18 years ago)
Author:
Gary Byers
Message:

Some changes to FD-STREAM initialization, to make it easier to use
MAKE-FD-STREAM to open (seekable) FILE-STREAMs.

File:
1 edited

Legend:

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

    r5264 r5275  
    23942394;;; (As fascinating as that may be, that has nothing to do with any
    23952395;;; nearby code, though it may have once been relevant.)
    2396 (defun make-ioblock-stream (class-name
     2396(defun make-ioblock-stream (class
    23972397                            &rest initargs
    23982398                            &key
    23992399                            &allow-other-keys)
    24002400  (declare (dynamic-extent initargs))
    2401   (let* ((class (find-class class-name))
    2402          (s
     2401  (let* ((s
    24032402          (if (subtypep class (find-class 'basic-stream))
    24042403            (apply #'make-basic-stream-instance class :allow-other-keys t initargs)
     
    24062405    (apply #'init-stream-ioblock s initargs)
    24072406    s))
     2407
    24082408
    24092409
     
    24382438  (let* ((in-p (member direction '(:io :input)))
    24392439         (out-p (member direction '(:io :output)))
    2440          (class-name (select-stream-class class in-p out-p character-p)))
    2441     (make-ioblock-stream class-name
     2440         (class-name (select-stream-class class in-p out-p character-p))
     2441         (class (find-class class-name)))
     2442    (make-ioblock-stream class
    24422443                         :insize (if in-p elements-per-buffer)
    24432444                         :outsize (if out-p elements-per-buffer)
     
    24462447                         :element-type element-type
    24472448                         :advance-function (if in-p
    2448                                              (if basic
    2449                                                'fd-stream-advance
    2450                                                (select-stream-advance-function class)))
     2449                                             (select-stream-advance-function class direction))
    24512450                         :listen-function (if in-p 'fd-stream-listen)
    24522451                         :eofp-function (if in-p 'fd-stream-eofp)
    24532452                         :force-output-function (if out-p
    2454                                                   (if basic
    2455                                                     'fd-stream-force-output
    2456                                                     (select-stream-force-output-function class)))
     2453                                                  (select-stream-force-output-function class direction))
    24572454                         :close-function 'fd-stream-close
    24582455                         :sharing sharing
     
    41034100
    41044101
    4105 (defmethod select-stream-advance-function ((s symbol))
    4106   (select-stream-advance-function (find-class s)))
    4107 
    4108 (defmethod select-stream-advance-function ((c class))
    4109   (select-stream-advance-function (class-prototype c)))
    4110 
    4111 (defmethod select-stream-advance-function ((s fd-stream))
     4102(defmethod select-stream-advance-function ((s symbol) direction)
     4103  (select-stream-advance-function (find-class s) direction))
     4104
     4105(defmethod select-stream-advance-function ((c class) direction)
     4106  (select-stream-advance-function (class-prototype c) direction))
     4107
     4108(defmethod select-stream-advance-function ((s fd-stream) (direction t))
    41124109  'fd-stream-advance)
    41134110
    4114 
    4115 (defmethod select-stream-force-output-function ((s symbol))
    4116   (select-stream-force-output-function (find-class s)))
    4117 
    4118 (defmethod select-stream-force-output-function ((c class))
    4119   (select-stream-force-output-function (class-prototype c)))
    4120 
    4121 (defmethod select-stream-force-output-function ((f fd-stream))
     4111(defmethod select-stream-advance-function ((s basic-stream) (direction t))
     4112  'fd-stream-advance)
     4113
     4114
     4115(defmethod select-stream-force-output-function ((s symbol) direction)
     4116  (select-stream-force-output-function (find-class s) direction))
     4117
     4118(defmethod select-stream-force-output-function ((c class) direction)
     4119  (select-stream-force-output-function (class-prototype c) direction))
     4120
     4121(defmethod select-stream-force-output-function ((f fd-stream) (direction t))
     4122  'fd-stream-force-output)
     4123
     4124(defmethod select-stream-force-output-function ((f basic-stream) (direction t))
    41224125  'fd-stream-force-output)
    41234126
Note: See TracChangeset for help on using the changeset viewer.