summaryrefslogtreecommitdiffstats
path: root/src/H5Ipublic.h
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2004-06-18 16:56:04 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2004-06-18 16:56:04 (GMT)
commitf249eed71d4b646bc57a43f28e32f3c2d9d71050 (patch)
tree831e79372ff27e582d5a1022e189a71d192256eb /src/H5Ipublic.h
parenta83233a2c9f1fff24cffe02d4fa3fdaab3f92ff1 (diff)
downloadhdf5-f249eed71d4b646bc57a43f28e32f3c2d9d71050.zip
hdf5-f249eed71d4b646bc57a43f28e32f3c2d9d71050.tar.gz
hdf5-f249eed71d4b646bc57a43f28e32f3c2d9d71050.tar.bz2
[svn-r8707] Changed the way HDF5 handles hid_t's and added API functions to allow users to register IDs and ID types at runtime.
Diffstat (limited to 'src/H5Ipublic.h')
-rw-r--r--src/H5Ipublic.h63
1 files changed, 45 insertions, 18 deletions
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 9c4d950..c8787c9 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -23,32 +23,34 @@
#include "H5public.h"
/*
- * Group values allowed. Start with `1' instead of `0' because it makes the
+ * Library type values. Start with `1' instead of `0' because it makes the
* tracing output look better when hid_t values are large numbers. Change the
- * GROUP_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will
+ * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will
* fail otherwise).
*
- * When adding groups here, add a section to the 'misc19' test in test/tmisc.c
+ * When adding types here, add a section to the 'misc19' test in test/tmisc.c
* to verify that the H5I{inc|dec|get}_ref() routines work correctly with in.
*
*/
typedef enum {
- H5I_BADID = (-1), /*invalid Group */
- H5I_FILE = 1, /*group ID for File objects */
+ H5I_UNINIT = (-2), /*uninitialized type */
+ H5I_BADID = (-1), /*invalid Type */
+ H5I_FILE = 1, /*type ID for File objects */
H5I_FILE_CLOSING, /*files pending close due to open objhdrs */
- H5I_GROUP, /*group ID for Group objects */
- H5I_DATATYPE, /*group ID for Datatype objects */
- H5I_DATASPACE, /*group ID for Dataspace objects */
- H5I_DATASET, /*group ID for Dataset objects */
- H5I_ATTR, /*group ID for Attribute objects */
- H5I_REFERENCE, /*group ID for Reference objects */
- H5I_VFL, /*group ID for virtual file layer */
- H5I_GENPROP_CLS, /*group ID for generic property list classes */
- H5I_GENPROP_LST, /*group ID for generic property lists */
- H5I_ERROR_CLASS, /*group ID for error classes */
- H5I_ERROR_MSG, /*group ID for error messages */
- H5I_ERROR_STACK, /*group ID for error stacks */
- H5I_NGROUPS /*number of valid groups, MUST BE LAST! */
+ H5I_GROUP, /*type ID for Group objects */
+ H5I_DATATYPE, /*type ID for Datatype objects */
+ H5I_DATASPACE, /*type ID for Dataspace objects */
+ H5I_DATASET, /*type ID for Dataset objects */
+ H5I_ATTR, /*type ID for Attribute objects */
+ H5I_TEMPBUF, /*type ID for Temporary buffer objects */
+ H5I_REFERENCE, /*type ID for Reference objects */
+ H5I_VFL, /*type ID for virtual file layer */
+ H5I_GENPROP_CLS, /*type ID for generic property list classes */
+ H5I_GENPROP_LST, /*type ID for generic property lists */
+ H5I_ERROR_CLASS, /*type ID for error classes */
+ H5I_ERROR_MSG, /*type ID for error messages */
+ H5I_ERROR_STACK, /*type ID for error stacks */
+ H5I_NTYPES /*number of library types, MUST BE LAST! */
} H5I_type_t;
/* Type of atoms to return to users */
@@ -57,17 +59,42 @@ typedef int hid_t;
/* An invalid object ID. This is also negative for error return. */
#define H5I_INVALID_HID (-1)
+/*
+ * Function for freeing objects. This function will be called with an object
+ * ID type number and a pointer to the object. The function should free the
+ * object and return non-negative to indicate that the object
+ * can be removed from the ID type. If the function returns negative
+ * (failure) then the object will remain in the ID type.
+ */
+typedef herr_t (*H5I_free_t)(void*);
+
+/* Type of the function to compare objects & keys */
+typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key);
+
#ifdef __cplusplus
extern "C" {
#endif
/* Public API functions */
+
+H5_DLL hid_t H5Iregister(H5I_type_t type, void *object);
+H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t id_type);
+H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t id_type);
H5_DLL H5I_type_t H5Iget_type(hid_t id);
H5_DLL hid_t H5Iget_file_id(hid_t id);
H5_DLL ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size);
H5_DLL int H5Iinc_ref(hid_t id);
H5_DLL int H5Idec_ref(hid_t id);
H5_DLL int H5Iget_ref(hid_t id);
+H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
+H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
+H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
+H5_DLL int H5Iinc_type_ref(H5I_type_t type);
+H5_DLL int H5Idec_type_ref(H5I_type_t type);
+H5_DLL int H5Iget_type_ref(H5I_type_t type);
+H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
+H5_DLL int H5Inmembers(H5I_type_t type);
+
#ifdef __cplusplus
}