diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-12 01:29:45 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-12 01:29:45 (GMT) |
commit | ca0b287d21f4d73bc7d197ee7f6e92ca2631e373 (patch) | |
tree | 22153cbcb36f9313fcbe536b47445db2721476cb /src/H5P.c | |
parent | 637fa77ea7e720eb7b5a932ceeb0d05beeefb978 (diff) | |
download | hdf5-ca0b287d21f4d73bc7d197ee7f6e92ca2631e373.zip hdf5-ca0b287d21f4d73bc7d197ee7f6e92ca2631e373.tar.gz hdf5-ca0b287d21f4d73bc7d197ee7f6e92ca2631e373.tar.bz2 |
[svn-r14204] Description:
Move H5Pinsert() out of old "compat v1.6" section and into API
versioning, switching internal usage to H5Pinsert2().
Add regression test for H5Pinsert1()
Clean up some other minor warnings.
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 'src/H5P.c')
-rw-r--r-- | src/H5P.c | 44 |
1 files changed, 13 insertions, 31 deletions
@@ -463,11 +463,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5Pinsert + H5Pinsert2 PURPOSE Routine to insert a new property in a property list. USAGE - herr_t H5Pinsert(plist, name, size, value, prp_set, prp_get, prp_close) + herr_t H5Pinsert2(plist, name, size, value, prp_set, prp_get, prp_close) hid_t plist; IN: Property list to add property to const char *name; IN: Name of property to add size_t size; IN: Size of property in bytes @@ -600,52 +600,34 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -#ifdef H5_WANT_H5_V1_6_COMPAT herr_t -H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, - H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, - H5P_prp_close_func_t prp_close) -#else /* H5_WANT_H5_V1_6_COMPAT */ -herr_t -H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, +H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) -#endif /* H5_WANT_H5_V1_6_COMPAT */ { H5P_genplist_t *plist; /* Property list to modify */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pinsert, FAIL); -#ifdef H5_WANT_H5_V1_6_COMPAT - H5TRACE9("e","iszxxxxxx",plist_id,name,size,value,prp_set,prp_get, - prp_delete,prp_copy,prp_close); -#else /* H5_WANT_H5_V1_6_COMPAT */ + FUNC_ENTER_API(H5Pinsert2, FAIL); H5TRACE10("e","iszxxxxxxx",plist_id,name,size,value,prp_set,prp_get, prp_delete,prp_copy,prp_cmp,prp_close); -#endif /* H5_WANT_H5_V1_6_COMPAT */ /* Check arguments. */ if(NULL == (plist = H5I_object_verify(plist_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name"); - if(size>0 && value==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "properties >0 size must have default"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid property name") + if(size > 0 && value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "properties >0 size must have default") /* Create the new property list class */ -#ifdef H5_WANT_H5_V1_6_COMPAT - if((ret_value = H5P_insert(plist,name,size,value,prp_set,prp_get,prp_delete,prp_copy,NULL,prp_close)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist"); -#else /* H5_WANT_H5_V1_6_COMPAT */ - if((ret_value = H5P_insert(plist,name,size,value,prp_set,prp_get,prp_delete,prp_copy,prp_cmp,prp_close)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist"); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + if((ret_value = H5P_insert(plist, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist") done: FUNC_LEAVE_API(ret_value); -} /* H5Pinsert() */ +} /* H5Pinsert2() */ /*-------------------------------------------------------------------------- @@ -1201,7 +1183,7 @@ done: Removes a property from a property list. Both properties which were in existance when the property list was created (i.e. properties registered with H5Pregister2) and properties added to the list after it was created - (i.e. added with H5Pinsert) may be removed from a property list. + (i.e. added with H5Pinsert2) may be removed from a property list. Properties do not need to be removed a property list before the list itself is closed, they will be released automatically when H5Pclose is called. The 'close' callback for this property is called before the property is @@ -1264,7 +1246,7 @@ done: 'copy' callback for the property, if one exists). If the property does not exist in the destination class or list, this call - is equivalent to calling H5Pregister2 or H5Pinsert (for a class or list, as + is equivalent to calling H5Pregister2 or H5Pinsert2 (for a class or list, as appropriate) and the 'create' callback will be called in the case of the property being copied into a list (if such a callback exists for the property). |