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 /* Property names for H5LTDdirect_chunk_write */
36 #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME	        "direct_chunk_flag"
37 #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME	"direct_chunk_filters"
38 #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME		"direct_chunk_offset"
39 #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME	"direct_chunk_datasize"
40 
41 /* Property names for H5LTDdirect_chunk_read */
42 #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME        "direct_chunk_read_flag"
43 #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME      "direct_chunk_read_offset"
44 #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME      "direct_chunk_read_filters"
45 
46 /*******************/
47 /* Public Typedefs */
48 /*******************/
49 
50 /* Values for the H5D_LAYOUT property */
51 typedef enum H5D_layout_t {
52     H5D_LAYOUT_ERROR	= -1,
53 
54     H5D_COMPACT		= 0,	/*raw data is very small		     */
55     H5D_CONTIGUOUS	= 1,	/*the default				     */
56     H5D_CHUNKED		= 2,	/*slow and fancy			     */
57     H5D_NLAYOUTS	= 3	/*this one must be last!		     */
58 } H5D_layout_t;
59 
60 /* Types of chunk index data structures */
61 typedef enum H5D_chunk_index_t {
62     H5D_CHUNK_BTREE	= 0	/* v1 B-tree index			     */
63 } H5D_chunk_index_t;
64 
65 /* Values for the space allocation time property */
66 typedef enum H5D_alloc_time_t {
67     H5D_ALLOC_TIME_ERROR	= -1,
68     H5D_ALLOC_TIME_DEFAULT  	= 0,
69     H5D_ALLOC_TIME_EARLY	= 1,
70     H5D_ALLOC_TIME_LATE		= 2,
71     H5D_ALLOC_TIME_INCR		= 3
72 } H5D_alloc_time_t;
73 
74 /* Values for the status of space allocation */
75 typedef enum H5D_space_status_t {
76     H5D_SPACE_STATUS_ERROR		= -1,
77     H5D_SPACE_STATUS_NOT_ALLOCATED	= 0,
78     H5D_SPACE_STATUS_PART_ALLOCATED	= 1,
79     H5D_SPACE_STATUS_ALLOCATED		= 2
80 } H5D_space_status_t;
81 
82 /* Values for time of writing fill value property */
83 typedef enum H5D_fill_time_t {
84     H5D_FILL_TIME_ERROR	= -1,
85     H5D_FILL_TIME_ALLOC = 0,
86     H5D_FILL_TIME_NEVER	= 1,
87     H5D_FILL_TIME_IFSET	= 2
88 } H5D_fill_time_t;
89 
90 /* Values for fill value status */
91 typedef enum H5D_fill_value_t {
92     H5D_FILL_VALUE_ERROR        =-1,
93     H5D_FILL_VALUE_UNDEFINED    =0,
94     H5D_FILL_VALUE_DEFAULT      =1,
95     H5D_FILL_VALUE_USER_DEFINED =2
96 } H5D_fill_value_t;
97 
98 /********************/
99 /* Public Variables */
100 /********************/
101 
102 /*********************/
103 /* Public Prototypes */
104 /*********************/
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 
109 /* Define the operator function pointer for H5Diterate() */
110 typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim,
111 				 const hsize_t *point, void *operator_data);
112 
113 /* Define the operator function pointer for H5Dscatter() */
114 typedef herr_t (*H5D_scatter_func_t)(const void **src_buf/*out*/,
115                                      size_t *src_buf_bytes_used/*out*/,
116                                      void *op_data);
117 
118 /* Define the operator function pointer for H5Dgather() */
119 typedef herr_t (*H5D_gather_func_t)(const void *dst_buf,
120                                     size_t dst_buf_bytes_used, void *op_data);
121 
122 H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id,
123     hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id);
124 H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id,
125     hid_t plist_id, hid_t dapl_id);
126 H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id);
127 H5_DLL herr_t H5Dclose(hid_t dset_id);
128 H5_DLL hid_t H5Dget_space(hid_t dset_id);
129 H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
130 H5_DLL hid_t H5Dget_type(hid_t dset_id);
131 H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
132 H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
133 H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
134 H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
135 H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
136 H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
137 			hid_t file_space_id, hid_t plist_id, void *buf/*out*/);
138 H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
139 			 hid_t file_space_id, hid_t plist_id, const void *buf);
140 H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id,
141             H5D_operator_t op, void *operator_data);
142 H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf);
143 H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
144 H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
145         hid_t buf_type, hid_t space);
146 H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
147 H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id,
148     hid_t dst_space_id, void *dst_buf);
149 H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
150     size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data);
151 H5_DLL herr_t H5Ddebug(hid_t dset_id);
152 
153 /* Symbols defined for compatibility with previous versions of the HDF5 API.
154  *
155  * Use of these symbols is deprecated.
156  */
157 #ifndef H5_NO_DEPRECATED_SYMBOLS
158 
159 /* Macros */
160 
161 
162 /* Typedefs */
163 
164 
165 /* Function prototypes */
166 H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
167     hid_t space_id, hid_t dcpl_id);
168 H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
169 H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
170 
171 #endif /* H5_NO_DEPRECATED_SYMBOLS */
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 #endif /* _H5Dpublic_H */
177