diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-08-26 00:28:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 00:28:23 (GMT) |
commit | 4576b3db8b19d8ea2cc949585f4ef292ddef37a0 (patch) | |
tree | 3b507e711b42650cc40dc1b183c5872bd6f6d5a0 /examples | |
parent | 54b92c122dcd1340dc678f586647997b3e4c86fe (diff) | |
download | hdf5-4576b3db8b19d8ea2cc949585f4ef292ddef37a0.zip hdf5-4576b3db8b19d8ea2cc949585f4ef292ddef37a0.tar.gz hdf5-4576b3db8b19d8ea2cc949585f4ef292ddef37a0.tar.bz2 |
Merge of examples and hl from dev (#964)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/h5_attribute.c | 3 | ||||
-rw-r--r-- | examples/h5_extlink.c | 5 | ||||
-rw-r--r-- | examples/h5_ref_compat.c | 4 | ||||
-rw-r--r-- | examples/h5_ref_extern.c | 4 |
4 files changed, 12 insertions, 4 deletions
diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 5d2a9ff..97be7f5 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -184,6 +184,8 @@ main(void) printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); ret = H5Aclose(attr); + //! [H5Oget_info3_snip] + /* * Find string attribute by iterating through all attributes */ @@ -203,6 +205,7 @@ main(void) ret = H5Tclose(atype); } + //! [H5Oget_info3_snip] /* * Get attribute info using iteration function. */ diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index 44ff2da..f9d4046 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -414,10 +414,15 @@ UD_hard_create(const char *link_name, hid_t loc_group, const void *udata, size_t token = *((H5O_token_t *)udata); + //! [H5Open_by_token_snip] + /* Open the object this link points to so that we can increment * its reference count. This also ensures that the token passed * in points to a real object (although this check is not perfect!) */ target_obj = H5Oopen_by_token(loc_group, token); + + //! [H5Open_by_token_snip] + if (target_obj < 0) { ret_value = -1; goto done; diff --git a/examples/h5_ref_compat.c b/examples/h5_ref_compat.c index 82ef525..cce755b 100644 --- a/examples/h5_ref_compat.c +++ b/examples/h5_ref_compat.c @@ -76,9 +76,9 @@ main(void) /* Access reference and read dataset data through new API */ assert(H5Rget_type((const H5R_ref_t *)&new_ref_buf[0]) == H5R_OBJECT2); - H5Rget_obj_type3((const H5R_ref_t *)&new_ref_buf[0], H5P_DEFAULT, &obj_type); + H5Rget_obj_type3(&new_ref_buf[0], H5P_DEFAULT, &obj_type); assert(obj_type == H5O_TYPE_DATASET); - dset1 = H5Ropen_object((const H5R_ref_t *)&new_ref_buf[0], H5P_DEFAULT, H5P_DEFAULT); + dset1 = H5Ropen_object(&new_ref_buf[0], H5P_DEFAULT, H5P_DEFAULT); H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_buf); H5Dclose(dset1); H5Rdestroy(&new_ref_buf[0]); diff --git a/examples/h5_ref_extern.c b/examples/h5_ref_extern.c index a46f676..691d235 100644 --- a/examples/h5_ref_extern.c +++ b/examples/h5_ref_extern.c @@ -78,9 +78,9 @@ main(void) /* Access reference and read dataset data without opening original file */ assert(H5Rget_type((const H5R_ref_t *)&ref_buf[0]) == H5R_OBJECT2); - H5Rget_obj_type3((const H5R_ref_t *)&ref_buf[0], H5P_DEFAULT, &obj_type); + H5Rget_obj_type3(&ref_buf[0], H5P_DEFAULT, &obj_type); assert(obj_type == H5O_TYPE_DATASET); - dset1 = H5Ropen_object((const H5R_ref_t *)&ref_buf[0], H5P_DEFAULT, H5P_DEFAULT); + dset1 = H5Ropen_object(&ref_buf[0], H5P_DEFAULT, H5P_DEFAULT); H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_buf); H5Dclose(dset1); H5Rdestroy(&ref_buf[0]); |