I was wondering if there is a tool capable of creating C HDF5 for reading and writing code from the C data structure.
I would like this tool to parse the C header file and generate the corresponding HDF5 C read / write code.
We can distinguish the case of static distribution and dynamic distribution. For the first time, I would only be interested in a static distribution.
For example, I would like to generate the following code from the definition of the sensor_t structure, which contains one int and two doubles. The displayed code is a direct conversion of the typedef C structure to the HDF5 C structure.
typedef struct { int serial_no; double temperature; double pressure; } sensor_t; #include "hdf5.h" hid_t memtype; herr_t status; memtype = H5Tcreate (H5T_COMPOUND, sizeof (sensor_t)); status = H5Tinsert (memtype, "serial_no", HOFFSET (sensor_t, serial_no), H5T_NATIVE_INT); status = H5Tinsert (memtype, "temperature", HOFFSET (sensor_t, temperature), H5T_NATIVE_DOUBLE); status = H5Tinsert (memtype, "pressure", HOFFSET (sensor_t, pressure), H5T_NATIVE_DOUBLE); sensor_t wdata[1]; status = H5Dread (dset, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); status = H5Dwrite (dset, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
I browsed the hdf website without success
http://www.hdfgroup.org
I know some tried to use HDF4 with a Perl script
http://www.srl.caltech.edu/ACE/ASC/exhdfgen/index.htm