[svn-r319] Removed H5M API from code

This commit is contained in:
Quincey Koziol 1998-03-12 16:04:53 -05:00
parent 4e295e1fda
commit e4d89c2cd6
10 changed files with 28 additions and 915 deletions

View File

@ -23,10 +23,8 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5Eprivate.h> /* Error handling */
#include <H5Gprivate.h> /* Group headers */
#include <H5Hprivate.h> /* Name heap */
#include <H5Mprivate.h> /* Meta data */
#include <H5MFprivate.h> /* File space allocation header */
#include <H5MMprivate.h> /* Memory management */
#include <H5Mprivate.h> /* Meta-Object API */
#include <H5Oprivate.h> /* Object headers */
#include <H5Pprivate.h> /* Property lists */
@ -688,32 +686,6 @@ H5Dextend (hid_t dataset_id, const size_t *size)
FUNC_LEAVE (SUCCEED);
}
/*-------------------------------------------------------------------------
* Function: H5D_find_name
*
* Purpose: This is a callback for H5Mfind_name(). It does the same
* thing as H5Dopen() except it takes an extra argument which
* isn't used.
*
* Return: Success: SUCCEED
*
* Failure: FAIL
*
* Errors:
*
* Programmer: Robb Matzke
* Thursday, December 4, 1997
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
hid_t
H5D_find_name(hid_t file_id, group_t UNUSED, const char *name)
{
return H5Dopen(file_id, name);
}
/*-------------------------------------------------------------------------
* Function: H5D_create
*

View File

@ -42,7 +42,6 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5ACprivate.h> /*cache */
#include <H5Eprivate.h> /*error handling */
#include <H5Gprivate.h> /*symbol tables */
#include <H5Mprivate.h> /*meta data */
#include <H5MMprivate.h> /*core memory management */
#include <H5Pprivate.h> /*property lists */

763
src/H5M.c
View File

@ -1,763 +0,0 @@
/****************************************************************************
* 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
static char RcsId[] = "@(#)$Revision$";
#endif
/* $Id$ */
/*LINTLIBRARY */
/*+
FILE
hdf5meta.c
HDF5 "Meta-Object" routines
EXPORTED ROUTINES
H5Maccess -- Start access to an existing object
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
H5Mdelete -- Delete an object from disk
H5Mget_file -- Get the file ID for an object
H5Mget_file -- Get the parent ID for an object
H5Mclose -- Release access to an object
LIBRARY-SCOPED ROUTINES
LOCAL ROUTINES
H5M_init_interface -- initialize the interface
+ */
#include <H5private.h> /* Generic functions */
#include <H5Aprivate.h> /* Atom interface */
#include <H5Dprivate.h> /* Dataset interface */
#include <H5Eprivate.h> /*error handling */
#include <H5Sprivate.h> /* Dataspace functions */
#include <H5Tprivate.h> /* Datatype interface */
#include <H5Mprivate.h> /* Meta-object interface */
#include <H5Pprivate.h> /* Property list interface */
#define PABLO_MASK H5M_mask
/*--------------------- Locally scoped variables -----------------------------*/
static meta_func_t meta_func_arr[] =
{
{ /* Template object meta-functions (defined in H5P.c) */
H5_TEMPLATE_0, /* File-Creation Template Type ID */
NULL, /* File-Creation Template Create */
NULL, /* File-Creation Template Access */
H5Pcopy, /* 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 */
H5Pclose /* File-Creation Template Release */
},
{ /* Template object meta-functions (defined in H5P.c) */
H5_TEMPLATE_1, /* File-Access Template Type ID */
NULL, /* File-Access Template Create */
NULL, /* File-Access Template Access */
H5Pcopy, /* File-Access Template Copy */
NULL, /* File-Access Template FindName */
NULL, /* File-Access Template NameLen */
NULL, /* File-Access Template GetName */
NULL, /* File-Access Template SetName */
NULL, /* File-Access Template Search */
NULL, /* File-Access Template Index */
NULL, /* File-Access Template Flush */
NULL, /* File-Access Template Delete */
NULL, /* File-Access Template GetParent */
NULL, /* File-Access Template GetFile */
H5Pclose /* File-Access Template 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 H5S.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 */
H5Sclose /* Dimensionality 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 */
},
};
/* Interface initialization */
static intn interface_initialize_g = FALSE;
#define INTERFACE_INIT H5M_init_interface
static herr_t H5M_init_interface(void);
/*--------------------------------------------------------------------------
NAME
H5M_init_interface -- Initialize interface-specific information
USAGE
herr_t H5M_init_interface()
RETURNS
SUCCEED/FAIL
DESCRIPTION
Initializes any interface-specific data or routines.
MODIFICATIONS
Robb Matzke, 4 Aug 1997
Changed the FUNC variable value to H5M_init_interface.
--------------------------------------------------------------------------*/
static herr_t
H5M_init_interface(void)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5M_init_interface, FAIL);
FUNC_LEAVE(ret_value);
} /* H5M_init_interface */
/*--------------------------------------------------------------------------
NAME
H5M_find_type
PURPOSE
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
RETURNS
Returns the index of the type in the array of methods on success, or FAIL
on failure.
DESCRIPTION
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(group_t type)
{
intn i; /* local counting variable */
intn ret_value = FAIL;
FUNC_ENTER(H5M_find_type, FAIL);
/*
* Currently this uses a stright linear search, which can easily be changed
* 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);
done:
if (ret_value == FAIL) { /* Error condition cleanup */
} /* end if */
/* Normal function cleanup */
FUNC_LEAVE(ret_value);
} /* end H5M_find_type() */
/*--------------------------------------------------------------------------
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.
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
--------------------------------------------------------------------------*/
hid_t
H5Maccess(hid_t oid)
{
group_t group;
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Maccess, FAIL);
/* Atom group for incoming object */
group = H5A_group(oid);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].access == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
"no access method");
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
H5Mcopy
PURPOSE
Copy an HDF5 object.
USAGE
hid_t H5Mcopy(oid)
hid_t oid; IN: Object to copy
RETURNS
SUCCEED/FAIL
DESCRIPTION
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 = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mcopy, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].copy == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no copy method");
ret_value = (meta_func_arr[i].copy) (oid);
done:
if (ret_value == FAIL) { /* Error condition cleanup */
} /* end if */
/* Normal function cleanup */
FUNC_LEAVE(ret_value);
} /* end H5Mcopy() */
/*--------------------------------------------------------------------------
NAME
H5Mfind_name
PURPOSE
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
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
--------------------------------------------------------------------------*/
hid_t
H5Mfind_name(hid_t owner_id, group_t type, const char *name)
{
#ifdef OLD_WAY
group_t group = H5A_group(owner_id); /* Atom group for incoming object */
#endif /* OLD_WAY */
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Mfind_name, FAIL);
/* Check args and all the boring stuff. */
#ifdef OLD_WAY
if (group <= BADGROUP || group >= MAXGROUP)
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, "bad group");
i = H5M_find_type(type);
#endif /* OLD_WAY */
if (meta_func_arr[i].find_name == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no open method");
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)
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
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
uint32
H5Mname_len(hid_t oid)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mname_len, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].name_len == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no name_len method");
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)
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
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t
H5Mget_name(hid_t oid, char *name)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Mget_name, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].get_name == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
"no get_name method");
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)
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
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t
H5Mset_name(hid_t oid, const char *name)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Mset_name, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].set_name == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
"no set_name method");
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
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
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
--------------------------------------------------------------------------*/
hid_t
H5Msearch(hid_t oid, group_t type, const char *name)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Msearch, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].search == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no search method");
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
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
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
--------------------------------------------------------------------------*/
hid_t
H5Mindex(hid_t oid, group_t type, uint32 idx)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
hid_t ret_value = SUCCEED;
FUNC_ENTER(H5Mindex, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].index == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no index method");
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
hid_t H5Mflush(oid)
hid_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
--------------------------------------------------------------------------*/
hid_t
H5Mflush(hid_t oid)
{
group_t group; /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mflush, FAIL); /* Insert function initialization code and variables */
/* Check args and all the boring stuff. */
group = H5A_group(oid); /* look up group for incoming object */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
/* 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, "no flush method");
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); /* Insert function prologue code */
} /* end H5Mflush() */
/*--------------------------------------------------------------------------
NAME
H5Mdelete
PURPOSE
Delete an HDF5 object from a file.
USAGE
herr_t H5Mdelete(oid)
hid_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(hid_t oid)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mdelete, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].delete == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no delete method");
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
hid_t H5Mget_parent(oid)
hid_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
--------------------------------------------------------------------------*/
hid_t
H5Mget_parent(hid_t oid)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mget_parent, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].get_parent == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
"no get_parent method");
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.
USAGE
hid_t H5Mget_file(oid)
hid_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
--------------------------------------------------------------------------*/
hid_t
H5Mget_file(hid_t oid)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mget_file, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].get_file == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL,
"no get_file method");
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
H5Mclose
PURPOSE
Release access to an HDF5 object.
USAGE
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
interface, as defined by the function pointers in hdf5fptr.h
--------------------------------------------------------------------------*/
herr_t
H5Mclose(hid_t oid)
{
group_t group = H5A_group(oid); /* Atom group for incoming object */
intn i; /* local counting variable */
herr_t ret_value = SUCCEED;
FUNC_ENTER(H5Mclose, FAIL);
/* Check args and all the boring stuff. */
if (group <= BADGROUP || group >= MAXGROUP)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "bad group");
i = H5M_find_type(group);
if (meta_func_arr[i].close == NULL)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "no close method");
ret_value = (meta_func_arr[i].close) (oid);
done:
if (ret_value == FAIL) { /* Error condition cleanup */
} /* end if */
/* Normal function cleanup */
FUNC_LEAVE(ret_value);
}

View File

@ -1,47 +0,0 @@
/****************************************************************************
* 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. *
* *
****************************************************************************/
/*
* This file contains macros & information for meta-objects
*/
#ifndef _H5Mprivate_H
#define _H5Mprivate_H
#include <H5Mpublic.h> /*include Public Definitions */
/* Private headers needed by this file */
#include <H5private.h>
/*
* A function table record for accessing interfaces which use the "meta"
* interface to create/open/close objects.
*/
typedef struct meta_func_t {
group_t type; /*object type this interface is for*/
hid_t (*create) (hid_t, group_t, const char *);/*object creation function*/
hid_t (*access) (hid_t); /*object access function*/
hid_t (*copy) (hid_t); /*object copy function*/
hid_t (*find_name) (hid_t, group_t, const char *);/*find first object*/
uint32 (*name_len) (hid_t); /*get length of object name*/
herr_t (*get_name) (hid_t, char *); /*get object name*/
herr_t (*set_name) (hid_t, const char *); /*set object name*/
hid_t (*search) (hid_t, group_t, const char *);/*search for list of objects*/
hid_t (*index) (hid_t, group_t, uint32);/*get the OID for the n'th object*/
herr_t (*flush) (hid_t); /*flush the object to disk*/
herr_t (*delete) (hid_t); /*delete an object from file*/
hid_t (*get_parent) (hid_t); /*get the parent object of an object*/
hid_t (*get_file) (hid_t); /*get the file ID of an object*/
herr_t (*close) (hid_t); /*end access to an object*/
} meta_func_t;
/* Private functions, not part of the publicly documented API */
#endif

View File

@ -1,45 +0,0 @@
/****************************************************************************
* 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. *
* *
****************************************************************************/
/*
* This file contains public declarations for the H5M module.
*/
#ifndef _H5Mpublic_H
#define _H5Mpublic_H
/* Public headers needed by this file */
#include <H5public.h>
#include <H5Ppublic.h> /*for hobjtype_t defn */
#ifdef __cplusplus
extern "C" {
#endif
/* Functions in H5M.c */
hid_t H5Maccess (hid_t oid);
hid_t H5Mcopy (hid_t oid);
hid_t H5Mfind_name (hid_t oid, group_t type, const char *name);
unsigned H5Mname_len (hid_t oid);
herr_t H5Mget_name (hid_t oid, char *name);
herr_t H5Mset_name (hid_t oid, const char *name);
hid_t H5Msearch (hid_t oid, group_t type, const char *name);
hid_t H5Mindex (hid_t oid, group_t type, unsigned idx);
hid_t H5Mflush (hid_t oid);
herr_t H5Mdelete (hid_t oid);
hid_t H5Mget_file (hid_t oid);
hid_t H5Mget_parent (hid_t oid);
herr_t H5Mclose (hid_t oid);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -20,7 +20,6 @@ static char RcsId[] = "@(#)$Revision$";
#include <H5private.h> /*generic functions */
#include <H5Aprivate.h> /*atom functions */
#include <H5Eprivate.h> /*error handling */
#include <H5Mprivate.h> /*meta data */
#include <H5MMprivate.h> /*memory management */
#include <H5Sprivate.h> /*data space */
#include <H5Tpkg.h> /*data-type functions */

View File

@ -16,11 +16,11 @@ PROGS=debug
# Source and object files for the library (lexicographically)...
PARALLEL_SRC=H5Fmpio.c
LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5D.c H5E.c H5F.c H5Farray.c H5Fcore.c \
H5Ffamily.c H5Fistore.c H5Flow.c H5Fsec2.c H5Fsplit.c H5Fstdio.c \
H5G.c H5Gent.c H5Gnode.c H5Gstab.c H5H.c H5M.c H5MF.c H5MM.c H5O.c \
H5Ocont.c H5Odtype.c H5Oefl.c H5Olayout.c H5Oname.c H5Onull.c \
H5Osdspace.c H5Ostab.c H5P.c H5S.c H5Ssimp.c H5T.c H5Tconv.c \
LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5D.c H5E.c H5F.c H5Farray.c H5Fcore.c \
H5Ffamily.c H5Fistore.c H5Flow.c H5Fsec2.c H5Fsplit.c H5Fstdio.c \
H5G.c H5Gent.c H5Gnode.c H5Gstab.c H5H.c H5MF.c H5MM.c H5O.c \
H5Ocont.c H5Odtype.c H5Oefl.c H5Olayout.c H5Oname.c H5Onull.c \
H5Osdspace.c H5Ostab.c H5P.c H5S.c H5Ssimp.c H5T.c H5Tconv.c \
H5Tinit.c H5V.c @PARALLEL_SRC@
LIB_OBJ=$(LIB_SRC:.c=.o)
@ -35,13 +35,13 @@ PROG_OBJ=$(PROG_SRC:.c=.o)
# Public header files (to be installed)...
PUB_HDR=H5public.h H5Apublic.h H5ACpublic.h H5Bpublic.h H5Ppublic.h \
H5Dpublic.h H5Epublic.h H5Fpublic.h H5Gpublic.h H5Hpublic.h \
H5Mpublic.h H5MFpublic.h H5MMpublic.h H5Opublic.h H5Spublic.h \
H5MFpublic.h H5MMpublic.h H5Opublic.h H5Spublic.h \
H5Tpublic.h H5config.h hdf5.h
# Other header files (not to be installed)...
PRIVATE_HDR=H5private.h H5Aprivate.h H5ACprivate.h H5Bprivate.h \
H5Pprivate.h H5Dprivate.h H5Eprivate.h H5Fprivate.h H5Gprivate.h \
H5Gpkg.h H5Hprivate.h H5Mprivate.h H5MFprivate.h H5MMprivate.h \
H5Gpkg.h H5Hprivate.h H5MFprivate.h H5MMprivate.h \
H5Oprivate.h H5Sprivate.h H5Tprivate.h H5Tpkg.h H5Vprivate.h
# Number format detection

View File

@ -27,7 +27,6 @@
#include <H5Fpublic.h> /* Files */
#include <H5Gpublic.h> /* Groups */
#include <H5Hpublic.h>
#include <H5Mpublic.h> /* "Meta" */
#include <H5MFpublic.h>
#include <H5MMpublic.h>
#include <H5Opublic.h> /* Object headers */

View File

@ -29,7 +29,6 @@ static char RcsId[] = "$Revision$";
#include <H5private.h>
#include <H5Bprivate.h>
#include <H5Pprivate.h>
#include <H5Mprivate.h>
#define F1_USERBLOCK_SIZE 0
#define F1_OFFSET_SIZE sizeof(size_t)
@ -98,13 +97,13 @@ test_file_create(void)
VERIFY(iparm2, F1_SYM_LEAF_K, "H5Pget_sym_k");
/* Release file-creation template */
ret = H5Mclose(tmpl1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
#ifdef LATER
/* Double-check that the atom has been vaporized */
ret = H5Mclose(tmpl1);
VERIFY(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
VERIFY(ret, FAIL, "H5Pclose");
#endif
/* Create a new file with a non-standard file-creation template */
@ -129,8 +128,8 @@ test_file_create(void)
CHECK(fid2, FAIL, "H5Fcreate");
/* Release file-creation template */
ret = H5Mclose(tmpl1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
/* Get the file-creation template */
tmpl1 = H5Fget_create_template(fid2);
@ -152,12 +151,12 @@ test_file_create(void)
VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
/* Clone the file-creation template */
tmpl2 = H5Mcopy(tmpl1);
CHECK(tmpl2, FAIL, "H5Mcopy");
tmpl2 = H5Pcopy(tmpl1);
CHECK(tmpl2, FAIL, "H5Pcopy");
/* Release file-creation template */
ret = H5Mclose(tmpl1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
/* Set the new file-creation parameter */
ret = H5Pset_userblock(tmpl2, F3_USERBLOCK_SIZE);
@ -171,8 +170,8 @@ test_file_create(void)
CHECK(fid3, FAIL, "H5Fcreate");
/* Release file-creation template */
ret = H5Mclose(tmpl2);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl2);
CHECK(ret, FAIL, "H5Pclose");
/* Get the file-creation template */
tmpl1 = H5Fget_create_template(fid3);
@ -194,8 +193,8 @@ test_file_create(void)
VERIFY(iparm2, F3_SYM_LEAF_K, "H5Pget_sym_k");
/* Release file-creation template */
ret = H5Mclose(tmpl1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
/* Close first file */
ret = H5Fclose(fid1);
@ -252,8 +251,8 @@ test_file_open(void)
VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
/* Release file-creation template */
ret = H5Mclose(tmpl1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
/* Close first file */
ret = H5Fclose(fid1);

View File

@ -28,8 +28,8 @@ static char RcsId[] = "$Revision$";
#include <H5private.h>
#include <H5Bprivate.h>
#include <H5Mprivate.h>
#include <H5Sprivate.h>
#include <H5Pprivate.h>
#define FILE "th5p1.h5"
@ -103,11 +103,11 @@ test_h5p_basic(void)
CHECK(ret, FAIL, "H5Sget_ldims");
VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(uint32)), 0, "H5Sget_ldims");
ret = H5Mclose(sid1);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Mclose(sid2);
CHECK(ret, FAIL, "H5Mrelease");
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
/* Close first file */
ret = H5Fclose(fid1);