summaryrefslogtreecommitdiffstats
path: root/src/H5M.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-12-10 22:41:07 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-12-10 22:41:07 (GMT)
commit082dd8cda9ef3d49be23dfce49e10dd30d0758bc (patch)
treee60a32468ba14f758849f34454fdd8722b72edaa /src/H5M.c
parent3aee91269b83b09a186d214c55873fbbfa15602d (diff)
downloadhdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.zip
hdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.tar.gz
hdf5-082dd8cda9ef3d49be23dfce49e10dd30d0758bc.tar.bz2
[svn-r139] ./src/*.[ch]
Removed the interface initialization argument from FUNC_ENTER() and made it a locally-defined preprocessor symbol, INTERFACE_INIT. Changed `offset' to `address' and `length' to `size' in documentation so it's more consistent. `Offset' still appears occassionally when it refers to a byte offset within some other data structure. Moved interface termination function prototypes from public header files to .c files and made them static. ./src/H5.c ./src/H5public.h Added H5init() because it's possible that the predefined data types are not initialized. This happens only if the first call to the hdf5 library passes a predefined data type symbol as an argument. There should be some way to fix this... ./src/H5A.c ./src/H5Aprivate.h ./src/H5Apublic.h The free_func returns SUCCEED or FAIL, although the return value is ignored by H5A. This is so we can use the various H5*_close() functions to free things. H5Ainc_ref() and H5Adec_ref() are no longer public. Many of the other atom functions should also be made private, but I'll save that for later... Added additional template groups called H5_TEMPLATE_0 through H5_TEMPLATE_7 that are used by the various template subclasses. Increased the number of bits used for atom groups to prevent negative atoms. ./src/H5AC.c ./src/H5ACprivate.h Changed H5AC_new() to H5AC_create() to make names more consistent. ./src/H5B.c ./src/H5Bprivate.h Changed H5B_new() to H5B_create() to make names more consistent. ./src/H5C.c ./src/H5Cprivate.h ./src/H5Cpublic.h Now supports multiple subclasses of templates, although it's done with big switch statements. The default values for templates are defined in the source file to which that template belongs. This got rid of lots of needless preprocessor constants. Added H5Ccreate() to create a new template. Changed H5C_release() to H5Cclose() to make the naming more consistent. ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h Enhanced to use the new dataset interface, and uses the enhanced data type and data space interfaces, which haven't been completely implemented. The dataset interface doesn't handle non-contiguous storage, compression, or data type and space conversions yet. ./src/H5F.c ./src/H5Fprivate.h ./src/H5Fpublic.h Removed H5Fflush() since just calls H5F_flush(), which doesn't do what the user would probably think it does, namely, flush everything. It only flushes those things sitting in the H5AC cache and the boot block. Changed the `file_create_parms' field of H5F_low_t to just `create_parms' since the `file' part is obvious. ./src/H5Fistore.c Added some support for external files. Mostly just in the file format and not supported much by the library yet. I need to finish some dataset functions first. Changed H5F_istore_new() to H5F_istore_create() to make names more uniform across packages. ./src/H5Flow.c Flushing a file causes the file to be physically extended to the logical eof. This prevents H5F_open() from thinking a file has been truncated. Most of the time the file will already be that large, and when it isn't Unix will often just allocate the final block anyway. ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gstab.c Removed H5G_basename() Removed (temporarily) data type information from symbol table entries and renamed H5G_CACHED_SDATA to H5G_CACHED_SDSPACE to reflect that it's a simple data space and has nothing to do with raw data. Changed H5G_node_new() to H5G_node_create() and H5G_stab_new() to H5G_stab_create() to make names more uniform across packages. Fixed an undefined address bug that happens when H5G_node_debug() program doesn't pass enough info to H5G_node_load(). ./src/H5H.c ./src/H5Hprivate.h Changed H5H_new() to H5H_create() to make the names more uniform across packages. ./src/H5M.c ./src/H5Mprivate.h ./src/H5Mpublic.h Nulled all the create functions. Most of the other callbacks are to public functions. Removed H5Mcreate(). Changed hobjtype_t to group_t since it has to be the same thing anyway. ./src/H5O.c ./src/H5Oprivate.h ./src/H5Osdim.c ./src/H5Osdtyp.c Changed H5O_SIM_DIM to H5O_SDSPACE (simple data space) since `simple data space' is its official name, not `simple dimensions'. Will eventually add H5O_CDSPACE for comples data spaces. Changed _sim_dim_ to _dspace_. Replaced H5O_SIM_DTYPE and the compound data type messages with a single H5O_DTYPE message. Changed _sim_dtype_ to _dtype_. Changed H5O_STD_STORE to H5O_CSTORE (contiguous storage) since contiguous storage is not necessarily standard. Changed _std_store_ to _cstore_ in H5Ocstore.c Added the H5O_EFL (external file list) message. Changed H5O_new() to H5O_create() to make names more uniform across packages. ./src/H5Oefl.c NEW External file list message for specifying which non-hdf5 files contain raw data for a dataset. ./src/H5P.c ./src/H5Pprivate.h ./src/H5Ppublic.h Renamed and moved data structures to make the names conform to our naming scheme. ./src/H5T.c ./src/H5Tprivate.h ./src/H5Tpublic.h ./src/H5Tpkg.h NEW Data structures redesigned to be more flexible. The interface was redesigned to make it more regular and to make some names more uniform across packages. ./src/H5detect.c Output was changed to produce a file that conforms to the hdf5 coding standard. ./src/Makefile.in Generates H5Tinit.c by running H5detect. ./src/debug.c Moved command argument processing.
Diffstat (limited to 'src/H5M.c')
-rw-r--r--src/H5M.c508
1 files changed, 233 insertions, 275 deletions
diff --git a/src/H5M.c b/src/H5M.c
index 750fe17..d1911bd 100644
--- a/src/H5M.c
+++ b/src/H5M.c
@@ -1,13 +1,13 @@
/****************************************************************************
-* NCSA HDF *
-* Software Development Group *
-* National Center for Supercomputing Applications *
-* University of Illinois at Urbana-Champaign *
-* 605 E. Springfield, Champaign IL 61820 *
-* *
-* For conditions of distribution and use, see the accompanying *
-* hdf/COPYING file. *
-* *
+* NCSA HDF *
+* Software Development Group *
+* National Center for Supercomputing Applications *
+* University of Illinois at Urbana-Champaign *
+* 605 E. Springfield, Champaign IL 61820 *
+* *
+* For conditions of distribution and use, see the accompanying *
+* hdf/COPYING file. *
+* *
****************************************************************************/
#ifdef RCSID
@@ -23,20 +23,19 @@ static char RcsId[] = "@(#)$Revision$";
HDF5 "Meta-Object" routines
EXPORTED ROUTINES
- H5Mcreate -- Create an object
H5Maccess -- Start access to an existing object
- H5Mcopy -- Copy an object
- H5Mfind_name -- Find an object by name
+ H5Mcopy -- Copy an object
+ H5Mopen -- 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
+ 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
+ H5Mclose -- Release access to an object
LIBRARY-SCOPED ROUTINES
@@ -44,94 +43,93 @@ static char RcsId[] = "@(#)$Revision$";
H5M_init_interface -- initialize the interface
+ */
-#include <H5private.h> /* Generic functions */
-#include <H5Cprivate.h> /* Template interface */
+#include <H5private.h> /* Generic functions */
+#include <H5Cprivate.h> /* Template interface */
#include <H5Dprivate.h> /* Dataset interface */
-#include <H5Eprivate.h> /*error handling */
+#include <H5Eprivate.h> /*error handling */
#include <H5Pprivate.h> /* Dataspace functions */
-#include <H5Tprivate.h> /* Datatype interface */
+#include <H5Tprivate.h> /* Datatype interface */
#include <H5Mprivate.h> /* Meta-object interface */
-#include <H5Cprivate.h> /* Template interface */
+#include <H5Cprivate.h> /* Template interface */
#define PABLO_MASK H5M_mask
/*--------------------- Locally scoped variables -----------------------------*/
-/* Whether we've installed the library termination function yet for this interface */
-static intn interface_initialize_g = FALSE;
-
static meta_func_t meta_func_arr[]={
- { /* Template object meta-functions (defined in H5C.c) */
- H5_TEMPLATE, /* File-Creation Template Type ID */
- H5C_create, /* File-Creation Template Create */
- NULL, /* File-Creation Template Access */
- H5C_copy, /* File-Creation Template Copy */
- NULL, /* File-Creation Template FindName */
- NULL, /* File-Creation Template NameLen */
- NULL, /* File-Creation Template GetName */
- NULL, /* File-Creation Template SetName */
- NULL, /* File-Creation Template Search */
- NULL, /* File-Creation Template Index */
- NULL, /* File-Creation Template Flush */
- NULL, /* File-Creation Template Delete */
- NULL, /* File-Creation Template GetParent */
- NULL, /* File-Creation Template GetFile */
- H5C_release /* File-Creation Template Release */
+ { /* Template object meta-functions (defined in H5C.c) */
+ H5_TEMPLATE_0, /* File-Creation Template Type ID */
+ NULL, /* File-Creation Template Create */
+ NULL, /* File-Creation Template Access */
+ H5Ccopy, /* File-Creation Template Copy */
+ NULL, /* File-Creation Template FindName */
+ NULL, /* File-Creation Template NameLen */
+ NULL, /* File-Creation Template GetName */
+ NULL, /* File-Creation Template SetName */
+ NULL, /* File-Creation Template Search */
+ NULL, /* File-Creation Template Index */
+ NULL, /* File-Creation Template Flush */
+ NULL, /* File-Creation Template Delete */
+ NULL, /* File-Creation Template GetParent */
+ NULL, /* File-Creation Template GetFile */
+ H5Cclose /* File-Creation Template Release */
},
- { /* Datatype object meta-functions (defined in H5T.c) */
- H5_DATATYPE, /* Datatype Type ID */
- H5T_create, /* Datatype Create */
- NULL, /* Datatype Access */
- NULL, /* Dataspace Copy */
- NULL, /* Datatype FindName */
- NULL, /* Datatype NameLen */
- NULL, /* Datatype GetName */
- NULL, /* Datatype SetName */
- NULL, /* Datatype Search */
- NULL, /* Datatype Index */
- NULL, /* Datatype Flush */
- NULL, /* Datatype Delete */
- NULL, /* Datatype GetParent */
- NULL, /* Datatype GetFile */
- H5T_release /* Datatype Release */
+ { /* Datatype object meta-functions (defined in H5T.c) */
+ H5_DATATYPE, /* Datatype Type ID */
+ NULL, /* Datatype Create */
+ NULL, /* Datatype Access */
+ H5Tcopy, /* Dataspace Copy */
+ NULL, /* Datatype FindName */
+ NULL, /* Datatype NameLen */
+ NULL, /* Datatype GetName */
+ NULL, /* Datatype SetName */
+ NULL, /* Datatype Search */
+ NULL, /* Datatype Index */
+ NULL, /* Datatype Flush */
+ NULL, /* Datatype Delete */
+ NULL, /* Datatype GetParent */
+ NULL, /* Datatype GetFile */
+ H5Tclose /* Datatype Release */
},
- { /* Dimensionality object meta-functions (defined in H5P.c) */
- H5_DATASPACE, /* Dimensionality Type ID */
- H5P_create, /* Dimensionality Create */
- NULL, /* Dimensionality Access */
- NULL, /* Dimensionality Copy */
- NULL, /* Dimensionality FindName */
- NULL, /* Dimensionality NameLen */
- NULL, /* Dimensionality GetName */
- NULL, /* Dimensionality SetName */
- NULL, /* Dimensionality Search */
- NULL, /* Dimensionality Index */
- NULL, /* Dimensionality Flush */
- NULL, /* Dimensionality Delete */
- NULL, /* Dimensionality GetParent */
- NULL, /* Dimensionality GetFile */
- H5P_release /* Dimensionality Release */
+ { /* Dimensionality object meta-functions (defined in H5P.c) */
+ H5_DATASPACE, /* Dimensionality Type ID */
+ NULL, /* Dimensionality Create */
+ NULL, /* Dimensionality Access */
+ NULL, /* Dimensionality Copy */
+ NULL, /* Dimensionality FindName */
+ NULL, /* Dimensionality NameLen */
+ NULL, /* Dimensionality GetName */
+ NULL, /* Dimensionality SetName */
+ NULL, /* Dimensionality Search */
+ NULL, /* Dimensionality Index */
+ NULL, /* Dimensionality Flush */
+ NULL, /* Dimensionality Delete */
+ NULL, /* Dimensionality GetParent */
+ NULL, /* Dimensionality GetFile */
+ H5Pclose /* Dimensionality Release */
},
- { /* Dataset object meta-functions (defined in H5D.c) */
- H5_DATASET, /* Dataset Type ID */
- H5D_create, /* Dataset Create */
- NULL, /* Dataset Access */
- NULL, /* Dataset Copy */
- H5D_find_name, /* Dataset FindName */
- NULL, /* Dataset NameLen */
- NULL, /* Dataset GetName */
- NULL, /* Dataset SetName */
- NULL, /* Dataset Search */
- NULL, /* Dataset Index */
- H5D_flush, /* Dataset Flush */
- NULL, /* Dataset Delete */
- NULL, /* Dataset GetParent */
- NULL, /* Dataset GetFile */
- H5D_release /* Dataset Release */
+ { /* Dataset object meta-functions (defined in H5D.c) */
+ H5_DATASET, /* Dataset Type ID */
+ NULL, /* Dataset Create */
+ NULL, /* Dataset Access */
+ NULL, /* Dataset Copy */
+ H5D_find_name, /* Dataset FindName */
+ NULL, /* Dataset NameLen */
+ NULL, /* Dataset GetName */
+ NULL, /* Dataset SetName */
+ NULL, /* Dataset Search */
+ NULL, /* Dataset Index */
+ NULL, /* Dataset Flush */
+ NULL, /* Dataset Delete */
+ NULL, /* Dataset GetParent */
+ NULL, /* Dataset GetFile */
+ H5Dclose /* Dataset Release */
},
};
-/*------------------_-- Local function prototypes ----------------------------*/
+/* Interface initialization */
+static intn interface_initialize_g = FALSE;
+#define INTERFACE_INIT H5M_init_interface
static herr_t H5M_init_interface(void);
/*--------------------------------------------------------------------------
@@ -153,7 +151,7 @@ MODIFICATIONS
static herr_t H5M_init_interface(void)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER (H5M_init_interface, NULL, FAIL);
+ FUNC_ENTER (H5M_init_interface, FAIL);
FUNC_LEAVE(ret_value);
} /* H5M_init_interface */
@@ -165,20 +163,21 @@ static herr_t H5M_init_interface(void)
Find the type of meta-object to issue a method call on
USAGE
intn H5M_find_type(type)
- hobjtype_t type; IN: Type of object to create
+ hobjtype_t type; IN: Type of object to create
RETURNS
Returns the index of the type in the array of methods on success, or FAIL
- on failure.
+ on failure.
DESCRIPTION
- This function performs a search to find the index of the type of a
+ This function performs a search to find the index of the type of a
meta-object in the array of function pointers.
--------------------------------------------------------------------------*/
-static intn H5M_find_type(hobjtype_t type)
+static intn
+H5M_find_type (group_t type)
{
- intn i; /* local counting variable */
+ intn i; /* local counting variable */
intn ret_value = FAIL;
- FUNC_ENTER(H5M_find_type, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5M_find_type, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
@@ -188,8 +187,8 @@ static intn H5M_find_type(hobjtype_t type)
* to a binary search when it becomes too slow.
*/
for(i=0; i<(sizeof(meta_func_arr)/sizeof(meta_func_t)); i++)
- if(type==meta_func_arr[i].type)
- HGOTO_DONE(i);
+ if(type==meta_func_arr[i].type)
+ HGOTO_DONE(i);
done:
if(ret_value == FAIL)
@@ -204,69 +203,25 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5Mcreate
- PURPOSE
- Create a new HDF5 object.
- USAGE
- hid_t H5Mcreate(owner_id, type, name)
- hid_t owner_id; IN: Group/file which owns this object
- hobjtype_t type; IN: Type of object to create
- const char *name; IN: Name of the object
- RETURNS
- Returns ID (atom) on success, FAIL on failure
- DESCRIPTION
- This function re-directs the object's creation into the appropriate
- interface, as defined by the function pointers in hdf5fptr.h
---------------------------------------------------------------------------*/
-hid_t H5Mcreate(hid_t owner_id, hobjtype_t type, const char *name)
-{
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
-
- FUNC_ENTER(H5Mcreate, H5M_init_interface, FAIL);
-
- /* Clear errors and check args and all the boring stuff. */
- H5ECLEAR;
- if(type<=BADGROUP || type>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
-
- i=H5M_find_type(type);
- if(meta_func_arr[i].create==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
- ret_value=(meta_func_arr[i].create)(owner_id,type,name);
-
-done:
- if(ret_value == FAIL)
- { /* Error condition cleanup */
-
- } /* end if */
-
- /* Normal function cleanup */
-
- FUNC_LEAVE(ret_value);
-} /* end H5Mcreate() */
-
-/*--------------------------------------------------------------------------
- NAME
H5Maccess
PURPOSE
Start access to an existing HDF5 object.
USAGE
hid_t H5Maccess(owner_id)
- hid_t oid; IN: OID of the object to access.
+ hid_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
+ This function re-directs the object's access into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Maccess(hid_t oid)
{
- group_t group;
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ group_t group;
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Maccess, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Maccess, FAIL);
/* Atom group for incoming object */
group = H5Aatom_group (oid);
@@ -274,15 +229,15 @@ hid_t H5Maccess(hid_t oid)
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].access)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -299,33 +254,33 @@ done:
Copy an HDF5 object.
USAGE
hid_t H5Mcopy(oid)
- hid_t oid; IN: Object to copy
+ hid_t oid; IN: Object to copy
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's copy into the appropriate
+ This function re-directs the object's copy into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mcopy(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ herr_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mcopy, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mcopy, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
i=H5M_find_type(group);
if(meta_func_arr[i].copy==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].copy)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -342,44 +297,45 @@ done:
Find an HDF5 object by name.
USAGE
hid_t H5Mfind_name(owner_id, type, name)
- hid_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
+ hid_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
+ This function re-directs the object's "find name" into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
-hid_t H5Mfind_name(hid_t owner_id, hobjtype_t type, const char *name)
+hid_t
+H5Mfind_name (hid_t owner_id, group_t type, const char *name)
{
#ifdef OLD_WAY
group_t group=H5Aatom_group(owner_id); /* Atom group for incoming object */
#endif /* OLD_WAY */
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mfind_name, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mfind_name, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
#ifdef OLD_WAY
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
i=H5M_find_type(group);
#else /* OLD_WAY */
if(type<=BADGROUP || type>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
i=H5M_find_type(type);
#endif /* OLD_WAY */
if(meta_func_arr[i].find_name==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].find_name)(owner_id,type,name);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -396,33 +352,33 @@ done:
Determine the length of the name of an HDF5 object.
USAGE
uint32 H5Mname_len(oid)
- hid_t oid; IN: Object to get name's length
+ hid_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
+ 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(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ 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);
+ FUNC_ENTER(H5Mname_len, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].name_len)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -439,34 +395,34 @@ done:
Get the name of an HDF5 object.
USAGE
herr_t H5Mget_name(oid, name)
- hid_t oid; IN: Object to retreive name of
- char *name; OUT: Buffer to place object's name in
+ hid_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
+ 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(hid_t oid, char *name)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mget_name, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mget_name, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].get_name)(oid,name);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -483,34 +439,34 @@ done:
Set the name of an HDF5 object.
USAGE
herr_t H5Mget_name(oid, name)
- hid_t oid; IN: Object to set name of
- const char *name; IN: Name to use for object
+ hid_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
+ 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(hid_t oid, const char *name)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mset_name, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mset_name, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].set_name)(oid,name);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -527,35 +483,36 @@ done:
Wildcard search for an HDF5 object by name.
USAGE
hid_t H5Mfind_name(owner_id, type, name)
- hid_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
+ hid_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
+ This function re-directs the object's "search" into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
-hid_t H5Msearch(hid_t oid, hobjtype_t type, const char *name)
+hid_t
+H5Msearch (hid_t oid, group_t type, const char *name)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Msearch, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Msearch, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].search)(oid,type,name);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -572,35 +529,36 @@ done:
Get an HDF5 object by index.
USAGE
hid_t H5Mindex(oid, type, idx)
- hid_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
+ hid_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
+ This function re-directs the object's "index" into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
-hid_t H5Mindex(hid_t oid, hobjtype_t type, uint32 idx)
+hid_t
+H5Mindex (hid_t oid, group_t type, uint32 idx)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- hid_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ hid_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mindex, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mindex, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].index)(oid,type,idx);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -617,35 +575,35 @@ done:
Flush an HDF5 object out to a file.
USAGE
hid_t H5Mflush(oid)
- hid_t oid; IN: Object to flush
+ hid_t oid; IN: Object to flush
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's flush into the appropriate
+ This function re-directs the object's flush into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mflush(hid_t oid)
{
group_t group; /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ intn i; /* local counting variable */
+ herr_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mflush, H5M_init_interface, FAIL); /* Insert function initialization code and variables */
+ FUNC_ENTER(H5Mflush, FAIL); /* Insert function initialization code and variables */
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
- group=H5Aatom_group(oid); /* look up group for incoming object */
+ group=H5Aatom_group(oid); /* look up group for incoming object */
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
/* Find correct function pointer set from static array */
i=H5M_find_type(group);
if(meta_func_arr[i].flush==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].flush)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -662,34 +620,34 @@ done:
Delete an HDF5 object from a file.
USAGE
herr_t H5Mdelete(oid)
- hid_t oid; IN: Object to delete
+ hid_t oid; IN: Object to delete
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's delete into the appropriate
+ 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(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ 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);
+ FUNC_ENTER(H5Mdelete, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].delete)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -706,33 +664,33 @@ done:
Get the parent ID an HDF5 object.
USAGE
hid_t H5Mget_parent(oid)
- hid_t oid; IN: Object to query
+ hid_t oid; IN: Object to query
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's query into the appropriate
+ This function re-directs the object's query into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mget_parent(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ 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);
+ FUNC_ENTER(H5Mget_parent, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].get_parent)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -749,33 +707,33 @@ done:
Get the file ID an HDF5 object.
USAGE
hid_t H5Mget_file(oid)
- hid_t oid; IN: Object to query
+ hid_t oid; IN: Object to query
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's query into the appropriate
+ This function re-directs the object's query into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
hid_t H5Mget_file(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ 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);
+ FUNC_ENTER(H5Mget_file, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ 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);
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
ret_value=(meta_func_arr[i].get_file)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -787,38 +745,38 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5Mrelease
+ H5Mclose
PURPOSE
Release access to an HDF5 object.
USAGE
- herr_t H5Mrelease(oid)
- hid_t oid; IN: Object to release access to
+ herr_t H5Mclose(oid)
+ hid_t oid; IN: Object to release access to
RETURNS
SUCCEED/FAIL
DESCRIPTION
- This function re-directs the object's release into the appropriate
+ This function re-directs the object's release into the appropriate
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
-herr_t H5Mrelease(hid_t oid)
+herr_t H5Mclose(hid_t oid)
{
- group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
- intn i; /* local counting variable */
- herr_t ret_value = SUCCEED;
+ group_t group=H5Aatom_group(oid); /* Atom group for incoming object */
+ intn i; /* local counting variable */
+ herr_t ret_value = SUCCEED;
- FUNC_ENTER(H5Mrelease, H5M_init_interface, FAIL);
+ FUNC_ENTER(H5Mclose, FAIL);
/* Clear errors and check args and all the boring stuff. */
H5ECLEAR;
if(group<=BADGROUP || group>=MAXGROUP)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL);
i=H5M_find_type(group);
- if(meta_func_arr[i].release==NULL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
- ret_value=(meta_func_arr[i].release)(oid);
+ if(meta_func_arr[i].close==NULL)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL);
+ ret_value=(meta_func_arr[i].close)(oid);
done:
- if(ret_value == FAIL)
+ if(ret_value == FAIL)
{ /* Error condition cleanup */
} /* end if */
@@ -826,5 +784,5 @@ done:
/* Normal function cleanup */
FUNC_LEAVE(ret_value);
-} /* end H5Mrelease() */
+}