summaryrefslogtreecommitdiffstats
path: root/byte.txi
diff options
context:
space:
mode:
Diffstat (limited to 'byte.txi')
-rw-r--r--byte.txi16
1 files changed, 16 insertions, 0 deletions
diff --git a/byte.txi b/byte.txi
index 01c725b..e4502b9 100644
--- a/byte.txi
+++ b/byte.txi
@@ -16,6 +16,7 @@ character sets. These functions abstract the notion of a @dfn{byte}.
zero-origin indexing.
@end defun
+
@deffn {Procedure} byte-set! bytes k byte
@var{k} must be a valid index of @var{bytes}, and @var{byte} must be a small
@@ -23,6 +24,7 @@ nonnegative integer. @code{byte-set!} stores @var{byte} in element @var{k} of @
returns an unspecified value. @c <!>
@end deffn
+
@defun make-bytes k byte
@@ -32,28 +34,33 @@ given, then all elements of the byte-array are initialized to @var{byte},
otherwise the contents of the byte-array are unspecified.
@end defun
+
@defun bytes-length bytes
@code{bytes-length} returns length of byte-array @var{bytes}.
@end defun
+
@defun bytes byte @dots{}
Returns a newly allocated byte-array composed of the small
nonnegative arguments.
@end defun
+
@defun bytes->list bytes
@code{bytes->list} returns a newly allocated list of the bytes that make up the
given byte-array.
@end defun
+
@defun list->bytes bytes
@code{list->bytes} returns a newly allocated byte-array formed from the small
nonnegative integers in the list @var{bytes}.
@end defun
+
@noindent
@code{Bytes->list} and @code{list->bytes} are inverses so far as
@code{equal?} is concerned.
@@ -65,16 +72,19 @@ nonnegative integers in the list @var{bytes}.
Returns a newly allocated copy of the given @var{bytes}.
@end defun
+
@deffn {Procedure} bytes-reverse! bytes
Reverses the order of byte-array @var{bytes}.
@end deffn
+
@defun bytes-reverse bytes
Returns a newly allocated bytes-array consisting of the elements of
@var{bytes} in reverse order.
@end defun
+
@noindent
@cindex binary
Input and output of bytes should be with ports opened in @dfn{binary}
@@ -96,6 +106,7 @@ be omitted, in which case it defaults to the value returned by
@findex current-output-port
@end defun
+
@defun read-byte port
@@ -106,6 +117,7 @@ end-of-file object is returned. @var{port} may be omitted, in which case it
defaults to the value returned by @code{current-input-port}.
@findex current-input-port
@end defun
+
@noindent
When reading and writing binary numbers with @code{read-bytes} and
@code{write-bytes}, the sign of the length argument determines the
@@ -135,6 +147,7 @@ end-of-file.
by @code{current-input-port}.
@end defun
+
@defun write-bytes bytes n port
@@ -147,6 +160,7 @@ value.
@var{port} may be omitted, in which case it defaults to the value returned
by @code{current-output-port}.
@end defun
+
@noindent
@code{substring-read!} and @code{substring-write} provide
lower-level procedures for reading and writing blocks of bytes. The
@@ -166,6 +180,7 @@ read from @var{port}. The first byte read is stored at index @var{string}.
by @code{current-input-port}.
@end deffn
+
@defun substring-write string start end port
@@ -177,3 +192,4 @@ returns the number of bytes written.
@var{port} may be omitted, in which case it defaults to the value returned
by @code{current-output-port}.
@end defun
+