FTAM/9000 Programmer's Guide
414 Chapter 10
Example Programs
Common Code Example
Api_rc outcome;
Return_code res;
struct Ft_diagnostic *diag = NULL;
/*
** Initialize the parameters with valid values.
*/
*filename = DEST_FNAME;
ftam_3(contents_type);
*requested_access = FT_FA_READ | FT_FA_REPLACE
| FT_FA_EXTEND | FT_FA_ERASE | FT_FA_READ_ATTRIBUTE
| FT_FA_CHANGE_ATTRIBUTE | FT_FA_DELETE_FILE;
*file_status = FT_NEW;
*return_event_name = 2;
/*
** Initialize the input_dcb.
*/
res = ft_didcb(FTiCreate, 0, (Octet **)input_dcb, & outcome);
if (res != SUCCESS)
error_handler(outcome, diag);
(*input_dcb)-concurrency_control = (struct Ft_concurrency_control *)
malloc(sizeof(struct Ft_concurrency_control));
concur_cntl_in( & ((*input_dcb)-concurrency_control) );
(*input_dcb)-create_file_pw.pointer = (Octet *)CREAT_PW;
(*input_dcb)-create_file_pw.length = CREAT_PW_LEN;
passwords_in( & ((*input_dcb)-file_passwords) );
(*input_dcb)-account = DEST_ACCOUNT;
/*
** Initialize the inout_dcb.
*/
*inout_dcb = NULL;
}
/*
** bgr_parm_in
** DESCRIPTION:
** This routine assigns valid values to the ft_bgroup parameters.
**
** PARAMETERS:
** Outputs:
** threshold : number of calls within the group
** return_event_name : gets signalled when the event completes
** default: SYNCHRONOUS
** input_dcb : contains ft_bgroup input information
** inout_dcb : contains return_code field
*/
void
bgr_parm_in(threshold, return_event_name, input_dcb, inout_dcb)
Uint16 *threshold;
Local_event_name *return_event_name;
char **input_dcb;
struct Ft_bgroup_out_dcb **inout_dcb;
{