struct wimp_message_header
Tony van der Hoff
OSLib at mk-net.demon.co.uk
Thu Oct 19 18:38:38 BST 2000
On Thu, 19 Oct 2000, at 16:56:44, David Bryan
<D.J.Bryan at cranfield.ac.uk> wrote on the subject "struct
wimp_message_header":
>In message <45mX2AA0qr75Ewxv at mk-net.demon.co.uk> you wrote:
>
>> On Wed, 18 Oct 2000, at 18:45:04, David Bryan
>> <D.J.Bryan at cranfield.ac.uk> wrote on the subject "struct
>> wimp_message_header":
>>
>> >Why does struct wimp_message_header have a data member? This
>> >makes its sizeof differ from what I would expect.
>>
>> Yes, it is legacy code, retained for backwards compatibility only. The
>> macro wimp_SIZEOF_MESSAGE_HEADER(0) will return the correct size.
>
>Legacy? AFAICS, the struct first appeared in version 6.00.
>
Well, yes, I was trying to get a way with a quick answer :-)
At 6.00 we modified DefMod to better handle variable-size structures. In
order to retain backward compatibility, it had to emit the old-style
structures, as well as the new macro based ones. This in turn meant that
any new structure definition would be created in the new and old styles.
We would normally ignore the old styles, but they'd be available to
anyone who wanted them.
>> Current code should not need to use the wimp_message_header structure,
>> which has been subsumed in the macro wimp_MESSAGE_HEADER_MEMBERS, which
>> in turn forms the basis for the definition of the preferred individual
>> message structures.
>
>I wasn't sure whether this was for internal use only. I failed to
>find anything specific in the documentation. The StrongHelp
>manual documents wimp_message_header, but not
>wimp_MESSAGE_HEADER_MEMBERS. So, I had assumed it was off limits.
>
Nothing in OSLib is off limits. The Stronghelp manual is auto generated
by DefMod, and it only contains proper structure definitions, not
macros. I guess that's a bit of a drop-off. The manual generation really
needs quite an overhaul in many areas, but it's tedious...
>> If you really want a header with no data members, you can define your
>> own:
>> struct
>> {
>> wimp_MESSAGE_HEADER_MEMBERS
>> } message_header;
>>
>> and, if you so choose, take the sizeof that.
>
>OK. But, wimp.h has lines like
>
> typedef wimp_message_header wimp_full_message_mode_change;
>
Which would indeed appear to be wrong. My expertise suddenly dries up
here. Tom, are you there?
>So, I was going to use wimp_message_header for other header-only
>messages.
>
Quite reasonable under the circumstances, but the wrong size :-(
--
Tony van der Hoff | mailto:OSLib at mk-net.demon.co.uk
Buckinghamshire, England | http://www.mk-net.demon.co.uk/oslib/
----------------------------------------------------------------
More information about the oslib-user
mailing list