diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-04-19 19:15:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-04-19 19:15:48 -0700 |
commit | c99dd869357f2afd0b79dfc24f9e9953d9129837 (patch) | |
tree | 5297cdf3c4745d8225e98281071db50aa71f424e /txr.1 | |
parent | 17725d8ac6a5bbc96e888ae6e346f909fe77f3e5 (diff) | |
download | txr-c99dd869357f2afd0b79dfc24f9e9953d9129837.tar.gz txr-c99dd869357f2afd0b79dfc24f9e9953d9129837.tar.bz2 txr-c99dd869357f2afd0b79dfc24f9e9953d9129837.zip |
New function: get-line-as-buf
* buf.c (buf_put_bytes, buf_get_bytes): static functions
become external.
* buf.h (buf_put_bytes, buf_get_bytes): Declared.
* stream.c (get_line_as_buf): New fucntnion.
(stream_init): Registered get-line-as-buf intrinsic.
* stream.h (get_line_as_buf): Declared.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -25120,6 +25120,29 @@ Finally, if the operation succeeds, then .code fill-buf-adjust adjusts the length of the buffer to match the position that is returned. +.coNP Function @ get-line-as-buf +.synb +.mets (get-line-as-buf <> [ stream ]) +.syne +.desc +The +.code get-line-as-buf +reads bytes from +.meta stream +as if using the +.code get-byte +function, until either a the newline character is encountered, or else the end +of input is encountered. The bytes which are read, exclusive of the newline +character, are returned in a new buffer object. The newline character, if it +occurs, is consumed. + +If +.meta stream +is omitted, it defaults to +.codn *stdin* . + +The stream is required to support byte input. + .coNP Functions @ file-get-buf and @ command-get-buf .synb .mets (file-get-buf < name >> [ max-bytes <> [ skip-bytes ]]) |