diff options
author | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 2000-05-04 17:05:09 (GMT) |
---|---|---|
committer | Patrick Lu <ptlu@hawkwind.ncsa.uiuc.edu> | 2000-05-04 17:05:09 (GMT) |
commit | 295fbf3b82d3ebfc9aefe5b90637159be4610401 (patch) | |
tree | 4c42cacc2c9f7f56f39bc8a459442db5a027dd98 /tools | |
parent | 23af2ada84a47cdb5c3bfbd340f31f7e1539ae8b (diff) | |
download | hdf5-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')
-rw-r--r-- | tools/h5dump.c | 13 | ||||
-rw-r--r-- | tools/h5dumptst.c | 45 |
2 files changed, 54 insertions, 4 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c index 37b23e7..359be5e 100644 --- a/tools/h5dump.c +++ b/tools/h5dump.c @@ -431,7 +431,12 @@ H5G_stat_t statbuf; break; case H5T_OPAQUE: - printf( "H5T_OPAQUE: not yet implemented"); + printf( "\n"); + indentation (indent+COL); + printf("H5T_OPAQUE\n"); + indentation (indent+COL); + printf("OPAQUE_TAG \"%s\"\n", H5Tget_tag(type)); + indentation (indent); break; case H5T_COMPOUND: @@ -1119,10 +1124,10 @@ hid_t type, space; printf("DATA{ not yet implemented.}\n"); break; case H5T_OPAQUE: - indent += COL; + /* indent += COL; indentation (indent); - indent -= COL; - printf("DATA{ not yet implemented.}\n"); + indent -= COL;*/ + dump_data(did, DATASET_DATA); break; case H5T_COMPOUND: dump_data(did, DATASET_DATA); 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; } |