
Synchronous C Data Types
Description
Function pointers of write_to_data_destination type are used to download object data to a network or other destination from the 5800 system server using “hc_retrieve_ez” on page 91. The function pointer and opaque cookie reference are supplied as arguments to “hc_retrieve_ez” on page 91, and the function will be called with the supplied cookie argument to deliver the downloaded data to a local data storage function.
A write_to_data_destination function should write exactly buff_len bytes to the data destination indicated by cookie, reading the bytes from the buffer at location buff. It should return a long value indicating the number of bytes actually processed. A return code that differs from buff_len indicates that the transfer should be terminated.
Parameters
cookie | An opaque data structure to identify this data cookie. The cookie is likely to be |
| an open file descriptor. |
buff | Where to copy the data from. |
buff_len | The number of bytes of space in buff. |
See Also
“hc_retrieve_ez” on page 91
hcerr_t
5800 system C client API error codes.
To decode hcerr_t values into strings, see “hc_decode_hcerr” on page 112
Synopsis
typedef enum hcerr { HCERR_OK = 0,
HCERR_NOT_INITED,
HCERR_ALREADY_INITED,
HCERR_INIT_FAILED,
HCERR_OOM,
HCERR_NOT_YET_IMPLEMENTED,
HCERR_SESSION_CREATE_FAILED,
HCERR_ADD_HEADER_FAILED,HCERR_IO_ERR,
HCERR_FAILOVER_OCCURRED,
HCERR_CAN_CALL_AGAIN,
HCERR_GET_RESPONSE_CODE_FAILED,
HCERR_CONNECTION_FAILED,
Chapter 3 • Sun StorageTek 5800 System C Client API | 51 |