Handbook
Glossary
read-loop ( dst n-remaining port n-read -- n-total )
Vocabulary
io
.
ports
.
private
Inputs
dst
an
object
n-remaining
an
object
port
an
object
n-read
an
object
Outputs
n-total
an
object
Definition
USING:
alien
kernel
libc
math.private
;
IN:
io.ports.private
::
read-loop
( dst n-remaining port n-read -- n-total )
n-remaining port
read-step
:>
( n-buffered ptr ) ptr
[
n-read dst
<displaced-alien>
ptr n-buffered
memcpy
n-remaining n-buffered
fixnum-fast
:>
n-remaining' n-read n-buffered
fixnum+fast
:>
n-read' dst n-remaining' port n-read'
read-loop
]
[
n-read
]
if
;
inline
recursive