test_microjson: test_microjson.o mjson.o
$(CC) $(CFLAGS) -o test_microjson test_microjson.o mjson.o
+.SUFFIXES: .html .asc
+
+# Requires asciidoc and xsltproc/docbook stylesheets.
+.asc.html:
+ asciidoc $*.asc
+
# Regression test
check: test_microjson
test_microjson
clean:
rm -f microjson.o test_microjson.o test_microjson example[123]
+ rm -f microjson.html
CSUPPRESSIONS = -U__UNUSED__
cppcheck:
dist: microjson-$(VERSION).tar.gz
-release: microjson-$(VERS).tar.gz mjson.html
+release: microjson-$(VERS).tar.gz microjson.html
shipper version=$(VERS) | sh -e -x
the right spec against the actual data. (There's an instance
of this in Example 3.)
- The dialect this parses has some limitations. First, it cannot
+The dialect this parses has some limitations. First, it cannot
recognize the JSON "null" value. Second, all elements of an array must
be of the same type. Third, some types (t_time, t_character) may not
be array elements (this restriction could be lifted, and might be
in a future release).
There are separate entry points for beginning a parse of either JSON
-object or a JSON array. JSON "float" quantities are actually stored as
-doubles.
+object or a JSON array.
+
+JSON "float" quantities are actually stored as doubles.
This parser processes object arrays in one of two different ways,
defending on whether the array subtype is declared as object or
structobject.
- Object arrays take one base address per object subfield, and are
+Object arrays take one base address per object subfield, and are
mapped into parallel C arrays (one per subfield). Strings are not
supported in this kind of array, as they don't have a "natural" size
to use as an offset multiplier.
- Structobject arrays are a way to parse a list of objects to a set
+Structobject arrays are a way to parse a list of objects to a set
of modifications to a corresponding array of C structs. The trick is
that the array object initialization has to specify both the C struct
array's base address and the stride length (the size of the C struct).