473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problem with structure

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
1 1881
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Muhammad Farooq-i-Azam | last post by:
Hi, I am trying to define an arp structure but having problem doing so. I think I have define the correct arp structure but I find myself in a strange problem. The size of structure that I have...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
4
by: David Scemama | last post by:
Hi, I'm trying to read a database file written from a turbo Pascal program. I've set a structure to map the records in the file, but I have problem reading the file when I use VBFixedArray in...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
43
by: John | last post by:
Hi This .net is driving me crazy!! In VB6 I had a type which contained a couple of multi-dimentional arrays which i used to create and read records: Type AAA : Array1(10,10,2) as Integer
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.