diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.in | 3 | ||||
-rw-r--r-- | tools/h5dump.c | 8 | ||||
-rw-r--r-- | tools/h5findshd.c | 4 | ||||
-rw-r--r-- | tools/h5ls.c | 40 |
4 files changed, 35 insertions, 20 deletions
diff --git a/tools/Makefile.in b/tools/Makefile.in index daed201..a28f9cf 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -26,9 +26,10 @@ LIB=libh5tools.a LIBHDF5=../src/libhdf5.la PROGS=h5debug h5import h5ls h5repart h5dump @H5TOH4@ -# Source and object files for the library. +# Source and object files for the library; do not install LIB_SRC=h5tools.c h5findshd.c LIB_OBJ=$(LIB_SRC:.c=.o) +PUB_LIB= # Source and object files for programs... PROG_SRC=h5debug.c h5import.c h5ls.c h5repart.c h5dump.c h5dumputil.c h5toh4.c diff --git a/tools/h5dump.c b/tools/h5dump.c index 5105cfa..a353e32 100644 --- a/tools/h5dump.c +++ b/tools/h5dump.c @@ -472,7 +472,7 @@ dump_dataspace (hid_t space) * *-----------------------------------------------------------------------*/ static herr_t -dump_attr (hid_t attr, const char *attr_name, void __unused__ *op_data) +dump_attr (hid_t attr, const char *attr_name, void UNUSED *op_data) { hid_t attr_id, type, space; @@ -646,7 +646,7 @@ H5G_stat_t statbuf; * *-----------------------------------------------------------------------*/ static herr_t -dump_all (hid_t group, const char *name, void __unused__ *op_data) +dump_all (hid_t group, const char *name, void UNUSED *op_data) { hid_t obj; char *buf, *tmp; @@ -1132,7 +1132,7 @@ int i; * *-----------------------------------------------------------------------*/ static herr_t -find_shared_objs(hid_t group, const char *name, void __unused__ *op_data) +find_shared_objs(hid_t group, const char *name, void UNUSED *op_data) { hid_t obj, type; H5G_stat_t statbuf; @@ -1271,7 +1271,7 @@ int i, index, curr_arg, display_bb=0, display_all=1; int nopts=0, *opts; char *buf, name[128], name1[128]; H5G_stat_t statbuf; -void __unused__ *op_data; +void UNUSED *op_data; void *edata; hid_t (*func)(void*); diff --git a/tools/h5findshd.c b/tools/h5findshd.c index 20d9492..088aa17 100644 --- a/tools/h5findshd.c +++ b/tools/h5findshd.c @@ -222,7 +222,7 @@ int i; * *-----------------------------------------------------------------------*/ herr_t -find_shared_objs(hid_t group, char *name, void __unused__ *op_data) +find_shared_objs(hid_t group, char *name, void UNUSED *op_data) { hid_t obj, type; H5G_stat_t statbuf; @@ -326,7 +326,7 @@ int i; * *-----------------------------------------------------------------------*/ herr_t -H5findobj_once(hid_t group, char *name, void __unused__ *op_data) +H5findobj_once(hid_t group, char *name, void UNUSED *op_data) { hid_t obj, type; H5G_stat_t statbuf; diff --git a/tools/h5ls.c b/tools/h5ls.c index 45e0deb..43b579e 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -23,6 +23,7 @@ static hbool_t label_g = FALSE; /*label compound values? */ static hbool_t string_g = FALSE; /*print 1-byte numbers as ASCII? */ static hbool_t fullname_g = FALSE; /*print full path names */ static hbool_t recursive_g = FALSE; /*recursive descent listing */ +static hbool_t grp_literal_g = FALSE; /*list group, not contents */ /* Info to pass to the iteration functions */ typedef struct iter_t { @@ -84,6 +85,7 @@ usage: %s [OPTIONS] FILE [OBJECTS...]\n\ -h, -?, --help Print a usage message and exit\n\ -d, --dump Print the values of datasets\n\ -f, --full Print full path names instead of base names\n\ + -g, --group Show information about a group, not its contents\n\ -l, --label Label members of compound datasets\n\ -r, --recursive List all groups recursively, avoiding cycles\n\ -s, --string Print 1-byte integer datasets as ASCII\n\ @@ -269,7 +271,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) *------------------------------------------------------------------------- */ static hbool_t -display_native_type(hid_t type, int __unused__ indent) +display_native_type(hid_t type, int UNUSED indent) { if (H5Tequal(type, H5T_NATIVE_SCHAR)) { printf("native signed char"); @@ -337,7 +339,7 @@ display_native_type(hid_t type, int __unused__ indent) *------------------------------------------------------------------------- */ static hbool_t -display_ieee_type(hid_t type, int __unused__ indent) +display_ieee_type(hid_t type, int UNUSED indent) { if (H5Tequal(type, H5T_IEEE_F32BE)) { printf("IEEE 32-bit big-endian float"); @@ -809,7 +811,7 @@ display_enum_type(hid_t type, int indent) *------------------------------------------------------------------------- */ static hbool_t -display_string_type(hid_t type, int __unused__ indent) +display_string_type(hid_t type, int UNUSED indent) { H5T_str_t pad; const char *pad_s=NULL; @@ -897,7 +899,7 @@ display_string_type(hid_t type, int __unused__ indent) *------------------------------------------------------------------------- */ static hbool_t -display_reference_type(hid_t type, int __unused__ indent) +display_reference_type(hid_t type, int UNUSED indent) { if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; @@ -1028,7 +1030,7 @@ dump_dataset_values(hid_t dset) *------------------------------------------------------------------------- */ static herr_t -list_attr (hid_t obj, const char *attr_name, void __unused__ *op_data) +list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data) { hid_t attr, space, type, p_type; hsize_t size[64], nelmts=1; @@ -1170,7 +1172,7 @@ dataset_list1(hid_t dset) *------------------------------------------------------------------------- */ static herr_t -dataset_list2(hid_t dset, const char __unused__ *name) +dataset_list2(hid_t dset, const char UNUSED *name) { hid_t dcpl; /*dataset creation property list*/ hid_t type; /*data type of dataset */ @@ -1331,7 +1333,7 @@ group_list2(hid_t grp, const char *name) *------------------------------------------------------------------------- */ static herr_t -datatype_list2(hid_t type, const char __unused__ *name) +datatype_list2(hid_t type, const char UNUSED *name) { if (verbose_g>0) { printf(" %-10s ", "Type:"); @@ -1360,7 +1362,7 @@ datatype_list2(hid_t type, const char __unused__ *name) *------------------------------------------------------------------------- */ static herr_t -ragged_list2(hid_t __unused__ ra, const char __unused__ *name) +ragged_list2(hid_t UNUSED ra, const char UNUSED *name) { if (dump_g) { puts(" Data: Not implemented yet (see values of member"); @@ -1712,6 +1714,8 @@ main (int argc, char *argv[]) } else if (!strcmp(argv[argno], "--help")) { usage(progname); exit(0); + } else if (!strcmp(argv[argno], "--group")) { + grp_literal_g = TRUE; } else if (!strcmp(argv[argno], "--dump")) { dump_g = TRUE; } else if (!strcmp(argv[argno], "--full")) { @@ -1763,6 +1767,9 @@ main (int argc, char *argv[]) case 'f': /* --full */ fullname_g = TRUE; break; + case 'g': /* --group */ + grp_literal_g = TRUE; + break; case 'l': /* --label */ label_g = TRUE; break; @@ -1813,14 +1820,21 @@ main (int argc, char *argv[]) * If there are no arguments then list `/'. */ if (argno>=argc) { - H5Gget_objinfo(file, "/", TRUE, &sb); - sym_insert(&sb, "/"); - iter.container = "/"; - H5Giterate(file, "/", NULL, list, &iter); + if (grp_literal_g) { + root = H5Gopen(file, "/"); + iter.container = "/"; + list(root, "/", &iter); + H5Gclose(root); + } else { + H5Gget_objinfo(file, "/", TRUE, &sb); + sym_insert(&sb, "/"); + iter.container = "/"; + H5Giterate(file, "/", NULL, list, &iter); + } } else { for (/*void*/; argno<argc; argno++) { if (H5Gget_objinfo(file, argv[argno], TRUE, &sb)>=0 && - H5G_GROUP==sb.type) { + H5G_GROUP==sb.type && !grp_literal_g) { /* * Specified name is a group. List the complete contents of * the group. |