chiark / gitweb /
mask-map nonoverlapping representation - wip (needs compile errors fixing and debuggi...
[chiark-tcl.git] / base / chiark-tcl.h
index 1bf433bb77e89bf1ef8744498cede5eb0a4242e4..b4fcfb8d551a3481d4e357c5111983ca28075e5e 100644 (file)
  *               uint VARNAME/VALUE         (VARNAME if ul2bitfields;
  *               ulong VARNAME/VALUE         VALUE if bitfields2ul)
  *
+ * Mask maps:
+ *
+ *  A maskmap is a slightly efficient mapping from addresses to
+ *  arbitrary data values.  An address is a number of octets expressed
+ *  as an hbytes.  All the addresses covered by the same maskmap
+ *  should have the same length (even though constructing the maskmap
+ *  does not involve specifying that length).
+ *
  *  hbytes mask-map lookup MAP-VAR ADDRESS [DEFAULT]   => DATA
- *     error on missing default or if any prefix longer than address
+ *     Error on missing default or if any prefix longer than ADDRESS.
+ *
  *  hbytes mask-map amend MAP-VAR PREFIX PREFIX-LENGTH DATA
- *     a maskmap MAP is [list [list PREFIX PREFIX-LENGTH DATA]] sorted
- *     first by descending PREFIX-LENGTH and then by ascending PREFIX
- *     each PREFIX _in the map_ is truncated to the shortest number of
- *     pairs of hex digits which can represent it
+ *     Sets all of the addresses in PREFIX/PREFIX-LENGTH to the
+ *     relevant value.
+ *
+ *  Representation:
+ *     A maskmap MAP is [list [list PREFIX PREFIX-LENGTH DATA]].
+ *     The list is sorted by ascending PREFIX and entries do not overlap.
+ *     Each PREFIX in the map is truncated to the shortest number of
+ *     pairs of hex digits which can represent it.
  *
  * Error codes
  *
  * TUNTAP IFNAME LENGTH                tun/tap interface name too long
  * TUNTAP MTU OVERRUN                  tun/tap mtu limited to 2^16 bytes
  *
- * Refs: HMAC: RFC2104
- */
+ * Refs: HMAC: RFC2104 */
 
 #ifndef HBYTES_H
 #define HBYTES_H