diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 1997-08-28 17:14:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 1997-08-28 17:14:35 (GMT) |
commit | a39e0ef324c57105c09e84f4aee878595a320a41 (patch) | |
tree | 401eaf34c9864657784d486b79c2cae1da1b0614 /src/H5M.c | |
parent | e8d5c25431dd926d04f35cc06ab2027db86869cf (diff) | |
download | hdf5-a39e0ef324c57105c09e84f4aee878595a320a41.zip hdf5-a39e0ef324c57105c09e84f4aee878595a320a41.tar.gz hdf5-a39e0ef324c57105c09e84f4aee878595a320a41.tar.bz2 |
[svn-r47] Finished flashing out the H5M* functions calls. Cleaned up non-compiling
source. Finished adding in remainder of H5Osdtyp.c functions.
Diffstat (limited to 'src/H5M.c')
-rw-r--r-- | src/H5M.c | 407 |
1 files changed, 406 insertions, 1 deletions
@@ -24,8 +24,18 @@ static char RcsId[] = "@(#)$Revision$"; EXPORTED ROUTINES H5Mcreate -- Create an object + H5Maccess -- Start access to an existing object H5Mcopy -- Copy an object + H5Mfind_name -- Find an object by name + H5Mname_len -- Get the length of an object's name + H5Mget_name -- Get an object's name + H5Mset_name -- Set an object's name + H5Msearch -- Wildcard search for an object by name + H5Mindex -- Get an object by index + H5Mflush -- Flush an object out to disk + H5Mdelete -- Delete an object from disk H5Mget_file -- Get the file ID for an object + H5Mget_file -- Get the parent ID for an object H5Mrelease -- Release access to an object LIBRARY-SCOPED ROUTINES @@ -236,6 +246,48 @@ done: FUNC_LEAVE(ret_value); } /* end H5Mcreate() */ +/*-------------------------------------------------------------------------- + NAME + H5Maccess + PURPOSE + Start access to an existing HDF5 object. + USAGE + hatom_t H5Maccess(owner_id) + hatom_t oid; IN: OID of the object to access. + RETURNS + Returns ID (atom) on success, FAIL on failure + DESCRIPTION + This function re-directs the object's access into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +hatom_t H5Maccess(hatom_t oid) +{ + group_t group=H5Aatom_group(oid); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Maccess, 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].access==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].access(oid); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Maccess() */ /*-------------------------------------------------------------------------- NAME @@ -282,11 +334,277 @@ done: /*-------------------------------------------------------------------------- NAME + H5Mfind_name + PURPOSE + Find an HDF5 object by name. + USAGE + hatom_t H5Mfind_name(owner_id, type, name) + hatom_t owner_id; IN: Group/file in which to search + hobjtype_t type; IN: Type of object to search names of + const char *name; IN: Name of the object to search for + RETURNS + Returns ID (atom) on success, FAIL on failure + DESCRIPTION + This function re-directs the object's "find name" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +hatom_t H5Mfind_name(hatom_t owner_id, hobjtype_t type, const char *name) +{ + group_t group=H5Aatom_group(owner_id); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Mfind_name, 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].find_name==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].find_name(owner_id,type,name); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mfind_name() */ + +/*-------------------------------------------------------------------------- + NAME + H5Mname_len + PURPOSE + Determine the length of the name of an HDF5 object. + USAGE + uint32 H5Mname_len(oid) + hatom_t oid; IN: Object to get name's length + RETURNS + SUCCEED/FAIL + DESCRIPTION + This function re-directs the object's "name length" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +uint32 H5Mname_len(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(H5Mname_len, 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].name_len==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].name_len(oid); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mname_len() */ + +/*-------------------------------------------------------------------------- + NAME + H5Mget_name + PURPOSE + Get the name of an HDF5 object. + USAGE + herr_t H5Mget_name(oid, name) + hatom_t oid; IN: Object to retreive name of + char *name; OUT: Buffer to place object's name in + RETURNS + SUCCEED/FAIL + DESCRIPTION + This function re-directs the object's "get name" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +herr_t H5Mget_name(hatom_t oid, char *name) +{ + group_t group=H5Aatom_group(oid); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Mget_name, 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_name==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].get_name(oid,name); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mget_name() */ + +/*-------------------------------------------------------------------------- + NAME + H5Mset_name + PURPOSE + Set the name of an HDF5 object. + USAGE + herr_t H5Mget_name(oid, name) + hatom_t oid; IN: Object to set name of + const char *name; IN: Name to use for object + RETURNS + SUCCEED/FAIL + DESCRIPTION + This function re-directs the object's "set name" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +herr_t H5Mset_name(hatom_t oid, const char *name) +{ + group_t group=H5Aatom_group(oid); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Mset_name, 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].set_name==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].set_name(oid,name); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mset_name() */ + +/*-------------------------------------------------------------------------- + NAME + H5Msearch + PURPOSE + Wildcard search for an HDF5 object by name. + USAGE + hatom_t H5Mfind_name(owner_id, type, name) + hatom_t owner_id; IN: Group/file in which to search + hobjtype_t type; IN: Type of object to search names of + const char *name; IN: Name of the object to search for + RETURNS + Returns ID (atom) on success, FAIL on failure + DESCRIPTION + This function re-directs the object's "search" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +hatom_t H5Msearch(hatom_t oid, hobjtype_t type, const char *name) +{ + group_t group=H5Aatom_group(oid); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Msearch, 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].search==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].search(oid,type,name); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Msearch() */ + +/*-------------------------------------------------------------------------- + NAME + H5Mindex + PURPOSE + Get an HDF5 object by index. + USAGE + hatom_t H5Mindex(oid, type, idx) + hatom_t oid; IN: Group/file in which to find items + hobjtype_t type; IN: Type of object to get + uint32 idx; IN: Index of the object to get + RETURNS + Returns ID (atom) on success, FAIL on failure + DESCRIPTION + This function re-directs the object's "index" into the appropriate + interface, as defined by the function pointers in hdf5fptr.h +--------------------------------------------------------------------------*/ +hatom_t H5Mindex(hatom_t oid, hobjtype_t type, uint32 idx) +{ + group_t group=H5Aatom_group(oid); /* Atom group for incoming object */ + intn i; /* local counting variable */ + hatom_t ret_value = SUCCEED; + + FUNC_ENTER(H5Mindex, 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].index==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].index(oid,type,idx); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mindex() */ + +/*-------------------------------------------------------------------------- + NAME H5Mflush PURPOSE Flush an HDF5 object out to a file. USAGE - hatom_t H5Mget_file(oid) + hatom_t H5Mflush(oid) hatom_t oid; IN: Object to flush RETURNS SUCCEED/FAIL @@ -325,6 +643,93 @@ done: /*-------------------------------------------------------------------------- NAME + H5Mdelete + PURPOSE + Delete an HDF5 object from a file. + USAGE + herr_t H5Mdelete(oid) + hatom_t oid; IN: Object to delete + RETURNS + SUCCEED/FAIL + DESCRIPTION + This function re-directs the object's delete into the appropriate + interface, as defined by the function pointers in hdf5fptr.h. Deleting + an object implicitly ends access to it. +--------------------------------------------------------------------------*/ +herr_t H5Mdelete(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(H5Mdelete, 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].delete==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].delete(oid); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mdelete() */ + +/*-------------------------------------------------------------------------- + NAME + H5Mget_parent + PURPOSE + Get the parent ID an HDF5 object. + USAGE + hatom_t H5Mget_parent(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_parent(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_parent, 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_parent==NULL) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL); + ret_value=meta_func_arr[i].get_parent(oid); + +done: + if(ret_value == FAIL) + { /* Error condition cleanup */ + + } /* end if */ + + /* Normal function cleanup */ + + FUNC_LEAVE(ret_value); +} /* end H5Mget_parent() */ + +/*-------------------------------------------------------------------------- + NAME H5Mget_file PURPOSE Get the file ID an HDF5 object. |