The issue is the answer to your question is actually: we have no way to tell, and even if we had an answer based on some scheme (likely bogus like "average" or "most" or similar) that answer could easily become false in time.
I've pretty much already outlined a very limited enumeration (based upon a single flat list) and this would be the core component of the system.
The get_info() style function would be critical as would likely a set_info(). These are the most flexible solution to the problem of data transfer and storage, formatting, protocol and so on. This is easily demonstrated by the fact everything we do is ultimately represented by arrays of bytes.
One limit to such a system is the c-string null termination means a null character is not valid within a string. So data including nulls (or any byte value) couldn't easily be dealt with using such a system.
For that you'd need a 2nd function pair minimally:
Code: Select all
size_t get_data(const char *name, void *destination);
... set_data(const char *name, const void *source, const size_t size);
"set_data" is something that would require real implementation to test. In some cases I've implemented functions like this with error communication methods to allow the server (or "plug-in") to report what happened to the client (or "host").
This is important in cases where something went wrong and the client has no way to report that to the user. Obviously an error reporting system has some overhead, so it's simply an issue to consider.