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