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