Last modified: 18 February 2014

Name: H5Pget_append_flush

herr_t H5Pget_append_flush ( hid_t dapl_id, int ndims, hsize_t boundary[], H5D_append_cb_t *func, void **user_data )

Retrieves the values of the append property that is set up in the dataset access property list.

H5Pget_append_flush obtains the following information from the dataset access property list dapl_id:
boundary[]    The sizes set up in the access property list that are used to determine when a dataset dimension size hits the boundary. Only at most ndims boundary sizes are retrieved, and ndims will not exceed the corresponding value that is set in the property list.
func The user-defined callback function to invoke when a dataset’s appended dimension size reaches a boundary.
user_data The user-defined input data for the callback function.

hid_t dapl_id IN: Dataset access property list identifier.
int ndims IN: The number of elements for boundary.
hsize_t *boundary[] IN: The dimension sizes used to determine the boundary.
H5D_append_cb_t *func    IN: The user-defined callback function.
void **user_data IN: The user-defined input data.

Returns a non-negative value if successful; otherwise returns a negative value.

Example Usage:
The example below illustrates the usage of this public routine to obtain the append values that are set up in the dataset access property list.
hid_t file_id;
hid_t dapl_id, dataset_id, dapl;
hsize_t dims[2] = {0, 100};
hsize_t max_dims[2] = {H5S_UNLIMITED, 100};
hsize_t boundary_dims[2] = {5, 0};
int counter;
hsize_t ret_boundary[1];
H5D_append_flush_cb_t ret_cb;
void *ret_udata;

/* Open the file */

/* Create a copy of the dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);

/* Set up the append property values */
/* boundary_dims[0]=5: to invoke callback and flush every 5 lines */
/* boundary_dims[1]=0: no boundary is set for the non-extendible dimension */
/* append_cb: callback function to invoke when hitting boundary (see below) */
/* counter: user data to pass along to the callback function */
H5Pset_append_flush(dapl_id, 2, boundary_dims, append_cb, &counter);

/* DATASET is a 2-dimensional chunked dataset with dataspace: 
   dims[] and max_dims[] */
dataset_id = H5Dopen2(file_id, “dataset”, dapl_id);

/* Get the dataset access property list for DATASET */
dapl = H5Dget_access_plist(dataset_id);

/* Retrieve the append property values for the dataset */
/* Only 1 boundary size is retrieved: ret_boundary[0] is 5 */
/* ret_cb will point to append_cb() */
/* ret_udata will point to counter */
H5Pget_append_flush(dapl, 1, ret_boundary, &ret_cb, &ret_udata);

/* The callback function */
static herr_t
append_cb(hid_t dset_id, hsize_t *cur_dims, void *_udata)
    unsigned *count = (unsigned *)_udata;
    return 0;
} /* append_cb() */

Fortran Interface:

See Also:

Release     Change
1.10.0 C function introduced with this release.