15 #error "Do not include this file outside the H5O package!" 22 #include "H5Oprivate.h" 25 #include "H5ACprivate.h" 26 #include "H5FLprivate.h" 31 #define H5O_MIN_SIZE 22 32 #define H5O_MSG_TYPES 25 33 #define H5O_MAX_CRT_ORDER_IDX 65535 38 #define H5O_VERSION_1 1 43 #define H5O_VERSION_2 2 47 #define H5O_VERSION_LATEST H5O_VERSION_2 57 #define H5O_ALIGN_OLD(X) (8 * (((X) + 7) / 8)) 58 #define H5O_ALIGN_VERS(V, X) \ 59 (((V) == H5O_VERSION_1) ? \ 64 #define H5O_ALIGN_OH(O, X) \ 65 H5O_ALIGN_VERS((O)->version, X) 66 #define H5O_ALIGN_F(F, X) \ 67 H5O_ALIGN_VERS((H5F_USE_LATEST_FORMAT(F) ? H5O_VERSION_LATEST : H5O_VERSION_1), X) 70 #define H5O_SIZEOF_CHKSUM 4 79 #define H5O_CRT_ATTR_MAX_COMPACT_DEF 8 80 #define H5O_CRT_ATTR_MIN_DENSE_DEF 6 81 #define H5O_CRT_OHDR_FLAGS_DEF H5O_HDR_STORE_TIMES 84 #define H5O_HDR_CHUNK0_1 0x00 85 #define H5O_HDR_CHUNK0_2 0x01 86 #define H5O_HDR_CHUNK0_4 0x02 87 #define H5O_HDR_CHUNK0_8 0x03 92 #define H5O_SIZEOF_HDR(O) \ 93 (((O)->version == H5O_VERSION_1) \ 104 (((O)->flags & H5O_HDR_STORE_TIMES) ? ( \ 110 (((O)->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) ? ( \ 114 (1 << ((O)->flags & H5O_HDR_CHUNK0_SIZE)) + \ 121 #define H5O_SIZEOF_MSGHDR_VERS(V,C) \ 122 (((V) == H5O_VERSION_1) \ 136 #define H5O_SIZEOF_MSGHDR_OH(O) \ 137 H5O_SIZEOF_MSGHDR_VERS((O)->version, (O)->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) 138 #define H5O_SIZEOF_MSGHDR_F(F, C) \ 139 H5O_SIZEOF_MSGHDR_VERS((H5F_USE_LATEST_FORMAT(F) || H5F_STORE_MSG_CRT_IDX(F)) ? H5O_VERSION_LATEST : H5O_VERSION_1, (C)) 144 #define H5O_SIZEOF_CHKHDR_VERS(V) \ 145 (((V) == H5O_VERSION_1) \ 153 #define H5O_SIZEOF_CHKHDR_OH(O) \ 154 H5O_SIZEOF_CHKHDR_VERS((O)->version) 159 #define H5O_SIZEOF_CHKSUM_VERS(V) \ 160 (((V) == H5O_VERSION_1) \ 166 #define H5O_SIZEOF_CHKSUM_OH(O) \ 167 H5O_SIZEOF_CHKSUM_VERS((O)->version) 170 #define H5O_DECODEIO_NOCHANGE 0x01u 171 #define H5O_DECODEIO_DIRTY 0x02u 175 #define INCR_NDECODE_DIRTIED(OH) (OH)->ndecode_dirtied++; 177 #define INCR_NDECODE_DIRTIED(OH) ; 182 #define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR) \ 183 if(NULL == (MSG)->native) { \ 184 const H5O_msg_class_t *msg_type = (MSG)->type; \ 185 unsigned ioflags = (IOF); \ 188 HDassert(msg_type->decode); \ 189 if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \ 190 HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ 193 if((ioflags & H5O_DECODEIO_DIRTY) && (H5F_get_intent((F)) & H5F_ACC_RDWR)) { \ 194 (MSG)->dirty = TRUE; \ 197 INCR_NDECODE_DIRTIED(OH) \ 201 if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \ 202 HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \ 203 H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \ 207 if(msg_type->set_crt_index) { \ 209 if((msg_type->set_crt_index)((MSG)->native, (MSG)->crt_idx) < 0) \ 210 HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, ERR, "unable to set creation index") \ 215 #define H5O_SHARE_IS_SHARABLE 0x01 216 #define H5O_SHARE_IN_OHDR 0x02 225 void *(*decode)(
H5F_t *,
hid_t,
H5O_t *, unsigned,
unsigned *, size_t,
const uint8_t *);
227 void *(*copy)(
const void *,
void *);
236 void *(*copy_file)(H5F_t *,
void *, H5F_t *, hbool_t *,
unsigned *, H5O_copy_t *,
void *,
hid_t);
271 #ifdef H5O_ENABLE_BAD_MESG_COUNT 320 void *(*get_copy_file_udata)(void);
321 void (*free_copy_file_udata)(
void *);
327 herr_t (*flush)(H5G_loc_t *loc, hid_t dxpl_id);
441 #ifdef H5O_ENABLE_BOGUS 549 int sequence, H5O_operator_t op,
void *op_data,
hbool_t adj_link,
hid_t dxpl_id);
551 void *mesg_src,
H5F_t *file_dst,
hbool_t *recompute_size,
552 unsigned *mesg_flags, H5O_copy_t *cpy_info,
void *udata,
hid_t dxpl_id);
554 const H5O_mesg_operator_t *op,
void *op_data,
hid_t dxpl_id);
588 const H5O_msg_class_t *mesg_type,
const void *_native_src,
void *_native_dst,
589 hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info,
590 void *udata,
hid_t dxpl_id);
593 H5O_shared_t *shared_dst,
unsigned *mesg_flags,
hid_t dxpl_id,
594 H5O_copy_t *cpy_info);
596 int indent,
int fwidth);
H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc)
H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_AINFO[1]
htri_t(* can_share)(const void *)
H5_DLL void * H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg)
herr_t(* set_crt_index)(void *, H5O_msg_crt_idx_t)
H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted)
herr_t(* post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *)
H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1]
H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg)
H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg)
H5O_msg_crt_idx_t crt_idx
struct H5O_chunk_t H5O_chunk_t
H5_DLL H5O_loc_t * H5O_get_loc(hid_t id)
struct H5O_obj_class_t H5O_obj_class_t
H5_DLL herr_t H5O_attr_reset(void *_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_DTYPE[1]
herr_t(* link)(H5F_t *, hid_t, H5O_t *, void *)
struct H5O_addr_map_t H5O_addr_map_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_BTREEK[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_GINFO[1]
herr_t(* del)(H5F_t *, hid_t, H5O_t *, void *)
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]
struct H5O_chunk_proxy_t H5O_chunk_proxy_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_ATTR[1]
H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy)
H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref)
H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link)
unsigned long long hsize_t
H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg)
H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LAYOUT[1]
H5_DLLVAR const H5AC_class_t H5AC_OHDR[1]
H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id)
struct H5O_common_cache_ud_t H5O_common_cache_ud_t
H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_PLINE[1]
H5_DLL void * H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
H5_DLL herr_t H5O_inc_rc(H5O_t *oh)
H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
H5_DLL herr_t H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth)
H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES]
H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
H5FL_SEQ_EXTERN(H5O_mesg_t)
const H5O_msg_class_t * type
herr_t(* get_crt_index)(const void *, H5O_msg_crt_idx_t *)
H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_DRVINFO[1]
struct H5O_chk_cache_ud_t H5O_chk_cache_ud_t
H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL_NEW[1]
H5O_common_cache_ud_t common
H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg)
H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_EFL[1]
H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_NAME[1]
const H5O_obj_class_t * obj_class
H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
herr_t(* encode)(H5F_t *, hbool_t, uint8_t *, const void *)
H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME[1]
herr_t(* pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *)
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_GROUP[1]
H5_DLL herr_t H5O_dec_rc(H5O_t *oh)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_FILL[1]
struct H5O_cont_msgs_t H5O_cont_msgs_t
size_t(* raw_size)(const H5F_t *, hbool_t, const void *)
H5_DLL herr_t H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info)
herr_t(* set_share)(void *, const H5O_shared_t *)
H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth)
uint32_t H5O_msg_crt_idx_t
H5_DLL herr_t H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_NULL[1]
H5_DLL H5O_chunk_proxy_t * H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf, const H5O_shared_t *sh_mesg)
H5FL_BLK_EXTERN(chunk_image)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_UNKNOWN[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINK[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_SDSPACE[1]
H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
struct H5O_cache_ud_t H5O_cache_ud_t
H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg, size_t *mesg_idx)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_SHMESG[1]
unsigned merged_null_msgs
H5_DLL herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg)
HDFFCLIBAPI intf intf intf * type
H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_MTIME_NEW[1]
herr_t(* bh_info)(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
H5O_cont_msgs_t * cont_msg_info
H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_CONT[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_REFCOUNT[1]
H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs)
H5_DLLVAR const H5O_msg_class_t H5O_MSG_LINFO[1]
H5_DLLVAR const H5O_msg_class_t H5O_MSG_STAB[1]
H5O_common_cache_ud_t common
herr_t(* debug)(H5F_t *, hid_t, const void *, FILE *, int, int)
H5_DLL herr_t H5O_free(H5O_t *oh)
H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id)
H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id)
H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)