That's the key observation, seems to me. In our development, we've
adopted a standard of tagged values, where a single-value file is
tagged by its name, and multiple-value files have a tag:value per
line (where value might be an n-tuple).
The result is easy to parse for userland code that needs the values
and relatively easy (because ASCII and consistent) for admins to
read. A pretty-printer provides an interface for mere humans.
I suppose one could add typing information as well, but it seems to
me that a reader of /proc/stuff is either completely ignorant of the
content (eg cat), and typing is irrelevant, or it knows what's there
(eg ps) and typing is redundant, as long as there are unambiguous
tags.
I think of the tagged list of n-tuples as a kind of ASCII
representation of a simple struct. One could of course create a
general ASCII representation of a C struct, and no doubt it's been
done innumerable times, but I don't think that helps in this
application.
Of course, one tagged value can be "version"....
-- /Jonathan Lundell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/