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 unsigned version;
00078 hbool_t initialized;
00079
00080 char *name;
00081 H5T_cset_t encoding;
00082
00083 H5T_t *dt;
00084 size_t dt_size;
00085
00086 H5S_t *ds;
00087 size_t ds_size;
00088
00089 void *data;
00090 size_t data_size;
00091 H5O_msg_crt_idx_t crt_idx;
00092 unsigned nrefs;
00093 } H5A_shared_t;
00094
00095
00096 struct H5A_t {
00097 H5O_shared_t sh_loc;
00098 H5O_loc_t oloc;
00099 hbool_t obj_opened;
00100 H5G_name_t path;
00101 H5A_shared_t *shared;
00102 };
00103
00104
00105
00106
00107
00108
00109 typedef struct H5A_dense_bt2_name_rec_t {
00110 H5O_fheap_id_t id;
00111 uint8_t flags;
00112 H5O_msg_crt_idx_t corder;
00113 uint32_t hash;
00114 } H5A_dense_bt2_name_rec_t;
00115
00116
00117
00118 typedef struct H5A_dense_bt2_corder_rec_t {
00119 H5O_fheap_id_t id;
00120 uint8_t flags;
00121 H5O_msg_crt_idx_t corder;
00122 } H5A_dense_bt2_corder_rec_t;
00123
00124
00125 typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, void *op_data);
00126
00127
00128
00129
00130
00131
00132 typedef struct H5A_bt2_ud_common_t {
00133
00134 H5F_t *f;
00135 hid_t dxpl_id;
00136 H5HF_t *fheap;
00137 H5HF_t *shared_fheap;
00138 const char *name;
00139 uint32_t name_hash;
00140 uint8_t flags;
00141 H5O_msg_crt_idx_t corder;
00142 H5A_bt2_found_t found_op;
00143 void *found_op_data;
00144 } H5A_bt2_ud_common_t;
00145
00146
00147
00148
00149
00150 typedef struct H5A_bt2_ud_ins_t {
00151
00152 H5A_bt2_ud_common_t common;
00153 H5O_fheap_id_t id;
00154 } H5A_bt2_ud_ins_t;
00155
00156
00157 typedef struct {
00158 size_t nattrs;
00159 H5A_t **attrs;
00160 } H5A_attr_table_t;
00161
00162
00163 typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data);
00164
00165
00166 struct H5A_attr_iter_op_t {
00167 enum {
00168 #ifndef H5_NO_DEPRECATED_SYMBOLS
00169 H5A_ATTR_OP_APP,
00170 #endif
00171 H5A_ATTR_OP_APP2,
00172 H5A_ATTR_OP_LIB
00173 } op_type;
00174 union {
00175 #ifndef H5_NO_DEPRECATED_SYMBOLS
00176 H5A_operator1_t app_op;
00177 #endif
00178 H5A_operator2_t app_op2;
00179 H5A_lib_iterate_t lib_op;
00180 } u;
00181 };
00182
00183
00184
00185
00186
00187
00188
00189 H5FL_EXTERN(H5A_t);
00190
00191
00192 H5FL_EXTERN(H5A_shared_t);
00193
00194
00195 H5FL_BLK_EXTERN(attr_buf);
00196
00197
00198 H5_DLLVAR const H5B2_class_t H5A_BT2_NAME[1];
00199
00200
00201 H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1];
00202
00203
00204
00205
00206
00207
00208
00209 H5_DLL herr_t H5A_init(void);
00210 H5_DLL hid_t H5A_create(const H5G_loc_t *loc, const char *name,
00211 const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id);
00212 H5_DLL H5A_t * H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name,
00213 const char *attr_name, hid_t lapl_id, hid_t dxpl_id);
00214 H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name,
00215 H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id);
00216 H5_DLL ssize_t H5A_get_name(H5A_t *attr, size_t buf_size, char *buf);
00217 H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr);
00218 H5_DLL herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo);
00219 H5_DLL herr_t H5A_free(H5A_t *attr);
00220 H5_DLL herr_t H5A_close(H5A_t *attr);
00221 H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo);
00222 H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr);
00223
00224
00225 H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
00226 H5_DLL H5A_t *H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00227 const char *name);
00228 H5_DLL herr_t H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00229 H5A_t *attr);
00230 H5_DLL herr_t H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00231 H5A_t *attr);
00232 H5_DLL herr_t H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00233 const char *old_name, const char *new_name);
00234 H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id,
00235 const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
00236 hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op,
00237 void *op_data);
00238 H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00239 const char *name);
00240 H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00241 H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
00242 H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
00243 const char *name);
00244 H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
00245
00246
00247
00248 H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00249 H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable);
00250 H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id,
00251 const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
00252 H5A_attr_table_t *atable);
00253 H5_DLL herr_t H5A_attr_iterate_table(const H5A_attr_table_t *atable,
00254 hsize_t skip, hsize_t *last_attr, hid_t loc_id,
00255 const H5A_attr_iter_op_t *attr_op, void *op_data);
00256 H5_DLL herr_t H5A_attr_release_table(H5A_attr_table_t *atable);
00257
00258
00259 H5_DLL herr_t H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr);
00260 H5_DLL H5A_t *H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name,
00261 hid_t dxpl_id);
00262 H5_DLL H5A_t *H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
00263 H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
00264 H5_DLL herr_t H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00265 H5A_t *attr, H5O_shared_t *sh_mesg);
00266 H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id,
00267 H5A_t *attr);
00268 H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id,
00269 const char *old_name, const char *new_name);
00270 H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type,
00271 H5_iter_order_t order, hsize_t skip, hsize_t *last_attr,
00272 const H5A_attr_iter_op_t *op, void *op_data);
00273 H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name,
00274 hid_t dxpl_id);
00275 H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
00276 H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
00277 H5_DLL htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id);
00278 #ifndef H5_NO_DEPRECATED_SYMBOLS
00279 H5_DLL int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id);
00280 #endif
00281 H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size,
00282 H5O_copy_t *cpy_info, hid_t dxpl_id);
00283 H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src,
00284 H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
00285 H5_DLL herr_t H5A_dense_copy_file_all(H5F_t *file_src, H5O_ainfo_t *ainfo_src, H5F_t *file_dst,
00286 const H5O_ainfo_t *ainfo_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, hid_t dxpl_id);
00287 H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src,
00288 H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
00289
00290
00291
00292 #ifdef H5A_TESTING
00293 H5_DLL htri_t H5A_is_shared_test(hid_t aid);
00294 H5_DLL herr_t H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count);
00295 #endif
00296
00297 #endif
00298