By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

problem with structure

P: n/a
HI,
Can anyone please explain this declaration?

typedef PACK_PREFIX struct {
CS_parm_id_t id;
CS_parm_type_t type;
CS_parmMakeup_t makeup;
PACK_PREFIX union {
ULONG enumerated;
ULONG numerical;
sint32 arithmetic;
char *string;
uint32 uint32num;
CS_internal_AID_t aid;
} PACK_SUFFIX val;
} PACK_SUFFIX CS_parm_t;
Thanks n Regds

Jul 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <11**********************@g4g2000hsf.googlegroups. com>,
ramu <ra******@gmail.comwrote:
Can anyone please explain this declaration?
>typedef PACK_PREFIX struct {
CS_parm_id_t id;
CS_parm_type_t type;
CS_parmMakeup_t makeup;
PACK_PREFIX union {
ULONG enumerated;
ULONG numerical;
sint32 arithmetic;
char *string;
uint32 uint32num;
CS_internal_AID_t aid;
} PACK_SUFFIX val;
} PACK_SUFFIX CS_parm_t;
CS_parm_t is defined as an alternate name for a structure.

The components of the structure are named id, type, makeup, and val,
of type CS_parm_id_t, CS_parm_type_t, CS_parmMakeup_t, and union
respectively. The val union members can named be any of enumerated,
numerical, arithmetic, string, uint32num, or aid, of types
ULONG, ULONG, sint32, char*, uint32, or CS_internal_AID_t .

In the snippet shown, the non-basic types CS_parm_id_t, CS_parm_type_t,
CS_parmMakeup_t, ULONG, sint32, and CS_internal_AID_t have not
been defined, so we can't tell you much about them.

PACK_PREFIX and PACK_SUFFIX could be any of a number of things, but
they are very likely macros and probably on -most- systems
are defined as empty -- that is, for -most- systems you would
probably read the declarations as if PACK_PREFIX and PACK_SUFFIX
were simply not there at all. However, on some system or other,
they are likely defined using some implementation-dependant
extension.

On some system, PACK_PREFIX might be defined as the token packed
and PACK_SUFFIX might be defined as empty. On some other system,
PACK_PREFIX might plausibly be defined as something like __packed{
and PACK_SUFFIX might be defined as } . Hard to say, since PACK
is not a standard part of C (and when it exists, it is often
handled through #pragma packed). -Something- system-specific,
hard to say what.
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Jul 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.