"Brian S. Julin" wrote:
> > I guess a more flexible scheme would be a dictionary of name/value pairs,
> > both dynamically allocated strings. Is there any way to add that to GII ?
>
> Hmm... both very good points. Not sure if I like the idea of
> yet another table of values -- my inclination would be to enable
> the use of any sized string somehow, and return a standard format
> string from which hw version/vendor can be parsed easily -- that
> way programs that do not care about version/vendor can just print
> it and the full info is printed out.
I don't see how a single long (parsable) string would solve any of the
problems. Given that it would be an (untyped) list of pairs of strings,
you can print that out (may be with a little helper function) without
caring what these strings contain. But when you care, i.e. when you want
to know the version string, you would in your case need to parse the
whole string, while in my case you simply look for a pair where the first
member is "version". Or did I miss something ?
> > Or, would you mind me adding that ? If so, where ?
>
> The more I look at LibGII the more I think that any work on it whatsoever
> would be greatly appreciated :-) The code there is surely not living
> up to the API's potential.
ok, I could try a bit, for example replace the longname/shortname members
by something like
struct nvpair
{
char *name;
char *value;
};
nvpair *info;
or however the correct syntax is in C :-)
That would be an evening's work (i.e. to fix all code that uses these meda
data), but it would IMO be worth it.
Regards,
Stefan