OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
typedef struct two_uuid_s_t {
uuid_t uuid1;
uuid_t uuid2;
} two_uuid_t;
typedef struct two_uint_s_t {
unsigned32 uint1;
unsigned32 uint2;
} two_uint_t;
typedef enum {
uuids,
uints
} union_contents;
typedef union switch (union_contents type){
case uuids:
two_uint_t integers;
case uints:
two_uuid_t ids;
} test_union_t;
The resulting IDL generated C header declarations look like as follows:
typedef struct two_uuid_s_t{
uuid_t uuid1;
uuid_t uuid2;
}two_uuid_t;
typedef struct two_uint_s_t{
unsigned32 uint1;
unsigned32 uint2;
}two_uint_t;
typedef enum{
uuids,
uints
}union_contents;
typedef struct{
union_contents type;
union {
/* case(s): 0 */
two_uint_t integers;
/* case(s): 1 */
two_uuid_t ids;
} tagged_union;
}test_union_t;
The IDL compiler packages the encapsulated union as a structure with the discriminant
as the first member. To pass the union as an [in] or [in,out] parameter, the calling
6 24 Tandem Computers Incorporated 124246