H5Ipublic.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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 function prototypes for each exported function in
  15. * the H5I module.
  16. */
  17. #ifndef H5Ipublic_H
  18. #define H5Ipublic_H
  19. /* Public headers needed by this file */
  20. #include "H5public.h"
  21. /**
  22. * Library type values.
  23. * \internal Library type values. Start with `1' instead of `0' because it
  24. * makes the tracing output look better when hid_t values are large
  25. * numbers. Change the TYPE_BITS in H5I.c if the MAXID gets larger
  26. * than 32 (an assertion will fail otherwise).
  27. *
  28. * When adding types here, add a section to the 'misc19' test in
  29. * test/tmisc.c to verify that the H5I{inc|dec|get}_ref() routines
  30. * work correctly with it. \endinternal
  31. */
  32. //! <!-- [H5I_type_t_snip] -->
  33. typedef enum H5I_type_t {
  34. H5I_UNINIT = (-2), /**< uninitialized type */
  35. H5I_BADID = (-1), /**< invalid Type */
  36. H5I_FILE = 1, /**< type ID for File objects */
  37. H5I_GROUP, /**< type ID for Group objects */
  38. H5I_DATATYPE, /**< type ID for Datatype objects */
  39. H5I_DATASPACE, /**< type ID for Dataspace objects */
  40. H5I_DATASET, /**< type ID for Dataset objects */
  41. H5I_MAP, /**< type ID for Map objects */
  42. H5I_ATTR, /**< type ID for Attribute objects */
  43. H5I_VFL, /**< type ID for virtual file layer */
  44. H5I_VOL, /**< type ID for virtual object layer */
  45. H5I_GENPROP_CLS, /**< type ID for generic property list classes */
  46. H5I_GENPROP_LST, /**< type ID for generic property lists */
  47. H5I_ERROR_CLASS, /**< type ID for error classes */
  48. H5I_ERROR_MSG, /**< type ID for error messages */
  49. H5I_ERROR_STACK, /**< type ID for error stacks */
  50. H5I_SPACE_SEL_ITER, /**< type ID for dataspace selection iterator */
  51. H5I_EVENTSET, /**< type ID for event sets */
  52. H5I_NTYPES /**< number of library types, MUST BE LAST! */
  53. } H5I_type_t;
  54. //! <!-- [H5I_type_t_snip] -->
  55. /**
  56. * Type of IDs to return to users
  57. */
  58. typedef int64_t hid_t;
  59. #define PRIdHID PRId64
  60. #define PRIxHID PRIx64
  61. #define PRIXHID PRIX64
  62. #define PRIoHID PRIo64
  63. /**
  64. * The size of identifiers
  65. */
  66. #define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T
  67. /**
  68. * An invalid object ID. This is also negative for error return.
  69. */
  70. #define H5I_INVALID_HID (-1)
  71. /**
  72. * A function for freeing objects. This function will be called with an object
  73. * ID type number and a pointer to the object. The function should free the
  74. * object and return non-negative to indicate that the object
  75. * can be removed from the ID type. If the function returns negative
  76. * (failure) then the object will remain in the ID type.
  77. */
  78. typedef herr_t (*H5I_free_t)(void *, void **);
  79. /**
  80. * The type of a function to compare objects & keys
  81. */
  82. //! <!-- [H5I_search_func_t_snip] -->
  83. typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key);
  84. //! <!-- [H5I_search_func_t_snip] -->
  85. /**
  86. * The type of H5Iiterate() callback functions
  87. */
  88. //! <!-- [H5I_iterate_func_t_snip] -->
  89. typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata);
  90. //! <!-- [H5I_iterate_func_t_snip] -->
  91. #ifdef __cplusplus
  92. extern "C" {
  93. #endif
  94. /* Public API functions */
  95. /**
  96. * \ingroup H5IUD
  97. *
  98. * \brief Registers an object under a type and returns an ID for it
  99. *
  100. * \param[in] type The identifier of the type of the new ID
  101. * \param[in] object Pointer to object for which a new ID is created
  102. *
  103. * \return \hid_t{object}
  104. *
  105. * \details H5Iregister() creates and returns a new ID for an object.
  106. *
  107. * \details The \p type parameter is the identifier for the ID type to which
  108. * this new ID will belong. This identifier must have been created by
  109. * a call to H5Iregister_type().
  110. *
  111. * \details The \p object parameter is a pointer to the memory which the new ID
  112. * will be a reference to. This pointer will be stored by the library
  113. * and returned via a call to H5Iobject_verify().
  114. *
  115. */
  116. H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object);
  117. /**
  118. * \ingroup H5IUD
  119. *
  120. * \brief Returns the object referenced by an ID
  121. *
  122. * \param[in] id ID to be dereferenced
  123. * \param[in] type The identifier type
  124. *
  125. * \return Pointer to the object referenced by \p id on success, NULL on failure.
  126. *
  127. * \details H5Iobject_verify() returns a pointer to the memory referenced by id
  128. * after verifying that \p id is of type \p type. This function is
  129. * analogous to dereferencing a pointer in C with type checking.
  130. *
  131. * \note H5Iobject_verify() does not change the ID it is called on in any way
  132. * (as opposed to H5Iremove_verify(), which removes the ID from its
  133. * type’s hash table).
  134. *
  135. * \see H5Iregister()
  136. *
  137. */
  138. H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t type);
  139. /**
  140. * \ingroup H5IUD
  141. *
  142. * \brief Removes an ID from its type
  143. *
  144. * \param[in] id The ID to be removed from its type
  145. * \param[in] type The identifier type
  146. *
  147. * \return Returns a pointer to the memory referred to by \p id on success,
  148. * NULL on failure.
  149. *
  150. * \details H5Iremove_verify() first ensures that \p id belongs to \p type.
  151. * If so, it removes \p id from its type and returns the pointer
  152. * to the memory it referred to. This pointer is the same pointer that
  153. * was placed in storage by H5Iregister(). If id does not belong to
  154. * \p type, then NULL is returned.
  155. *
  156. * The \p id parameter is the ID which is to be removed from its type.
  157. *
  158. * The \p type parameter is the identifier for the ID type which \p id
  159. * is supposed to belong to. This identifier must have been created by
  160. * a call to H5Iregister_type().
  161. *
  162. * \note This function does NOT deallocate the memory that \p id refers to.
  163. * The pointer returned by H5Iregister() must be deallocated by the user
  164. * to avoid memory leaks.
  165. *
  166. */
  167. H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t type);
  168. /**
  169. * \ingroup H5I
  170. *
  171. * \brief Retrieves the type of an object
  172. *
  173. * \obj_id{id}
  174. *
  175. * \return Returns the object type if successful; otherwise #H5I_BADID.
  176. *
  177. * \details H5Iget_type() retrieves the type of the object identified by
  178. * \p id. If no valid type can be determined or the identifier submitted is
  179. * invalid, the function returns #H5I_BADID.
  180. *
  181. * This function is of particular use in determining the type of
  182. * object closing function (H5Dclose(), H5Gclose(), etc.) to call
  183. * after a call to H5Rdereference().
  184. *
  185. * \note Note that this function returns only the type of object that \p id
  186. * would identify if it were valid; it does not determine whether \p id
  187. * is valid identifier. Validity can be determined with a call to
  188. * H5Iis_valid().
  189. *
  190. */
  191. H5_DLL H5I_type_t H5Iget_type(hid_t id);
  192. /**
  193. * \ingroup H5I
  194. *
  195. * \brief Retrieves an identifier for the file containing the specified object
  196. *
  197. * \obj_id{id}
  198. *
  199. * \return \hid_t{file}
  200. *
  201. * \details H5Iget_file_id() returns the identifier of the file associated with
  202. * the object referenced by \p id.
  203. *
  204. * \note Note that the HDF5 library permits an application to close a file
  205. * while objects within the file remain open. If the file containing the
  206. * object \p id is still open, H5Iget_file_id() will retrieve the
  207. * existing file identifier. If there is no existing file identifier for
  208. * the file, i.e., the file has been closed, H5Iget_file_id() will reopen
  209. * the file and return a new file identifier. In either case, the file
  210. * identifier must eventually be released using H5Fclose().
  211. *
  212. * \since 1.6.3
  213. *
  214. */
  215. H5_DLL hid_t H5Iget_file_id(hid_t id);
  216. /**
  217. * \ingroup H5I
  218. *
  219. * \brief Retrieves a name of an object based on the object identifier
  220. *
  221. * \obj_id{id}
  222. * \param[out] name A buffer for thename associated with the identifier
  223. * \param[in] size The size of the \p name buffer; usually the size of
  224. * the name in bytes plus 1 for a NULL terminator
  225. *
  226. * \return ssize_t
  227. *
  228. * \details H5Iget_name() retrieves a name for the object identified by \p id.
  229. *
  230. * \details Up to size characters of the name are returned in \p name;
  231. * additional characters, if any, are not returned to the user
  232. * application.
  233. *
  234. * If the length of the name, which determines the required value of
  235. * \p size, is unknown, a preliminary H5Iget_name() call can be made.
  236. * The return value of this call will be the size in bytes of the
  237. * object name. That value, plus 1 for a NULL terminator, is then
  238. * assigned to size for a second H5Iget_name() call, which will
  239. * retrieve the actual name.
  240. *
  241. * If the object identified by \p id is an attribute, as determined
  242. * via H5Iget_type(), H5Iget_name() retrieves the name of the object
  243. * to which that attribute is attached. To retrieve the name of the
  244. * attribute itself, use H5Aget_name().
  245. *
  246. * If there is no name associated with the object identifier or if the
  247. * name is NULL, H5Iget_name() returns 0 (zero).
  248. *
  249. * \note Note that an object in an HDF5 file may have multiple paths if there
  250. * are multiple links pointing to it. This function may return any one of
  251. * these paths. When possible, H5Iget_name() returns the path with which
  252. * the object was opened.
  253. *
  254. * \since 1.6.0
  255. *
  256. */
  257. H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size);
  258. /**
  259. * \ingroup H5I
  260. *
  261. * \brief Increments the reference count for an object
  262. *
  263. * \obj_id{id}
  264. *
  265. * \return Returns a non-negative reference count of the object ID after
  266. * incrementing it if successful; otherwise a negative value is
  267. * returned.
  268. *
  269. * \details H5Iinc_ref() increments the reference count of the object
  270. * identified by \p id.
  271. *
  272. * The reference count for an object ID is attached to the information
  273. * about an object in memory and has no relation to the number of
  274. * links to an object on disk.
  275. *
  276. * The reference count for a newly created object will be 1. Reference
  277. * counts for objects may be explicitly modified with this function or
  278. * with H5Idec_ref(). When an object ID's reference count reaches
  279. * zero, the object will be closed. Calling an object ID's \c close
  280. * function decrements the reference count for the ID which normally
  281. * closes the object, but if the reference count for the ID has been
  282. * incremented with this function, the object will only be closed when
  283. * the reference count reaches zero with further calls to H5Idec_ref()
  284. * or the object ID's \c close function.
  285. *
  286. * If the object ID was created by a collective parallel call (such as
  287. * H5Dcreate(), H5Gopen(), etc.), the reference count should be
  288. * modified by all the processes which have copies of the ID.
  289. * Generally this means that group, dataset, attribute, file and named
  290. * datatype IDs should be modified by all the processes and that all
  291. * other types of IDs are safe to modify by individual processes.
  292. *
  293. * This function is of particular value when an application is
  294. * maintaining multiple copies of an object ID. The object ID can be
  295. * incremented when a copy is made. Each copy of the ID can then be
  296. * safely closed or decremented and the HDF5 object will be closed
  297. * when the reference count for that that object drops to zero.
  298. *
  299. * \since 1.6.2
  300. *
  301. */
  302. H5_DLL int H5Iinc_ref(hid_t id);
  303. /**
  304. * \ingroup H5I
  305. *
  306. * \brief Decrements the reference count for an object
  307. *
  308. * \obj_id{id}
  309. *
  310. * \return Returns a non-negative reference count of the object ID after
  311. * decrementing it, if successful; otherwise a negative value is
  312. * returned.
  313. *
  314. * \details H5Idec_ref() decrements the reference count of the object
  315. * identified by \p id.
  316. *
  317. * The reference count for an object ID is attached to the information
  318. * about an object in memory and has no relation to the number of
  319. * links to an object on disk.
  320. *
  321. * The reference count for a newly created object will be 1. Reference
  322. * counts for objects may be explicitly modified with this function or
  323. * with H5Iinc_ref(). When an object identifier’s reference count
  324. * reaches zero, the object will be closed. Calling an object
  325. * identifier’s \c close function decrements the reference count for
  326. * the identifier which normally closes the object, but if the
  327. * reference count for the identifier has been incremented with
  328. * H5Iinc_ref(), the object will only be closed when the reference
  329. * count reaches zero with further calls to this function or the
  330. * object identifier’s \c close function.
  331. *
  332. * If the object ID was created by a collective parallel call (such as
  333. * H5Dcreate(), H5Gopen(), etc.), the reference count should be
  334. * modified by all the processes which have copies of the ID.
  335. * Generally this means that group, dataset, attribute, file and named
  336. * datatype IDs should be modified by all the processes and that all
  337. * other types of IDs are safe to modify by individual processes.
  338. *
  339. * This function is of particular value when an application is
  340. * maintaining multiple copies of an object ID. The object ID can be
  341. * incremented when a copy is made. Each copy of the ID can then be
  342. * safely closed or decremented and the HDF5 object will be closed
  343. * when the reference count for that that object drops to zero.
  344. *
  345. * \since 1.6.2
  346. *
  347. */
  348. H5_DLL int H5Idec_ref(hid_t id);
  349. /**
  350. * \ingroup H5I
  351. *
  352. * \brief Retrieves the reference count for an object
  353. *
  354. * \obj_id{id}
  355. *
  356. * \return Returns a non-negative current reference count of the object
  357. * identifier if successful; otherwise a negative value is returned.
  358. *
  359. * \details H5Iget_ref() retrieves the reference count of the object identified
  360. * by \p id.
  361. *
  362. * The reference count for an object identifier is attached to the
  363. * information about an object in memory and has no relation to the
  364. * number of links to an object on disk.
  365. *
  366. * The function H5Iis_valid() is used to determine whether a specific
  367. * object identifier is valid.
  368. *
  369. * \since 1.6.2
  370. *
  371. */
  372. H5_DLL int H5Iget_ref(hid_t id);
  373. /**
  374. * \ingroup H5IUD
  375. *
  376. * \brief Creates and returns a new ID type
  377. *
  378. * \param[in] hash_size Minimum hash table size (in entries) used to store IDs
  379. * for the new type
  380. * \param[in] reserved Number of reserved IDs for the new type
  381. * \param[in] free_func Function used to deallocate space for a single ID
  382. *
  383. * \return Returns the type identifier on success, negative on failure.
  384. *
  385. * \details H5Iregister_type() allocates space for a new ID type and returns an
  386. * identifier for it.
  387. *
  388. * The \p hash_size parameter indicates the minimum size of the hash
  389. * table used to store IDs in the new type.
  390. *
  391. * The \p reserved parameter indicates the number of IDs in this new
  392. * type to be reserved. Reserved IDs are valid IDs which are not
  393. * associated with any storage within the library.
  394. *
  395. * The \p free_func parameter is a function pointer to a function
  396. * which returns an herr_t and accepts a \c void*. The purpose of this
  397. * function is to deallocate memory for a single ID. It will be called
  398. * by H5Iclear_type() and H5Idestroy_type() on each ID. This function
  399. * is NOT called by H5Iremove_verify(). The \c void* will be the same
  400. * pointer which was passed in to the H5Iregister() function. The \p
  401. * free_func function should return 0 on success and -1 on failure.
  402. *
  403. */
  404. H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
  405. /**
  406. * \ingroup H5IUD
  407. *
  408. * \brief Deletes all identifiers of the given type
  409. *
  410. * \param[in] type Identifier of identifier type which is to be cleared of identifiers
  411. * \param[in] force Whether or not to force deletion of all identifiers
  412. *
  413. * \return \herr_t
  414. *
  415. * \details H5Iclear_type() deletes all identifiers of the type identified by
  416. * the argument \p type.
  417. *
  418. * The identifier type's free function is first called on all of these
  419. * identifiers to free their memory, then they are removed from the
  420. * type.
  421. *
  422. * If the \p force flag is set to false, only those identifiers whose
  423. * reference counts are equal to 1 will be deleted, and all other
  424. * identifiers will be entirely unchanged. If the force flag is true,
  425. * all identifiers of this type will be deleted.
  426. *
  427. */
  428. H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
  429. /**
  430. * \ingroup H5IUD
  431. *
  432. * \brief Removes an identifier type and all identifiers within that type
  433. *
  434. * \param[in] type Identifier of identifier type which is to be destroyed
  435. *
  436. * \return \herr_t
  437. *
  438. * \details H5Idestroy_type deletes an entire identifier type \p type. All
  439. * identifiers of this type are destroyed and no new identifiers of
  440. * this type can be registered.
  441. *
  442. * The type’s free function is called on all of the identifiers which
  443. * are deleted by this function, freeing their memory. In addition,
  444. * all memory used by this type’s hash table is freed.
  445. *
  446. * Since the H5I_type_t values of destroyed identifier types are
  447. * reused when new types are registered, it is a good idea to set the
  448. * variable holding the value of the destroyed type to #H5I_UNINIT.
  449. *
  450. */
  451. H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
  452. /**
  453. * \ingroup H5IUD
  454. *
  455. * \brief Increments the reference count on an ID type
  456. *
  457. * \param[in] type The identifier of the type whose reference count is to be incremented
  458. *
  459. * \return Returns the current reference count on success, negative on failure.
  460. *
  461. * \details H5Iinc_type_ref() increments the reference count on an ID type. The
  462. * reference count is used by the library to indicate when an ID type
  463. * can be destroyed.
  464. *
  465. * The type parameter is the identifier for the ID type whose
  466. * reference count is to be incremented. This identifier must have
  467. * been created by a call to H5Iregister_type().
  468. *
  469. */
  470. H5_DLL int H5Iinc_type_ref(H5I_type_t type);
  471. /**
  472. * \ingroup H5IUD
  473. *
  474. * \brief Decrements the reference count on an identifier type
  475. *
  476. * \param[in] type The identifier of the type whose reference count is to be decremented
  477. *
  478. * \return Returns the current reference count on success, negative on failure.
  479. *
  480. * \details H5Idec_type_ref() decrements the reference count on an identifier
  481. * type. The reference count is used by the library to indicate when
  482. * an identifier type can be destroyed. If the reference count reaches
  483. * zero, this function will destroy it.
  484. *
  485. * The type parameter is the identifier for the identifier type whose
  486. * reference count is to be decremented. This identifier must have
  487. * been created by a call to H5Iregister_type().
  488. *
  489. */
  490. H5_DLL int H5Idec_type_ref(H5I_type_t type);
  491. /**
  492. * \ingroup H5IUD
  493. *
  494. * \brief Retrieves the reference count on an ID type
  495. *
  496. * \param[in] type The identifier of the type whose reference count is to be retrieved
  497. *
  498. * \return Returns the current reference count on success, negative on failure.
  499. *
  500. * \details H5Iget_type_ref() retrieves the reference count on an ID type. The
  501. * reference count is used by the library to indicate when an ID type
  502. * can be destroyed.
  503. *
  504. * The type parameter is the identifier for the ID type whose
  505. * reference count is to be retrieved. This identifier must have been
  506. * created by a call to H5Iregister_type().
  507. *
  508. */
  509. H5_DLL int H5Iget_type_ref(H5I_type_t type);
  510. /**
  511. * \ingroup H5IUD
  512. *
  513. * \brief Finds the memory referred to by an ID within the given ID type such
  514. * that some criterion is satisfied
  515. *
  516. * \param[in] type The identifier of the type to be searched
  517. * \param[in] func The function defining the search criteria
  518. * \param[in] key A key for the search function
  519. *
  520. * \return Returns a pointer to the object which satisfies the search function
  521. * on success, NULL on failure.
  522. *
  523. * \details H5Isearch() searches through a given ID type to find an object that
  524. * satisfies the criteria defined by \p func. If such an object is
  525. * found, the pointer to the memory containing this object is
  526. * returned. Otherwise, NULL is returned. To do this, \p func is
  527. * called on every member of type \p type. The first member to satisfy
  528. * \p func is returned.
  529. *
  530. * The \p type parameter is the identifier for the ID type which is to
  531. * be searched. This identifier must have been created by a call to
  532. * H5Iregister_type().
  533. *
  534. * The parameter \p func is a function pointer to a function which
  535. * takes three parameters. The first parameter is a \c void* and will
  536. * be a pointer to the object to be tested. This is the same object
  537. * that was placed in storage using H5Iregister(). The second
  538. * parameter is a hid_t and is the ID of the object to be tested. The
  539. * last parameter is a \c void*. This is the \p key parameter and can
  540. * be used however the user finds helpful, or it can be ignored if it
  541. * is not needed. \p func returns 0 if the object it is testing does
  542. * not pass its criteria. A non-zero value should be returned if the
  543. * object does pass its criteria. H5I_search_func_t is defined in
  544. * H5Ipublic.h and is shown below.
  545. * \snippet this H5I_search_func_t_snip
  546. * The \p key parameter will be passed to the search function as a
  547. * parameter. It can be used to further define the search at run-time.
  548. *
  549. */
  550. H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
  551. /**
  552. * \ingroup H5IUD
  553. *
  554. * \brief Calls a callback for each member of the identifier type specified
  555. *
  556. * \param[in] type The identifier type
  557. * \param[in] op The callback function
  558. * \param[in,out] op_data The data for the callback function
  559. *
  560. * \return The last value returned by \p op
  561. *
  562. * \details H5Iiterate() calls the callback function \p op for each member of
  563. * the identifier type \p type. The callback function type for \p op,
  564. * H5I_iterate_func_t, is defined in H5Ipublic.h as:
  565. * \snippet this H5I_iterate_func_t_snip
  566. * \p op takes as parameters the identifier and a pass through of
  567. * \p op_data, and returns an herr_t.
  568. *
  569. * A positive return from op will cause the iteration to stop and
  570. * H5Iiterate() will return the value returned by \p op. A negative
  571. * return from \p op will cause the iteration to stop and H5Iiterate()
  572. * will return failure. A zero return from \p op will allow iteration
  573. * to continue, as long as there are other identifiers remaining in
  574. * type.
  575. *
  576. * \since 1.12.0
  577. *
  578. */
  579. H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
  580. /**
  581. * \ingroup H5IUD
  582. *
  583. * \brief Returns the number of identifiers in a given identifier type
  584. *
  585. * \param[in] type The identifier type
  586. * \param[out] num_members Number of identifiers of the specified identifier type
  587. *
  588. * \return \herr_t
  589. *
  590. * \details H5Inmembers() returns the number of identifiers of the identifier
  591. * type specified in \p type.
  592. *
  593. * The number of identifiers is returned in \p num_members. If no
  594. * identifiers of this type have been registered, the type does not
  595. * exist, or it has been destroyed, \p num_members is returned with
  596. * the value 0.
  597. *
  598. */
  599. H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members);
  600. /**
  601. * \ingroup H5IUD
  602. *
  603. * \brief Determines whether an identifier type is registered
  604. *
  605. * \param[in] type Identifier type
  606. *
  607. * \return \htri_t
  608. *
  609. * \details H5Itype_exists() determines whether the given identifier type,
  610. * \p type, is registered with the library.
  611. *
  612. * \since 1.8.0
  613. *
  614. */
  615. H5_DLL htri_t H5Itype_exists(H5I_type_t type);
  616. /**
  617. * \ingroup H5I
  618. *
  619. * \brief Determines whether an identifier is valid
  620. *
  621. * \obj_id{id}
  622. *
  623. * \return \htri_t
  624. *
  625. * \details H5Iis_valid() determines whether the identifier \p id is valid.
  626. *
  627. * \details Valid identifiers are those that have been obtained by an
  628. * application and can still be used to access the original target.
  629. * Examples of invalid identifiers include:
  630. * \li Out of range values: negative, for example
  631. * \li Previously-valid identifiers that have been released:
  632. * for example, a dataset identifier for which the dataset has
  633. * been closed
  634. *
  635. * H5Iis_valid() can be used with any type of identifier: object
  636. * identifier, property list identifier, attribute identifier, error
  637. * message identifier, etc. When necessary, a call to H5Iget_type()
  638. * can determine the type of the object that \p id identifies.
  639. *
  640. * \since 1.8.3
  641. *
  642. */
  643. H5_DLL htri_t H5Iis_valid(hid_t id);
  644. #ifdef __cplusplus
  645. }
  646. #endif
  647. #endif /* H5Ipublic_H */