summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-12-05 17:33:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-12-05 17:33:31 (GMT)
commitb46e9055944a06b642b1ff1a200aea84cdfb34a6 (patch)
tree189ce595bbc6c0ce4ae49f47b635fd1e0b2ee325 /src
parente3c98c2899039b0a3e49205bad3a84ebbfacdff4 (diff)
downloadhdf5-b46e9055944a06b642b1ff1a200aea84cdfb34a6.zip
hdf5-b46e9055944a06b642b1ff1a200aea84cdfb34a6.tar.gz
hdf5-b46e9055944a06b642b1ff1a200aea84cdfb34a6.tar.bz2
[svn-r4673] Purpose:
Backward Compatibility Fix Description: H5Pset_fapl_log's parameters have changed from a simple "verbosity" level to bit-masked flags to enable various behaviors. Solution: Added in v1.4 compat stuff, on the unlikely chance that others are actually using this code in some production way. There are no C++ or FORTRAN wrappers for this call. Platforms tested: FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5FDlog.c48
-rw-r--r--src/H5FDlog.h4
2 files changed, 52 insertions, 0 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 27359b2..6a3d077 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -252,6 +252,53 @@ H5FD_log_init(void)
FUNC_LEAVE(H5FD_LOG_g);
}
+#ifdef H5_WANT_H5_V1_4_COMPAT
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_fapl_log
+ *
+ * Purpose: Modify the file access property list to use the H5FD_LOG
+ * driver defined in this source file. There are no driver
+ * specific properties.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Thursday, February 19, 1998
+ *
+ * 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
+H5Pset_fapl_log(hid_t fapl_id, char *logfile, int verbosity)
+{
+ H5FD_log_fapl_t fa; /* File access property list information */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=FAIL;
+
+ FUNC_ENTER(H5Pset_fapl_log, FAIL);
+ H5TRACE3("e","isIs",fapl_id,logfile,verbosity);
+
+ if(TRUE!=H5P_isa_class(fapl_id,H5P_FILE_ACCESS) || NULL == (plist = H5I_object(fapl_id)))
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+
+ fa.logfile=logfile;
+ if(verbosity>0) {
+ fa.flags=H5FD_LOG_LOC_IO|H5FD_LOG_FLAVOR;
+ if(verbosity>1)
+ fa.flags|=H5FD_LOG_FILE_IO;
+ } /* end if */
+ fa.buf_size=32*(1024*1024);
+ ret_value= H5P_set_driver(plist, H5FD_LOG, &fa);
+
+ FUNC_LEAVE(ret_value);
+}
+#else /* H5_WANT_H5_V1_4_COMPAT */
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_log
@@ -293,6 +340,7 @@ H5Pset_fapl_log(hid_t fapl_id, char *logfile, unsigned flags, size_t buf_size)
FUNC_LEAVE(ret_value);
}
+#endif /* H5_WANT_H5_V1_4_COMPAT */
/*-------------------------------------------------------------------------
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index 9319999..07f43ae 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -47,7 +47,11 @@ extern "C" {
#endif
__DLL__ hid_t H5FD_log_init(void);
+#ifdef H5_WANT_H5_V1_4_COMPAT
+__DLL__ herr_t H5Pset_fapl_log(hid_t fapl_id, char *logfile, int verbosity);
+#else /* H5_WANT_H5_V1_4_COMPAT */
__DLL__ herr_t H5Pset_fapl_log(hid_t fapl_id, char *logfile, unsigned flags, size_t buf_size);
+#endif /* H5_WANT_H5_V1_4_COMPAT */
#ifdef __cplusplus
}