/************************************************************
This example shows how to set the space allocation time
for a dataset. The program first creates two datasets,
one with the default allocation time (late) and one with
early allocation time, and displays whether each has been
allocated and their allocation size. Next, it writes data
to the datasets, and again displays whether each has been
allocated and their allocation size.
This file is intended for use with HDF5 Library version 1.8
************************************************************/
#include "hdf5.h"
#include
#include
#define FILE "h5ex_d_alloc.h5"
#define DATASET1 "DS1"
#define DATASET2 "DS2"
#define DIM0 4
#define DIM1 7
#define FILLVAL 99
int
main (void)
{
hid_t file, space, dset1, dset2, dcpl;
/* Handles */
herr_t status;
H5D_space_status_t space_status;
hsize_t dims[2] = {DIM0, DIM1},
storage_size;
int wdata[DIM0][DIM1]; /* Write buffer */
hsize_t i, j;
/*
* Initialize data.
*/
for (i=0; i