Ethereal-dev: Re: [Ethereal-dev] Enhancement request: better bit fields handling

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Guy Harris" <gharris@xxxxxxxxx>
Date: Mon, 8 Mar 2004 16:06:24 -0800 (PST)
Yaniv Kaul said:
> It's a lot of work using these days FT_BOOLEAN.
> If it could just use some array that would look something like:
> static const bitvalues[] {
>     {bitmask, 'true string', 'false string'},
>     {bitmask2, 'true string2', 'false string2'},
> ...
> };

It's impossible for it to *globally* use such an array, because, for
different FT_BOOLEAN flags, the same bit can mean different things.

Also, not all FT_BOOLEANS are one-bit variables - some are, as far as I
know, full byte/word/etc. values.

Do you mean that, for a given field that contains Boolean bitfields, you'd
have a single array that contains values for all the Boolean bitfields in
that field, and have the "hf_register_info" values for all those bitfields
refer to that array?