summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-11-30 21:59:22 (GMT)
committerGitHub <noreply@github.com>2020-11-30 21:59:22 (GMT)
commit123c5a653dbe3867e06eb8c31da952b7ef042f95 (patch)
tree077e9e2951b85e5c38ed0c9ea11c6baa396879e9 /tools
parentcadd6db431e2664e6dd3f2460639a27d21c6c8a9 (diff)
downloadhdf5-123c5a653dbe3867e06eb8c31da952b7ef042f95.zip
hdf5-123c5a653dbe3867e06eb8c31da952b7ef042f95.tar.gz
hdf5-123c5a653dbe3867e06eb8c31da952b7ef042f95.tar.bz2
Expand 'opt_query' VOL callback to return a bitfield instead of a flag (#136)
* Expand 'opt_query' VOL callback to return a bitfield instead of a flag * Correct pastos
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_dump.c10
-rw-r--r--tools/src/h5dump/h5dump_ddl.c4
-rw-r--r--tools/src/h5ls/h5ls.c12
-rw-r--r--tools/test/h5dump/h5dumpgentest.c48
4 files changed, 37 insertions, 37 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 56ffd27..09660fc 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -3298,8 +3298,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
(hsize_t)0);
}
else {
- haddr_t ioffset;
- hbool_t supported = FALSE;
+ haddr_t ioffset;
+ uint64_t supported = 0;
/* NORMAL FILE */
@@ -3322,7 +3322,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
*/
H5VLquery_optional(dset_id, H5VL_SUBCLS_DATASET, H5VL_NATIVE_DATASET_GET_OFFSET, &supported);
- if (supported) {
+ if (supported & H5VL_OPT_QUERY_SUPPORTED) {
ctx->need_prefix = TRUE;
@@ -3777,12 +3777,12 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_
* instead of the current stripmine position i; this is necessary
* to print the array indices
*/
- hbool_t supported = FALSE;
+ uint64_t supported = 0;
/* Check if comments are supported and return if not */
H5VLquery_optional(obj_id, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_GET_COMMENT, &supported);
- if (!supported)
+ if (!(supported & H5VL_OPT_QUERY_SUPPORTED))
return;
/* setup */
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 8c637b1..5566b8f 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -1154,7 +1154,7 @@ dump_fcpl(hid_t fid)
unsigned sym_ik; /* symbol table B-tree internal 'K' value */
unsigned istore_ik; /* indexed storage B-tree internal 'K' value */
- hbool_t supported = FALSE;
+ uint64_t supported = 0;
/* Dumping the information here only makes sense for the native
* VOL connector. The only VOL call here is H5Fget_info(), so we'll
@@ -1163,7 +1163,7 @@ dump_fcpl(hid_t fid)
*/
H5VLquery_optional(fid, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_GET_INFO, &supported);
- if (!supported)
+ if (!(supported & H5VL_OPT_QUERY_SUPPORTED))
return;
fcpl = H5Fget_create_plist(fid);
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 9ebd4d5..dd21bb1 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -2157,11 +2157,11 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
/* Show detailed information about the object, beginning with information
* which is common to all objects. */
if (verbose_g > 0) {
- size_t buf_size = 0;
- char * comment = NULL;
- char * obj_tok_str = NULL;
- ssize_t cmt_bufsize = -1;
- hbool_t supported = FALSE;
+ size_t buf_size = 0;
+ char * comment = NULL;
+ char * obj_tok_str = NULL;
+ ssize_t cmt_bufsize = -1;
+ uint64_t supported = 0;
/* Display attributes */
H5TOOLS_DEBUG("Display attributes");
@@ -2200,7 +2200,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
/* Only emit comments if the VOL connector supports that */
H5VLquery_optional(obj_id, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_GET_COMMENT, &supported);
- if (supported) {
+ if (supported & H5VL_OPT_QUERY_SUPPORTED) {
/* Object comment */
cmt_bufsize = H5Oget_comment(obj_id, comment, buf_size);
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index f2d9271..99ceeb3 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -2106,7 +2106,7 @@ gent_objref(void)
uint32_t * tu32; /* Temporary pointer to uint32 data */
int i; /* counting variables */
const char *write_comment = "Foo!"; /* Comments for group */
- hbool_t supports_comments = FALSE;
+ uint64_t supports_comments = 0;
/* Allocate write & read buffers */
wbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1);
@@ -2126,7 +2126,7 @@ gent_objref(void)
H5VLquery_optional(fid1, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments);
/* Set group's comment */
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment(group, write_comment);
/* Create a dataset (inside Group1) */
@@ -3677,9 +3677,9 @@ gent_empty(void)
static void
gent_group_comments(void)
{
- hid_t fid = H5I_INVALID_HID;
- hid_t group = H5I_INVALID_HID;
- hbool_t supports_comments = FALSE;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t group = H5I_INVALID_HID;
+ uint64_t supports_comments = 0;
fid = H5Fcreate(FILE33, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3688,69 +3688,69 @@ gent_group_comments(void)
/* / */
group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g1", "Comment for group /g1", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g2", "Comment for group /g2", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g3", "Comment for group /g3", H5P_DEFAULT);
H5Gclose(group);
/* /g1 */
group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g1/g1.1", "Comment for group /g1/g1.1", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g1/g1.2", "Comment for group /g1/g1.2", H5P_DEFAULT);
H5Gclose(group);
/* /g2 */
group = H5Gcreate2(fid, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g2/g2.1", "Comment for group /g2/g2.1", H5P_DEFAULT);
H5Gclose(group);
/* /g3 */
group = H5Gcreate2(fid, "/g3/g3.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g3/g3.1", "Comment for group /g3/g3.1", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g3/g3.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g3/g3.2", "Comment for group /g3/g3.2", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g3/g3.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g3/g3.3", "Comment for group /g3/g3.3", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g3/g3.4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g3/g3.4", "Comment for group /g3/g3.4", H5P_DEFAULT);
H5Gclose(group);
/* /g2/g2.1 */
group = H5Gcreate2(fid, "/g2/g2.1/g2.1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g2/g2.1/g2.1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.2", "Comment for group /g2/g2.1/g2.1.2", H5P_DEFAULT);
H5Gclose(group);
group = H5Gcreate2(fid, "/g2/g2.1/g2.1.3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3", H5P_DEFAULT);
H5Gclose(group);
/* /glongcomment */
group = H5Gcreate2(fid, "/glongcomment", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (supports_comments)
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED)
H5Oset_comment_by_name(
group, "/glongcomment",
"Comment for group /glongcomment with a really, really, really long, long, long comment",
@@ -5446,7 +5446,7 @@ gent_filters(void)
int buf1[DIM1][DIM2];
int i, j, n;
int H5_ATTR_NDEBUG_UNUSED ret;
- hbool_t supports_comments = FALSE;
+ uint64_t supports_comments = 0;
for (i = n = 0; i < DIM1; i++) {
for (j = 0; j < DIM2; j++) {
@@ -5478,7 +5478,7 @@ gent_filters(void)
ret = make_dset(fid, "compact", sid, H5T_NATIVE_INT, dcpl, buf1);
HDassert(ret >= 0);
- if (supports_comments) {
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) {
ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT);
HDassert(ret >= 0);
}
@@ -5489,7 +5489,7 @@ gent_filters(void)
ret = make_dset(fid, "contiguous", sid, H5T_NATIVE_INT, dcpl, buf1);
HDassert(ret >= 0);
- if (supports_comments) {
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) {
ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage",
H5P_DEFAULT);
HDassert(ret >= 0);
@@ -5504,7 +5504,7 @@ gent_filters(void)
ret = make_dset(fid, "chunked", sid, H5T_NATIVE_INT, dcpl, buf1);
HDassert(ret >= 0);
- if (supports_comments) {
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) {
ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT);
HDassert(ret >= 0);
}
@@ -5720,7 +5720,7 @@ gent_filters(void)
ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
HDassert(ret >= 0);
- if (supports_comments) {
+ if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) {
ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT);
HDassert(ret >= 0);
}