summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5trav.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-17 12:45:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-17 12:45:55 (GMT)
commit6747ebd9858374ae912b6182024861b1710518c8 (patch)
tree9bd75142d9dd292fe4272118f650f1c91205a988 /tools/lib/h5trav.h
parent9de3a84f916168831f29a4259fe93cb4823d8f57 (diff)
downloadhdf5-6747ebd9858374ae912b6182024861b1710518c8.zip
hdf5-6747ebd9858374ae912b6182024861b1710518c8.tar.gz
hdf5-6747ebd9858374ae912b6182024861b1710518c8.tar.bz2
[svn-r19413] Description:
Bring r19349:19411 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'tools/lib/h5trav.h')
-rw-r--r--tools/lib/h5trav.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index bb31461..8eb93fa 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -36,7 +36,7 @@ typedef herr_t (*h5trav_lnk_func_t)(const char *path_name, const H5L_info_t *lin
*-------------------------------------------------------------------------
*/
typedef enum {
- H5TRAV_TYPE_UNKNOWN = -1, /* Unknown object type */
+ H5TRAV_TYPE_UNKNOWN = -1, /* Unknown object type */
H5TRAV_TYPE_GROUP, /* Object is a group */
H5TRAV_TYPE_DATASET, /* Object is a dataset */
H5TRAV_TYPE_NAMED_DATATYPE, /* Object is a named datatype */
@@ -48,6 +48,20 @@ typedef enum {
* public struct to store name and type of an object
*-------------------------------------------------------------------------
*/
+/* Struct to keep track of symbolic link targets visited.
+ * Functions: symlink_visit_add() and symlink_is_visited()
+ */
+typedef struct symlink_trav_t {
+ size_t nalloc;
+ size_t nused;
+ struct {
+ H5L_type_t type;
+ char *file;
+ char *path;
+ } *objs;
+ hbool_t dangle_link;
+} symlink_trav_t;
+
typedef struct trav_path_t {
char *path;
h5trav_type_t type;
@@ -56,7 +70,11 @@ typedef struct trav_path_t {
typedef struct trav_info_t {
size_t nalloc;
size_t nused;
+ const char *fname;
+ hid_t fid; /* File ID */
trav_path_t *paths;
+ symlink_trav_t symlink_visited; /* already visited symbolic links */
+ void * opts; /* optional data passing */
} trav_info_t;
@@ -110,9 +128,11 @@ extern "C" {
* "h5trav general" public functions
*-------------------------------------------------------------------------
*/
-H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_start,
- hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk,
- void *udata);
+H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name,
+ hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj,
+ h5trav_lnk_func_t visit_lnk, void *udata);
+H5TOOLS_DLL herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path);
+H5TOOLS_DLL hbool_t symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path);
/*-------------------------------------------------------------------------
* "h5trav info" public functions
@@ -120,6 +140,8 @@ H5TOOLS_DLL int h5trav_visit(hid_t file_id, const char *grp_name, hbool_t visit_
*/
H5TOOLS_DLL int h5trav_getinfo(hid_t file_id, trav_info_t *info);
H5TOOLS_DLL ssize_t h5trav_getindex(const trav_info_t *info, const char *obj);
+H5TOOLS_DLL int trav_info_visit_obj (const char *path, const H5O_info_t *oinfo, const char *already_visited, void *udata);
+H5TOOLS_DLL int trav_info_visit_lnk (const char *path, const H5L_info_t *linfo, void *udata);
/*-------------------------------------------------------------------------
* "h5trav table" public functions
@@ -144,10 +166,12 @@ H5TOOLS_DLL int h5trav_print(hid_t fid);
*-------------------------------------------------------------------------
*/
-H5TOOLS_DLL void trav_info_init(trav_info_t **info);
+H5TOOLS_DLL void trav_info_init(const char *filename, hid_t fileid, trav_info_t **info);
H5TOOLS_DLL void trav_info_free(trav_info_t *info);
+H5TOOLS_DLL void trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type);
+
/*-------------------------------------------------------------------------
* table private functions
*-------------------------------------------------------------------------