![]() |
|
|||
File indexing completed on 2025-09-18 09:39:14
0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0002 * Copyright by The HDF Group. * 0003 * All rights reserved. * 0004 * * 0005 * This file is part of HDF5. The full HDF5 copyright notice, including * 0006 * terms governing use, modification, and redistribution, is contained in * 0007 * the COPYING file, which can be found at the root of the source code * 0008 * distribution tree, or in https://www.hdfgroup.org/licenses. * 0009 * If you do not have access to either file, you may request a copy from * 0010 * help@hdfgroup.org. * 0011 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 0012 0013 /* 0014 * This file contains public declarations for the H5A module. 0015 */ 0016 #ifndef H5Apublic_H 0017 #define H5Apublic_H 0018 0019 #include "H5public.h" /* Generic Functions */ 0020 #include "H5Ipublic.h" /* Identifiers */ 0021 #include "H5Opublic.h" /* Object Headers */ 0022 #include "H5Tpublic.h" /* Datatypes */ 0023 0024 //! <!-- [H5A_info_t_snip] --> 0025 /** 0026 * Information struct for H5Aget_info() / H5Aget_info_by_idx() 0027 */ 0028 typedef struct { 0029 hbool_t corder_valid; /**< Indicate if creation order is valid */ 0030 H5O_msg_crt_idx_t corder; /**< Creation order */ 0031 H5T_cset_t cset; /**< Character set of attribute name */ 0032 hsize_t data_size; /**< Size of raw data */ 0033 } H5A_info_t; 0034 //! <!-- [H5A_info_t_snip] --> 0035 0036 //! <!-- [H5A_operator2_t_snip] --> 0037 /** 0038 * Typedef for H5Aiterate2() / H5Aiterate_by_name() callbacks 0039 * \param[in] location_id The identifier for the group, dataset 0040 * or named datatype being iterated over 0041 * \param[in] attr_name The name of the current object attribute 0042 * \param[in] ainfo The attribute's info struct 0043 * \param[in,out] op_data A pointer to the operator data passed into 0044 * H5Aiterate2() or H5Aiterate_by_name() 0045 * \return The return values from an operator are: 0046 * \li Zero causes the iterator to continue, returning zero when 0047 * all attributes have been processed. 0048 * \li Positive causes the iterator to immediately return that 0049 * positive value, indicating short-circuit success. The 0050 * iterator can be restarted at the next attribute. 0051 * \li Negative causes the iterator to immediately return that value, 0052 * indicating failure. The iterator can be restarted at the next 0053 * attribute. 0054 * 0055 * \callback_note 0056 * 0057 * \since 1.8.0 0058 * 0059 */ 0060 typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_name /*in*/, 0061 const H5A_info_t *ainfo /*in*/, void *op_data /*in,out*/); 0062 //! <!-- [H5A_operator2_t_snip] --> 0063 0064 /********************/ 0065 /* Public Variables */ 0066 /********************/ 0067 0068 /*********************/ 0069 /* Public Prototypes */ 0070 /*********************/ 0071 #ifdef __cplusplus 0072 extern "C" { 0073 #endif 0074 0075 /*-------------------------------------------------------------------------*/ 0076 /** 0077 * \ingroup H5A 0078 * 0079 * \brief Closes the specified attribute 0080 * 0081 * \attr_id 0082 * 0083 * \return \herr_t 0084 * 0085 * \details H5Aclose() terminates access to the attribute through 0086 * \p attr_id and releases the identifier. 0087 * 0088 * \par Example 0089 * \snippet H5A_examples.c create 0090 * 0091 * \since 1.0.0 0092 * 0093 * \see H5Acreate(), H5Aopen() 0094 */ 0095 H5_DLL herr_t H5Aclose(hid_t attr_id); 0096 /*--------------------------------------------------------------------------*/ 0097 /** 0098 * \ingroup ASYNC 0099 * \async_variant_of{H5Aclose} 0100 */ 0101 #ifndef H5_DOXYGEN 0102 H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id, 0103 hid_t es_id); 0104 #else 0105 H5_DLL herr_t H5Aclose_async(hid_t attr_id, hid_t es_id); 0106 #endif 0107 /* --------------------------------------------------------------------------*/ 0108 /** 0109 * \ingroup H5A 0110 * 0111 * \brief Creates an attribute attached to a specified object 0112 * 0113 * \fgdt_loc_id 0114 * \param[in] attr_name Name of attribute 0115 * \param[in] type_id Attribute datatype identifier 0116 * \space_id 0117 * \acpl_id 0118 * \aapl_id 0119 * 0120 * \return \hid_ti{attribute} 0121 * 0122 * \details H5Acreate2() creates an attribute, \p attr_name, which is attached 0123 * to the object specified by the identifier \p loc_id. 0124 * 0125 * The attribute name, \p attr_name, must be unique for the object. 0126 * 0127 * The attribute is created with the specified datatype and dataspace, 0128 * \p type_id and \p space_id. 0129 * 0130 * \plist_unused{aapl_id} 0131 * 0132 * The attribute identifier returned by this function must be released 0133 * with H5Aclose() or resource leaks will develop. 0134 * 0135 * \note If \p loc_id is a file identifier, the attribute will be attached to 0136 * that file's root group. 0137 * 0138 * \par Example 0139 * \snippet H5A_examples.c create 0140 * 0141 * \since 1.8.0 0142 * 0143 * \see H5Aclose() 0144 * 0145 */ 0146 H5_DLL hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, 0147 hid_t aapl_id); 0148 /*--------------------------------------------------------------------------*/ 0149 /** 0150 * \ingroup ASYNC 0151 * \async_variant_of{H5Acreate} 0152 */ 0153 #ifndef H5_DOXYGEN 0154 H5_DLL hid_t H5Acreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id, 0155 const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, 0156 hid_t aapl_id, hid_t es_id); 0157 #else 0158 H5_DLL hid_t H5Acreate_async(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, 0159 hid_t acpl_id, hid_t aapl_id, hid_t es_id); 0160 #endif 0161 0162 /*--------------------------------------------------------------------------*/ 0163 /** 0164 * \ingroup H5A 0165 * 0166 * \brief Creates an attribute attached to a specified object 0167 * 0168 * \fgdt_loc_id 0169 * \param[in] obj_name Name, relative to \p loc_id, of object that 0170 * attribute is to be attached to 0171 * \param[in] attr_name Attribute name 0172 * \param[in] type_id Attribute datatype identifier 0173 * \space_id 0174 * \acpl_id 0175 * \aapl_id 0176 * \lapl_id 0177 * 0178 * \return \hid_ti{attribute} 0179 * 0180 * \details H5Acreate_by_name() creates an attribute, \p attr_name, which is 0181 * attached to the object specified by \p loc_id and \p obj_name. 0182 * 0183 * \p loc_id is a location identifier; \p obj_name is the object 0184 * name relative to \p loc_id. 0185 * 0186 * The attribute name, \p attr_name, must be unique for the object. 0187 * 0188 * The attribute is created with the specified datatype and 0189 * dataspace, \p type_id and \p space_id. 0190 * 0191 * \plist_unused{aapl_id} 0192 * 0193 * The link access property list, \p lapl_id, may provide 0194 * information regarding the properties of links required to access 0195 * the object, \p obj_name. 0196 * 0197 * \since 1.8.0 0198 * 0199 */ 0200 H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, 0201 hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id); 0202 /*--------------------------------------------------------------------------*/ 0203 /** 0204 * \ingroup ASYNC 0205 * \async_variant_of{H5Acreate_by_name} 0206 */ 0207 #ifndef H5_DOXYGEN 0208 H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app_line, 0209 hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, 0210 hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id, 0211 hid_t es_id); 0212 #else 0213 H5_DLL hid_t H5Acreate_by_name_async(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, 0214 hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id, 0215 hid_t es_id); 0216 #endif 0217 0218 /*-------------------------------------------------------------------------*/ 0219 /** 0220 * \ingroup H5A 0221 * 0222 * \brief Deletes an attribute from a specified location 0223 * 0224 * \fgdt_loc_id 0225 * \param[in] attr_name Name of the attribute to delete 0226 * 0227 * \return \herr_t 0228 * 0229 * \details H5Adelete() removes the attribute specified by its name, 0230 * \p attr_name, from a file, dataset, group, or named datatype. 0231 * 0232 * \attention This function should not be used when other attribute identifiers 0233 * are open on \p loc_id. This may cause the internal indexes of 0234 * the attributes to change and future writes to the open 0235 * attributes to produce incorrect results. 0236 * 0237 * \par Example 0238 * \snippet H5A_examples.c delete 0239 * 0240 * \since 1.0.0 0241 * 0242 */ 0243 H5_DLL herr_t H5Adelete(hid_t loc_id, const char *attr_name); 0244 /*-------------------------------------------------------------------------*/ 0245 /** 0246 * \ingroup H5A 0247 * 0248 * \brief Deletes an attribute from an object according to index order 0249 * 0250 * \fgdt_loc_id 0251 * \param[in] obj_name Name of object, relative to location, from which 0252 * attribute is to be removed 0253 * \param[in] idx_type Type of index 0254 * \param[in] order Order in which to iterate over the index 0255 * \param[in] n Offset within the index 0256 * \lapl_id 0257 * 0258 * \return \herr_t 0259 * 0260 * \details H5Adelete_by_idx() removes an attribute specified by its 0261 * location in an index, from an object. 0262 * 0263 * The object from which the attribute is to be removed is 0264 * specified by a location identifier and name, \p loc_id and 0265 * \p obj_name, respectively. 0266 * 0267 * The attribute to be removed is specified by a position in an 0268 * index, \p n. The type of index is specified by \p idx_type. 0269 * The order in which the index is to be traversed is specified by 0270 * \p order. For example, if \p idx_type, \p order, 0271 * and \p n are set to #H5_INDEX_NAME, #H5_ITER_INC, and 5, 0272 * respectively, the fifth attribute in the lexicographic order of 0273 * attribute names will be removed. 0274 * 0275 * The link access property list, \p lapl_id, may provide 0276 * information regarding the properties of links required to access 0277 * the object, \p obj_name. 0278 0279 * \since 1.8.0 0280 * 0281 */ 0282 H5_DLL herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, 0283 hsize_t n, hid_t lapl_id); 0284 /*-------------------------------------------------------------------------*/ 0285 /** 0286 * \ingroup H5A 0287 * 0288 * \brief Removes an attribute from a specified location 0289 * 0290 * \fgdt_loc_id 0291 * \param[in] obj_name Name of object, relative to location, from which 0292 * attribute is to be removed 0293 * \param[in] attr_name Name of attribute to delete 0294 * \lapl_id 0295 * 0296 * \return \herr_t 0297 * 0298 * \details H5Adelete_by_name() removes the attribute \p attr_name 0299 * from an object specified by location and name, \p loc_id and 0300 * \p obj_name, respectively. 0301 * 0302 * The link access property list, \p lapl_id, may provide 0303 * information regarding the properties of links required to 0304 * access the object, \p obj_name. 0305 * 0306 * \since 1.8.0 0307 * 0308 */ 0309 H5_DLL herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 0310 /*-------------------------------------------------------------------------*/ 0311 /** 0312 * \ingroup H5A 0313 * 0314 * \brief Determines whether an attribute with a given name exists on an 0315 * object 0316 * 0317 * \fgdt_loc_id{obj_id} 0318 * \param[in] attr_name Attribute name 0319 * 0320 * \return \htri_t 0321 * 0322 * \details H5Aexists() determines whether the attribute \p attr_name 0323 * exists on the object specified by \p obj_id. 0324 * 0325 * \since 1.8.0 0326 * 0327 */ 0328 H5_DLL htri_t H5Aexists(hid_t obj_id, const char *attr_name); 0329 /*--------------------------------------------------------------------------*/ 0330 /** 0331 * \ingroup ASYNC 0332 * \async_variant_of{H5Aexists} 0333 */ 0334 #ifndef H5_DOXYGEN 0335 H5_DLL herr_t H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id, 0336 const char *attr_name, hbool_t *exists, hid_t es_id); 0337 #else 0338 H5_DLL herr_t H5Aexists_async(hid_t obj_id, const char *attr_name, hbool_t *exists, hid_t es_id); 0339 #endif 0340 0341 /*-------------------------------------------------------------------------*/ 0342 /** 0343 * \ingroup H5A 0344 * 0345 * \brief Determines whether an attribute with a given name exists on an 0346 * object 0347 * 0348 * \fgdt_loc_id{obj_id} 0349 * \param[in] obj_name Object name 0350 * \param[in] attr_name Attribute name 0351 * \lapl_id 0352 * 0353 * \return \htri_t 0354 * 0355 * \details H5Aexists_by_name() determines whether the attribute 0356 * \p attr_name exists on an object. That object is specified by 0357 * its location and name, \p loc_id and \p obj_name, respectively. 0358 * 0359 * \p loc_id specifies a location in the file containing the object. 0360 * \p obj_name is the name of the object to which the attribute is 0361 * attached and can be a relative name, relative to \p loc_id, 0362 * or an absolute name, based on the root group of the file. 0363 * 0364 * The link access property list, \p lapl_id, may provide 0365 * information regarding the properties of links required to access 0366 * \p obj_name. 0367 * 0368 * \since 1.8.0 0369 * 0370 */ 0371 H5_DLL htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id); 0372 /*--------------------------------------------------------------------------*/ 0373 /** 0374 * \ingroup ASYNC 0375 * \async_variant_of{H5Aexists_by_name} 0376 */ 0377 #ifndef H5_DOXYGEN 0378 H5_DLL herr_t H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app_line, 0379 hid_t loc_id, const char *obj_name, const char *attr_name, 0380 hbool_t *exists, hid_t lapl_id, hid_t es_id); 0381 #else 0382 H5_DLL herr_t H5Aexists_by_name_async(hid_t loc_id, const char *obj_name, const char *attr_name, 0383 hbool_t *exists, hid_t lapl_id, hid_t es_id); 0384 #endif 0385 0386 /*-------------------------------------------------------------------------*/ 0387 /** 0388 * \ingroup H5A 0389 * 0390 * \brief Gets an attribute creation property list identifier 0391 * 0392 * \attr_id 0393 * 0394 * \return \hid_ti{attribute's creation property list} 0395 * 0396 * \details H5Aget_create_plist() returns an identifier for the attribute 0397 * creation property list associated with the attribute specified 0398 * by \p attr_id. 0399 * 0400 * The creation property list identifier should be released with 0401 * H5Pclose() to prevent resource leaks. 0402 * 0403 * \since 1.8.0 0404 * 0405 */ 0406 H5_DLL hid_t H5Aget_create_plist(hid_t attr_id); 0407 /*-------------------------------------------------------------------------*/ 0408 /** 0409 * \ingroup H5A 0410 * 0411 * \brief Retrieves attribute information by attribute identifier 0412 * 0413 * \attr_id 0414 * \param[out] ainfo Attribute information struct 0415 * 0416 * \return \herr_t 0417 * 0418 * \details H5Aget_info() retrieves attribute information, locating the 0419 * attribute with an attribute identifier, \p attr_id. The 0420 * attribute information is returned in the \p ainfo struct. 0421 * 0422 * \since 1.8.0 0423 * 0424 */ 0425 H5_DLL herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/); 0426 /*-------------------------------------------------------------------------*/ 0427 /** 0428 * \ingroup H5A 0429 * 0430 * \brief Retrieves attribute information by attribute index position 0431 * 0432 * \fgdt_loc_id 0433 * \param[in] obj_name Name of object to which attribute is attached, 0434 * relative to location 0435 * \param[in] idx_type Type of index 0436 * \param[in] order Index traversal order 0437 * \param[in] n Attribute's position in index 0438 * \param[out] ainfo Struct containing returned attribute information 0439 * \lapl_id 0440 * 0441 * \return \herr_t 0442 * 0443 * \details H5Aget_info_by_idx() retrieves information for an attribute 0444 * that is attached to an object, which is specified by its 0445 * location and name, \p loc_id and \p obj_name, respectively. 0446 * The attribute is located by its index position, and the attribute 0447 * information is returned in the \p ainfo struct. 0448 * 0449 * The attribute is located by means of an index type, an index 0450 * traversal order, and a position in the index, \p idx_type, 0451 * \p order and \p n, respectively. 0452 * 0453 * The link access property list, \p lapl_id, may provide 0454 * information regarding the properties of links required to access 0455 * the object, \p obj_name. 0456 * 0457 * \since 1.8.0 0458 * 0459 */ 0460 H5_DLL herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 0461 H5_iter_order_t order, hsize_t n, H5A_info_t *ainfo /*out*/, hid_t lapl_id); 0462 /*-------------------------------------------------------------------------*/ 0463 /** 0464 * \ingroup H5A 0465 * 0466 * \brief Retrieves attribute information by attribute name 0467 * 0468 * \fgdt_loc_id 0469 * \param[in] obj_name Name of the object to which an attribute is attached, 0470 * relative to location 0471 * \param[in] attr_name Attribute name 0472 * \param[out] ainfo Struct containing returned attribute information 0473 * \lapl_id 0474 * 0475 * \return \herr_t 0476 * 0477 * \details H5Aget_info_by_name() retrieves information for an attribute, 0478 * \p attr_name, that is attached to an object specified by its 0479 * location and name, \p loc_id and \p obj_name, respectively. 0480 * The attribute information is returned in the \p ainfo struct. 0481 * 0482 * The link access property list, \p lapl_id, may provide 0483 * information regarding the properties of links required to 0484 * access the object, \p obj_name. 0485 * 0486 * \since 1.8.0 0487 * 0488 */ 0489 H5_DLL herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, 0490 H5A_info_t *ainfo /*out*/, hid_t lapl_id); 0491 /*-------------------------------------------------------------------------*/ 0492 /** 0493 * \ingroup H5A 0494 * 0495 * \brief Gets an attribute name 0496 * 0497 * \attr_id 0498 * \param[in] buf_size The size of the buffer to store the name in 0499 * \param[out] buf Buffer to store name in 0500 * 0501 * \return Returns the length of the attribute's name, which may be longer 0502 * than \p buf_size, if successful. Otherwise, returns a negative 0503 * value. 0504 * 0505 * \details H5Aget_name() retrieves the name of an attribute specified by 0506 * the identifier, \p attr_id. 0507 * 0508 * \details_namelen{attribute,H5Aget_name} 0509 * 0510 * \since 1.0.0 0511 * 0512 */ 0513 H5_DLL ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf); 0514 /*-------------------------------------------------------------------------*/ 0515 /** 0516 * \ingroup H5A 0517 * 0518 * \brief Gets an attribute name by attribute index position 0519 * 0520 * \fgdt_loc_id 0521 * \param[in] obj_name Name of object to which attribute is attached, 0522 * relative to location 0523 * \param[in] idx_type Type of index 0524 * \param[in] order Index traversal order 0525 * \param[in] n Attribute's position in index 0526 * \param[out] name Attribute name 0527 * \param[in] size Size, in bytes, of attribute name 0528 * \lapl_id 0529 * 0530 * \return Returns attribute name size, in bytes, if successful; 0531 * otherwise, returns a negative value. 0532 * 0533 * \details H5Aget_name_by_idx() retrieves the name of an attribute that is 0534 * attached to an object, which is specified by its location and 0535 * name, \p loc_id and \p obj_name, respectively. The attribute is 0536 * located by its index position, the size of the name is specified 0537 * in \p size, and the attribute name is returned in \p name. 0538 * 0539 * The attribute is located by means of an index type, an index 0540 * traversal order, and a position in the index, \p idx_type, 0541 * \p order and \p n, respectively. 0542 * 0543 * \details_namelen{attribute,H5Aget_name_by_idx} 0544 * 0545 * The link access property list, \p lapl_id, may provide 0546 * information regarding the properties of links required to access 0547 * the object, \p obj_name. 0548 * 0549 * \since 1.8.0 0550 * 0551 */ 0552 H5_DLL ssize_t H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 0553 H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size, 0554 hid_t lapl_id); 0555 /*-------------------------------------------------------------------------*/ 0556 /** 0557 * \ingroup H5A 0558 * 0559 * \brief Gets a copy of the dataspace for an attribute 0560 * 0561 * \attr_id 0562 * 0563 * \return \hid_ti{attribute dataspace} 0564 * 0565 * \details H5Aget_space() retrieves a copy of the dataspace for an 0566 * attribute. The dataspace identifier returned from this 0567 * function must be released with H5Sclose() or resource leaks 0568 * will develop. 0569 * 0570 * \since 1.0.0 0571 * 0572 */ 0573 H5_DLL hid_t H5Aget_space(hid_t attr_id); 0574 /*-------------------------------------------------------------------------*/ 0575 /** 0576 * \ingroup H5A 0577 * 0578 * \brief Returns the amount of storage used to store an attribute 0579 * 0580 * \attr_id 0581 * 0582 * \return Returns the amount of storage size allocated for the attribute; 0583 * otherwise, returns 0 (zero). 0584 * 0585 * \details H5Aget_storage_size() returns the amount of storage that is 0586 * required for the specified attribute, \p attr_id. 0587 * 0588 * \since 1.6.0 0589 * 0590 */ 0591 H5_DLL hsize_t H5Aget_storage_size(hid_t attr_id); 0592 /*-------------------------------------------------------------------------*/ 0593 /** 0594 * \ingroup H5A 0595 * 0596 * \brief Gets an attribute's datatype 0597 * 0598 * \attr_id 0599 * 0600 * \return \hid_t{datatype} 0601 * 0602 * \details H5Aget_type() retrieves a copy of the attribute's datatype. 0603 * The datatype is reopened if it is a named type before returning 0604 * it to the application. The datatypes returned by this function 0605 * are always read-only. 0606 * 0607 * The datatype identifier returned from this function must be 0608 * released with H5Tclose() or resource leaks will develop. 0609 * 0610 * \since 1.0.0 0611 * 0612 */ 0613 H5_DLL hid_t H5Aget_type(hid_t attr_id); 0614 /*-------------------------------------------------------------------------*/ 0615 /** 0616 * \ingroup H5A 0617 * 0618 * \brief Calls a user-defined function for each attribute on an object 0619 * 0620 * \fgdt_loc_id 0621 * \param[in] idx_type Type of index 0622 * \param[in] order Order in which to iterate over index 0623 * \param[in,out] idx Initial and returned offset within index 0624 * \param[in] op User-defined function to pass each attribute to 0625 * \param[in,out] op_data User data to pass through to and to be returned 0626 * by iterator operator function 0627 * 0628 * \return \herr_t 0629 * Further note that this function returns the return value of the 0630 * last operator if it was non-zero, which can be a negative value, 0631 * zero if all attributes were processed, or a positive value 0632 * indicating short-circuit success. 0633 * 0634 * \details H5Aiterate2() iterates over the attributes attached to a 0635 * dataset, named datatype, or group, as specified by \p loc_id. 0636 * For each attribute, user-provided data, \p op_data, with 0637 * additional information, as defined below, is passed to a 0638 * user-defined function, \p op, which operates on that 0639 * attribute. 0640 * 0641 * The order of the iteration and the attributes iterated over 0642 * are specified by three parameters: the index type, 0643 * \p idx_type; the order in which the index is to be traversed, 0644 * \p order; and the attribute's position in the index, \p idx. 0645 * The next attribute to be operated on is specified by \p idx, 0646 * a position in the index. 0647 * 0648 * For example, if \p idx_type, \p order, and \p idx are set to 0649 * #H5_INDEX_NAME, #H5_ITER_INC, and 5, respectively, the attribute 0650 * in question is the fifth attribute from the beginning of the 0651 * alphanumeric index of attribute names. If \p order were set to 0652 * #H5_ITER_DEC, it would be the fifth attribute from the end of 0653 * the index. 0654 * 0655 * The parameter \p idx is passed in on an H5Aiterate2() call with 0656 * one value and may be returned with another value. The value 0657 * passed in identifies the parameter to be operated on first; 0658 * the value returned identifies the parameter to be operated on 0659 * in the next step of the iteration. 0660 * 0661 * \note This function is also available through the H5Aiterate() macro. 0662 * 0663 * \warning Adding or removing attributes to the object during iteration 0664 * will lead to undefined behavior. 0665 * 0666 * \callback_note 0667 * 0668 * \since 1.8.0 0669 * 0670 */ 0671 H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, 0672 H5A_operator2_t op, void *op_data); 0673 /*--------------------------------------------------------------------------*/ 0674 /** 0675 * \ingroup H5A 0676 * 0677 * \brief Calls user-defined function for each attribute on an object 0678 * 0679 * \fgdt_loc_id 0680 * \param[in] obj_name Name of object, relative to location 0681 * \param[in] idx_type Type of index 0682 * \param[in] order Order in which to iterate over index 0683 * \param[in,out] idx Initial and returned offset within index 0684 * \param[in] op User-defined function to pass each attribute to 0685 * \param[in,out] op_data User data to pass through to and to be returned 0686 * by iterator operator function 0687 * \lapl_id 0688 * 0689 * \return \herr_t 0690 * Further note that this function returns the return value of 0691 * the last operator if it is non-zero, which can be a negative 0692 * value, zero if all attributes were processed, or a positive value 0693 * indicating short-circuit success. 0694 * 0695 * \details H5Aiterate_by_name() iterates over the attributes attached 0696 * to the dataset or group specified with \p loc_id and \p obj_name. 0697 * For each attribute, user-provided data, \p op_data, with 0698 * additional information, as defined below, is passed to a 0699 * user-defined function, \p op, which operates on that attribute. 0700 * 0701 * The order of the iteration and the attributes iterated over 0702 * are specified by three parameters: the index type, \p idx_type; 0703 * the order in which the index is to be traversed, \p order; 0704 * and the attribute's position in the index, \p idx. 0705 * The next attribute to be operated on is specified by \p idx, 0706 * a position in the index. 0707 * 0708 * For example, if \p idx_type, \p order, and \p idx are set to 0709 * #H5_INDEX_NAME, #H5_ITER_INC, and 5, respectively, the attribute 0710 * in question is the fifth attribute from the beginning of the 0711 * alphanumeric index of attribute names. If \p order were set to 0712 * #H5_ITER_DEC, it would be the fifth attribute from the end of 0713 * the index. 0714 * 0715 * The parameter \p idx is passed in on an H5Aiterate_by_name() 0716 * call with one value and may be returned with another value. The 0717 * value passed in identifies the parameter to be operated on first; 0718 * the value returned identifies the parameter to be operated on in 0719 * the next step of the iteration. 0720 * 0721 * The link access property list, \p lapl_id, may provide 0722 * information regarding the properties of links required to access 0723 * the object, \p obj_name. 0724 * 0725 * \warning Adding or removing attributes to the object during iteration 0726 * will lead to undefined behavior. 0727 * 0728 * \since 1.8.0 0729 * 0730 */ 0731 H5_DLL herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 0732 H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, 0733 hid_t lapl_id); 0734 /*--------------------------------------------------------------------------*/ 0735 /** 0736 * \ingroup H5A 0737 * 0738 * \brief Opens an attribute for an object specified by object identifier and 0739 * attribute name 0740 * 0741 * \fgdt_loc_id{obj_id} 0742 * \param[in] attr_name Name of attribute to open 0743 * \aapl_id 0744 * 0745 * \return \hid_ti{attribute} 0746 * 0747 * \details H5Aopen() opens an existing attribute, \p attr_name, that is 0748 * attached to the object specified by an object identifier, \p obj_id. 0749 * 0750 * \plist_unused{aapl_id} 0751 * 0752 * This function, H5Aopen_by_idx() or H5Aopen_by_name() must be called 0753 * before the attribute can be accessed for any further purpose, 0754 * including reading, writing, or any modification. 0755 * 0756 * The attribute identifier returned by this function must be released 0757 * with H5Aclose() or resource leaks will develop. 0758 * 0759 * \par Example 0760 * \snippet H5A_examples.c read 0761 * 0762 * \since 1.8.0 0763 * 0764 * \see H5Aclose(), H5Acreate() 0765 */ 0766 H5_DLL hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id); 0767 /*--------------------------------------------------------------------------*/ 0768 /** 0769 * \ingroup ASYNC 0770 * \async_variant_of{H5Aopen} 0771 */ 0772 #ifndef H5_DOXYGEN 0773 H5_DLL hid_t H5Aopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id, 0774 const char *attr_name, hid_t aapl_id, hid_t es_id); 0775 #else 0776 H5_DLL hid_t H5Aopen_async(hid_t obj_id, const char *attr_name, hid_t aapl_id, hid_t es_id); 0777 #endif 0778 /*--------------------------------------------------------------------------*/ 0779 /** 0780 * \ingroup H5A 0781 * 0782 * \brief Opens the nth attribute attached to an object 0783 * 0784 * \loc_id 0785 * \param[in] obj_name Name of object to which attribute is attached, 0786 * relative to location 0787 * \param[in] idx_type Type of index 0788 * \param[in] order Index traversal order 0789 * \param[in] n Attribute's position in index 0790 * \aapl_id 0791 * \lapl_id 0792 * 0793 * \return \hid_ti{attribute} 0794 * 0795 * \details H5Aopen_by_idx() opens an existing attribute that is attached 0796 * to an object specified by location and name, \p loc_id and 0797 * \p obj_name, respectively. 0798 * 0799 * The attribute is identified by an index type, an index traversal 0800 * order, and a position in the index, \p idx_type, \p order and 0801 * \p n, respectively. 0802 * 0803 * \plist_unused{aapl_id} 0804 * 0805 * The link access property list, \p lapl_id, may provide 0806 * information regarding the properties of links required to access 0807 * the object, \p obj_name. 0808 * 0809 * This function, H5Aopen(), or H5Aopen_by_name() must be called 0810 * before an attribute can be accessed for any further purpose, 0811 * including reading, writing, or any modification. 0812 * 0813 * The attribute identifier returned by this function must be 0814 * released with H5Aclose() or resource leaks will develop. 0815 * 0816 * \since 1.8.0 0817 * 0818 */ 0819 H5_DLL hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, 0820 hsize_t n, hid_t aapl_id, hid_t lapl_id); 0821 /*--------------------------------------------------------------------------*/ 0822 /** 0823 * \ingroup ASYNC 0824 * \async_variant_of{H5Aopen_by_idx} 0825 */ 0826 #ifndef H5_DOXYGEN 0827 H5_DLL hid_t H5Aopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id, 0828 const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, 0829 hid_t aapl_id, hid_t lapl_id, hid_t es_id); 0830 #else 0831 H5_DLL hid_t H5Aopen_by_idx_async(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 0832 H5_iter_order_t order, hsize_t n, hid_t aapl_id, hid_t lapl_id, 0833 hid_t es_id); 0834 #endif 0835 /*--------------------------------------------------------------------------*/ 0836 /** 0837 * \ingroup H5A 0838 * 0839 * \brief Opens an attribute for an object by object name and attribute name 0840 * 0841 * \fgdt_loc_id 0842 * \param[in] obj_name Name of object to which attribute is attached, 0843 * relative to \p loc_id 0844 * \param[in] attr_name Name of attribute to open 0845 * \aapl_id 0846 * \lapl_id 0847 * 0848 * \return \hid_ti{attribute} 0849 * 0850 * \details H5Aopen_by_name() opens an existing attribute, \p attr_name, 0851 * that is attached to an object specified by location and name, 0852 * \p loc_id and \p obj_name, respectively. 0853 * 0854 * \p loc_id specifies a location from which the target object can 0855 * be located and \p obj_name is an object name relative to 0856 * \p loc_id. 0857 * 0858 * \plist_unused{aapl_id} 0859 * 0860 * The link access property list, \p lapl_id, may provide 0861 * information regarding the properties of links required to access 0862 * the object, \p obj_name. 0863 * 0864 * This function, H5Aopen(), or H5Aopen_by_idx() must be called 0865 * before an attribute can be accessed for any further purpose, 0866 * including reading, writing, or any modification. 0867 * 0868 * The attribute identifier returned by this function must be 0869 * released with H5Aclose() or resource leaks will develop. 0870 * 0871 * \since 1.8.0 0872 * 0873 */ 0874 H5_DLL hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, 0875 hid_t lapl_id); 0876 /*--------------------------------------------------------------------------*/ 0877 /** 0878 * \ingroup ASYNC 0879 * \async_variant_of{H5Aopen_by_name} 0880 */ 0881 #ifndef H5_DOXYGEN 0882 H5_DLL hid_t H5Aopen_by_name_async(const char *app_file, const char *app_func, unsigned app_line, 0883 hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, 0884 hid_t lapl_id, hid_t es_id); 0885 #else 0886 H5_DLL hid_t H5Aopen_by_name_async(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, 0887 hid_t lapl_id, hid_t es_id); 0888 #endif 0889 0890 /*-------------------------------------------------------------------------- */ 0891 /** 0892 * \ingroup H5A 0893 * 0894 * \brief Reads the value of an attribute 0895 * 0896 * \attr_id 0897 * \mem_type_id{type_id} 0898 * \param[out] buf Buffer for data to be read 0899 * 0900 * \return \herr_t 0901 * 0902 * \details H5Aread() reads an attribute, specified with \p attr_id. The 0903 * attribute's in-memory datatype is specified with \p type_id. The 0904 * entire attribute is read into \p buf from the file. 0905 * 0906 * Datatype conversion takes place at the time of a read or write and 0907 * is automatic. 0908 * 0909 * \par Example 0910 * \snippet H5A_examples.c read 0911 * 0912 * \version 1.8.8 Fortran updated to Fortran2003. 0913 * \version 1.4.2 The \p dims parameter was added to the Fortran API in this 0914 * release. 0915 * \since 1.0.0 0916 * 0917 * \see H5Awrite() 0918 * 0919 */ 0920 H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); 0921 /*--------------------------------------------------------------------------*/ 0922 /** 0923 * \ingroup ASYNC 0924 * \async_variant_of{H5Aread} 0925 */ 0926 #ifndef H5_DOXYGEN 0927 H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id, 0928 hid_t dtype_id, void *buf, hid_t es_id); 0929 #else 0930 H5_DLL herr_t H5Aread_async(hid_t attr_id, hid_t dtype_id, void *buf, hid_t es_id); 0931 #endif 0932 /*-------------------------------------------------------------------------*/ 0933 /** 0934 * \ingroup H5A 0935 * 0936 * \brief Renames an attribute 0937 * 0938 * \fgdt_loc_id 0939 * \param[in] old_name Name of the attribute to be changed 0940 * \param[in] new_name New name for the attribute 0941 * 0942 * \return \herr_t 0943 * 0944 * \details H5Arename() changes the name of the attribute located at 0945 * \p loc_id. 0946 * 0947 * The old name, \p old_name, is changed to the new name, 0948 * \p new_name. 0949 * 0950 * \since 1.6.0 0951 * 0952 */ 0953 H5_DLL herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name); 0954 /*--------------------------------------------------------------------------*/ 0955 /** 0956 * \ingroup ASYNC 0957 * \async_variant_of{H5Arename} 0958 */ 0959 #ifndef H5_DOXYGEN 0960 H5_DLL herr_t H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id, 0961 const char *old_name, const char *new_name, hid_t es_id); 0962 #else 0963 H5_DLL herr_t H5Arename_async(hid_t loc_id, const char *old_name, const char *new_name, hid_t es_id); 0964 #endif 0965 /*--------------------------------------------------------------------------*/ 0966 /** 0967 * \ingroup ASYNC 0968 * \async_variant_of{H5Arename_by_name} 0969 */ 0970 #ifndef H5_DOXYGEN 0971 H5_DLL herr_t H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app_line, 0972 hid_t loc_id, const char *obj_name, const char *old_attr_name, 0973 const char *new_attr_name, hid_t lapl_id, hid_t es_id); 0974 #else 0975 H5_DLL herr_t H5Arename_by_name_async(hid_t loc_id, const char *obj_name, const char *old_attr_name, 0976 const char *new_attr_name, hid_t lapl_id, hid_t es_id); 0977 #endif 0978 /*--------------------------------------------------------------------------*/ 0979 /** 0980 * \ingroup H5A 0981 * 0982 * \brief Writes data to an attribute 0983 * 0984 * \attr_id 0985 * \mem_type_id{type_id} 0986 * \param[out] buf Data to be written 0987 * 0988 * \return \herr_t 0989 * 0990 * \details H5Awrite() writes an attribute, specified with \p attr_id. The 0991 * attribute's in-memory datatype is specified with \p type_id. 0992 * The entire attribute is written from \p buf to the file. 0993 * 0994 * Datatype conversion takes place at the time of a read or write and 0995 * is automatic. 0996 * 0997 * \par Example 0998 * \snippet H5A_examples.c update 0999 * 1000 * \version 1.8.8 Fortran updated to Fortran2003. 1001 * \version 1.4.2 Fortran \p dims parameter added in this release 1002 * \since 1.0.0 1003 * \see H5Aread() 1004 * 1005 */ 1006 H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); 1007 /*--------------------------------------------------------------------------*/ 1008 /** 1009 * \ingroup ASYNC 1010 * \async_variant_of{H5Awrite} 1011 */ 1012 #ifndef H5_DOXYGEN 1013 H5_DLL herr_t H5Awrite_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id, 1014 hid_t type_id, const void *buf, hid_t es_id); 1015 #else 1016 H5_DLL herr_t H5Awrite_async(hid_t attr_id, hid_t type_id, const void *buf, hid_t es_id); 1017 #endif 1018 /*-------------------------------------------------------------------------*/ 1019 /** 1020 * \ingroup H5A 1021 * 1022 * \fgdt_loc_id 1023 * \param[in] obj_name Name of object, relative to location, whose 1024 * attribute is to be renamed 1025 * \param[in] old_attr_name Prior attribute name 1026 * \param[in] new_attr_name New attribute name 1027 * \lapl_id 1028 * 1029 * \details H5Arename_by_name() changes the name of attribute that is 1030 * attached to the object specified by \p loc_id and \p obj_name. 1031 * The attribute named \p old_attr_name is renamed 1032 * \p new_attr_name. 1033 * 1034 * The link access property list, \p lapl_id, may provide 1035 * information regarding the properties of links required to 1036 * access the object, \p obj_name. 1037 * 1038 * \since 1.8.0 1039 * 1040 */ 1041 H5_DLL herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, 1042 const char *new_attr_name, hid_t lapl_id); 1043 1044 /// \cond DEV 1045 /* API Wrappers for async routines */ 1046 /* (Must be defined _after_ the function prototype) */ 1047 /* (And must only defined when included in application code, not the library) */ 1048 #ifndef H5A_MODULE 1049 #define H5Acreate_async(...) H5Acreate_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1050 #define H5Acreate_by_name_async(...) H5Acreate_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1051 #define H5Aopen_async(...) H5Aopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1052 #define H5Aopen_by_name_async(...) H5Aopen_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1053 #define H5Aopen_by_idx_async(...) H5Aopen_by_idx_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1054 #define H5Awrite_async(...) H5Awrite_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1055 #define H5Aread_async(...) H5Aread_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1056 #define H5Arename_async(...) H5Arename_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1057 #define H5Arename_by_name_async(...) H5Arename_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1058 #define H5Aexists_async(...) H5Aexists_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1059 #define H5Aexists_by_name_async(...) H5Aexists_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1060 #define H5Aclose_async(...) H5Aclose_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1061 1062 /* Define "wrapper" versions of function calls, to allow compile-time values to 1063 * be passed in by language wrapper or library layer on top of HDF5. 1064 */ 1065 #define H5Acreate_async_wrap H5_NO_EXPAND(H5Acreate_async) 1066 #define H5Acreate_by_name_async_wrap H5_NO_EXPAND(H5Acreate_by_name_async) 1067 #define H5Aopen_async_wrap H5_NO_EXPAND(H5Aopen_async) 1068 #define H5Aopen_by_name_async_wrap H5_NO_EXPAND(H5Aopen_by_name_async) 1069 #define H5Aopen_by_idx_async_wrap H5_NO_EXPAND(H5Aopen_by_idx_async) 1070 #define H5Awrite_async_wrap H5_NO_EXPAND(H5Awrite_async) 1071 #define H5Aread_async_wrap H5_NO_EXPAND(H5Aread_async) 1072 #define H5Arename_async_wrap H5_NO_EXPAND(H5Arename_async) 1073 #define H5Arename_by_name_async_wrap H5_NO_EXPAND(H5Arename_by_name_async) 1074 #define H5Aexists_async_wrap H5_NO_EXPAND(H5Aexists_async) 1075 #define H5Aexists_by_name_async_wrap H5_NO_EXPAND(H5Aexists_by_name_async) 1076 #define H5Aclose_async_wrap H5_NO_EXPAND(H5Aclose_async) 1077 #endif /* H5A_MODULE */ 1078 /// \endcond 1079 1080 /* Symbols defined for compatibility with previous versions of the HDF5 API. 1081 * 1082 * Use of these symbols is deprecated. 1083 */ 1084 #ifndef H5_NO_DEPRECATED_SYMBOLS 1085 1086 /* Macros */ 1087 1088 /* Typedefs */ 1089 1090 //! <!-- [H5A_operator1_t_snip] --> 1091 /** 1092 * \brief Typedef for H5Aiterate1() callbacks 1093 * 1094 * \param[in] location_id The identifier for the group, dataset 1095 * or named datatype being iterated over 1096 * \param[in] attr_name The name of the current object attribute 1097 * \param[in,out] operator_data A pointer to the operator data passed into 1098 * H5Aiterate1() 1099 * \return The return values from an operator are: 1100 * \li Zero causes the iterator to continue, returning zero when 1101 * all attributes have been processed. 1102 * \li Positive causes the iterator to immediately return that 1103 * positive value, indicating short-circuit success. The 1104 * iterator can be restarted at the next attribute. 1105 * \li Negative causes the iterator to immediately return that value, 1106 * indicating failure. The iterator can be restarted at the next 1107 * attribute. 1108 */ 1109 typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_name /*in*/, 1110 void *operator_data /*in,out*/); 1111 //! <!-- [H5A_operator1_t_snip] --> 1112 1113 /* Function prototypes */ 1114 /* --------------------------------------------------------------------------*/ 1115 /** 1116 * \ingroup H5A 1117 * 1118 * \brief Creates an attribute attached to a specified object 1119 * 1120 * \fgdt_loc_id 1121 * \param[in] name Name of attribute to locate and open 1122 * \param[in] type_id Identifier of attribute datatype 1123 * \space_id 1124 * \acpl_id 1125 * 1126 * \return \hid_ti{attribute} 1127 * 1128 * \deprecation_note{H5Acreate2()} 1129 * 1130 * \plist_unused{acpl} 1131 * 1132 * \details H5Acreate1() creates an attribute, \p name, which is attached 1133 * to the object specified by the identifier \p loc_id. 1134 * 1135 * The attribute name, \p name, must be unique for the object. 1136 * 1137 * The attribute is created with the specified datatype and dataspace, 1138 * \p type_id and \p space_id. 1139 * 1140 * \since 1.8.0 1141 * 1142 * \version 1.8.0 The function H5Acreate() was renamed to H5Acreate1() and 1143 * deprecated in this release. 1144 * 1145 * \see H5Aclose() 1146 * 1147 */ 1148 H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id); 1149 /* --------------------------------------------------------------------------*/ 1150 /** 1151 * \ingroup H5A 1152 * 1153 * \brief Determines the number of attributes attached to an object 1154 * 1155 * \fgdt_loc_id 1156 * 1157 * \return Returns the number of attributes if successful; otherwise, returns 1158 * a negative value. 1159 * 1160 * \deprecation_note{H5Oget_info(), H5Oget_info_by_name(), and H5Oget_info_by_idx()} 1161 * 1162 * \details H5Aget_num_attrs() returns the number of attributes attached to 1163 * the object specified by its identifier, \p loc_id. 1164 * 1165 * \since 1.0.0 1166 * 1167 */ 1168 H5_DLL int H5Aget_num_attrs(hid_t loc_id); 1169 /* --------------------------------------------------------------------------*/ 1170 /** 1171 * \ingroup H5A 1172 * 1173 * \brief Calls a user's function for each attribute on an object 1174 * 1175 * \loc_id 1176 * \param[in,out] idx Starting (in) and ending (out) attribute index 1177 * \param[in] op User's function to pass each attribute to 1178 * \param[in,out] op_data User's data to pass through to the iterator operator 1179 * function 1180 * 1181 * \return \herr_t 1182 * 1183 * \deprecation_note{H5Aiterate2()} 1184 * 1185 * \details H5Aiterate1() iterates over the attributes of the object 1186 * specified by its identifier, \p loc_id. The object can be a 1187 * group, dataset, or named datatype. For each attribute of the 1188 * object, the \p op_data and some additional information specified 1189 * below are passed to the operator function \p op. The iteration 1190 * begins with the attribute specified by its index, \p idx; the 1191 * index for the next attribute to be processed by the operator, 1192 * \p op, is returned in \p idx. If \p idx is the null pointer, 1193 * then all attributes are processed. 1194 * 1195 * \warning Adding or removing attributes to the object during iteration 1196 * will lead to undefined behavior. 1197 * 1198 * \callback_note 1199 * 1200 * \version 1.8.0 The function \p H5Aiterate was renamed to H5Aiterate1() 1201 * and deprecated in this release. 1202 * \since 1.0.0 1203 * 1204 */ 1205 H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *idx, H5A_operator1_t op, void *op_data); 1206 /* --------------------------------------------------------------------------*/ 1207 /** 1208 * \ingroup H5A 1209 * 1210 * \brief Opens the attribute specified by its index 1211 * 1212 * \loc_id 1213 * \param[in] idx Index of the attribute to open 1214 * 1215 * \return \hid_ti{attribute} 1216 * 1217 * \deprecation_note{H5Aopen_by_idx()} 1218 * 1219 * \details H5Aopen_idx() opens an attribute that is attached to the 1220 * object specified with \p loc_id. The location object may be 1221 * either a group, dataset, or named datatype, all of which may 1222 * have any sort of attribute. The attribute specified by the index, 1223 * \p idx, indicates the attribute to access. The value of \p idx 1224 * is a 0-based, non-negative integer. The attribute identifier 1225 * returned from this function must be released with H5Aclose() 1226 * or resource leaks will develop. 1227 * 1228 * \since 1.0.0 1229 * 1230 */ 1231 H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx); 1232 /* --------------------------------------------------------------------------*/ 1233 /** 1234 * \ingroup H5A 1235 * 1236 * \brief Opens an attribute specified by name 1237 * 1238 * \loc_id 1239 * \param[in] name Attribute name 1240 * 1241 * \return \hid_ti{attribute} 1242 * 1243 * \deprecation_note{H5Aopen_by_name()} 1244 * 1245 * \details H5Aopen_name() opens an attribute specified by its name, 1246 * \p name, which is attached to the object specified with 1247 * \p loc_id. The location object may be either a group, dataset, 1248 * or named datatype, which may have any sort of attribute. The 1249 * attribute identifier returned from this function must be 1250 * released with H5Aclose() or resource leaks will develop. 1251 * 1252 * \since 1.0.0 1253 * 1254 */ 1255 H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name); 1256 1257 #endif /* H5_NO_DEPRECATED_SYMBOLS */ 1258 1259 #ifdef __cplusplus 1260 } 1261 #endif 1262 1263 #endif /* H5Apublic_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |