src/h5core/*:
- all *_has_* functions: return TRUE, FALSE or H5_FAILURE
This commit is contained in:
@@ -60,9 +60,9 @@ hdf5_get_objname (
|
||||
Determine whether a link with the specified name exists in a group.
|
||||
|
||||
Result:
|
||||
1 if link exists
|
||||
0 if link doesn't exist
|
||||
error else
|
||||
TRUE if link exists
|
||||
FALSE if link doesn't exist
|
||||
H5_FAILURE on error
|
||||
*/
|
||||
static inline h5_err_t
|
||||
hdf5_link_exists (
|
||||
|
||||
+11
-2
@@ -118,6 +118,12 @@ h5priv_get_dataset_type(
|
||||
H5_CORE_API_RETURN (type);
|
||||
}
|
||||
|
||||
/*
|
||||
returns:
|
||||
TRUE (value > 0): if step exists
|
||||
FALSE (i.e. 0): if step does not exist
|
||||
H5_FAILURE: on error
|
||||
*/
|
||||
h5_err_t
|
||||
h5_has_step (
|
||||
const h5_file_t f_, /*!< [in] Handle to open file */
|
||||
@@ -128,8 +134,11 @@ h5_has_step (
|
||||
char name[2*H5_STEPNAME_LEN];
|
||||
sprintf (name,
|
||||
"%s#%0*lld",
|
||||
f->props->prefix_step_name, f->props->width_step_idx, (long long)step_idx);
|
||||
H5_CORE_API_RETURN (hdf5_link_exists(f->file, name));
|
||||
f->props->prefix_step_name, f->props->width_step_idx,
|
||||
(long long)step_idx);
|
||||
h5_err_t exists;
|
||||
TRY (exists = hdf5_link_exists (f->file, name));
|
||||
H5_CORE_API_RETURN (exists);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
+2
-18
@@ -42,11 +42,8 @@ h5b_has_field_data (
|
||||
H5_CORE_API_ENTER (h5_err_t, "f=%p", f);
|
||||
CHECK_FILEHANDLE (f);
|
||||
h5_err_t exists;
|
||||
h5_err_t result = H5_NOK;
|
||||
TRY (exists = hdf5_link_exists (f->step_gid, H5BLOCK_GROUPNAME_BLOCK));
|
||||
if (exists)
|
||||
result = H5_SUCCESS;
|
||||
H5_CORE_API_RETURN (result);
|
||||
H5_CORE_API_RETURN (exists);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -482,19 +479,6 @@ _create_block_group (
|
||||
H5_PRIV_FUNC_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_have_field_group (
|
||||
const h5_file_p f, /*!< IN: file handle */
|
||||
const char *name
|
||||
) {
|
||||
H5_PRIV_API_ENTER (h5_err_t, "f=%p, name='%s'", f, name);
|
||||
char name2[H5_DATANAME_LEN];
|
||||
h5priv_normalize_dataset_name (name, name2);
|
||||
|
||||
TRY( h5bpriv_open_block_group(f) );
|
||||
H5_PRIV_API_RETURN (hdf5_link_exists(f->b->block_gid, name2));
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_open_field_group (
|
||||
const h5_file_p f, /*!< IN: file handle */
|
||||
@@ -545,7 +529,7 @@ h5_int64_t
|
||||
h5b_3d_has_view (
|
||||
const h5_file_t fh /*!< IN: File handle */
|
||||
) {
|
||||
return ( ((h5_file_p)fh)->b->have_layout > 0 ? H5_SUCCESS : H5_NOK );
|
||||
return (((h5_file_p)fh)->b->have_layout > 0);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -17,12 +17,6 @@
|
||||
H5_ERR_VIEW, \
|
||||
"No view has been defined!"));
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_have_field_group (
|
||||
const h5_file_p f, /*!< IN: file handle */
|
||||
const char *name
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5bpriv_open_field_group (
|
||||
const h5_file_p f, /*!< IN: file handle */
|
||||
|
||||
@@ -25,7 +25,7 @@ h5u_get_num_points (
|
||||
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
h5_ssize_t nparticles;
|
||||
|
||||
if (h5u_has_view ((h5_file_t)f) == H5_OK) {
|
||||
if (h5u_has_view ((h5_file_t)f)) {
|
||||
/* if a view exists, use its size as the number of particles */
|
||||
TRY (nparticles = h5u_get_num_points_in_view (fh));
|
||||
} else {
|
||||
@@ -45,7 +45,7 @@ h5u_get_num_points_in_view (
|
||||
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
h5_ssize_t nparticles;
|
||||
|
||||
if (h5u_has_view (fh) != H5_OK) {
|
||||
if (!h5u_has_view (fh)) {
|
||||
H5_CORE_API_LEAVE (
|
||||
h5_error (
|
||||
H5_ERR_H5PART,
|
||||
@@ -211,8 +211,7 @@ h5u_has_view (
|
||||
) {
|
||||
h5_file_p f = (h5_file_p)fh;
|
||||
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
h5_err_t result = (f->u->viewindexed || f->u->viewstart >= 0) ? H5_SUCCESS : H5_NOK;
|
||||
H5_CORE_API_RETURN (result);
|
||||
H5_CORE_API_RETURN (f->u->viewindexed || f->u->viewstart >= 0);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
Reference in New Issue
Block a user