summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-09-30 16:31:55 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-09-30 16:31:55 (GMT)
commitd1e26ae3280320dcc7cd286b4ef77be552bfc244 (patch)
treeb0b85f9e029956209be19e9b28f342a59294c260 /src/H5FDmulti.c
parent4cfb158c292f7707a8a87edfd4b525c6ad7bb4b8 (diff)
downloadhdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.zip
hdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.tar.gz
hdf5-d1e26ae3280320dcc7cd286b4ef77be552bfc244.tar.bz2
[svn-r5951]
Purpose: New API functions Description: Added API functions to return pointer to low-level file handle (H5Fget_vfd_handle and H5FDget_vfd_handle) and related property list setting functions(H5Pset_family_offset and H5Pset_multi_type). Platforms tested: Linux 2.2(eirene), Solaris 2.7(arabica), IRIX64 6.5(modi4)
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 3d56cc9..9a9667e 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -122,6 +122,7 @@ static herr_t H5FD_multi_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD_multi_get_eoa(H5FD_t *_file);
static herr_t H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa);
static haddr_t H5FD_multi_get_eof(H5FD_t *_file);
+static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hsize_t size);
static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, haddr_t addr,
hsize_t size);
@@ -155,6 +156,7 @@ static const H5FD_class_t H5FD_multi_g = {
H5FD_multi_get_eoa, /*get_eoa */
H5FD_multi_set_eoa, /*set_eoa */
H5FD_multi_get_eof, /*get_eof */
+ H5FD_multi_get_handle, /*get_handle */
H5FD_multi_read, /*read */
H5FD_multi_write, /*write */
H5FD_multi_flush, /*flush */
@@ -1516,6 +1518,39 @@ H5FD_multi_get_eof(H5FD_t *_file)
/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_get_handle
+ *
+ * Purpose: Returns the file handle of MULTI file driver.
+ *
+ * Returns: Non-negative if succeed or negative if fails.
+ *
+ * Programmer: Raymond Lu
+ * Sept. 16, 2002
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
+{
+ H5FD_multi_t *file = (H5FD_multi_t *)_file;
+ H5FD_mem_t type, mmt;
+ static const char *func="H5FD_multi_get_handle"; /* Function Name for error reporting */
+
+ /* 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);
+ if(type<H5FD_MEM_DEFAULT || type>=H5FD_MEM_NTYPES)
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
+ mmt = file->fa.memb_map[type];
+ if(H5FD_MEM_DEFAULT==mmt) mmt = type;
+
+ return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle));
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_multi_alloc
*
* Purpose: Allocate file memory.