1.0.0.15: build fix & cleanup
[sbcl.git] / contrib / sb-simple-streams / direct.lisp
1 ;;; -*- lisp -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written by Paul Foley and has been placed in the public
5 ;;; domain.
6 ;;;
7
8 ;;; Sbcl port by Rudi Schlatte.
9
10 (in-package "SB-SIMPLE-STREAMS")
11
12 ;;;
13 ;;; **********************************************************************
14 ;;;
15 ;;; Direct-Simple-Stream and Buffer-(Input|Output)-Simple-Stream
16
17 (def-stream-class direct-simple-stream (single-channel-simple-stream)
18   ())
19
20 (def-stream-class buffer-input-simple-stream (direct-simple-stream)
21   ())
22
23 (def-stream-class buffer-output-simple-stream (direct-simple-stream)
24   ((out-buffer :initform nil :type (or simple-stream-buffer null))
25    (outpos :initform 0 :type fixnum)
26    (max-out-pos :initform 0 :type fixnum)))
27
28 (defmethod device-file-length ((stream direct-simple-stream))
29   ;; return buffer length
30   )
31
32 (defmethod device-open ((stream buffer-input-simple-stream) options)
33   #| do something |#
34   stream)
35
36 (defmethod device-open ((stream buffer-output-simple-stream) options)
37   #| do something |#
38   stream)
39
40