Add some clarification as to which sections are flag-dependent
authorJonathan Dieter <jdieter@gmail.com>
Mon, 25 Nov 2019 17:45:31 +0000 (17:45 +0000)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 25 Nov 2019 17:45:31 +0000 (17:45 +0000)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
zchunk_format.txt

index f9237c6ef1979371bd9a1e0bbc810bef252d5455..5aa790f1c71a2729ddd8411ff3471cda580c4af1 100644 (file)
@@ -9,7 +9,7 @@ of four parts:
  * The index: Details about each chunk
  * The signatures: Signatures used to sign the zchunk file
 
-Definitions:
+Definitions and document conventions:
 (ci)
  Compressed (unsigned) integer - An variable length little endian integer where
  the first seven bits of the number are stored in the first byte, followed by
@@ -17,6 +17,9 @@ Definitions:
  except the final byte must be zero, and the top bit of the final byte must be
  one, indicating the end of the number.
 
+[#]
+ Section is only used if flag # is set.
+
 The lead:
 +-+-+-+-+-+====================+==================+=================+
 |   ID    | Checksum type (ci) | Header size (ci) | Header checksum |
@@ -46,18 +49,17 @@ The preface:
 | Data checksum | Flags (ci) | Compression type (ci ) |
 +===============+============+========================+
 
-(Optional elements will only be set if flag 1 is set to 1)
-+=============================+
-| Optional element count (ci) |
-+=============================+
++=================================+
+| Optional element count (ci) [1] |
++=================================+
 
-[+==========================+=================================+
-[| Optional element id (ci) | Optional element data size (ci) |
-[+==========================+=================================+
+[+==============================+=====================================+
+[| Optional element id (ci) [1] | Optional element data size (ci) [1] |
+[+==============================+=====================================+
 
-+=======================+]
-| Optional element data |] ...
-+=======================+]
++===========================+]
+| Optional element data [1] |] ...
++===========================+]
 
 Data checksum
  This is the checksum of everything after the header, including the compressed
@@ -112,19 +114,17 @@ The index:
 +=================+==========================+==================+
 
 (Dict stream will only exist if flag 0 is set to 1)
-+==================+===============+==================+
-| Dict stream (ci) | Dict checksum | Dict length (ci) |
-+==================+===============+==================+
++======================+===============+==================+
+| Dict stream (ci) [0] | Dict checksum | Dict length (ci) |
++======================+===============+==================+
 
 +===============================+
 | Uncompressed dict length (ci) |
 +===============================+
 
-(Chunk stream will only exist if flag 0 is set to 1)
-EXPERIMENTAL: (Uncompressed chunk checksum will only exist if flag 2 is set to 1)
-[+===================+================+=============================+
-[| Chunk stream (ci) | Chunk checksum | Uncompressed chunk checksum |
-[+===================+================+=============================+
+[+=======================+================+=================================+
+[| Chunk stream (ci) [0] | Chunk checksum | Uncompressed chunk checksum [2] |
+[+=======================+================+=================================+
 
 +===================+==========================+]
 | Chunk length (ci) | Uncompressed length (ci) |] ...