HDF5  1.12.0
H5Rpublic.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 public declarations for the H5R module.
16  */
17 #ifndef _H5Rpublic_H
18 #define _H5Rpublic_H
19 
20 /* Public headers needed by this file */
21 #include "H5public.h"
22 #include "H5Gpublic.h"
23 #include "H5Ipublic.h"
24 
25 /*****************/
26 /* Public Macros */
27 /*****************/
28 
29 /* Deprecated reference buffer sizes that are kept for backward compatibility */
30 #define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t)
31 #define H5R_DSET_REG_REF_BUF_SIZE (sizeof(haddr_t) + 4)
32 
33 /* Default reference buffer size.
34  * Note! Be careful with the sizes of the references because they should really
35  * depend on the run-time values in the file.
36  */
37 #define H5R_REF_BUF_SIZE (64)
38 
39 /*******************/
40 /* Public Typedefs */
41 /*******************/
42 
43 /*
44  * Reference types allowed.
45  * DO NOT CHANGE THE ORDER or VALUES as reference type values are encoded into
46  * the datatype message header.
47  */
48 typedef enum {
49  H5R_BADTYPE = (-1), /* Invalid reference type */
50  H5R_OBJECT1 = 0, /* Backward compatibility (object) */
51  H5R_DATASET_REGION1 = 1, /* Backward compatibility (region) */
52  H5R_OBJECT2 = 2, /* Object reference */
53  H5R_DATASET_REGION2 = 3, /* Region reference */
54  H5R_ATTR = 4, /* Attribute Reference */
55  H5R_MAXTYPE = 5 /* Highest type (invalid) */
57 
58 /* Deprecated types are kept for backward compatibility with previous versions */
59 
65 
73 typedef struct {
76 
82 typedef struct {
83  union {
84  uint8_t __data[H5R_REF_BUF_SIZE]; /* opaque data */
85  int64_t align; /* ensures alignment */
86  } u;
87 } H5R_ref_t;
88 
89 /********************/
90 /* Public Variables */
91 /********************/
92 
93 
94 /*********************/
95 /* Public Prototypes */
96 /*********************/
97 
98 #ifdef __cplusplus
99 extern "C" {
100 #endif
101 
102 /* Constructors */
103 H5_DLL herr_t H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_ptr);
104 H5_DLL herr_t H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, H5R_ref_t *ref_ptr);
105 H5_DLL herr_t H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl_id, H5R_ref_t *ref_ptr);
107 
108 /* Info */
109 H5_DLL H5R_type_t H5Rget_type(const H5R_ref_t *ref_ptr);
110 H5_DLL htri_t H5Requal(const H5R_ref_t *ref1_ptr, const H5R_ref_t *ref2_ptr);
111 H5_DLL herr_t H5Rcopy(const H5R_ref_t *src_ref_ptr, H5R_ref_t *dst_ref_ptr);
112 
113 /* Dereference */
114 H5_DLL hid_t H5Ropen_object(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id);
115 H5_DLL hid_t H5Ropen_region(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id);
116 H5_DLL hid_t H5Ropen_attr(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id);
117 
118 /* Get type */
119 H5_DLL herr_t H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type);
120 
121 /* Get name */
122 H5_DLL ssize_t H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf, size_t size);
123 H5_DLL ssize_t H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size);
124 H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf, size_t size);
125 
126 /* Symbols defined for compatibility with previous versions of the HDF5 API.
127  *
128  * Use of these symbols is or will be deprecated.
129  */
130 
131 /* Macros */
132 
133 /* Versions for compatibility */
134 #define H5R_OBJECT H5R_OBJECT1
135 #define H5R_DATASET_REGION H5R_DATASET_REGION1
136 
137 /* Function prototypes */
138 #ifndef H5_NO_DEPRECATED_SYMBOLS
139 
140 H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref);
141 H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
142 
143 #endif /* H5_NO_DEPRECATED_SYMBOLS */
144 
145 H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id);
146 H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type);
147 H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref);
148 H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref);
149 H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, char *name, size_t size);
150 
151 #ifdef __cplusplus
152 }
153 #endif
154 
155 #endif /* _H5Rpublic_H */
H5public.h
u
hsize_t u
Definition: H5EA.c:1007
H5R_BADTYPE
@ H5R_BADTYPE
Definition: H5Rpublic.h:49
ssize_t
int ssize_t
Definition: H5public.h:167
H5Ipublic.h
size
iblock size
Definition: H5EAcache.c:787
H5Rget_region
H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref)
Definition: H5Rdeprec.c:466
H5Ropen_object
H5_DLL hid_t H5Ropen_object(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id)
Definition: H5R.c:471
H5Requal
H5_DLL htri_t H5Requal(const H5R_ref_t *ref1_ptr, const H5R_ref_t *ref2_ptr)
Definition: H5R.c:410
H5R_OBJECT1
@ H5R_OBJECT1
Definition: H5Rpublic.h:50
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5Rget_type
H5_DLL H5R_type_t H5Rget_type(const H5R_ref_t *ref_ptr)
Definition: H5R.c:379
hdset_reg_ref_t
Definition: H5Rpublic.h:73
H5R_ATTR
@ H5R_ATTR
Definition: H5Rpublic.h:54
H5Rget_name
H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, char *name, size_t size)
Definition: H5Rdeprec.c:552
uint8_t
unsigned char uint8_t
Definition: H5private.h:429
H5Rdestroy
H5_DLL herr_t H5Rdestroy(H5R_ref_t *ref_ptr)
Definition: H5R.c:345
H5Rget_file_name
H5_DLL ssize_t H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf, size_t size)
Definition: H5R.c:793
int64_t
int64_t
Definition: H5overflow.txt:35
htri_t
int htri_t
Definition: H5public.h:160
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5Rcreate_object
H5_DLL herr_t H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_ptr)
Definition: H5R.c:77
H5Rget_obj_type3
H5_DLL herr_t H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type)
Definition: H5R.c:733
H5Rcreate
H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id)
Definition: H5Rdeprec.c:223
H5Rcopy
H5_DLL herr_t H5Rcopy(const H5R_ref_t *src_ref_ptr, H5R_ref_t *dst_ref_ptr)
Definition: H5R.c:440
H5R_OBJECT2
@ H5R_OBJECT2
Definition: H5Rpublic.h:52
H5Rget_obj_type1
H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
Definition: H5Rdeprec.c:98
H5Rget_attr_name
H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf, size_t size)
Definition: H5R.c:901
H5Ropen_region
H5_DLL hid_t H5Ropen_region(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id)
Definition: H5R.c:544
H5R_ref_t::align
int64_t align
Definition: H5Rpublic.h:85
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5Rget_obj_type2
H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type)
Definition: H5Rdeprec.c:339
H5Rcreate_region
H5_DLL herr_t H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, H5R_ref_t *ref_ptr)
Definition: H5R.c:164
H5Rcreate_attr
H5_DLL herr_t H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl_id, H5R_ref_t *ref_ptr)
Definition: H5R.c:256
H5Rget_obj_name
H5_DLL ssize_t H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size)
Definition: H5R.c:842
H5R_DSET_REG_REF_BUF_SIZE
#define H5R_DSET_REG_REF_BUF_SIZE
Definition: H5Rpublic.h:31
H5Gpublic.h
H5R_type_t
H5R_type_t
Definition: H5Rpublic.h:48
hobj_ref_t
haddr_t hobj_ref_t
Definition: H5Rpublic.h:64
H5R_DATASET_REGION1
@ H5R_DATASET_REGION1
Definition: H5Rpublic.h:51
H5R_DATASET_REGION2
@ H5R_DATASET_REGION2
Definition: H5Rpublic.h:53
H5R_ref_t
Definition: H5Rpublic.h:82
herr_t
int herr_t
Definition: H5public.h:128
H5Rdereference2
H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref)
Definition: H5Rdeprec.c:396
H5R_REF_BUF_SIZE
#define H5R_REF_BUF_SIZE
Definition: H5Rpublic.h:37
H5Ropen_attr
H5_DLL hid_t H5Ropen_attr(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id)
Definition: H5R.c:638
H5G_obj_t
H5G_obj_t
Definition: H5Gpublic.h:120
H5Rdereference1
H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref)
Definition: H5Rdeprec.c:158
H5R_MAXTYPE
@ H5R_MAXTYPE
Definition: H5Rpublic.h:55
H5O_type_t
H5O_type_t
Definition: H5Opublic.h:102