summaryrefslogtreecommitdiffstats
path: root/hl/src/H5IM.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 19:29:58 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 19:29:58 (GMT)
commitbb3afd50c2e94cf2db558218c6704dcc285c72e9 (patch)
treeadd60605c7c88c64582acde6b3e84051f72ea27b /hl/src/H5IM.c
parent3db40827da29243b88ade3c3f174f3f5e6cd0622 (diff)
downloadhdf5-bb3afd50c2e94cf2db558218c6704dcc285c72e9.zip
hdf5-bb3afd50c2e94cf2db558218c6704dcc285c72e9.tar.gz
hdf5-bb3afd50c2e94cf2db558218c6704dcc285c72e9.tar.bz2
[svn-r14185] Description:
Move H5Aopen_name() routine to deprecated symbol section and replace internal usage with H5Aopen(). Add simple regression test for H5Aopen_name() to deprecated routine test. 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
Diffstat (limited to 'hl/src/H5IM.c')
-rw-r--r--hl/src/H5IM.c143
1 files changed, 70 insertions, 73 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index 70baf26..e6bd506 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -253,29 +253,29 @@ herr_t H5IMget_image_info( hid_t loc_id,
*npals = 0;
/* Open the dataset. */
- if ( (did = H5Dopen( loc_id, dset_name )) < 0 )
+ if((did = H5Dopen(loc_id, dset_name)) < 0)
return -1;
/* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */
- has_attr = H5LT_find_attribute( did, "INTERLACE_MODE" );
+ has_attr = H5LT_find_attribute(did, "INTERLACE_MODE");
/* It exists, get it */
- if ( has_attr == 1 )
+ if(has_attr == 1)
{
- if ( (attr_id = H5Aopen_name( did, "INTERLACE_MODE" )) < 0 )
+ if((attr_id = H5Aopen(did, ".", "INTERLACE_MODE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( H5Aread( attr_id, attr_type, interlace ) < 0 )
+ if(H5Aread(attr_id, attr_type, interlace) < 0)
goto out;
- if ( H5Tclose( attr_type ) < 0 )
+ if(H5Tclose(attr_type) < 0)
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
}
@@ -327,23 +327,23 @@ herr_t H5IMget_image_info( hid_t loc_id,
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
- has_pal = H5IM_find_palette( did );
+ has_pal = H5IM_find_palette(did);
- if ( has_pal == 1 )
+ if(has_pal == 1)
{
- if ( (attr_id = H5Aopen_name( did, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(did, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Check if it is really a reference */
- if ( attr_class == H5T_REFERENCE )
+ if(attr_class == H5T_REFERENCE)
{
/* Get the reference(s) */
@@ -563,7 +563,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
goto out;
if ( H5Tclose( attr_type ) < 0 )
goto out;
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
}
@@ -572,23 +572,22 @@ herr_t H5IMlink_palette( hid_t loc_id,
* The attribute already exists, open it
*-------------------------------------------------------------------------
*/
- else if ( ok_pal == 1 )
-
+ else if(ok_pal == 1)
{
- if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Get and save the old reference(s) */
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
- n_refs = H5Sget_simple_extent_npoints( attr_space_id );
+ n_refs = H5Sget_simple_extent_npoints(attr_space_id);
dim_ref = n_refs + 1;
@@ -699,29 +698,29 @@ herr_t H5IMunlink_palette( hid_t loc_id,
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
- ok_pal = H5LT_find_attribute( image_id, "PALETTE" );
+ ok_pal = H5LT_find_attribute(image_id, "PALETTE");
/* It does not exist. Nothing to do */
- if ( ok_pal == 0 )
+ if(ok_pal == 0)
return -1;
/* The attribute exists, open it */
- else if ( ok_pal == 1 )
+ else if(ok_pal == 1)
{
- if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Check if it is really a reference */
- if ( attr_class == H5T_REFERENCE )
+ if(attr_class == H5T_REFERENCE)
{
- /* Deelete the attribute */
+ /* Delete the attribute */
if(H5Adelete2(image_id, ".", "PALETTE", H5P_DEFAULT) < 0)
goto out;
@@ -781,29 +780,29 @@ herr_t H5IMget_npalettes( hid_t loc_id,
*npals = 0;
/* Open the dataset. */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0 )
+ if((image_id = H5Dopen(loc_id, image_name)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
- has_pal = H5IM_find_palette( image_id );
+ has_pal = H5IM_find_palette(image_id);
- if ( has_pal == 1 )
+ if(has_pal == 1 )
{
- if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Check if it is really a reference */
- if ( attr_class == H5T_REFERENCE )
+ if(attr_class == H5T_REFERENCE)
{
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
*npals = H5Sget_simple_extent_npoints( attr_space_id );
@@ -874,28 +873,28 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hsize_t pal_maxdims[2];
/* Open the dataset. */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0 )
+ if((image_id = H5Dopen(loc_id, image_name)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
- has_pal = H5IM_find_palette( image_id );
+ has_pal = H5IM_find_palette(image_id);
- if ( has_pal == 1 )
+ if(has_pal == 1)
{
- if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Get the reference(s) */
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
- n_refs = H5Sget_simple_extent_npoints( attr_space_id );
+ n_refs = H5Sget_simple_extent_npoints(attr_space_id);
dim_ref = n_refs;
@@ -986,28 +985,28 @@ herr_t H5IMget_palette( hid_t loc_id,
hid_t pal_id;
/* Open the dataset. */
- if ( (image_id = H5Dopen( loc_id, image_name )) < 0 )
+ if((image_id = H5Dopen(loc_id, image_name)) < 0)
return -1;
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
- has_pal = H5IM_find_palette( image_id );
+ has_pal = H5IM_find_palette(image_id);
- if ( has_pal == 1 )
+ if(has_pal == 1 )
{
- if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 )
+ if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Get the reference(s) */
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
- n_refs = H5Sget_simple_extent_npoints( attr_space_id );
+ n_refs = H5Sget_simple_extent_npoints(attr_space_id);
dim_ref = n_refs;
@@ -1089,30 +1088,29 @@ herr_t H5IMis_image( hid_t loc_id,
return -1;
/* Try to find the attribute "CLASS" on the dataset */
- has_class = H5LT_find_attribute( did, "CLASS" );
+ has_class = H5LT_find_attribute(did, "CLASS");
- if ( has_class == 0 )
+ if(has_class == 0)
{
- H5Dclose( did );
+ H5Dclose(did);
return 0;
}
-
- else if ( has_class == 1 )
+ else if(has_class == 1)
{
- if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 )
+ if((attr_id = H5Aopen(did, ".", "CLASS", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( H5Tget_class( attr_type ) < 0 )
+ if(H5Tget_class(attr_type) < 0)
goto out;
- if ( H5Aread( attr_id, attr_type, attr_data ) < 0 )
+ if(H5Aread(attr_id, attr_type, attr_data) < 0)
goto out;
- if( strcmp( attr_data, IMAGE_CLASS ) == 0 )
+ if(strcmp(attr_data, IMAGE_CLASS) == 0)
ret = 1;
else
ret = 0;
@@ -1175,30 +1173,29 @@ herr_t H5IMis_palette( hid_t loc_id,
return -1;
/* Try to find the attribute "CLASS" on the dataset */
- has_class = H5LT_find_attribute( did, "CLASS" );
+ has_class = H5LT_find_attribute(did, "CLASS");
- if ( has_class == 0 )
+ if(has_class == 0)
{
H5Dclose( did );
return 0;
}
-
- else if ( has_class == 1 )
+ else if(has_class == 1)
{
- if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 )
+ if((attr_id = H5Aopen(did, ".", "CLASS", H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if ( (attr_type = H5Aget_type( attr_id )) < 0 )
+ if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( H5Tget_class( attr_type ) < 0 )
+ if(H5Tget_class(attr_type) < 0)
goto out;
- if ( H5Aread( attr_id, attr_type, attr_data ) < 0 )
+ if(H5Aread(attr_id, attr_type, attr_data) < 0)
goto out;
- if( strcmp( attr_data, PALETTE_CLASS ) == 0 )
+ if(strcmp(attr_data, PALETTE_CLASS) == 0)
ret = 1;
else
ret = 0;