From b3afaccfe51320c3cb38a2338d17ba8f79c15073 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 25 Oct 2001 14:29:37 -0500 Subject: [svn-r4572] Purpose: Followup file access property list changes. Platforms tested: IRIX64, SunOS 5.7, FreeBSD. --- src/H5FDcore.c | 23 +++++++++++++++++++---- src/H5FDdpss.c | 9 ++++++--- src/H5FDgass.c | 18 ++++++++++++++---- src/H5FDlog.c | 10 ++++++++-- src/H5FDmpio.c | 2 +- src/H5FDmulti.c | 17 +++++++++++++---- src/H5FDsrb.c | 24 ++++++++++++++++++++---- src/H5FDstdio.c | 4 +++- src/H5FDstream.c | 1 + 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 #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 #include "hdf5.h" +#include "H5private.h" /* library function */ #ifdef H5_HAVE_STDIO_H #include @@ -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 -- cgit v0.12