From: Ben Pfaff Date: Sat, 23 Jul 2016 18:02:06 +0000 (-0700) Subject: Some progress on format documentation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=317044f9d3cd7abf6dff515574538e59657f98af Some progress on format documentation. --- diff --git a/Makefile b/Makefile index cf5aa787de..348323a9a6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ parse-xml.o: CFLAGS := $(shell pkg-config --cflags libxml-2.0) $(base_cflags) parse-xml: LDFLAGS := $(shell pkg-config --libs libxml-2.0) $(LDFLAGS) dump2.o: CFLAGS := $(base_cflags) -Wno-unused -all: dump dump2 parse-xml +all: dump dump2 parse-xml spv-file-format.text dump: dump.o u8-mbtouc.o dump2: dump2.o u8-mbtouc.o parse-xml: parse-xml.o +spv-file-format.text: spv-file-format.texi + makeinfo --force --plaintext -o $@ $< diff --git a/parse-xml.c b/parse-xml.c index 4d352ce8d8..d8726abcce 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -113,7 +113,11 @@ print_attributes (xmlNode * a_node) { printf ("%s", node->name); for (xmlAttr *attr = node->properties; attr; attr = attr->next) - printf (" %s", attr->name); + { + printf (" %s", attr->name); + if (!strcmp ((char *) attr->name, "baseFormat")) + printf ("=%s", (char *) xmlGetProp (node, attr->name)); + } putchar ('\n'); } @@ -163,7 +167,7 @@ static void print_xml (xmlDoc *doc, xmlNode *node) { xmlBuffer *buf = xmlBufferCreate(); - xmlNodeDump (buf, doc, node, 0, 1); + xmlNodeDump (buf, doc, node, 0, 0); xmlBufferDump (stdout, buf); xmlBufferFree (buf); putchar ('\n'); diff --git a/spv-file-format.texi b/spv-file-format.texi index f4cceb4b4c..ce094484da 100644 --- a/spv-file-format.texi +++ b/spv-file-format.texi @@ -1922,7 +1922,7 @@ never present (``no''), or sometimes present (``opt'') depends on @item hourFormat @tab yes @tab opt @tab no @tab no @item hourPadding @tab yes @tab yes @tab no @tab no @item @w{ } -@item showMinute @tab yes @tab no @tab no @tab no +@item showMinute @tab yes @tab yes @tab no @tab no @item minutePadding @tab yes @tab yes @tab no @tab no @item @w{ } @item showSecond @tab yes @tab yes @tab no @tab no @@ -1995,39 +1995,35 @@ Only values of @code{true} and @code{short}, respectively, have been observed. @end defvr -@defvr {Attribute} showDay -@defvrx {Attribute} dayPadding +@defvr {Attribute} dayPadding @defvrx {Attribute} dayOfMonthPadding -@defvrx {Attribute} dayType -When @code{baseFormat} is @code{elapsedTime}, @code{showDay} controls -whether and how the ``day'' component (e.g.@: the number of elapsed -24-hour periods) of the elapsed time is displayed. @code{dayPadding} -presumably controls whether the day is padded with spaces, but the -details are not understood. The only observed values are @code{true} -and @code{true}, respectively. @code{dayOfMonthPadding} and -@code{dayType} are not used. - -When @code{baseFormat} is @code{dateTime}, @code{showDay}, which is -always @code{true} in the corpus, controls whether a day is displayed. -@code{dayType} is always @code{month} in the corpus, specifying that +@defvrx {Attribute} hourPadding +@defvrx {Attribute} minutePadding +@defvrx {Attribute} secondPadding +These attributes presumably control whether each field in the output +is padded with spaces to its maximum width, but the details are not +understood. The only observed value for any of these attributes is +@code{true}. +@end defvr + +@defvr {Attribute} showDay +@defvrx {Attribute} showHour +@defvrx {Attribute} showMinute +@defvrx {Attribute} showSecond +@defvrx {Attribute} showMillis +These attributes presumably control whether each field is displayed +in the output, but the details are not understood. The only +observed value for any of these attributes is @code{true}. +@end defvr + +@defvr {Attribute} dayType +This attribute is always @code{month} in the corpus, specifying that the day of the month is to be displayed; a value of @code{year} is supposed to indicate that the day of the year, where 1 is January 1, -is to be displayed instead. @code{dayOfMonthPadding} or possibly -@code{dayPadding} presumably controls whether a 1-digit day of the -month is padded with a space to occupy two positions; in the corpus -both are always present and always @code{true}. (A day of the year -would presumably be padded to 3 positions.) +is to be displayed instead. @end defvr -@defvr {Attribute} showHour -@defvrx {Attribute} hourFormat -@defvrx {Attribute} hourPadding -@code{showHour} controls whether and how the hour component of a date -or an elapsed time is displayed. @code{hourPadding} presumably -controls whether the hour is padded with spaces, but the details are -not understood. The only observed values are @code{true} and -@code{true}, respectively. - +@defvr {Attribute} hourFormat @code{hourFormat}, if present, is one of: @table @code