summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 22:19:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 22:19:07 (GMT)
commit1de51c7bc148b9cb5104936dfd23096a222d0cb8 (patch)
treeb23ea23404fd02a41f4539ebbc8311a1c43fecbe /src
parent041de441c5d7468812be8af1346b30db6ea94e3a (diff)
downloadhdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.zip
hdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.tar.gz
hdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.tar.bz2
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted to H5Acreate2(). Add regression tests for H5Acreate1(). 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')
-rw-r--r--src/H5A.c2
-rw-r--r--src/H5Adeprec.c17
-rw-r--r--src/H5Apublic.h10
-rw-r--r--src/H5Tconv.c2
-rw-r--r--src/H5vers.txt1
-rw-r--r--src/H5version.h15
6 files changed, 31 insertions, 16 deletions
diff --git a/src/H5A.c b/src/H5A.c
index f7d1081..7f0d7ed 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -276,7 +276,7 @@ done:
* Function: H5A_create
*
* Purpose:
- * This is the guts of the H5Acreate function.
+ * This is the guts of creating an attribute.
* Usage:
* hid_t H5A_create (ent, name, type, space)
* const H5G_entry_t *ent; IN: Pointer to symbol table entry for object to attribute
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 1ff98c0..c490dcc 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -105,14 +105,15 @@ H5A_init_deprec_interface(void)
FUNC_LEAVE_NOAPI(H5A_init())
} /* H5A_init_deprec_interface() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/*--------------------------------------------------------------------------
NAME
- H5Acreate
+ H5Acreate1
PURPOSE
Creates an attribute on an object
USAGE
- hid_t H5Acreate (loc_id, name, type_id, space_id, plist_id)
+ hid_t H5Acreate1(loc_id, name, type_id, space_id, plist_id)
hid_t loc_id; IN: Object (dataset or group) to be attached to
const char *name; IN: Name of attribute to create
hid_t type_id; IN: ID of datatype for attribute
@@ -129,9 +130,12 @@ H5A_init_deprec_interface(void)
The attribute ID returned from this function must be released with H5Aclose
or resource leaks will develop.
+ NOTE
+ Deprecated in favor of H5Acreate2
+
--------------------------------------------------------------------------*/
hid_t
-H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
+H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t plist_id)
{
H5G_loc_t loc; /* Object location */
@@ -139,7 +143,7 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
H5S_t *space; /* Dataspace to use for attribute */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Acreate, FAIL)
+ FUNC_ENTER_API(H5Acreate1, FAIL)
H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, plist_id);
/* check arguments */
@@ -162,9 +166,8 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Acreate() */
+} /* H5Acreate1() */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
/*--------------------------------------------------------------------------
NAME
@@ -185,6 +188,8 @@ done:
H5Aclose or resource leaks will develop.
The location object may be either a group or a dataset, both of
which may have any sort of attribute.
+ NOTE
+ Deprecated in favor of H5Aopen
--------------------------------------------------------------------------*/
hid_t
H5Aopen_name(hid_t loc_id, const char *name)
diff --git a/src/H5Apublic.h b/src/H5Apublic.h
index 911b7b1..fdda900 100644
--- a/src/H5Apublic.h
+++ b/src/H5Apublic.h
@@ -75,14 +75,6 @@ H5_DLL herr_t H5Adelete2(hid_t loc_id, const char *obj_name,
H5_DLL herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id);
-/* Functions and variables defined for compatibility with previous versions
- * of the HDF5 API.
- *
- * Use of these functions and variables is deprecated.
- */
-H5_DLL hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_id,
- hid_t space_id, hid_t plist_id);
-
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
@@ -100,6 +92,8 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id/*in*/,
/* Function prototypes */
+H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id,
+ hid_t space_id, hid_t plist_id);
H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name);
H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx);
H5_DLL int H5Aget_num_attrs(hid_t loc_id);
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 7094fe0..0da4d53 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1890,7 +1890,7 @@ H5T_subset_t
H5T_conv_struct_subset(const H5T_cdata_t *cdata)
{
H5T_conv_struct_t *priv;
- H5T_subset_t ret_value = FALSE; /* Return value */
+ H5T_subset_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_conv_struct_subset)
diff --git a/src/H5vers.txt b/src/H5vers.txt
index fa7200a..8d4b6f9 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -45,6 +45,7 @@
# API function names
# (although not required, it's easier to compare this file with the headers
# generated if the list below is in alphanumeric sort order - QAK)
+FUNCTION: H5Acreate; ; v10, v18
FUNCTION: H5Adelete; ; v10, v18
FUNCTION: H5Aiterate; H5A_operator; v10, v18
FUNCTION: H5Arename; ; v16, v18
diff --git a/src/H5version.h b/src/H5version.h
index 1a84886..25efa53 100644
--- a/src/H5version.h
+++ b/src/H5version.h
@@ -38,6 +38,10 @@
/* Functions */
/*************/
+#if !defined(H5Acreate_vers)
+#define H5Acreate_vers 1
+#endif /* !defined(H5Acreate_vers) */
+
#if !defined(H5Adelete_vers)
#define H5Adelete_vers 1
#endif /* !defined(H5Adelete_vers) */
@@ -115,6 +119,17 @@
/* Functions */
/*************/
+#if !defined(H5Acreate_vers) || H5Acreate_vers == 2
+#ifndef H5Acreate_vers
+#define H5Acreate_vers 2
+#endif /* H5Acreate_vers */
+#define H5Acreate H5Acreate2
+#elif H5Acreate_vers == 1
+#define H5Acreate H5Acreate1
+#else /* H5Acreate_vers */
+#error "H5Acreate_vers set to invalid value"
+#endif /* H5Acreate_vers */
+
#if !defined(H5Adelete_vers) || H5Adelete_vers == 2
#ifndef H5Adelete_vers
#define H5Adelete_vers 2