diff options
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5IM.c | 44 | ||||
-rw-r--r-- | hl/src/H5LT.c | 48 |
2 files changed, 32 insertions, 60 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 30a479e..70baf26 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -166,30 +166,23 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * *------------------------------------------------------------------------- */ - -static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) +static herr_t +find_palette(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; - - /* Shut compiler */ - loc_id=loc_id; - op_data=op_data; - - /* 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, "PALETTE" ) == 0 ) - ret = 1; + /* Shut compiler up */ + loc_id = loc_id; ainfo = ainfo; op_data = op_data; + /* 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, "PALETTE") == 0) + ret = H5_ITER_STOP; - return ret; + return ret; } @@ -205,7 +198,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) * Date: May 11, 2001 * * Comments: - * The function uses H5Aiterate with the operator function find_palette + * The function uses H5Aiterate2 with the operator function find_palette * * Modifications: * @@ -214,14 +207,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) herr_t H5IM_find_palette( hid_t loc_id ) { - - unsigned int attr_num; /* Starting attribute to look up */ - herr_t ret; - - attr_num = 0; - ret = H5Aiterate( loc_id, &attr_num, find_palette, 0 ); - - return ret; + return H5Aiterate2(loc_id, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, find_palette, NULL, H5P_DEFAULT); } 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); } |