summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-19 19:15:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-19 19:15:48 -0700
commitc99dd869357f2afd0b79dfc24f9e9953d9129837 (patch)
tree5297cdf3c4745d8225e98281071db50aa71f424e /txr.1
parent17725d8ac6a5bbc96e888ae6e346f909fe77f3e5 (diff)
downloadtxr-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.123
1 files changed, 23 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 5309290f..404da89a 100644
--- a/txr.1
+++ b/txr.1
@@ -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 ]])