FTAM/9000 Programmer's Guide

Chapter 10 365
Example Programs
Using LLCS Functions Example
/*
** Open the source file.
**
** Get the parameters for ft_open.
** Call ft_open and verify the outcome.
*/
(void)printf(“Opening the source file...\n”);
ope_parm_in( & processing_mode, & contents_type,
& return_event_name, & ope_input_dcb, & ope_inout_dcb);
res = ft_open(conn_id[SRC], 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);
/*
** Free memory.
*/
res = ft_dfdcb((Octet *)ope_input_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
res = ft_dfdcb((Octet *)ope_inout_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
/*
** Perform a grouped activity on the destination file.
** ft_bgroup
** ft_create
** ft_open
** ft_egroup
**
** Get the parameters for ft_bgroup.
** Call ft_bgroup and verify the outcome.
*/
(void)printf(“Creating and opening the destination file...\n”);
bgr_parm_in( & threshold, & return_event_name, & bgr_input_dcb,
& bgr_inout_dcb );
res = ft_bgroup(conn_id[DST], threshold, return_event_name,
bgr_input_dcb, & bgr_inout_dcb);
if (res != SUCCESS)
error_handler(bgr_inout_dcb->result, diag);
/*
** Get the parameters for ft_create.
** Call ft_create and verify the outcome.
*/
cre_parm_in( & dst_filename, & contents_type,
& requested_access, & file_status, & return_event_name,
& cre_input_dcb, & cre_inout_dcb );
/*
** Set the attributes and contents_type of the destination file
** to be identical with those of the source file.
*/
cre_input_dcb->attributes = attr_src;
contents_type = attr_src.values.contents_type;
res = ft_create(conn_id[DST], dst_filename, contents_type,
requested_access, file_status, return_event_name,
cre_input_dcb, & cre_inout_dcb);
if (res != SUCCESS)
error_handler(cre_inout_dcb->result, cre_inout_dcb->diagnostic);