Handbook
Glossary
input-port
Factor handbook
»
Input and output
»
Non-blocking I/O implementation
Prev:
<buffered-port> ( handle class -- port )
Next:
<input-port> ( handle -- input-port )
Vocabulary
io
.
ports
Class description
The class of ports implementing the input stream protocol.
Definition
IN:
io.ports
TUPLE:
input-port
<
buffered-port
;
Methods
USING:
alien
classes
io
io.ports
io.ports.private
kernel
libc
;
M:
input-port
stream-read-partial-unsafe
[
c-ptr
check-instance
swap
]
dip
prepare-read
read-step
[
swap
[
memcpy
]
keep
]
[
2drop
0
]
if*
;
USING:
alien
classes
io
io.ports
io.ports.private
kernel
;
M:
input-port
stream-read-unsafe
[
c-ptr
check-instance
swap
]
dip
prepare-read
0
read-loop
;
USING:
io
io.ports
io.ports.private
kernel
sequences
;
M:
input-port
stream-read-until
2dup
read-until-step
dup
[
2nipd
]
[
over
[
drop
BV{
}
like
[
read-until-loop
]
keep
B{
}
like
swap
]
[
2nipd
]
if
]
if
;
USING:
accessors
destructors
io
io.buffers
io.ports
kernel
;
M:
input-port
stream-read1
check-disposed
dup
wait-to-read
[
drop
f
]
[
buffer>>
buffer-pop
]
if
;
inline
USING:
accessors
destructors
io
io.buffers
io.ports
io.ports.private
kernel
;
M:
input-port
stream-seek
check-disposed
do-seek-relative
[
buffer>>
0
swap
buffer-reset
]
[
handle>>
seek-handle
]
bi
;
USING:
destructors
io
io.ports
io.ports.private
math
;
M:
input-port
stream-tell
check-disposed
port-tell
-
;