From 840383dbaac4f8ad9e9ea4b0b7156e65569821d3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 16 May 2025 07:29:26 -0700 Subject: doc: buffers: section on arithmetic conventions. * txr.1: Add Arithmetic Conventions of Buffer section. --- txr.1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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, -- cgit v1.2.3