summaryrefslogtreecommitdiffstats
path: root/hl/src/H5LT.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
commit59b51a2ea72ff98586372a454adfd8c790a62734 (patch)
tree74173cf2dab79097c9dc8f116a22ad0138d310a2 /hl/src/H5LT.c
parent302830e60108513d9ff2e710444dc0d0188c92ee (diff)
downloadhdf5-59b51a2ea72ff98586372a454adfd8c790a62734.zip
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.gz
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.bz2
[svn-r14180] Description:
Make H5Aiterate() versioned and change all internal use to H5Aiterate2() Leave some regression tests that exercise H5Aiterate1() Fix attribute display in h5dump & h5ls to be "by name" by default 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 2.6 (smirom) 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, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'hl/src/H5LT.c')
-rw-r--r--hl/src/H5LT.c48
1 files changed, 17 insertions, 31 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index e26669f..6e47549 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1619,31 +1619,23 @@ herr_t H5LTset_attribute_double( hid_t loc_id,
*
*-------------------------------------------------------------------------
*/
-
-static herr_t find_attr( hid_t loc_id, const char *name, void *op_data)
+static herr_t
+find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
+ void *op_data)
{
+ int ret = H5_ITER_CONT;
- /* Define a default zero value for return. This will cause the iterator to continue if
- * the palette attribute is not found yet.
- */
-
- int ret = 0;
-
- char *attr_name = (char*)op_data;
-
- /* Shut the compiler up */
- loc_id=loc_id;
-
- /* Define a positive value for return value if the attribute was found. This will
- * cause the iterator to immediately return that positive value,
- * indicating short-circuit success
- */
-
- if( strcmp( name, attr_name ) == 0 )
- ret = 1;
+ /* Shut compiler up */
+ loc_id = loc_id; ainfo = ainfo;
+ /* Define a positive value for return value if the attribute was found. This will
+ * cause the iterator to immediately return that positive value,
+ * indicating short-circuit success
+ */
+ if(strcmp(name, (char *)op_data) == 0)
+ ret = H5_ITER_STOP;
- return ret;
+ return ret;
}
@@ -1680,7 +1672,7 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name )
* Date: June 21, 2001
*
* Comments:
- * The function uses H5Aiterate with the operator function find_attr
+ * The function uses H5Aiterate2 with the operator function find_attr
*
* Return:
* Success: The return value of the first operator that
@@ -1694,16 +1686,10 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name )
*-------------------------------------------------------------------------
*/
-herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name )
+herr_t
+H5LT_find_attribute( hid_t loc_id, const char* attr_name )
{
-
- unsigned int attr_num;
- herr_t ret;
-
- attr_num = 0;
- ret = H5Aiterate( loc_id, &attr_num, find_attr, (void *)attr_name );
-
- return ret;
+ return H5Aiterate2(loc_id, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name, H5P_DEFAULT);
}