00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00002 * Copyright by The HDF Group. * 00003 * Copyright by the Board of Trustees of the University of Illinois. * 00004 * All rights reserved. * 00005 * * 00006 * This file is part of HDF5. The full HDF5 copyright notice, including * 00007 * terms governing use, modification, and redistribution, is contained in * 00008 * the files COPYING and Copyright.html. COPYING can be found at the root * 00009 * of the source code distribution tree; Copyright.html can be found at the * 00010 * root level of an installed copy of the electronic HDF5 document set and * 00011 * is linked from the top-level documents page. It can also be found at * 00012 * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * 00013 * access to either file, you may request a copy from help@hdfgroup.org. * 00014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00015 00016 /* 00017 * This file contains function prototypes for each exported function in 00018 * the H5I module. 00019 */ 00020 #ifndef _H5Ipublic_H 00021 #define _H5Ipublic_H 00022 00023 /* Public headers needed by this file */ 00024 #include "H5public.h" 00025 00026 /* 00027 * Library type values. Start with `1' instead of `0' because it makes the 00028 * tracing output look better when hid_t values are large numbers. Change the 00029 * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will 00030 * fail otherwise). 00031 * 00032 * When adding types here, add a section to the 'misc19' test in test/tmisc.c 00033 * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. 00034 * 00035 */ 00036 typedef enum H5I_type_t { 00037 H5I_UNINIT = (-2), /*uninitialized type */ 00038 H5I_BADID = (-1), /*invalid Type */ 00039 H5I_FILE = 1, /*type ID for File objects */ 00040 H5I_GROUP, /*type ID for Group objects */ 00041 H5I_DATATYPE, /*type ID for Datatype objects */ 00042 H5I_DATASPACE, /*type ID for Dataspace objects */ 00043 H5I_DATASET, /*type ID for Dataset objects */ 00044 H5I_ATTR, /*type ID for Attribute objects */ 00045 H5I_REFERENCE, /*type ID for Reference objects */ 00046 H5I_VFL, /*type ID for virtual file layer */ 00047 H5I_GENPROP_CLS, /*type ID for generic property list classes */ 00048 H5I_GENPROP_LST, /*type ID for generic property lists */ 00049 H5I_ERROR_CLASS, /*type ID for error classes */ 00050 H5I_ERROR_MSG, /*type ID for error messages */ 00051 H5I_ERROR_STACK, /*type ID for error stacks */ 00052 H5I_NTYPES /*number of library types, MUST BE LAST! */ 00053 } H5I_type_t; 00054 00055 /* Type of atoms to return to users */ 00056 typedef int hid_t; 00057 #define H5_SIZEOF_HID_T H5_SIZEOF_INT 00058 00059 /* An invalid object ID. This is also negative for error return. */ 00060 #define H5I_INVALID_HID (-1) 00061 00062 /* 00063 * Function for freeing objects. This function will be called with an object 00064 * ID type number and a pointer to the object. The function should free the 00065 * object and return non-negative to indicate that the object 00066 * can be removed from the ID type. If the function returns negative 00067 * (failure) then the object will remain in the ID type. 00068 */ 00069 typedef herr_t (*H5I_free_t)(void*); 00070 00071 /* Type of the function to compare objects & keys */ 00072 typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key); 00073 00074 #ifdef __cplusplus 00075 extern "C" { 00076 #endif 00077 00078 /* Public API functions */ 00079 00080 H5_DLL hid_t H5Iregister(H5I_type_t type, void *object); 00081 H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t id_type); 00082 H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t id_type); 00083 H5_DLL H5I_type_t H5Iget_type(hid_t id); 00084 H5_DLL hid_t H5Iget_file_id(hid_t id); 00085 H5_DLL ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size); 00086 H5_DLL int H5Iinc_ref(hid_t id); 00087 H5_DLL int H5Idec_ref(hid_t id); 00088 H5_DLL int H5Iget_ref(hid_t id); 00089 H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func); 00090 H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force); 00091 H5_DLL herr_t H5Idestroy_type(H5I_type_t type); 00092 H5_DLL int H5Iinc_type_ref(H5I_type_t type); 00093 H5_DLL int H5Idec_type_ref(H5I_type_t type); 00094 H5_DLL int H5Iget_type_ref(H5I_type_t type); 00095 H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); 00096 H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members); 00097 H5_DLL htri_t H5Itype_exists(H5I_type_t type); 00098 H5_DLL htri_t H5Iis_valid(hid_t id); 00099 00100 #ifdef __cplusplus 00101 } 00102 #endif 00103 #endif /* _H5Ipublic_H */ 00104