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 files COPYING and Copyright.html.  COPYING can be found at the root   *
9  * of the source code distribution tree; Copyright.html can be found at the  *
10  * root level of an installed copy of the electronic HDF5 document set and   *
11  * is linked from the top-level documents page.  It can also be found at     *
12  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
13  * access to either file, you may request a copy from help@hdfgroup.org.     *
14  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 module hdf5.H5Dpublic;
17 
18 /*
19  * This file contains public declarations for the H5D module.
20  */
21 
22 /* Public headers needed by this file */
23 import hdf5.H5public;
24 import hdf5.H5Ipublic;
25 
26 extern(C):
27 
28 /*****************/
29 /* Public Macros */
30 /*****************/
31 
32 /* Macros used to "unset" chunk cache configuration parameters */
33 enum H5D_CHUNK_CACHE_NSLOTS_DEFAULT = (cast(size_t) -1);
34 enum H5D_CHUNK_CACHE_NBYTES_DEFAULT = (cast(size_t) -1);
35 enum H5D_CHUNK_CACHE_W0_DEFAULT     = -1.;
36 
37 /* Property names for H5LTDdirect_chunk_write */   
38 enum H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME     = "direct_chunk_flag";
39 enum H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME  = "direct_chunk_filters";
40 enum H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME   = "direct_chunk_offset";
41 enum H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME = "direct_chunk_datasize";
42 
43 /*******************/
44 /* Public Typedefs */
45 /*******************/
46 
47 /* Values for the H5D_LAYOUT property */
48 enum H5D_layout_t {
49     H5D_LAYOUT_ERROR	= -1,
50 
51     H5D_COMPACT		= 0,	/*raw data is very small		     */
52     H5D_CONTIGUOUS	= 1,	/*the default				     */
53     H5D_CHUNKED		= 2,	/*slow and fancy			     */
54     H5D_NLAYOUTS	= 3	/*this one must be last!		     */
55 }
56 
57 /* Types of chunk index data structures */
58 enum H5D_chunk_index_t {
59     H5D_CHUNK_BTREE	= 0	/* v1 B-tree index			     */
60 }
61 
62 /* Values for the space allocation time property */
63 enum H5D_alloc_time_t {
64     H5D_ALLOC_TIME_ERROR	= -1,
65     H5D_ALLOC_TIME_DEFAULT  	= 0,
66     H5D_ALLOC_TIME_EARLY	= 1,
67     H5D_ALLOC_TIME_LATE		= 2,
68     H5D_ALLOC_TIME_INCR		= 3
69 }
70 
71 /* Values for the status of space allocation */
72 enum H5D_space_status_t {
73     H5D_SPACE_STATUS_ERROR		= -1,
74     H5D_SPACE_STATUS_NOT_ALLOCATED	= 0,
75     H5D_SPACE_STATUS_PART_ALLOCATED	= 1,
76     H5D_SPACE_STATUS_ALLOCATED		= 2
77 }
78 
79 /* Values for time of writing fill value property */
80 enum H5D_fill_time_t {
81     H5D_FILL_TIME_ERROR	= -1,
82     H5D_FILL_TIME_ALLOC = 0,
83     H5D_FILL_TIME_NEVER	= 1,
84     H5D_FILL_TIME_IFSET	= 2
85 }
86 
87 /* Values for fill value status */
88 enum H5D_fill_value_t {
89     H5D_FILL_VALUE_ERROR        =-1,
90     H5D_FILL_VALUE_UNDEFINED    =0,
91     H5D_FILL_VALUE_DEFAULT      =1,
92     H5D_FILL_VALUE_USER_DEFINED =2
93 }
94 
95 /********************/
96 /* Public Variables */
97 /********************/
98 
99 /*********************/
100 /* Public Prototypes */
101 /*********************/
102 
103 /* Define the operator function pointer for H5Diterate() */
104 alias H5D_operator_t = herr_t function(void *elem, hid_t type_id, int ndim,
105 				 const hsize_t *point, void *operator_data);
106 
107 /* Define the operator function pointer for H5Dscatter() */
108 alias H5D_scatter_func_t = herr_t function(const void **src_buf/*out*/,
109                                      size_t *src_buf_bytes_used/*out*/,
110                                      void *op_data);
111 
112 /* Define the operator function pointer for H5Dgather() */
113 alias H5D_gather_func_t = herr_t function(const void *dst_buf,
114                                     size_t dst_buf_bytes_used, void *op_data);
115 
116 version(Posix) {
117   hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id,
118                    hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id);
119   hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id,
120                        hid_t plist_id, hid_t dapl_id);
121   hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id);
122   herr_t H5Dclose(hid_t dset_id);
123   hid_t H5Dget_space(hid_t dset_id);
124   herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
125   hid_t H5Dget_type(hid_t dset_id);
126   hid_t H5Dget_create_plist(hid_t dset_id);
127   hid_t H5Dget_access_plist(hid_t dset_id);
128   hsize_t H5Dget_storage_size(hid_t dset_id);
129   haddr_t H5Dget_offset(hid_t dset_id);
130   herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
131                  hid_t file_space_id, hid_t plist_id, void *buf/*out*/);
132   herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
133                   hid_t file_space_id, hid_t plist_id, const void *buf);
134   herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id,
135                     H5D_operator_t op, void *operator_data);
136   herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf);
137   herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
138   herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
139                  hid_t buf_type, hid_t space);
140   herr_t H5Dset_extent(hid_t dset_id, const hsize_t* size);
141   herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id,
142                     hid_t dst_space_id, void *dst_buf);
143   herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
144                    size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data);
145   herr_t H5Ddebug(hid_t dset_id);
146 }
147 
148 /++ DEPRECATED
149 /* Symbols defined for compatibility with previous versions of the HDF5 API.
150  *
151  * Use of these symbols is deprecated.
152  */
153 #ifndef H5_NO_DEPRECATED_SYMBOLS
154 
155 /* Macros */
156 
157 
158 /* Typedefs */
159 
160 
161 /* Function prototypes */
162 hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
163     hid_t space_id, hid_t dcpl_id);
164 hid_t H5Dopen1(hid_t file_id, const char *name);
165 herr_t H5Dextend(hid_t dset_id, const hsize_t[] size);
166 
167 #endif /* H5_NO_DEPRECATED_SYMBOLS */
168 +/
169