summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-08-24 12:52:10 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-08-24 12:52:10 (GMT)
commit296d9cf76640fa1aab51479def07119236f86cb9 (patch)
treefed33399626284a57091730a748309d709edb13a /src/H5FD.c
parent8e338a50298bbd928e919cd2dbd30e57e8b322ce (diff)
downloadhdf5-296d9cf76640fa1aab51479def07119236f86cb9.zip
hdf5-296d9cf76640fa1aab51479def07119236f86cb9.tar.gz
hdf5-296d9cf76640fa1aab51479def07119236f86cb9.tar.bz2
[svn-r1585] Changes since 19990820
---------------------- ./src/H5D.c Added additional elements to a variable initializer in H5Dvlen_get_buf_size() to shut up a warning message. Also added the API tracing call. ./src/H5F.c Added file opening optimizations. If the driver doesn't support the ability to determine when two file handles refer to the same file (like MPIO and GASS) then H5F_open() makes fewer calls to the driver's open callback. Also, if the tentative file access flags are the same as the original flags then H5F_open() makes fewer calls to the file device. ./src/H5FD.c ./src/H5FDprivate.h ./src/H5FDpublic.h Added H5FD_get_class() so the library can get information about what file driver callbacks are defined. This will be useful when more optimization functions are added to the VFL, such as for MPIO derived datatype I/O. ./src/H5FDcore.c ./src/H5FDfamily.c ./src/H5FDmpio.c ./src/H5FDmulti.c ./src/H5FDsec2.c The driver symbols (like H5FD_CORE, etc) are actually function calls. The functions were fixed to return correct values even after calling H5close(). ./src/H5FDmulti.c ./src/H5FDmulti.h Added support for opening a file when parts are missing (only if the caller explicitly allows that in the file access property list). Moved some common code sequences into macros or functions. Added better support for reopening files. All the application has to know is that the file is a multi file and the base name from which all the member names are created. More debugging output when the file is opened with the H5F_ACC_DEBUG flag. Fixed various bugs. ./src/H5Fistore.c Chunked raw data was accidently allocated as meta data instead of raw data. ./src/H5I.c The H5Iget_type() function fails when invoked with an old object ID (an ID which has been closed down). ./test/h5test.c Added an extra argument when setting the multi file access property lists so the test fails if it can't open one of the sub-files. ./tools/h5ls.c Improved the algorithm for deciding what file driver to use. It basically tries all of the predefined drivers and is now able to open family, split, and multi files without looking for special characters in the file name. Added `-e' and `--errors' switches which cause errors from libhdf5 to be reported on stderr in addition to the simple error message displayed by h5ls.
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 86759d7..c025090 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -247,6 +247,69 @@ H5FDunregister(hid_t driver_id)
/*-------------------------------------------------------------------------
+ * Function: H5FD_get_class
+ *
+ * Purpose: Optains a pointer to the driver struct containing all the
+ * callback pointers, etc. The PLIST_ID argument can be a file
+ * access property list, a data transfer property list, or a
+ * file driver identifier.
+ *
+ * Return: Success: Ptr to the driver information. The pointer is
+ * only valid as long as the driver remains
+ * registered or some file or property list
+ * exists which references the driver.
+ *
+ * Failure: NULL
+ *
+ * Programmer: Robb Matzke
+ * Friday, August 20, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+H5FD_class_t *
+H5FD_get_class(hid_t id)
+{
+ H5FD_class_t *ret_value=NULL;
+ H5F_access_t *fapl=NULL;
+ H5F_xfer_t *dxpl=NULL;
+
+ FUNC_ENTER(H5FD_get_class, NULL);
+
+ if (H5P_DEFAULT==id) {
+ ret_value = H5FD_get_class(H5F_access_dflt.driver_id);
+ } else if (H5I_VFL==H5I_get_type(id)) {
+ ret_value = H5I_object(id);
+ } else {
+ switch (H5P_get_class(id)) {
+ case H5P_FILE_ACCESS:
+ if (NULL==(fapl=H5I_object(id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
+ "not a file access property list");
+ }
+ ret_value = H5FD_get_class(fapl->driver_id);
+ break;
+
+ case H5P_DATA_XFER:
+ if (NULL==(dxpl=H5I_object(id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
+ "not a data transfer property list");
+ }
+ ret_value = H5FD_get_class(dxpl->driver_id);
+ break;
+
+ default:
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
+ "not a driver id, file access property list or "
+ "data transfer property list");
+ }
+ }
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_sb_size
*
* Purpose: Obtains the number of bytes required to store the driver file