summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2001-10-25 19:29:37 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2001-10-25 19:29:37 (GMT)
commitb3afaccfe51320c3cb38a2338d17ba8f79c15073 (patch)
treed792e019c45166e605db14cad8911961fa919632
parent46af16f87be6a9977e14a99609063a82c81eba45 (diff)
downloadhdf5-b3afaccfe51320c3cb38a2338d17ba8f79c15073.zip
hdf5-b3afaccfe51320c3cb38a2338d17ba8f79c15073.tar.gz
hdf5-b3afaccfe51320c3cb38a2338d17ba8f79c15073.tar.bz2
[svn-r4572]
Purpose: Followup file access property list changes. Platforms tested: IRIX64, SunOS 5.7, FreeBSD.
-rw-r--r--src/H5FDcore.c23
-rw-r--r--src/H5FDdpss.c9
-rw-r--r--src/H5FDgass.c18
-rw-r--r--src/H5FDlog.c10
-rw-r--r--src/H5FDmpio.c2
-rw-r--r--src/H5FDmulti.c17
-rw-r--r--src/H5FDsrb.c24
-rw-r--r--src/H5FDstdio.c4
-rw-r--r--src/H5FDstream.c1
9 files changed, 85 insertions, 23 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 2631d43..6072d38 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -168,6 +168,10 @@ H5FD_core_init(void)
* Added the BACKING_STORE argument. If set then the entire file
* contents are flushed to a file with the same name as this
* core file.
+ *
+ * Raymond Lu, 2001-10-25
+ * Changed the file access list to the new generic list.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -179,8 +183,12 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store)
FUNC_ENTER(H5FD_set_fapl_core, FAIL);
H5TRACE3("e","izb",fapl_id,increment,backing_store);
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ /* Check argument */
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
+
fa.increment = increment;
fa.backing_store = backing_store;
@@ -205,6 +213,11 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store)
* Modifications:
* Robb Matzke, 1999-10-19
* Added the BACKING_STORE argument.
+ *
+ * Raymond Lu
+ * 2001-10-25
+ * Changed file access list to the new generic property list.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -216,8 +229,10 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/,
FUNC_ENTER(H5Pget_fapl_core, FAIL);
H5TRACE3("e","ixx",fapl_id,increment,backing_store);
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
if (H5FD_CORE!=H5P_get_driver(fapl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
if (NULL==(fa=H5Pget_driver_info(fapl_id)))
diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c
index 6fa1bc6..2ce942f 100644
--- a/src/H5FDdpss.c
+++ b/src/H5FDdpss.c
@@ -10,8 +10,9 @@
*/
#include "hdf5.h"
+#include "H5private.h" /* library function */
#include "H5Eprivate.h" /* error handling */
-#include "H5FDprivate.h" /*file driver */
+#include "H5FDprivate.h" /*file driver */
#include "H5FDdpss.h"
#include "H5MMprivate.h" /* memory management */
@@ -239,8 +240,10 @@ H5Pset_fapl_dpss(hid_t fapl_id)
H5TRACE1("e","i",fapl_id);
/* Check arguments */
- if (H5P_FILE_ACCESS != H5Pget_class (fapl_id))
- HRETURN_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
ret_value = H5Pset_driver (fapl_id, H5FD_DPSS, NULL);
diff --git a/src/H5FDgass.c b/src/H5FDgass.c
index aeaf60e..8cd000a 100644
--- a/src/H5FDgass.c
+++ b/src/H5FDgass.c
@@ -218,6 +218,9 @@ H5FD_gass_init(void)
*
* Modifications:
*
+ * Raymond Lu, 2001-10-25
+ * Changed the file access list to the new generic property list.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -229,8 +232,10 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info)
FUNC_ENTER(H5Pset_fapl_gass, FAIL);
/* Check arguments */
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+
#ifdef LATER
#warning "We need to verify that INFO contain sensible information."
#endif
@@ -264,6 +269,9 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info)
*
* Modifications:
*
+ * Raymond Lu, 2001-10-25
+ * Changed the file access list to the new generic property list.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -274,8 +282,10 @@ H5Pget_fapl_gass(hid_t fapl_id, GASS_Info *info/*out*/)
FUNC_ENTER(H5Pget_fapl_gass, FAIL);
H5TRACE2("e","ix",fapl_id,info);
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
if (H5FD_GASS!=H5P_get_driver(fapl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
if (NULL==(fa=H5Pget_driver_info(fapl_id)))
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 968057a..873b44c 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -269,6 +269,10 @@ H5FD_log_init(void)
*
* Modifications:
* We copy the LOGFILE value into our own access properties.
+ *
+ * Raymond Lu, 2001-10-25
+ * Changed the file access list to the new generic property list.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -280,8 +284,10 @@ H5Pset_fapl_log(hid_t fapl_id, char *logfile, int verbosity)
FUNC_ENTER(H5Pset_fapl_log, FAIL);
H5TRACE3("e","isIs",fapl_id,logfile,verbosity);
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
fa.logfile = logfile;
fa.verbosity=verbosity;
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 7448117..2846d4a 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -304,7 +304,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/)
FUNC_ENTER(H5Pget_fapl_mpio, FAIL);
H5TRACE3("e","ixx",fapl_id,comm,info);
- if(H5I_GENPROP_LST != H5I_GET_TYPE(fapl_id) ||
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_MPIO!=H5P_get_driver(fapl_id))
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index fb8aa59..725c358 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include "hdf5.h"
+#include "H5private.h" /* library function */
/*
* Define H5FD_MULTI_DEBUG if you want the ability to print debugging
@@ -375,6 +376,9 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
*
* Modifications:
*
+ * Raymond Lu, 2001-10-25
+ * Use new generic property list for argument checking.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -398,8 +402,9 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
H5Eclear();
/* Check arguments and supply default values */
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not a file access property list", -1);
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
if (!memb_map) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) {
_memb_map[mt] = H5FD_MEM_DEFAULT;
@@ -475,6 +480,9 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
*
* Modifications:
*
+ * Raymond Lu, 2001-10-25
+ * Use new generic property list for argument checking.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -491,8 +499,9 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
/* Clear the error stack */
H5Eclear();
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ H5Epush_ret(func, 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);
if (NULL==(fa=H5Pget_driver_info(fapl_id)))
diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c
index d98288a..792c008 100644
--- a/src/H5FDsrb.c
+++ b/src/H5FDsrb.c
@@ -183,7 +183,12 @@ H5FD_srb_init(void)
*
* Programmer: Raymond Lu
* April 12, 2000
+ *
* Modifications:
+ *
+ * Raymond Lu, 2001-10-25
+ * Use the new generic property list for argument checking.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -195,8 +200,10 @@ H5Pset_fapl_srb(hid_t fapl_id, SRB_Info info)
FUNC_ENTER(H5Pset_fapl_srb, FAIL);
- if(H5P_FILE_ACCESS != H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "Not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
/*connect to SRB server */
fa.srb_conn = clConnect(info.srbHost, info.srbPort, info.srbAuth);
@@ -222,9 +229,16 @@ H5Pset_fapl_srb(hid_t fapl_id, SRB_Info info)
*
* Return: Success: File INFO is returned.
* Failure: Negative
+ *
* Programmer: Raymond Lu
* April 12, 2000
+ *
* Modifications:
+ *
+ * Raymond Lu, 2001-10-25
+ * Use the new generic property list for checking property list
+ * ID.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -235,8 +249,10 @@ H5Pget_fapl_srb(hid_t fapl_id, SRB_Info *info/*out*/)
FUNC_ENTER(H5Pget_fapl_srb, FAIL);
H5TRACE2("e","ix",fapl_id,info);
- if(H5P_FILE_ACCESS != H5Pget_class(fapl_id))
- HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a fapl");
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a file access property list");
if(H5FD_SRB != H5P_get_driver(fapl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
if(NULL==(fa=H5Pget_driver_info(fapl_id)))
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 3c1a0a6..3082f96 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -15,6 +15,7 @@
#include <sys/stat.h>
#include "hdf5.h"
+#include "H5private.h" /* library function */
#ifdef H5_HAVE_STDIO_H
#include <stdio.h>
@@ -227,7 +228,8 @@ H5Pset_fapl_stdio(hid_t fapl_id)
/* Clear the error stack */
H5Eclear();
- if (H5P_FILE_ACCESS!=H5Pget_class(fapl_id)) {
+ if(H5I_GENPROP_LST != H5I_get_type(fapl_id) ||
+ TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) {
H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE,
"not a file access property list", -1);
}
diff --git a/src/H5FDstream.c b/src/H5FDstream.c
index 1c8be7f..d383b7a 100644
--- a/src/H5FDstream.c
+++ b/src/H5FDstream.c
@@ -22,6 +22,7 @@
*/
#include "H5public.h" /* H5_HAVE_STREAM */
+#include "H5private.h" /* library function */
/* Only build this driver if it was configured with --with-Stream-VFD */
#ifdef H5_HAVE_STREAM