~vdupras/duskos

87585b9b7ee4ad286f5b03b56dfbda9a4c900004 — Virgil Dupras 13 days ago a029749
doc/io: clarify and add missing methods
1 files changed, 7 insertions(+), 2 deletions(-)

M fs/doc/io.txt
M fs/doc/io.txt => fs/doc/io.txt +7 -2
@@ 50,7 50,12 @@ In addition to those device-specific words, all IO structures share these
convenience words:

:write ( a n hdl -- )
  Repeatedly call :writebuf until all requested bytes have been written.
  Repeatedly call :writebuf until 'n' bytes have been written (coming from 'a')
  Aborts if we can't write all bytes.

:read ( a n hdl -- )
  Repeatedly call :readbuf until 'n' bytes have been read (into buffer at 'a',
  which of course must be big enough). Aborts if we can't read all bytes.

:getc ( hdl -- c )
  Read 1 byte from hdl an return it. Advance position by 1 byte. Return -1 on


@@ 66,7 71,7 @@ convenience words:
  Set the putback value to c.

:readline ( hdl -- str-or-0 )
  read stdin for a maximum of STR_MAXSZ-1 characters until LF or EOF is
  read hdl for a maximum of STR_MAXSZ-1 characters until LF or EOF is
  encountered, then return a string representing that read line. The LF
  character is not included. Aborts on LNSZ overflow. The string can be zero in
  length if LF is encountered right away. When EOF is encountered in the middle