summaryrefslogtreecommitdiffstats
path: root/tools/h5dumptst.c
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-05-04 17:05:09 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-05-04 17:05:09 (GMT)
commit295fbf3b82d3ebfc9aefe5b90637159be4610401 (patch)
tree4c42cacc2c9f7f56f39bc8a459442db5a027dd98 /tools/h5dumptst.c
parent23af2ada84a47cdb5c3bfbd340f31f7e1539ae8b (diff)
downloadhdf5-295fbf3b82d3ebfc9aefe5b90637159be4610401.zip
hdf5-295fbf3b82d3ebfc9aefe5b90637159be4610401.tar.gz
hdf5-295fbf3b82d3ebfc9aefe5b90637159be4610401.tar.bz2
[svn-r2214] added support for the opaque type.
prints out the data section in hexidecimal format. in the h5dumptst.c i added a function to create an opaque test file.
Diffstat (limited to 'tools/h5dumptst.c')
-rw-r--r--tools/h5dumptst.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/tools/h5dumptst.c b/tools/h5dumptst.c
index d01fc0a..b90974a 100644
--- a/tools/h5dumptst.c
+++ b/tools/h5dumptst.c
@@ -23,6 +23,7 @@
#define FILE16 "tobjref.h5"
#define FILE17 "tdatareg.h5"
#define FILE18 "tnestedcomp.h5"
+#define FILE19 "topaque.h5"
#define LENSTR 50
#define LENSTR2 11
@@ -1645,6 +1646,48 @@ void test_nestcomp(void){
}
+void test_opaque(){
+ hid_t file, type, dataset, space;
+ char test[100][2];
+ int x;
+ hsize_t dim = 2;
+
+ for (x = 0; x < 100; x++){
+ test[x][0] = x;
+ test[x][1] = 99 - x;
+ }
+
+ /*
+ * Create the data space.
+ */
+ space = H5Screate_simple(1, &dim, NULL);
+ /*
+ * Create the file.
+ */
+ file = H5Fcreate(FILE19, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ /*
+ * Create the memory datatype.
+ */
+ type = H5Tcreate (H5T_OPAQUE, sizeof(char)*100*2);
+ H5Tset_tag(type, "test opaque type");
+
+ /*
+ * Create the dataset.
+ */
+ dataset = H5Dcreate(file, "opaque test", type, space, H5P_DEFAULT);
+ /*
+ * Wtite data to the dataset;
+ */
+ H5Dwrite(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, test);
+
+ H5Tclose(type);
+ H5Sclose(space);
+ H5Dclose(dataset);
+ H5Fclose(file);
+
+}
+
+
int main(void){
test_group();
@@ -1670,6 +1713,8 @@ test_objref();
test_datareg();
test_nestcomp();
+
+test_opaque();
return 0;
}