summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 15:06:28 (GMT)
commit59b51a2ea72ff98586372a454adfd8c790a62734 (patch)
tree74173cf2dab79097c9dc8f116a22ad0138d310a2 /src
parent302830e60108513d9ff2e710444dc0d0188c92ee (diff)
downloadhdf5-59b51a2ea72ff98586372a454adfd8c790a62734.zip
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.gz
hdf5-59b51a2ea72ff98586372a454adfd8c790a62734.tar.bz2
[svn-r14180] Description:
Make H5Aiterate() versioned and change all internal use to H5Aiterate2() Leave some regression tests that exercise H5Aiterate1() Fix attribute display in h5dump & h5ls to be "by name" by default 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 2.6 (smirom) w/default API=1.6.x, 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/H5Adense.c2
-rw-r--r--src/H5Adeprec.c16
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5Apkg.h6
-rw-r--r--src/H5Apublic.h12
-rw-r--r--src/H5vers.txt1
-rw-r--r--src/H5version.h17
7 files changed, 41 insertions, 15 deletions
diff --git a/src/H5Adense.c b/src/H5Adense.c
index 8549a10..de6bc8c 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -1024,10 +1024,12 @@ H5A_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
break;
}
+#ifndef H5_NO_DEPRECATED_SYMBOLS
case H5A_ATTR_OP_APP:
/* Make the application callback */
ret_value = (bt2_udata->attr_op->u.app_op)(bt2_udata->loc_id, fh_udata.attr->name, bt2_udata->op_data);
break;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
case H5A_ATTR_OP_LIB:
/* Call the library's callback */
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 75f5191..9ca3d5a 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -377,19 +377,18 @@ H5Arename1(hid_t loc_id, const char *old_name, const char *new_name)
done:
FUNC_LEAVE_API(ret_value)
} /* H5Arename1() */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
/*--------------------------------------------------------------------------
NAME
- H5Aiterate
+ H5Aiterate1
PURPOSE
Calls a user's function for each attribute on an object
USAGE
- herr_t H5Aiterate (loc_id, attr_num, op, data)
+ herr_t H5Aiterate1(loc_id, attr_num, op, data)
hid_t loc_id; IN: Object (dataset or group) to be iterated over
unsigned *attr_num; IN/OUT: Starting (IN) & Ending (OUT) attribute number
- H5A_operator_t op; IN: User's function to pass each attribute to
+ H5A_operator1_t op; IN: User's function to pass each attribute to
void *op_data; IN/OUT: User's data to pass through to iterator operator function
RETURNS
Returns a negative value if something is wrong, the return value of the
@@ -414,16 +413,18 @@ done:
C. Negative causes the iterator to immediately return that value,
indicating failure. The iterator can be restarted at the next
attribute.
+ NOTE
+ Deprecated in favor of H5Aiterate2
--------------------------------------------------------------------------*/
herr_t
-H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
+H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data)
{
H5A_attr_iter_op_t attr_op; /* Attribute operator */
hsize_t start_idx; /* Index of attribute to start iterating at */
hsize_t last_attr; /* Index of last attribute examined */
herr_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Aiterate, FAIL)
+ FUNC_ENTER_API(H5Aiterate1, FAIL)
H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data);
/* check arguments */
@@ -445,9 +446,8 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Aiterate() */
+} /* H5Aiterate1() */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 6293797..c08c6cf 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -554,10 +554,12 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip,
break;
}
+#ifndef H5_NO_DEPRECATED_SYMBOLS
case H5A_ATTR_OP_APP:
/* Make the application callback */
ret_value = (attr_op->u.app_op)(loc_id, atable->attrs[u].name, op_data);
break;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
case H5A_ATTR_OP_LIB:
/* Call the library's callback */
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index 99cfe5d..f72de64 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -161,12 +161,16 @@ typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data);
/* Describe kind of callback to make for each attribute */
struct H5A_attr_iter_op_t {
enum {
+#ifndef H5_NO_DEPRECATED_SYMBOLS
H5A_ATTR_OP_APP, /* Application callback */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
H5A_ATTR_OP_APP2, /* Revised application callback */
H5A_ATTR_OP_LIB /* Library internal callback */
} op_type;
union {
- H5A_operator_t app_op; /* Application callback for each attribute */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ H5A_operator1_t app_op; /* Application callback for each attribute */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
H5A_operator2_t app_op2; /* Revised application callback for each attribute */
H5A_lib_iterate_t lib_op; /* Library internal callback for each attribute */
} u;
diff --git a/src/H5Apublic.h b/src/H5Apublic.h
index f154261..d20ad8f 100644
--- a/src/H5Apublic.h
+++ b/src/H5Apublic.h
@@ -36,10 +36,6 @@ typedef struct {
hsize_t data_size; /* Size of raw data */
} H5A_info_t;
-/* Typedef for H5Aiterate() callbacks */
-typedef herr_t (*H5A_operator_t)(hid_t location_id/*in*/,
- const char *attr_name/*in*/, void *operator_data/*in,out*/);
-
/* Typedef for H5Aiterate2() callbacks */
typedef herr_t (*H5A_operator2_t)(hid_t location_id/*in*/,
const char *attr_name/*in*/, const H5A_info_t *ainfo/*in*/, void *op_data/*in,out*/);
@@ -89,8 +85,6 @@ H5_DLL hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_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);
-H5_DLL herr_t H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op,
- void *op_data);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -103,10 +97,16 @@ H5_DLL herr_t H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op,
/* Typedefs */
+/* Typedef for H5Aiterate1() callbacks */
+typedef herr_t (*H5A_operator1_t)(hid_t location_id/*in*/,
+ const char *attr_name/*in*/, void *operator_data/*in,out*/);
+
/* Function prototypes */
H5_DLL herr_t H5Adelete1(hid_t loc_id, const char *name);
H5_DLL herr_t H5Arename1(hid_t loc_id, const char *old_name, const char *new_name);
+H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op,
+ void *op_data);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5vers.txt b/src/H5vers.txt
index 17dde82..fa7200a 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -46,6 +46,7 @@
# (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: H5Adelete; ; v10, v18
+FUNCTION: H5Aiterate; H5A_operator; v10, v18
FUNCTION: H5Arename; ; v16, v18
FUNCTION: H5Eclear; ; v10, v18
FUNCTION: H5Eget_auto; ; v10, v18
diff --git a/src/H5version.h b/src/H5version.h
index a6c8414..1a84886 100644
--- a/src/H5version.h
+++ b/src/H5version.h
@@ -42,6 +42,10 @@
#define H5Adelete_vers 1
#endif /* !defined(H5Adelete_vers) */
+#if !defined(H5Aiterate_vers)
+#define H5Aiterate_vers 1
+#endif /* !defined(H5Aiterate_vers) */
+
#if !defined(H5Arename_vers)
#define H5Arename_vers 1
#endif /* !defined(H5Arename_vers) */
@@ -122,6 +126,19 @@
#error "H5Adelete_vers set to invalid value"
#endif /* H5Adelete_vers */
+#if !defined(H5Aiterate_vers) || H5Aiterate_vers == 2
+#ifndef H5Aiterate_vers
+#define H5Aiterate_vers 2
+#endif /* H5Aiterate_vers */
+#define H5Aiterate H5Aiterate2
+#define H5A_operator_t H5A_operator2_t
+#elif H5Aiterate_vers == 1
+#define H5Aiterate H5Aiterate1
+#define H5A_operator_t H5A_operator1_t
+#else /* H5Aiterate_vers */
+#error "H5Aiterate_vers set to invalid value"
+#endif /* H5Aiterate_vers */
+
#if !defined(H5Arename_vers) || H5Arename_vers == 2
#ifndef H5Arename_vers
#define H5Arename_vers 2