/************************************************************ This example shows how to create and extend an unlimited dataset. The program first writes integers to a dataset with dataspace dimensions of DIM0xDIM1, then closes the file. Next, it reopens the file, reads back the data, outputs it to the screen, extends the dataset, and writes new data to the extended portions of the dataset. Finally it reopens the file again, reads back the data, and outputs it to the screen. This file is intended for use with HDF5 Library version 1.8 ************************************************************/ #include "hdf5.h" #include #include #define FILE "h5ex_d_unlimadd.h5" #define DATASET "DS1" #define DIM0 4 #define DIM1 7 #define EDIM0 6 #define EDIM1 10 #define CHUNK0 4 #define CHUNK1 4 int main (void) { hid_t file, space, dset, dcpl; /* Handles */ herr_t status; hsize_t dims[2] = {DIM0, DIM1}, extdims[2] = {EDIM0, EDIM1}, maxdims[2], chunk[2] = {CHUNK0, CHUNK1}, start[2], count[2]; int wdata[DIM0][DIM1], /* Write buffer */ wdata2[EDIM0][EDIM1], /* Write buffer for extension */ **rdata, /* Read buffer */ ndims, i, j; /* * Initialize data. */ for (i=0; i