diff options
author | Robb Matzke <matzke@llnl.gov> | 1999-04-15 19:57:50 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1999-04-15 19:57:50 (GMT) |
commit | 43c356f93dd4beb691abf8e5acb692438a5f8f00 (patch) | |
tree | 5c62c13f1c836def696b3bcc31b02df76aa7faea /tools/h5ls.c | |
parent | 77d7a3328b044ae71a03bfc6aaac2af4d6eac923 (diff) | |
download | hdf5-43c356f93dd4beb691abf8e5acb692438a5f8f00.zip hdf5-43c356f93dd4beb691abf8e5acb692438a5f8f00.tar.gz hdf5-43c356f93dd4beb691abf8e5acb692438a5f8f00.tar.bz2 |
[svn-r1184] Changes since 19990402
----------------------
./config/commence.in
./config/conclude.in
./test/Makefile.in
./tools/Makefile.in
Fixed so private libraries are not installed publicly.
The installation directories `bin', `include', and `lib' are
created mode 755.
./src/H5.c
./src/H5A.c
./src/H5F.c
./src/H5Fcore.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fmpio.c
./src/H5Fsec2.c
./src/H5Fstdio.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5HG.c
./src/H5HL.c
./src/H5O.c
./src/H5Oattr.c
./src/H5Ocomp.c
./src/H5Ocont.c
./src/H5Odtype.c
./src/H5Oefl.c
./src/H5Ofill.c
./src/H5Olayout.c
./src/H5Omtime.c
./src/H5Oname.c
./src/H5Osdspace.c
./src/H5Oshared.c
./src/H5Ostab.c
./src/H5R.c
./src/H5Sall.c
./src/H5Shyper.c
./src/H5Smpio.c
./src/H5Snone.c
./src/H5Spoint.c
./src/H5T.c
./src/H5Tconv.c
./src/H5Vprivate.h
./src/H5Z.c
./src/H5detect.c
./src/H5private.h
./test/chunk.c
./test/dsets.c
./test/dtypes.c
./test/h5test.c
./test/overhead.c
./test/ragged.c
./test/tattr.c
./tools/h5dump.c
./tools/h5findshd.c
./tools/h5ls.c
Changed `__unused__' to `UNUSED' to fix a conflict with GNU
header files.
./src/H5Tpkg.h
./test/h5test.h
Removed __unused__ from forward function declarations.
./src/H5P.c
Removed a comment about restrictions for the type conversion
temporary buffers. Thanks to Quincey, the comment no longer
applied.
./src/H5T.c
Relaxed the H5Tpack() a little so it would pack compound data
structures that had non-transient atomic members.
./tools/h5ls.c
Added a `-g' (or `--group') flag that causes information to be
printed about the specified group instead of the group's
contents. (sort of like Unix's `ls -d'). The `-g' can be used
in combination with `-r' to print information about the group
and its contents.
Diffstat (limited to 'tools/h5ls.c')
-rw-r--r-- | tools/h5ls.c | 40 |
1 files changed, 27 insertions, 13 deletions
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. |