summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-08 18:53:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-08 18:53:49 (GMT)
commit1c1bf5dcd37a9370f555f4ad2e4a001f39e1a1dd (patch)
treea4053065394277f3caf5d0947647661b454cef90 /src/H5FDmulti.c
parent7255ce7c07b80524c273cdc9c4e9bc516b06b70e (diff)
downloadhdf5-1c1bf5dcd37a9370f555f4ad2e4a001f39e1a1dd.zip
hdf5-1c1bf5dcd37a9370f555f4ad2e4a001f39e1a1dd.tar.gz
hdf5-1c1bf5dcd37a9370f555f4ad2e4a001f39e1a1dd.tar.bz2
[svn-r7299] Purpose:
Code refactoring Description: Chase new error API usage by adding error class to calls to H5Epush(). Platforms tested: h5committested
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 9492d7c..4d8849a 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -421,7 +421,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
/* Check arguments and supply default values */
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
if (!memb_map) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
_memb_map[mt] = H5FD_MEM_DEFAULT;
@@ -453,7 +453,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
/* Map usage type */
mmt = memb_map[mt];
if (mmt<0 || mmt>=H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1);
if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
/*
@@ -461,11 +461,11 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
* access property lists.
*/
if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1);
/* All names must be defined */
if (!memb_name[mmt] || !memb_name[mmt][0])
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
}
/*
@@ -524,11 +524,11 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not an access list", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list", -1);
if (H5FD_MULTI!=H5Pget_driver(fapl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
if (NULL==(fa=H5Pget_driver_info(fapl_id)))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
if (memb_map) {
memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t));
@@ -596,12 +596,12 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
/* Check arguments */
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
if (!memb_dxpl)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
if (memb_dxpl[mt]!=H5P_DEFAULT && TRUE!=H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
}
/* Initialize the data transfer property list */
@@ -647,11 +647,11 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
H5Eclear(H5E_DEFAULT);
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
if (H5FD_MULTI!=H5Pget_driver(dxpl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
if (NULL==(dx=H5Pget_driver_info(dxpl_id)))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
if (memb_dxpl) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -781,7 +781,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
} END_MEMBERS;
if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen*2, buf+8, NULL,
H5P_DEFAULT)<0) {
- H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
}
/* Encode all name templates */
@@ -840,7 +840,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
/* Make sure the name/version number is correct */
if (strcmp(name, "NCSAmult"))
- H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
/* Set default values */
ALL_MEMBERS(mt) {
@@ -869,7 +869,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memcpy(x, buf, (size_t)(nseen*2*8));
buf += nseen*2*8;
if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen*2, x, NULL, H5P_DEFAULT)<0)
- H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
ap = (haddr_t*)x;
UNIQUE_MEMBERS(map, mt) {
memb_addr[_unmapped] = *ap++;
@@ -937,11 +937,11 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
} END_MEMBERS;
if (compute_next(file)<0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
/* Open all necessary files */
if (open_members(file)<0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1);
/* Set the EOA marker for all open files */
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
@@ -1034,7 +1034,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
if (new_fa->memb_name[mt]) free(new_fa->memb_name[mt]);
}
free(new_fa);
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
}
return new_fa;
}
@@ -1116,7 +1116,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx)
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
H5Pclose(new_dx->memb_dxpl[mt]);
free(new_dx);
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
}
return new_dx;
}
@@ -1188,16 +1188,16 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
if (0==maxaddr || HADDR_UNDEF==maxaddr)
- H5Epush_ret(func, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
/*
* Initialize the file from the file access properties, using default
* values if necessary.
*/
if (NULL==(file=calloc(1, sizeof(H5FD_multi_t))))
- H5Epush_ret(func, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_MULTI!=H5Pget_driver(fapl_id)) {
close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE);
@@ -1226,9 +1226,9 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
/* Compute derived properties and open member files */
if (compute_next(file)<0)
- H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", error);
+ H5Epush_goto(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", error);
if (open_members(file)<0)
- H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", error);
+ H5Epush_goto(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", error);
/* We must have opened at least the superblock file */
if (H5FD_MEM_DEFAULT==(m=file->fa.memb_map[H5FD_MEM_SUPER])) {
@@ -1301,7 +1301,7 @@ H5FD_multi_close(H5FD_t *_file)
}
} END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
/* Clean up other stuff */
ALL_MEMBERS(mt) {
@@ -1472,7 +1472,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa)
status = H5FDset_eoa(file->memb[mmt], eoa-file->fa.memb_addr[mmt]);
} H5E_END_TRY;
if (status<0)
- H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
}
/* Save new eoa for return later */
@@ -1516,7 +1516,7 @@ H5FD_multi_get_eof(H5FD_t *_file)
tmp = H5FDget_eof(file->memb[mt]);
} H5E_END_TRY;
if (HADDR_UNDEF==tmp)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF);
if (tmp>0) tmp += file->fa.memb_addr[mt];
} else if (file->fa.relax) {
@@ -1528,7 +1528,7 @@ H5FD_multi_get_eof(H5FD_t *_file)
assert(HADDR_UNDEF!=tmp);
} else {
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
}
if (tmp>eof) eof = tmp;
@@ -1561,9 +1561,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
/* Get data type for multi driver */
if(H5Pget_multi_type(fapl, &type) < 0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver", -1);
if(type<H5FD_MEM_DEFAULT || type>=H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
mmt = file->fa.memb_map[type];
if(H5FD_MEM_DEFAULT==mmt) mmt = type;
@@ -1599,7 +1599,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
if (H5FD_MEM_DEFAULT==mmt) mmt = type;
if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size))) {
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF);
}
addr += file->fa.memb_addr[mmt];
if (addr+size>file->eoa) file->eoa = addr+size;
@@ -1820,7 +1820,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1);
return 0;
}
@@ -1924,7 +1924,7 @@ open_members(H5FD_multi_t *file)
}
} END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
return 0;
}