OSF DCE Application Development Guide--Core Components

Topics in RPC Application Development
/* Decode the data using another operation with the same signature */
out_data_addr = (idl_byte *)(((out_buff - (idl_byte *)0) + 7) & (˜7));
out_data_size = (OUT_BUFF_SIZE - (out_data_addr - out_buff)) & (˜7);
es_state.file_handle = open("es_array_1.dat", O_RDONLY, 0);
if (es_state.file_handle < 0)
{
printf("Can’t open es_array_1.dat for reading\n");
exit(0);
}
idl_es_decode_incremental((idl_void_p_t)&es_state, es_read,
&es_h, &status);
if (status != error_status_ok)
{
printf("Error %08x from idl_es_decode_incremental\n", status);
exit(0);
}
out_array_op1(es_h, out_arr);
close(es_state.file_handle);
idl_es_handle_free(&es_h, &status);
if (status != error_status_ok)
{
printf("Error %08x from idl_es_handle_free\n", status);
exit(0);
}
/* Check the input and output are the same */
for(i=0;i<N; i++)
{
if (out_arr[i] != arr[i])
{
printf("out_arr[%d] - found %d - expecting %d\n",
i, out_arr[i], arr[i]);
}
}
/*
* Fixed buffer encode/decode
*/
fixed_buff_start = (idl_byte *)(((fixed_buff_area - \
(idl_byte *)0) + 7)
& (˜7));
fixed_buff_size = (FIXED_BUFF_STORE - \
(fixed_buff_start - fixed_buff_area))
& (˜7);
idl_es_encode_fixed_buffer(fixed_buff_start, fixed_buff_size,
&encoding_size, &es_h, &status);
if (status != error_status_ok)
{
printf("Error %08x from idl_es_encode_fixed_buffer\n", status);
exit(0);
}
124245 Tandem Computers Incorporated 16 53