aboutsummaryrefslogtreecommitdiffstats
path: root/byte.txi
diff options
context:
space:
mode:
Diffstat (limited to 'byte.txi')
-rw-r--r--byte.txi29
1 files changed, 21 insertions, 8 deletions
diff --git a/byte.txi b/byte.txi
index e4502b9..6ffab1c 100644
--- a/byte.txi
+++ b/byte.txi
@@ -73,6 +73,19 @@ Returns a newly allocated copy of the given @var{bytes}.
@end defun
+@defun subbytes bytes start end
+
+@var{bytes} must be a bytes, and @var{start} and @var{end}
+must be exact integers satisfying
+
+@center 0 <= @var{start} <= @var{end} <= @w{@t{(bytes-length @var{bytes})@r{.}}}
+
+@code{subbytes} returns a newly allocated bytes formed from the bytes of
+@var{bytes} beginning with index @var{start} (inclusive) and ending with index
+@var{end} (exclusive).
+@end defun
+
+
@deffn {Procedure} bytes-reverse! bytes
Reverses the order of byte-array @var{bytes}.
@@ -162,31 +175,31 @@ by @code{current-output-port}.
@end defun
@noindent
-@code{substring-read!} and @code{substring-write} provide
+@code{subbytes-read!} and @code{subbytes-write} provide
lower-level procedures for reading and writing blocks of bytes. The
relative size of @var{start} and @var{end} determines the order of
writing.
-@deffn {Procedure} substring-read! string start end port
+@deffn {Procedure} subbytes-read! string start end port
-@deffnx {Procedure} substring-read! string start end
+@deffnx {Procedure} subbytes-read! string start end
Fills @var{string} with up to @code{(abs (- @var{start} @var{end}))} bytes
read from @var{port}. The first byte read is stored at index @var{string}.
-@code{substring-read!} returns the number of bytes read.
+@code{subbytes-read!} returns the number of bytes read.
@var{port} may be omitted, in which case it defaults to the value returned
by @code{current-input-port}.
@end deffn
-@defun substring-write string start end port
+@defun subbytes-write string start end port
-@defunx substring-write string start end
-@code{substring-write} writes @code{(abs (- @var{start} @var{end}))} bytes to
-output-port @var{port}. The first byte written is index @var{start} of @var{string}. @code{substring-write}
+@defunx subbytes-write string start end
+@code{subbytes-write} writes @code{(abs (- @var{start} @var{end}))} bytes to
+output-port @var{port}. The first byte written is index @var{start} of @var{string}. @code{subbytes-write}
returns the number of bytes written.
@var{port} may be omitted, in which case it defaults to the value returned