HDF5  1.12.0
H5Ipublic.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * This file contains function prototypes for each exported function in
16  * the H5I module.
17  */
18 #ifndef _H5Ipublic_H
19 #define _H5Ipublic_H
20 
21 /* Public headers needed by this file */
22 #include "H5public.h"
23 
24 /*
25  * Library type values. Start with `1' instead of `0' because it makes the
26  * tracing output look better when hid_t values are large numbers. Change the
27  * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will
28  * fail otherwise).
29  *
30  * When adding types here, add a section to the 'misc19' test in test/tmisc.c
31  * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it.
32  */
33 typedef enum H5I_type_t {
34  H5I_UNINIT = (-2), /* uninitialized type */
35  H5I_BADID = (-1), /* invalid Type */
36  H5I_FILE = 1, /* type ID for File objects */
37  H5I_GROUP, /* type ID for Group objects */
38  H5I_DATATYPE, /* type ID for Datatype objects */
39  H5I_DATASPACE, /* type ID for Dataspace objects */
40  H5I_DATASET, /* type ID for Dataset objects */
41  H5I_MAP, /* type ID for Map objects */
42  H5I_ATTR, /* type ID for Attribute objects */
43  H5I_VFL, /* type ID for virtual file layer */
44  H5I_VOL, /* type ID for virtual object layer */
45  H5I_GENPROP_CLS, /* type ID for generic property list classes */
46  H5I_GENPROP_LST, /* type ID for generic property lists */
47  H5I_ERROR_CLASS, /* type ID for error classes */
48  H5I_ERROR_MSG, /* type ID for error messages */
49  H5I_ERROR_STACK, /* type ID for error stacks */
50  H5I_SPACE_SEL_ITER, /* type ID for dataspace selection iterator */
51  H5I_NTYPES /* number of library types, MUST BE LAST! */
53 
54 /* Type of atoms to return to users */
55 typedef int64_t hid_t;
56 #define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T
57 
58 /* An invalid object ID. This is also negative for error return. */
59 #define H5I_INVALID_HID (-1)
60 
61 /*
62  * Function for freeing objects. This function will be called with an object
63  * ID type number and a pointer to the object. The function should free the
64  * object and return non-negative to indicate that the object
65  * can be removed from the ID type. If the function returns negative
66  * (failure) then the object will remain in the ID type.
67  */
68 typedef herr_t (*H5I_free_t)(void *);
69 
70 /* Type of the function to compare objects & keys */
71 typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key);
72 
73 /* Type of the H5Iiterate callback function */
74 typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata);
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
80 /* Public API functions */
81 
82 H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object);
83 H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t id_type);
84 H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t id_type);
87 H5_DLL ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size);
88 H5_DLL int H5Iinc_ref(hid_t id);
89 H5_DLL int H5Idec_ref(hid_t id);
90 H5_DLL int H5Iget_ref(hid_t id);
91 H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
97 H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
98 H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
99 H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 #endif /* _H5Ipublic_H */
107 
H5public.h
ssize_t
int ssize_t
Definition: H5public.h:167
size
iblock size
Definition: H5EAcache.c:787
H5Iget_type
H5_DLL H5I_type_t H5Iget_type(hid_t id)
Definition: H5I.c:1071
H5I_iterate_func_t
herr_t(* H5I_iterate_func_t)(hid_t id, void *udata)
Definition: H5Ipublic.h:74
H5I_type_t
H5I_type_t
Definition: H5Ipublic.h:33
H5I_BADID
@ H5I_BADID
Definition: H5Ipublic.h:35
H5I_GROUP
@ H5I_GROUP
Definition: H5Ipublic.h:37
H5I_SPACE_SEL_ITER
@ H5I_SPACE_SEL_ITER
Definition: H5Ipublic.h:50
H5I_free_t
herr_t(* H5I_free_t)(void *)
Definition: H5Ipublic.h:68
H5Iobject_verify
H5_DLL void * H5Iobject_verify(hid_t id, H5I_type_t id_type)
Definition: H5I.c:966
H5Iinc_type_ref
H5_DLL int H5Iinc_type_ref(H5I_type_t type)
Definition: H5I.c:1629
int64_t
int64_t
Definition: H5overflow.txt:35
H5I_MAP
@ H5I_MAP
Definition: H5Ipublic.h:41
H5Idec_type_ref
H5_DLL int H5Idec_type_ref(H5I_type_t type)
Definition: H5I.c:1710
H5I_search_func_t
int(* H5I_search_func_t)(void *obj, hid_t id, void *key)
Definition: H5Ipublic.h:71
H5Iget_name
H5_DLL ssize_t H5Iget_name(hid_t id, char *name, size_t size)
Definition: H5I.c:2220
htri_t
int htri_t
Definition: H5public.h:160
H5Iiterate
H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data)
Definition: H5I.c:2028
H5Itype_exists
H5_DLL htri_t H5Itype_exists(H5I_type_t type)
Definition: H5I.c:351
H5Iremove_verify
H5_DLL void * H5Iremove_verify(hid_t id, H5I_type_t id_type)
Definition: H5I.c:1157
H5I_ERROR_CLASS
@ H5I_ERROR_CLASS
Definition: H5Ipublic.h:47
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5Iregister_type
H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func)
Definition: H5I.c:218
H5I_ERROR_MSG
@ H5I_ERROR_MSG
Definition: H5Ipublic.h:48
H5Inmembers
H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members)
Definition: H5I.c:389
H5Iget_type_ref
H5_DLL int H5Iget_type_ref(H5I_type_t type)
Definition: H5I.c:1791
H5I_UNINIT
@ H5I_UNINIT
Definition: H5Ipublic.h:34
H5I_DATASET
@ H5I_DATASET
Definition: H5Ipublic.h:40
H5Iclear_type
H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force)
Definition: H5I.c:519
H5I_FILE
@ H5I_FILE
Definition: H5Ipublic.h:36
int
CATCH int
Definition: H5EA.c:1002
H5I_DATASPACE
@ H5I_DATASPACE
Definition: H5Ipublic.h:39
H5I_NTYPES
@ H5I_NTYPES
Definition: H5Ipublic.h:51
H5I_DATATYPE
@ H5I_DATATYPE
Definition: H5Ipublic.h:38
H5I_GENPROP_LST
@ H5I_GENPROP_LST
Definition: H5Ipublic.h:46
H5Isearch
H5_DLL void * H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key)
Definition: H5I.c:1934
H5Iis_valid
H5_DLL htri_t H5Iis_valid(hid_t id)
Definition: H5I.c:1859
H5Iinc_ref
H5_DLL int H5Iinc_ref(hid_t id)
Definition: H5I.c:1496
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5Idestroy_type
H5_DLL herr_t H5Idestroy_type(H5I_type_t type)
Definition: H5I.c:661
H5I_GENPROP_CLS
@ H5I_GENPROP_CLS
Definition: H5Ipublic.h:45
H5I_VFL
@ H5I_VFL
Definition: H5Ipublic.h:43
H5Iget_ref
H5_DLL int H5Iget_ref(hid_t id)
Definition: H5I.c:1565
H5I_ATTR
@ H5I_ATTR
Definition: H5Ipublic.h:42
herr_t
int herr_t
Definition: H5public.h:128
hbool_t
bool hbool_t
Definition: H5public.h:159
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5I_VOL
@ H5I_VOL
Definition: H5Ipublic.h:44
H5Iregister
H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object)
Definition: H5I.c:741
H5Iget_file_id
H5_DLL hid_t H5Iget_file_id(hid_t id)
Definition: H5I.c:2259
H5Idec_ref
H5_DLL int H5Idec_ref(hid_t id)
Definition: H5I.c:1305
H5I_ERROR_STACK
@ H5I_ERROR_STACK
Definition: H5Ipublic.h:49