]> Cypherpunks repositories - keks.git/commitdiff
Less @anchors
authorSergey Matveev <stargrave@stargrave.org>
Wed, 22 Jan 2025 14:56:40 +0000 (17:56 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 22 Jan 2025 14:58:19 +0000 (17:58 +0300)
spec/encoding/blob.texi
spec/encoding/index.texi
spec/encoding/list.texi [new file with mode: 0644]
spec/encoding/map.texi [moved from spec/encoding/cont.texi with 63% similarity]
spec/encoding/prim.texi
spec/encoding/str.texi
spec/encoding/table.texi
spec/schema.texi

index f425931febeeb9a39e2fabd30eef6699c63efca1a7be7eeaa946bd71f40afa1b..302a5ea14b7f944289c47e151a5254f924791c859944540c224b0677d4be7944 100644 (file)
@@ -1,5 +1,4 @@
 @node Blobs
-@anchor{BLOB}
 @cindex BLOB
 @cindex chunk
 @section Blobs
@@ -8,10 +7,10 @@ Blob (binary large object) allows you to transfer binary data in chunks,
 in a streaming way, when data may not fit in memory.
 
 64-bit big-endian integer follows the BLOB tag, setting the following
-chunks payload size (+1). Then come one or more @ref{BIN} strings with
-the chunk-length payload. All of them, except for the last one, must
-have fixed chunk length payload. Last terminating string's payload must
-be shorter.
+chunks payload size (+1). Then come one or more @ref{Strings, BIN}
+strings with the chunk-length payload. All of them, except for the last
+one, must have fixed chunk length payload. Last terminating string's
+payload must be shorter.
 
 Data format definition must specify exact chunk size expected to be
 used, if it needs deterministic encoding.
index 987c423a54d6ef370678348374a9e5bd199bfe2dc936ece582a7b26d17236a17..2522627ef6d12f35cc13c08bf7b5c34ce8d9fe1161765b52304e30b5ea6ee8e4 100644 (file)
@@ -11,14 +11,14 @@ Possible values for the tag:
 @multitable {dec} {hex} {12345678} {len} {float256}
 @headitem dec @tab hex @tab bin @tab vlen @tab description
 
-@item 000 @tab 00 @tab @code{00000000} @tab 0 @tab @ref{Containers, EOC}
+@item 000 @tab 00 @tab @code{00000000} @tab 0 @tab @ref{LIST, EOC}
 @item 001 @tab 01 @tab @code{00000001} @tab 0 @tab @ref{Primitives, NIL}
 @item 002 @tab 02 @tab @code{00000010} @tab 0 @tab @ref{Primitives, FALSE}
 @item 003 @tab 03 @tab @code{00000011} @tab 0 @tab @ref{Primitives, TRUE}
 @item 004 @tab 04 @tab @code{00000100} @tab 16 @tab @ref{UUID}
 @item [...]
-@item 008 @tab 08 @tab @code{00001000} @tab 0 @tab @ref{Containers, LIST}
-@item 009 @tab 09 @tab @code{00001001} @tab 0 @tab @ref{Containers, MAP}
+@item 008 @tab 08 @tab @code{00001000} @tab 0 @tab @ref{LIST}
+@item 009 @tab 09 @tab @code{00001001} @tab 0 @tab @ref{MAP}
 @item 010 @tab 0A @tab @code{00001010} @tab
 @item 011 @tab 0B @tab @code{00001011} @tab 8+~ @tab @ref{Blobs, BLOB}
 @item 012 @tab 0C @tab @code{00001100} @tab 1+~ @tab @ref{Integers, +INT}
@@ -60,5 +60,6 @@ Possible values for the tag:
 @include encoding/float.texi
 @include encoding/tai64.texi
 @include encoding/magic.texi
-@include encoding/cont.texi
+@include encoding/list.texi
+@include encoding/map.texi
 @include encoding/blob.texi
diff --git a/spec/encoding/list.texi b/spec/encoding/list.texi
new file mode 100644 (file)
index 0000000..4582a38
--- /dev/null
@@ -0,0 +1,19 @@
+@node LIST
+@cindex EOC
+@section LIST
+
+LIST contains a concatenation of items of arbitrary type, terminated by
+EOC atom.
+
+@verbatim
+LIST [ITEM0 || ITEM1 || ...] EOC
+@end verbatim
+
+Example representations:
+
+@multitable @columnfractions .5 .5
+
+@item LIST[] @tab @code{08 00}
+@item LIST[INT(123) FALSE] @tab @code{08 0C817B 02 00}
+
+@end multitable
similarity index 63%
rename from spec/encoding/cont.texi
rename to spec/encoding/map.texi
index 0d3a8e8006a5a14a5dd7ae8ffa99f2e3cb59a1fff83314f93692360ceb8f5af6..ebfdf45e8ed51d39fada76f5e6dd54cf45b7098b22448fe781ba4b2347af6ee7 100644 (file)
@@ -1,21 +1,7 @@
-@node Containers
-@cindex containers
-@section Containers
-
-Containers do not have any explicit length, but are terminated by EOC
-(end of contents) tag.
-
-@anchor{LIST}
-@cindex LIST
-@cindex EOC
-LIST contains a concatenation of items of arbitrary type.
-
-@verbatim
-LIST [ITEM0 || ITEM1 || ...] EOC
-@end verbatim
-
-@anchor{MAP}
+@node MAP
 @cindex MAP
+@section MAP
+
 MAP contains concatenation of @ref{Strings, STR(key)}-value pairs. Keys
 @strong{must} be non-empty, unique and length-first bytewise ascending ordered.
 
@@ -34,9 +20,8 @@ Example representations:
 
 @multitable @columnfractions .5 .5
 
-@item LIST[] @tab @code{08 00}
-@item LIST[INT(123) FALSE] @tab @code{08 0C817B 02 00}
 @item MAP[foo: LIST["bar"]] @tab @code{09 C3666F6F 08 C3626172 00 00}
 @item SET[sig, dh] @tab @code{09 C26468 01 C3736967 01 00}
 
 @end multitable
+
index aca3125da3a69e92ab07aa18e99edad31f8cc4817a1467e186647077513153b7..76c3ab0c53d66527740329cf05634d0ec4ea3208e45d2d88dfc48ef3509ef7fd 100644 (file)
@@ -1,5 +1,4 @@
 @node Primitives
-@anchor{NIL}
 @cindex NIL
 @cindex FALSE
 @cindex TRUE
index ef848220c2d7673563a130c21e5ec320e590f85cf3c624f2e08a667d0bb0e7cf..8f6607d1d2b20074beaab23720d28c417d43cce7908f96ecb9396f4894966dea 100644 (file)
@@ -1,5 +1,4 @@
 @node Strings
-@anchor{BIN}
 @cindex BIN
 @cindex STR
 @section Strings
index 754fac5ed5664d0ac6ed8fcbfa62fcec437e259ca1d758a49ef36c5ae655c8d1..96aa26ff21f8546c8794c874138e54ed021db24d6e3f98f4a3dbff4bf6a28e0f 100644 (file)
@@ -4,7 +4,7 @@
 @multitable {dec} {hex} {12345678} {len} {float256}
 @headitem dec @tab hex @tab bin @tab vlen @tab description
 
-@item 000 @tab 00 @tab @code{00000000} @tab 0 @tab @ref{Containers, EOC}
+@item 000 @tab 00 @tab @code{00000000} @tab 0 @tab @ref{LIST, EOC}
 @item 001 @tab 01 @tab @code{00000001} @tab 0 @tab @ref{Primitives, NIL}
 @item 002 @tab 02 @tab @code{00000010} @tab 0 @tab @ref{Primitives, FALSE}
 @item 003 @tab 03 @tab @code{00000011} @tab 0 @tab @ref{Primitives, TRUE}
@@ -12,8 +12,8 @@
 @item 005 @tab 05 @tab @code{00000101} @tab 0 @tab
 @item 006 @tab 06 @tab @code{00000110} @tab 0 @tab
 @item 007 @tab 07 @tab @code{00000111} @tab 0 @tab
-@item 008 @tab 08 @tab @code{00001000} @tab 0 @tab @ref{Containers, LIST}
-@item 009 @tab 09 @tab @code{00001001} @tab 0 @tab @ref{Containers, MAP}
+@item 008 @tab 08 @tab @code{00001000} @tab 0 @tab @ref{LIST}
+@item 009 @tab 09 @tab @code{00001001} @tab 0 @tab @ref{MAP}
 @item 010 @tab 0A @tab @code{00001010} @tab 0 @tab
 @item 011 @tab 0B @tab @code{00001011} @tab 8+~ @tab @ref{Blobs, BLOB}
 @item 012 @tab 0C @tab @code{00001100} @tab 1+~ @tab @ref{Integers, +INT}
index 031e0c3a6ed370440afcea172d28f7b6b660a330cc7483708185961a50fe71dc..acd1ddfa747f04bdfadddcbfa0538a14af6d2deafc36c3bd430ba215f1745983 100644 (file)
@@ -8,10 +8,10 @@ readable language somewhere nearby.
 For being able to streamingly generate the serialised data, you have to
 worry about @ref{MAP}'s keys ordering. Remember that it is length-first one.
 
-By default binary data is expected to be encoded as @ref{BIN}. If you
-expect to deal with huge amounts of data, then probably you should use
-the @ref{BLOB} type. Generally you have to differentiate field names for
-ordinary strings and blobs.
+By default binary data is expected to be encoded as @ref{Strings, BIN}.
+If you expect to deal with huge amounts of data, then probably you
+should use the @ref{Blobs, BLOB} type. Generally you have to
+differentiate field names for ordinary strings and blobs.
 
 For relatively small structures it could be wise to use reasonably short
 key names. However it may be difficult and not obvious to keep the
@@ -32,4 +32,4 @@ guessing the context of the data inside.
 
 If you really desire more compact encoding, even agree to use schema
 definitions, then think about replacing MAPs with @ref{LIST}s. Non-present
-values can be indicated by @ref{NIL} tag.
+values can be indicated by @ref{Primitives, NIL} tag.