H5D_SCATTER retrieves data from the supplied callback op and scatters it to the supplied buffer dst_buf in a manner similar to data being written to a dataset. dst_space_id is a dataspace which defines the extent of dst_buf and the selection within it to scatter the data to.
type_id is the datatype of the data to be scattered in both the source and destination buffers.
dst_buf must be at least as large as the number of elements in the extent of dst_space_id times the size in bytes of type_id .
To retrieve the data to be scattered, H5D_SCATTER repeatedly calls op , which should return a valid source buffer, until enough data to fill the selection has been retrieved. The prototype of the callback function op is as follows (as defined in the source code file H5Dpublic.h ): herr_t (*H5D_scatter_func_t)( const void ** src_buf/*out*/, size_t *src_buf_bytes_used/*out*/, void *op_data) The parameters of this callback function have the following values or meanings: src_buf | Pointer to the buffer holding the next set of elements to scatter On entry, the value of *src_buf is undefined. The callback function should set *src_buf to point to the next set of elements. | src_buf_bytes_used | Pointer to the number of valid bytes in src_buf On entry, the value of *src_buf_bytes_used is undefined. The callback function should set *src_buf_bytes_used to the number of valid bytes in src_buf . This number must be a multiple of the datatype size. | op_data | User-defined pointer to data required by the callback function A pass-through of the op_data pointer provided with theH5D_SCATTER function call. |
The callback function should always return at least one element in src_buf , and must not return more elements than are remaining to be scattered. This function will be repeatedly called until all elements to be scattered have been returned. The callback function should return zero (0 ) to indicate success, and a negative value to indicate failure. |