FTAM/9000 Programmer's Guide
412 Chapter 10
Example Programs
Common Code Example
/*
**
** ope_parm_in
**
** DESCRIPTION:
** This routine assigns valid values to the ft_open parameters.
**
**
** PARAMETERS:
** Outputs:
** processing_mode : type of permission
** contents_type : document type
** return_event_name : gets signalled when the event completes
** default: SYNCHRONOUS
** input_dcb : contains ft_open input information
** inout_dcb : contains return_code field
**
*/
void
ope_parm_in(processing_mode, contents_type, return_event_name,
input_dcb, inout_dcb)
Ft_processing_mode *processing_mode;
struct Ft_contents_type *contents_type;
Local_event_name *return_event_name;
struct Ft_open_in_dcb **input_dcb;
struct Ft_open_out_dcb **inout_dcb;
{
Api_rc outcome;
Return_code res;
struct Ft_diagnostic *diag = NULL;
/*
** Initialize the parameters with valid values.
*/
*processing_mode = FT_PM_READ | FT_PM_REPLACE
| FT_PM_EXTEND | FT_PM_ERASE;
ftam_3(contents_type);
*return_event_name = SYNCHRONOUS;
/*
** Initialize the input_dcb.
*/
res = ft_didcb(FTiOpen, 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) );
/*
** Initialize the inout_dcb.
*/
*inout_dcb = NULL;
}