00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _H5FDpublic_H
00021 #define _H5FDpublic_H
00022
00023 #include "H5public.h"
00024 #include "H5Fpublic.h"
00025
00026 #define H5_HAVE_VFL 1
00027 #define H5FD_VFD_DEFAULT 0
00028
00029
00030
00031
00032
00033
00034 typedef enum H5FD_mem_t {
00035 H5FD_MEM_NOLIST = -1,
00036 H5FD_MEM_DEFAULT = 0,
00037 H5FD_MEM_SUPER = 1,
00038 H5FD_MEM_BTREE = 2,
00039 H5FD_MEM_DRAW = 3,
00040 H5FD_MEM_GHEAP = 4,
00041 H5FD_MEM_LHEAP = 5,
00042 H5FD_MEM_OHDR = 6,
00043
00044 H5FD_MEM_NTYPES
00045 } H5FD_mem_t;
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #define H5FD_MEM_FHEAP_HDR H5FD_MEM_OHDR
00063 #define H5FD_MEM_FHEAP_IBLOCK H5FD_MEM_OHDR
00064 #define H5FD_MEM_FHEAP_DBLOCK H5FD_MEM_LHEAP
00065 #define H5FD_MEM_FHEAP_HUGE_OBJ H5FD_MEM_DRAW
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #define H5FD_MEM_FSPACE_HDR H5FD_MEM_OHDR
00077 #define H5FD_MEM_FSPACE_SINFO H5FD_MEM_LHEAP
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 #define H5FD_MEM_SOHM_TABLE H5FD_MEM_OHDR
00090 #define H5FD_MEM_SOHM_INDEX H5FD_MEM_BTREE
00091
00092
00093
00094
00095
00096
00097
00098
00099 #define H5FD_FLMAP_SINGLE { \
00100 H5FD_MEM_SUPER, \
00101 H5FD_MEM_SUPER, \
00102 H5FD_MEM_SUPER, \
00103 H5FD_MEM_SUPER, \
00104 H5FD_MEM_SUPER, \
00105 H5FD_MEM_SUPER, \
00106 H5FD_MEM_SUPER \
00107 }
00108
00109
00110
00111
00112
00113 #define H5FD_FLMAP_DICHOTOMY { \
00114 H5FD_MEM_SUPER, \
00115 H5FD_MEM_SUPER, \
00116 H5FD_MEM_SUPER, \
00117 H5FD_MEM_DRAW, \
00118 H5FD_MEM_SUPER, \
00119 H5FD_MEM_SUPER, \
00120 H5FD_MEM_SUPER \
00121 }
00122
00123
00124
00125
00126
00127 #define H5FD_FLMAP_DEFAULT { \
00128 H5FD_MEM_DEFAULT, \
00129 H5FD_MEM_DEFAULT, \
00130 H5FD_MEM_DEFAULT, \
00131 H5FD_MEM_DEFAULT, \
00132 H5FD_MEM_DEFAULT, \
00133 H5FD_MEM_DEFAULT, \
00134 H5FD_MEM_DEFAULT \
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 #define H5FD_FEAT_AGGREGATE_METADATA 0x00000001
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 #define H5FD_FEAT_ACCUMULATE_METADATA_WRITE 0x00000002
00159 #define H5FD_FEAT_ACCUMULATE_METADATA_READ 0x00000004
00160 #define H5FD_FEAT_ACCUMULATE_METADATA (H5FD_FEAT_ACCUMULATE_METADATA_WRITE|H5FD_FEAT_ACCUMULATE_METADATA_READ)
00161
00162
00163
00164
00165
00166
00167
00168 #define H5FD_FEAT_DATA_SIEVE 0x00000008
00169
00170
00171
00172
00173
00174 #define H5FD_FEAT_AGGREGATE_SMALLDATA 0x00000010
00175
00176
00177
00178 typedef struct H5FD_t H5FD_t;
00179
00180
00181 typedef struct H5FD_class_t {
00182 const char *name;
00183 haddr_t maxaddr;
00184 H5F_close_degree_t fc_degree;
00185 hsize_t (*sb_size)(H5FD_t *file);
00186 herr_t (*sb_encode)(H5FD_t *file, char *name,
00187 unsigned char *p);
00188 herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
00189 size_t fapl_size;
00190 void * (*fapl_get)(H5FD_t *file);
00191 void * (*fapl_copy)(const void *fapl);
00192 herr_t (*fapl_free)(void *fapl);
00193 size_t dxpl_size;
00194 void * (*dxpl_copy)(const void *dxpl);
00195 herr_t (*dxpl_free)(void *dxpl);
00196 H5FD_t *(*open)(const char *name, unsigned flags, hid_t fapl,
00197 haddr_t maxaddr);
00198 herr_t (*close)(H5FD_t *file);
00199 int (*cmp)(const H5FD_t *f1, const H5FD_t *f2);
00200 herr_t (*query)(const H5FD_t *f1, unsigned long *flags);
00201 herr_t (*get_type_map)(const H5FD_t *file, H5FD_mem_t *type_map);
00202 haddr_t (*alloc)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
00203 herr_t (*free)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
00204 haddr_t addr, hsize_t size);
00205 haddr_t (*get_eoa)(const H5FD_t *file, H5FD_mem_t type);
00206 herr_t (*set_eoa)(H5FD_t *file, H5FD_mem_t type, haddr_t addr);
00207 haddr_t (*get_eof)(const H5FD_t *file);
00208 herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void**file_handle);
00209 herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
00210 haddr_t addr, size_t size, void *buffer);
00211 herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl,
00212 haddr_t addr, size_t size, const void *buffer);
00213 herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, unsigned closing);
00214 herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
00215 herr_t (*lock)(H5FD_t *file, unsigned char *oid, unsigned lock_type, hbool_t last);
00216 herr_t (*unlock)(H5FD_t *file, unsigned char *oid, hbool_t last);
00217 H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
00218 } H5FD_class_t;
00219
00220
00221 typedef struct H5FD_free_t {
00222 haddr_t addr;
00223 hsize_t size;
00224 struct H5FD_free_t *next;
00225 } H5FD_free_t;
00226
00227
00228
00229
00230
00231 struct H5FD_t {
00232 hid_t driver_id;
00233 const H5FD_class_t *cls;
00234 unsigned long fileno;
00235 unsigned long feature_flags;
00236 haddr_t maxaddr;
00237 haddr_t base_addr;
00238
00239
00240 hsize_t threshold;
00241 hsize_t alignment;
00242 };
00243
00244 #ifdef __cplusplus
00245 extern "C" {
00246 #endif
00247
00248
00249 H5_DLL hid_t H5FDregister(const H5FD_class_t *cls);
00250 H5_DLL herr_t H5FDunregister(hid_t driver_id);
00251 H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id,
00252 haddr_t maxaddr);
00253 H5_DLL herr_t H5FDclose(H5FD_t *file);
00254 H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
00255 H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags);
00256 H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
00257 H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
00258 haddr_t addr, hsize_t size);
00259 H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type);
00260 H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa);
00261 H5_DLL haddr_t H5FDget_eof(H5FD_t *file);
00262 H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle);
00263 H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
00264 haddr_t addr, size_t size, void *buf);
00265 H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
00266 haddr_t addr, size_t size, const void *buf);
00267 H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing);
00268 H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
00269
00270 #ifdef __cplusplus
00271 }
00272 #endif
00273 #endif
00274