HDF5  1.12.0
H5Dpublic.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 H5D module.
16  */
17 #ifndef _H5Dpublic_H
18 #define _H5Dpublic_H
19 
20 /* System headers needed by this file */
21 
22 /* Public headers needed by this file */
23 #include "H5public.h"
24 #include "H5Ipublic.h"
25 
26 /*****************/
27 /* Public Macros */
28 /*****************/
29 
30 /* Macros used to "unset" chunk cache configuration parameters */
31 #define H5D_CHUNK_CACHE_NSLOTS_DEFAULT ((size_t) -1)
32 #define H5D_CHUNK_CACHE_NBYTES_DEFAULT ((size_t) -1)
33 #define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0f)
34 
35 /* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */
36 #define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u)
37 
38 /*******************/
39 /* Public Typedefs */
40 /*******************/
41 
42 /* Values for the H5D_LAYOUT property */
43 typedef enum H5D_layout_t {
45 
46  H5D_COMPACT = 0, /*raw data is very small */
47  H5D_CONTIGUOUS = 1, /*the default */
48  H5D_CHUNKED = 2, /*slow and fancy */
49  H5D_VIRTUAL = 3, /*actual data is stored in other datasets */
50  H5D_NLAYOUTS = 4 /*this one must be last! */
52 
53 /* Types of chunk index data structures */
54 typedef enum H5D_chunk_index_t {
55  H5D_CHUNK_IDX_BTREE = 0, /* v1 B-tree index (default) */
56  H5D_CHUNK_IDX_SINGLE = 1, /* Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
57  H5D_CHUNK_IDX_NONE = 2, /* Implicit: No Index (H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
58  H5D_CHUNK_IDX_FARRAY = 3, /* Fixed array (for 0 unlimited dims) */
59  H5D_CHUNK_IDX_EARRAY = 4, /* Extensible array (for 1 unlimited dim) */
60  H5D_CHUNK_IDX_BT2 = 5, /* v2 B-tree index (for >1 unlimited dims) */
61  H5D_CHUNK_IDX_NTYPES /* This one must be last! */
63 
64 /* Values for the space allocation time property */
65 typedef enum H5D_alloc_time_t {
72 
73 /* Values for the status of space allocation */
74 typedef enum H5D_space_status_t {
80 
81 /* Values for time of writing fill value property */
82 typedef enum H5D_fill_time_t {
88 
89 /* Values for fill value status */
90 typedef enum H5D_fill_value_t {
96 
97 /* Values for VDS bounds option */
98 typedef enum H5D_vds_view_t {
103 
104 /* Callback for H5Pset_append_flush() in a dataset access property list */
105 typedef herr_t (*H5D_append_cb_t)(hid_t dataset_id, hsize_t *cur_dims, void *op_data);
106 
107 /* Define the operator function pointer for H5Diterate() */
108 typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim,
109  const hsize_t *point, void *operator_data);
110 
111 /* Define the operator function pointer for H5Dscatter() */
112 typedef herr_t (*H5D_scatter_func_t)(const void **src_buf/*out*/,
113  size_t *src_buf_bytes_used/*out*/,
114  void *op_data);
115 
116 /* Define the operator function pointer for H5Dgather() */
117 typedef herr_t (*H5D_gather_func_t)(const void *dst_buf,
118  size_t dst_buf_bytes_used, void *op_data);
119 
120 
121 /********************/
122 /* Public Variables */
123 /********************/
124 
125 /*********************/
126 /* Public Prototypes */
127 /*********************/
128 #ifdef __cplusplus
129 extern "C" {
130 #endif
131 
132 H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id,
133  hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id);
134 H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id,
135  hid_t plist_id, hid_t dapl_id);
136 H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id);
137 H5_DLL herr_t H5Dclose(hid_t dset_id);
138 H5_DLL hid_t H5Dget_space(hid_t dset_id);
140 H5_DLL hid_t H5Dget_type(hid_t dset_id);
144 H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
145 H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks);
146 H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size);
147 H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size);
149 H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
150  hid_t file_space_id, hid_t plist_id, void *buf/*out*/);
151 H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
152  hid_t file_space_id, hid_t plist_id, const void *buf);
153 H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters,
154  const hsize_t *offset, size_t data_size, const void *buf);
155 H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id,
156  const hsize_t *offset, uint32_t *filters, void *buf);
157 H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id,
158  H5D_operator_t op, void *operator_data);
159 H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
160 H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
161  hid_t buf_type, hid_t space);
162 H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
163 H5_DLL herr_t H5Dflush(hid_t dset_id);
164 H5_DLL herr_t H5Drefresh(hid_t dset_id);
165 H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id,
166  hid_t dst_space_id, void *dst_buf);
167 H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
168  size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data);
169 H5_DLL herr_t H5Ddebug(hid_t dset_id);
170 
171 /* Internal API routines */
174 
175 /* Symbols defined for compatibility with previous versions of the HDF5 API.
176  *
177  * Use of these symbols is deprecated.
178  */
179 #ifndef H5_NO_DEPRECATED_SYMBOLS
180 
181 /* Macros */
182 #define H5D_CHUNK_BTREE H5D_CHUNK_IDX_BTREE
183 
184 /* Formerly used to support the H5DOread/write_chunk() API calls.
185  * These symbols are no longer used in the library.
186  */
187 /* Property names for H5DOwrite_chunk */
188 #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME "direct_chunk_flag"
189 #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME "direct_chunk_filters"
190 #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME "direct_chunk_offset"
191 #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME "direct_chunk_datasize"
192 /* Property names for H5DOread_chunk */
193 #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag"
194 #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset"
195 #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters"
196 
197 /* Typedefs */
198 
199 
200 /* Function prototypes */
201 H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
202  hid_t space_id, hid_t dcpl_id);
203 H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
204 H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
205 H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf);
206 
207 #endif /* H5_NO_DEPRECATED_SYMBOLS */
208 
209 #ifdef __cplusplus
210 }
211 #endif
212 #endif /* _H5Dpublic_H */
213 
H5public.h
H5D_ALLOC_TIME_ERROR
@ H5D_ALLOC_TIME_ERROR
Definition: H5Dpublic.h:66
H5D_gather_func_t
herr_t(* H5D_gather_func_t)(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data)
Definition: H5Dpublic.h:117
H5D_ALLOC_TIME_LATE
@ H5D_ALLOC_TIME_LATE
Definition: H5Dpublic.h:69
H5Dclose
H5_DLL herr_t H5Dclose(hid_t dset_id)
Definition: H5D.c:323
H5D_space_status_t
H5D_space_status_t
Definition: H5Dpublic.h:74
H5D_SPACE_STATUS_PART_ALLOCATED
@ H5D_SPACE_STATUS_PART_ALLOCATED
Definition: H5Dpublic.h:77
H5Dformat_convert
H5_DLL herr_t H5Dformat_convert(hid_t dset_id)
Definition: H5D.c:891
H5Ipublic.h
H5Dread_chunk
H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, void *buf)
Definition: H5Dio.c:212
size
iblock size
Definition: H5EAcache.c:787
H5D_CHUNK_IDX_FARRAY
@ H5D_CHUNK_IDX_FARRAY
Definition: H5Dpublic.h:58
H5D_vds_view_t
H5D_vds_view_t
Definition: H5Dpublic.h:98
H5D_CHUNK_IDX_BTREE
@ H5D_CHUNK_IDX_BTREE
Definition: H5Dpublic.h:55
uint32_t
uint32_t
Definition: H5overflow.txt:38
H5D_SPACE_STATUS_NOT_ALLOCATED
@ H5D_SPACE_STATUS_NOT_ALLOCATED
Definition: H5Dpublic.h:76
H5D_CHUNK_IDX_BT2
@ H5D_CHUNK_IDX_BT2
Definition: H5Dpublic.h:60
H5Dflush
H5_DLL herr_t H5Dflush(hid_t dset_id)
Definition: H5D.c:810
H5D_VDS_FIRST_MISSING
@ H5D_VDS_FIRST_MISSING
Definition: H5Dpublic.h:100
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5D_scatter_func_t
herr_t(* H5D_scatter_func_t)(const void **src_buf, size_t *src_buf_bytes_used, void *op_data)
Definition: H5Dpublic.h:112
H5Dvlen_reclaim
H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
Definition: H5Ddeprec.c:322
H5D_FILL_TIME_IFSET
@ H5D_FILL_TIME_IFSET
Definition: H5Dpublic.h:86
H5Dcreate2
H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id)
Definition: H5D.c:99
H5Dcreate_anon
H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id)
Definition: H5D.c:199
H5Dget_type
H5_DLL hid_t H5Dget_type(hid_t dset_id)
Definition: H5D.c:425
H5D_COMPACT
@ H5D_COMPACT
Definition: H5Dpublic.h:46
H5D_layout_t
H5D_layout_t
Definition: H5Dpublic.h:43
H5Dset_extent
H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[])
Definition: H5D.c:773
H5D_FILL_VALUE_DEFAULT
@ H5D_FILL_VALUE_DEFAULT
Definition: H5Dpublic.h:93
H5D_ALLOC_TIME_DEFAULT
@ H5D_ALLOC_TIME_DEFAULT
Definition: H5Dpublic.h:67
H5D_ALLOC_TIME_INCR
@ H5D_ALLOC_TIME_INCR
Definition: H5Dpublic.h:70
H5Dwrite
H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf)
Definition: H5Dio.c:282
H5D_CHUNK_IDX_NTYPES
@ H5D_CHUNK_IDX_NTYPES
Definition: H5Dpublic.h:61
H5D_alloc_time_t
H5D_alloc_time_t
Definition: H5Dpublic.h:65
H5D_FILL_VALUE_USER_DEFINED
@ H5D_FILL_VALUE_USER_DEFINED
Definition: H5Dpublic.h:94
H5Dopen2
H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id)
Definition: H5D.c:266
H5D_CHUNK_IDX_SINGLE
@ H5D_CHUNK_IDX_SINGLE
Definition: H5Dpublic.h:56
H5Dget_access_plist
H5_DLL hid_t H5Dget_access_plist(hid_t dset_id)
Definition: H5D.c:518
H5D_FILL_VALUE_ERROR
@ H5D_FILL_VALUE_ERROR
Definition: H5Dpublic.h:91
H5D_CHUNKED
@ H5D_CHUNKED
Definition: H5Dpublic.h:48
H5D_VIRTUAL
@ H5D_VIRTUAL
Definition: H5Dpublic.h:49
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5Dget_storage_size
H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id)
Definition: H5D.c:555
H5D_ALLOC_TIME_EARLY
@ H5D_ALLOC_TIME_EARLY
Definition: H5Dpublic.h:68
H5Dscatter
H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf)
Definition: H5Dscatgath.c:936
H5Dget_space_status
H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation)
Definition: H5D.c:390
H5Dgather
H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data)
Definition: H5Dscatgath.c:1034
H5Dread
H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf)
Definition: H5Dio.c:160
H5Dget_num_chunks
H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks)
Definition: H5D.c:1015
H5Diterate
H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data)
Definition: H5D.c:669
H5Dwrite_chunk
H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf)
Definition: H5Dio.c:334
H5Dget_chunk_index_type
H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type)
Definition: H5D.c:929
H5D_chunk_index_t
H5D_chunk_index_t
Definition: H5Dpublic.h:54
H5D_FILL_TIME_ERROR
@ H5D_FILL_TIME_ERROR
Definition: H5Dpublic.h:83
H5D_FILL_TIME_ALLOC
@ H5D_FILL_TIME_ALLOC
Definition: H5Dpublic.h:84
H5Ddebug
H5_DLL herr_t H5Ddebug(hid_t dset_id)
Definition: H5Ddbg.c:74
H5Drefresh
H5_DLL herr_t H5Drefresh(hid_t dset_id)
Definition: H5D.c:848
H5Dget_chunk_info_by_coord
H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
Definition: H5D.c:1116
H5D_CONTIGUOUS
@ H5D_CONTIGUOUS
Definition: H5Dpublic.h:47
H5Dget_offset
H5_DLL haddr_t H5Dget_offset(hid_t dset_id)
Definition: H5D.c:588
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5Dget_create_plist
H5_DLL hid_t H5Dget_create_plist(hid_t dset_id)
Definition: H5D.c:463
H5D_operator_t
herr_t(* H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data)
Definition: H5Dpublic.h:108
H5D_VDS_ERROR
@ H5D_VDS_ERROR
Definition: H5Dpublic.h:99
H5Dvlen_get_buf_size
H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size)
Definition: H5D.c:722
H5Dextend
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[])
Definition: H5Ddeprec.c:245
H5D_fill_value_t
H5D_fill_value_t
Definition: H5Dpublic.h:90
H5Dcreate1
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id)
Definition: H5Ddeprec.c:113
H5D_NLAYOUTS
@ H5D_NLAYOUTS
Definition: H5Dpublic.h:50
H5Dget_chunk_info
H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *coord, unsigned *filter_mask, haddr_t *addr, hsize_t *size)
Definition: H5D.c:1061
H5D_FILL_VALUE_UNDEFINED
@ H5D_FILL_VALUE_UNDEFINED
Definition: H5Dpublic.h:92
H5Dfill
H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space)
Definition: H5Dfill.c:119
H5D_SPACE_STATUS_ALLOCATED
@ H5D_SPACE_STATUS_ALLOCATED
Definition: H5Dpublic.h:78
herr_t
int herr_t
Definition: H5public.h:128
H5D_CHUNK_IDX_NONE
@ H5D_CHUNK_IDX_NONE
Definition: H5Dpublic.h:57
H5Dget_space
H5_DLL hid_t H5Dget_space(hid_t dset_id)
Definition: H5D.c:359
H5Dget_chunk_storage_size
H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes)
Definition: H5D.c:968
H5D_VDS_LAST_AVAILABLE
@ H5D_VDS_LAST_AVAILABLE
Definition: H5Dpublic.h:101
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5Dopen1
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name)
Definition: H5Ddeprec.c:187
H5D_append_cb_t
herr_t(* H5D_append_cb_t)(hid_t dataset_id, hsize_t *cur_dims, void *op_data)
Definition: H5Dpublic.h:105
H5D_LAYOUT_ERROR
@ H5D_LAYOUT_ERROR
Definition: H5Dpublic.h:44
H5D_CHUNK_IDX_EARRAY
@ H5D_CHUNK_IDX_EARRAY
Definition: H5Dpublic.h:59
H5D_FILL_TIME_NEVER
@ H5D_FILL_TIME_NEVER
Definition: H5Dpublic.h:85
H5D_SPACE_STATUS_ERROR
@ H5D_SPACE_STATUS_ERROR
Definition: H5Dpublic.h:75
H5D_fill_time_t
H5D_fill_time_t
Definition: H5Dpublic.h:82