summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Fprivate.h24
-rw-r--r--src/H5Gdeprec.c8
-rw-r--r--src/H5Gloc.c86
-rw-r--r--src/H5Gname.c6
-rw-r--r--src/H5Gnode.c7
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5L.c26
-rw-r--r--src/H5Lprivate.h2
-rw-r--r--src/H5Oint.c59
-rw-r--r--src/H5Opkg.h2
-rw-r--r--src/H5Oprivate.h1
-rw-r--r--src/H5Opublic.h2
-rw-r--r--src/H5R.c23
-rw-r--r--src/H5Rdeprec.c10
-rw-r--r--src/H5Rint.c20
-rw-r--r--src/H5Rprivate.h1
-rw-r--r--src/H5Rpublic.h4
-rw-r--r--src/H5VLconnector.h9
-rw-r--r--src/H5VLnative.h17
-rw-r--r--src/H5VLnative_link.c1
-rw-r--r--src/H5VLpublic.h25
-rw-r--r--src/H5system.c4
-rw-r--r--src/H5vers.txt2
23 files changed, 191 insertions, 150 deletions
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 4008eb8..75ef0a9 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -247,29 +247,29 @@ typedef struct H5F_t H5F_t;
}
/* Address-related macros */
-#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
- HADDR_UNDEF==(X)+(haddr_t)(Z) || \
+#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
+ HADDR_UNDEF==(X)+(haddr_t)(Z) || \
(X)+(haddr_t)(Z)<(X))
#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
/* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
* certain that X is not HADDR_UNDEF and then checking that X equals Y
*/
-#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
+#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \
(X)==(Y))
#define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y)))
-#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
+#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
(X)<(Y))
-#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
+#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
(X)<=(Y))
-#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
+#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
(X)>(Y))
-#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
- (Y)!=HADDR_UNDEF && \
+#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \
+ (Y)!=HADDR_UNDEF && \
(X)>=(Y))
-#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
+#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \
(H5F_addr_lt((X), (Y)) ? -1 : 1))
#define H5F_addr_pow2(N) ((haddr_t)1<<(N))
#define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index c321e97..5f16f67 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -984,15 +984,15 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c
FUNC_ENTER_STATIC;
/* Check if the name in this group resolved to a valid link */
- if (lnk == NULL && obj_loc == NULL)
+ if(lnk == NULL && obj_loc == NULL)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name);
- /* Only modify user's buffer if it's available */
- if (udata->statbuf) {
+ /* Only modify user's buffer if it's available */
+ if(udata->statbuf) {
H5G_stat_t *statbuf = udata->statbuf; /* Convenience pointer for statbuf */
/* Common code to retrieve the file's fileno */
- if (H5F_get_fileno((obj_loc ? obj_loc : grp_loc)->oloc->file, &statbuf->fileno[0]) < 0)
+ if(H5F_get_fileno((obj_loc ? obj_loc : grp_loc)->oloc->file, &statbuf->fileno[0]) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "unable to read fileno");
/* Info for soft and UD links is gotten by H5L_get_info. If we have
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 40d56c6..56608e2 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -112,6 +112,10 @@ static herr_t H5G__loc_find_cb(H5G_loc_t *grp_loc, const char *name,
static herr_t H5G__loc_find_by_idx_cb(H5G_loc_t *grp_loc, const char *name,
const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata,
H5G_own_loc_t *own_loc);
+static herr_t H5G__loc_addr_cb(H5G_loc_t *grp_loc, const char *name,
+ const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc);
+static herr_t H5G__loc_info_cb(H5G_loc_t *grp_loc, const char *name,
+ const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc);
static herr_t H5G__loc_set_comment_cb(H5G_loc_t *grp_loc, const char *name,
const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata,
H5G_own_loc_t *own_loc);
@@ -684,7 +688,79 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_loc_info_cb
+ * Function: H5G__loc_addr_cb
+ *
+ * Purpose: Callback for retrieving the address for an object in a group
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, December 21, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5G__loc_addr_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc,
+ void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/)
+{
+ haddr_t *udata = (haddr_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid link */
+ if(obj_loc == NULL)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist")
+
+ /* Set address of object */
+ *udata = obj_loc->oloc->addr;
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G__loc_addr_cb() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G__loc_addr
+ *
+ * Purpose: Retrieve the information for an object from a group location
+ * and path to that object
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, November 23, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G__loc_addr(const H5G_loc_t *loc, const char *name, haddr_t *addr/*out*/)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check args. */
+ HDassert(loc);
+ HDassert(name && *name);
+ HDassert(addr);
+
+ /* Traverse group hierarchy to locate object */
+ if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_addr_cb, addr) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G__loc_addr() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G__loc_info_cb
*
* Purpose: Callback for retrieving object info for an object in a group
*
@@ -696,13 +772,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
+H5G__loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/)
{
H5G_loc_info_t *udata = (H5G_loc_info_t *)_udata; /* User data passed in */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check if the name in this group resolved to a valid link */
if(obj_loc == NULL)
@@ -718,7 +794,7 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_loc_info_cb() */
+} /* end H5G__loc_info_cb() */
/*-------------------------------------------------------------------------
@@ -752,7 +828,7 @@ H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo/*out*/, u
udata.oinfo = oinfo;
/* Traverse group hierarchy to locate object */
- if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_info_cb, &udata) < 0)
+ if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_info_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object")
done:
diff --git a/src/H5Gname.c b/src/H5Gname.c
index 86a0c2f..ab8ddf4 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -1195,11 +1195,11 @@ done:
* Purpose: Callback for retrieving object's name by address
*
* Return: Positive if path is for object desired
- * 0 if not correct object
- * negative on failure.
+ * 0 if not correct object
+ * negative on failure.
*
* Programmer: Quincey Koziol
- * November 4 2007
+ * November 4 2007
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index b79b7d2..d11d7a0 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -1256,7 +1256,7 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr,
/* expand soft link */
if(H5G_CACHED_SLINK == src_ent->type && cpy_info->expand_soft_link) {
- H5O_info_t oinfo; /* Information about object pointed to by soft link */
+ haddr_t obj_addr; /* Address of object pointed to by soft link */
H5G_loc_t grp_loc; /* Group location holding soft link */
H5G_name_t grp_path; /* Path for group holding soft link */
char *link_name; /* Pointer to value of soft link */
@@ -1274,9 +1274,8 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr,
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name")
/* Check if the object pointed by the soft link exists in the source file */
- /* Only basic information is needed */
- if(H5G_loc_info(&grp_loc, link_name, &oinfo, H5O_INFO_BASIC) >= 0) {
- tmp_src_ent.header = oinfo.addr;
+ if(H5G__loc_addr(&grp_loc, link_name, &obj_addr) >= 0) {
+ tmp_src_ent.header = obj_addr;
src_ent = &tmp_src_ent;
} /* end if */
else
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index f475bde..6dc025c 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -498,6 +498,8 @@ H5_DLL herr_t H5G__name_init(H5G_name_t *name, const char *path);
*/
H5_DLL herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name,
H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info);
+H5_DLL herr_t H5G__loc_addr(const H5G_loc_t *loc, const char *name,
+ haddr_t *addr/*out*/);
/* Testing functions */
#ifdef H5G_TESTING
diff --git a/src/H5L.c b/src/H5L.c
index c8c8cde..1606ef7 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -982,9 +982,9 @@ herr_t
H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id);
@@ -1018,11 +1018,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Lget_info_by_idx
*
- * Purpose: Gets metadata for a link, according to the order within an
+ * Purpose: Gets metadata for a link, according to the order within an
* index.
*
- * Return: Success: Non-negative with information in LINFO
- * Failure: Negative
+ * Return: Success: Non-negative with information in LINFO
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* Monday, November 6, 2006
@@ -1034,9 +1034,9 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
H5L_info_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo,
@@ -1346,7 +1346,7 @@ done:
* of the operators.
*
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 16, 2006
*
*-------------------------------------------------------------------------
@@ -1490,8 +1490,8 @@ done:
* library, or the negative value returned by one
* of the operators.
*
- * Programmer: Quincey Koziol
- * November 3 2007
+ * Programmer: Quincey Koziol
+ * November 3 2007
*
*-------------------------------------------------------------------------
*/
@@ -3174,7 +3174,7 @@ done:
*
* Purpose: Returns metadata about a link.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: James Laird
* Monday, April 17 2006
diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h
index fa3c097..6652352 100644
--- a/src/H5Lprivate.h
+++ b/src/H5Lprivate.h
@@ -63,7 +63,7 @@ typedef struct {
/* User data for path traversal routine for getting link info by index */
typedef struct {
/* In */
- H5_index_t idx_type; /* Index to use */
+ H5_index_t idx_type; /* Index to use */
H5_iter_order_t order; /* Order to iterate in index */
hsize_t n; /* Offset of link within index */
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 75be714..23094b9 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -56,7 +56,7 @@
/* User data for recursive traversal over objects from a group */
typedef struct {
hid_t obj_id; /* The ID for the starting group */
- H5G_loc_t *start_loc; /* Location of starting group */
+ H5G_loc_t *start_loc; /* Location of starting group */
H5SL_t *visited; /* Skip list for tracking visited nodes */
H5O_iterate_t op; /* Application callback */
void *op_data; /* Application's op data */
@@ -2283,63 +2283,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O__get_info_by_idx
- *
- * Purpose: Internal routine to retrieve an object's info according to
- * an index within a group.
- *
- *
- * Note: Add a parameter "fields" to indicate selection of object info.
- *
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * December 28, 2017
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields)
-{
- H5G_loc_t obj_loc; /* Location used to open group */
- H5G_name_t obj_path; /* Opened object group hier. path */
- H5O_loc_t obj_oloc; /* Opened object object location */
- hbool_t loc_found = FALSE; /* Entry at 'name' found */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check arguments */
- HDassert(loc);
- HDassert(group_name && *group_name);
- HDassert(oinfo);
-
- /* Set up opened group location to fill in */
- obj_loc.oloc = &obj_oloc;
- obj_loc.path = &obj_path;
- H5G_loc_reset(&obj_loc);
-
- /* Find the object's location, according to the order in the index */
- if(H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &obj_loc/*out*/) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
- loc_found = TRUE;
-
- /* Retrieve the object's information */
- if(H5O_get_info(obj_loc.oloc, oinfo, fields) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info")
-
-done:
- /* Release the object location */
- if(loc_found && H5G_loc_free(&obj_loc) < 0)
- HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location")
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O__get_info_by_idx() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5O_get_create_plist
*
* Purpose: Retrieve the object creation properties for an object
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 4afa452..c7167c7 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -556,8 +556,6 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1];
/* Package-local function prototypes */
H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc);
H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted);
-H5_DLL herr_t H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields);
H5_DLL herr_t H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type,
H5_iter_order_t order, H5O_iterate_t op, void *op_data, unsigned fields);
H5_DLL herr_t H5O__inc_rc(H5O_t *oh);
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 54e8ec8..5965fc6 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -877,6 +877,7 @@ typedef struct {
void *new_obj; /* Pointer to new object created */
} H5O_obj_create_t;
+
/* Forward declarations for prototype arguments */
struct H5P_genplist_t;
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 234f4f0..cda446b 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -75,7 +75,7 @@
/* Flags for H5Oget_info.
* Theses flags determine which fields will be filled in in the H5O_info_t
- * struct.
+ * struct.
*/
#define H5O_INFO_BASIC 0x0001u /* Fill in the fileno, addr, type, and rc fields */
#define H5O_INFO_TIME 0x0002u /* Fill in the atime, mtime, ctime, and btime fields */
diff --git a/src/H5R.c b/src/H5R.c
index 2c4c713..f5d119f 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -237,7 +237,7 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id,
done:
if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0)
- HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "unable to decrement refcount on file")
+ HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file")
FUNC_LEAVE_API(ret_value)
} /* end H5Rcreate_region() */
@@ -326,7 +326,7 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name,
done:
if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0)
- HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "unable to decrement refcount on file")
+ HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file")
FUNC_LEAVE_API(ret_value)
} /* end H5Rcreate_attr() */
@@ -616,7 +616,7 @@ done:
HDONE_ERROR(H5E_REFERENCE, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close object")
if(H5I_INVALID_HID == ret_value) /* Cleanup on failure */
if((space_id != H5I_INVALID_HID) && (H5I_dec_ref(space_id) < 0))
- HDONE_ERROR(H5E_REFERENCE, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close dataspace")
+ HDONE_ERROR(H5E_REFERENCE, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close dataspace")
FUNC_LEAVE_API(ret_value)
} /* end H5Ropen_region() */
@@ -688,7 +688,7 @@ H5Ropen_attr(const H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id)
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
@@ -700,18 +700,18 @@ H5Ropen_attr(const H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id)
/* Open the attribute */
if(NULL == (opened_attr = H5VL_attr_open(opened_obj, &loc_params, H5R_REF_ATTRNAME((const H5R_ref_priv_t *)ref_ptr), aapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
- HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute: '%s'", H5R_REF_ATTRNAME((const H5R_ref_priv_t *)ref_ptr))
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute: '%s'", H5R_REF_ATTRNAME((const H5R_ref_priv_t *)ref_ptr))
/* Register the attribute and get an ID for it */
if((ret_value = H5VL_register(H5I_ATTR, opened_attr, vol_obj->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
done:
if((opened_obj_id != H5I_INVALID_HID) && (H5I_dec_ref(opened_obj_id) < 0))
HDONE_ERROR(H5E_REFERENCE, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close object")
if(H5I_INVALID_HID == ret_value) /* Cleanup on failure */
if(opened_attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
+ HDONE_ERROR(H5E_REFERENCE, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
FUNC_LEAVE_API(ret_value)
} /* end H5Ropen_attr() */
@@ -746,7 +746,7 @@ H5Rget_obj_type3(const H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type)
|| H5R__get_type((const H5R_ref_priv_t *)ref_ptr) >= H5R_MAXTYPE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
if(rapl_id < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/* Retrieve loc_id from reference */
if(H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr))) {
@@ -770,7 +770,7 @@ H5Rget_obj_type3(const H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type)
/* Retrieve object's type */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, obj_type) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object type")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve object type")
done:
FUNC_LEAVE_API(ret_value)
@@ -854,7 +854,7 @@ H5Rget_obj_name(const H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size)
|| H5R__get_type((const H5R_ref_priv_t *)ref_ptr) >= H5R_MAXTYPE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "invalid reference type")
if(rapl_id < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a property list")
/* Retrieve loc_id from reference */
if(H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr))) {
@@ -878,7 +878,7 @@ H5Rget_obj_name(const H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size)
/* Retrieve object's name */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value, buf, size) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)
@@ -915,3 +915,4 @@ H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf, size_t size)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Rget_attr_name() */
+
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index 25cce85..256c930 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -133,7 +133,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
/* Retrieve object's type */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &obj_type) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5G_UNKNOWN, "can't retrieve object type")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5G_UNKNOWN, "can't retrieve object type")
/* Set return value */
ret_value = H5G_map_obj_type(obj_type);
@@ -373,7 +373,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref,
/* Retrieve object's type */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, obj_type) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object type")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve object type")
done:
FUNC_LEAVE_API(ret_value)
@@ -492,7 +492,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
/* Check if using native VOL connector */
if(H5VL_object_is_native(vol_obj, &is_native) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't query if file uses native VOL connector")
/* Must use native VOL connector for this operation */
HDassert(is_native);
@@ -525,7 +525,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
/* Atomize */
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
done:
if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0)
@@ -583,7 +583,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name,
/* Retrieve object's name */
if(H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value, name, size) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 590b3bf..c6e3875 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -529,26 +529,26 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id)
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a file access property list")
if(H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info")
/* Stash a copy of the "top-level" connector property, before any pass-through
* connectors modify or unwrap it.
*/
if(H5CX_set_vol_connector_prop(&connector_prop) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context")
/* Open the file */
/* (Must open file read-write to allow for object modifications) */
if(NULL == (new_file = H5VL_file_open(&connector_prop, H5R_REF_FILENAME(ref), H5F_ACC_RDWR, fapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file")
/* Get an ID for the file */
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
/* Get the file object */
if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier")
/* Make the 'post open' callback */
supported = FALSE;
@@ -1382,7 +1382,7 @@ H5R__encode_heap(H5F_t *f, unsigned char *buf, size_t *nalloc,
/* Write the reference information to disk (allocates space also) */
if(H5HG_insert(f, data_size, data, &hobjid) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to write reference information")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to write reference information")
/* Encode the heap information */
H5F_addr_encode(f, &p, hobjid.addr);
@@ -1433,7 +1433,7 @@ H5R__decode_heap(H5F_t *f, const unsigned char *buf, size_t *nbytes,
/* Read the information from disk */
if(NULL == (*data_ptr = (unsigned char *)H5HG_read(f, &hobjid, (void *)*data_ptr, data_size)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "Unable to read reference data")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read reference data")
*nbytes = buf_size;
@@ -1479,7 +1479,7 @@ H5R__free_heap(H5F_t *f, const unsigned char *buf, size_t nbytes)
if(hobjid.addr > 0) {
/* Free heap object */
if(H5HG_remove(f, &hobjid) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to remove heap object")
} /* end if */
done:
@@ -1677,7 +1677,7 @@ H5R__encode_token_region_compat(H5F_t *f, const H5VL_token_t *obj_token,
/* Allocate the space to store the serialized information */
H5_CHECK_OVERFLOW(data_size, hssize_t, size_t);
if(NULL == (data = (uint8_t *)H5MM_malloc((size_t)data_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Serialize information for dataset OID into heap buffer */
p = (uint8_t *)data;
@@ -1748,7 +1748,7 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
/* Open and copy the dataset's dataspace */
if(NULL == (space = H5S_read(&oloc)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "not found")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "not found")
/* Unserialize the selection */
if(H5S_SELECT_DESERIALIZE(&space, &p) < 0)
diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h
index 6afec47..870deaf 100644
--- a/src/H5Rprivate.h
+++ b/src/H5Rprivate.h
@@ -43,3 +43,4 @@
/******************************/
#endif /* _H5Rprivate_H */
+
diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h
index a13d54b..cfbf3c8 100644
--- a/src/H5Rpublic.h
+++ b/src/H5Rpublic.h
@@ -71,7 +71,7 @@ typedef haddr_t hobj_ref_t;
* Note! This type can only be used with the "native" HDF5 VOL connector.
*/
typedef struct {
- char __data[H5R_DSET_REG_REF_BUF_SIZE];
+ uint8_t __data[H5R_DSET_REG_REF_BUF_SIZE];
} hdset_reg_ref_t;
/**
@@ -80,7 +80,7 @@ typedef struct {
* should always be used with the current reference API.
*/
typedef struct {
- char __data[H5R_REF_BUF_SIZE];
+ uint8_t __data[H5R_REF_BUF_SIZE];
} H5R_ref_t;
/********************/
diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h
index 6ae43c0..4ce6bb1 100644
--- a/src/H5VLconnector.h
+++ b/src/H5VLconnector.h
@@ -459,14 +459,6 @@ typedef struct H5VL_blob_class_t {
herr_t (*optional)(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments);
} H5VL_blob_class_t;
-/*
- * VOL connector identifiers. Values 0 through 255 are for connectors defined
- * by the HDF5 library. Values 256 through 511 are available for testing new
- * filters. Subsequent values should be obtained from the HDF5 development
- * team at help@hdfgroup.org.
- */
-typedef int H5VL_class_value_t;
-
/* Class information for each VOL connector */
typedef struct H5VL_class_t {
/* Overall connector fields & callbacks */
@@ -514,6 +506,7 @@ extern "C" {
#endif
/* Helper routines for VOL connector authors */
+H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
H5_DLL void *H5VLobject(hid_t obj_id);
H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id,
hid_t dtype_id);
diff --git a/src/H5VLnative.h b/src/H5VLnative.h
index 2f8d5bd..44ed670 100644
--- a/src/H5VLnative.h
+++ b/src/H5VLnative.h
@@ -20,6 +20,11 @@
/* Public headers needed by this file */
#include "H5VLpublic.h" /* Virtual Object Layer */
+
+/*****************/
+/* Public Macros */
+/*****************/
+
/* Identifier for the native VOL connector */
#define H5VL_NATIVE (H5VL_native_register())
@@ -89,6 +94,18 @@
#define H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES 4 /* H5Oenable_mdc_flushes */
#define H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED 5 /* H5Oare_mdc_flushes_disabled */
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c
index 2a8c27a..9a633ac 100644
--- a/src/H5VLnative_link.c
+++ b/src/H5VLnative_link.c
@@ -255,6 +255,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_
} /* end else-if */
else
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info")
+
break;
}
diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h
index 88afea9..34a642e 100644
--- a/src/H5VLpublic.h
+++ b/src/H5VLpublic.h
@@ -21,12 +21,6 @@
#include "H5public.h" /* Generic Functions */
#include "H5Ipublic.h" /* IDs */
-/* Semi-public headers mainly for VOL connector authors */
-#include "H5VLconnector.h" /* VOL connector author routines */
-#include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */
-#include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */
-
-
/*****************/
/* Public Macros */
/*****************/
@@ -34,7 +28,7 @@
/* VOL connector identifier values
* These are H5VL_class_value_t values, NOT hid_t values!
*/
-#define H5_VOL_INVALID (-1) /* Invalid ID for VOL connector iD */
+#define H5_VOL_INVALID (-1) /* Invalid ID for VOL connector ID */
#define H5_VOL_NATIVE 0 /* Native HDF5 file format VOL connector */
#define H5_VOL_RESERVED 256 /* VOL connector IDs below this value are reserved for library use */
#define H5_VOL_MAX 65535 /* Maximum VOL connector ID */
@@ -44,6 +38,16 @@
/* Public Typedefs */
/*******************/
+
+/*
+ * VOL connector identifiers. Values 0 through 255 are for connectors defined
+ * by the HDF5 library. Values 256 through 511 are available for testing new
+ * filters. Subsequent values should be obtained from the HDF5 development
+ * team at help@hdfgroup.org.
+ */
+typedef int H5VL_class_value_t;
+
+
/********************/
/* Public Variables */
/********************/
@@ -59,8 +63,6 @@ extern "C" {
/* The H5VL types uses in the API calls are not opaque - they are defined in
* H5VLconnector.h, which is included at the top of this file.
*/
-
-H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id);
H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id);
H5_DLL htri_t H5VLis_connector_registered(const char *name);
@@ -74,5 +76,10 @@ H5_DLL herr_t H5VLunregister_connector(hid_t connector_id);
}
#endif
+/* Semi-public headers mainly for VOL connector authors */
+#include "H5VLconnector.h" /* VOL connector author routines */
+#include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */
+#include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */
+
#endif /* _H5VLpublic_H */
diff --git a/src/H5system.c b/src/H5system.c
index 384360d..4b5e290 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -86,7 +86,9 @@ static hbool_t H5_ntzset = FALSE;
* prints an `hsize_t' value as a hex number right justified and
* zero filled in an 18-character field.
*
- * The conversion `a' refers to an `haddr_t' type.
+ * The conversion 'a' refers to an haddr_t type.
+ *
+ * The conversion 't' refers to an htri_t type.
*
* Return: Success: Number of characters printed
*
diff --git a/src/H5vers.txt b/src/H5vers.txt
index 22117c3..4b2f222 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -20,7 +20,7 @@
# Blank lines and lines beginning with '#' are ignored
#
# The format of this file is as follows:
-# <type>: <base routine name>; <list of parameter types for function>; <version introduced>, <list of revised versions>
+# <type>: <base routine name>; <list of versioned parameter types for function>; <version introduced>, <list of revised versions>
#
# Where <type> is either 'FUNCTION' or 'TYPEDEF'
#