00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef H5A_PACKAGE
00025 #error "Do not include this file outside the H5A package!"
00026 #endif
00027
00028 #ifndef _H5Apkg_H
00029 #define _H5Apkg_H
00030
00031
00032
00033
00034 #ifdef NDEBUG
00035 # undef H5A_DEBUG
00036 #endif
00037
00038
00039 #include "H5Aprivate.h"
00040
00041
00042 #include "H5B2private.h"
00043 #include "H5FLprivate.h"
00044 #include "H5HFprivate.h"
00045 #include "H5Oprivate.h"
00046 #include "H5Sprivate.h"
00047 #include "H5Tprivate.h"
00048
00049
00050
00051
00052
00053
00054
00055 #define H5O_ATTR_VERSION_1 1
00056
00057
00058
00059
00060
00061 #define H5O_ATTR_VERSION_2 2
00062
00063
00064 #define H5O_ATTR_VERSION_3 3
00065
00066
00067
00068
00069 #define H5O_ATTR_VERSION_LATEST H5O_ATTR_VERSION_3
00070
00071
00072
00073
00074
00075
00076 typedef struct H5A_shared_t {
00077 uint8_t version;
00078
00079 char *name;
00080 H5T_cset_t encoding;
00081
00082 H5T_t *dt;
00083 size_t dt_size;
00084
00085 H5S_t *ds;
00086 size_t ds_size;
00087
00088 void *data;
00089 size_t data_size;
00090 H5O_msg_crt_idx_t crt_idx;
00091 unsigned nrefs;
00092 } H5A_shared_t;
00093
00094
00095 struct H5A_t {
00096 H5O_shared_t sh_loc;
00097 H5O_loc_t oloc;
00098 hbool_t obj_opened;
00099 H5G_name_t path;
00100 H5A_shared_t *shared;
00101 };
00102
00103
00104
00105
00106
00107
00108 typedef struct H5A_dense_bt2_name_rec_t {
00109 H5O_fheap_id_t id;
00110 uint8_t flags;
00111 H5O_msg_crt_idx_t corder;
00112 uint32_t hash;
00113 } H5A_dense_bt2_name_rec_t;
00114
00115
00116
00117 typedef struct H5A_dense_bt2_corder_rec_t {
00118 H5O_fheap_id_t id;
00119 uint8_t flags;
00120 H5O_msg_crt_idx_t corder;
00121 } H5A_dense_bt2_corder_rec_t;
00122
00123
00124 typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, void *op_data);
00125
00126
00127
00128
00129
00130
00131 typedef struct H5A_bt2_ud_common_t {
00132
00133 H5F_t *f;
00134 hid_t dxpl_id;
00135 H5HF_t *fheap;
00136 H5HF_t *shared_fheap;
00137 const char *name;
00138 uint32_t name_hash;
00139 uint8_t flags;
00140 H5O_msg_crt_idx_t corder;
00141 H5A_bt2_found_t found_op;
00142 void *found_op_data;
00143 } H5A_bt2_ud_common_t;
00144
00145
00146
00147
00148
00149 typedef struct H5A_bt2_ud_ins_t {
00150
00151 H5A_bt2_ud_common_t common;
00152 H5O_fheap_id_t id;
00153 } H5A_bt2_ud_ins_t;
00154
00155
00156 typedef struct {
00157 size_t nattrs;
00158 H5A_t **attrs;
00159 } H5A_attr_table_t;
00160
00161
00162 typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data);
00163
00164
00165 typedef enum H5A_attr_iter_op_type_t {
00166 #ifndef H5_NO_DEPRECATED_SYMBOLS
00167 H5A_ATTR_OP_APP,
00168 #endif
00169 H5A_ATTR_OP_APP2,
00170 H5A_ATTR_OP_LIB
00171 } H5A_attr_iter_op_type_t;
00172
00173 typedef struct H5A_attr_iter_op_t {
00174 H5A_attr_iter_op_type_t op_type;
00175 union {
00176 #ifndef H5_NO_DEPRECATED_SYMBOLS
00177 H5A_operator1_t app_op;
00178 #endif
00179 H5A_operator2_t app_op2;
00180 H5A_lib_iterate_t lib_op;
00181 } u;
00182 } H5A_attr_iter_op_t;
00183
00184
00185
00186
00187
00188
00189
00190 H5FL_EXTERN(H5A_t);
00191
00192
00193 H5FL_EXTERN(H5A_shared_t);
00194
00195
00196 H5FL_BLK_EXTERN(attr_buf);
00197
00198
00199 H5_DLLVAR const H5B2_class_t H5A_BT2_NAME[1];
00200
00201
00202 H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1];
00203
00204
00205
00206
00207
00208
00209
00210 H5_DLL herr_t H5A_init(void);
00211 H5_DLL hid_t H5A_create(const H5G_loc_t *loc, const char *name,
00212 const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id);
00213 H5_DLL H5A_t * H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name,
00214 const char *attr_name, hid_t lapl_id, hid_t dxpl_id);
00215 H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name,
00216 H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id);
00217 H5_DLL ssize_t H5A_get_name(H5A_t *attr, size_t buf_size, char *buf);
00218 H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr);
00219 H5_DLL herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo);
00220 H5_DLL herr_t H5A_free(H5A_t *attr);
00221 H5_DLL herr_t H5A_close(H5A_t *attr);
00222 H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo);
00223 H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr);
00224
00225
00226 H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
00227 H5_DLL H5A_t *H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00228 const char *name);
00229 H5_DLL herr_t H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00230 H5A_t *attr);
00231 H5_DLL herr_t H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00232 H5A_t *attr);
00233 H5_DLL herr_t H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00234 const char *old_name, const char *new_name);
00235 H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id,
00236 const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
00237 hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op,
00238 void *op_data);
00239 H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00240 const char *name);
00241 H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00242 H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
00243 H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00244 const char *name);
00245 H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
00246
00247
00248
00249 H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00250 H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable);
00251 H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id,
00252 const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
00253 H5A_attr_table_t *atable);
00254 H5_DLL herr_t H5A_attr_iterate_table(const H5A_attr_table_t *atable,
00255 hsize_t skip, hsize_t *last_attr, hid_t loc_id,
00256 const H5A_attr_iter_op_t *attr_op, void *op_data);
00257 H5_DLL herr_t H5A_attr_release_table(H5A_attr_table_t *atable);
00258
00259
00260 H5_DLL herr_t H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr);
00261 H5_DLL H5A_t *H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name,
00262 hid_t dxpl_id);
00263 H5_DLL H5A_t *H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
00264 H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
00265 H5_DLL herr_t H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00266 H5A_t *attr, H5O_shared_t *sh_mesg);
00267 H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id,
00268 H5A_t *attr);
00269 H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id,
00270 const char *old_name, const char *new_name);
00271 H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type,
00272 H5_iter_order_t order, hsize_t skip, hsize_t *last_attr,
00273 const H5A_attr_iter_op_t *op, void *op_data);
00274 H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name,
00275 hid_t dxpl_id);
00276 H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
00277 H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
00278 H5_DLL htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id);
00279 #ifndef H5_NO_DEPRECATED_SYMBOLS
00280 H5_DLL int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id);
00281 #endif
00282 H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size,
00283 H5O_copy_t *cpy_info, hid_t dxpl_id);
00284 H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src,
00285 H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
00286 H5_DLL herr_t H5A_dense_copy_file_all(H5F_t *file_src, H5O_ainfo_t *ainfo_src, H5F_t *file_dst,
00287 const H5O_ainfo_t *ainfo_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, hid_t dxpl_id);
00288 H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src,
00289 H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
00290
00291
00292
00293 #ifdef H5A_TESTING
00294 H5_DLL htri_t H5A_is_shared_test(hid_t aid);
00295 H5_DLL herr_t H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count);
00296 #endif
00297
00298 #endif
00299