summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2001-12-11 19:53:44 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2001-12-11 19:53:44 (GMT)
commitd28fd08f4a9593bd8bb51ebc17b8b6555b3885cd (patch)
tree61e5d32198fc92bdfb2b98115269991f3fadd53b /src/H5P.c
parent33ed41455eff31751d3d9d635140996ebbc61a4e (diff)
downloadhdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.zip
hdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.tar.gz
hdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.tar.bz2
[svn-r4696]
Purpose: Modify H5Fclose behavior Description: The HDF5 actual file close behaves in several ways in terms of if there are still objects(dataset, group, datatype) opened in file. Solution: Added a new file access property, file close degree. It has four values, H5F_CLOSE_DEFAULT H5F_CLOSE_WEAK H5F_CLOSE_SEMI H5F_CLOSE_STRONG The way a file is closed is decided by these values. Platforms tested: IRIX64 6.5, SunOS 5.6, FreeBSD 4.4
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/H5P.c b/src/H5P.c
index f1f6a5c..952c9a9 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -3471,7 +3471,9 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref/*out*/)
/* Get values */
if (gc_ref)
+
if(H5P_get(plist, H5F_ACS_GARBG_COLCT_REF_NAME, gc_ref) < 0)
+
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get garbage collect reference");
done:
@@ -3480,6 +3482,82 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5Pset_fclose_degree
+ *
+ * Purpose: Sets the degree for the file close behavior.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * November, 2001
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_fclose_degree(hid_t plist_id, H5F_close_degree_t degree)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER(H5Pset_fclose_degree, FAIL);
+
+ /* Check args */
+ if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5I_object(plist_id)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Set values */
+ if(H5P_set(plist, H5F_CLOSE_DEGREE_NAME, &degree) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree");
+
+done:
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_fclose_degree
+ *
+ * Purpose: Returns the current setting for the garbage collection
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * June, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER(H5Pget_fclose_degree, FAIL);
+
+ /* Check args */
+ if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5I_object(plist_id)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) )
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree");
+
+done:
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5P_set_vlen_mem_manager
*
* Purpose: Sets the memory allocate/free pair for VL datatypes. The