Description
Functionpointers of read_from_data_source type are used to upload object data. The function
pointerand opaque cookie reference are supplied as arguments to hc_store_both_ez”on
page87 and other functions that store object data. The data source reader function will be
calledrepeatedly, with the supplied cookie as an argument, to gather the object data to upload
intostorage.
Aread_from_data_sourcefunction should read up to buf_size bytes from the data source
indicatedby cookie into the buer at location buff and return the actual number of bytes read
asthe return value from the function.
Thereare two special return codes:
Areturn value of 0indicates the end-of-le condition. The data should be committed to the
datastore.
Areturn value of -1 indicates a request to cancel the store. The store operation should be
abortedwith an error code of HCERR_ABORTED_BY_CALLBACK.
Parameters
cookie
Anopaque data structure to identify this data cookie. The cookie is likely to be an open le
descriptor.
buf
Whereto store the data.
buf_size
Thenumber of available bytes of space in buf.
SeeAlso
hc_store_both_ez”on page 87
write_to_data_destination
Datadestination template used to download object data to the cluster.
Synopsis
typedef long (*write_to_data_destination)
(void *cookie, char *buff, long buff_len);
SynchronousCData Types
SunStorageTek5800 System Client API Reference Manual • June 200850