FTAM/9000 Programmer's Guide
394 Chapter 10
Example Programs
Common Code Example
/* Send data to the destination file.
**
** Get the parameters for ft_sdata.
** Call ft_sdata and verify the outcome.
*/
if (rda_inout_dcb -data_unit != NULL) {
sda_parm_in(& return_event_name, & sda_inout_dcb);
res = ft_sdata(conn_id[DST], rda_inout_dcb-data_unit,
return_event_name, & sda_inout_dcb);
if (res != SUCCESS) {
/*
** If a “No connection resources” error was returned,
** wait until the resources are free.
*/
if (res == FTE008_NO_CON_RESOURCES) {
/*
** Get the parameters for ft_nwcleared.
** Call ft_nwcleared and verify the outcome.
*/
nwc_parm_in( & return_event_name, & nwc_inout_dcb );
res = ft_nwcleared(conn_id[DST], return_event_name,
& nwc_inout_dcb);
if (res != SUCCESS)
error_handler(nwc_inout_dcb-result, diag);
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)nwc_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
}
else {
error_handler(sda_inout_dcb-result,
sda_inout_dcb-diagnostic);
}
}
/* Free memory.
*/
res = ft_dfdcb((Octet *)sda_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
}
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)rda_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
}
/*
** Send a data end to the destination file.
**
** Get the parameters for ft_edata.
** Call ft_edata and verify the outcome.
*/
eda_parm_in(& return_event_name, & eda_input_dcb, & eda_inout_dcb);
res = ft_edata(conn_id[DST], return_event_name, eda_input_dcb,
& eda_inout_dcb);
if (res != SUCCESS)
error_handler(eda_inout_dcb-result, eda_inout_dcb-diagnostic);