summaryrefslogtreecommitdiffstats
path: root/examples/h5_compound.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>1998-07-08 20:41:14 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>1998-07-08 20:41:14 (GMT)
commit44d5c8823eb4370ff70bf7ed56c8eae7404d222c (patch)
tree66589a703e3b7f69fc4fbcc7957923ebf4c14ef5 /examples/h5_compound.c
parent768b7465a19afcbc87ba54a7b6400492d54c2626 (diff)
downloadhdf5-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_compound.c')
-rw-r--r--examples/h5_compound.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/examples/h5_compound.c b/examples/h5_compound.c
index 1abd4c2..1641ee6 100644
--- a/examples/h5_compound.c
+++ b/examples/h5_compound.c
@@ -40,10 +40,8 @@ float s3[LENGTH];
int i;
hid_t file, datatype, dataset, space; /* Handles */
herr_t status;
-size_t dim[] = {LENGTH}; /* Dataspace dimensions */
+hsize_t dim[] = {LENGTH}; /* Dataspace dimensions */
-H5T_class_t class;
-size_t size;
/*
* Initialize the data
@@ -68,9 +66,9 @@ file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
* Create the memory data type.
*/
s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t));
-status = H5Tinsert(s1_tid, "a_name", HPOFFSET(s1, a), H5T_NATIVE_INT);
-status = H5Tinsert(s1_tid, "c_name", HPOFFSET(s1, c), H5T_NATIVE_DOUBLE);
-status = H5Tinsert(s1_tid, "b_name", HPOFFSET(s1, b), H5T_NATIVE_FLOAT);
+H5Tinsert(s1_tid, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
+H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
+H5Tinsert(s1_tid, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
/*
* Create the dataset.
@@ -102,11 +100,11 @@ dataset = H5Dopen(file, DATASETNAME);
*/
s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t));
-status = H5Tinsert(s2_tid, "c_name", HPOFFSET(s2, c), H5T_NATIVE_DOUBLE);
-status = H5Tinsert(s2_tid, "a_name", HPOFFSET(s2, a), H5T_NATIVE_INT);
+H5Tinsert(s2_tid, "c_name", HOFFSET(s2_t, c), H5T_NATIVE_DOUBLE);
+H5Tinsert(s2_tid, "a_name", HOFFSET(s2_t, a), H5T_NATIVE_INT);
/*
- * Read two fields c and a from s1 dataset. Fields iin the file
+ * Read two fields c and a from s1 dataset. Fields in the file
* are found by their names "c_name" and "a_name".
*/
status = H5Dread(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s2);
@@ -150,6 +148,5 @@ printf("\n");
H5Tclose(s2_tid);
H5Tclose(s3_tid);
H5Dclose(dataset);
-H5Sclose(space);
H5Fclose(file);
}