![]() |
|
|||
File indexing completed on 2025-04-18 09:16:03
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 * 0015 * Created: H5Opublic.h 0016 * 0017 * Purpose: Public declarations for the H5O (object header) 0018 * package 0019 * 0020 *------------------------------------------------------------------------- 0021 */ 0022 #ifndef H5Opublic_H 0023 #define H5Opublic_H 0024 0025 #include "H5public.h" /* Generic Functions */ 0026 #include "H5Ipublic.h" /* Identifiers */ 0027 0028 /*****************/ 0029 /* Public Macros */ 0030 /*****************/ 0031 0032 /* Flags for object copy (H5Ocopy) */ 0033 #define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /**< Copy only immediate members */ 0034 #define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /**< Expand soft links into new objects */ 0035 #define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /**< Expand external links into new objects */ 0036 #define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /**< Copy objects that are pointed by references */ 0037 #define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /**< Copy object without copying attributes */ 0038 #define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /**< Copy NULL messages (empty space) */ 0039 #define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /**< Merge committed datatypes in dest file */ 0040 #define H5O_COPY_ALL (0x007Fu) /**< All object copying flags (for internal checking) */ 0041 0042 /* Flags for shared message indexes. 0043 * Pass these flags in using the mesg_type_flags parameter in 0044 * H5P_set_shared_mesg_index. 0045 * (Developers: These flags correspond to object header message type IDs, 0046 * but we need to assign each kind of message to a different bit so that 0047 * one index can hold multiple types.) 0048 */ 0049 #define H5O_SHMESG_NONE_FLAG 0x0000 /**< No shared messages */ 0050 #define H5O_SHMESG_SDSPACE_FLAG ((unsigned)1 << 0x0001) /**< Simple Dataspace Message. */ 0051 #define H5O_SHMESG_DTYPE_FLAG ((unsigned)1 << 0x0003) /**< Datatype Message. */ 0052 #define H5O_SHMESG_FILL_FLAG ((unsigned)1 << 0x0005) /**< Fill Value Message. */ 0053 #define H5O_SHMESG_PLINE_FLAG ((unsigned)1 << 0x000b) /**< Filter pipeline message. */ 0054 #define H5O_SHMESG_ATTR_FLAG ((unsigned)1 << 0x000c) /**< Attribute Message. */ 0055 #define H5O_SHMESG_ALL_FLAG \ 0056 (H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | \ 0057 H5O_SHMESG_ATTR_FLAG) 0058 0059 /* clang-format off */ 0060 /* Object header status flag definitions */ 0061 #define H5O_HDR_CHUNK0_SIZE 0x03 /**< 2-bit field indicating # of bytes to store the size of chunk 0's data */ 0062 #define H5O_HDR_ATTR_CRT_ORDER_TRACKED 0x04 /**< Attribute creation order is tracked */ 0063 #define H5O_HDR_ATTR_CRT_ORDER_INDEXED 0x08 /**< Attribute creation order has index */ 0064 #define H5O_HDR_ATTR_STORE_PHASE_CHANGE 0x10 /**< Non-default attribute storage phase change values stored */ 0065 #define H5O_HDR_STORE_TIMES 0x20 /**< Store access, modification, change & birth times for object */ 0066 #define H5O_HDR_ALL_FLAGS \ 0067 (H5O_HDR_CHUNK0_SIZE | H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | \ 0068 H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES) 0069 /* clang-format on */ 0070 0071 /* Maximum shared message values. Number of indexes is 8 to allow room to add 0072 * new types of messages. 0073 */ 0074 #define H5O_SHMESG_MAX_NINDEXES 8 0075 #define H5O_SHMESG_MAX_LIST_SIZE 5000 0076 0077 /* Flags for H5Oget_info. 0078 * These flags determine which fields will be filled in the H5O_info_t 0079 * struct. 0080 */ 0081 #define H5O_INFO_BASIC 0x0001u /**< Fill in the fileno, addr, type, and rc fields */ 0082 #define H5O_INFO_TIME 0x0002u /**< Fill in the atime, mtime, ctime, and btime fields */ 0083 #define H5O_INFO_NUM_ATTRS 0x0004u /**< Fill in the num_attrs field */ 0084 #define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS) 0085 0086 //! <!-- [H5O_native_info_fields_snip] --> 0087 /** 0088 * Flags for H5Oget_native_info(). These flags determine which fields will be 0089 * filled in the \ref H5O_native_info_t struct. 0090 */ 0091 #define H5O_NATIVE_INFO_HDR 0x0008u /**< Fill in the hdr field */ 0092 #define H5O_NATIVE_INFO_META_SIZE 0x0010u /**< Fill in the meta_size field */ 0093 #define H5O_NATIVE_INFO_ALL (H5O_NATIVE_INFO_HDR | H5O_NATIVE_INFO_META_SIZE) 0094 //! <!-- [H5O_native_info_fields_snip] --> 0095 0096 /* Convenience macro to check if the token is the 'undefined' token value */ 0097 #define H5O_IS_TOKEN_UNDEF(token) (!memcmp(&(token), &(H5O_TOKEN_UNDEF), sizeof(H5O_token_t))) 0098 0099 /*******************/ 0100 /* Public Typedefs */ 0101 /*******************/ 0102 0103 //! <!-- [H5O_type_t_snip] --> 0104 /** 0105 * Types of objects in file 0106 */ 0107 typedef enum H5O_type_t { 0108 H5O_TYPE_UNKNOWN = -1, /**< Unknown object type */ 0109 H5O_TYPE_GROUP, /**< Object is a group */ 0110 H5O_TYPE_DATASET, /**< Object is a dataset */ 0111 H5O_TYPE_NAMED_DATATYPE, /**< Object is a named data type */ 0112 H5O_TYPE_MAP, /**< Object is a map */ 0113 H5O_TYPE_NTYPES /**< Number of different object types (must be last!) */ 0114 } H5O_type_t; 0115 //! <!-- [H5O_type_t_snip] --> 0116 0117 //! <!-- [H5O_hdr_info_t_snip] --> 0118 /** 0119 * Information struct for object header metadata (for 0120 * H5Oget_info(), H5Oget_info_by_name(), H5Oget_info_by_idx()) 0121 */ 0122 typedef struct H5O_hdr_info_t { 0123 unsigned version; /**< Version number of header format in file */ 0124 unsigned nmesgs; /**< Number of object header messages */ 0125 unsigned nchunks; /**< Number of object header chunks */ 0126 unsigned flags; /**< Object header status flags */ 0127 struct { 0128 hsize_t total; /**< Total space for storing object header in file */ 0129 hsize_t meta; /**< Space within header for object header metadata information */ 0130 hsize_t mesg; /**< Space within header for actual message information */ 0131 hsize_t free; /**< Free space within object header */ 0132 } space; 0133 struct { 0134 uint64_t present; /**< Flags to indicate presence of message type in header */ 0135 uint64_t shared; /**< Flags to indicate message type is shared in header */ 0136 } mesg; 0137 } H5O_hdr_info_t; 0138 //! <!-- [H5O_hdr_info_t_snip] --> 0139 0140 //! <!-- [H5O_info2_t_snip] --> 0141 /** 0142 * Data model information struct for objects 0143 * (For H5Oget_info(), H5Oget_info_by_name(), H5Oget_info_by_idx() version 3) 0144 */ 0145 typedef struct H5O_info2_t { 0146 unsigned long 0147 fileno; /**< File number that object is located in. Constant across multiple opens of the same file */ 0148 H5O_token_t token; /**< Token representing the object */ 0149 H5O_type_t type; /**< Basic object type (group, dataset, etc.) */ 0150 unsigned rc; /**< Reference count of object */ 0151 time_t atime; /**< Access time */ 0152 time_t mtime; /**< Modification time */ 0153 time_t ctime; /**< Change time */ 0154 time_t btime; /**< Birth time */ 0155 hsize_t num_attrs; /**< Number of attributes attached to object */ 0156 } H5O_info2_t; 0157 //! <!-- [H5O_info2_t_snip] --> 0158 0159 //! <!-- [H5O_native_info_t_snip] --> 0160 /** 0161 * Native file format information struct for objects. 0162 * (For H5Oget_native_info(), H5Oget_native_info_by_name(), H5Oget_native_info_by_idx()) 0163 */ 0164 typedef struct H5O_native_info_t { 0165 H5O_hdr_info_t hdr; /**< Object header information */ 0166 struct { 0167 H5_ih_info_t obj; /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ 0168 H5_ih_info_t attr; /**< v2 B-tree & heap for attributes */ 0169 } meta_size; /**< Extra metadata storage for obj & attributes */ 0170 } H5O_native_info_t; 0171 //! <!-- [H5O_native_info_t_snip] --> 0172 0173 /** 0174 * Typedef for message creation indexes 0175 */ 0176 typedef uint32_t H5O_msg_crt_idx_t; 0177 0178 //! <!-- [H5O_iterate2_t_snip] --> 0179 /** 0180 * Prototype for H5Ovisit(), H5Ovisit_by_name() operator (version 3) 0181 * 0182 * \param[in] obj Object that serves as the root of the iteration; 0183 * the same value as the H5Ovisit3() \c obj_id parameter 0184 * \param[in] name Name of object, relative to \p obj, being examined at current 0185 * step of the iteration 0186 * \param[out] info Information about that object 0187 * \param[in,out] op_data User-defined pointer to data required by the application 0188 * in processing the object; a pass-through of the \c op_data 0189 * pointer provided with the H5Ovisit3() function call 0190 * \return \herr_t_iter 0191 * 0192 * \since 1.12.0 0193 * 0194 */ 0195 typedef herr_t (*H5O_iterate2_t)(hid_t obj, const char *name, const H5O_info2_t *info, void *op_data); 0196 //! <!-- [H5O_iterate2_t_snip] --> 0197 0198 //! <!-- [H5O_mcdt_search_ret_t_snip] --> 0199 typedef enum H5O_mcdt_search_ret_t { 0200 H5O_MCDT_SEARCH_ERROR = -1, /**< Abort H5Ocopy */ 0201 H5O_MCDT_SEARCH_CONT, /**< Continue the global search of all committed datatypes in the destination file 0202 */ 0203 H5O_MCDT_SEARCH_STOP /**< Stop the search, but continue copying. The committed datatype will be copied 0204 but not merged. */ 0205 } H5O_mcdt_search_ret_t; 0206 //! <!-- [H5O_mcdt_search_ret_t_snip] --> 0207 0208 //! <!-- [H5O_mcdt_search_cb_t_snip] --> 0209 /** 0210 * Callback to invoke when completing the search for a matching committed 0211 * datatype from the committed dtype list 0212 */ 0213 typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data); 0214 //! <!-- [H5O_mcdt_search_cb_t_snip] --> 0215 0216 /********************/ 0217 /* Public Variables */ 0218 /********************/ 0219 0220 /*********************/ 0221 /* Public Prototypes */ 0222 /*********************/ 0223 #ifdef __cplusplus 0224 extern "C" { 0225 #endif 0226 0227 /** 0228 *------------------------------------------------------------------------- 0229 * \ingroup H5O 0230 * 0231 * \brief Opens an object in an HDF5 file by location identifier and path name. 0232 * 0233 * \fgdta_loc_obj_id{loc_id} 0234 * \param[in] name Path to the object; relative to \p loc_id 0235 * \lapl_id 0236 * 0237 * \return \hid_ti{object} 0238 * 0239 * \details H5Oopen() opens a group, dataset, or committed (named) datatype 0240 * specified by a location, \p loc_id, and a path name, \p name, in an HDF5 file. 0241 * 0242 * This function opens the object in the same manner as H5Gopen(), H5Topen(), and H5Dopen(). 0243 * However, H5Oopen() does not require the type of object to be known beforehand. 0244 * This can be useful with user-defined links, for instance, when only a path may be known. 0245 * 0246 * H5Oopen() cannot be used to open a dataspace, attribute, property list, or file. 0247 * 0248 * Once an object of an unknown type has been opened with H5Oopen(), 0249 * the type of that object can be determined by means of an H5Iget_type() call. 0250 * 0251 * \p loc_id may be a file, group, dataset, named datatype, or attribute. 0252 * If an attribute is specified for \p loc_id then the object where the 0253 * attribute is attached will be accessed. 0254 * 0255 * \p name must be the path to that object relative to \p loc_id. 0256 * 0257 * \p lapl_id is the link access property list associated with the link pointing to 0258 * the object. If default link access properties are appropriate, this can be 0259 * passed in as #H5P_DEFAULT. 0260 * 0261 * When it is no longer needed, the opened object should be closed with 0262 * H5Oclose(), H5Gclose(), H5Tclose(), or H5Dclose(). 0263 * 0264 * \version 1.8.1 Fortran subroutine introduced in this release. 0265 * 0266 * \since 1.8.0 0267 * 0268 */ 0269 H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id); 0270 /** 0271 * -------------------------------------------------------------------------- 0272 * \ingroup ASYNC 0273 * \async_variant_of{H5Oopen} 0274 */ 0275 #ifndef H5_DOXYGEN 0276 H5_DLL hid_t H5Oopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id, 0277 const char *name, hid_t lapl_id, hid_t es_id); 0278 #else 0279 H5_DLL hid_t H5Oopen_async(hid_t loc_id, const char *name, hid_t lapl_id, hid_t es_id); 0280 #endif 0281 0282 /** 0283 *------------------------------------------------------------------------- 0284 * \ingroup H5O 0285 * 0286 * \brief Opens an object in an HDF5 file using its VOL independent token 0287 * 0288 * \fgdta_loc_obj_id{loc_id} 0289 * \param[in] token Object token 0290 * 0291 * \return \hid_ti{object} 0292 * 0293 * \details H5Oopen_by_token() opens an object specified by the object 0294 * identifier, \p loc_id and object token, \p token. 0295 * 0296 * \since 1.12.0 0297 * 0298 */ 0299 H5_DLL hid_t H5Oopen_by_token(hid_t loc_id, H5O_token_t token); 0300 0301 /** 0302 *------------------------------------------------------------------------- 0303 * \ingroup H5O 0304 * 0305 * \brief Opens the nth object in a group 0306 * 0307 * \fgdta_loc_obj_id{loc_id} 0308 * \param[in] group_name Name of group, relative to \p loc_id, in which object is located 0309 * \idx_type 0310 * \order 0311 * \param[in] n Object to open 0312 * \lapl_id 0313 * 0314 * \return \hid_ti{object} 0315 * 0316 * \details H5Oopen_by_idx() opens the nth object in the group specified by \p loc_id 0317 * and \p group_name. 0318 * 0319 * \p loc_id specifies a location identifier. 0320 * \p group_name specifies the group relative to \p loc_id in which the object can be found. 0321 * If \p loc_id fully specifies the group in which the object resides, 0322 * \p group_name can be a dot (.). 0323 * 0324 * The specific object to be opened within the group is specified by the three parameters: 0325 * \p idx_type, \p order and \p n. 0326 * 0327 * \p idx_type specifies the type of index by which objects are ordered. 0328 * Valid index types include the following: 0329 * 0330 * \indexes 0331 * 0332 * \p order specifies the order in which the objects are to be referenced for the purposes 0333 * of this function. Valid orders include the following: 0334 * 0335 * \orders 0336 * 0337 * Note that for #H5_ITER_NATIVE, rather than implying a particular order, 0338 * it instructs the HDF5 library to iterate through the objects in the fastest 0339 * available order, i.e., in a natural order. 0340 * 0341 * \p n specifies the position of the object within the index. Note that this count is 0342 * zero-based; 0 (zero) indicates that the function will return the value of the first object; 0343 * if \p n is 5, the function will return the value of the sixth object; etc. 0344 * 0345 * \p lapl_id specifies the link access property list to be used in accessing the object. 0346 * 0347 * An object opened with this function should be closed when it is no longer needed so that 0348 * resource leaks will not develop. H5Oclose() can be used to close groups, datasets, 0349 * or committed datatypes. 0350 * 0351 * \version 1.8.1 Fortran subroutine introduced in this release. 0352 * 0353 * \since 1.8.0 0354 * 0355 */ 0356 H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, 0357 hsize_t n, hid_t lapl_id); 0358 /** 0359 * -------------------------------------------------------------------------- 0360 * \ingroup ASYNC 0361 * \async_variant_of{H5Oopen_by_idx} 0362 */ 0363 #ifndef H5_DOXYGEN 0364 H5_DLL hid_t H5Oopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id, 0365 const char *group_name, H5_index_t idx_type, H5_iter_order_t order, 0366 hsize_t n, hid_t lapl_id, hid_t es_id); 0367 #else 0368 H5_DLL hid_t H5Oopen_by_idx_async(hid_t loc_id, const char *group_name, H5_index_t idx_type, 0369 H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t es_id); 0370 #endif 0371 0372 /** 0373 *------------------------------------------------------------------------- 0374 * \ingroup H5O 0375 * 0376 * \brief Determines whether a link resolves to an actual object. 0377 * 0378 * \fgdta_loc_obj_id{loc_id} 0379 * \param[in] name The name of the link to check 0380 * \lapl_id 0381 * 0382 * \return Returns a positive value if the object pointed to by 0383 * the \p loc_id and \p name combination exists. 0384 * \return Returns 0 if the object pointed to by 0385 * the \p loc_id and \p name combination does not exist. 0386 * \return Returns a negative value when the function fails. 0387 * 0388 * \details H5Oexists_by_name() allows an application to determine whether 0389 * the link \p name in the group or file specified with \p loc_id 0390 * resolves to an HDF5 object to open or if the link dangles. The 0391 * link may be of any type, but hard links will always resolve 0392 * to objects and do not need to be verified. 0393 * 0394 * Note that H5Oexists_by_name() verifies only that the target 0395 * object exists. If \p name includes either a relative path or 0396 * an absolute path to the target link, intermediate steps 0397 * along the path must be verified before the existence of 0398 * the target link can be safely checked. If the path is not 0399 * verified and an intermediate element of the path does not 0400 * exist, H5Oexists_by_name() will fail. The example in the next 0401 * paragraph illustrates one step-by-step method for verifying 0402 * the existence of a link with a relative or absolute path. 0403 * 0404 * \par Example 0405 * Use the following steps to verify the existence of 0406 * the link \c datasetD in the \c group group1/group2/softlink_to_group3/, 0407 * where \c group1 is a member of the group specified by \c loc_id: 0408 * 0409 * \par 0410 * - First, use H5Lexists() to verify that a link named \c group1 exists. 0411 * - If \c group1 exists, use H5Oexists_by_name() to verify that the 0412 * link \c group1 resolves to an object. 0413 * - If \c group1 exists, use H5Lexists() again, this time with the name 0414 * set to \c group1/group2, to verify that the link \c group2 exists 0415 * in \c group1. 0416 * - If the \c group2 link exists, use H5Oexists_by_name() to verify 0417 * that \c group1/group2 resolves to an object. 0418 * - If \c group2 exists, use H5Lexists() again, this time with the name 0419 * set to \c group1/group2/softlink_to_group3, to verify that the 0420 * link \c softlink_to_group3 exists in \c group2. 0421 * - If the \c softlink_to_group3 link exists, use H5Oexists_by_name() 0422 * to verify that \c group1/group2/softlink_to_group3 resolves to 0423 * an object. 0424 * - If \c softlink_to_group3 exists, you can now safely use H5Lexists 0425 * with the name set to \c group1/group2/softlink_to_group3/datasetD to 0426 * verify that the target link, \c datasetD, exists. 0427 * - And finally, if the link \c datasetD exists, use H5Oexists_by_name 0428 * to verify that \c group1/group2/softlink_to_group3/datasetD 0429 * resolves to an object. 0430 * 0431 * \par 0432 * If the link to be verified is specified with an absolute path, 0433 * the same approach should be used, but starting with the first 0434 * link in the file's root group. For instance, if \c datasetD 0435 * were in \c /group1/group2/softlink_to_group3, the first call to 0436 * H5Lexists() would have name set to \c /group1. 0437 * 0438 * \par 0439 * Note that this is an outline and does not include all the necessary 0440 * details. Depending on circumstances, for example, an application 0441 * may need to verify the type of an object also. 0442 * 0443 * \warning \Bold{Failure Modes:} 0444 * \warning If \p loc_id and \p name both exist, but the combination does not 0445 * resolve to an object, the function will return 0 (zero); 0446 * the function does not fail in this case. 0447 * \warning If either the location or the link specified by the \p loc_id 0448 * and \p name combination does not exist, the function will fail, 0449 * returning a negative value. 0450 * \warning Note that verifying the existence of an object within an HDF5 0451 * file is a multistep process. An application can be certain the 0452 * object does not exist only if H5Lexists() and H5Oexists_by_name() 0453 * have been used to verify the existence of the links and groups 0454 * in the hierarchy above that object. The example above, in the 0455 * function description, provides a step-by-step description of 0456 * that verification process. 0457 * 0458 * \version 1.8.11 Fortran subroutine introduced in this release. 0459 * 0460 * \since 1.8.5 0461 * 0462 */ 0463 H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id); 0464 0465 /** 0466 *------------------------------------------------------------------------- 0467 * \ingroup H5O 0468 * 0469 * \brief Retrieves the metadata for an object specified by an identifier 0470 * 0471 * \fgdta_loc_obj_id{loc_id} 0472 * \param[out] oinfo Buffer in which to return object information 0473 * \param[in] fields Flags specifying the fields to include in \p oinfo 0474 * 0475 * \return \herr_t 0476 * 0477 * \details H5Oget_info3() specifies an object by its identifier, \p loc_id , and 0478 * retrieves the metadata describing that object in \p oinfo. 0479 * 0480 * The \p fields parameter contains flags to determine which fields will be filled in 0481 * the H5O_info2_t \c struct returned in \p oinfo. 0482 * These flags are defined in the H5Opublic.h file: 0483 * 0484 * \obj_info_fields 0485 * 0486 * \par Example 0487 * An example snippet from examples/h5_attribute.c: 0488 * \par 0489 * \snippet h5_attribute.c H5Oget_info3_snip 0490 * 0491 * \note If you are iterating through a lot of different objects to 0492 * retrieve information via the H5Oget_info() family of routines, 0493 * you may see memory building up. This can be due to memory 0494 * allocation for metadata, such as object headers and messages, 0495 * when the iterated objects are put into the metadata cache. 0496 * \note 0497 * If the memory buildup is not desirable, you can configure a 0498 * smaller cache via H5Fset_mdc_config() or set the file access 0499 * property list via H5Pset_mdc_config(). A smaller sized cache 0500 * will force metadata entries to be evicted from the cache, 0501 * thus freeing the memory associated with the entries. 0502 * 0503 * \since 1.12.0 0504 * 0505 */ 0506 H5_DLL herr_t H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields); 0507 0508 /** 0509 *------------------------------------------------------------------------- 0510 * \ingroup H5O 0511 * 0512 * \brief Retrieves the metadata for an object, identifying the object by 0513 * location and relative name 0514 * 0515 * \fgdta_loc_obj_id{loc_id} 0516 * \param[in] name Name of object, relative to \p loc_id 0517 * \param[out] oinfo Buffer in which to return object information 0518 * \param[in] fields Flags specifying the fields to include in \p oinfo 0519 * \lapl_id 0520 * 0521 * \return \herr_t 0522 * 0523 * \details H5Oget_info_by_name3() specifies an object's location and name, 0524 * \p loc_id and \p name, respectively, and retrieves the metadata 0525 * describing that object in \p oinfo, an H5O_info2_t struct. 0526 * 0527 * The \p fields parameter contains flags to determine which fields will be filled in 0528 * the H5O_info2_t \c struct returned in \p oinfo. 0529 * These flags are defined in the H5Opublic.h file: 0530 * 0531 * \obj_info_fields 0532 * 0533 * The link access property list, \c lapl_id, is not currently used; 0534 * it should be passed in as #H5P_DEFAULT. 0535 * 0536 * \par Example 0537 * An example snippet from test/vol.c: 0538 * \snippet vol.c H5Oget_info_by_name3_snip 0539 * 0540 * \since 1.12.0 0541 * 0542 */ 0543 H5_DLL herr_t H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo, unsigned fields, 0544 hid_t lapl_id); 0545 /** 0546 * -------------------------------------------------------------------------- 0547 * \ingroup ASYNC 0548 * \async_variant_of{H5Oget_info_by_name} 0549 */ 0550 #ifndef H5_DOXYGEN 0551 H5_DLL herr_t H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned app_line, 0552 hid_t loc_id, const char *name, H5O_info2_t *oinfo /*out*/, 0553 unsigned fields, hid_t lapl_id, hid_t es_id); 0554 #else 0555 H5_DLL herr_t H5Oget_info_by_name_async(hid_t loc_id, const char *name, H5O_info2_t *oinfo /*out*/, 0556 unsigned fields, hid_t lapl_id, hid_t es_id); 0557 #endif 0558 0559 /** 0560 *------------------------------------------------------------------------- 0561 * \ingroup H5O 0562 * 0563 * \brief Retrieves the metadata for an object, identifying the object 0564 * by an index position 0565 * 0566 * \fgdta_loc_obj_id{loc_id} 0567 * \param[in] group_name Name of group in which object is located 0568 * \idx_type 0569 * \order 0570 * \param[in] n Position within the index 0571 * \param[out] oinfo Buffer in which to return object information 0572 * \param[in] fields Flags specifying the fields to include in \p oinfo 0573 * \lapl_id 0574 * 0575 * \return \herr_t 0576 * 0577 * \details H5Oget_info_by_idx3() retrieves the metadata describing an 0578 * object in the \c struct \p oinfo, as specified by the location, 0579 * \p loc_id, group name, \p group_name, the index by which objects 0580 * in that group are tracked, \p idx_type, the order by which the 0581 * index is to be traversed, \p order, and an object's position 0582 * \p n within that index. 0583 * 0584 * If \p loc_id fully specifies the group in which the object resides, 0585 * \p group_name can be a dot (\c .). 0586 * 0587 * The \p fields parameter contains flags to determine which fields will be filled in 0588 * the H5O_info2_t \c struct returned in \p oinfo. 0589 * These flags are defined in the H5Opublic.h file: 0590 * \obj_info_fields 0591 * 0592 * The link access property list, \c lapl_id, is not currently used; 0593 * it should be passed in as #H5P_DEFAULT. 0594 * 0595 * \par Example 0596 * An example snippet from test/titerate.c: 0597 * \snippet titerate.c H5Oget_info_by_idx3_snip 0598 * 0599 * \since 1.12.0 0600 * 0601 */ 0602 H5_DLL herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, 0603 H5_iter_order_t order, hsize_t n, H5O_info2_t *oinfo, unsigned fields, 0604 hid_t lapl_id); 0605 0606 /** 0607 *------------------------------------------------------------------------- 0608 * \ingroup H5O 0609 * 0610 * \brief Retrieve native file format information about an object 0611 * 0612 * \fgdta_loc_obj_id{loc_id} 0613 * \param[out] oinfo Buffer in which to return native object information 0614 * \param[in] fields Flags to determine which fields in \p oinfo are filled in 0615 * 0616 * \return \herr_t 0617 * 0618 * \details H5Oget_native_info() retrieves the native file format information for an object 0619 * specified by \p loc_id. 0620 * 0621 * The \p fields parameter indicates which fields to fill in 0622 * H5O_native_info_t. Possible values defined in H5Opublic.h are: 0623 * 0624 * \snippet this H5O_native_info_fields_snip 0625 * 0626 * \par Example 0627 * An example snippet from test/tfile.c: 0628 * \par 0629 * \snippet tfile.c H5Oget_native_info_snip 0630 * 0631 * \since 1.12.0 0632 * 0633 */ 0634 H5_DLL herr_t H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo, unsigned fields); 0635 0636 /** 0637 *------------------------------------------------------------------------- 0638 * \ingroup H5O 0639 * 0640 * \brief Retrieve native file format information about an object given its name 0641 * 0642 * \fgdta_loc_obj_id{loc_id} 0643 * \param[in] name Name of object 0644 * \param[out] oinfo Buffer in which to return native object information 0645 * \param[in] fields Flags to determine which fields in \p oinfo are filled in 0646 * \lapl_id 0647 * 0648 * \return \herr_t 0649 * 0650 * \details H5Oget_native_info_by_name() retrieves the native file format 0651 * information for an object specified by \p loc_id and the name \p 0652 * name. 0653 * 0654 * The \p fields parameter which fields to fill in H5O_native_info_t. 0655 * Possible values defined in H5Opublic.h are: 0656 * 0657 * \snippet this H5O_native_info_fields_snip 0658 * 0659 * \par Example 0660 * An example snippet from test/tfile.c: 0661 * \snippet tfile.c H5Oget_native_info_by_name_snip 0662 * 0663 * \since 1.12.0 0664 * 0665 */ 0666 H5_DLL herr_t H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oinfo, 0667 unsigned fields, hid_t lapl_id); 0668 0669 /** 0670 *------------------------------------------------------------------------- 0671 * \ingroup H5O 0672 * 0673 * \brief Retrieve native file format information about an object 0674 * according to the order of an index 0675 * 0676 * \fgdta_loc_obj_id{loc_id} 0677 * \param[in] group_name Name of group in which object is located 0678 * \idx_type 0679 * \order 0680 * \param[in] n Position within the index 0681 * \param[out] oinfo Buffer in which to return native object information 0682 * \param[in] fields Flags to determine which fields in \p oinfo are filled in 0683 * \lapl_id 0684 * 0685 * \return \herr_t 0686 * 0687 * \details H5Oget_native_info_by_idx() retrieves the native file format information for an object 0688 * specified by \p loc_id, group name, \p group_name, the index by which 0689 * objects in the group are tracked, \p idx_type, the order by which 0690 * the index is to be traversed, \p order , and an object's position 0691 * \p n within that index. 0692 * 0693 * The \p fields parameter indicates which fields to fill in H5O_native_info_t. 0694 * Possible values defined in H5Opublic.h are: 0695 * \snippet this H5O_native_info_fields_snip 0696 * 0697 * The link access property list, \c lapl_id, is not currently used; 0698 * it should be passed in as #H5P_DEFAULT. 0699 * 0700 * \since 1.12.0 0701 * 0702 */ 0703 H5_DLL herr_t H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, 0704 H5_iter_order_t order, hsize_t n, H5O_native_info_t *oinfo, 0705 unsigned fields, hid_t lapl_id); 0706 0707 /** 0708 *------------------------------------------------------------------------- 0709 * \ingroup H5O 0710 * 0711 * \brief Creates a hard link to an object in an HDF5 file 0712 * 0713 * \param[in] obj_id Object to be linked 0714 * \param[in] new_loc_id Location identifier at which object is to be linked; 0715 * may be a file, group, dataset, named datatype or attribute identifier. 0716 * \param[in] new_name Name of link to be created, relative to \p new_loc_id. 0717 * \lcpl_id 0718 * \lapl_id 0719 * 0720 * \return \herr_t 0721 * 0722 * \details H5Olink() creates a new hard link to an object in an HDF5 file. 0723 * \p new_loc_id and \p \p new_link_name specify the location and name of the 0724 * new link, while \p object_id identifies the object that the link 0725 * points to. 0726 * 0727 * H5Olink() is designed for two purposes: 0728 * - To create the first hard link to an object that has just 0729 * been created with H5Dcreate_anon(), H5Gcreate_anon(), or 0730 * H5Tcommit_anon(). 0731 * - To add additional structure to an existing 0732 * file so that, for example, an object can be shared among 0733 * multiple groups. 0734 * 0735 * \p lcpl and \p lapl are the link creation and access property lists 0736 * associated with the new link. 0737 * 0738 * \par Example: 0739 * To create a new link to an object while simultaneously creating 0740 * missing intermediate groups: Suppose that an application must 0741 * create the group C with the path /A/B01/C but may not know 0742 * at run time whether the groups A and B01 exist. The following 0743 * code ensures that those groups are created if they are missing: 0744 * \par 0745 * \code 0746 * 0747 * // Creates a link creation property list (LCPL). 0748 * hid_t lcpl_id = H5Pcreate(H5P_LINK_CREATE); 0749 * 0750 * // Sets "create missing intermediate groups" property in that LCPL. 0751 * int status = H5Pset_create_intermediate_group(lcpl_id, true); 0752 * 0753 * // Creates a group without linking it into the file structure. 0754 * hid_t gid = H5Gcreate_anon(file_id, H5P_DEFAULT, H5P_DEFAULT); 0755 * 0756 * // Links group into file structure. 0757 * status = H5Olink(gid, file_id, "/A/B01/C", lcpl_id, H5P_DEFAULT); 0758 * 0759 * \endcode 0760 * 0761 * \par 0762 * Note that unless the object is intended to be temporary, 0763 * the H5O_LINK call is mandatory if an object created with one 0764 * of the H5*_CREATE_ANON functions (or with H5T_COMMIT_ANON) 0765 * is to be retained in the file; without an H5O_LINK call, 0766 * the object will not be linked into the HDF5 file structure 0767 * and will be deleted when the file is closed. 0768 * 0769 * \version 1.8.1 Fortran subroutine introduced in this release. 0770 * 0771 * \since 1.8.0 0772 * 0773 */ 0774 H5_DLL herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id); 0775 0776 /** 0777 *------------------------------------------------------------------------- 0778 * \ingroup H5O 0779 * 0780 * \brief Increments an object reference count 0781 * 0782 * \fgdta_loc_obj_id{object_id} 0783 * 0784 * \return \herr_t 0785 * 0786 * \details H5Oincr_refcount() increments the hard link reference count for an object. 0787 * It should be used any time a user-defined link that references 0788 * an object by address is added. When the link is deleted, 0789 * H5Odecr_refcount() should be used. 0790 * 0791 * An object's reference count is the number of hard links in the 0792 * file that point to that object. See the “Programming Model” 0793 * section of the HDF5 Groups chapter in the -- <em>\ref UG</em> 0794 * for a complete discussion of reference counts. 0795 * 0796 * If a user application needs to determine an object's reference 0797 * count, an H5Oget_info() call is required; the reference count 0798 * is returned in the \c rc field of the #H5O_info_t \c struct. 0799 * 0800 * \warning This function must be used with care! 0801 * \warning Improper use can lead to inaccessible data, wasted space in the file, 0802 * or <b><em>file corruption</em></b>. 0803 * 0804 * \version 1.8.11 Fortran subroutine introduced in this release. 0805 * 0806 * \since 1.8.0 0807 * 0808 */ 0809 H5_DLL herr_t H5Oincr_refcount(hid_t object_id); 0810 0811 /** 0812 *------------------------------------------------------------------------- 0813 * \ingroup H5O 0814 * 0815 * \brief Decrements an object reference count 0816 * 0817 * \fgdta_loc_obj_id{object_id} 0818 * 0819 * \return \herr_t 0820 * 0821 * \details H5Odecr_refcount() decrements the hard link reference count for an object. 0822 * It should be used any time a user-defined link that references 0823 * an object by address is deleted. In general, H5Oincr_refcount() will have 0824 * been used previously, when the link was created. 0825 * 0826 * An object's reference count is the number of hard links in the 0827 * file that point to that object. See the “Programming Model” 0828 * section of the HDF5 Groups chapter in the <em>\ref UG</em> 0829 * for a more complete discussion of reference counts. 0830 * 0831 * If a user application needs to determine an object's reference 0832 * count, an H5Oget_info() call is required; the reference count 0833 * is returned in the \c rc field of the #H5O_info_t \c struct. 0834 * 0835 * \warning This function must be used with care! 0836 * \warning Improper use can lead to inaccessible data, wasted space in the file, 0837 * or <b><em>file corruption</em></b>. 0838 * 0839 * \version 1.8.11 Fortran subroutine introduced in this release. 0840 * 0841 * \since 1.8.0 0842 * 0843 */ 0844 H5_DLL herr_t H5Odecr_refcount(hid_t object_id); 0845 0846 /** 0847 *------------------------------------------------------------------------- 0848 * \ingroup H5O 0849 * 0850 * \brief Copies an object in an HDF5 file 0851 * 0852 * \param[in] src_loc_id Object identifier indicating the location of the 0853 * source object to be copied 0854 * \param[in] src_name Name of the source object to be copied 0855 * \param[in] dst_loc_id Location identifier specifying the destination 0856 * \param[in] dst_name Name to be assigned to the new copy 0857 * \param[in] ocpypl_id Object copy property list 0858 * \lcpl_id 0859 * 0860 * \return \herr_t 0861 * 0862 * \details H5Ocopy() copies the group, dataset or committed datatype 0863 * specified by \p src_name from the file or group specified by 0864 * \p src_loc_id to the destination location \p dst_loc_id. 0865 * 0866 * The destination location, as specified in dst_loc_id, may 0867 * be a group in the current file or a location in a different 0868 * file. If dst_loc_id is a file identifier, the copy will be 0869 * placed in that file's root group. 0870 * 0871 * The copy will be created with the path specified in \p dst_name, 0872 * which must not pre-exist in the destination location. If 0873 * \p dst_name already exists at the location \p dst_loc_id, 0874 * H5Ocopy() will fail. If \p dst_name is an absolute path, 0875 * the copy will be created relative to the file's root group. 0876 * 0877 * The copy of the object is created with the property lists 0878 * specified by \p ocpypl_id and \p lcpl_id. #H5P_DEFAULT can be passed 0879 * in for these property lists. The default behavior: 0880 * 0881 * - of the link creation property list is to NOT create 0882 * intermediate groups. 0883 * - of the flags specified by the object creation property list 0884 * is described in H5Pset_copy_object(). 0885 * 0886 * These property lists or flags can be modified to govern the 0887 * behavior of H5Ocopy() as follows: 0888 * 0889 * - A flag controlling the creation of intermediate groups that 0890 * may not yet exist is set in the link creation property list 0891 * \p lcpl_id with H5Pset_create_intermediate_group(). 0892 * 0893 * - Copying of committed datatypes can be tuned through the use 0894 * of H5Pset_copy_object(), H5Padd_merge_committed_dtype_path(), 0895 * H5Pset_mcdt_search_cb(), and related functions. 0896 * 0897 * - Flags controlling other aspects of object copying are set in the 0898 * object copy property list \p ocpypl_id with H5Pset_copy_object(). 0899 * 0900 * H5Ocopy() will always try to make a copy of the object specified 0901 * in \p src_name. 0902 * 0903 * - If the object specified by \p src_name is a group containing a 0904 * soft or external link, the default is that the new copy will 0905 * contain a soft or external link with the same value as the 0906 * original. See H5Pset_copy_object() for optional settings. 0907 * 0908 * - If the path specified in \p src_name is or contains a soft link 0909 * or an external link, H5Ocopy() will copy the target object. 0910 * Use H5Lcopy() if the intent is to create a new soft or external 0911 * link with the same value as the original link. 0912 * 0913 * H5Ocopy() can be used to copy an object in an HDF5 file. If 0914 * an object has been changed since it was opened, it should be 0915 * written back to the file before using H5Ocopy(). The object 0916 * can be written back either by closing the object (H5Gclose(), 0917 * H5Oclose(), H5Dclose(), or H5Tclose()) or by flushing 0918 * the HDF5 file (H5Fflush()). 0919 * 0920 * \par See Also: 0921 * - Functions to modify the behavior of H5Ocopy(): 0922 * - H5Padd_merge_committed_dtype_path() 0923 * - H5Pset_copy_object() 0924 * - H5Pset_create_intermediate_group() 0925 * - H5Pset_mcdt_search_cb() 0926 * - Copying Committed Datatypes with #H5Ocopy - A comprehensive 0927 * discussion of copying committed datatypes (PDF) in 0928 * Advanced Topics in HDF5 0929 * 0930 * \version 1.8.9 Fortran subroutine introduced in this release. 0931 * 0932 * \since 1.8.0 0933 * 0934 */ 0935 H5_DLL herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, 0936 hid_t ocpypl_id, hid_t lcpl_id); 0937 /** 0938 * -------------------------------------------------------------------------- 0939 * \ingroup ASYNC 0940 * \async_variant_of{H5Ocopy} 0941 */ 0942 #ifndef H5_DOXYGEN 0943 H5_DLL herr_t H5Ocopy_async(const char *app_file, const char *app_func, unsigned app_line, hid_t src_loc_id, 0944 const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, 0945 hid_t lcpl_id, hid_t es_id); 0946 #else 0947 H5_DLL herr_t H5Ocopy_async(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, 0948 hid_t ocpypl_id, hid_t lcpl_id, hid_t es_id); 0949 #endif 0950 0951 /** 0952 *------------------------------------------------------------------------- 0953 * \ingroup H5O 0954 * 0955 * \brief Sets comment for specified object 0956 * 0957 * \fgdta_loc_obj_id{obj_id} 0958 * \param[in] comment The new comment 0959 * 0960 * \return \herr_t 0961 * 0962 * \details H5Oset_comment() sets the comment for the specified object 0963 * to the contents of \p comment. Any previously existing comment 0964 * is overwritten. 0965 * 0966 * The target object is specified by an identifier, \p obj_id. 0967 * If \p comment is an empty string or a null pointer, any existing 0968 * comment message is removed from the object. 0969 * 0970 * Comments should be relatively short, null-terminated, ASCII strings. 0971 * 0972 * Comments can be attached to any object that has an object 0973 * header. Datasets, groups, and committed (named) datatypes have 0974 * object headers. Symbolic links do not have object headers. 0975 * 0976 * If a comment is being added to an object attribute, this comment 0977 * will be attached to the object to which the attribute belongs 0978 * and not to the attribute itself. 0979 * 0980 * \version 1.8.11 Fortran subroutine introduced in this release. 0981 * 0982 * \since 1.8.0 0983 * 0984 */ 0985 H5_DLL herr_t H5Oset_comment(hid_t obj_id, const char *comment); 0986 0987 /** 0988 *------------------------------------------------------------------------- 0989 * \ingroup H5O 0990 * 0991 * \brief Sets comment for specified object 0992 * 0993 * \fgdta_loc_obj_id{loc_id} 0994 * \param[in] name Name of the object whose comment is to be set or reset 0995 * \param[in] comment The new comment 0996 * \lapl_id 0997 * 0998 * \return \herr_t 0999 * 1000 * \details H5Oset_comment_by_name() sets the comment for the specified object 1001 * to the contents of \p comment. Any previously existing comment 1002 * is overwritten. 1003 * 1004 * The target object is specified by \p loc_id and \p name. 1005 * \p loc_id can specify any object in the file. 1006 * \p name can be one of the following: 1007 * 1008 * - The name of the object specified as a path relative to \p loc_id 1009 * - An absolute name of the object, starting from \c /, the file's root group 1010 * - A dot (\c .), if \p loc_id fully specifies the object 1011 * 1012 * If \p comment is an empty string or a null pointer, any existing 1013 * comment message is removed from the object. 1014 * 1015 * Comments should be relatively short, null-terminated, ASCII strings. 1016 * 1017 * Comments can be attached to any object that has an object 1018 * header. Datasets, groups, and committed (named) datatypes have 1019 * object headers. Symbolic links do not have object headers. 1020 * 1021 * If a comment is being added to an object attribute, this comment 1022 * will be attached to the object to which the attribute belongs 1023 * and not to the attribute itself. 1024 * 1025 * \p lapl_id contains a link access property list identifier. A 1026 * link access property list can come into play when traversing 1027 * links to access an object. 1028 * 1029 * \version 1.8.11 Fortran subroutine introduced in this release. 1030 * 1031 * \since 1.8.0 1032 * 1033 */ 1034 H5_DLL herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id); 1035 1036 /** 1037 *------------------------------------------------------------------------- 1038 * \ingroup H5O 1039 * 1040 * \brief Retrieves comment for specified object 1041 * 1042 * \fgdta_loc_obj_id{obj_id} 1043 * \param[out] comment The comment 1044 * \param[in] bufsize Anticipated required size of the comment buffer 1045 * 1046 * \return Upon success, returns the number of characters in the 1047 * comment, not including the \c NULL terminator, or zero (\c 0) if 1048 * the object has no comment. The value returned may be larger 1049 * than \p bufsize. Otherwise returns a negative value. 1050 * 1051 * \details H5Oget_comment() retrieves the comment for the specified object in 1052 * the buffer \p comment. 1053 * 1054 * The target object is specified by an identifier, \p object_id. 1055 * 1056 * The size in bytes of the buffer \p comment, including the \c NULL 1057 * terminator, is specified in \p bufsize. If \p bufsize is unknown, 1058 * a preliminary H5Oget_comment() call with the pointer \p comment 1059 * set to \c NULL will return the size of the comment <em>without</em> 1060 * the \c NULL terminator. 1061 * 1062 * If \p bufsize is set to a smaller value than described above, 1063 * only \p bufsize bytes of the comment, without a \c NULL terminator, 1064 * are returned in \p comment. 1065 * 1066 * If an object does not have a comment, an empty string is 1067 * returned in \p comment. 1068 * 1069 * \version 1.8.11 Fortran subroutine introduced in this release. 1070 * 1071 * \since 1.8.0 1072 * 1073 */ 1074 H5_DLL ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize); 1075 1076 /** 1077 *------------------------------------------------------------------------- 1078 * \ingroup H5O 1079 * 1080 * \brief Retrieves comment for specified object 1081 * 1082 * \fgdta_loc_obj_id{loc_id} 1083 * \param[in] name Name of the object whose comment is to be retrieved 1084 * \param[out] comment The comment 1085 * \param[in] bufsize Anticipated required size of the \p comment buffer 1086 * \lapl_id 1087 * 1088 * \return Upon success, returns the number of characters in the comment, 1089 * not including the \c NULL terminator, or zero (\c 0) if the object 1090 * has no comment. The value returned may be larger than \c bufsize. 1091 * Otherwise returns a negative value. 1092 * 1093 * \details H5Oget_comment_by_name() retrieves the comment for an object 1094 * in the buffer \p comment. 1095 * 1096 * The target object is specified by \p loc_id and \p name. 1097 * \p loc_id can specify any object in the file. 1098 * \p name can be one of the following: 1099 * 1100 * - The name of the object relative to \p loc_id 1101 * - An absolute name of the object, starting from \c /, the file's root group 1102 * - A dot (\c .), if \p loc_id fully specifies the object 1103 * 1104 * The size in bytes of the comment, including the \c NULL terminator, 1105 * is specified in \p bufsize. If \p bufsize is unknown, a preliminary 1106 * H5Oget_comment_by_name() call with the pointer \p comment set 1107 * to \c NULL will return the size of the comment <em>without</em> 1108 * the \c NULL terminator. 1109 * 1110 * If \p bufsize is set to a smaller value than described above, 1111 * only \p bufsize bytes of the comment, without a \c NULL terminator, 1112 * are returned in \p comment. 1113 * 1114 * If an object does not have a comment, an empty string is 1115 * returned in \p comment. 1116 * 1117 * \p lapl_id contains a link access property list identifier. A 1118 * link access property list can come into play when traversing 1119 * links to access an object. 1120 * 1121 * \version 1.8.11 Fortran subroutine introduced in this release. 1122 * 1123 * \since 1.8.0 1124 * 1125 */ 1126 H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, 1127 hid_t lapl_id); 1128 1129 /** 1130 *------------------------------------------------------------------------- 1131 * \ingroup H5O 1132 * 1133 * \brief Recursively visits all objects accessible from a specified object 1134 * 1135 * \fgdta_loc_obj_id{obj_id} 1136 * \idx_type 1137 * \order 1138 * \param[in] op Callback function passing data regarding the object 1139 * to the calling application 1140 * \param[in] op_data User-defined pointer to data required by the application 1141 * for its processing of the object 1142 * \param[in] fields Flags specifying the fields to be retrieved to the 1143 * callback \p op 1144 * 1145 * \return On success, returns the return value of the first operator 1146 * that returns a positive value, or zero if all members were 1147 * processed with no operator returning non-zero. 1148 * 1149 * \return On failure, returns a negative value if something goes wrong 1150 * within the library, or the first negative value returned by 1151 * an operator. 1152 * 1153 * \details H5Ovisit3() is a recursive iteration function to visit the 1154 * object \p obj_id and, if \p obj_id is a group, all objects in 1155 * and below it in an HDF5 file, thus providing a mechanism for 1156 * an application to perform a common set of operations across 1157 * all of those objects or a dynamically selected subset. 1158 * For non-recursive iteration across the members of a group, 1159 * see H5Literate2(). 1160 * 1161 * If \p obj_id is a group identifier, that group serves as the 1162 * root of a recursive iteration. If \p obj_id is a file identifier, 1163 * that file's root group serves as the root of the recursive 1164 * iteration. If \p obj_id is an attribute identifier, 1165 * then the object where the attribute is attached will be iterated. 1166 * If \p obj_id is any other type of object, such as a dataset or 1167 * named datatype, there is no iteration. 1168 * 1169 * Two parameters are used to establish the iteration: \p idx_type 1170 * and \p order. 1171 * 1172 * \p idx_type specifies the index to be used. If the links in 1173 * a group have not been indexed by the index type, they will 1174 * first be sorted by that index then the iteration will begin; 1175 * if the links have been so indexed, the sorting step will be 1176 * unnecessary, so the iteration may begin more quickly. 1177 1178 * Note that the index type passed in \p idx_type is a 1179 * <em>best effort</em> setting. If the application passes in 1180 * a value indicating iteration in creation order and a group is 1181 * encountered that was not tracked in creation order, that group 1182 * will be iterated over in alphanumeric order by name, or 1183 * <em>name order</em>. (<em>Name order</em> is the native order 1184 * used by the HDF5 library and is always available.) 1185 * 1186 * \p order specifies the order in which objects are to be inspected 1187 * along the index specified in \p idx_type. 1188 * 1189 * The H5Ovisit3() \p op_data parameter is a user-defined pointer to the data 1190 * required to process objects in the course of the iteration. This pointer 1191 * is passed back to each step of the iteration in the callback 1192 * function's \p op_data parameter. 1193 * 1194 * The \p fields parameter contains flags to determine which fields will 1195 * be retrieved by the \p op callback function. These flags are defined 1196 * in the H5Opublic.h file: 1197 * \obj_info_fields 1198 * 1199 * H5Lvisit2() and H5Ovisit3() are companion functions: one for 1200 * examining and operating on links; the other for examining 1201 * and operating on the objects that those links point to. Both 1202 * functions ensure that by the time the function completes 1203 * successfully, every link or object below the specified point 1204 * in the file has been presented to the application for whatever 1205 * processing the application requires. These functions assume 1206 * that the membership of the group being iterated over remains 1207 * unchanged through the iteration; if any of the links in the 1208 * group change during the iteration, the resulting behavior 1209 * is undefined. 1210 * 1211 * \par Example 1212 * An example snippet from test/links.c: 1213 * \snippet links.c H5Ovisit3_snip 1214 * 1215 * \since 1.12.0 1216 * 1217 */ 1218 H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, 1219 void *op_data, unsigned fields); 1220 1221 /** 1222 *------------------------------------------------------------------------- 1223 * \ingroup H5O 1224 * 1225 * \brief Recursively visits all objects accessible from a specified object 1226 * 1227 * \fgdta_loc_obj_id{loc_id} 1228 * \param[in] obj_name Name of the object, generally relative to 1229 * \p loc_id, that will serve as root of the iteration 1230 * \idx_type 1231 * \order 1232 * \param[in] op Callback function passing data regarding the object 1233 * to the calling application 1234 * \param[in] op_data User-defined pointer to data required by the application 1235 * for its processing of the object 1236 * \param[in] fields Flags specifying the fields to be retrieved to the 1237 * callback function \p op 1238 * \lapl_id 1239 * 1240 * \return On success, returns the return value of the first operator 1241 * that returns a positive value, or zero if all members were 1242 * processed with no operator returning non-zero. 1243 * 1244 * \return On failure, returns a negative value if something goes wrong 1245 * within the library, or the first negative value returned by 1246 * an operator. 1247 * 1248 * \details H5Ovisit_by_name3() is a recursive iteration function to visit 1249 * the object specified by the \p loc_id / \p obj_name parameter 1250 * pair and, if that object is a group, all objects in and below it 1251 * in an HDF5 file, thus providing a mechanism for an application to 1252 * perform a common set of operations across all of those objects or 1253 * a dynamically selected subset. For non-recursive iteration across 1254 * the members of a group, see H5Literate2(). 1255 * 1256 * The object serving as the root of the iteration is specified 1257 * by the \p loc_id / \p obj_name parameter pair. \p loc_id specifies 1258 * a file or an object in a file; if \p loc_id is an attribute identifier, 1259 * the object where the attribute is attached will be used. 1260 * \p obj_name specifies either an object in the file (with an absolute 1261 * name based on the file's root group) or an object name relative 1262 * to \p loc_id. If \p loc_id fully specifies the object that is to serve 1263 * as the root of the iteration, \p obj_name should be '\c .' (a dot). 1264 * (Note that when \p loc_id fully specifies the object that is to serve 1265 * as the root of the iteration, the user may wish to consider 1266 * using H5Ovisit3() instead of H5Ovisit_by_name3().) 1267 * 1268 * Two parameters are used to establish the iteration: \p idx_type 1269 * and \p order. 1270 * 1271 * \p idx_type specifies the index to be used. If the links in 1272 * a group have not been indexed by the index type, they will 1273 * first be sorted by that index then the iteration will begin; 1274 * if the links have been so indexed, the sorting step will be 1275 * unnecessary, so the iteration may begin more quickly. 1276 * 1277 * Note that the index type passed in \p idx_type is a 1278 * <em>best effort</em> setting. If the application passes in a 1279 * value indicating iteration in creation order and a group is 1280 * encountered that was not tracked in creation order, that group 1281 * will be iterated over in alphanumeric order by name, or 1282 * <em>name order</em>. (<em>Name order</em> is the native order 1283 * used by the HDF5 library and is always available.) 1284 * 1285 * \p order specifies the order in which objects are to be inspected 1286 * along the index specified in \p idx_type. 1287 * 1288 * The H5Ovisit_by_name3() \p op_data parameter is a user-defined 1289 * pointer to the data required to process objects in the course 1290 * of the iteration. This pointer is passed back to each step of 1291 * the iteration in the callback function's \p op_data parameter. 1292 * 1293 * \p lapl_id is a link access property list. In the general case, 1294 * when default link access properties are acceptable, this can 1295 * be passed in as #H5P_DEFAULT. An example of a situation that 1296 * requires a non-default link access property list is when 1297 * the link is an external link; an external link may require 1298 * that a link prefix be set in a link access property list 1299 * (see H5Pset_elink_prefix()). 1300 * 1301 * The \p fields parameter contains flags to determine which fields will 1302 * be retrieved by the \p op callback function. These flags are defined 1303 * in the H5Opublic.h file: 1304 * \obj_info_fields 1305 * 1306 * H5Lvisit_by_name2() and H5Ovisit_by_name3() are companion 1307 * functions: one for examining and operating on links; the other 1308 * for examining and operating on the objects that those links point to. 1309 * Both functions ensure that by the time the function completes 1310 * successfully, every link or object below the specified point 1311 * in the file has been presented to the application for whatever 1312 * processing the application requires. 1313 * 1314 * \par Example 1315 * An example snippet from test/links.c: 1316 * \snippet links.c H5Ovisit_by_name3_snip 1317 * 1318 * \since 1.12.0 1319 * 1320 */ 1321 H5_DLL herr_t H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 1322 H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields, 1323 hid_t lapl_id); 1324 1325 /** 1326 *------------------------------------------------------------------------- 1327 * \ingroup H5O 1328 * 1329 * \brief Closes an object in an HDF5 file 1330 * 1331 * \obj_id{object_id} 1332 * 1333 * \return \herr_t 1334 * 1335 * \details H5Oclose() closes the group, dataset, or named datatype specified by 1336 * object_id. 1337 * 1338 * This function is the companion to H5Oopen(), and has the same 1339 * effect as calling H5Gclose(), H5Dclose(), or H5Tclose(). 1340 * 1341 * H5Oclose() is not used to close a dataspace, attribute, property 1342 * list, or file. 1343 * 1344 * \version 1.8.8 Fortran subroutine introduced in this release. 1345 * 1346 * \since 1.8.0 1347 * 1348 */ 1349 H5_DLL herr_t H5Oclose(hid_t object_id); 1350 /** 1351 * -------------------------------------------------------------------------- 1352 * \ingroup ASYNC 1353 * \async_variant_of{H5Oclose} 1354 */ 1355 #ifndef H5_DOXYGEN 1356 H5_DLL herr_t H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t object_id, 1357 hid_t es_id); 1358 #else 1359 H5_DLL herr_t H5Oclose_async(hid_t object_id, hid_t es_id); 1360 #endif 1361 1362 /** 1363 *------------------------------------------------------------------------- 1364 * \ingroup H5O 1365 * 1366 * \brief Flushes all buffers associated with an HDF5 object to disk 1367 * 1368 * \fgdta_loc_obj_id{obj_id} 1369 * 1370 * \return \herr_t 1371 * 1372 * \details H5Oflush() causes all buffers associated with an object to be immediately 1373 * flushed to disk without removing the data from the cache. 1374 * 1375 * The object associated with \p object_id can be any named object in an 1376 * HDF5 file, including a dataset, a group, or a committed datatype. 1377 * 1378 * \warning H5Oflush doesn't work correctly with parallel. It causes an assertion 1379 * failure in metadata cache during H5Fclose(). 1380 * 1381 * \note HDF5 does not possess full control over buffering. H5Oflush() 1382 * flushes the internal HDF5 buffers and then asks the operating 1383 * system (the OS) to flush the system buffers for the open 1384 * files. After that, the OS is responsible for ensuring that 1385 * the data is actually flushed to disk. 1386 * 1387 * \see H5Dflush(), H5Drefresh(), H5Oflush(), H5Grefresh(), H5Oflush(), 1388 * H5Orefresh(), H5Tflush(), H5Trefresh() 1389 * \see H5DOappend(), H5Fstart_swmr_write(), H5Pget_append_flush(), 1390 * H5Pget_object_flush_cb(), H5Pset_append_flush(), H5Pset_object_flush_cb() 1391 * \see H5Oare_mdc_flushes_disabled(), H5Odisable_mdc_flushes(), H5Oenable_mdc_flushes() 1392 * 1393 * \since 1.10.0 1394 * 1395 */ 1396 H5_DLL herr_t H5Oflush(hid_t obj_id); 1397 /** 1398 * -------------------------------------------------------------------------- 1399 * \ingroup ASYNC 1400 * \async_variant_of{H5Oflush} 1401 */ 1402 #ifndef H5_DOXYGEN 1403 H5_DLL herr_t H5Oflush_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id, 1404 hid_t es_id); 1405 #else 1406 H5_DLL herr_t H5Oflush_async(hid_t obj_id, hid_t es_id); 1407 #endif 1408 /** 1409 *------------------------------------------------------------------------- 1410 * \ingroup H5O 1411 * 1412 * \brief Refreshes all buffers associated with an HDF5 object 1413 * 1414 * \fgdta_loc_obj_id{oid} 1415 * 1416 * \return \herr_t 1417 * 1418 * \details H5Orefresh() causes all buffers associated with an object to be cleared 1419 * and immediately re-loaded with updated contents from disk. 1420 * 1421 * This function essentially closes the object, evicts all 1422 * metadata associated with it from the cache, and then re-opens 1423 * the object. The reopened object is automatically re-registered 1424 * with the same identifier. 1425 * 1426 * The object associated with \p oid can be any named object in an 1427 * HDF5 file including a dataset, a group, or a committed datatype. 1428 * 1429 * \since 1.10.0 1430 * 1431 */ 1432 H5_DLL herr_t H5Orefresh(hid_t oid); 1433 /** 1434 * -------------------------------------------------------------------------- 1435 * \ingroup ASYNC 1436 * \async_variant_of{H5Orefresh} 1437 */ 1438 #ifndef H5_DOXYGEN 1439 H5_DLL herr_t H5Orefresh_async(const char *app_file, const char *app_func, unsigned app_line, hid_t oid, 1440 hid_t es_id); 1441 #else 1442 H5_DLL herr_t H5Orefresh_async(hid_t oid, hid_t es_id); 1443 #endif 1444 1445 /** 1446 *------------------------------------------------------------------------- 1447 * \ingroup H5O 1448 * 1449 * \brief Prevents metadata entries for an HDF5 object from being flushed 1450 * from the metadata cache to storage 1451 * 1452 * \param[in] object_id Identifier of the object that will have flushes disabled; 1453 * may be a group, named datatype, or dataset identifier 1454 * 1455 * \return \herr_t 1456 * 1457 * \details H5Odisable_mdc_flushes(), H5Oenable_mdc_flushes() and associated flush 1458 * functions can be used to control the flushing of entries from 1459 * a file's metadata cache. 1460 * 1461 * This function prevents an object's or cache's dirty metadata 1462 * entries from being flushed from the cache by the usual cache 1463 * eviction/flush policy. Instead, users must manually flush the 1464 * cache or entries for individual objects via the appropriate 1465 * H5Fflush(), H5Dflush(), H5Gflush(), H5Tflush(), and H5Oflush() calls. 1466 * 1467 * Metadata cache entries can be controlled at both the individual 1468 * HDF5 object level (datasets, groups, committed datatypes) 1469 * and the entire metadata cache level. 1470 * 1471 * \note HDF5 objects include datasets, groups, and committed datatypes. Only 1472 * #hid_t identifiers that represent these objects can be passed to the 1473 * function. Passing in a #hid_t identifier that represents any other 1474 * HDF5 entity is considered an error. It is an error to pass an HDF5 1475 * file identifier (obtained from H5Fopen() or H5Fcreate()) to this 1476 * function. Misuse of this function can cause the cache to exhaust 1477 * available memory. Objects can be returned to the default automatic 1478 * flush behavior with H5Oenable_mdc_flushes(). Flush prevention only 1479 * pertains to new or dirty metadata entries. Clean entries can be 1480 * evicted from the cache. Calling this function on an object that has 1481 * already had flushes disabled will return an error. 1482 * 1483 * \since 1.10.0 1484 * 1485 */ 1486 H5_DLL herr_t H5Odisable_mdc_flushes(hid_t object_id); 1487 1488 /** 1489 *------------------------------------------------------------------------- 1490 * \ingroup H5O 1491 * 1492 * \brief Enables flushing of dirty metadata entries from a file's metadata cache 1493 * 1494 * \param[in] object_id Identifier of the object that will have flushes re-enabled; 1495 * may be a group, named datatype, or dataset identifier 1496 * 1497 * \return \herr_t 1498 * 1499 * \details H5Oenable_mdc_flushes(), H5Odisable_mdc_flushes() 1500 * and associated flush functions can be used to control the flushing 1501 * of entries from a file's metadata cache. 1502 * 1503 * This function allows an object or cache's dirty metadata entries to be 1504 * flushed from the cache by the usual cache eviction/flush policy. 1505 * 1506 * Metadata cache entries can be controlled at both the individual HDF5 1507 * object level (datasets, groups, committed datatypes) and the entire 1508 * metadata cache level. 1509 * 1510 * 1511 * \note HDF5 objects include datasets, groups, and committed datatypes. Only 1512 * #hid_t identifiers that represent these objects can be passed to the 1513 * function. Passing in a #hid_t identifier that represents any other 1514 * HDF5 entity is considered an error. It is an error to pass an HDF5 1515 * file identifier (obtained from H5Fopen() or H5Fcreate()) to this 1516 * function. Using this function on an object that has not had flushes 1517 * disabled is considered an error. The state of an object can be 1518 * determined with H5Oare_mdc_flushes_disabled(). An object will be 1519 * returned to the default flush algorithm when it is closed. All objects 1520 * will be returned to the default flush algorithm when the file is 1521 * closed. An object's entries will not necessarily be flushed as a 1522 * result of calling this function. 1523 * 1524 * \since 1.10.0 1525 * 1526 */ 1527 H5_DLL herr_t H5Oenable_mdc_flushes(hid_t object_id); 1528 1529 /** 1530 *------------------------------------------------------------------------- 1531 * \ingroup H5O 1532 * 1533 * \brief Retrieves comment for specified object 1534 * 1535 * \param[in] object_id Identifier of an object in the cache; 1536 * may be a group, named datatype, or dataset identifier 1537 * \param[out] are_disabled Flushes enabled/disabled 1538 * 1539 * \return \p are_disabled will be set to \c 1 if an object has had flushes disabled 1540 * and \c 0 if it has not had flushes disabled. 1541 * \return \herr_t 1542 * 1543 * \details H5Oare_mdc_flushes_disabled() determines if an HDF5 object (dataset, group, committed 1544 * datatype) has had flushes of metadata entries disabled. 1545 * 1546 * The H5Oenable_mdc_flushes(), H5Odisable_mdc_flushes() and 1547 * associated flush functions can be used to control the flushing of 1548 * entries from a file's metadata cache. Metadata cache entries can be controlled 1549 * at both the individual HDF5 object level (datasets, groups, 1550 * committed datatypes) and the entire metadata cache level. 1551 * 1552 * \note HDF5 objects include datasets, groups, and committed datatypes. 1553 * Only #hid_t identifiers that represent these objects can be passed to the function. 1554 * \note Passing in a #hid_t identifier that represents any other HDF5 entity is 1555 * considered an error. 1556 * \note It is an error to pass an HDF5 file identifier 1557 * (obtained from H5Fopen() or H5Fcreate()) to this function. 1558 * 1559 * \since 1.10.0 1560 * 1561 */ 1562 H5_DLL herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled); 1563 1564 /** 1565 *------------------------------------------------------------------------- 1566 * \ingroup H5O 1567 * 1568 * \brief Compares two VOL connector object tokens 1569 * 1570 * \fgdta_loc_obj_id{loc_id} 1571 * \param[in] token1 First object token 1572 * \param[in] token2 Second object token 1573 * \param[out] cmp_value Comparison value 1574 * 1575 * \return \herr_t 1576 * 1577 * \details H5Otoken_cmp() compares two VOL connector object tokens, \p token1 1578 * and \p token2 for the file or group identifier specified by \p loc_id. 1579 * Both object tokens must be from the same VOL connector class. 1580 * 1581 * H5O_token_t is defined in H5public.h as follows: 1582 * \snippet H5public.h H5O_token_t_snip 1583 * 1584 * A comparison value, \p cmp_value, is returned, which indicates the 1585 * result of the comparison: 1586 * 1587 * <table> 1588 * <tr> 1589 * <th>cmp_value</th> 1590 * <th>Result</th> 1591 * </tr> 1592 * <tr> 1593 * <td> > 0</td> 1594 * <td> \p token1 > \p token2</td> 1595 * </tr> 1596 * <tr> 1597 * <td> < 0</td> 1598 * <td>\p token1 < \p token2</td> 1599 * </tr> 1600 * <tr> 1601 * <td>0</td> 1602 * <td>\p token1 = \p token2</td> 1603 * </tr> 1604 * </table> 1605 * 1606 * \par Example 1607 * An example snippet from test/links.c: 1608 * \snippet links.c H5Otoken_cmp_snip 1609 * 1610 * \since 1.12.0 1611 * 1612 */ 1613 H5_DLL herr_t H5Otoken_cmp(hid_t loc_id, const H5O_token_t *token1, const H5O_token_t *token2, 1614 int *cmp_value); 1615 1616 /** 1617 *------------------------------------------------------------------------- 1618 * \ingroup H5O 1619 * 1620 * \brief Serializes a connector's object token into a string 1621 * 1622 * \fgdta_loc_obj_id{loc_id} 1623 * \param[in] token Connector object token 1624 * \param[out] token_str String for connector object token \p token 1625 * 1626 * \return \herr_t 1627 * 1628 * \details H5Otoken_to_str() serializes a connector's object token specified by 1629 * \p token and the location identifier for the object, \p loc_id, 1630 * into a string, \p token_str. 1631 * 1632 * \since 1.12.0 1633 * 1634 */ 1635 H5_DLL herr_t H5Otoken_to_str(hid_t loc_id, const H5O_token_t *token, char **token_str); 1636 1637 /** 1638 *------------------------------------------------------------------------- 1639 * \ingroup H5O 1640 * 1641 * \brief Deserializes a string into a connector object token 1642 * 1643 * \fgdta_loc_obj_id{loc_id} 1644 * \param[in] token_str Object token string 1645 * \param[out] token Connector object token 1646 * 1647 * \return \herr_t 1648 * 1649 * \details H5Otoken_from_str() deserializes a string, \p token_str, into a 1650 * connector object token, \p token, for the object specified by the 1651 * location identifier, \p loc_id. 1652 * 1653 * \since 1.12.0 1654 * 1655 */ 1656 H5_DLL herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t *token); 1657 1658 /// \cond DEV 1659 /* API Wrappers for async routines */ 1660 /* (Must be defined _after_ the function prototype) */ 1661 /* (And must only defined when included in application code, not the library) */ 1662 #ifndef H5O_MODULE 1663 #define H5Oopen_async(...) H5Oopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1664 #define H5Oopen_by_idx_async(...) H5Oopen_by_idx_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1665 #define H5Oget_info_by_name_async(...) H5Oget_info_by_name_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1666 #define H5Oclose_async(...) H5Oclose_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1667 #define H5Oflush_async(...) H5Oflush_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1668 #define H5Orefresh_async(...) H5Orefresh_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1669 #define H5Ocopy_async(...) H5Ocopy_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1670 1671 /* Define "wrapper" versions of function calls, to allow compile-time values to 1672 * be passed in by language wrapper or library layer on top of HDF5. 1673 */ 1674 #define H5Oopen_async_wrap H5_NO_EXPAND(H5Oopen_async) 1675 #define H5Oopen_by_idx_async_wrap H5_NO_EXPAND(H5Oopen_by_idx_async) 1676 #define H5Oget_info_by_name_async_wrap H5_NO_EXPAND(H5Oget_info_by_name_async) 1677 #define H5Oclose_async_wrap H5_NO_EXPAND(H5Oclose_async) 1678 #define H5Oflush_async_wrap H5_NO_EXPAND(H5Oflush_async) 1679 #define H5Orefresh_async_wrap H5_NO_EXPAND(H5Orefresh_async) 1680 #define H5Ocopy_async_wrap H5_NO_EXPAND(H5Ocopy_async) 1681 #endif 1682 /// \endcond 1683 1684 /* The canonical 'undefined' token value */ 1685 #define H5O_TOKEN_UNDEF (H5OPEN H5O_TOKEN_UNDEF_g) 1686 H5_DLLVAR const H5O_token_t H5O_TOKEN_UNDEF_g; 1687 1688 /* Symbols defined for compatibility with previous versions of the HDF5 API. 1689 * 1690 * Use of these symbols is deprecated. 1691 */ 1692 #ifndef H5_NO_DEPRECATED_SYMBOLS 1693 1694 /* Macros */ 1695 1696 /* Deprecated flags for earlier versions of H5Oget_info* */ 1697 #define H5O_INFO_HDR 0x0008u /**< Fill in the hdr field */ 1698 #define H5O_INFO_META_SIZE 0x0010u /**< Fill in the meta_size field */ 1699 #undef H5O_INFO_ALL 1700 #define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE) 1701 1702 /* Typedefs */ 1703 1704 //! <!-- [H5O_stat_t_snip] --> 1705 /** 1706 * A struct that's part of the \ref H5G_stat_t structure 1707 * \deprecated 1708 */ 1709 typedef struct H5O_stat_t { 1710 hsize_t size; /**< Total size of object header in file */ 1711 hsize_t free; /**< Free space within object header */ 1712 unsigned nmesgs; /**< Number of object header messages */ 1713 unsigned nchunks; /**< Number of object header chunks */ 1714 } H5O_stat_t; 1715 //! <!-- [H5O_stat_t_snip] --> 1716 1717 //! <!-- [H5O_info1_t_snip] --> 1718 /** 1719 * Information struct for object (For H5Oget_info(), H5Oget_info_by_name(), 1720 * H5Oget_info_by_idx() versions 1 & 2.) 1721 */ 1722 typedef struct H5O_info1_t { 1723 unsigned long 1724 fileno; /**< File number that object is located in. Constant across multiple opens of the same file */ 1725 haddr_t addr; /**< Object address in file */ 1726 H5O_type_t type; /**< Basic object type (group, dataset, etc.) */ 1727 unsigned rc; /**< Reference count of object */ 1728 time_t atime; /**< Access time */ 1729 time_t mtime; /**< Modification time */ 1730 time_t ctime; /**< Change time */ 1731 time_t btime; /**< Birth time */ 1732 hsize_t num_attrs; /**< Number of attributes attached to object */ 1733 H5O_hdr_info_t hdr; /**< Object header information */ 1734 /* Extra metadata storage for obj & attributes */ 1735 struct { 1736 H5_ih_info_t obj; /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ 1737 H5_ih_info_t attr; /**< v2 B-tree & heap for attributes */ 1738 } meta_size; 1739 } H5O_info1_t; 1740 //! <!-- [H5O_info1_t_snip] --> 1741 1742 //! <!-- [H5O_iterate1_t_snip] --> 1743 /** 1744 * Prototype for H5Ovisit(), H5Ovisit_by_name() operator (versions 1 & 2) 1745 * 1746 * \param[in] obj Object that serves as the root of the iteration; 1747 * the same value as the H5Ovisit1() \c obj_id parameter 1748 * \param[in] name Name of object, relative to \p obj, being examined at current 1749 * step of the iteration 1750 * \param[out] info Information about that object 1751 * \param[in,out] op_data User-defined pointer to data required by the application 1752 * in processing the object 1753 * \return \herr_t_iter 1754 * 1755 * \since 1.8.0 1756 * 1757 */ 1758 typedef herr_t (*H5O_iterate1_t)(hid_t obj, const char *name, const H5O_info1_t *info, void *op_data); 1759 //! <!-- [H5O_iterate1_t_snip] --> 1760 1761 /* Function prototypes */ 1762 1763 /** 1764 *------------------------------------------------------------------------- 1765 * \ingroup H5O 1766 * 1767 * \brief Opens an object using its address within an HDF5 file. 1768 * 1769 * \fgdta_loc_obj_id{loc_id} 1770 * \param[in] addr Object's address in the file 1771 * 1772 * \return \hid_ti{object} 1773 * 1774 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 1775 * the function H5Oopen_by_token(). 1776 * 1777 * \details H5Oopen_by_addr() opens a group, dataset, or committed (named) datatype using its 1778 * address within an HDF5 file, \p addr. The resulting opened object is identical to 1779 * an object opened with H5Oopen() and should be closed with H5Oclose() or an 1780 * object-type-specific closing function (such as H5Gclose()) when no longer needed. 1781 * 1782 * \p loc_id is a location identifier in the file. 1783 * 1784 * The object's address within the file, \p addr, is the byte offset of the first byte 1785 * of the object header from the beginning of the HDF5 file space, i.e., from the 1786 * beginning of the superblock (see the “HDF5 Storage Model” section of the The 1787 * HDF5 Data Model and File Structure chapter of the <em>HDF5 User's Guide</em>.) 1788 * 1789 * \p addr can be obtained via either of two function calls. H5Gget_objinfo() returns 1790 * the object's address in the \c objno field of the H5G_stat_t \c struct; 1791 * H5Lget_info() returns the address in the \c address field of the #H5L_info_t \c struct. 1792 * 1793 * The address of the HDF5 file on a physical device has no effect on H5Oopen_by_addr(), 1794 * nor does the use of any file driver. As stated above, the object address is its 1795 * offset within the HDF5 file; HDF5's file drivers will transparently map this to an 1796 * address on a storage device. 1797 * 1798 * \warning This function must be used with care! 1799 * \warning Improper use can lead to inaccessible data, wasted space in the file, 1800 * or <b><em>file corruption</em></b>. 1801 * \warning This function is dangerous if called on an invalid address. The risk can be safely 1802 * overcome by retrieving the object address with H5Gget_objinfo() or H5Lget_info() 1803 * immediately before calling H5Oopen_by_addr(). The immediacy of the operation can be 1804 * important; if time has elapsed and the object has been deleted from the file, 1805 * the address will be invalid, and file corruption can result. 1806 * 1807 * \version 1.8.4 Fortran subroutine added in this release. 1808 * 1809 * \since 1.8.0 1810 * 1811 */ 1812 H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr); 1813 1814 /** 1815 *------------------------------------------------------------------------- 1816 * \ingroup H5O 1817 * 1818 * \brief Retrieves the metadata for an object specified by an identifier 1819 * 1820 * \fgdta_loc_obj_id{loc_id} 1821 * \param[out] oinfo Buffer in which to return object information 1822 * 1823 * \return \herr_t 1824 * 1825 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 1826 * the function H5Oget_info3() or the macro #H5Oget_info. 1827 * 1828 * \details H5Oget_info1() specifies an object by its identifier, \p loc_id , and 1829 * retrieves the metadata describing that object in \p oinfo. 1830 * 1831 * \note If you are iterating through a lot of different objects to 1832 * retrieve information via the H5Oget_info() family of routines, 1833 * you may see memory building up. This can be due to memory 1834 * allocation for metadata, such as object headers and messages, 1835 * when the iterated objects are put into the metadata cache. 1836 * \note 1837 * If the memory buildup is not desirable, you can configure a 1838 * smaller cache via H5Fset_mdc_config() or set the file access 1839 * property list via H5Pset_mdc_config(). A smaller sized cache 1840 * will force metadata entries to be evicted from the cache, 1841 * thus freeing the memory associated with the entries. 1842 * 1843 * \version 1.10.5 The macro #H5Oget_info was removed and the function 1844 * H5Oget_info1() was copied to H5Oget_info(). 1845 * \version 1.10.3 Function H5Oget_info() was copied to H5Oget_info1(), 1846 * and the macro #H5Oget_info was created. 1847 * \version 1.8.15 Added a note about the valid values for the \c version 1848 * field in the H5O_hdr_info_t structure. 1849 * \version 1.8.11 Fortran subroutine introduced in this release. 1850 * \version 1.8.10 Added #H5O_type_t structure to the Description section. \n 1851 * Separated H5O_hdr_info_t structure from #H5O_info_t in the 1852 * Description section. \n 1853 * Clarified the definition and implementation of the time fields. 1854 * 1855 * \since 1.8.0 1856 * 1857 */ 1858 H5_DLL herr_t H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo); 1859 1860 /** 1861 *------------------------------------------------------------------------- 1862 * \ingroup H5O 1863 * 1864 * \brief Retrieves the metadata for an object, identifying the object 1865 * by location and relative name 1866 * 1867 * \fgdta_loc_obj_id{loc_id} 1868 * \param[in] name Name of object, relative to \p loc_id 1869 * \param[out] oinfo Buffer in which to return object information 1870 * \lapl_id 1871 * 1872 * \return \herr_t 1873 * 1874 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 1875 * the function H5Oget_info_by_name2() or the macro #H5Oget_info_by_name. 1876 * 1877 * \details H5Oget_info_by_name1() specifies an object's location and name, \p loc_id 1878 * and \p name, respectively, and retrieves the metadata describing that object 1879 * in \p oinfo, an H5O_info1_t \c struct. 1880 * 1881 * The \c struct H5O_info1_t is defined in H5Opublic.h and described 1882 * in the H5Oget_info1() function entry. 1883 * 1884 * The link access property list, \p lapl_id, is not currently used; 1885 * it should be passed in as #H5P_DEFAULT. 1886 * 1887 * \version 1.10.5 The macro #H5Oget_info_by_name was removed and the function 1888 * H5Oget_info_by_name1() was copied to H5Oget_info_by_name(). 1889 * \version 1.10.3 Function H5Oget_info_by_name() was copied to H5Oget_info_by_name1() 1890 * and the macro #H5Oget_info_by_name was created. 1891 * \version 1.8.8 Fortran 2003 subroutine and \c h5o_info_t derived type introduced 1892 * in this release. 1893 * 1894 * \since 1.8.0 1895 * 1896 */ 1897 H5_DLL herr_t H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo, hid_t lapl_id); 1898 1899 /** 1900 *------------------------------------------------------------------------- 1901 * \ingroup H5O 1902 * 1903 * \brief Retrieves the metadata for an object, identifying the object 1904 * by an index position 1905 * 1906 * \fgdta_loc_obj_id{loc_id} 1907 * \param[in] group_name Name of group in which object is located 1908 * \idx_type 1909 * \order 1910 * \param[in] n Position within the index 1911 * \param[out] oinfo Buffer in which to return object information 1912 * \lapl_id 1913 * 1914 * \return \herr_t 1915 * 1916 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 1917 * the function H5Oget_info_by_idx3() or the macro H5Oget_info_by_idx(). 1918 * 1919 * \details H5Oget_info_by_idx1() retrieves the metadata describing an 1920 * object in the \c struct \p oinfo, as specified by the location, 1921 * \p loc_id, group name, \p group_name, the index by which objects 1922 * in that group are tracked, \p idx_type, the order by which the 1923 * index is to be traversed, \p order, and an object's position 1924 * \p n within that index. 1925 * 1926 * If \p loc_id fully specifies the group in which the object resides, 1927 * \p group_name can be a dot (\c .). 1928 * 1929 * The link access property list, \c lapl_id, is not currently used; 1930 * it should be passed in as #H5P_DEFAULT. 1931 * 1932 * \version 1.10.5 The macro #H5Oget_info_by_idx was removed and the function 1933 * H5Oget_info_by_idx() was copied to H5Oget_info_by_idx1(). 1934 * \version 1.10.3 Function H5Oget_info_by_idx() was copied to H5Oget_info_by_idx1() 1935 * and the macro #H5Oget_info_by_idx was created. 1936 * \version 1.8.11 Fortran subroutine introduced in this release. 1937 * 1938 * \since 1.8.0 1939 * 1940 */ 1941 H5_DLL herr_t H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, 1942 H5_iter_order_t order, hsize_t n, H5O_info1_t *oinfo, hid_t lapl_id); 1943 1944 /** 1945 *------------------------------------------------------------------------- 1946 * \ingroup H5O 1947 * 1948 * \brief Retrieves the metadata for an object specified by an identifier 1949 * 1950 * \fgdta_loc_obj_id{loc_id} 1951 * \param[out] oinfo Buffer in which to return object information 1952 * \param[in] fields Flags specifying the fields to include in \p oinfo 1953 * 1954 * \return \herr_t 1955 * 1956 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 1957 * the function H5Oget_info3() or the macro H5Oget_info(). 1958 * 1959 * \details H5Oget_info2() specifies an object by its identifier, \p loc_id , and 1960 * retrieves the metadata describing that object in \p oinfo , an H5O_info1_t \c struct. 1961 * This \c struct type is described in H5Oget_info1(). 1962 * 1963 * The \p fields parameter contains flags to determine which fields will be filled in 1964 * the H5O_info1_t \c struct returned in \p oinfo. 1965 * These flags are defined in the H5Opublic.h file: 1966 * 1967 * \obj_info_fields 1968 * 1969 * \note If you are iterating through a lot of different objects to 1970 * retrieve information via the H5Oget_info() family of routines, 1971 * you may see memory building up. This can be due to memory 1972 * allocation for metadata, such as object headers and messages, 1973 * when the iterated objects are put into the metadata cache. 1974 * \note 1975 * If the memory buildup is not desirable, you can configure a 1976 * smaller cache via H5Fset_mdc_config() or set the file access 1977 * property list via H5Pset_mdc_config(). A smaller sized cache 1978 * will force metadata entries to be evicted from the cache, 1979 * thus freeing the memory associated with the entries. 1980 * 1981 * \since 1.10.3 1982 * 1983 */ 1984 H5_DLL herr_t H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields); 1985 1986 /** 1987 *------------------------------------------------------------------------- 1988 * \ingroup H5O 1989 * 1990 * \brief Retrieves the metadata for an object, identifying the object 1991 * by location and relative name 1992 * 1993 * \fgdta_loc_obj_id{loc_id} 1994 * \param[in] name Name of object, relative to \p loc_id 1995 * \param[out] oinfo Buffer in which to return object information 1996 * \param[in] fields Flags specifying the fields to include in \p oinfo 1997 * \lapl_id 1998 * 1999 * \return \herr_t 2000 * 2001 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 2002 * the function H5Oget_info_by_name3() or the macro H5Oget_info_by_name(). 2003 * 2004 * \details H5Oget_info_by_name2() specifies an object's location and name, \p loc_id and 2005 * \p name, respectively, and retrieves the metadata describing 2006 * that object in \p oinfo, an H5O_info1_t \c struct. 2007 * 2008 * The \c struct H5O_info1_t is defined in H5Opublic.h and described 2009 * in the H5Oget_info1() function entry. 2010 * 2011 * The \p fields parameter contains flags to determine which fields 2012 * will be filled in the H5O_info1_t \c struct returned in 2013 * \p oinfo. These flags are defined in the H5Opublic.h file: 2014 * 2015 * \obj_info_fields 2016 * 2017 * The link access property list, \p lapl_id, is not currently used; 2018 * it should be passed in as #H5P_DEFAULT. 2019 * 2020 * \since 1.10.3 2021 * 2022 */ 2023 H5_DLL herr_t H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigned fields, 2024 hid_t lapl_id); 2025 2026 /** 2027 *------------------------------------------------------------------------- 2028 * \ingroup H5O 2029 * 2030 * \brief Retrieves the metadata for an object, identifying the object 2031 * by an index position 2032 * 2033 * \fgdta_loc_obj_id{loc_id} 2034 * \param[in] group_name Name of group in which object is located 2035 * \idx_type 2036 * \order 2037 * \param[in] n Position within the index 2038 * \param[out] oinfo Buffer in which to return object information 2039 * \param[in] fields Flags specifying the fields to include in \p oinfo 2040 * \lapl_id 2041 * 2042 * \return \herr_t 2043 * 2044 * \deprecated As of HDF5-1.12 this function is deprecated in favor of 2045 * the function H5Oget_info_by_idx3() or the macro #H5Oget_info_by_idx. 2046 * 2047 * \details H5Oget_info_by_idx2() retrieves the metadata describing an 2048 * object in the \c struct \p oinfo, as specified by the location, 2049 * \p loc_id, group name, \p group_name, the index by which objects 2050 * in that group are tracked, \p idx_type, the order by which the 2051 * index is to be traversed, \p order, and an object's position 2052 * \p n within that index. 2053 * 2054 * \p oinfo, in which the object information is returned, is a \c struct of 2055 * type H5O_info1_t. This and other \c struct types used 2056 * by H5Oget_info_by_idx2() are described in H5Oget_info_by_idx1(). 2057 * 2058 * If \p loc_id fully specifies the group in which the object resides, 2059 * i\p group_name can be a dot (\c .). 2060 * 2061 * The \p fields parameter contains flags to determine which fields will be 2062 * filled in the H5O_info1_t \c struct returned in \p oinfo. 2063 * These flags are defined in the H5Opublic.h file: 2064 * \obj_info_fields 2065 * 2066 * The link access property list, \c lapl_id, is not currently used; 2067 * it should be passed in as #H5P_DEFAULT. 2068 * 2069 * \since 1.10.3 2070 * 2071 */ 2072 H5_DLL herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, 2073 H5_iter_order_t order, hsize_t n, H5O_info1_t *oinfo, unsigned fields, 2074 hid_t lapl_id); 2075 2076 /** 2077 *------------------------------------------------------------------------- 2078 * \ingroup H5O 2079 * 2080 * \brief Recursively visits all objects accessible from a specified object 2081 * 2082 * \fgdta_loc_obj_id{obj_id} 2083 * \idx_type 2084 * \order 2085 * \param[in] op Callback function passing data regarding the object 2086 * to the calling application 2087 * \param[in] op_data User-defined pointer to data required by the application 2088 * for its processing of the object 2089 * 2090 * \return On success, returns the return value of the first operator 2091 * that returns a positive value, or zero if all members were 2092 * processed with no operator returning non-zero. 2093 * 2094 * \return On failure, returns a negative value if something goes wrong 2095 * within the library, or the first negative value returned by 2096 * an operator. 2097 * 2098 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 2099 * the function H5Ovisit3() or the macro #H5Ovisit. 2100 * 2101 * \details H5Ovisit1() is a recursive iteration function to visit the 2102 * object \p obj_id and, if \p obj_id is a group, all objects in 2103 * and below it in an HDF5 file, thus providing a mechanism for 2104 * an application to perform a common set of operations across all 2105 * of those objects or a dynamically selected subset. For 2106 * non-recursive iteration across the members of a group, 2107 * see H5Literate1(). 2108 * 2109 * If \p obj_id is a group identifier, that group serves as the 2110 * root of a recursive iteration. If \p obj_id is a file identifier, 2111 * that file's root group serves as the root of the recursive 2112 * iteration. If \p obj_id is an attribute identifier, 2113 * then the object where the attribute is attached will be iterated. 2114 * If \p obj_id is any other type of object, such as a dataset or 2115 * named datatype, there is no iteration. 2116 * 2117 * Two parameters are used to establish the iteration: \p idx_type 2118 * and \p order. 2119 * 2120 * \p idx_type specifies the index to be used. If the links in 2121 * a group have not been indexed by the index type, they will 2122 * first be sorted by that index then the iteration will begin; 2123 * if the links have been so indexed, the sorting step will be 2124 * unnecessary, so the iteration may begin more quickly. 2125 * 2126 * Note that the index type passed in \p idx_type is a 2127 * <em>best effort</em> setting. If the application passes in 2128 * a value indicating iteration in creation order and a group is 2129 * encountered that was not tracked in creation order, that group 2130 * will be iterated over in alphanumeric order by name, or 2131 * <em>name order</em>. (<em>Name order</em> is the native order 2132 * used by the HDF5 library and is always available.) 2133 * 2134 * \p order specifies the order in which objects are to be inspected 2135 * along the index specified in \p idx_type. 2136 * 2137 * H5Lvisit1() and H5Ovisit1() are companion functions: one for 2138 * examining and operating on links; the other for examining 2139 * and operating on the objects that those links point to. Both 2140 * functions ensure that by the time the function completes 2141 * successfully, every link or object below the specified point 2142 * in the file has been presented to the application for whatever 2143 * processing the application requires. These functions assume 2144 * that the membership of the group being iterated over remains 2145 * unchanged through the iteration; if any of the links in the 2146 * group change during the iteration, the resulting behavior 2147 * is undefined. 2148 * 2149 * \version 1.10.5 The macro #H5Ovisit was removed and the function 2150 * H5Ovisit1() was copied to H5Ovisit(). 2151 * \version 1.10.3 Function H5Ovisit() was copied to H5Ovisit1(), 2152 * and the macro #H5Ovisit was created. 2153 * \version 1.8.8 Fortran subroutine introduced in this release. 2154 * 2155 * \since 1.8.0 2156 * 2157 */ 2158 H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1_t op, 2159 void *op_data); 2160 2161 /** 2162 *------------------------------------------------------------------------- 2163 * \ingroup H5O 2164 * 2165 * \brief Recursively visits all objects starting from a specified object 2166 * 2167 * \fgdta_loc_obj_id{loc_id} 2168 * \param[in] obj_name Name of the object, generally relative to 2169 * \p loc_id, that will serve as root of the iteration 2170 * \idx_type 2171 * \order 2172 * \param[in] op Callback function passing data regarding the object 2173 * to the calling application 2174 * \param[in] op_data User-defined pointer to data required by the application 2175 * for its processing of the object 2176 * \lapl_id 2177 * 2178 * \return On success, returns the return value of the first operator 2179 * that returns a positive value, or zero if all members were 2180 * processed with no operator returning non-zero. 2181 * 2182 * \return On failure, returns a negative value if something goes wrong 2183 * within the library, or the first negative value returned by 2184 * an operator. 2185 * 2186 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 2187 * the function H5Ovisit_by_name3() or the macro #H5Ovisit_by_name. 2188 * 2189 * \details H5Ovisit_by_name1() is a recursive iteration function to visit 2190 * the object specified by the \p loc_id / \p obj_name parameter 2191 * pair and, if that object is a group, all objects in and below it 2192 * in an HDF5 file, thus providing a mechanism for an application to 2193 * perform a common set of operations across all of those objects or 2194 * a dynamically selected subset. For non-recursive iteration across 2195 * the members of a group, see H5Literate1(). 2196 * 2197 * The object serving as the root of the iteration is specified 2198 * by the \p loc_id / \p obj_name parameter pair. \p loc_id specifies 2199 * a file or an object in a file; if \p loc_id is an attribute identifier, 2200 * the object where the attribute is attached will be used. 2201 * \p obj_name specifies either an object in the file (with an absolute 2202 * name based on the file's root group) or an object name relative 2203 * to \p loc_id. If \p loc_id fully specifies the object that is to serve 2204 * as the root of the iteration, \p obj_name should be '\c .' (a dot). 2205 * (Note that when \p loc_id fully specifies the object that is to serve 2206 * as the root of the iteration, the user may wish to consider 2207 * using H5Ovisit1() instead of H5Ovisit_by_name1().) 2208 * 2209 * Two parameters are used to establish the iteration: \p idx_type 2210 * and \p order. 2211 * 2212 * \p idx_type specifies the index to be used. If the links in 2213 * a group have not been indexed by the index type, they will 2214 * first be sorted by that index then the iteration will begin; 2215 * if the links have been so indexed, the sorting step will be 2216 * unnecessary, so the iteration may begin more quickly. 2217 * 2218 * Note that the index type passed in \p idx_type is a 2219 * <em>best effort</em> setting. If the application passes in a 2220 * value indicating iteration in creation order and a group is 2221 * encountered that was not tracked in creation order, that group 2222 * will be iterated over in alphanumeric order by name, or 2223 * <em>name order</em>. (<em>Name order</em> is the native order 2224 * used by the HDF5 library and is always available.) 2225 * 2226 * \p order specifies the order in which objects are to be inspected 2227 * along the index specified in \p idx_type. 2228 * 2229 * The \p op callback function and the effect of the callback 2230 * function's return value on the application are described 2231 * in H5Ovisit1(). 2232 * 2233 * The H5O_info1_t \c struct is defined in H5Opublic.h 2234 * and described in the H5Oget_info1() function entry. 2235 * 2236 * The H5Ovisit_by_name1() \p op_data parameter is a user-defined 2237 * pointer to the data required to process objects in the course 2238 * of the iteration. This pointer is passed back to each step of 2239 * the iteration in the callback function's \p op_data parameter. 2240 * 2241 * \p lapl_id is a link access property list. In the general case, 2242 * when default link access properties are acceptable, this can 2243 * be passed in as #H5P_DEFAULT. An example of a situation that 2244 * requires a non-default link access property list is when 2245 * the link is an external link; an external link may require 2246 * that a link prefix be set in a link access property list 2247 * (see H5Pset_elink_prefix()). 2248 * 2249 * H5Lvisit_by_name1() and H5Ovisit_by_name1() are companion 2250 * functions: one for examining and operating on links; the other 2251 * for examining and operating on the objects that those links point to. 2252 * Both functions ensure that by the time the function completes 2253 * successfully, every link or object below the specified point 2254 * in the file has been presented to the application for whatever 2255 * processing the application requires. 2256 * 2257 * \version 1.10.5 The macro #H5Ovisit_by_name was removed and the function 2258 * H5Ovisit_by_name1() was copied to #H5Ovisit_by_name. 2259 * \version 1.10.3 The H5Ovisit_by_name() function was renamed to H5Ovisit_by_name1(), 2260 * and the macro #H5Ovisit_by_name was created. 2261 * \version 1.8.11 Fortran subroutine introduced in this release. 2262 * 2263 * \since 1.8.0 2264 * 2265 */ 2266 H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 2267 H5_iter_order_t order, H5O_iterate1_t op, void *op_data, hid_t lapl_id); 2268 2269 /** 2270 *------------------------------------------------------------------------- 2271 * \ingroup H5O 2272 * 2273 * \brief Recursively visits all objects accessible from a specified object 2274 * 2275 * \fgdta_loc_obj_id{obj_id} 2276 * \idx_type 2277 * \order 2278 * \param[in] op Callback function passing data regarding the object 2279 * to the calling application 2280 * \param[in] op_data User-defined pointer to data required by the application 2281 * for its processing of the object 2282 * \param[in] fields Flags specifying the fields to be retrieved to the 2283 * callback \p op 2284 * 2285 * \return On success, returns the return value of the first operator 2286 * that returns a positive value, or zero if all members were 2287 * processed with no operator returning non-zero. 2288 * 2289 * \return On failure, returns a negative value if something goes wrong 2290 * within the library, or the first negative value returned by 2291 * an operator. 2292 * 2293 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 2294 * the function H5Ovisit3() or the macro #H5Ovisit. 2295 * 2296 * \details H5Ovisit2() is a recursive iteration function to visit the 2297 * object \p obj_id and, if \p obj_id is a group, all objects in 2298 * and below it in an HDF5 file, thus providing a mechanism for 2299 * an application to perform a common set of operations across all 2300 * of those objects or a dynamically selected subset. For 2301 * non-recursive iteration across the members of a group, 2302 * see H5Literate1(). 2303 * 2304 * If \p obj_id is a group identifier, that group serves as the 2305 * root of a recursive iteration. If \p obj_id is a file identifier, 2306 * that file's root group serves as the root of the recursive 2307 * iteration. If \p obj_id is an attribute identifier, 2308 * then the object where the attribute is attached will be iterated. 2309 * If \p obj_id is any other type of object, such as a dataset or 2310 * named datatype, there is no iteration. 2311 * 2312 * Two parameters are used to establish the iteration: \p idx_type 2313 * and \p order. 2314 * 2315 * \p idx_type specifies the index to be used. If the links in 2316 * a group have not been indexed by the index type, they will 2317 * first be sorted by that index then the iteration will begin; 2318 * if the links have been so indexed, the sorting step will be 2319 * unnecessary, so the iteration may begin more quickly. 2320 * 2321 * Note that the index type passed in \p idx_type is a 2322 * <em>best effort</em> setting. If the application passes in 2323 * a value indicating iteration in creation order and a group is 2324 * encountered that was not tracked in creation order, that group 2325 * will be iterated over in alphanumeric order by name, or 2326 * <em>name order</em>. (<em>Name order</em> is the native order 2327 * used by the HDF5 library and is always available.) 2328 * 2329 * \p order specifies the order in which objects are to be inspected 2330 * along the index specified in \p idx_type. 2331 * 2332 * The \p fields parameter contains flags to determine which fields will 2333 * be retrieved by the \p op callback function. These flags are defined 2334 * in the H5Opublic.h file: 2335 * \obj_info_fields 2336 * 2337 * H5Lvisit() and H5Ovisit() are companion functions: one for 2338 * examining and operating on links; the other for examining 2339 * and operating on the objects that those links point to. Both 2340 * functions ensure that by the time the function completes 2341 * successfully, every link or object below the specified point 2342 * in the file has been presented to the application for whatever 2343 * processing the application requires. These functions assume 2344 * that the membership of the group being iterated over remains 2345 * unchanged through the iteration; if any of the links in the 2346 * group change during the iteration, the resulting behavior 2347 * is undefined. 2348 * 2349 * 2350 * \since 1.10.3 2351 * 2352 */ 2353 H5_DLL herr_t H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1_t op, 2354 void *op_data, unsigned fields); 2355 2356 /** 2357 *------------------------------------------------------------------------- 2358 * \ingroup H5O 2359 * 2360 * \brief Recursively visits all objects starting from a specified object 2361 * 2362 * \fgdta_loc_obj_id{loc_id} 2363 * \param[in] obj_name Name of the object, generally relative to 2364 * \p loc_id, that will serve as root of the iteration 2365 * \idx_type 2366 * \order 2367 * \param[in] op Callback function passing data regarding the object 2368 * to the calling application 2369 * \param[in] op_data User-defined pointer to data required by the application 2370 * for its processing of the object 2371 * \param[in] fields Flags specifying the fields to be retrieved to the 2372 * callback function \p op 2373 * \lapl_id 2374 * 2375 * \return On success, returns the return value of the first operator 2376 * that returns a positive value, or zero if all members were 2377 * processed with no operator returning non-zero. 2378 * 2379 * \return On failure, returns a negative value if something goes wrong 2380 * within the library, or the first negative value returned by 2381 * an operator. 2382 * 2383 * \deprecated As of HDF5-1.12 this function has been deprecated in favor of 2384 * the function H5Ovisit_by_name3() or the macro #H5Ovisit_by_name. 2385 * 2386 * \details H5Ovisit_by_name2() is a recursive iteration function to visit 2387 * the object specified by the \p loc_id / \p obj_name parameter 2388 * pair and, if that object is a group, all objects in and below it 2389 * in an HDF5 file, thus providing a mechanism for an application to 2390 * perform a common set of operations across all of those objects or 2391 * a dynamically selected subset. For non-recursive iteration across 2392 * the members of a group, see #H5Literate. 2393 * 2394 * The object serving as the root of the iteration is specified 2395 * by the \p loc_id / \p obj_name parameter pair. \p loc_id specifies 2396 * a file or an object in a file; if \p loc_id is an attribute identifier, 2397 * the object where the attribute is attached will be used. 2398 * \p obj_name specifies either an object in the file (with an absolute 2399 * name based in the file's root group) or an object name relative 2400 * to \p loc_id. If \p loc_id fully specifies the object that is to serve 2401 * as the root of the iteration, \p obj_name should be '\c .' (a dot). 2402 * (Note that when \p loc_id fully specifies the object that is to serve 2403 * as the root of the iteration, the user may wish to consider 2404 * using H5Ovisit2() instead of #H5Ovisit_by_name.) 2405 * 2406 * Two parameters are used to establish the iteration: \p idx_type 2407 * and \p order. 2408 * 2409 * \p idx_type specifies the index to be used. If the links in 2410 * a group have not been indexed by the index type, they will 2411 * first be sorted by that index then the iteration will begin; 2412 * if the links have been so indexed, the sorting step will be 2413 * unnecessary, so the iteration may begin more quickly. 2414 * 2415 * Note that the index type passed in \p idx_type is a 2416 * <em>best effort</em> setting. If the application passes in a 2417 * value indicating iteration in creation order and a group is 2418 * encountered that was not tracked in creation order, that group 2419 * will be iterated over in alphanumeric order by name, or 2420 * <em>name order</em>. (<em>Name order</em> is the native order 2421 * used by the HDF5 library and is always available.) 2422 * 2423 * \p order specifies the order in which objects are to be inspected 2424 * along the index specified in \p idx_type. 2425 * 2426 * The \p op callback function and the effect of the callback 2427 * function's return value on the application are described 2428 * in H5Ovisit2(). 2429 * 2430 * The H5O_info1_t \c struct is defined in H5Opublic.h 2431 * and described in the H5Oget_info1() function entry. 2432 * 2433 * The H5Ovisit_by_name2() \p op_data parameter is a user-defined 2434 * pointer to the data required to process objects in the course 2435 * of the iteration. This pointer is passed back to each step of 2436 * the iteration in the callback function's \p op_data parameter. 2437 * 2438 * \p lapl_id is a link access property list. In the general case, 2439 * when default link access properties are acceptable, this can 2440 * be passed in as #H5P_DEFAULT. An example of a situation that 2441 * requires a non-default link access property list is when 2442 * the link is an external link; an external link may require 2443 * that a link prefix be set in a link access property list 2444 * (see H5Pset_elink_prefix()). 2445 * 2446 * The \p fields parameter contains flags to determine which fields will 2447 * be retrieved by the \p op callback function. These flags are defined 2448 * in the H5Opublic.h file: 2449 * \obj_info_fields 2450 * 2451 * #H5Lvisit_by_name and #H5Ovisit_by_name are companion 2452 * functions: one for examining and operating on links; the other 2453 * for examining and operating on the objects that those links point to. 2454 * Both functions ensure that by the time the function completes 2455 * successfully, every link or object below the specified point 2456 * in the file has been presented to the application for whatever 2457 * processing the application requires. 2458 * 2459 * \since 1.10.3 2460 * 2461 */ 2462 H5_DLL herr_t H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, 2463 H5_iter_order_t order, H5O_iterate1_t op, void *op_data, unsigned fields, 2464 hid_t lapl_id); 2465 2466 #endif /* H5_NO_DEPRECATED_SYMBOLS */ 2467 2468 #ifdef __cplusplus 2469 } 2470 #endif 2471 #endif /* H5Opublic_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |