summaryrefslogtreecommitdiffstats
path: root/src/H5M.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1997-08-15 16:06:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1997-08-15 16:06:12 (GMT)
commitfdb45fa4fa3c0e0749deb2b40c6246543ba47cf1 (patch)
treeb766f5bc4aa6143f76e15d4e773985ac20aa7a88 /src/H5M.c
parent876badec3f143c1ca90f240c02e09e54b1b20608 (diff)
downloadhdf5-fdb45fa4fa3c0e0749deb2b40c6246543ba47cf1.zip
hdf5-fdb45fa4fa3c0e0749deb2b40c6246543ba47cf1.tar.gz
hdf5-fdb45fa4fa3c0e0749deb2b40c6246543ba47cf1.tar.bz2
[svn-r31] Added code for H5Mget_file & H5Mflush and re-targeted some of the H5D calls
to use them.
Diffstat (limited to 'src/H5M.c')
-rw-r--r--src/H5M.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/H5M.c b/src/H5M.c
index 101adbc..57a042e 100644
--- a/src/H5M.c
+++ b/src/H5M.c
@@ -25,6 +25,7 @@ static char RcsId[] = "@(#)$Revision$";
EXPORTED ROUTINES
H5Mcreate -- Create an object
H5Mcopy -- Copy an object
+ H5Mget_file -- Get the file ID for an object
H5Mrelease -- Release access to an object
LIBRARY-SCOPED ROUTINES
@@ -208,6 +209,92 @@ done:
/*--------------------------------------------------------------------------
NAME
+ H5Mflush
+ PURPOSE
+ Flush an HDF5 object out to a file.
+ USAGE
+ hatom_t H5Mget_file(oid)
+ hatom_t oid; IN: Object to flush
+ RETURNS
+ SUCCEED/FAIL
+ DESCRIPTION
+ This function re-directs the object's flush into the appropriate
+ interface, as defined by the function pointers in hdf5fptr.h
+--------------------------------------------------------------------------*/
+hatom_t H5Mflush(hatom_t oid)
+{
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER(H5Mflush, H5M_init_interface, FAIL);
+
+ /* Clear errors and check args and all the boring stuff. */
+ H5ECLEAR;
+ if(group<=BADGROUP || group>=MAXGROUP)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+
+ i=H5M_find_type(group);
+ if(meta_func_arr[i].flush==NULL)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ ret_value=meta_func_arr[i].flush(oid);
+
+done:
+ if(ret_value == FAIL)
+ { /* Error condition cleanup */
+
+ } /* end if */
+
+ /* Normal function cleanup */
+
+ FUNC_LEAVE(ret_value);
+} /* end H5Mflush() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5Mget_file
+ PURPOSE
+ Get the file ID an HDF5 object.
+ USAGE
+ hatom_t H5Mget_file(oid)
+ hatom_t oid; IN: Object to query
+ RETURNS
+ SUCCEED/FAIL
+ DESCRIPTION
+ This function re-directs the object's query into the appropriate
+ interface, as defined by the function pointers in hdf5fptr.h
+--------------------------------------------------------------------------*/
+hatom_t H5Mget_file(hatom_t oid)
+{
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER(H5Mget_file, H5M_init_interface, FAIL);
+
+ /* Clear errors and check args and all the boring stuff. */
+ H5ECLEAR;
+ if(group<=BADGROUP || group>=MAXGROUP)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+
+ i=H5M_find_type(group);
+ if(meta_func_arr[i].get_file==NULL)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ ret_value=meta_func_arr[i].get_file(oid);
+
+done:
+ if(ret_value == FAIL)
+ { /* Error condition cleanup */
+
+ } /* end if */
+
+ /* Normal function cleanup */
+
+ FUNC_LEAVE(ret_value);
+} /* end H5Mget_file() */
+
+/*--------------------------------------------------------------------------
+ NAME
H5Mrelease
PURPOSE
Release access to an HDF5 object.