FTAM/9000 Programmer's Guide
366 Chapter 10
Example Programs
Using LLCS Functions Example
/*
** Get the parameters for ft_open.
** Call ft_open and verify the outcome.
*/
ope_parm_in( & processing_mode, & contents_type,
& return_event_name, & ope_input_dcb, & ope_inout_dcb );
contents_type = attr_src.values.contents_type;
return_event_name = 3;
res = ft_open(conn_id[DST], processing_mode, contents_type,
return_event_name, ope_input_dcb, & ope_inout_dcb);
if (res != SUCCESS)
error_handler(ope_inout_dcb->result, ope_inout_dcb->diagnostic);
/*
** Get the parameters for ft_egroup.
** Call ft_egroup and verify the outcome.
*/
egr_parm_in( & return_event_name, & egr_input_dcb, & egr_inout_dcb );
res = ft_egroup(conn_id[DST], return_event_name, egr_input_dcb,
& egr_inout_dcb);
if (res != SUCCESS)
error_handler(egr_inout_dcb->result, diag);
/*
** Wait on the asynchronous events in the group.
*/
for (i = 1; i %<M=> 3; ++i) {
wait_parm_in( & time, & result );
res = em_wait(time, & return_event_name, & result);
if (res != SUCCESS)
error_handler(result, diag);
switch (return_event_name) {
case 1:
if (bgr_inout_dcb->result.return_code != SUCCESS)
error_handler(bgr_inout_dcb->result, diag);
break;
case 2:
if (cre_inout_dcb->result.return_code != SUCCESS)
error_handler(cre_inout_dcb->result,
cre_inout_dcb->diagnostic);
break;
case 3:
if (ope_inout_dcb->result.return_code != SUCCESS)
error_handler(ope_inout_dcb->result,
ope_inout_dcb->diagnostic);
break;
default:
break;
}
}