2003-04-01 02:10:51 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 02:10:51 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-04-01 02:10:51 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
2001-03-09 04:18:42 +08:00
|
|
|
|
/*
|
|
|
|
|
* Programmer: Bill Wendling <wendling@ncsa.uiuc.edu>
|
|
|
|
|
* Tuesday, 6. March 2001
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Portions of this work are derived from _Obfuscated C and Other Mysteries_,
|
|
|
|
|
* by Don Libes, copyright (c) 1993 by John Wiley & Sons, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#include "h5tools_utils.h"
|
|
|
|
|
#include "H5private.h"
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
#include "h5trav.h"
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
/* global variables */
|
|
|
|
|
int nCols = 80;
|
|
|
|
|
|
|
|
|
|
/* ``get_option'' variables */
|
|
|
|
|
int opt_err = 1; /*get_option prints errors if this is on */
|
|
|
|
|
int opt_ind = 1; /*token pointer */
|
|
|
|
|
const char *opt_arg; /*flag argument (or value) */
|
|
|
|
|
|
|
|
|
|
/* local functions */
|
2005-08-26 04:16:40 +08:00
|
|
|
|
static void init_table(table_t **tbl);
|
|
|
|
|
#ifdef H5DUMP_DEBUG
|
|
|
|
|
static void dump_table(char* tablename, table_t *table);
|
|
|
|
|
#endif /* H5DUMP_DEBUG */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t recorded);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Function: error_msg
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Purpose: Print a nicely formatted error message to stderr flushing the
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* stdout stream first.
|
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Return: Nothing
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Programmer: Bill Wendling
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* Tuesday, 20. February 2001
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
error_msg(const char *progname, const char *fmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfflush(stdout);
|
|
|
|
|
HDfprintf(stderr, "%s error: ", progname);
|
|
|
|
|
HDvfprintf(stderr, fmt, ap);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2001-03-09 04:18:42 +08:00
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Function: warn_msg
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Purpose: Print a nicely formatted warning message to stderr flushing
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* the stdout stream first.
|
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Return: Nothing
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Programmer: Bill Wendling
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* Tuesday, 20. February 2001
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
warn_msg(const char *progname, const char *fmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfflush(stdout);
|
|
|
|
|
HDfprintf(stderr, "%s warning: ", progname);
|
|
|
|
|
HDvfprintf(stderr, fmt, ap);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Function: get_option
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Purpose: Determine the command-line options a user specified. We can
|
|
|
|
|
* accept both short and long type command-lines.
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Return: Success: The short valued "name" of the command line
|
|
|
|
|
* parameter or EOF if there are no more
|
|
|
|
|
* parameters to process.
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Failure: A question mark.
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* Programmer: Bill Wendling
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* Friday, 5. January 2001
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
|
|
|
|
|
{
|
|
|
|
|
static int sp = 1; /* character index in current token */
|
|
|
|
|
int opt_opt = '?'; /* option character passed back to user */
|
|
|
|
|
|
|
|
|
|
if (sp == 1) {
|
|
|
|
|
/* check for more flag-like tokens */
|
|
|
|
|
if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
|
|
|
|
|
return EOF;
|
2001-06-19 04:22:10 +08:00
|
|
|
|
} else if (HDstrcmp(argv[opt_ind], "--") == 0) {
|
2001-03-09 04:18:42 +08:00
|
|
|
|
opt_ind++;
|
|
|
|
|
return EOF;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
|
|
|
|
|
/* long command line option */
|
|
|
|
|
const char *arg = &argv[opt_ind][2];
|
2001-06-19 04:22:10 +08:00
|
|
|
|
int i;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
for (i = 0; l_opts && l_opts[i].name; i++) {
|
2001-06-19 04:22:10 +08:00
|
|
|
|
size_t len = HDstrlen(l_opts[i].name);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
2001-06-19 04:22:10 +08:00
|
|
|
|
if (HDstrncmp(arg, l_opts[i].name, len) == 0) {
|
2001-03-09 04:18:42 +08:00
|
|
|
|
/* we've found a matching long command line flag */
|
|
|
|
|
opt_opt = l_opts[i].shortval;
|
|
|
|
|
|
|
|
|
|
if (l_opts[i].has_arg != no_arg) {
|
|
|
|
|
if (arg[len] == '=') {
|
|
|
|
|
opt_arg = &arg[len + 1];
|
|
|
|
|
} else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') {
|
|
|
|
|
opt_arg = argv[++opt_ind];
|
|
|
|
|
} else if (l_opts[i].has_arg == require_arg) {
|
|
|
|
|
if (opt_err)
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr,
|
2001-03-09 04:18:42 +08:00
|
|
|
|
"%s: option required for \"--%s\" flag\n",
|
|
|
|
|
argv[0], arg);
|
|
|
|
|
|
|
|
|
|
opt_opt = '?';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (arg[len] == '=') {
|
|
|
|
|
if (opt_err)
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr,
|
2001-03-09 04:18:42 +08:00
|
|
|
|
"%s: no option required for \"%s\" flag\n",
|
|
|
|
|
argv[0], arg);
|
|
|
|
|
|
|
|
|
|
opt_opt = '?';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opt_arg = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (l_opts[i].name == NULL) {
|
|
|
|
|
/* exhausted all of the l_opts we have and still didn't match */
|
|
|
|
|
if (opt_err)
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
opt_opt = '?';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opt_ind++;
|
|
|
|
|
sp = 1;
|
|
|
|
|
} else {
|
|
|
|
|
register char *cp; /* pointer into current token */
|
|
|
|
|
|
|
|
|
|
/* short command line option */
|
|
|
|
|
opt_opt = argv[opt_ind][sp];
|
|
|
|
|
|
|
|
|
|
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) {
|
|
|
|
|
if (opt_err)
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr, "%s: unknown option \"%c\"\n",
|
2001-03-09 04:18:42 +08:00
|
|
|
|
argv[0], opt_opt);
|
|
|
|
|
|
|
|
|
|
/* if no chars left in this token, move to next token */
|
|
|
|
|
if (argv[opt_ind][++sp] == '\0') {
|
|
|
|
|
opt_ind++;
|
|
|
|
|
sp = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return '?';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (*++cp == ':') {
|
|
|
|
|
/* if a value is expected, get it */
|
|
|
|
|
if (argv[opt_ind][sp + 1] != '\0') {
|
|
|
|
|
/* flag value is rest of current token */
|
|
|
|
|
opt_arg = &argv[opt_ind++][sp + 1];
|
|
|
|
|
} else if (++opt_ind >= argc) {
|
|
|
|
|
if (opt_err)
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr,
|
2001-03-09 04:18:42 +08:00
|
|
|
|
"%s: value expected for option \"%c\"\n",
|
|
|
|
|
argv[0], opt_opt);
|
|
|
|
|
|
|
|
|
|
opt_opt = '?';
|
|
|
|
|
} else {
|
|
|
|
|
/* flag value is next token */
|
|
|
|
|
opt_arg = argv[opt_ind++];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sp = 1;
|
|
|
|
|
} else {
|
|
|
|
|
/* set up to look at next char in token, next time */
|
|
|
|
|
if (argv[opt_ind][++sp] == '\0') {
|
|
|
|
|
/* no more in current token, so setup next token */
|
|
|
|
|
opt_ind++;
|
|
|
|
|
sp = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opt_arg = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* return the current flag character found */
|
|
|
|
|
return opt_opt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: indentation
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Print spaces for indentation
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
indentation(int x)
|
|
|
|
|
{
|
|
|
|
|
if (x < nCols) {
|
|
|
|
|
while (x-- > 0)
|
|
|
|
|
printf(" ");
|
|
|
|
|
} else {
|
2001-06-19 04:22:10 +08:00
|
|
|
|
HDfprintf(stderr, "error: the indentation exceeds the number of cols.\n");
|
2001-03-09 04:18:42 +08:00
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: print_version
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Print the program name and the version information which is
|
2006-12-07 05:14:39 +08:00
|
|
|
|
* defined the same as the HDF5 library version.
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: unknown
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
print_version(const char *progname)
|
|
|
|
|
{
|
|
|
|
|
printf("%s: Version %u.%u.%u%s%s\n",
|
|
|
|
|
progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
|
|
|
|
|
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: init_table
|
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
|
* Purpose: allocate and initialize tables for shared groups, datasets,
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* and committed types
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2005-08-26 04:16:40 +08:00
|
|
|
|
static void
|
2001-03-09 04:18:42 +08:00
|
|
|
|
init_table(table_t **tbl)
|
|
|
|
|
{
|
2001-06-19 04:22:10 +08:00
|
|
|
|
table_t *table = HDmalloc(sizeof(table_t));
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
table->size = 20;
|
|
|
|
|
table->nobjs = 0;
|
2001-06-19 04:22:10 +08:00
|
|
|
|
table->objs = HDmalloc(table->size * sizeof(obj_t));
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
*tbl = table;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Function: free_table
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Purpose: free tables for shared groups, datasets,
|
|
|
|
|
* and committed types
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Programmer: Paul Harten
|
|
|
|
|
*
|
2001-03-09 04:18:42 +08:00
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
2005-08-26 04:16:40 +08:00
|
|
|
|
free_table(table_t *table)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
2005-08-26 04:16:40 +08:00
|
|
|
|
unsigned u; /* Local index value */
|
|
|
|
|
|
|
|
|
|
/* Free the names for the objects in the table */
|
|
|
|
|
for(u = 0; u < table->nobjs; u++)
|
|
|
|
|
if(table->objs[u].objname)
|
|
|
|
|
HDfree(table->objs[u].objname);
|
|
|
|
|
|
|
|
|
|
HDfree(table->objs);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
#ifdef H5DUMP_DEBUG
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Function: dump_table
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Purpose: display the contents of tables for debugging purposes
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
dump_table(char* tablename, table_t *table)
|
|
|
|
|
{
|
|
|
|
|
unsigned u;
|
|
|
|
|
|
|
|
|
|
printf("%s: # of entries = %d\n", tablename,table->nobjs);
|
|
|
|
|
for (u = 0; u < table->nobjs; u++)
|
2006-12-07 05:14:39 +08:00
|
|
|
|
HDfprintf(stdout,"%a %s %d %d\n", table->objs[u].objno,
|
|
|
|
|
table->objs[u].objname,
|
|
|
|
|
table->objs[u].displayed, table->objs[u].recorded);
|
2005-08-26 04:16:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: dump_tables
|
|
|
|
|
*
|
|
|
|
|
* Purpose: display the contents of tables for debugging purposes
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
void
|
2005-08-26 04:16:40 +08:00
|
|
|
|
dump_tables(find_objs_t *info)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
2005-08-26 04:16:40 +08:00
|
|
|
|
dump_table("group_table", info->group_table);
|
|
|
|
|
dump_table("dset_table", info->dset_table);
|
|
|
|
|
dump_table("type_table", info->type_table);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
2005-08-26 04:16:40 +08:00
|
|
|
|
#endif /* H5DUMP_DEBUG */
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: search_obj
|
|
|
|
|
*
|
|
|
|
|
* Purpose: search the object specified by objno in the table
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: an integer, the location of the object
|
|
|
|
|
*
|
|
|
|
|
* Failure: FAIL if object is not found
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2005-08-26 04:16:40 +08:00
|
|
|
|
obj_t *
|
2003-08-09 03:39:10 +08:00
|
|
|
|
search_obj(table_t *table, haddr_t objno)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
2005-08-26 04:16:40 +08:00
|
|
|
|
unsigned u;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
for(u = 0; u < table->nobjs; u++)
|
|
|
|
|
if(table->objs[u].objno == objno)
|
|
|
|
|
return &(table->objs[u]);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
return NULL;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: find_objs_cb
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Callback to find objects, committed types and store them in tables
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: Success: SUCCEED
|
|
|
|
|
*
|
|
|
|
|
* Failure: FAIL
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2005-08-26 04:16:40 +08:00
|
|
|
|
static herr_t
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen,
|
|
|
|
|
void *op_data)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
|
|
|
|
find_objs_t *info = (find_objs_t*)op_data;
|
2005-08-26 04:16:40 +08:00
|
|
|
|
herr_t ret_value = 0;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
switch(oinfo->type) {
|
|
|
|
|
case H5O_TYPE_GROUP:
|
|
|
|
|
if(NULL == already_seen)
|
|
|
|
|
add_obj(info->group_table, oinfo->addr, name, TRUE);
|
|
|
|
|
break;
|
2005-08-26 04:16:40 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
case H5O_TYPE_DATASET:
|
|
|
|
|
if(NULL == already_seen) {
|
|
|
|
|
hid_t dset;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
/* Add the dataset to the list of objects */
|
|
|
|
|
add_obj(info->dset_table, oinfo->addr, name, TRUE);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
/* Check for a dataset that uses a named datatype */
|
|
|
|
|
if((dset = H5Dopen2(info->fid, name, H5P_DEFAULT)) >= 0) {
|
|
|
|
|
hid_t type = H5Dget_type(dset);
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
if(H5Tcommitted(type) > 0) {
|
|
|
|
|
H5O_info_t type_oinfo;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
H5Oget_info(type, &type_oinfo);
|
|
|
|
|
if(search_obj(info->type_table, type_oinfo.addr) == NULL)
|
|
|
|
|
add_obj(info->type_table, type_oinfo.addr, name, FALSE);
|
2007-09-13 23:44:56 +08:00
|
|
|
|
} /* end if */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
H5Tclose(type);
|
|
|
|
|
H5Dclose(dset);
|
|
|
|
|
} /* end if */
|
|
|
|
|
else
|
|
|
|
|
ret_value = FAIL;
|
|
|
|
|
} /* end if */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case H5O_TYPE_NAMED_DATATYPE:
|
|
|
|
|
{
|
|
|
|
|
obj_t *found_obj;
|
|
|
|
|
|
|
|
|
|
if((found_obj = search_obj(info->type_table, oinfo->addr)) == NULL)
|
|
|
|
|
add_obj(info->type_table, oinfo->addr, name, TRUE);
|
|
|
|
|
else {
|
|
|
|
|
/* Use latest version of name */
|
|
|
|
|
HDfree(found_obj->objname);
|
|
|
|
|
found_obj->objname = HDstrdup(name);
|
|
|
|
|
|
|
|
|
|
/* Mark named datatype as having valid name */
|
|
|
|
|
found_obj->recorded = TRUE;
|
|
|
|
|
} /* end else */
|
|
|
|
|
break;
|
2005-11-16 08:46:30 +08:00
|
|
|
|
}
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
} /* end switch */
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
return ret_value;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Function: init_objs
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Purpose: Initialize tables for groups, datasets & named datatypes
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: Success: SUCCEED
|
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Failure: FAIL
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Programmer: Ruey-Hsia Li
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
2005-08-26 04:16:40 +08:00
|
|
|
|
* Modifications:
|
2001-03-09 04:18:42 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2005-08-26 04:16:40 +08:00
|
|
|
|
herr_t
|
|
|
|
|
init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
|
|
|
|
|
table_t **dset_table, table_t **type_table)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
2005-08-26 04:16:40 +08:00
|
|
|
|
/* Initialize the tables */
|
|
|
|
|
init_table(group_table);
|
|
|
|
|
init_table(dset_table);
|
|
|
|
|
init_table(type_table);
|
|
|
|
|
|
|
|
|
|
/* Init the find_objs_t */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
info->fid = fid;
|
2005-08-26 04:16:40 +08:00
|
|
|
|
info->group_table = *group_table;
|
|
|
|
|
info->type_table = *type_table;
|
|
|
|
|
info->dset_table = *dset_table;
|
|
|
|
|
|
|
|
|
|
/* Find all shared objects */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
return(h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info));
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: add_obj
|
|
|
|
|
*
|
|
|
|
|
* Purpose: add a shared object to the table
|
|
|
|
|
* realloc the table if necessary
|
|
|
|
|
*
|
|
|
|
|
* Return: void
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Ruey-Hsia Li
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static void
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record)
|
2001-03-09 04:18:42 +08:00
|
|
|
|
{
|
2005-08-26 04:16:40 +08:00
|
|
|
|
unsigned u;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
/* See if we need to make table larger */
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
if(table->nobjs == table->size) {
|
2001-03-09 04:18:42 +08:00
|
|
|
|
table->size *= 2;
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
table->objs = HDrealloc(table->objs, table->size * sizeof(table->objs[0]));
|
|
|
|
|
} /* end if */
|
2001-03-09 04:18:42 +08:00
|
|
|
|
|
2005-08-26 04:16:40 +08:00
|
|
|
|
/* Increment number of objects in table */
|
|
|
|
|
u = table->nobjs++;
|
|
|
|
|
|
|
|
|
|
/* Set information about object */
|
|
|
|
|
table->objs[u].objno = objno;
|
[svn-r14284] Description:
Add H5Lvisit_by_name() API routine to library.
Eliminated all (five!) other group traversal routines and changed them
all to use the new API routine.
Cleaned up output of h5ls & h5stat:
- Issue error when requesting recursive traversal of a file
with the "group info" flag, but no group given
- Print info about root group in all(?) appropriate situations
- Don't print "verbose" information about root group until the
root group is in the list of objects to display
(mostly because h5ls & h5stat had a different twist on traversing the
groups in a file that the other utilities)
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-25 00:49:36 +08:00
|
|
|
|
table->objs[u].objname = HDstrdup(objname);
|
2005-08-26 04:16:40 +08:00
|
|
|
|
table->objs[u].recorded = record;
|
|
|
|
|
table->objs[u].displayed = 0;
|
2001-03-09 04:18:42 +08:00
|
|
|
|
}
|
2005-02-09 04:55:17 +08:00
|
|
|
|
|
2005-08-10 00:53:43 +08:00
|
|
|
|
|
|
|
|
|
#ifndef H5_HAVE_TMPFILE
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: tmpfile
|
|
|
|
|
*
|
|
|
|
|
* Purpose: provide tmpfile() function when it is not supported by the
|
|
|
|
|
* system. Always return NULL for now.
|
|
|
|
|
*
|
|
|
|
|
* Return: a stream description when succeeds.
|
|
|
|
|
* NULL if fails.
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Albert Cheng, 2005/8/9
|
|
|
|
|
*
|
|
|
|
|
* Modifications:
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
FILE *
|
|
|
|
|
tmpfile(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|