port-write ( src n-remaining port n-write -- )


Vocabulary
io.ports.private

Inputs
srcan object
n-remainingan object
portan object
n-writean object


Outputs
None

Definition


:: port-write ( src n-remaining port n-write -- )
port buffer>> :> buffer n-remaining buffer size>> min
:> n-chunk n-chunk port wait-to-write
n-write src >c-ptr <displaced-alien>
n-chunk buffer buffer-write n-remaining n-chunk fixnum-fast
dup 0 >
[ src swap port n-write n-chunk fixnum+fast port-write ]
[ drop ] if ; inline recursive