]> git.pond.sub.org Git - empserver/commit - doc/xdump
xdump: Make meta-type numbers portable, get rid of meta-type "c"
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 26 Jun 2016 06:00:20 +0000 (08:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:17 +0000 (20:09 +0200)
commit89a06ec2d4fcf4999bcfc3eada947ee6893e314e
tree3904f0362263a4ae5cbd402c9bb910f6ffba8da0
parent6e9f256c6835f5739c9efc64050b54bfaf11c140
xdump: Make meta-type numbers portable, get rid of meta-type "c"

The xdump field data types are abstract symbols "d", "f", "s" and "c".
However, the abstraction leaks: we dump the enum nsc_type ca_type
values verbatim in meta table field "type", and have symbol table
meta-type map all integer types to "d", and both floating-point types
to "f".  Not a problem for well-behaved clients, since all they do
with the dumped value is referencing table meta-type.  It is a problem
for version-test: since the integer type compatible with an
enumeration type is implementation-defined, the type value of
selectors of enumeration type can vary between compilers.  It also
makes table meta-type a somewhat ugly exception to the rule that a
symbol table maps integers to names 1:1.

Virtual selectors let us seal the abstraction: dump the promoted
ca_type value.

The integer types get all promoted to NSC_LONG.  This takes care of
version-test.

The floating-point types get all promoted to NSC_DOUBLE.  Makes sense.

NSC_STRINGY gets promoted to NSC_STRING.  This changes all field data
types "c" to "s".  Getting rid of "c" is a welcome simplification,
because now the meaning of meta type field "len" no longer depends on
"type", but always means that the array is dumped as that many fields.
We lose string length limit information, though.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
doc/xdump
src/lib/common/nsc.c
src/lib/global/symbol.c
tests/normalize.pl
tests/version/journal.log