00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #ifndef _H5Bprivate_H
00030 #define _H5Bprivate_H
00031 
00032 #include "H5Bpublic.h"          
00033 
00034 
00035 #include "H5private.h"          
00036 #include "H5ACprivate.h"        
00037 #include "H5Fprivate.h"         
00038 #include "H5FLprivate.h"        
00039 #include "H5RCprivate.h"        
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 #ifdef NDEBUG
00052 #  undef H5B_DEBUG
00053 #endif
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 typedef enum H5B_subid_t {
00065     H5B_SNODE_ID         = 0,   
00066     H5B_CHUNK_ID         = 1,   
00067     H5B_NUM_BTREE_ID            
00068 } H5B_subid_t;
00069 
00070 
00071 typedef enum H5B_ins_t {
00072     H5B_INS_ERROR        = -1,  
00073     H5B_INS_NOOP         = 0,   
00074     H5B_INS_LEFT         = 1,   
00075     H5B_INS_RIGHT        = 2,   
00076     H5B_INS_CHANGE       = 3,   
00077     H5B_INS_FIRST        = 4,   
00078     H5B_INS_REMOVE       = 5    
00079 } H5B_ins_t;
00080 
00081 
00082 typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
00083                                         const void *_rt_key, void *_udata);
00084 
00085 
00086 typedef struct H5B_t H5B_t;
00087 
00088 
00089 
00090 
00091 typedef struct H5B_shared_t {
00092     const struct H5B_class_t    *type;  
00093     unsigned            two_k;          
00094     size_t              sizeof_rkey;    
00095     size_t              sizeof_rnode;   
00096     size_t              sizeof_keys;    
00097     uint8_t             *page;          
00098     size_t              *nkey;          
00099 } H5B_shared_t;
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 typedef struct H5B_class_t {
00110     H5B_subid_t id;                                     
00111     size_t      sizeof_nkey;                    
00112     H5RC_t *    (*get_shared)(const H5F_t*, const void*);    
00113     herr_t      (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_t*);
00114     int         (*cmp2)(H5F_t*, hid_t, void*, void*, void*);        
00115     int         (*cmp3)(H5F_t*, hid_t, void*, void*, void*);        
00116     htri_t      (*found)(H5F_t*, hid_t, haddr_t, const void*, void*);
00117 
00118     
00119     H5B_ins_t   (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*,
00120                           void*, hbool_t*, haddr_t*);
00121 
00122     
00123     hbool_t     follow_min;
00124     hbool_t     follow_max;
00125 
00126     
00127     H5B_ins_t   (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*,
00128                           hbool_t*);
00129 
00130     
00131     herr_t      (*decode)(const H5F_t*, const struct H5B_t*, const uint8_t*, void*);
00132     herr_t      (*encode)(const H5F_t*, const struct H5B_t*, uint8_t*, void*);
00133     herr_t      (*debug_key)(FILE*, H5F_t*, hid_t, int, int, const void*, const void*);
00134 } H5B_class_t;
00135 
00136 
00137 typedef struct H5B_info_t {
00138     hsize_t     size;           
00139     hsize_t     num_nodes;      
00140 } H5B_info_t;
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 H5_DLL herr_t H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00153     void *udata, haddr_t *addr_p);
00154 H5_DLL herr_t H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00155     haddr_t addr, void *udata);
00156 H5_DLL herr_t H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00157     haddr_t addr, void *udata);
00158 H5_DLL herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00159     haddr_t addr, H5B_operator_t op, void *udata);
00160 H5_DLL herr_t H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00161     haddr_t addr, H5B_info_t *bt_info, H5B_operator_t op, void *udata);
00162 H5_DLL herr_t H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00163     haddr_t addr, void *udata);
00164 H5_DLL herr_t H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00165     haddr_t addr, void *udata);
00166 H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type,
00167     size_t sizeof_rkey);
00168 H5_DLL herr_t H5B_shared_free(void *_shared);
00169 H5_DLL herr_t H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
00170     int indent, int fwidth, const H5B_class_t *type, void *udata);
00171 H5_DLL htri_t H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
00172     haddr_t addr);
00173 #endif 
00174