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 /*
17  * This file contains public declarations for the H5D module.
18  */
19 #ifndef _H5Dpublic_H
20 #define _H5Dpublic_H
21 
22 /* System headers needed by this file */
23 
24 /* Public headers needed by this file */
25 #include "H5public.h"
26 #include "H5Ipublic.h"
27 
28 /*****************/
29 /* Public Macros */
30 /*****************/
31 
32 /* Macros used to "unset" chunk cache configuration parameters */
33 #define H5D_CHUNK_CACHE_NSLOTS_DEFAULT     ((size_t) -1)
34 #define H5D_CHUNK_CACHE_NBYTES_DEFAULT      ((size_t) -1)
35 #define H5D_CHUNK_CACHE_W0_DEFAULT          -1.
36 
37 /*******************/
38 /* Public Typedefs */
39 /*******************/
40 
41 /* Values for the H5D_LAYOUT property */
42 typedef enum H5D_layout_t {
43     H5D_LAYOUT_ERROR	= -1,
44 
45     H5D_COMPACT		= 0,	/*raw data is very small		     */
46     H5D_CONTIGUOUS	= 1,	/*the default				     */
47     H5D_CHUNKED		= 2,	/*slow and fancy			     */
48     H5D_NLAYOUTS	= 3	/*this one must be last!		     */
49 } H5D_layout_t;
50 
51 /* Types of chunk index data structures */
52 typedef enum H5D_chunk_index_t {
53     H5D_CHUNK_BTREE	= 0	/* v1 B-tree index			     */
54 } H5D_chunk_index_t;
55 
56 /* Values for the space allocation time property */
57 typedef enum H5D_alloc_time_t {
58     H5D_ALLOC_TIME_ERROR	= -1,
59     H5D_ALLOC_TIME_DEFAULT  	= 0,
60     H5D_ALLOC_TIME_EARLY	= 1,
61     H5D_ALLOC_TIME_LATE		= 2,
62     H5D_ALLOC_TIME_INCR		= 3
63 } H5D_alloc_time_t;
64 
65 /* Values for the status of space allocation */
66 typedef enum H5D_space_status_t {
67     H5D_SPACE_STATUS_ERROR		= -1,
68     H5D_SPACE_STATUS_NOT_ALLOCATED	= 0,
69     H5D_SPACE_STATUS_PART_ALLOCATED	= 1,
70     H5D_SPACE_STATUS_ALLOCATED		= 2
71 } H5D_space_status_t;
72 
73 /* Values for time of writing fill value property */
74 typedef enum H5D_fill_time_t {
75     H5D_FILL_TIME_ERROR	= -1,
76     H5D_FILL_TIME_ALLOC = 0,
77     H5D_FILL_TIME_NEVER	= 1,
78     H5D_FILL_TIME_IFSET	= 2
79 } H5D_fill_time_t;
80 
81 /* Values for fill value status */
82 typedef enum H5D_fill_value_t {
83     H5D_FILL_VALUE_ERROR        =-1,
84     H5D_FILL_VALUE_UNDEFINED    =0,
85     H5D_FILL_VALUE_DEFAULT      =1,
86     H5D_FILL_VALUE_USER_DEFINED =2
87 } H5D_fill_value_t;
88 
89 /********************/
90 /* Public Variables */
91 /********************/
92 
93 /*********************/
94 /* Public Prototypes */
95 /*********************/
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 
100 /* Define the operator function pointer for H5Diterate() */
101 typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim,
102 				 const hsize_t *point, void *operator_data);
103 
104 H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id,
105     hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id);
106 H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id,
107     hid_t plist_id, hid_t dapl_id);
108 H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id);
109 H5_DLL herr_t H5Dclose(hid_t dset_id);
110 H5_DLL hid_t H5Dget_space(hid_t dset_id);
111 H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
112 H5_DLL hid_t H5Dget_type(hid_t dset_id);
113 H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
114 H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
115 H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
116 H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
117 H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
118 			hid_t file_space_id, hid_t plist_id, void *buf/*out*/);
119 H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
120 			 hid_t file_space_id, hid_t plist_id, const void *buf);
121 H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id,
122             H5D_operator_t op, void *operator_data);
123 H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf);
124 H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
125 H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
126         hid_t buf_type, hid_t space);
127 H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
128 H5_DLL herr_t H5Ddebug(hid_t dset_id);
129 
130 /* Symbols defined for compatibility with previous versions of the HDF5 API.
131  *
132  * Use of these symbols is deprecated.
133  */
134 #ifndef H5_NO_DEPRECATED_SYMBOLS
135 
136 /* Macros */
137 
138 
139 /* Typedefs */
140 
141 
142 /* Function prototypes */
143 H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
144     hid_t space_id, hid_t dcpl_id);
145 H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
146 H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
147 
148 #endif /* H5_NO_DEPRECATED_SYMBOLS */
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 #endif /* _H5Dpublic_H */
154 
155