FTAM/9000 Programmer's Guide
Chapter 8 315
Transferring HP FTAM/9000 Data
Reading Data
ft_rdata()
#include %</opt/ftam/include/map.h>
#include %</opt/ftam/include/mapftam.h>
Return_code
ft_rdata (connection_id, des_requested, return_event_name,
inout_dcb)
Connection_id connection_id;
Uint16 des_requested;
Local_event_name return_event_name;
struct Ft_rdata_out_dcb **inout_dcb;
Use ft_rdata() to receive the data you requested on ft_read(). Issuing
ft_rdata() controls the number of data elements you read (i.e., controls
the flow of information). You may have to call ft_rdata() several times to
read the entire contents of a file. The information returns in the
inout_dcb->data_unit parameter.
Since FTAM-1, FTAM-3, and INTAP-1 files contain only single FADUs,
you must read the entire file. You can read individual FADUs within
FTAM-2 files. (Refer to the “FTAM Data Structures” chapter for
Ft_data_unit information.)
• Invoke ft_rdata() in the Data Transfer regime after invoking
ft_read(); you do not move to another regime.
• The des_requested parameter specifies the maximum number of data
elements you want to receive.
• During ft_connect(), you must negotiate the FT_FU_READ
functional_units to use ft_rdata().
• If the inout_dcb->data_unit->structure_id equals FT_DATA_END,
you reached the end of the file.
• If the inout_dcb->data_unit->structure_id equals FT_CANCEL_IND,
the responder cancelled the data transfer. Call ft_rcancel() to respond
to the cancel indication; do not send another ft_rdata().
Ft_rdata_out_dcb
struct Ft_rdata_out_dcb {
Uint16 size;
struct Api_rc result;
Uint32 des_received;
struct Ft_data_unit *data_unit;
enum Ft_action_result action_result;
struct Ft_diagnostic *diagnostic;
};