summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-09-01 17:43:30 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-09-01 17:43:30 (GMT)
commitcb7f03a26ff906175e5bf37af57547681683770f (patch)
treed8d167353c83fe6caebc6df15c33ca1c7f6dc521 /src/H5FDmulti.c
parent226f162ce75ff63e3d1468d17528ba629c51db58 (diff)
downloadhdf5-cb7f03a26ff906175e5bf37af57547681683770f.zip
hdf5-cb7f03a26ff906175e5bf37af57547681683770f.tar.gz
hdf5-cb7f03a26ff906175e5bf37af57547681683770f.tar.bz2
[svn-r9183] Purpose: New feature
Description: Restore 6 old error API functions back to the library to be backward compatible with v1.6. They are H5Epush, H5Eprint, H5Ewalk, H5Eclear, H5Eset_auto, H5Eget_auto. These functions do not have error stack as parameter. Solution: Internally, these functions use default error stack. Platforms tested: h5committest and fuss. Misc. update: RELEASE.txt
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c156
1 files changed, 26 insertions, 130 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 01048d6..d1d0b6e 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -231,11 +231,7 @@ hid_t
H5FD_multi_init(void)
{
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
if (H5I_VFL!=H5Iget_type(H5FD_MULTI_g)) {
H5FD_MULTI_g = H5FDregister(&H5FD_multi_g);
@@ -304,11 +300,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
/*NO TRACE*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Initialize */
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -452,11 +444,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
/*NO TRACE*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Check arguments and supply default values */
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
@@ -557,11 +545,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
/*NO TRACE*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
@@ -628,11 +612,7 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
/*NO TRACE*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Check arguments */
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
@@ -684,11 +664,7 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
/*NO TRACE*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
@@ -735,11 +711,7 @@ H5FD_multi_sb_size(H5FD_t *_file)
hsize_t nbytes = 8; /*size of header*/
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* How many unique files? */
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
@@ -797,11 +769,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Name and version number */
strncpy(name, "NCSAmulti",8);
@@ -886,11 +854,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Make sure the name/version number is correct */
if (strcmp(name, "NCSAmult"))
@@ -1032,11 +996,7 @@ H5FD_multi_fapl_get(H5FD_t *_file)
H5FD_multi_t *file = (H5FD_multi_t*)_file;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
return H5FD_multi_fapl_copy(&(file->fa));
}
@@ -1070,11 +1030,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
assert(new_fa);
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t));
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -1125,11 +1081,7 @@ H5FD_multi_fapl_free(void *_fa)
static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
if (fa->memb_fapl[mt]>=0)
@@ -1172,11 +1124,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx)
assert(new_dx);
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t));
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -1220,11 +1168,7 @@ H5FD_multi_dxpl_free(void *_dx)
static const char *func="H5FD_multi_dxpl_free"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
if (dx->memb_dxpl[mt]>=0)
@@ -1264,11 +1208,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
static const char *func="H5FD_multi_open"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Check arguments */
if (!name || !*name)
@@ -1363,11 +1303,7 @@ H5FD_multi_close(H5FD_t *_file)
static const char *func="H5FD_multi_close"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Close as many members as possible */
ALL_MEMBERS(mt) {
@@ -1433,11 +1369,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
int cmp=0;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
if (f1->memb[mt] && f2->memb[mt]) break;
@@ -1511,11 +1443,7 @@ H5FD_multi_get_eoa(H5FD_t *_file)
H5FD_multi_t *file = (H5FD_multi_t*)_file;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
return file->eoa;
}
@@ -1549,11 +1477,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa)
static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Find the subfile in which the new EOA value falls */
for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -1609,11 +1533,7 @@ H5FD_multi_get_eof(H5FD_t *_file)
static const char *func="H5FD_multi_eof"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
if (file->memb[mt]) {
@@ -1735,11 +1655,7 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi
H5FD_mem_t mmt;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
mmt = file->fa.memb_map[type];
if (H5FD_MEM_DEFAULT==mmt) mmt = type;
@@ -1779,11 +1695,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
haddr_t start_addr=0;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Get the data transfer properties */
if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) {
@@ -1838,11 +1750,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
haddr_t start_addr=0;
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Get the data transfer properties */
if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) {
@@ -1926,11 +1834,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
#endif
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
/* Flush each file */
for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -1968,11 +1872,7 @@ static int
compute_next(H5FD_multi_t *file)
{
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
ALL_MEMBERS(mt) {
file->memb_next[mt] = HADDR_UNDEF;
@@ -2019,11 +1919,7 @@ open_members(H5FD_multi_t *file)
static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */
/* Clear the error stack */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- H5Eclear();
-#else
- H5Eclear(H5E_DEFAULT);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
+ H5Eclear_stack(H5E_DEFAULT);
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
if (file->memb[mt]) continue; /*already open*/