summaryrefslogtreecommitdiffstats
path: root/src/H5Pdcpl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-01-08 14:55:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-01-08 14:55:11 (GMT)
commitfeaa5bb9d54017961e325f4bc2c366fc023c2443 (patch)
treea84153ea1ed3305049e86ddff013c794b414719b /src/H5Pdcpl.c
parentc81f060deb2fc82d33ef17a57b3a48718511bdc6 (diff)
downloadhdf5-feaa5bb9d54017961e325f4bc2c366fc023c2443.zip
hdf5-feaa5bb9d54017961e325f4bc2c366fc023c2443.tar.gz
hdf5-feaa5bb9d54017961e325f4bc2c366fc023c2443.tar.bz2
[svn-r8038] Purpose:
Bug fix Description: When two property lists are compared, the H5Pequal routine was just comparing the raw information for the property values. This causes problems when the raw information contains pointers to other information. Solution: Allow a 'compare' callback to be registered for properties, so that a user application get perform the comparison itself, allowing for "deep" compares of the property value. This was exported to the H5Pregister & H5Pinsert routines in the development branch, but not the release branch. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r--src/H5Pdcpl.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 8052600..6307a07 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -288,7 +288,7 @@ done:
herr_t
H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size)
{
- int idx;
+ size_t idx;
hsize_t total, tmp;
H5O_efl_t efl;
H5P_genplist_t *plist; /* Property list pointer */
@@ -426,16 +426,26 @@ done:
*
*-------------------------------------------------------------------------
*/
+#ifdef H5_WANT_H5_V1_6_COMPAT
herr_t
H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
off_t *offset/*out*/, hsize_t *size/*out*/)
+#else /* H5_WANT_H5_V1_6_COMPAT */
+herr_t
+H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out*/,
+ off_t *offset/*out*/, hsize_t *size/*out*/)
+#endif /* H5_WANT_H5_V1_6_COMPAT */
{
H5O_efl_t efl;
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_external, FAIL);
+#ifdef H5_WANT_H5_V1_6_COMPAT
H5TRACE6("e","iIszxxx",plist_id,idx,name_size,name,offset,size);
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ H5TRACE6("e","iIuzxxx",plist_id,idx,name_size,name,offset,size);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
@@ -445,8 +455,13 @@ H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list");
- if (idx<0 || idx>=efl.nused)
+#ifdef H5_WANT_H5_V1_6_COMPAT
+ if (idx<0 || (size_t)idx>=efl.nused)
HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range");
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ if (idx>=efl.nused)
+ HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range");
+#endif /* H5_WANT_H5_V1_6_COMPAT */
/* Return values */
if (name_size>0 && name)
@@ -661,7 +676,7 @@ H5Pget_nfilters(hid_t plist_id)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline");
/* Set return value */
- ret_value=(int)(pline.nfilters);
+ ret_value=(int)(pline.nused);
done:
FUNC_LEAVE_API(ret_value);
@@ -698,10 +713,17 @@ done:
*
*-------------------------------------------------------------------------
*/
+#ifdef H5_WANT_H5_V1_6_COMPAT
H5Z_filter_t
H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
size_t namelen, char name[]/*out*/)
+#else /* H5_WANT_H5_V1_6_COMPAT */
+H5Z_filter_t
+H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/,
+ size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
+ size_t namelen, char name[]/*out*/)
+#endif /* H5_WANT_H5_V1_6_COMPAT */
{
H5O_pline_t pline; /* Filter pipeline */
H5Z_filter_info_t *filter; /* Pointer to filter information */
@@ -710,8 +732,13 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
H5Z_filter_t ret_value; /* return value */
FUNC_ENTER_API(H5Pget_filter, H5Z_FILTER_ERROR);
+#ifdef H5_WANT_H5_V1_6_COMPAT
H5TRACE7("Zf","iIsx*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen,
name);
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen,
+ name);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
/* Check args */
if (cd_nelmts || cd_values) {
@@ -743,8 +770,13 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5Z_FILTER_ERROR, "can't get pipeline");
/* Check more args */
- if (idx<0 || (size_t)idx>=pline.nfilters)
+#ifdef H5_WANT_H5_V1_6_COMPAT
+ if (idx<0 || (size_t)idx>=pline.nused)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5Z_FILTER_ERROR, "filter number is invalid");
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ if (idx>=pline.nused)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5Z_FILTER_ERROR, "filter number is invalid");
+#endif /* H5_WANT_H5_V1_6_COMPAT */
/* Set pointer to particular filter to query */
filter=&pline.filter[idx];