H5Apublic.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. * Copyright by The HDF Group. *
  3. * Copyright by the Board of Trustees of the University of Illinois. *
  4. * All rights reserved. *
  5. * *
  6. * This file is part of HDF5. The full HDF5 copyright notice, including *
  7. * terms governing use, modification, and redistribution, is contained in *
  8. * the COPYING file, which can be found at the root of the source code *
  9. * distribution tree, or in https://www.hdfgroup.org/licenses. *
  10. * If you do not have access to either file, you may request a copy from *
  11. * help@hdfgroup.org. *
  12. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  13. /*
  14. * This file contains public declarations for the H5A module.
  15. */
  16. #ifndef H5Apublic_H
  17. #define H5Apublic_H
  18. /* Public headers needed by this file */
  19. #include "H5Ipublic.h" /* IDs */
  20. #include "H5Opublic.h" /* Object Headers */
  21. #include "H5Tpublic.h" /* Datatypes */
  22. //! <!-- [H5A_info_t_snip] -->
  23. /**
  24. * Information struct for H5Aget_info() / H5Aget_info_by_idx()
  25. */
  26. typedef struct {
  27. hbool_t corder_valid; /**< Indicate if creation order is valid */
  28. H5O_msg_crt_idx_t corder; /**< Creation order */
  29. H5T_cset_t cset; /**< Character set of attribute name */
  30. hsize_t data_size; /**< Size of raw data */
  31. } H5A_info_t;
  32. //! <!-- [H5A_info_t_snip] -->
  33. //! <!-- [H5A_operator2_t_snip] -->
  34. /**
  35. * Typedef for H5Aiterate2() / H5Aiterate_by_name() callbacks
  36. * \param[in] location_id The identifier for the group, dataset
  37. * or named datatype being iterated over
  38. * \param[in] attr_name The name of the current object attribute
  39. * \param[in] ainfo The attribute’s info struct
  40. * \param[in,out] op_data A pointer to the operator data passed in to
  41. * H5Aiterate2() or H5Aiterate_by_name()
  42. * \returns The return values from an operator are:
  43. * \li Zero causes the iterator to continue, returning zero when
  44. * all attributes have been processed.
  45. * \li Positive causes the iterator to immediately return that
  46. * positive value, indicating short-circuit success. The
  47. * iterator can be restarted at the next attribute.
  48. * \li Negative causes the iterator to immediately return that value,
  49. * indicating failure. The iterator can be restarted at the next
  50. * attribute.
  51. */
  52. typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
  53. const H5A_info_t *ainfo /*in*/, void *op_data /*in,out*/);
  54. //! <!-- [H5A_operator2_t_snip] -->
  55. /********************/
  56. /* Public Variables */
  57. /********************/
  58. /*********************/
  59. /* Public Prototypes */
  60. /*********************/
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64. /*-------------------------------------------------------------------------*/
  65. /**
  66. * \ingroup H5A
  67. *
  68. * \brief Closes the specified attribute
  69. *
  70. * \attr_id
  71. *
  72. * \return \herr_t
  73. *
  74. * \details H5Aclose() terminates access to the attribute through
  75. * \p attr_id and releases the identifier.
  76. *
  77. * \par Example
  78. * \snippet H5A_examples.c create
  79. *
  80. * \since 1.0.0
  81. *
  82. * \see H5Acreate(), H5Aopen()
  83. */
  84. H5_DLL herr_t H5Aclose(hid_t attr_id);
  85. /*--------------------------------------------------------------------------*/
  86. /**
  87. * \ingroup ASYNC
  88. * \async_variant_of{H5Aclose}
  89. */
  90. H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
  91. hid_t es_id);
  92. /* --------------------------------------------------------------------------*/
  93. /**
  94. * \ingroup H5A
  95. *
  96. * \brief Creates an attribute attached to a specified object
  97. *
  98. * \fgdt_loc_id
  99. * \param[in] attr_name Name of attribute
  100. * \param[in] type_id Attribute datatype identifier
  101. * \space_id
  102. * \acpl_id
  103. * \aapl_id
  104. *
  105. * \return \hid_tv{attribute}
  106. *
  107. * \details H5Acreate2() creates an attribute, \p attr_name, which is attached
  108. * to the object specified by the identifier \p loc_id.
  109. *
  110. * The attribute name, \p attr_name, must be unique for the object.
  111. *
  112. * The attribute is created with the specified datatype and dataspace,
  113. * \p type_id and \p space_id.
  114. *
  115. * \plist_unused{acpl}
  116. *
  117. * The attribute identifier returned by this function must be released
  118. * with H5Aclose() resource leaks will develop.
  119. *
  120. * \note If \p loc_id is a file identifier, the attribute will be attached
  121. * that file’s root group.
  122. *
  123. * \par Example
  124. * \snippet H5A_examples.c create
  125. *
  126. * \since 1.8.0
  127. *
  128. * \see H5Aclose()
  129. *
  130. */
  131. 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,
  132. hid_t aapl_id);
  133. /*--------------------------------------------------------------------------*/
  134. /**
  135. * \ingroup ASYNC
  136. * \async_variant_of{H5Acreate}
  137. */
  138. H5_DLL hid_t H5Acreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
  139. const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id,
  140. hid_t aapl_id, hid_t es_id);
  141. /*--------------------------------------------------------------------------*/
  142. /**
  143. * \ingroup H5A
  144. *
  145. * \brief Creates an attribute attached to a specified object
  146. *
  147. * \fgdt_loc_id
  148. * \param[in] obj_name Name, relative to \p loc_id, of object that
  149. * attribute is to be attached to
  150. * \param[in] attr_name Attribute name
  151. * \param[in] type_id Attribute datatype identifier
  152. * \space_id
  153. * \acpl_id
  154. * \aapl_id
  155. * \lapl_id
  156. *
  157. * \return \hid_tv{attribute}
  158. *
  159. * \details H5Acreate_by_name() creates an attribute, \p attr_name, which is
  160. * attached to the object specified by \p loc_id and \p obj_name.
  161. *
  162. * \p loc_id is a location identifier; \p obj_name is the object
  163. * name relative to \p loc_id.
  164. *
  165. * The attribute name, \p attr_name, must be unique for the object.
  166. *
  167. * The attribute is created with the specified datatype and
  168. * dataspace, \p type_id and \p space_id.
  169. *
  170. * \plist_unused{aapl}
  171. *
  172. * The link access property list, \p lapl_id, may provide
  173. * information regarding the properties of links required to access
  174. * the object, \p obj_name.
  175. *
  176. * \since 1.8.0
  177. *
  178. */
  179. H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id,
  180. hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id);
  181. /*--------------------------------------------------------------------------*/
  182. /**
  183. * \ingroup ASYNC
  184. * \async_variant_of{H5Acreate_by_name}
  185. */
  186. H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
  187. hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id,
  188. hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id,
  189. hid_t es_id);
  190. /*-------------------------------------------------------------------------*/
  191. /**
  192. * \ingroup H5A
  193. *
  194. * \brief Deletes an attribute from a specified location
  195. *
  196. * \fgdt_loc_id
  197. * \param[in] attr_name Name of the attribute to delete
  198. *
  199. * \return \herr_t
  200. *
  201. * \details H5Adelete() removes the attribute specified by its name,
  202. * \p attr_name, from a file, dataset, group, or named datatype.
  203. *
  204. * \attention This function should not be used when other attribute identifiers
  205. * are open on \p loc_id. This may cause the internal indexes of
  206. * the attributes to change and future writes to the open
  207. * attributes to produce incorrect results.
  208. *
  209. * \par Example
  210. * \snippet H5A_examples.c delete
  211. *
  212. * \since 1.0.0
  213. *
  214. */
  215. H5_DLL herr_t H5Adelete(hid_t loc_id, const char *attr_name);
  216. /*-------------------------------------------------------------------------*/
  217. /**
  218. * \ingroup H5A
  219. *
  220. * \brief Deletes an attribute from an object according to index order
  221. *
  222. * \fgdt_loc_id
  223. * \param[in] obj_name Name of object, relative to location, from which
  224. * attribute is to be removed
  225. * \param[in] idx_type Type of index
  226. * \param[in] order Order in which to iterate over index
  227. * \param[in] n Offset within index
  228. * \lapl_id
  229. *
  230. * \return \herr_t
  231. *
  232. * \details H5Adelete_by_idx() removes an attribute, specified by its
  233. * location in an index, from an object.
  234. *
  235. * The object from which the attribute is to be removed is
  236. * specified by a location identifier and name, \p loc_id and
  237. * \p obj_name, respectively.
  238. *
  239. * The attribute to be removed is specified by a position in an
  240. * index, \p n. The type of index is specified by \p idx_type.
  241. * The order in which the index is to be traversed is specified by
  242. * \p order. For example, if \p idx_type, \p order,
  243. * and \p n are set to #H5_INDEX_NAME, #H5_ITER_INC, and 5,
  244. * respectively, the fifth attribute in lexicographic order of
  245. * attribute names will be removed.
  246. *
  247. * The link access property list, \p lapl_id, may provide
  248. * information regarding the properties of links required to access
  249. * the object, \p obj_name.
  250. * \since 1.8.0
  251. *
  252. */
  253. 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,
  254. hsize_t n, hid_t lapl_id);
  255. /*-------------------------------------------------------------------------*/
  256. /**
  257. * \ingroup H5A
  258. *
  259. * \brief Removes an attribute from a specified location
  260. *
  261. * \fgdt_loc_id
  262. * \param[in] obj_name Name of object, relative to location, from which
  263. * attribute is to be removed
  264. * \param[in] attr_name Name of attribute to delete
  265. * \lapl_id
  266. *
  267. * \return \herr_t
  268. *
  269. * \details H5Adelete_by_name() removes the attribute \p attr_name
  270. * from an object specified by location and name, \p loc_id and
  271. * \p obj_name, respectively.
  272. *
  273. * The link access property list, \p lapl_id, may provide
  274. * information regarding the properties of links required to
  275. * access the object, \p obj_name.
  276. *
  277. * \since 1.8.0
  278. *
  279. */
  280. H5_DLL herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id);
  281. /*-------------------------------------------------------------------------*/
  282. /**
  283. * \ingroup H5A
  284. *
  285. * \brief Determines whether an attribute with a given name exists on an
  286. * object
  287. *
  288. * \fgdt_loc_id{obj_id}
  289. * \param[in] attr_name Attribute name
  290. *
  291. * \return \htri_t
  292. *
  293. * \details H5Aexists() determines whether the attribute \p attr_name
  294. * exists on the object specified by \p obj_id.
  295. *
  296. * \since 1.8.0
  297. *
  298. */
  299. H5_DLL htri_t H5Aexists(hid_t obj_id, const char *attr_name);
  300. /*--------------------------------------------------------------------------*/
  301. /**
  302. * \ingroup ASYNC
  303. * \async_variant_of{H5Aexists}
  304. */
  305. H5_DLL herr_t H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
  306. const char *attr_name, hbool_t *exists, hid_t es_id);
  307. /*-------------------------------------------------------------------------*/
  308. /**
  309. * \ingroup H5A
  310. *
  311. * \brief Determines whether an attribute with a given name exists on an
  312. * object
  313. *
  314. * \fgdt_loc_id{obj_id}
  315. * \param[in] obj_name Object name
  316. * \param[in] attr_name Attribute name
  317. * \lapl_id
  318. *
  319. * \return \htri_t
  320. *
  321. * \details H5Aexists_by_name() determines whether the attribute
  322. * \p attr_name exists on an object. That object is specified by
  323. * its location and name, \p loc_id and \p obj_name, respectively.
  324. *
  325. * \p loc_id specifies a location in the file containing the object.
  326. * \p obj_name is the name of the object to which the attribute is
  327. * attached and can be a relative name, relative to \p loc_id,
  328. * or an absolute name, based in the root group of the file.
  329. *
  330. * The link access property list, \p lapl_id, may provide
  331. * information regarding the properties of links required to access
  332. * \p obj_name.
  333. *
  334. * \since 1.8.0
  335. *
  336. */
  337. H5_DLL htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id);
  338. /*--------------------------------------------------------------------------*/
  339. /**
  340. * \ingroup ASYNC
  341. * \async_variant_of{H5Aexists_by_name}
  342. */
  343. H5_DLL herr_t H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
  344. hid_t loc_id, const char *obj_name, const char *attr_name,
  345. hbool_t *exists, hid_t lapl_id, hid_t es_id);
  346. /*-------------------------------------------------------------------------*/
  347. /**
  348. * \ingroup H5A
  349. *
  350. * \brief Gets an attribute creation property list identifier
  351. *
  352. * \attr_id
  353. *
  354. * \return \hid_tv{attribute's creation property list}
  355. *
  356. * \details H5Aget_create_plist() returns an identifier for the attribute
  357. * creation property list associated with the attribute specified
  358. * by \p attr_id.
  359. *
  360. * \since 1.8.0
  361. *
  362. */
  363. H5_DLL hid_t H5Aget_create_plist(hid_t attr_id);
  364. /*-------------------------------------------------------------------------*/
  365. /**
  366. * \ingroup H5A
  367. *
  368. * \brief Retrieves attribute information, by attribute identifier
  369. *
  370. * \attr_id
  371. * \param[out] ainfo Attribute information struct
  372. *
  373. * \return \herr_t
  374. *
  375. * \details H5Aget_info() retrieves attribute information, locating the
  376. * attribute with an attribute identifier, \p attr_id. The
  377. * attribute information is returned in the \p ainfo struct.
  378. *
  379. * \since 1.8.0
  380. *
  381. */
  382. H5_DLL herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/);
  383. /*-------------------------------------------------------------------------*/
  384. /**
  385. * \ingroup H5A
  386. *
  387. * \brief Retrieves attribute information by attribute index position
  388. *
  389. * \fgdt_loc_id
  390. * \param[in] obj_name Name of object to which attribute is attached,
  391. * relative to location
  392. * \param[in] idx_type Type of index
  393. * \param[in] order Index traversal order
  394. * \param[in] n Attribute’s position in index
  395. * \param[out] ainfo Struct containing returned attribute information
  396. * \lapl_id
  397. *
  398. * \return \herr_t
  399. *
  400. * \details H5Aget_info_by_idx() retrieves information for an attribute
  401. * that is attached to an object, which is specified by its
  402. * location and name, \p loc_id and \p obj_name, respectively.
  403. * The attribute is located by its index position and the attribute
  404. * information is returned in the \p ainfo struct.
  405. *
  406. * The attribute is located by means of an index type, an index
  407. * traversal order, and a position in the index, \p idx_type,
  408. * \p order and \p n, respectively.
  409. *
  410. * The link access property list, \p lapl_id, may provide
  411. * information regarding the properties of links required to access
  412. * the object, \p obj_name.
  413. *
  414. * \since 1.8.0
  415. *
  416. */
  417. H5_DLL herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
  418. H5_iter_order_t order, hsize_t n, H5A_info_t *ainfo /*out*/, hid_t lapl_id);
  419. /*-------------------------------------------------------------------------*/
  420. /**
  421. * \ingroup H5A
  422. *
  423. * \brief Retrieves attribute information, by attribute name
  424. *
  425. * \fgdt_loc_id
  426. * \param[in] obj_name Name of the object to which an attribute is attached,
  427. * relative to location
  428. * \param[in] attr_name Attribute name
  429. * \param[out] ainfo Struct containing returned attribute information
  430. * \lapl_id
  431. *
  432. * \return \herr_t
  433. *
  434. * \details H5Aget_info_by_name() retrieves information for an attribute,
  435. * \p attr_name, that is attached to an object specified by its
  436. * location and name, \p loc_id and \p obj_name, respectively.
  437. * The attribute information is returned in the \p ainfo struct.
  438. *
  439. * The link access property list, \p lapl_id, may provide
  440. * information regarding the properties of links required to
  441. * access the object, \p obj_name.
  442. *
  443. * \since 1.8.0
  444. *
  445. */
  446. H5_DLL herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
  447. H5A_info_t *ainfo /*out*/, hid_t lapl_id);
  448. /*-------------------------------------------------------------------------*/
  449. /**
  450. * \ingroup H5A
  451. *
  452. * \brief Gets an attribute name
  453. *
  454. * \attr_id
  455. * \param[in] buf_size The size of the buffer to store the name in
  456. * \param[out] buf Buffer to store name in
  457. *
  458. * \return Returns the length of the attribute's name, which may be longer
  459. * than \p buf_size, if successful. Otherwise returns a negative
  460. * value.
  461. *
  462. * \details H5Aget_name() retrieves the name of an attribute specified by
  463. * the identifier, \p attr_id. Up to \p buf_size characters are
  464. * stored in \p buf followed by a \0 string terminator. If the
  465. * name of the attribute is longer than (\p buf_size -1), the
  466. * string terminator is stored in the last position of the buffer
  467. * to properly terminate the string.
  468. *
  469. * If the user only wants to retrieve the name length, the
  470. * values 0 and NULL should be passed for the parameters
  471. * \p bufsize and \p buf.
  472. *
  473. * \since 1.0.0
  474. *
  475. */
  476. H5_DLL ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf);
  477. /*-------------------------------------------------------------------------*/
  478. /**
  479. * \ingroup H5A
  480. *
  481. * \brief Gets an attribute name by attribute index position
  482. *
  483. * \fgdt_loc_id
  484. * \param[in] obj_name Name of object to which attribute is attached,
  485. * relative to location
  486. * \param[in] idx_type Type of index
  487. * \param[in] order Index traversal order
  488. * \param[in] n Attribute’s position in index
  489. * \param[out] name Attribute name
  490. * \param[in] size Size, in bytes, of attribute name
  491. * \lapl_id
  492. *
  493. * \return Returns attribute name size, in bytes, if successful;
  494. * otherwise returns a negative value.
  495. *
  496. * \details H5Aget_name_by_idx() retrieves the name of an attribute that is
  497. * attached to an object, which is specified by its location and
  498. * name, \p loc_id and \p obj_name, respectively. The attribute is
  499. * located by its index position, the size of the name is specified
  500. * in \p size, and the attribute name is returned in \p name.
  501. *
  502. * The attribute is located by means of an index type, an index
  503. * traversal order, and a position in the index, \p idx_type,
  504. * \p order and \p n, respectively.
  505. *
  506. * If the attribute name’s size is unknown, the values 0 and NULL
  507. * can be passed in for the parameters \p size and \p name. The
  508. * function’s return value will provide the correct value for
  509. * \p size.
  510. *
  511. * The link access property list, \p lapl_id, may provide
  512. * information regarding the properties of links required to access
  513. * the object, \p obj_name.
  514. *
  515. * \since 1.8.0
  516. *
  517. */
  518. H5_DLL ssize_t H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
  519. H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size,
  520. hid_t lapl_id);
  521. /*-------------------------------------------------------------------------*/
  522. /**
  523. * \ingroup H5A
  524. *
  525. * \brief Gets a copy of the dataspace for an attribute
  526. *
  527. * \attr_id
  528. *
  529. * \return \hid_tv{attribute dataspace}
  530. *
  531. * \details H5Aget_space() retrieves a copy of the dataspace for an
  532. * attribute. The dataspace identifier returned from this
  533. * function must be released with H5Sclose() or resource leaks
  534. * will develop.
  535. *
  536. * \since 1.0.0
  537. *
  538. */
  539. H5_DLL hid_t H5Aget_space(hid_t attr_id);
  540. /*-------------------------------------------------------------------------*/
  541. /**
  542. * \ingroup H5A
  543. *
  544. * \brief Returns the amount of storage used to store an attribute
  545. *
  546. * \attr_id
  547. *
  548. * \return Returns the amount of storage size allocated for the attribute;
  549. * otherwise returns 0 (zero).
  550. *
  551. * \details H5Aget_storage_size() returns the amount of storage that is
  552. * required for the specified attribute, \p attr_id.
  553. *
  554. * \since 1.6.0
  555. *
  556. */
  557. H5_DLL hsize_t H5Aget_storage_size(hid_t attr_id);
  558. /*-------------------------------------------------------------------------*/
  559. /**
  560. * \ingroup H5A
  561. *
  562. * \brief Gets an attribute's datatype
  563. *
  564. * \attr_id
  565. *
  566. * \return \hid_t{datatype}
  567. *
  568. * \details H5Aget_type() retrieves a copy of the attribute's datatype.
  569. * The datatype is reopened if it is a named type before returning
  570. * it to the application. The datatypes returned by this function
  571. * are always read-only.
  572. *
  573. * The datatype identifier returned from this function must be
  574. * released with H5Tclose() or resource leaks will develop.
  575. *
  576. * \since 1.0.0
  577. *
  578. */
  579. H5_DLL hid_t H5Aget_type(hid_t attr_id);
  580. /*-------------------------------------------------------------------------*/
  581. /**
  582. * \ingroup H5A
  583. *
  584. * \brief Calls a user-defined function for each attribute on an object
  585. *
  586. * \fgdt_loc_id
  587. * \param[in] idx_type Type of index
  588. * \param[in] order Order in which to iterate over index
  589. * \param[in,out] idx Initial and returned offset within index
  590. * \param[in] op User-defined function to pass each attribute to
  591. * \param[in,out] op_data User data to pass through to and to be returned
  592. * by iterator operator function
  593. *
  594. * \return \herr_t
  595. * Further note that this function returns the return value of the
  596. * last operator if it was non-zero, which can be a negative value,
  597. * zero if all attributes were processed, or a positive value
  598. * indicating short-circuit success.
  599. *
  600. * \details H5Aiterate2() iterates over the attributes attached to a
  601. * dataset, named datatype, or group, as specified by \p loc_id.
  602. * For each attribute, user-provided data, \p op_data, with
  603. * additional information as defined below, is passed to a
  604. * user-defined function, \p op, which operates on that
  605. * attribute.
  606. *
  607. * The order of the iteration and the attributes iterated over
  608. * are specified by three parameters: the index type,
  609. * \p idx_type; the order in which the index is to be traversed,
  610. * \p order; and the attribute’s position in the index, \p idx.
  611. * The next attribute to be operated on is specified by \p idx,
  612. * a position in the index.
  613. *
  614. * For example, if \p idx_type, \p order, and \p idx are set to
  615. * #H5_INDEX_NAME, #H5_ITER_INC, and 5, respectively, the attribute
  616. * in question is the fifth attribute from the beginning of the
  617. * alphanumeric index of attribute names. If \p order were set to
  618. * #H5_ITER_DEC, it would be the fifth attribute from the end of
  619. * the index.
  620. *
  621. * The parameter \p idx is passed in on an H5Aiterate2() call with
  622. * one value and may be returned with another value. The value
  623. * passed in identifies the parameter to be operated on first;
  624. * the value returned identifies the parameter to be operated on
  625. * in the next step of the iteration.
  626. *
  627. * \note This function is also available through the H5Aiterate() macro.
  628. *
  629. * \since 1.8.0
  630. *
  631. */
  632. H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx,
  633. H5A_operator2_t op, void *op_data);
  634. /*--------------------------------------------------------------------------*/
  635. /**
  636. * \ingroup H5A
  637. *
  638. * \brief Calls user-defined function for each attribute on an object
  639. *
  640. * \fgdt_loc_id
  641. * \param[in] obj_name Name of object, relative to location
  642. * \param[in] idx_type Type of index
  643. * \param[in] order Order in which to iterate over index
  644. * \param[in,out] idx Initial and returned offset within index
  645. * \param[in] op User-defined function to pass each attribute to
  646. * \param[in,out] op_data User data to pass through to and to be returned
  647. * by iterator operator function
  648. * \lapl_id
  649. *
  650. * \return \herr_t
  651. * Further note that this function returns the return value of
  652. * the last operator if it was non-zero, which can be a negative
  653. * value, zero if all attributes were processed, or a positive value
  654. * indicating short-circuit success.
  655. *
  656. * \details H5Aiterate_by_name() iterates over the attributes attached
  657. * to the dataset or group specified with \p loc_id and \p obj_name.
  658. * For each attribute, user-provided data, \p op_data, with
  659. * additional information as defined below, is passed to a
  660. * user-defined function, \p op, which operates on that attribute.
  661. *
  662. * The order of the iteration and the attributes iterated over
  663. * are specified by three parameters: the index type, \p idx_type;
  664. * the order in which the index is to be traversed, \p order;
  665. * and the attribute’s position in the index, \p idx.
  666. * The next attribute to be operated on is specified by \p idx,
  667. * a position in the index.
  668. *
  669. * For example, if \p idx_type, \p order, and \p idx are set to
  670. * #H5_INDEX_NAME, #H5_ITER_INC, and 5, respectively, the attribute
  671. * in question is the fifth attribute from the beginning of the
  672. * alphanumeric index of attribute names. If \p order were set to
  673. * #H5_ITER_DEC, it would be the fifth attribute from the end of
  674. * the index.
  675. *
  676. * The parameter \p idx is passed in on an H5Aiterate_by_name()
  677. * call with one value and may be returned with another value. The
  678. * value passed in identifies the parameter to be operated on first;
  679. * the value returned identifies the parameter to be operated on in
  680. * the next step of the iteration.
  681. *
  682. * The link access property list, \p lapl_id, may provide
  683. * information regarding the properties of links required to access
  684. * the object, \p obj_name.
  685. *
  686. * \since 1.8.0
  687. *
  688. */
  689. H5_DLL herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
  690. H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data,
  691. hid_t lapl_id);
  692. /*--------------------------------------------------------------------------*/
  693. /**
  694. * \ingroup H5A
  695. *
  696. * \brief Opens an attribute for an object specified by object identifier and
  697. * attribute name
  698. *
  699. * \fgdt_loc_id{obj_id}
  700. * \param[in] attr_name Name of attribute to open
  701. * \aapl_id
  702. *
  703. * \return \hid_tv{attribute}
  704. *
  705. * \details H5Aopen() opens an existing attribute, \p attr_name, that is
  706. * attached to object specified by an object identifier, \p obj_id.
  707. *
  708. * \plist_unused{aapl_id}
  709. *
  710. * This function, H5Aopen_by_idx() or H5Aopen_by_name() must be called
  711. * before the attribute can be accessed for any further purpose,
  712. * including reading, writing, or any modification.
  713. *
  714. * The attribute identifier returned by this function must be released
  715. * with H5Aclose() or resource leaks will develop.
  716. *
  717. * \par Example
  718. * \snippet H5A_examples.c read
  719. *
  720. * \since 1.8.0
  721. *
  722. * \see H5Aclose(), H5Acreate()
  723. */
  724. H5_DLL hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id);
  725. /*--------------------------------------------------------------------------*/
  726. /**
  727. * \ingroup ASYNC
  728. * \async_variant_of{H5Aopen}
  729. */
  730. H5_DLL hid_t H5Aopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
  731. const char *attr_name, hid_t aapl_id, hid_t es_id);
  732. /*--------------------------------------------------------------------------*/
  733. /**
  734. * \ingroup H5A
  735. *
  736. * \brief Opens the nth attribute attached to an object
  737. *
  738. * \loc_id
  739. * \param[in] obj_name Name of object to which attribute is attached,
  740. * relative to location
  741. * \param[in] idx_type Type of index
  742. * \param[in] order Index traversal order
  743. * \param[in] n Attribute’s position in index
  744. * \aapl_id
  745. * \lapl_id
  746. *
  747. * \return \hid_tv{attribute}
  748. *
  749. * \details H5Aopen_by_idx() opens an existing attribute that is attached
  750. * to an object specified by location and name, \p loc_id and
  751. * \p obj_name, respectively.
  752. *
  753. * The attribute is identified by an index type, an index traversal
  754. * order, and a position in the index, \p idx_type, \p order and
  755. * \p n, respectively.
  756. *
  757. * \plist_unused{aapl_id}
  758. *
  759. * The link access property list, \p lapl_id, may provide
  760. * information regarding the properties of links required to access
  761. * the object, \p obj_name.
  762. *
  763. * This function, H5Aopen(), or H5Aopen_by_name() must be called
  764. * before an attribute can be accessed for any further purpose,
  765. * including reading, writing, or any modification.
  766. *
  767. * The attribute identifier returned by this function must be
  768. * released with H5Aclose() or resource leaks will develop.
  769. *
  770. * \since 1.8.0
  771. *
  772. */
  773. 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,
  774. hsize_t n, hid_t aapl_id, hid_t lapl_id);
  775. /*--------------------------------------------------------------------------*/
  776. /**
  777. * \ingroup ASYNC
  778. * \async_variant_of{H5Aopen_by_idx}
  779. */
  780. H5_DLL hid_t H5Aopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
  781. const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
  782. hid_t aapl_id, hid_t lapl_id, hid_t es_id);
  783. /*--------------------------------------------------------------------------*/
  784. /**
  785. * \ingroup H5A
  786. *
  787. * \brief Opens an attribute for an object by object name and attribute name
  788. *
  789. * \fgdt_loc_id
  790. * \param[in] obj_name Name of object to which attribute is attached,
  791. * relative to \p loc_id
  792. * \param[in] attr_name Name of attribute to open
  793. * \aapl_id
  794. * \lapl_id
  795. *
  796. * \return \hid_tv{attribute}
  797. *
  798. * \details H5Aopen_by_name() opens an existing attribute, \p attr_name,
  799. * that is attached to an object specified by location and name,
  800. * \p loc_id and \p obj_name, respectively.
  801. *
  802. * \p loc_id specifies a location from which the target object can
  803. * be located and \p obj_name is an object name relative to
  804. * \p loc_id.
  805. *
  806. * \plist_unused{aapl_id}
  807. *
  808. * The link access property list, \p lapl_id, may provide
  809. * information regarding the properties of links required to access
  810. * the object, \p obj_name.
  811. *
  812. * This function, H5Aopen(), or H5Aopen_by_idx() must be called
  813. * before an attribute can be accessed for any further purpose,
  814. * including reading, writing, or any modification.
  815. *
  816. * The attribute identifier returned by this function must be
  817. * released with H5Aclose() or resource leaks will develop.
  818. *
  819. * \since 1.8.0
  820. *
  821. */
  822. H5_DLL hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id,
  823. hid_t lapl_id);
  824. /*--------------------------------------------------------------------------*/
  825. /**
  826. * \ingroup ASYNC
  827. * \async_variant_of{H5Aopen_by_name}
  828. */
  829. H5_DLL hid_t H5Aopen_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
  830. hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id,
  831. hid_t lapl_id, hid_t es_id);
  832. /*-------------------------------------------------------------------------- */
  833. /**
  834. * \ingroup H5A
  835. *
  836. * \brief Reads the value of an attribute
  837. *
  838. * \attr_id
  839. * \mem_type_id{type_id}
  840. * \param[out] buf Buffer for data to be read
  841. *
  842. * \return \herr_t
  843. *
  844. * \details H5Aread() reads an attribute, specified with \p attr_id. The
  845. * attribute's in-memory datatype is specified with \p type_id. The
  846. * entire attribute is read into \p buf from the file.
  847. *
  848. * Datatype conversion takes place at the time of a read or write and
  849. * is automatic.
  850. *
  851. * \par Example
  852. * \snippet H5A_examples.c read
  853. *
  854. * \version 1.8.8 Fortran updated to Fortran2003.
  855. * \version 1.4.2 The \p dims parameter was added to the Fortran API in this
  856. * release.
  857. * \since 1.0.0
  858. *
  859. * \see H5Awrite()
  860. *
  861. */
  862. H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf);
  863. /*--------------------------------------------------------------------------*/
  864. /**
  865. * \ingroup ASYNC
  866. * \async_variant_of{H5Aread}
  867. */
  868. H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
  869. hid_t dtype_id, void *buf, hid_t es_id);
  870. /*-------------------------------------------------------------------------*/
  871. /**
  872. * \ingroup H5A
  873. *
  874. * \brief Renames an attribute
  875. *
  876. * \fgdt_loc_id
  877. * \param[in] old_name Name of the attribute to be changed
  878. * \param[in] new_name New name for the attribute
  879. *
  880. * \return \herr_t
  881. *
  882. * \details H5Arename() changes the name of the attribute located at
  883. * \p loc_id.
  884. *
  885. * The old name, \p old_name, is changed to the new name,
  886. * \p new_name.
  887. *
  888. * \since 1.6.0
  889. *
  890. */
  891. H5_DLL herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name);
  892. /*--------------------------------------------------------------------------*/
  893. /**
  894. * \ingroup ASYNC
  895. * \async_variant_of{H5Arename}
  896. */
  897. H5_DLL herr_t H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
  898. const char *old_name, const char *new_name, hid_t es_id);
  899. /*--------------------------------------------------------------------------*/
  900. /**
  901. * \ingroup ASYNC
  902. * \async_variant_of{H5Arename_by_name}
  903. */
  904. H5_DLL herr_t H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
  905. hid_t loc_id, const char *obj_name, const char *old_attr_name,
  906. const char *new_attr_name, hid_t lapl_id, hid_t es_id);
  907. /*--------------------------------------------------------------------------*/
  908. /**
  909. * \ingroup H5A
  910. *
  911. * \brief Writes data to an attribute
  912. *
  913. * \attr_id
  914. * \mem_type_id{type_id}
  915. * \param[out] buf Data to be written
  916. *
  917. * \return \herr_t
  918. *
  919. * \details H5Awrite() writes an attribute, specified with \p attr_id. The
  920. * attribute's in-memory datatype is specified with \p type_id.
  921. * The entire attribute is written from \p buf to the file.
  922. *
  923. * Datatype conversion takes place at the time of a read or write and
  924. * is automatic.
  925. *
  926. * \par Example
  927. * \snippet H5A_examples.c update
  928. *
  929. * \version 1.8.8 Fortran updated to Fortran2003.
  930. * \version 1.4.2 Fortran \p dims parameter added in this release
  931. * \since 1.0.0
  932. * \see H5Aread()
  933. *
  934. */
  935. H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf);
  936. /*--------------------------------------------------------------------------*/
  937. /**
  938. * \ingroup ASYNC
  939. * \async_variant_of{H5Awrite}
  940. */
  941. H5_DLL herr_t H5Awrite_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
  942. hid_t type_id, const void *buf, hid_t es_id);
  943. /*-------------------------------------------------------------------------*/
  944. /**
  945. * \ingroup H5A
  946. *
  947. * \fgdt_loc_id
  948. * \param[in] obj_name Name of object, relative to location, whose
  949. * attribute is to be renamed
  950. * \param[in] old_attr_name Prior attribute name
  951. * \param[in] new_attr_name New attribute name
  952. * \lapl_id
  953. *
  954. * \details H5Arename_by_name() changes the name of attribute that is
  955. * attached to the object specified by \p loc_id and \p obj_name.
  956. * The attribute named \p old_attr_name is renamed
  957. * \p new_attr_name.
  958. *
  959. * The link access property list, \p lapl_id, may provide
  960. * information regarding the properties of links required to
  961. * access the object, \p obj_name.
  962. *
  963. * \since 1.8.0
  964. *
  965. */
  966. H5_DLL herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name,
  967. const char *new_attr_name, hid_t lapl_id);
  968. /// \cond DEV
  969. /* API Wrappers for async routines */
  970. /* (Must be defined _after_ the function prototype) */
  971. /* (And must only defined when included in application code, not the library) */
  972. #ifndef H5A_MODULE
  973. #define H5Acreate_async(...) H5Acreate_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  974. #define H5Acreate_by_name_async(...) H5Acreate_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  975. #define H5Aopen_async(...) H5Aopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  976. #define H5Aopen_by_name_async(...) H5Aopen_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  977. #define H5Aopen_by_idx_async(...) H5Aopen_by_idx_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  978. #define H5Awrite_async(...) H5Awrite_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  979. #define H5Aread_async(...) H5Aread_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  980. #define H5Arename_async(...) H5Arename_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  981. #define H5Arename_by_name_async(...) H5Arename_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  982. #define H5Aexists_async(...) H5Aexists_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  983. #define H5Aexists_by_name_async(...) H5Aexists_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  984. #define H5Aclose_async(...) H5Aclose_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
  985. /* Define "wrapper" versions of function calls, to allow compile-time values to
  986. * be passed in by language wrapper or library layer on top of HDF5.
  987. */
  988. #define H5Acreate_async_wrap H5_NO_EXPAND(H5Acreate_async)
  989. #define H5Acreate_by_name_async_wrap H5_NO_EXPAND(H5Acreate_by_name_async)
  990. #define H5Aopen_async_wrap H5_NO_EXPAND(H5Aopen_async)
  991. #define H5Aopen_by_name_async_wrap H5_NO_EXPAND(H5Aopen_by_name_async)
  992. #define H5Aopen_by_idx_async_wrap H5_NO_EXPAND(H5Aopen_by_idx_async)
  993. #define H5Awrite_async_wrap H5_NO_EXPAND(H5Awrite_async)
  994. #define H5Aread_async_wrap H5_NO_EXPAND(H5Aread_async)
  995. #define H5Arename_async_wrap H5_NO_EXPAND(H5Arename_async)
  996. #define H5Arename_by_name_async_wrap H5_NO_EXPAND(H5Arename_by_name_async)
  997. #define H5Aexists_async_wrap H5_NO_EXPAND(H5Aexists_async)
  998. #define H5Aexists_by_name_async_wrap H5_NO_EXPAND(H5Aexists_by_name_async)
  999. #define H5Aclose_async_wrap H5_NO_EXPAND(H5Aclose_async)
  1000. #endif /* H5A_MODULE */
  1001. /// \endcond
  1002. /* Symbols defined for compatibility with previous versions of the HDF5 API.
  1003. *
  1004. * Use of these symbols is deprecated.
  1005. */
  1006. #ifndef H5_NO_DEPRECATED_SYMBOLS
  1007. /* Macros */
  1008. /* Typedefs */
  1009. //! <!-- [H5A_operator1_t_snip] -->
  1010. /**
  1011. * \brief Typedef for H5Aiterate1() callbacks
  1012. *
  1013. * \param[in] location_id The identifier for the group, dataset
  1014. * or named datatype being iterated over
  1015. * \param[in] attr_name The name of the current object attribute
  1016. * \param[in,out] operator_data A pointer to the operator data passed in to
  1017. * H5Aiterate1()
  1018. * \returns The return values from an operator are:
  1019. * \li Zero causes the iterator to continue, returning zero when
  1020. * all attributes have been processed.
  1021. * \li Positive causes the iterator to immediately return that
  1022. * positive value, indicating short-circuit success. The
  1023. * iterator can be restarted at the next attribute.
  1024. * \li Negative causes the iterator to immediately return that value,
  1025. * indicating failure. The iterator can be restarted at the next
  1026. * attribute.
  1027. */
  1028. typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
  1029. void *operator_data /*in,out*/);
  1030. //! <!-- [H5A_operator1_t_snip] -->
  1031. /* Function prototypes */
  1032. /* --------------------------------------------------------------------------*/
  1033. /**
  1034. * \ingroup H5A
  1035. *
  1036. * \brief Creates an attribute attached to a specified object
  1037. *
  1038. * \fgdt_loc_id
  1039. * \param[in] name Name of attribute to locate and open
  1040. * \param[in] type_id Identifier of attribute datatype
  1041. * \space_id
  1042. * \acpl_id
  1043. *
  1044. * \return \hid_tv{attribute}
  1045. *
  1046. * \deprecation_note{H5Acreate2()}
  1047. *
  1048. * \plist_unused{acpl}
  1049. *
  1050. * \details H5Acreate1() creates an attribute, \p name, which is attached
  1051. * to the object specified by the identifier \p loc_id.
  1052. *
  1053. * The attribute name, \p name, must be unique for the object.
  1054. *
  1055. * The attribute is created with the specified datatype and dataspace,
  1056. * \p type_id and \p space_id.
  1057. *
  1058. * \since 1.8.0
  1059. *
  1060. * \version 1.8.0 The function H5Acreate() was renamed to H5Acreate1() and
  1061. * deprecated in this release.
  1062. *
  1063. * \see H5Aclose()
  1064. *
  1065. */
  1066. H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id);
  1067. /* --------------------------------------------------------------------------*/
  1068. /**
  1069. * \ingroup H5A
  1070. *
  1071. * \brief Determines the number of attributes attached to an object
  1072. *
  1073. * \fgdt_loc_id
  1074. *
  1075. * \return Returns the number of attributes if successful; otherwise returns
  1076. * a negative value.
  1077. *
  1078. * \deprecation_note{H5Oget_info(), H5Oget_info_by_name(), and H5Oget_info_by_idx()}
  1079. *
  1080. * \details H5Aget_num_attrs() returns the number of attributes attached to
  1081. * the object specified by its identifier, \p loc_id.
  1082. *
  1083. * \since 1.0.0
  1084. *
  1085. */
  1086. H5_DLL int H5Aget_num_attrs(hid_t loc_id);
  1087. /* --------------------------------------------------------------------------*/
  1088. /**
  1089. * \ingroup H5A
  1090. *
  1091. * \brief Calls a user’s function for each attribute on an object
  1092. *
  1093. * \loc_id
  1094. * \param[in,out] idx Starting (in) and ending (out) attribute index
  1095. * \param[in] op User's function to pass each attribute to
  1096. * \param[in,out] op_data User's data to pass through to iterator operator
  1097. * function
  1098. *
  1099. * \return \herr_t
  1100. *
  1101. * \deprecation_note{H5Aiterate2()}
  1102. *
  1103. * \details H5Aiterate1() iterates over the attributes of the object
  1104. * specified by its identifier, \p loc_id. The object can be a
  1105. * group, dataset, or named datatype. For each attribute of the
  1106. * object, the \p op_data and some additional information specified
  1107. * below are passed to the operator function \p op. The iteration
  1108. * begins with the attribute specified by its index, \p idx; the
  1109. * index for the next attribute to be processed by the operator,
  1110. * \p op, is returned in \p idx. If \p idx is the null pointer,
  1111. * then all attributes are processed.
  1112. *
  1113. * \version 1.8.0 The function \p H5Aiterate was renamed to H5Aiterate1()
  1114. * and deprecated in this release.
  1115. * \since 1.0.0
  1116. *
  1117. */
  1118. H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *idx, H5A_operator1_t op, void *op_data);
  1119. /* --------------------------------------------------------------------------*/
  1120. /**
  1121. * \ingroup H5A
  1122. *
  1123. * \brief Opens the attribute specified by its index
  1124. *
  1125. * \loc_id
  1126. * \param[in] idx Index of the attribute to open
  1127. *
  1128. * \return \hid_tv{attribute}
  1129. *
  1130. * \deprecation_note{H5Aopen_by_idx()}
  1131. *
  1132. * \details H5Aopen_idx() opens an attribute which is attached to the
  1133. * object specified with \p loc_id . The location object may be
  1134. * either a group, dataset, or named datatype, all of which may
  1135. * have any sort of attribute. The attribute specified by the index,
  1136. * \p idx , indicates the attribute to access. The value of \p idx
  1137. * is a 0-based, non-negative integer. The attribute identifier
  1138. * returned from this function must be released with H5Aclose()
  1139. * or resource leaks will develop.
  1140. *
  1141. * \since 1.0.0
  1142. *
  1143. */
  1144. H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx);
  1145. /* --------------------------------------------------------------------------*/
  1146. /**
  1147. * \ingroup H5A
  1148. *
  1149. * \brief Opens an attribute specified by name
  1150. *
  1151. * \loc_id
  1152. * \param[in] name Attribute name
  1153. *
  1154. * \return \hid_tv{attribute}
  1155. *
  1156. * \deprecation_note{H5Aopen_by_name()}
  1157. *
  1158. * \details H5Aopen_name() opens an attribute specified by its name,
  1159. * \p name, which is attached to the object specified with
  1160. * \p loc_id. The location object may be either a group, dataset,
  1161. * or named datatype, which may have any sort of attribute. The
  1162. * attribute identifier returned from this function must be
  1163. * released with H5Aclose() or resource leaks will develop.
  1164. *
  1165. * \since 1.0.0
  1166. *
  1167. */
  1168. H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name);
  1169. #endif /* H5_NO_DEPRECATED_SYMBOLS */
  1170. #ifdef __cplusplus
  1171. }
  1172. #endif
  1173. #endif /* H5Apublic_H */