summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-17 12:48:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-17 12:48:04 (GMT)
commit13c484162cc9098e6538deec931563848011bdb5 (patch)
treec33201bfab0f74c7e3bff9b17a55d92deb852118 /fortran/src
parentbe729e5f78ae9308dd4a305039e8ddd58068d477 (diff)
downloadhdf5-13c484162cc9098e6538deec931563848011bdb5.zip
hdf5-13c484162cc9098e6538deec931563848011bdb5.tar.gz
hdf5-13c484162cc9098e6538deec931563848011bdb5.tar.bz2
[svn-r14206] Description:
Make H5Pget_filter API versioned and switch internal usage to H5Pget_filter2. Add regression test for H5Pget_filter1. 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 'fortran/src')
-rw-r--r--fortran/src/H5Pf.c70
1 files changed, 31 insertions, 39 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index 3f8bebf..02864fe 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -1520,7 +1520,7 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters)
/*----------------------------------------------------------------------------
* Name: h5pget_filter_c
- * Purpose: Call H5Pget_filter to get information about a filter
+ * Purpose: Call H5Pget_filter2 to get information about a filter
* in a pipeline
* Inputs: prp_id - property list identifier
* filter_number - Sequence number within the filter
@@ -1541,51 +1541,43 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters)
int_f
nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id)
{
- int ret_value = -1;
- hid_t c_prp_id;
- unsigned c_filter_number;
- unsigned int c_flags;
- size_t c_cd_nelmts, c_namelen;
- size_t c_cd_nelmts_in;
- H5Z_filter_t c_filter;
- unsigned int * c_cd_values;
- char* c_name;
- unsigned i;
-
- c_cd_nelmts_in = (size_t)*cd_nelmts;
- c_namelen = (size_t)*namelen;
- c_name = (char*)malloc(sizeof(char)*c_namelen);
- if (!c_name) return ret_value;
-
- c_cd_values = (unsigned int*)malloc(sizeof(unsigned int)*((int)c_cd_nelmts_in));
- if (!c_cd_values) {HDfree(c_name);
- return ret_value;
- }
+ unsigned int c_flags;
+ size_t c_cd_nelmts;
+ size_t c_cd_nelmts_in = (size_t)*cd_nelmts;
+ H5Z_filter_t c_filter;
+ unsigned int *c_cd_values = NULL;
+ char *c_name = NULL;
+ unsigned i;
+ int ret_value = -1;
+ if(NULL == (c_name = (char *)malloc((size_t)*namelen)))
+ goto DONE;
- /*
- * Call H5Pget_filter function.
- */
- c_prp_id = (hid_t)*prp_id;
- c_filter_number = (unsigned)*filter_number;
- c_filter = H5Pget_filter(c_prp_id, c_filter_number, &c_flags, &c_cd_nelmts, c_cd_values, c_namelen, c_name, NULL);
+ if(NULL == (c_cd_values = (unsigned int *)malloc(sizeof(unsigned int) * c_cd_nelmts_in)))
+ goto DONE;
- if (c_filter < 0) goto DONE;
+ /*
+ * Call H5Pget_filter2 function.
+ */
+ if((c_filter = H5Pget_filter2((hid_t)*prp_id, (unsigned)*filter_number, &c_flags, &c_cd_nelmts, c_cd_values, (size_t)*namelen, c_name, NULL)) < 0)
+ goto DONE;
- *filter_id = (int_f)c_filter;
- *cd_nelmts = (size_t_f)c_cd_nelmts;
- *flags = (int_f)c_flags;
- HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
+ *filter_id = (int_f)c_filter;
+ *cd_nelmts = (size_t_f)c_cd_nelmts;
+ *flags = (int_f)c_flags;
+ HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
- for (i = 0; i < c_cd_nelmts_in; i++)
- cd_values[i] = (int_f)c_cd_values[i];
+ for(i = 0; i < c_cd_nelmts_in; i++)
+ cd_values[i] = (int_f)c_cd_values[i];
- ret_value = 0;
+ ret_value = 0;
DONE:
- HDfree(c_name);
- HDfree(c_cd_values);
- return ret_value;
+ if(c_name)
+ HDfree(c_name);
+ if(c_cd_values)
+ HDfree(c_cd_values);
+ return ret_value;
}
/*----------------------------------------------------------------------------
@@ -3328,7 +3320,7 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f
/*
- * Call H5Pget_filter function.
+ * Call H5Pget_filter_by_id function.
*/
c_prp_id = (hid_t)*prp_id;
c_filter_id = (H5Z_filter_t)*filter_id;