PreviousNext

Structures

The type_specifier for a structure type can take the following forms:

struct [tag]

{

struct_member;

...

}

struct tag

A tag, if supplied in a specifier of the first form, becomes a shorthand form for the set of member declarations that follows it. Such a tag can subsequently be used in a specifier of the second form.

A struct_member takes the following form:

[[struct_member_attribute, ...]] type_specifier declarator, ...;

A struct_member_attribute can be any of the following:

· array_attribute: One of several attributes that specify characteristics of arrays.

· ignore: An attribute indicating that the pointer member being declared is not to be transmitted in remote procedure calls.

· ref: An attribute indicating that the pointer member being declared is a reference pointer: it cannot be NULL and cannot be an alias.

· ptr: An attribute indicating that the pointer member being declared is a full pointer: it can be NULL and can be an alias.

· unique: An attribute indicating that the pointer member being declared is a unique pointer.

· string: n attribute indicating that he array member being declared is a string.

· switch_is:

A structure can contain a conformant array (conformant structure) only as its last member. And such a structure can be contained by another structure only as its last member, and so on. A conformant structure cannot be returned by an operation as its value and cannot e simply an out parameter. Note that a structure can contain any number of pointer to conformant arrays. Structure fields defined as pointers to an array base type and with one or more of the array size attributes define pointers to conformant arrays. Since the size of the pointer field in the structure is fixed, the structure itself is not conformant, although the array that it points to is conformant.

A structure cannot contain a pipe or context handle.

The ignore attribute specifies that he pointer is not to be transmitted in remote procedure calls. Note that the ignore attribute can be applied only to a pointer that is a member of a structure. The ignore attribute is not allowed in a type declaration that defines a pointer type.