Hacker News new | ask | show | jobs
by idealmedtech 1274 days ago
It would be great if the kernel itself provided a header only definition of such a format, so you could focus on the data and not the parsing. Would also be able to integrate into their extensive testing infrastructure.
1 comments

Realistically it could stay mostly as-is, some text values with separators, just define exactly how to quote stuff and what the separator.

Then you could just have "load a single value" function that does the unquoting, "load K/V" function for stuff like /proc/meminfo, and "load table" for stuff like /proc/<pid>/stat. Maybe "load records" for stuff like /proc/net/nf_conntrack which is essentially list of KV pairs.