summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-07-12 15:38:44 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-07-12 15:38:44 (GMT)
commitb54b3fcf290d532de381e135254dfc343d338d24 (patch)
tree167a494e2aff12bf3f95229fe72d4e4f00ccffe3 /tools/lib
parent4bba12dbee46b5ea8a383ec90b42ab98f722d9e1 (diff)
downloadhdf5-b54b3fcf290d532de381e135254dfc343d338d24.zip
hdf5-b54b3fcf290d532de381e135254dfc343d338d24.tar.gz
hdf5-b54b3fcf290d532de381e135254dfc343d338d24.tar.bz2
[svn-r22563] HDFFV-8095: index order of links wrong
Create setters for indexing options in h5trav.c to be set before the obj table is created. Revert h5trav_print to remove now duplicated parameters. Added test and testfiles. Tested: local linux with cmake
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5trav.c22
-rw-r--r--tools/lib/h5trav.h3
2 files changed, 20 insertions, 5 deletions
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 833b8c4..170e612 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -67,6 +67,23 @@ static void trav_table_addlink(trav_table_t *table,
static H5_index_t trav_index_by = H5_INDEX_NAME;
static H5_iter_order_t trav_index_order = H5_ITER_INC;
+
+/*-------------------------------------------------------------------------
+ * Function: h5trav_set_index
+ *
+ * Purpose: Set indexing properties for the objects & links in the file
+ *
+ * Return: none
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order)
+{
+ trav_index_by = print_index_by;
+ trav_index_order = print_index_order;
+}
+
/*-------------------------------------------------------------------------
* "h5trav info" public functions. used in h5diff
*-------------------------------------------------------------------------
@@ -955,14 +972,11 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
*/
int
-h5trav_print(hid_t fid, H5_index_t print_index_by, H5_iter_order_t print_index_order)
+h5trav_print(hid_t fid)
{
trav_print_udata_t print_udata; /* User data for traversal */
trav_visitor_t print_visitor; /* Visitor structure for printing objects */
- trav_index_by = print_index_by;
- trav_index_order = print_index_order;
-
/* Init user data for printing */
print_udata.fid = fid;
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index 7311897..ce44bc9 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -131,6 +131,7 @@ extern "C" {
* "h5trav general" public functions
*-------------------------------------------------------------------------
*/
+H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order);
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);
@@ -158,7 +159,7 @@ H5TOOLS_DLL int h5trav_getindext(const char *obj, const trav_table_t *travt);
* "h5trav print" public functions
*-------------------------------------------------------------------------
*/
-H5TOOLS_DLL int h5trav_print(hid_t fid, H5_index_t print_index_by, H5_iter_order_t print_index_order);
+H5TOOLS_DLL int h5trav_print(hid_t fid);
#ifdef __cplusplus
}