Source
did_b = H5Dcreate2(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* This program illustrates how references to objects can be used.
* Program creates a dataset and a group in a file. It also creates
* second dataset, and references to the first dataset and the group
* are stored in it.
* Program reopens the file and reads dataset with the references.
* References are used to open the objects. Information about the
* objects is displayed.
*/
int
main(void) {
hid_t fid; /* File, group, datasets, datatypes */
hid_t gid_a; /* and dataspaces identifiers */
hid_t did_b, sid_b, tid_b;
hid_t did_r, tid_r, sid_r;
H5O_type_t obj_type;
herr_t status;
hobj_ref_t *wbuf; /* buffer to write to disk */
hobj_ref_t *rbuf; /* buffer to read from disk */
hsize_t dim_r[1];
hsize_t dim_b[2];
/*
* Create a file using default properties.
*/
fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*