summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-16 07:29:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-16 07:29:26 -0700
commit840383dbaac4f8ad9e9ea4b0b7156e65569821d3 (patch)
tree4daa7f09b1d4cb3772ad197222a04f7f865c501c
parentbc5f5cde73464f8d31e32c5885236996aee928fc (diff)
downloadtxr-840383dbaac4f8ad9e9ea4b0b7156e65569821d3.tar.gz
txr-840383dbaac4f8ad9e9ea4b0b7156e65569821d3.tar.bz2
txr-840383dbaac4f8ad9e9ea4b0b7156e65569821d3.zip
doc: buffers: section on arithmetic conventions.
* txr.1: Add Arithmetic Conventions of Buffer section.
-rw-r--r--txr.122
1 files changed, 22 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 48c37097..10d77642 100644
--- a/txr.1
+++ b/txr.1
@@ -28943,6 +28943,28 @@ The
function returns a value of type
.codn cptr .
+.NP Arithmetic Conventions of Buffers
+
+Buffers support a limited number of functions for dealing
+with buffers as if they were integers. Buffers may be
+converted to and from integer values using the functions
+.codn buf-int ,
+.codn buf-uint ,
+.code int-buf
+and
+.codn uint-buf .
+A number of bitwise manipulation functions are provided
+such as
+.codn buf-ash ,
+.codn buf-and ,
+.code buf-or
+and others.
+
+Under arithmetic, buffers are regarded as binary numbers in big-endian
+representation, whereby the last byte of a buffer
+represents the least significant eight bits of the integer.
+An empty buffer is taken to be zero.
+
.NP* Fill Pattern Argument Conventions
Several buffer functions accept a fill pattern argument,