Refine understanding of minor points.
[pspp] / spv-file-format.texi
index 5e95b53a9e1491acc15326e297c70c47a5a07ba8..3251e3e38b066884f14d7b7f116007108a52891e 100644 (file)
@@ -353,3 +353,73 @@ Typical contents (indented for clarity):
 Always @code{text}.
 @end table
 @end table
+
+@node SPV Light Detail Member Format
+@subsection Light Detail Member Format
+
+A ``light'' detail member @file{.bin} consists of a number of sections
+concatenated together, terminated by a byte 01:
+
+@example
+light-member := header title fonts dims data 01
+@end example
+
+The first section is a 0x27-byte header:
+
+@example
+header := 01 00 version 01 (00 | 01) byte*21 00 00 table-id byte*4
+version := i1 | i3
+table-id := int
+@end example
+
+@code{header} includes @code{version}, a version number that affects
+the interpretation of some of the other data in the member.  We will
+refer to ``version 1'' and ``version 3'' members later on.  It also
+@code{table-id} is a binary version of @code{tableId} attribute in the
+structure member that refers to the detail member.  For example, if
+@code{tableId} is @code{-4154297861994971133}, then @code{table-id}
+would be 0xdca00003.  The meaning of the other variable parts of the
+header is not known.
+
+@example
+title := value 01?              /* @r{localized title} */
+         value 01? 31           /* @r{subtype} */
+         value 01? 00? 58       /* @r{locale-invariant title} */
+         (31 value | 58)        /* @r{caption} */
+         int[n] footnote*[n]    /* @r{footnotes} */
+footnote := value (31 value | 58) byte*4
+@end example
+
+@example
+fonts := 00 font*8
+         int[x1] byte*[x1]
+         int[x2] byte*[x2]
+         int[x3] byte*[x3]
+         int[x4] int*[x4]
+         string                 /* @r{encoding} */
+         (i0 | i-1) (00 | 01) 00 (00 | 01)
+         int
+         byte[decimal] byte[grouping]
+         int[x5] string*[x5]    /* @r{custom currency} */
+         int[x6] byte*[x6]
+@end example
+
+In every example in the corpus, @code{x1} is 240.  The meaning of the
+bytes that follow it is unknown.
+
+In every example in the corpus, @code{x2} is 18 and the bytes that
+follow it are @code{00 00 00 01 00 00 00 00 00 00 00 00 00 02 00 00 00
+00}.  The meaning of these bytes is unknown.
+
+Observed values of @code{x3} vary from 16 to 150.  The bytes that
+follow it vary somewhat.
+
+Observed values of @code{x4} vary from 0 to 17.  Out of 7060 examples
+in the corpus, it is nonzero only 36 times.
+
+@code{decimal} is the decimal point character.  The observed values
+are @samp{.} and @samp{,}.
+
+@code{grouping} is the grouping character.  The observed values are
+@samp{,}, @samp{.}, @samp{'}, @samp{ }, and zero (presumably
+indicating that digits should not be grouped).