Some progress on format documentation.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 23 Jul 2016 18:02:06 +0000 (11:02 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 23 Jul 2016 18:02:06 +0000 (11:02 -0700)
Makefile
parse-xml.c
spv-file-format.texi

index cf5aa787de3e99e0d7adbad3449780114b8ece79..348323a9a631f3b6650162bedf5a22aa79f0604a 100644 (file)
--- 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 $@ $<
index 4d352ce8d8cbfe0f03a400fe558c09e644d94a2b..d8726abcceeb23dbc3de7a64ec49da04e389a47e 100644 (file)
@@ -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');
index f4cceb4b4c5c4cb675d22ece46826ff8a92bc375..ce094484da3fe059cfb6c3e60f889c14d4cc56b6 100644 (file)
@@ -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