diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 1998-07-08 20:41:14 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 1998-07-08 20:41:14 (GMT) |
commit | 44d5c8823eb4370ff70bf7ed56c8eae7404d222c (patch) | |
tree | 66589a703e3b7f69fc4fbcc7957923ebf4c14ef5 /examples/h5_write.c | |
parent | 768b7465a19afcbc87ba54a7b6400492d54c2626 (diff) | |
download | hdf5-44d5c8823eb4370ff70bf7ed56c8eae7404d222c.zip hdf5-44d5c8823eb4370ff70bf7ed56c8eae7404d222c.tar.gz hdf5-44d5c8823eb4370ff70bf7ed56c8eae7404d222c.tar.bz2 |
[svn-r472] Examples have been modified to reflect the current status of the API functions.
Tested on Solaris 2.5
Diffstat (limited to 'examples/h5_write.c')
-rw-r--r-- | examples/h5_write.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/h5_write.c b/examples/h5_write.c index 98e321f..c57fc7c 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.c @@ -1,9 +1,9 @@ /* - * This example writes data to HDF5 file. + * This example writes data to the HDF5 file. * Data conversion is performed during write operation. */ -#include "hdf5.h" +#include <hdf5.h> #define FILE "SDS.h5" #define DATASETNAME "IntArray" @@ -15,9 +15,9 @@ main () { hid_t file, dataset; /* file and dataset handles */ hid_t datatype, dataspace; /* handles */ - size_t dimsf[2]; /* dataset dimensions */ + hsize_t dimsf[2]; /* dataset dimensions */ herr_t status; - int32 data[NX][NY]; /* data to write */ + int data[NX][NY]; /* data to write */ int i, j; /* @@ -51,9 +51,9 @@ dataspace = H5Screate_simple(RANK, dimsf, NULL); /* * Define datatype for the data in the file. - * We will store little endian INT32 numbers. + * We will store little endian INT numbers. */ -datatype = H5Tcopy(H5T_NATIVE_INT32); +datatype = H5Tcopy(H5T_NATIVE_INT); status = H5Tset_order(datatype, H5T_ORDER_LE); /* * Create a new dataset within the file using defined dataspace and @@ -65,7 +65,7 @@ dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace, /* * Write the data to the dataset using default transfer properties. */ -status = H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, +status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); /* |