From 1e38c1378582208f6f109042c37c8fff858f985d Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Mon, 31 Aug 1998 08:46:47 -0500 Subject: [svn-r633] Changes since 19980828 ---------------------- ./RELEASE Updated with important changes I made since the second beta. ./src/H5A.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5G.c ./src/H5Gprivate.h ./src/H5R.c ./src/H5Rprivate.h ./src/H5T.c ./src/H5Tprivate.h Any API function that used to take an `hid_t loc_id' followed by a `const char *name' can now take any type of object for the loc_id as long as the object is somehow associated with a file. Internally, H5G_loc() was modified to return an H5G_entry_t* instead of an H5G_t* so it's more general. Among other things, this allows one to retrieve information about an object like a named type or dataset without knowing the name of the type or dataset: int get_nlinks (hid_t obj) { H5G_stat_t sb; if (H5Gstat(obj, ".", TRUE, &sb)<0) return -1; return sb.nlink; } ./test/gheap.c ./test/istore.c These files needed a couple of changes because they call some of the internal functions whose H5G_t arguments changed to H5G_entry_t. ./src/H5A.c Got rid of all the switch statements for getting symbol table entries for varous objects and replaced them with a call to H5G_loc() allowing attributes to automatically apply to any type of object that belongs to a file. ./test/Makefile.in Moved the ragged array tests from the normal list of tests to the `make timings' target. ./test/ragged.c Added rewrite tests -- rewrite the rows of a dataset changing the number of rows and the length of each row. ./test/mtime.c Added a test that checks that H5Gstat() can be called with a dataset as the first argument. ./src/H5S.c Added #ifdef HAVE_PARALLEL around code to check for the HDF5_MPI_OPT_TYPES environment variable because the global variable that gets set is #ifdef'd. ./bin/release bzip2 uses .bz2 as the file extension. --- README | 2 +- RELEASE | 18 ++++ bin/release | 2 +- src/.distdep | 306 +++++++++++++++++++++++++++---------------------------- src/H5A.c | 142 +++++++------------------- src/H5D.c | 20 ++-- src/H5Dprivate.h | 4 +- src/H5G.c | 177 +++++++++++++++++++++++--------- src/H5R.c | 76 ++++++++------ src/H5Rprivate.h | 5 +- src/H5S.c | 2 +- src/H5T.c | 10 +- src/H5Tprivate.h | 4 +- test/.distdep | 141 ++++++++++++------------- test/Makefile.in | 4 +- test/gheap.c | 7 +- test/istore.c | 4 +- test/mtime.c | 28 +++-- test/ragged.c | 31 +++--- 19 files changed, 525 insertions(+), 458 deletions(-) diff --git a/README b/README index f76c407..03b9406 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is hdf5-1.0.75 released on Fri Aug 28 09:54:16 CDT 1998 +This is hdf5-1.0.75 released on Fri Aug 28 16:07:31 EDT 1998 Please refer to the INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/RELEASE b/RELEASE index 63b8e9d..99c9662 100644 --- a/RELEASE +++ b/RELEASE @@ -7,6 +7,24 @@ Release information for hdf5-1.0.23a * The compression API has been replaced with a more general filter API. See doc/html/Filters.html for details. +* Alpha-quality 2d ragged arrays, a layer built on top of other hdf5 + objects. The API and storage format will almost certainly change. + +* More debugging support including API tracing. See Debugging.html. + +* C and Fortran style 8-bit fixed-length character string types are + supported with space or null padding or null termination and + translations between them. + +* Added function H5Fflush() to write all cached data immediately to + the file. + +* Datasets maintain a modification time which can be retrieved with + H5Gstat(). + +* The h5ls tool can display much more information, including all the + values of a dataset. + CHANGES SINCE THE FIRST ALPHA * Two of the packages have been renamed. The data space API has been diff --git a/bin/release b/bin/release index 3b975d3..cf4ad9f 100755 --- a/bin/release +++ b/bin/release @@ -121,7 +121,7 @@ for comp in $methods; do gzip -9 <../x.tar >$DEST/hdf5-$VERS.tar.gz;; bzip2) test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <../x.tar >$DEST/hdf5-$VERS.tar.gz;; + bzip2 -9 <../x.tar >$DEST/hdf5-$VERS.tar.bz2;; esac done diff --git a/src/.distdep b/src/.distdep index a260d68..a021579 100644 --- a/src/.distdep +++ b/src/.distdep @@ -768,8 +768,8 @@ H5.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h -H5A.o: \ - H5A.c \ +H5P.o: \ + H5P.c \ H5private.h \ H5public.h \ H5config.h \ @@ -795,25 +795,27 @@ H5A.o: \ H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Pprivate.h \ - H5Ppublic.h \ - H5Apkg.h \ - H5Aprivate.h -H5D.o: \ - H5D.c \ + H5MMprivate.h +H5TB.o: \ + H5TB.c \ H5private.h \ H5public.h \ H5config.h \ H5Iprivate.h \ H5Ipublic.h \ - H5ACprivate.h \ - H5ACpublic.h \ + H5Eprivate.h +H5Fmpio.o: \ + H5Fmpio.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5Dprivate.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ @@ -828,115 +830,125 @@ H5D.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ + H5MMprivate.h \ + H5MMpublic.h +H5O.o: \ + H5O.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Ipublic.h \ + H5Dpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ H5MFprivate.h \ - H5MFpublic.h -H5P.o: \ - H5P.c \ + H5MFpublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h +H5Smpio.o: \ + H5Smpio.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Dprivate.h \ - H5Gprivate.h \ - H5Gpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h -H5S.o: \ - H5S.c \ + H5Tpublic.h +H5Spoint.o: \ + H5Spoint.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ H5Eprivate.h \ H5Epublic.h \ + H5Ipublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h -H5T.o: \ - H5T.c \ + H5HGpublic.h +H5Sselect.o: \ + H5Sselect.c \ H5private.h \ H5public.h \ H5config.h \ - H5Dprivate.h \ - H5Dpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ H5Zprivate.h \ - H5Zpublic.h \ - H5Iprivate.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h -H5TB.o: \ - H5TB.c \ + H5Zpublic.h +H5A.o: \ + H5A.c \ H5private.h \ H5public.h \ H5config.h \ H5Iprivate.h \ H5Ipublic.h \ - H5Eprivate.h -H5F.o: \ - H5F.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Aprivate.h \ - H5Apublic.h \ - H5Ipublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ H5Dprivate.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -947,25 +959,27 @@ H5F.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5Iprivate.h \ - H5ACprivate.h \ - H5ACpublic.h \ H5Eprivate.h \ H5Epublic.h \ H5MMprivate.h \ - H5MMpublic.h -H5Fmpio.o: \ - H5Fmpio.c \ + H5MMpublic.h \ + H5Pprivate.h \ + H5Ppublic.h \ + H5Apkg.h \ + H5Aprivate.h +H5D.o: \ + H5D.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Iprivate.h \ H5Ipublic.h \ - H5Dprivate.h \ - H5Dpublic.h \ + H5ACprivate.h \ + H5ACpublic.h \ H5Fprivate.h \ H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ @@ -980,22 +994,28 @@ H5Fmpio.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5MMprivate.h \ - H5MMpublic.h -H5G.o: \ - H5G.c \ + H5Eprivate.h \ + H5Epublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5MFprivate.h \ + H5MFpublic.h +H5F.o: \ + H5F.c \ H5private.h \ H5public.h \ H5config.h \ + H5Aprivate.h \ + H5Apublic.h \ + H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Ipublic.h \ H5Dpublic.h \ H5Dprivate.h \ - H5Gprivate.h \ - H5Gpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ @@ -1006,43 +1026,46 @@ H5G.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Gpkg.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ H5Iprivate.h \ - H5MMprivate.h -H5O.o: \ - H5O.c \ - H5private.h \ - H5public.h \ - H5config.h \ H5ACprivate.h \ H5ACpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Ipublic.h \ - H5Dpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h \ H5MMprivate.h \ - H5MMpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ + H5MMpublic.h +H5G.o: \ + H5G.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5Aprivate.h \ + H5Apublic.h \ + H5Ipublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Gpkg.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5HLprivate.h \ + H5HLpublic.h H5R.o: \ H5R.c \ H5Rprivate.h \ @@ -1071,77 +1094,54 @@ H5R.o: \ H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h -H5Smpio.o: \ - H5Smpio.c \ +H5T.o: \ + H5T.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ + H5Dprivate.h \ + H5Dpublic.h \ H5Ipublic.h \ - H5Sprivate.h \ - H5Spublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h -H5Spoint.o: \ - H5Spoint.c \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Iprivate.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h +H5S.o: \ + H5S.c \ H5private.h \ H5public.h \ H5config.h \ + H5Iprivate.h \ + H5Ipublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h -H5Sselect.o: \ - H5Sselect.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ - H5Iprivate.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h + H5Tprivate.h diff --git a/src/H5A.c b/src/H5A.c index 5142bae..268258a 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -153,7 +153,6 @@ hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t plist_id) { - void *obj = NULL; H5G_entry_t *ent = NULL; H5T_t *type = NULL; H5S_t *space = NULL; @@ -163,25 +162,13 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5TRACE5("i","isiii",loc_id,name,type_id,space_id,plist_id); /* check arguments */ - if (NULL==(obj=H5I_object (loc_id))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); } - switch (H5I_group (loc_id)) { - case H5_DATASET: - ent = H5D_entof ((H5D_t*)obj); - break; - case H5_DATATYPE: - if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "target data type is not committed"); - } - break; - case H5_GROUP: - ent = H5G_entof ((H5G_t*)obj); - break; - default: - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "inappropriate attribute target"); + if (NULL==(ent=H5G_loc(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); } if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); @@ -235,10 +222,10 @@ static hid_t H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, const H5S_t *space) { - H5A_t *attr = NULL; - H5A_t found_attr; - intn seq=0; - hid_t ret_value = FAIL; + H5A_t *attr = NULL; + H5A_t found_attr; + intn seq=0; + hid_t ret_value = FAIL; FUNC_ENTER(H5A_create, FAIL); @@ -400,7 +387,6 @@ hid_t H5Aopen_name(hid_t loc_id, const char *name) { H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute*/ - void *obj = NULL; intn idx=0; hid_t ret_value = FAIL; @@ -408,25 +394,13 @@ H5Aopen_name(hid_t loc_id, const char *name) H5TRACE2("i","is",loc_id,name); /* check arguments */ - if(NULL == (obj = H5I_object(loc_id))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); } - switch (H5I_group (loc_id)) { - case H5_DATASET: - ent = H5D_entof ((H5D_t*)obj); - break; - case H5_DATATYPE: - if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "target data type is not committed"); - } - break; - case H5_GROUP: - ent = H5G_entof ((H5G_t*)obj); - break; - default: - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "inappropriate attribute target"); + if (NULL==(ent=H5G_loc(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); } if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); @@ -477,32 +451,19 @@ hid_t H5Aopen_idx(hid_t loc_id, unsigned idx) { H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute */ - void *obj = NULL; hid_t ret_value = FAIL; FUNC_ENTER(H5Aopen_idx, FAIL); H5TRACE2("i","iIu",loc_id,idx); /* check arguments */ - if(NULL == (obj = H5I_object(loc_id))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); } - switch (H5I_group (loc_id)) { - case H5_DATASET: - ent = H5D_entof ((H5D_t*)obj); - break; - case H5_DATATYPE: - if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "target data type is not committed"); - } - break; - case H5_GROUP: - ent = H5G_entof ((H5G_t*)obj); - break; - default: - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "inappropriate attribute target"); + if (NULL==(ent=H5G_loc(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); } /* Go do the real work for opening the attribute */ @@ -1109,6 +1070,11 @@ H5Anum_attrs(hid_t loc_id) H5TRACE1("Is","i",loc_id); /* check arguments */ + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); + } if(NULL == (obj = H5I_object(loc_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); } @@ -1187,7 +1153,6 @@ int H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) { H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */ - void *obj = NULL; H5A_t found_attr; intn ret_value = 0; intn idx; @@ -1196,31 +1161,15 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) H5TRACE4("Is","i*Iuxx",loc_id,attr_num,op,op_data); /* check arguments */ - if(NULL == (obj = H5I_object(loc_id))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); - } - switch (H5I_group (loc_id)) { - case H5_DATASET: - ent = H5D_entof ((H5D_t*)obj); - break; - case H5_DATATYPE: - if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "target data type is not committed"); - } - break; - case H5_GROUP: - ent = H5G_entof ((H5G_t*)obj); - break; - default: - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "inappropriate attribute target"); + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); } - if (!op) { - HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid operator"); + if (NULL==(ent=H5G_loc(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); } - /* * Look up the attribute for the object. Make certain the start point is * reasonable. @@ -1276,7 +1225,6 @@ H5Adelete(hid_t loc_id, const char *name) { H5A_t found_attr; H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */ - void *obj = NULL; intn idx=0, found=-1; herr_t ret_value = FAIL; @@ -1284,25 +1232,13 @@ H5Adelete(hid_t loc_id, const char *name) H5TRACE2("e","is",loc_id,name); /* check arguments */ - if(NULL == (obj = H5I_object(loc_id))) { - HRETURN_ERROR(H5E_ARGS, H5E_BADATOM, FAIL, "illegal object atom"); + if (H5_FILE==H5I_group(loc_id) || + H5_ATTR==H5I_group(loc_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "location is not valid for an attribute"); } - switch (H5I_group (loc_id)) { - case H5_DATASET: - ent = H5D_entof ((H5D_t*)obj); - break; - case H5_DATATYPE: - if (NULL==(ent=H5T_entof ((H5T_t*)obj))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "target data type is not committed"); - } - break; - case H5_GROUP: - ent = H5G_entof ((H5G_t*)obj); - break; - default: - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, - "inappropriate attribute target"); + if (NULL==(ent=H5G_loc(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); } if (!name || !*name) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name"); diff --git a/src/H5D.c b/src/H5D.c index c5550d7..4baf7df 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -181,7 +181,7 @@ hid_t H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t plist_id) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; H5T_t *type = NULL; H5S_t *space = NULL; H5D_t *new_dset = NULL; @@ -253,7 +253,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t H5Dopen(hid_t loc_id, const char *name) { - H5G_t *loc = NULL; /*location holding the dataset */ + H5G_entry_t *loc = NULL; /*location holding the dataset */ H5D_t *dataset = NULL; /*the dataset */ hid_t ret_value = FAIL; @@ -813,15 +813,15 @@ H5Dextend(hid_t dset_id, const hsize_t *size) *------------------------------------------------------------------------- */ H5D_t * -H5D_create(H5G_t *loc, const char *name, const H5T_t *type, const H5S_t *space, - const H5D_create_t *create_parms) +H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, + const H5S_t *space, const H5D_create_t *create_parms) { H5D_t *new_dset = NULL; H5D_t *ret_value = NULL; intn i, ndims; hsize_t max_dim[H5O_LAYOUT_NDIMS]; H5O_efl_t *efl = NULL; - H5F_t *f = H5G_fileof (loc); + H5F_t *f = loc->file; FUNC_ENTER(H5D_create, NULL); @@ -1052,15 +1052,12 @@ H5D_create(H5G_t *loc, const char *name, const H5T_t *type, const H5S_t *space, *------------------------------------------------------------------------- */ H5D_t * -H5D_open(H5G_t *loc, const char *name) +H5D_open(H5G_entry_t *loc, const char *name) { H5D_t *dataset = NULL; /*the dataset which was found */ H5D_t *ret_value = NULL; /*return value */ intn i; H5S_t *space = NULL; -#ifdef HAVE_PARALLEL - H5F_t *f = NULL; -#endif FUNC_ENTER(H5D_open, NULL); @@ -1102,9 +1099,8 @@ H5D_open(H5G_t *loc, const char *name) } #ifdef HAVE_PARALLEL - f = H5G_fileof (loc); /* If MPIO is used, no filter support yet. */ - if (f->shared->access_parms->driver == H5F_LOW_MPIO && + if (dataset->ent.file->shared->access_parms->driver == H5F_LOW_MPIO && dataset->create_parms->pline.nfilters>0){ HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel IO does not support filters yet"); @@ -1160,7 +1156,7 @@ H5D_open(H5G_t *loc, const char *name) */ if (dataset->ent.file->shared->access_parms->driver==H5F_LOW_MPIO && dataset->layout.type == H5D_CHUNKED && - (f->intent & H5F_ACC_RDWR)){ + (dataset->ent.file->intent & H5F_ACC_RDWR)){ if (H5D_allocate(dataset)==FAIL){ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "fail in file space allocation dataset"); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 4462e80..245ed58 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -63,9 +63,9 @@ extern const H5D_create_t H5D_create_dflt; extern const H5D_xfer_t H5D_xfer_dflt; /* Functions defined in H5D.c */ -H5D_t *H5D_create (H5G_t *loc, const char *name, const H5T_t *type, +H5D_t *H5D_create (H5G_entry_t *loc, const char *name, const H5T_t *type, const H5S_t *space, const H5D_create_t *create_parms); -H5D_t *H5D_open (H5G_t *loc, const char *name); +H5D_t *H5D_open (H5G_entry_t *loc, const char *name); herr_t H5D_close (H5D_t *dataset); herr_t H5D_read (H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, diff --git a/src/H5G.c b/src/H5G.c index 74af27d..d4f6c91 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -75,6 +75,7 @@ /* Packages needed by this file... */ #include +#include #include #include #include @@ -83,6 +84,7 @@ #include #include #include +#include #define H5G_INIT_HEAP 8192 #define H5G_RESERVED_ATOMS 0 @@ -127,7 +129,7 @@ static void H5G_term_interface(void); hid_t H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; H5G_t *grp = NULL; hid_t ret_value = FAIL; @@ -179,7 +181,7 @@ H5Gopen(hid_t loc_id, const char *name) { hid_t ret_value = FAIL; H5G_t *grp = NULL; - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER(H5Gopen, FAIL); H5TRACE2("i","is",loc_id,name); @@ -278,7 +280,7 @@ herr_t H5Gset(hid_t loc_id, const char *name) { H5G_t *grp = NULL; - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER(H5Gset, FAIL); H5TRACE2("e","is",loc_id,name); @@ -339,7 +341,7 @@ herr_t H5Gpush(hid_t loc_id, const char *name) { H5G_t *grp = NULL; - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER(H5Gpush, FAIL); H5TRACE2("e","is",loc_id,name); @@ -403,7 +405,7 @@ H5Gpush(hid_t loc_id, const char *name) herr_t H5Gpop(hid_t loc_id) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER(H5Gpop, FAIL); H5TRACE1("e","i",loc_id); @@ -414,7 +416,7 @@ H5Gpop(hid_t loc_id) } /* pop */ - if (H5G_pop(H5G_fileof (loc))<0) { + if (H5G_pop(loc->file)<0) { HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "stack is empty"); } FUNC_LEAVE(SUCCEED); @@ -455,7 +457,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx, int _idx = 0; H5G_bt_ud2_t udata; herr_t ret_value = FAIL; - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER (H5Giterate, FAIL); H5TRACE5("e","is*Isxx",loc_id,name,idx,op,op_data); @@ -566,7 +568,7 @@ herr_t H5Glink(hid_t loc_id, H5G_link_t type, const char *cur_name, const char *new_name) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER (H5Glink, FAIL); H5TRACE4("e","iGlss",loc_id,type,cur_name,new_name); @@ -651,7 +653,7 @@ herr_t H5Gstat(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER (H5Gstat, FAIL); H5TRACE4("e","isbx",loc_id,name,follow_link,statbuf); @@ -694,7 +696,7 @@ H5Gstat(hid_t loc_id, const char *name, hbool_t follow_link, herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER (H5Gget_linkval, FAIL); H5TRACE4("e","iszx",loc_id,name,size,buf); @@ -739,7 +741,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; FUNC_ENTER(H5Gset_comment, FAIL); H5TRACE3("e","iss",loc_id,name,comment); @@ -786,7 +788,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; intn retval = FAIL; FUNC_ENTER(H5Gget_comment, FAIL); @@ -1229,7 +1231,7 @@ H5G_mkroot (H5F_t *f, H5G_entry_t *ent) *------------------------------------------------------------------------- */ H5G_t * -H5G_create(H5G_t *loc, const char *name, size_t size_hint) +H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint) { const char *rest = NULL; /*the base name */ H5G_entry_t grp_ent; /*group containing new group */ @@ -1244,8 +1246,7 @@ H5G_create(H5G_t *loc, const char *name, size_t size_hint) assert(name && *name); /* lookup name */ - if (0 == H5G_namei(H5G_entof(loc), name, &rest, &grp_ent, NULL, - TRUE, NULL)) { + if (0 == H5G_namei(loc, name, &rest, &grp_ent, NULL, TRUE, NULL)) { HRETURN_ERROR(H5E_SYM, H5E_EXISTS, NULL, "already exists"); } H5E_clear(); /*it's OK that we didn't find it */ @@ -1308,7 +1309,7 @@ H5G_create(H5G_t *loc, const char *name, size_t size_hint) *------------------------------------------------------------------------- */ H5G_t * -H5G_open(H5G_t *loc, const char *name) +H5G_open(H5G_entry_t *loc, const char *name) { H5G_t *grp = NULL; H5G_t *ret_value = NULL; @@ -1621,7 +1622,7 @@ H5G_pop (H5F_t *f) *------------------------------------------------------------------------- */ herr_t -H5G_insert(H5G_t *loc, const char *name, H5G_entry_t *ent) +H5G_insert(H5G_entry_t *loc, const char *name, H5G_entry_t *ent) { const char *rest = NULL; /*part of name not existing yet */ H5G_entry_t grp; /*entry for group to contain obj */ @@ -1638,7 +1639,7 @@ H5G_insert(H5G_t *loc, const char *name, H5G_entry_t *ent) /* * Look up the name -- it shouldn't exist yet. */ - if (H5G_namei(H5G_entof(loc), name, &rest, &grp, NULL, TRUE, NULL) >= 0) { + if (H5G_namei(loc, name, &rest, &grp, NULL, TRUE, NULL) >= 0) { HRETURN_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "already exists"); } H5E_clear(); /*it's OK that we didn't find it */ @@ -1702,7 +1703,7 @@ H5G_insert(H5G_t *loc, const char *name, H5G_entry_t *ent) *------------------------------------------------------------------------- */ herr_t -H5G_find(H5G_t *loc, const char *name, +H5G_find(H5G_entry_t *loc, const char *name, H5G_entry_t *grp_ent/*out*/, H5G_entry_t *obj_ent/*out*/) { FUNC_ENTER(H5G_find, FAIL); @@ -1711,8 +1712,7 @@ H5G_find(H5G_t *loc, const char *name, assert (loc); assert (name && *name); - if (H5G_namei(H5G_entof(loc), name, NULL, grp_ent, obj_ent, - TRUE, NULL)<0) { + if (H5G_namei(loc, name, NULL, grp_ent, obj_ent, TRUE, NULL)<0) { HRETURN_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found"); } FUNC_LEAVE(SUCCEED); @@ -1769,8 +1769,8 @@ H5G_fileof (H5G_t *grp) /*------------------------------------------------------------------------- * Function: H5G_loc * - * Purpose: Given a location ID return a group. The group should not be - * closed. + * Purpose: Given an object ID return a symbol table entry for the + * object. * * Return: Success: Group pointer. * @@ -1783,28 +1783,112 @@ H5G_fileof (H5G_t *grp) * *------------------------------------------------------------------------- */ -H5G_t * +H5G_entry_t * H5G_loc (hid_t loc_id) { H5F_t *f; - H5G_t *ret_value = NULL; + H5G_entry_t *ret_value = NULL; + H5G_t *group=NULL; + H5T_t *dt=NULL; + H5D_t *dset=NULL; + H5A_t *attr=NULL; + H5R_t *ra=NULL; FUNC_ENTER (H5G_loc, NULL); - - if (H5_FILE==H5I_group (loc_id)) { + + switch (H5I_group(loc_id)) { + case H5_FILE: if (NULL==(f=H5I_object (loc_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "invalid file ID"); } - if (NULL==(ret_value=H5G_getcwg (f))) { + if (NULL==(group=H5G_getcwg (f))) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, - "unable to get current working directory"); + "unable to get current working group"); + } + if (NULL==(ret_value=H5G_entof(group))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of c.w.g."); } - } else if (H5_GROUP==H5I_group (loc_id)) { - if (NULL==(ret_value=H5I_object (loc_id))) { + break; + + case H5_TEMPLATE_0: + case H5_TEMPLATE_1: + case H5_TEMPLATE_2: + case H5_TEMPLATE_3: + case H5_TEMPLATE_4: + case H5_TEMPLATE_5: + case H5_TEMPLATE_6: + case H5_TEMPLATE_7: +#ifndef NDEBUG + case H5_TEMPLATE_MAX: +#endif + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of property list"); + break; + + case H5_GROUP: + if (NULL==(group=H5I_object (loc_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "invalid group ID"); } - } else { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, NULL, "not a location"); + if (NULL==(ret_value=H5G_entof(group))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of group"); + } + break; + + case H5_DATATYPE: + if (NULL==(dt=H5I_object(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid type ID"); + } + if (NULL==(ret_value=H5T_entof(dt))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of data type"); + } + break; + + case H5_DATASPACE: + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of data space"); + + case H5_DATASET: + if (NULL==(dset=H5I_object(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid data ID"); + } + if (NULL==(ret_value=H5D_entof(dset))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of dataset"); + } + break; + + case H5_ATTR: + if (NULL==(attr=H5I_object(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "invalid attribute ID"); + } + if (NULL==(ret_value=H5A_entof(attr))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of attribute"); + } + break; + + case H5_TEMPBUF: + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of buffer"); + + case H5_RAGGED: + if (NULL==(ra=H5I_object(loc_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "invalid ragged array ID"); + } + if (NULL==(ret_value=H5R_entof(ra))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, + "unable to get symbol table entry of ragged array"); + } + break; + + case MAXGROUP: + case BADGROUP: + HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid object ID"); } FUNC_LEAVE (ret_value); @@ -1829,7 +1913,7 @@ H5G_loc (hid_t loc_id) *------------------------------------------------------------------------- */ herr_t -H5G_link (H5G_t *loc, H5G_link_t type, const char *cur_name, +H5G_link (H5G_entry_t *loc, H5G_link_t type, const char *cur_name, const char *new_name) { H5G_entry_t cur_obj; /*entry for the link tail */ @@ -1853,8 +1937,7 @@ H5G_link (H5G_t *loc, H5G_link_t type, const char *cur_name, * Lookup the the new_name so we can get the group which will contain * the new entry. The entry shouldn't exist yet. */ - if (H5G_namei (H5G_entof(loc), new_name, &rest, &grp_ent, NULL, - TRUE, NULL)>=0) { + if (H5G_namei (loc, new_name, &rest, &grp_ent, NULL, TRUE, NULL)>=0) { HRETURN_ERROR (H5E_SYM, H5E_EXISTS, FAIL, "already exists"); } H5E_clear (); /*it's okay that we didn't find it*/ @@ -1956,7 +2039,7 @@ H5G_link (H5G_t *loc, H5G_link_t type, const char *cur_name, *------------------------------------------------------------------------- */ herr_t -H5G_stat (H5G_t *loc, const char *name, hbool_t follow_link, +H5G_stat (H5G_entry_t *loc, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { H5O_stab_t stab_mesg; @@ -1973,8 +2056,8 @@ H5G_stat (H5G_t *loc, const char *name, hbool_t follow_link, if (statbuf) HDmemset (statbuf, 0, sizeof *statbuf); /* Find the object's symbol table entry */ - if (H5G_namei (H5G_entof(loc), name, NULL, &grp_ent/*out*/, - &obj_ent/*out*/, follow_link, NULL)<0) { + if (H5G_namei (loc, name, NULL, &grp_ent/*out*/, &obj_ent/*out*/, + follow_link, NULL)<0) { HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to stat object"); } @@ -2058,7 +2141,7 @@ H5G_stat (H5G_t *loc, const char *name, hbool_t follow_link, *------------------------------------------------------------------------- */ herr_t -H5G_linkval (H5G_t *loc, const char *name, size_t size, char *buf/*out*/) +H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/) { const char *s = NULL; H5G_entry_t grp_ent, obj_ent; @@ -2070,8 +2153,8 @@ H5G_linkval (H5G_t *loc, const char *name, size_t size, char *buf/*out*/) * Get the symbol table entry for the link head and the symbol table * entry for the group in which the link head appears. */ - if (H5G_namei (H5G_entof(loc), name, NULL, &grp_ent/*out*/, - &obj_ent/*out*/, FALSE, NULL)<0) { + if (H5G_namei (loc, name, NULL, &grp_ent/*out*/, &obj_ent/*out*/, FALSE, + NULL)<0) { HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "symbolic link was not found"); } @@ -2120,7 +2203,7 @@ H5G_linkval (H5G_t *loc, const char *name, size_t size, char *buf/*out*/) *------------------------------------------------------------------------- */ herr_t -H5G_set_comment(H5G_t *loc, const char *name, const char *buf) +H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf) { H5G_entry_t obj_ent; H5O_name_t comment; @@ -2128,8 +2211,7 @@ H5G_set_comment(H5G_t *loc, const char *name, const char *buf) FUNC_ENTER(H5G_set_comment, FAIL); /* Get the symbol table entry for the object */ - if (H5G_namei(H5G_entof(loc), name, NULL, NULL, &obj_ent/*out*/, - TRUE, NULL)<0) { + if (H5G_namei(loc, name, NULL, NULL, &obj_ent/*out*/, TRUE, NULL)<0) { HRETURN_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found"); } @@ -2169,7 +2251,7 @@ H5G_set_comment(H5G_t *loc, const char *name, const char *buf) *------------------------------------------------------------------------- */ intn -H5G_get_comment(H5G_t *loc, const char *name, size_t bufsize, char *buf) +H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf) { H5O_name_t comment; H5G_entry_t obj_ent; @@ -2178,8 +2260,7 @@ H5G_get_comment(H5G_t *loc, const char *name, size_t bufsize, char *buf) FUNC_ENTER(H5G_get_comment, FAIL); /* Get the symbol table entry for the object */ - if (H5G_namei(H5G_entof(loc), name, NULL, NULL, &obj_ent/*out*/, - TRUE, NULL)<0) { + if (H5G_namei(loc, name, NULL, NULL, &obj_ent/*out*/, TRUE, NULL)<0) { HRETURN_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found"); } diff --git a/src/H5R.c b/src/H5R.c index 9d31119..8960259 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -40,6 +40,7 @@ typedef struct H5R_meta_t { } H5R_meta_t; struct H5R_t { + H5G_t *group; /*the group containing everything */ H5D_t *meta; /*ragged meta data array */ H5D_t *raw; /*fixed-width raw data */ H5D_t *over; /*overflow data */ @@ -160,7 +161,7 @@ hid_t H5Rcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t plist_id) { H5R_t *ra=NULL; - H5G_t *loc=NULL; + H5G_entry_t *loc=NULL; H5T_t *type=NULL; const H5D_create_t *plist=NULL; hid_t ret_value=FAIL; @@ -229,10 +230,10 @@ H5Rcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t plist_id) *------------------------------------------------------------------------- */ H5R_t * -H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) +H5R_create(H5G_entry_t *loc, const char *name, H5T_t *type, + const H5D_create_t *dcpl) { H5R_t *ra = NULL; - H5G_t *grp = NULL; H5S_t *space = NULL; hsize_t cur_dims[2]; hsize_t max_dims[2]; @@ -255,7 +256,7 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) } /* Create the group to contain the arrays */ - if (NULL==(grp=H5G_create(loc, name, 0))) { + if (NULL==(ra->group=H5G_create(loc, name, 0))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, "unable to create container group"); } @@ -269,7 +270,8 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, "unable to define raw dataset extents"); } - if (NULL==(ra->raw=H5D_create(grp, "raw", type, space, dcpl))) { + if (NULL==(ra->raw=H5D_create(H5G_entof(ra->group), "raw", type, space, + dcpl))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, "unable to create raw dataset"); } @@ -291,7 +293,8 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) d1_dcpl = *dcpl; d1_dcpl.chunk_ndims = 1; d1_dcpl.chunk_size[0] = dcpl->chunk_size[0]*dcpl->chunk_size[1]; - if (NULL==(ra->over=H5D_create(grp, "over", type, space, &d1_dcpl))) { + if (NULL==(ra->over=H5D_create(H5G_entof(ra->group), "over", type, space, + &d1_dcpl))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, "unable to create overflow dataset"); } @@ -314,8 +317,8 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) (dcpl->chunk_size[0]*dcpl->chunk_size[1]* H5T_get_size(type))/ H5T_get_size(H5R_meta_type_g)); - if (NULL==(ra->meta=H5D_create(grp, "meta", H5R_meta_type_g, space, - &d1_dcpl))) { + if (NULL==(ra->meta=H5D_create(H5G_entof(ra->group), "meta", + H5R_meta_type_g, space, &d1_dcpl))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, "unable to create meta dataset"); } @@ -326,20 +329,13 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) } space = NULL; - /* Close the group -- we no longer need it */ - if (H5G_close(grp)<0) { - grp = NULL; - HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, - "unable to close ragged array group"); - } - grp = NULL; ret_value = ra; done: if (!ret_value) { - if (grp) H5G_close(grp); if (space) H5S_close(space); if (ra) { + if (ra->group) H5G_close(ra->group); if (ra->raw) H5D_close(ra->raw); if (ra->over) H5D_close(ra->over); if (ra->meta) H5D_close(ra->meta); @@ -371,7 +367,7 @@ H5R_create(H5G_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl) hid_t H5Ropen(hid_t loc_id, const char *name) { - H5G_t *loc=NULL; + H5G_entry_t *loc=NULL; H5R_t *ra=NULL; hid_t ret_value=FAIL; @@ -421,11 +417,10 @@ H5Ropen(hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ H5R_t * -H5R_open(H5G_t *loc, const char *name) +H5R_open(H5G_entry_t *loc, const char *name) { H5R_t *ra = NULL; H5R_t *ret_value = NULL; - H5G_t *grp=NULL; FUNC_ENTER(H5R_open, NULL); @@ -440,32 +435,25 @@ H5R_open(H5G_t *loc, const char *name) } /* Open the containing group */ - if (NULL==(grp=H5G_open(loc, name))) { + if (NULL==(ra->group=H5G_open(loc, name))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTOPENOBJ, NULL, "unable to open container group"); } /* Open the datasets */ - if (NULL==(ra->raw=H5D_open(grp, "raw")) || - NULL==(ra->over=H5D_open(grp, "over")) || - NULL==(ra->meta=H5D_open(grp, "meta"))) { + if (NULL==(ra->raw=H5D_open(H5G_entof(ra->group), "raw")) || + NULL==(ra->over=H5D_open(H5G_entof(ra->group), "over")) || + NULL==(ra->meta=H5D_open(H5G_entof(ra->group), "meta"))) { HGOTO_ERROR(H5E_RAGGED, H5E_CANTOPENOBJ, NULL, "unable to open one or more component datasets"); } - /* Close group */ - if (H5G_close(grp)<0) { - grp = NULL; - HGOTO_ERROR(H5E_RAGGED, H5E_CANTINIT, NULL, - "unable to close container group"); - } - grp = NULL; ret_value = ra; done: if (!ret_value) { - if (grp) H5G_close(grp); if (ra) { + if (ra->group) H5G_close(ra->group); if (ra->raw) H5D_close(ra->raw); if (ra->over) H5D_close(ra->over); if (ra->meta) H5D_close(ra->meta); @@ -540,7 +528,8 @@ H5R_close(H5R_t *ra) FUNC_ENTER(H5R_close, FAIL); assert(ra); - if ((ra->raw && H5D_close(ra->raw)<0) || + if ((ra->group && H5G_close(ra->group)<0) || + (ra->raw && H5D_close(ra->raw)<0) || (ra->over && H5D_close(ra->over)<0) || (ra->meta && H5D_close(ra->meta)<0)) { HRETURN_ERROR(H5E_RAGGED, H5E_CANTINIT, FAIL, @@ -1175,3 +1164,26 @@ H5R_read(H5R_t *ra, hssize_t start_row, hsize_t nrows, H5T_t *type, FUNC_LEAVE(ret_value); } + +/*------------------------------------------------------------------------- + * Function: H5R_entof + * + * Purpose: Return a pointer to the ragged arrays symbol table entry. + * + * Return: Success: Ptr to symbol table entry + * + * Failure: NULL + * + * Programmer: Robb Matzke + * Friday, August 28, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +H5G_entry_t * +H5R_entof(H5R_t *ra) +{ + assert(ra); + return H5G_entof(ra->group); +} diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index c4b8471..39c7135 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -16,12 +16,13 @@ typedef struct H5R_t H5R_t; herr_t H5R_close(H5R_t *ra); -H5R_t *H5R_create(H5G_t *loc, const char *name, H5T_t *type, +H5R_t *H5R_create(H5G_entry_t *loc, const char *name, H5T_t *type, const H5D_create_t *dcpl); -H5R_t *H5R_open(H5G_t *loc, const char *name); +H5R_t *H5R_open(H5G_entry_t *loc, const char *name); herr_t H5R_write(H5R_t *ra, hssize_t start_row, hsize_t nrows, H5T_t *type, hsize_t size[], void *buf[]); herr_t H5R_read(H5R_t *ra, hssize_t start_row, hsize_t nrows, H5T_t *type, hsize_t size[], void *buf[]); +H5G_entry_t *H5R_entof(H5R_t *ra); #endif diff --git a/src/H5S.c b/src/H5S.c index b8878cd..cd387d9 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -77,7 +77,7 @@ H5S_init_interface(void) HRETURN_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to register one or more conversion functions"); } - + #ifdef HAVE_PARALLEL { /* Allow MPI buf-and-file-type optimizations? */ diff --git a/src/H5T.c b/src/H5T.c index 86e73a0..c0c7618 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -893,7 +893,7 @@ H5Tcreate(H5T_class_t type, size_t size) hid_t H5Topen(hid_t loc_id, const char *name) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; H5T_t *type = NULL; hid_t ret_value = FAIL; @@ -945,7 +945,7 @@ H5Topen(hid_t loc_id, const char *name) herr_t H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) { - H5G_t *loc = NULL; + H5G_entry_t *loc = NULL; H5T_t *type = NULL; FUNC_ENTER (H5Tcommit, FAIL); @@ -3505,7 +3505,7 @@ H5T_create(H5T_class_t type, size_t size) *------------------------------------------------------------------------- */ H5T_t * -H5T_open (H5G_t *loc, const char *name) +H5T_open (H5G_entry_t *loc, const char *name) { H5T_t *dt = NULL; H5G_entry_t ent; @@ -3668,7 +3668,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) *------------------------------------------------------------------------- */ herr_t -H5T_commit (H5G_t *loc, const char *name, H5T_t *type) +H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type) { herr_t ret_value = FAIL; @@ -3695,7 +3695,7 @@ H5T_commit (H5G_t *loc, const char *name, H5T_t *type) * Create the object header and open it for write access. Insert the data * type message and then give the object header a name. */ - if (H5O_create (H5G_fileof (loc), 64, &(type->ent))<0) { + if (H5O_create (loc->file, 64, &(type->ent))<0) { HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create data type object header"); } diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index a686b59..7d22895 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -44,10 +44,10 @@ typedef enum H5T_copy_t { /* Private functions */ herr_t H5T_init (void); herr_t H5T_init_interface (void); -H5T_t *H5T_open (H5G_t *loc, const char *name); +H5T_t *H5T_open (H5G_entry_t *loc, const char *name); H5T_t *H5T_create (H5T_class_t type, size_t size); H5T_t *H5T_copy (const H5T_t *old_dt, H5T_copy_t method); -herr_t H5T_commit (H5G_t *loc, const char *name, H5T_t *type); +herr_t H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type); herr_t H5T_lock (H5T_t *dt, hbool_t immutable); herr_t H5T_close (H5T_t *dt); size_t H5T_get_size (const H5T_t *dt); diff --git a/test/.distdep b/test/.distdep index 217d2b7..b5d511d 100644 --- a/test/.distdep +++ b/test/.distdep @@ -178,34 +178,6 @@ th5s.o: \ ../src/H5Tpublic.h \ ../src/H5Zprivate.h \ ../src/H5Zpublic.h -istore.o: \ - istore.c \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Iprivate.h \ - ../src/H5Ipublic.h \ - ../src/H5Pprivate.h \ - ../src/H5Ppublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Zpublic.h \ - ../src/H5Fprivate.h \ - ../src/H5Gprivate.h \ - ../src/H5Gpublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5MMprivate.h \ - ../src/H5MMpublic.h \ - ../src/H5Oprivate.h \ - ../src/H5Opublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ - ../src/H5Tprivate.h \ - ../src/H5Tpublic.h \ - ../src/H5Sprivate.h \ - ../src/H5Spublic.h \ - ../src/H5Zprivate.h external.o: \ external.c \ ../src/hdf5.h \ @@ -228,25 +200,6 @@ external.o: \ ../src/H5Zpublic.h \ ../src/H5Spublic.h \ ../src/H5Tpublic.h -gheap.o: \ - gheap.c \ - ../src/H5private.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Eprivate.h \ - ../src/H5Epublic.h \ - ../src/H5Ipublic.h \ - ../src/H5Fprivate.h \ - ../src/H5Fpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Gprivate.h \ - ../src/H5Gpublic.h \ - ../src/H5Bprivate.h \ - ../src/H5Bpublic.h \ - ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ - ../src/H5Pprivate.h \ - ../src/H5Ppublic.h shtype.o: \ shtype.c \ ../src/hdf5.h \ @@ -363,29 +316,6 @@ extend.o: \ ../src/H5Ppublic.h \ ../src/H5Zpublic.h \ ../src/H5Spublic.h -mtime.o: \ - mtime.c \ - ../src/hdf5.h \ - ../src/H5public.h \ - ../src/H5config.h \ - ../src/H5Ipublic.h \ - ../src/H5Apublic.h \ - ../src/H5ACpublic.h \ - ../src/H5Bpublic.h \ - ../src/H5Dpublic.h \ - ../src/H5Epublic.h \ - ../src/H5Fpublic.h \ - ../src/H5Gpublic.h \ - ../src/H5HGpublic.h \ - ../src/H5HLpublic.h \ - ../src/H5MFpublic.h \ - ../src/H5MMpublic.h \ - ../src/H5Opublic.h \ - ../src/H5Ppublic.h \ - ../src/H5Zpublic.h \ - ../src/H5Spublic.h \ - ../src/H5Tpublic.h \ - ../src/H5private.h links.o: \ links.c \ ../src/hdf5.h \ @@ -496,6 +426,77 @@ bittests.o: \ ../src/H5Tpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h +istore.o: \ + istore.c \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Iprivate.h \ + ../src/H5Ipublic.h \ + ../src/H5Pprivate.h \ + ../src/H5Ppublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Fprivate.h \ + ../src/H5Gprivate.h \ + ../src/H5Gpublic.h \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ + ../src/H5MMprivate.h \ + ../src/H5MMpublic.h \ + ../src/H5Oprivate.h \ + ../src/H5Opublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ + ../src/H5Tprivate.h \ + ../src/H5Tpublic.h \ + ../src/H5Sprivate.h \ + ../src/H5Spublic.h \ + ../src/H5Zprivate.h +gheap.o: \ + gheap.c \ + ../src/H5private.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Eprivate.h \ + ../src/H5Epublic.h \ + ../src/H5Ipublic.h \ + ../src/H5Fprivate.h \ + ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Gprivate.h \ + ../src/H5Gpublic.h \ + ../src/H5Bprivate.h \ + ../src/H5Bpublic.h \ + ../src/H5HGprivate.h \ + ../src/H5HGpublic.h \ + ../src/H5Pprivate.h \ + ../src/H5Ppublic.h +mtime.o: \ + mtime.c \ + ../src/hdf5.h \ + ../src/H5public.h \ + ../src/H5config.h \ + ../src/H5Ipublic.h \ + ../src/H5Apublic.h \ + ../src/H5ACpublic.h \ + ../src/H5Bpublic.h \ + ../src/H5Dpublic.h \ + ../src/H5Epublic.h \ + ../src/H5Fpublic.h \ + ../src/H5Gpublic.h \ + ../src/H5HGpublic.h \ + ../src/H5HLpublic.h \ + ../src/H5MFpublic.h \ + ../src/H5MMpublic.h \ + ../src/H5Opublic.h \ + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Rpublic.h \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h \ + ../src/H5private.h ragged.o: \ ragged.c \ ../src/hdf5.h \ diff --git a/test/Makefile.in b/test/Makefile.in index f4024b5..3fb99cd 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -12,8 +12,8 @@ CPPFLAGS=-I. -I../src @CPPFLAGS@ # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. TESTS=testhdf5 gheap hyperslab istore bittests dtypes dsets cmpd_dset extend \ - external shtype links big mtime ragged -TIMINGS=iopipe chunk + external shtype links big mtime +TIMINGS=iopipe chunk ragged # Temporary files MOSTLYCLEAN=cmpd_dset.h5 dataset.h5 extend.h5 istore.h5 tfile1.h5 tfile2.h5 \ diff --git a/test/gheap.c b/test/gheap.c index d6c6768..d4d4633 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -40,7 +40,7 @@ * Function: emit_diagnostics * * Purpose: If debugging is turned on then this function will cause the - * library to emit it's diagnostic messages now instead of when + * library to emit its diagnostic messages now instead of when * we're trying to make the output look nice. * * Return: void @@ -55,9 +55,10 @@ static void emit_diagnostics (void) { - H5F_t *f = H5F_open (TEST_FILE_NAME0, H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC, + H5F_t *f = H5F_open (TEST_FILE_NAME0, + H5F_ACC_CREAT|H5F_ACC_RDWR|H5F_ACC_TRUNC, NULL, NULL); - H5G_t *g = H5G_create (f->shared->root_grp, "emit", 0); + H5G_t *g = H5G_create (H5G_entof(f->shared->root_grp), "emit", 0); H5G_close (g); H5F_close (f); } diff --git a/test/istore.c b/test/istore.c index 24c5cd7..5af8075 100644 --- a/test/istore.c +++ b/test/istore.c @@ -134,7 +134,7 @@ new_object(H5F_t *f, const char *name, intn ndims, H5G_entry_t *ent/*out*/) return -1; } /* Give the object header a name */ - if (H5G_insert(H5G_getcwg(f), name, ent) < 0) { + if (H5G_insert(H5G_entof(H5G_getcwg(f)), name, ent) < 0) { printf("*FAILED*\n"); if (!isatty(1)) { AT(); @@ -638,7 +638,7 @@ main(int argc, char *argv[]) * By creating a group we cause the library to emit it's debugging * diagnostic messages before we begin testing... */ - dir = H5G_create(H5G_getcwg(f), "flushing_diagnostics", 0); + dir = H5G_create(H5G_entof(H5G_getcwg(f)), "flushing_diagnostics", 0); H5G_close(dir); dir = NULL; diff --git a/test/mtime.c b/test/mtime.c index 6f5327a..91d7400 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -101,7 +101,7 @@ main(void) hsize_t size[1] = {2}; time_t now; struct tm *tm; - H5G_stat_t sb; + H5G_stat_t sb1, sb2; char buf1[32], buf2[32]; H5Eset_auto(display_error_cb, NULL); @@ -118,21 +118,37 @@ main(void) if (H5Sclose(space)<0) return 1; if (H5Fclose(file)<0) return 1; - /* Open the file and get the modification time */ + /* + * Open the file and get the modification time. We'll test the new + * H5Gstat() arguments too: being able to stat something without knowing + * its name. + */ if ((file = H5Fopen(FILE_NAME_1, H5F_ACC_RDONLY, H5P_DEFAULT))<0) return 1; - if (H5Gstat(file, "dset", TRUE, &sb)<0) return 1; + if (H5Gstat(file, "dset", TRUE, &sb1)<0) return 1; + if ((dset=H5Dopen(file, "dset"))<0) return 1; + if (H5Gstat(dset, ".", TRUE, &sb2)<0) return 1; + if (H5Dclose(dset)<0) return 1; if (H5Fclose(file)<0) return 1; + /* Compare times from the two ways of calling H5Gstat() */ + if (sb1.objno[0]!=sb2.objno[0] || sb1.objno[1]!=sb2.objno[1] || + sb1.mtime!=sb2.mtime) { + puts("*FAILED*"); + puts(" Calling H5Gstat() with the dataset ID returned different"); + puts(" values than calling it with a file and dataset name."); + return 1; + } + /* Compare times -- they must be within 60 seconds of one another */ - if (0==sb.mtime) { + if (0==sb1.mtime) { puts("--SKIP--"); puts(" The modification time could not be decoded on this OS."); puts(" Modification times will be mantained in the file bug cannot"); puts(" be queried on this system. See H5O_mtime_decode()."); return 1; - } else if (fabs(HDdifftime(now, sb.mtime))>60.0) { + } else if (fabs(HDdifftime(now, sb1.mtime))>60.0) { puts("*FAILED*"); - tm = localtime(&(sb.mtime)); + tm = localtime(&(sb1.mtime)); strftime(buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); tm = localtime(&now); strftime(buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm); diff --git a/test/ragged.c b/test/ragged.c index f5ba2f4..1e2d6ea 100644 --- a/test/ragged.c +++ b/test/ragged.c @@ -138,7 +138,7 @@ rand_nelmts(int reset_counters) { double p = (rand() % 1000000)/1000000.0; double total = 0.0; - size_t size, i; + size_t size=0, i; static size_t ncalls=0; if (reset_counters) { @@ -174,9 +174,9 @@ rand_nelmts(int reset_counters) /*------------------------------------------------------------------------- - * Function: ragged_append + * Function: ragged_write_all * - * Purpose: Writes rows to the end of ragged array RA. + * Purpose: Writes rows to the ragged array RA. * * Return: Success: 0 * @@ -190,7 +190,7 @@ rand_nelmts(int reset_counters) *------------------------------------------------------------------------- */ static int -ragged_append(hid_t ra, hsize_t rows_at_once) +ragged_write_all(hid_t ra, hsize_t rows_at_once) { int *dd, total_nelmts=0; hssize_t row; /*current row number */ @@ -203,7 +203,7 @@ ragged_append(hid_t ra, hsize_t rows_at_once) char s[64]; /*tempory string buffer */ char testname[80]; - sprintf(testname, "Testing append, units of %lu", + sprintf(testname, "Testing write all, units of %lu", (unsigned long)rows_at_once); printf("%s...\n", testname); fflush(stdout); @@ -276,7 +276,7 @@ ragged_append(hid_t ra, hsize_t rows_at_once) /*------------------------------------------------------------------------- - * Function: ragged_readall + * Function: ragged_read_all * * Purpose: Reads all rows of a ragged array in row order a few rows at a * time. @@ -293,7 +293,7 @@ ragged_append(hid_t ra, hsize_t rows_at_once) *------------------------------------------------------------------------- */ static int -ragged_readall(hid_t ra, hsize_t rows_at_once) +ragged_read_all(hid_t ra, hsize_t rows_at_once) { int total_nelmts=0; hsize_t i, j; /*counters */ @@ -403,7 +403,7 @@ ragged_readall(hid_t ra, hsize_t rows_at_once) /*------------------------------------------------------------------------- - * Function: ragged_readshort + * Function: ragged_read_short * * Purpose: Reads all the data but only the part that is in the `raw' * dataset. We should see a nice speed increase because we @@ -422,7 +422,7 @@ ragged_readall(hid_t ra, hsize_t rows_at_once) *------------------------------------------------------------------------- */ static int -ragged_readshort(hid_t ra, hsize_t rows_at_once, hsize_t width) +ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width) { int total_nelmts=0; hsize_t i, j; @@ -545,7 +545,7 @@ ragged_readshort(hid_t ra, hsize_t rows_at_once, hsize_t width) printf("%-70s*FAILED*\n\n", testname); return -1; } - + /*------------------------------------------------------------------------- * Function: main @@ -600,9 +600,14 @@ main(int argc, char *argv[]) if (H5Pclose(dcpl)<0) goto error; /* The tests */ - if (ragged_append(ra, rows_at_once)<0) goto error; - if (ragged_readall(ra, rows_at_once)<0) goto error; - if (ragged_readshort(ra, rows_at_once, ch_size[1])<0) goto error; + if (ragged_write_all(ra, rows_at_once)<0) goto error; + if (ragged_read_all(ra, rows_at_once)<0) goto error; + if (ragged_read_short(ra, rows_at_once, ch_size[1])<0) goto error; + + /* The tests again */ + if (ragged_write_all(ra, rows_at_once)<0) goto error; + if (ragged_read_all(ra, rows_at_once)<0) goto error; + if (ragged_read_short(ra, rows_at_once, ch_size[1])<0) goto error; /* Conclusions */ printf("\n\nDistribution of row lengths:\n"); -- cgit v0.12