OSF DCE Application Development Guide--Introduction and Style Guide
RPC Parameters
handle_t handle,
v_struct v_array,
error_status_t *status
)
{
unsigned32 i;
printf("Array test 30);
for(i=v_array.first; i < v_array.first + v_array.length; i++)
printf("subscript %i value %c0, i, v_array.array[i]);
*status = error_status_ok;
}
void array_test4(
handle_t handle,
cv_struct *cv_array,
error_status_t *status
)
{
unsigned32 i;
printf("Array test 40);
for (i = (*cv_array).first; i < (*cv_array).first + (*cv_array).length; i++)
printf("subscript %i value %c0, i, (*cv_array).array[i]);
*status = error_status_ok;
}
The client sample code is as follows:
char5array fixed_array = {’a’,’b’,’c’,’d’,’e’};
v_struct varying_array = {3,4,{’a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’}};
struct {
unsigned32 size;
unsigned32 first;
unsigned32 length;
char array[10];
}cv_array = {10, 4, 5, {’a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’}};
array_test1(binding_h, &fixed_array, &status);
array_test2(binding_h, 5, fixed_array, &status);
array_test3(binding_h, varying_array, &status);
array_test4(binding_h, &cv_array, &status);
124246 Tandem Computers Incorporated 6− 21