OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
*/
typedef struct{
unsigned32 size;
unsigned32 first;
unsigned32 length;
[size_is(size), first_is(first), length_is(length)] char array[0..*];
}cv_struct;
void array_test4(
[in] handle_t handle,
[in] cv_struct *cv_array,
[out] error_status_t *status);
The examples show clearly how field attribute variables are related to array declarations.
In the second operation declaration, a conformant array is declared as an operation
parameter (an_array), so that the field attribute variable (size) must also be a parameter
of the interface. In the third and fourth operations, varying and conformant-varying
arrays are declared within structures, so that the field attribute variables (size, first, and
length) must also be members of the same structures.
The server manager sample code to test these declarations is as follows:
void array_test1(
handle_t handle,
char5ptr a_pointer,
error_status_t *status
)
{
printf("Array test 10);
printf("%c %c 0, (*a_pointer)[0],(*a_pointer)[1]);
*status = error_status_ok;
};
void array_test2(
handle_t handle,
unsigned32 size,
idl_char an_array[],
error_status_t *status
)
{
unsigned32 i;
printf("Array test 20);
for(i=0; i < size; i++)
{
printf("%c ",an_array[i]);
printf("0);
}
*status = error_status_ok;
}
void array_test3(
6 20 Tandem Computers Incorporated 124246