2009-01-13 20:25:44 -05:00
|
|
|
! Copyright (C) 2007, 2009 Slava Pestov.
|
2007-09-20 18:09:08 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2009-01-13 20:25:44 -05:00
|
|
|
USING: kernel io io.timeouts io.styles destructors ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: io.streams.null
|
|
|
|
|
2009-01-13 20:25:44 -05:00
|
|
|
SINGLETONS: null-reader null-writer ;
|
|
|
|
UNION: null-stream null-reader null-writer ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2008-01-31 01:52:06 -05:00
|
|
|
M: null-stream dispose drop ;
|
2008-02-10 04:12:44 -05:00
|
|
|
M: null-stream set-timeout 2drop ;
|
2008-05-05 03:19:25 -04:00
|
|
|
|
|
|
|
M: null-reader stream-readln drop f ;
|
|
|
|
M: null-reader stream-read1 drop f ;
|
|
|
|
M: null-reader stream-read-until 2drop f f ;
|
|
|
|
M: null-reader stream-read 2drop f ;
|
|
|
|
|
|
|
|
M: null-writer stream-write1 2drop ;
|
|
|
|
M: null-writer stream-write 2drop ;
|
|
|
|
M: null-writer stream-nl drop ;
|
|
|
|
M: null-writer stream-flush drop ;
|
|
|
|
M: null-writer stream-format 3drop ;
|
|
|
|
M: null-writer make-span-stream nip ;
|
|
|
|
M: null-writer make-block-stream nip ;
|
|
|
|
M: null-writer make-cell-stream nip ;
|
|
|
|
M: null-writer stream-write-table 3drop ;
|
|
|
|
|
|
|
|
: with-null-reader ( quot -- )
|
2009-01-13 20:25:44 -05:00
|
|
|
null-reader swap with-input-stream* ; inline
|
2008-05-05 03:19:25 -04:00
|
|
|
|
|
|
|
: with-null-writer ( quot -- )
|
2009-01-13 20:25:44 -05:00
|
|
|
null-writer swap with-output-stream* ; inline
|