From feaa5bb9d54017961e325f4bc2c366fc023c2443 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 8 Jan 2004 09:55:11 -0500 Subject: [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 --- doc/html/RM_H5P.html | 69 +++++++++ fortran/src/H5Pf.c | 4 +- release_docs/RELEASE.txt | 10 +- src/H5AC.c | 12 +- src/H5D.c | 294 ++++++++++++++++++++++++++++++++----- src/H5Distore.c | 10 +- src/H5Dprivate.h | 3 + src/H5F.c | 58 ++++---- src/H5FDfphdf5.c | 4 +- src/H5FDmpio.c | 4 +- src/H5FPclient.c | 2 +- src/H5Fistore.c | 10 +- src/H5Oefl.c | 116 ++++++++------- src/H5Opline.c | 28 ++-- src/H5Oprivate.h | 8 +- src/H5P.c | 262 +++++++++++++++++++++++++++------ src/H5Pdcpl.c | 40 ++++- src/H5Ppkg.h | 1 + src/H5Pprivate.h | 5 +- src/H5Ppublic.h | 32 ++++ src/H5Z.c | 28 ++-- src/H5private.h | 7 +- test/dsets.c | 88 +++++++++++ test/tgenprop.c | 162 +++++++++++++++++++- tools/h5repack/h5repack_verify.c | 1 + tools/h5repack/testh5repack_main.c | 12 +- 26 files changed, 1027 insertions(+), 243 deletions(-) diff --git a/doc/html/RM_H5P.html b/doc/html/RM_H5P.html index da6bbb5..d8ae024 100644 --- a/doc/html/RM_H5P.html +++ b/doc/html/RM_H5P.html @@ -4184,6 +4184,7 @@ SUBROUTINE H5P_prp_get_func_t get, H5P_prp_delete_func_t delete, H5P_prp_copy_func_t copy, + H5P_prp_compare_func_t compare, H5P_prp_close_func_t close ) @@ -4290,6 +4291,7 @@ SUBROUTINE routine returns an error value.

+

The delete routine is called when a property is being deleted from a property list. The H5P_prp_delete_func_t callback function is defined @@ -4323,6 +4325,7 @@ SUBROUTINE error value but the property is still deleted.

+

The copy routine is called when a new property list with this property is being created through a copy operation. The H5P_prp_copy_func_t collback function is defined @@ -4349,6 +4352,36 @@ SUBROUTINE If the copy routine returns a negative value, the new property value is not copied into the property and the copy routine returns an error value. +

+ +

+ The compare routine is called when a property list with + this property is compared to another property list with the same property. + The H5P_prp_compare_func_t callback function is defined + as follows: +

+ The parameters to the callback function are defined as follows: + + The compare routine may not modify the values. + The compare routine should return a positive value if + value1 is greater than value2, a negative value + if value2 is greater than value1 and zero if + value1 and value2 are equal. +

The close routine is called when a property list with this property is being closed. @@ -4722,6 +4755,7 @@ END SUBROUTINE h5pmodify_filter_f H5P_prp_get_func_t get, H5P_prp_delete_func_t delete, H5P_prp_copy_func_t copy, + H5P_prp_compare_func_t compare, H5P_prp_close_func_t close ) @@ -4749,6 +4783,7 @@ END SUBROUTINE h5pmodify_filter_f get callbacks are never called.

+

The create routine is called when a new property list with this property is being created. The H5P_prp_create_func_t callback function is defined @@ -4778,6 +4813,7 @@ END SUBROUTINE h5pmodify_filter_f create routine returns an error value.

+

The set routine is called before a new value is copied into the property. The H5P_prp_set_func_t callback function is defined @@ -4855,6 +4891,7 @@ END SUBROUTINE h5pmodify_filter_f routine returns an error value.

+

The delete routine is called when a property is being deleted from a property list. The H5P_prp_delete_func_t callback function is defined @@ -4888,6 +4925,7 @@ END SUBROUTINE h5pmodify_filter_f an error value but the property is still deleted.

+

The copy routine is called when a new property list with this property is being created through a copy operation. The H5P_prp_copy_func_t callback function is defined @@ -4916,6 +4954,36 @@ END SUBROUTINE h5pmodify_filter_f the copy routine returns an error value.

+

+ The compare routine is called when a property list with + this property is compared to another property list with the same property. + The H5P_prp_compare_func_t callback function is defined + as follows: +

+ The parameters to the callback function are defined as follows: + + The compare routine may not modify the values. + The compare routine should return a positive value if + value1 is greater than value2, a negative value + if value2 is greater than value1 and zero if + value1 and value2 are equal. +

+ +

The close routine is called when a property list with this property is being closed. The H5P_prp_close_func_t callback function is defined @@ -4948,6 +5016,7 @@ END SUBROUTINE h5pmodify_filter_f If the close routine returns a negative value, the property list close routine returns an error value but the property list is still closed. +

Parameters: