![]() |
|
|||
File indexing completed on 2025-06-20 08:49:46
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 #ifndef H5LTpublic_H 0014 #define H5LTpublic_H 0015 0016 /* Flag definitions for H5LTopen_file_image() */ 0017 #define H5LT_FILE_IMAGE_OPEN_RW 0x0001 /* Open image for read-write */ 0018 #define H5LT_FILE_IMAGE_DONT_COPY 0x0002 /* The HDF5 lib won't copy */ 0019 /* user supplied image buffer. The same image is open with the core driver. */ 0020 #define H5LT_FILE_IMAGE_DONT_RELEASE 0x0004 /* The HDF5 lib won't */ 0021 /* deallocate user supplied image buffer. The user application is responsible */ 0022 /* for doing so. */ 0023 #define H5LT_FILE_IMAGE_ALL 0x0007 0024 0025 typedef enum H5LT_lang_t { 0026 H5LT_LANG_ERR = -1, /*this is the first*/ 0027 H5LT_DDL = 0, /*for DDL*/ 0028 H5LT_C = 1, /*for C*/ 0029 H5LT_FORTRAN = 2, /*for Fortran*/ 0030 H5LT_NO_LANG = 3 /*this is the last*/ 0031 } H5LT_lang_t; 0032 0033 #ifdef __cplusplus 0034 extern "C" { 0035 #endif 0036 0037 /** \page H5LT_UG HDF5 High Level Lite 0038 * @todo Under Construction 0039 */ 0040 0041 /**\defgroup H5LT HDF5 Lite APIs (H5LT,H5LD) 0042 * <em>Functions used to simplify creating and manipulating datasets, 0043 * attributes and other features (H5LT, H5LD)</em> 0044 * 0045 * The HDF5 Lite API consists of higher-level functions which do 0046 * more operations per call than the basic HDF5 interface. 0047 * The purpose is to wrap intuitive functions around certain sets 0048 * of features in the existing APIs. 0049 * It has the following sets of functions listed below. 0050 * 0051 * \note \Bold{Programming hints:} 0052 * \note To use any of these functions or subroutines, 0053 * you must first include the relevant include file (C) or 0054 * module (Fortran) in your application. 0055 * \note The following line includes the HDF5 Lite package, H5LT, 0056 * in C applications: 0057 * \code #include "hdf5_hl.h" \endcode 0058 * \note This line includes the H5LT module in Fortran applications: 0059 * \code use h5lt \endcode 0060 * 0061 * <table> 0062 * <tr valign="top"><td style="border: none;"> 0063 * 0064 * - Dataset Functions 0065 * - Make dataset functions 0066 * - \ref H5LTmake_dataset 0067 * - \ref H5LTmake_dataset_char 0068 * - \ref H5LTmake_dataset_short 0069 * - \ref H5LTmake_dataset_int 0070 * - \ref H5LTmake_dataset_long 0071 * - \ref H5LTmake_dataset_float 0072 * - \ref H5LTmake_dataset_double 0073 * - \ref H5LTmake_dataset_string 0074 * 0075 * - Read dataset functions 0076 * - \ref H5LTread_dataset 0077 * - \ref H5LTread_dataset_char 0078 * - \ref H5LTread_dataset_short 0079 * - \ref H5LTread_dataset_int 0080 * - \ref H5LTread_dataset_long 0081 * - \ref H5LTread_dataset_float 0082 * - \ref H5LTread_dataset_double 0083 * - \ref H5LTread_dataset_string 0084 * 0085 * - Query dataset functions 0086 * - \ref H5LTfind_dataset 0087 * - \ref H5LTget_dataset_ndims 0088 * - \ref H5LTget_dataset_info 0089 * 0090 * - Dataset watch functions 0091 * - \ref H5LDget_dset_dims 0092 * - \ref H5LDget_dset_elmts 0093 * - \ref H5LDget_dset_type_size 0094 * 0095 * </td><td style="border: none;"> 0096 * 0097 * - Attribute Functions 0098 * - Set attribute functions 0099 * - \ref H5LTset_attribute_string 0100 * - \ref H5LTset_attribute_char 0101 * - \ref H5LTset_attribute_uchar 0102 * - \ref H5LTset_attribute_short 0103 * - \ref H5LTset_attribute_ushort 0104 * - \ref H5LTset_attribute_int 0105 * - \ref H5LTset_attribute_uint 0106 * - \ref H5LTset_attribute_long 0107 * - \ref H5LTset_attribute_long_long 0108 * - \ref H5LTset_attribute_ulong 0109 * - \ref H5LTset_attribute_ullong 0110 * - \ref H5LTset_attribute_float 0111 * - \ref H5LTset_attribute_double 0112 * - <code>H5LTset_attribute_f</code> (fortran ONLY) 0113 * 0114 * - Get attribute functions 0115 * - \ref H5LTget_attribute 0116 * - \ref H5LTget_attribute_string 0117 * - \ref H5LTget_attribute_char 0118 * - \ref H5LTget_attribute_uchar 0119 * - \ref H5LTget_attribute_short 0120 * - \ref H5LTget_attribute_ushort 0121 * - \ref H5LTget_attribute_int 0122 * - \ref H5LTget_attribute_uint 0123 * - \ref H5LTget_attribute_long 0124 * - \ref H5LTget_attribute_long_long 0125 * - \ref H5LTget_attribute_ulong 0126 * - \ref H5LTget_attribute_ullong 0127 * - \ref H5LTget_attribute_float 0128 * - \ref H5LTget_attribute_double 0129 * 0130 * - Query attribute functions 0131 * - \ref H5LTfind_attribute 0132 * - \ref H5LTget_attribute_info 0133 * - \ref H5LTget_attribute_ndims 0134 * 0135 * </td><td style="border: none;"> 0136 * 0137 * - Datatype Functions 0138 * - Datatype translation functions 0139 * - \ref H5LTtext_to_dtype 0140 * - \ref H5LTdtype_to_text 0141 * 0142 * - File image function 0143 * - Open file image function 0144 * - \ref H5LTopen_file_image 0145 * 0146 * - Path and object function 0147 * - Query path and object function 0148 * - \ref H5LTpath_valid 0149 * 0150 * </td></tr> 0151 * </table> 0152 * 0153 */ 0154 0155 /*------------------------------------------------------------------------- 0156 * 0157 * Make dataset functions 0158 * 0159 *------------------------------------------------------------------------- 0160 */ 0161 0162 /** 0163 *------------------------------------------------------------------------- 0164 * \ingroup H5LT 0165 * 0166 * \brief Creates and writes a dataset of a type \p type_id. 0167 * 0168 * \fg_loc_id 0169 * \param[in] dset_name The Name of the dataset to create 0170 * \param[in] rank Number of dimensions of dataspace 0171 * \param[in] dims An array of the size of each dimension 0172 * \param[in] type_id Identifier of the datatype to use when creating the dataset 0173 * \param[in] buffer Buffer with data to be written to the dataset 0174 * 0175 * \return \herr_t 0176 * 0177 * \details H5LTmake_dataset() creates and writes a dataset named 0178 * \p dset_name attached to the object specified by the 0179 * identifier \p loc_id. 0180 * 0181 * The parameter \p type_id can be any valid HDF5 Prdefined \ref PDTNAT; 0182 * For example, setting \p type_id to #H5T_NATIVE_INT will result in a dataset 0183 * of <em>signed \e integer datatype</em>. 0184 * 0185 * \version 1.10.0 Fortran 2003 subroutine added to accept a C address of the data buffer. 0186 * \version 1.8.7 Fortran subroutine modified in this release to accommodate arrays 0187 * with more than three dimensions. 0188 * 0189 */ 0190 H5_HLDLL herr_t H5LTmake_dataset(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0191 hid_t type_id, const void *buffer); 0192 0193 /** 0194 *------------------------------------------------------------------------- 0195 * \ingroup H5LT 0196 * 0197 * \brief Creates and writes a dataset. 0198 * 0199 * \fg_loc_id 0200 * \param[in] dset_name The Name of the dataset to create 0201 * \param[in] rank Number of dimensions of dataspace 0202 * \param[in] dims An array of the size of each dimension 0203 * \param[in] buffer Buffer with data to be written to the dataset 0204 * 0205 * \return \herr_t 0206 * 0207 * \details H5LTmake_dataset_char() creates and writes a dataset 0208 * named \p dset_name attached to the object specified by 0209 * the identifier \p loc_id. 0210 * 0211 * The dataset's datatype will be \e character, #H5T_NATIVE_CHAR. 0212 * 0213 */ 0214 H5_HLDLL herr_t H5LTmake_dataset_char(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0215 const char *buffer); 0216 0217 /** 0218 *------------------------------------------------------------------------- 0219 * \ingroup H5LT 0220 * 0221 * \brief Creates and writes a dataset. 0222 * 0223 * \fg_loc_id 0224 * \param[in] dset_name The Name of the dataset to create 0225 * \param[in] rank Number of dimensions of dataspace 0226 * \param[in] dims An array of the size of each dimension 0227 * \param[in] buffer Buffer with data to be written to the dataset 0228 * 0229 * \return \herr_t 0230 * 0231 * \details H5LTmake_dataset_short() creates and writes a dataset 0232 * named \p dset_name attached to the object specified by 0233 * the identifier \p loc_id. 0234 * 0235 * The dataset's datatype will be <em>short signed integer</em>, 0236 * #H5T_NATIVE_SHORT. 0237 * 0238 */ 0239 H5_HLDLL herr_t H5LTmake_dataset_short(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0240 const short *buffer); 0241 0242 /** 0243 *------------------------------------------------------------------------- 0244 * \ingroup H5LT 0245 * 0246 * \brief Creates and writes a dataset. 0247 * 0248 * \fg_loc_id 0249 * \param[in] dset_name The Name of the dataset to create 0250 * \param[in] rank Number of dimensions of dataspace 0251 * \param[in] dims An array of the size of each dimension 0252 * \param[in] buffer Buffer with data to be written to the dataset 0253 * 0254 * \return \herr_t 0255 * 0256 * \details H5LTmake_dataset_int() creates and writes a dataset 0257 * named \p dset_name attached to the object specified by 0258 * the identifier \p loc_id. 0259 * 0260 * The dataset's datatype will be <em>native signed integer</em>, 0261 * #H5T_NATIVE_INT. 0262 * 0263 * \version Fortran subroutine modified in this release to accommodate 0264 * arrays with more than three dimensions. 0265 * 0266 */ 0267 H5_HLDLL herr_t H5LTmake_dataset_int(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0268 const int *buffer); 0269 0270 /** 0271 *------------------------------------------------------------------------- 0272 * \ingroup H5LT 0273 * 0274 * \brief Creates and writes a dataset. 0275 * 0276 * \fg_loc_id 0277 * \param[in] dset_name The Name of the dataset to create 0278 * \param[in] rank Number of dimensions of dataspace 0279 * \param[in] dims An array of the size of each dimension 0280 * \param[in] buffer Buffer with data to be written to the dataset 0281 * 0282 * \return \herr_t 0283 * 0284 * \details H5LTmake_dataset_long() creates and writes a dataset 0285 * named \p dset_name attached to the object specified by 0286 * the identifier \p loc_id. 0287 * 0288 * The dataset's datatype will be <em>long signed integer</em>, 0289 * #H5T_NATIVE_LONG. 0290 * 0291 */ 0292 H5_HLDLL herr_t H5LTmake_dataset_long(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0293 const long *buffer); 0294 0295 /** 0296 *------------------------------------------------------------------------- 0297 * \ingroup H5LT 0298 * 0299 * \brief Creates and writes a dataset. 0300 * 0301 * \fg_loc_id 0302 * \param[in] dset_name The Name of the dataset to create 0303 * \param[in] rank Number of dimensions of dataspace 0304 * \param[in] dims An array of the size of each dimension 0305 * \param[in] buffer Buffer with data to be written to the dataset 0306 * 0307 * \return \herr_t 0308 * 0309 * \details H5LTmake_dataset_float() creates and writes a dataset 0310 * named \p dset_name attached to the object specified by 0311 * the identifier \p loc_id. 0312 * 0313 * The dataset's datatype will be <em>native floating point</em>, 0314 * #H5T_NATIVE_FLOAT. 0315 * 0316 * \version 1.8.7 Fortran subroutine modified in this release to accommodate 0317 * arrays with more than three dimensions. 0318 * 0319 */ 0320 H5_HLDLL herr_t H5LTmake_dataset_float(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0321 const float *buffer); 0322 0323 /** 0324 *------------------------------------------------------------------------- 0325 * \ingroup H5LT 0326 * 0327 * \brief Creates and writes a dataset. 0328 * 0329 * \fg_loc_id 0330 * \param[in] dset_name The Name of the dataset to create 0331 * \param[in] rank Number of dimensions of dataspace 0332 * \param[in] dims An array of the size of each dimension 0333 * \param[in] buffer Buffer with data to be written to the dataset 0334 * 0335 * \return \herr_t 0336 * 0337 * \details H5LTmake_dataset_double() creates and writes a dataset 0338 * named \p dset_name attached to the object specified by 0339 * the identifier \p loc_id. 0340 * 0341 * The dataset's datatype will be 0342 * <em>native floating-point double</em>, #H5T_NATIVE_DOUBLE. 0343 * 0344 * \version 1.8.7 Fortran subroutine modified in this release to accommodate 0345 * arrays with more than three dimensions. 0346 * 0347 */ 0348 H5_HLDLL herr_t H5LTmake_dataset_double(hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, 0349 const double *buffer); 0350 0351 /** 0352 *------------------------------------------------------------------------- 0353 * \ingroup H5LT 0354 * 0355 * \brief Creates and writes a dataset with string datatype. 0356 * 0357 * \fg_loc_id 0358 * \param[in] dset_name The name of the dataset to create 0359 * \param[in] buf Buffer with data to be written to the dataset 0360 * 0361 * \return \herr_t 0362 * 0363 * \details H5LTmake_dataset_string() creates and writes a dataset 0364 * named \p dset_name attached to the object specified by 0365 * the identifier \p loc_id. 0366 * 0367 * The dataset's datatype will be <em>C string</em>, #H5T_C_S1. 0368 * 0369 */ 0370 H5_HLDLL herr_t H5LTmake_dataset_string(hid_t loc_id, const char *dset_name, const char *buf); 0371 0372 /*------------------------------------------------------------------------- 0373 * 0374 * Read dataset functions 0375 * 0376 *------------------------------------------------------------------------- 0377 */ 0378 0379 /** 0380 *------------------------------------------------------------------------- 0381 * \ingroup H5LT 0382 * 0383 * \brief Reads a dataset from disk. 0384 * 0385 * \fg_loc_id 0386 * \param[in] dset_name The name of the dataset to read 0387 * \param[in] type_id Identifier of the datatype to use when reading 0388 * the dataset 0389 * \param[out] buffer Buffer with data 0390 * 0391 * \return \herr_t 0392 * 0393 * \details H5LTread_dataset() reads a dataset named \p dset_name 0394 * attached to the object specified by the identifier \p loc_id. 0395 * 0396 * \version 1.10.0 Fortran 2003 subroutine added to accept a C 0397 * address of the data buffer. 0398 * \version 1.8.7 Fortran subroutine modified in this release to 0399 * accommodate arrays with more than three dimensions. 0400 * 0401 */ 0402 H5_HLDLL herr_t H5LTread_dataset(hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer); 0403 0404 /** 0405 *------------------------------------------------------------------------- 0406 * \ingroup H5LT 0407 * 0408 * \brief Reads a dataset from disk. 0409 * 0410 * \fg_loc_id 0411 * \param[in] dset_name The name of the dataset to read 0412 * \param[out] buffer Buffer with data 0413 * 0414 * \return \herr_t 0415 * 0416 * \details H5LTread_dataset_char() reads a dataset named \p dset_name 0417 * attached to the object specified by the identifier \p loc_id. 0418 * The HDF5 datatype is #H5T_NATIVE_CHAR. 0419 * 0420 */ 0421 H5_HLDLL herr_t H5LTread_dataset_char(hid_t loc_id, const char *dset_name, char *buffer); 0422 0423 /** 0424 *------------------------------------------------------------------------- 0425 * \ingroup H5LT 0426 * 0427 * \brief Reads a dataset from disk. 0428 * 0429 * \fg_loc_id 0430 * \param[in] dset_name The name of the dataset to read 0431 * \param[out] buffer Buffer with data 0432 * 0433 * \return \herr_t 0434 * 0435 * \details H5LTread_dataset_short() reads a dataset named \p dset_name 0436 * attached to the object specified by the identifier \p loc_id. 0437 * The HDF5 datatype is #H5T_NATIVE_SHORT. 0438 * 0439 */ 0440 H5_HLDLL herr_t H5LTread_dataset_short(hid_t loc_id, const char *dset_name, short *buffer); 0441 0442 /** 0443 *------------------------------------------------------------------------- 0444 * \ingroup H5LT 0445 * 0446 * \brief Reads a dataset from disk. 0447 * 0448 * \fg_loc_id 0449 * \param[in] dset_name The name of the dataset to read 0450 * \param[out] buffer Buffer with data 0451 * 0452 * \return \herr_t 0453 * 0454 * \details H5LTread_dataset_int() reads a dataset named \p dset_name 0455 * attached to the object specified by the identifier \p loc_id. 0456 * The HDF5 datatype is #H5T_NATIVE_INT. 0457 * 0458 * \version 1.8.7 Fortran subroutine modified in this release to 0459 * accommodate arrays with more than three dimensions. 0460 * 0461 */ 0462 H5_HLDLL herr_t H5LTread_dataset_int(hid_t loc_id, const char *dset_name, int *buffer); 0463 0464 /** 0465 *------------------------------------------------------------------------- 0466 * \ingroup H5LT 0467 * 0468 * \brief Reads a dataset from disk. 0469 * 0470 * \fg_loc_id 0471 * \param[in] dset_name The name of the dataset to read 0472 * \param[out] buffer Buffer with data 0473 * 0474 * \return \herr_t 0475 * 0476 * \details H5LTread_dataset_long() reads a dataset named \p dset_name 0477 * attached to the object specified by the identifier \p loc_id. 0478 * The HDF5 datatype is #H5T_NATIVE_LONG. 0479 * 0480 */ 0481 H5_HLDLL herr_t H5LTread_dataset_long(hid_t loc_id, const char *dset_name, long *buffer); 0482 0483 /** 0484 *------------------------------------------------------------------------- 0485 * \ingroup H5LT 0486 * 0487 * \brief Reads a dataset from disk. 0488 * 0489 * \fg_loc_id 0490 * \param[in] dset_name The name of the dataset to read 0491 * \param[out] buffer Buffer with data 0492 * 0493 * \return \herr_t 0494 * 0495 * \details H5LTread_dataset_float() reads a dataset named \p dset_name 0496 * attached to the object specified by the identifier \p loc_id. 0497 * The HDF5 datatype is #H5T_NATIVE_FLOAT. 0498 * 0499 * \version 1.8.7 Fortran subroutine modified in this release to 0500 * accommodate arrays with more than three dimensions. 0501 */ 0502 H5_HLDLL herr_t H5LTread_dataset_float(hid_t loc_id, const char *dset_name, float *buffer); 0503 0504 /** 0505 *------------------------------------------------------------------------- 0506 * \ingroup H5LT 0507 * 0508 * \brief Reads a dataset from disk. 0509 * 0510 * \fg_loc_id 0511 * \param[in] dset_name The name of the dataset to read 0512 * \param[out] buffer Buffer with data 0513 * 0514 * \return \herr_t 0515 * 0516 * \details H5LTread_dataset_double() reads a dataset named \p dset_name 0517 * attached to the object specified by the identifier \p loc_id. 0518 * The HDF5 datatype is #H5T_NATIVE_DOUBLE. 0519 * 0520 * \version 1.8.7 Fortran subroutine modified in this release to 0521 * accommodate arrays with more than three dimensions. 0522 */ 0523 H5_HLDLL herr_t H5LTread_dataset_double(hid_t loc_id, const char *dset_name, double *buffer); 0524 0525 /** 0526 *------------------------------------------------------------------------- 0527 * \ingroup H5LT 0528 * 0529 * \brief Reads a dataset from disk. 0530 * 0531 * \fg_loc_id 0532 * \param[in] dset_name The name of the dataset to read 0533 * \param[out] buf Buffer with data 0534 * 0535 * \return \herr_t 0536 * 0537 * \details H5LTread_dataset_string() reads a dataset named \p dset_name 0538 * attached to the object specified by the identifier \p loc_id. 0539 * The HDF5 datatype is #H5T_C_S1. 0540 * 0541 */ 0542 H5_HLDLL herr_t H5LTread_dataset_string(hid_t loc_id, const char *dset_name, char *buf); 0543 0544 /*------------------------------------------------------------------------- 0545 * 0546 * Query dataset functions 0547 * 0548 *------------------------------------------------------------------------- 0549 */ 0550 0551 /** 0552 *------------------------------------------------------------------------- 0553 * \ingroup H5LT 0554 * 0555 * \brief Gets the dimensionality of a dataset 0556 * 0557 * \param[in] loc_id Identifier of the object to 0558 * locate the dataset within 0559 * \param[in] dset_name The dataset name 0560 * \param[out] rank The dimensionality of the dataset 0561 * 0562 * \return \herr_t 0563 * 0564 * \details H5LTget_dataset_ndims() gets the dimensionality of a dataset 0565 * named \p dset_name exists attached to the object \p loc_id. 0566 * 0567 */ 0568 H5_HLDLL herr_t H5LTget_dataset_ndims(hid_t loc_id, const char *dset_name, int *rank); 0569 0570 /** 0571 *------------------------------------------------------------------------- 0572 * \ingroup H5LT 0573 * 0574 * \brief Retrieves information about a dataset 0575 * 0576 * \param[in] loc_id Identifier of the object to locate 0577 * the dataset within 0578 * \param[in] dset_name The dataset name 0579 * \param[out] dims The dimensions of the dataset 0580 * \param[out] type_class The class identifier. #H5T_class_t is defined in 0581 * H5Tpublic.h. See H5Tget_class() for a list 0582 * of class types. 0583 * \param[out] type_size The size of the datatype in bytes 0584 * 0585 * \return \herr_t 0586 * 0587 * \details H5LTget_dataset_info() retrieves information about a dataset 0588 * named \p dset_name attached to the object \p loc_id. 0589 * 0590 */ 0591 H5_HLDLL herr_t H5LTget_dataset_info(hid_t loc_id, const char *dset_name, hsize_t *dims, 0592 H5T_class_t *type_class, size_t *type_size); 0593 0594 /** 0595 *------------------------------------------------------------------------- 0596 * \ingroup H5LT 0597 * 0598 * \brief Determines whether a dataset exists. 0599 * 0600 * \param[in] loc_id Identifier of the group containing the dataset 0601 * \param[in] name Dataset name 0602 * 0603 * \return \htri_t 0604 * 0605 * \details H5LTfind_dataset() determines whether a dataset named 0606 * \p name exists in the group specified by \p loc_id. 0607 * 0608 * \p loc_id must be a group identifier and \p name must 0609 * specify a dataset that is a member of that group. 0610 * 0611 */ 0612 H5_HLDLL herr_t H5LTfind_dataset(hid_t loc_id, const char *name); 0613 0614 /*------------------------------------------------------------------------- 0615 * 0616 * Set attribute functions 0617 * 0618 *------------------------------------------------------------------------- 0619 */ 0620 0621 /** 0622 *------------------------------------------------------------------------- 0623 * \ingroup H5LT 0624 * 0625 * \brief Creates and writes a string attribute. 0626 * 0627 * \param[in] loc_id Identifier of the object (dataset or group) 0628 * to create the attribute within 0629 * \param[in] obj_name The name of the object to attach the attribute 0630 * \param[in] attr_name The attribute name 0631 * \param[in] attr_data Buffer with data to be written to the attribute 0632 * 0633 * \return \herr_t 0634 * 0635 * \details H5LTset_attribute_string() creates and writes a string attribute 0636 * named \p attr_name and attaches it to the object specified by 0637 * the name \p obj_name. If the attribute already exists, 0638 * it is overwritten. 0639 * 0640 */ 0641 H5_HLDLL herr_t H5LTset_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_name, 0642 const char *attr_data); 0643 0644 /** 0645 *------------------------------------------------------------------------- 0646 * \ingroup H5LT 0647 * 0648 * \brief Creates and writes an attribute. 0649 * 0650 * \param[in] loc_id Identifier of the object (dataset or group) 0651 * to create the attribute within 0652 * \param[in] obj_name The name of the object to attach the attribute 0653 * \param[in] attr_name The attribute name 0654 * \param[in] buffer Buffer with data to be written to the attribute 0655 * \param[in] size The size of the 1D array (one in the case of a 0656 * scalar attribute). This value is used by 0657 * H5Screate_simple() to create the dataspace. 0658 * 0659 * \return \herr_t 0660 * 0661 * \details H5LTset_attribute_char() creates and writes a numerical attribute 0662 * named \p attr_name and attaches it to the object specified by the 0663 * name \p obj_name. The attribute has a dimensionality of 1. 0664 * The HDF5 datatype of the attribute is #H5T_NATIVE_CHAR. 0665 * 0666 */ 0667 H5_HLDLL herr_t H5LTset_attribute_char(hid_t loc_id, const char *obj_name, const char *attr_name, 0668 const char *buffer, size_t size); 0669 0670 /** 0671 *------------------------------------------------------------------------- 0672 * \ingroup H5LT 0673 * 0674 * \brief Creates and writes an attribute. 0675 * 0676 * \param[in] loc_id Identifier of the object (dataset or group) 0677 * to create the attribute within 0678 * \param[in] obj_name The name of the object to attach the attribute 0679 * \param[in] attr_name The attribute name 0680 * \param[in] buffer Buffer with data to be written to the attribute 0681 * \param[in] size The size of the 1D array (one in the case of a 0682 * scalar attribute). This value is used by 0683 * H5Screate_simple() to create the dataspace. 0684 * 0685 * \return \herr_t 0686 * 0687 * \details H5LTset_attribute_uchar() creates and writes a numerical attribute 0688 * named \p attr_name and attaches it to the object specified by the 0689 * name \p obj_name. The attribute has a dimensionality of 1. 0690 * The HDF5 datatype of the attribute is #H5T_NATIVE_UCHAR. 0691 * 0692 */ 0693 H5_HLDLL herr_t H5LTset_attribute_uchar(hid_t loc_id, const char *obj_name, const char *attr_name, 0694 const unsigned char *buffer, size_t size); 0695 0696 /** 0697 *------------------------------------------------------------------------- 0698 * \ingroup H5LT 0699 * 0700 * \brief Creates and writes an attribute. 0701 * 0702 * \param[in] loc_id Identifier of the object (dataset or group) 0703 * to create the attribute within 0704 * \param[in] obj_name The name of the object to attach the attribute 0705 * \param[in] attr_name The attribute name 0706 * \param[in] buffer Buffer with data to be written to the attribute 0707 * \param[in] size The size of the 1D array (one in the case of a 0708 * scalar attribute). This value is used by 0709 * H5Screate_simple() to create the dataspace. 0710 * 0711 * \return \herr_t 0712 * 0713 * \details H5LTset_attribute_short() creates and writes a numerical attribute 0714 * named \p attr_name and attaches it to the object specified by the 0715 * name \p obj_name. The attribute has a dimensionality of 1. 0716 * The HDF5 datatype of the attribute is #H5T_NATIVE_SHORT. 0717 * 0718 */ 0719 H5_HLDLL herr_t H5LTset_attribute_short(hid_t loc_id, const char *obj_name, const char *attr_name, 0720 const short *buffer, size_t size); 0721 0722 /** 0723 *------------------------------------------------------------------------- 0724 * \ingroup H5LT 0725 * 0726 * \brief Creates and writes an attribute. 0727 * 0728 * \param[in] loc_id Identifier of the object (dataset or group) 0729 * to create the attribute within 0730 * \param[in] obj_name The name of the object to attach the attribute 0731 * \param[in] attr_name The attribute name 0732 * \param[in] buffer Buffer with data to be written to the attribute 0733 * \param[in] size The size of the 1D array (one in the case of a 0734 * scalar attribute). This value is used by 0735 * H5Screate_simple() to create the dataspace. 0736 * 0737 * \return \herr_t 0738 * 0739 * \details H5LTset_attribute_ushort() creates and writes a numerical attribute 0740 * named \p attr_name and attaches it to the object specified by the 0741 * name \p obj_name. The attribute has a dimensionality of 1. 0742 * The HDF5 datatype of the attribute is #H5T_NATIVE_USHORT. 0743 * 0744 */ 0745 H5_HLDLL herr_t H5LTset_attribute_ushort(hid_t loc_id, const char *obj_name, const char *attr_name, 0746 const unsigned short *buffer, size_t size); 0747 0748 /** 0749 *------------------------------------------------------------------------- 0750 * \ingroup H5LT 0751 * 0752 * \brief Creates and writes an attribute. 0753 * 0754 * \param[in] loc_id Identifier of the object (dataset or group) 0755 * to create the attribute within 0756 * \param[in] obj_name The name of the object to attach the attribute 0757 * \param[in] attr_name The attribute name 0758 * \param[in] buffer Buffer with data to be written to the attribute 0759 * \param[in] size The size of the 1D array (one in the case of a 0760 * scalar attribute). This value is used by 0761 * H5Screate_simple() to create the dataspace. 0762 * 0763 * \return \herr_t 0764 * 0765 * \details H5LTset_attribute_int() creates and writes a numerical integer 0766 * attribute named \p attr_name and attaches it to the object 0767 * specified by the name \p obj_name. The attribute has a 0768 * dimensionality of 1. The HDF5 datatype of the attribute 0769 * is #H5T_NATIVE_INT. 0770 * 0771 */ 0772 H5_HLDLL herr_t H5LTset_attribute_int(hid_t loc_id, const char *obj_name, const char *attr_name, 0773 const int *buffer, size_t size); 0774 0775 /** 0776 *------------------------------------------------------------------------- 0777 * \ingroup H5LT 0778 * 0779 * \brief Creates and writes an attribute. 0780 * 0781 * \param[in] loc_id Identifier of the object (dataset or group) 0782 * to create the attribute within 0783 * \param[in] obj_name The name of the object to attach the attribute 0784 * \param[in] attr_name The attribute name 0785 * \param[in] buffer Buffer with data to be written to the attribute 0786 * \param[in] size The size of the 1D array (one in the case of a 0787 * scalar attribute). This value is used by 0788 * H5Screate_simple() to create the dataspace. 0789 * 0790 * \return \herr_t 0791 * 0792 * \details H5LTset_attribute_uint() creates and writes a numerical integer 0793 * attribute named \p attr_name and attaches it to the object specified 0794 * by the name \p obj_name. The attribute has a dimensionality of 1. 0795 * The HDF5 datatype of the attribute is #H5T_NATIVE_UINT. 0796 * 0797 */ 0798 H5_HLDLL herr_t H5LTset_attribute_uint(hid_t loc_id, const char *obj_name, const char *attr_name, 0799 const unsigned int *buffer, size_t size); 0800 0801 /** 0802 *------------------------------------------------------------------------- 0803 * \ingroup H5LT 0804 * 0805 * \brief Creates and writes an attribute. 0806 * 0807 * \param[in] loc_id Identifier of the object (dataset or group) 0808 * to create the attribute within 0809 * \param[in] obj_name The name of the object to attach the attribute 0810 * \param[in] attr_name The attribute name 0811 * \param[in] buffer Buffer with data to be written to the attribute 0812 * \param[in] size The size of the 1D array (one in the case of a 0813 * scalar attribute). This value is used by 0814 * H5Screate_simple() to create the dataspace. 0815 * 0816 * \return \herr_t 0817 * 0818 * \details H5LTset_attribute_long() creates and writes a numerical 0819 * attribute named \p attr_name and attaches it to the object 0820 * specified by the name \p obj_name. The attribute has a 0821 * dimensionality of 1. The HDF5 datatype of the attribute 0822 * is #H5T_NATIVE_LONG. 0823 * 0824 */ 0825 H5_HLDLL herr_t H5LTset_attribute_long(hid_t loc_id, const char *obj_name, const char *attr_name, 0826 const long *buffer, size_t size); 0827 0828 /** 0829 *------------------------------------------------------------------------- 0830 * \ingroup H5LT 0831 * 0832 * \brief Creates and writes an attribute. 0833 * 0834 * \param[in] loc_id Location of the object to which the attribute 0835 * is to be attached 0836 * \param[in] obj_name That object's name 0837 * \param[in] attr_name Attribute name 0838 * \param[in] buffer Attribute value 0839 * \param[in] size Attribute size 0840 * 0841 * \return \herr_t 0842 * 0843 * \details H5LTset_attribute_long_long() creates and writes a numerical 0844 * attribute named \p attr_name and attaches it to the object 0845 * specified by the name \p obj_name. 0846 * 0847 * The attribute has a dimensionality of 1 and its HDF5 datatype 0848 * is #H5T_NATIVE_LLONG. 0849 * 0850 */ 0851 H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name, const char *attr_name, 0852 const long long *buffer, size_t size); 0853 0854 /** 0855 *------------------------------------------------------------------------- 0856 * \ingroup H5LT 0857 * 0858 * \brief Creates and writes an attribute. 0859 * 0860 * \param[in] loc_id Identifier of the object (dataset or group) 0861 * to create the attribute within 0862 * \param[in] obj_name The name of the object to attach the attribute 0863 * \param[in] attr_name The attribute name 0864 * \param[in] buffer Buffer with data to be written to the attribute 0865 * \param[in] size The size of the 1D array (one in the case of a 0866 * scalar attribute). This value is used by 0867 * H5Screate_simple() to create the dataspace. 0868 * 0869 * \return \herr_t 0870 * 0871 * \details H5LTset_attribute_ulong() creates and writes a numerical 0872 * attribute named \p attr_name and attaches it to the object 0873 * specified by the name \p obj_name. The attribute has a 0874 * dimensionality of 1. The HDF5 datatype of the attribute 0875 * is #H5T_NATIVE_ULONG. 0876 * 0877 */ 0878 H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name, 0879 const unsigned long *buffer, size_t size); 0880 0881 /** 0882 *------------------------------------------------------------------------- 0883 * \ingroup H5LT 0884 * 0885 * \brief Creates and writes an attribute. 0886 * 0887 * \param[in] loc_id Location of the object to which the attribute 0888 * is to be attached 0889 * \param[in] obj_name That object's name 0890 * \param[in] attr_name Attribute name 0891 * \param[in] buffer Attribute value 0892 * \param[in] size Attribute size 0893 * 0894 * \return \herr_t 0895 * 0896 * \details H5LTset_attribute_ullong() creates and writes a numerical 0897 * attribute named \p attr_name and attaches it to the object 0898 * specified by the name \p obj_name. 0899 * 0900 * The attribute has a dimensionality of 1 and its HDF5 datatype 0901 * is #H5T_NATIVE_ULLONG. 0902 * 0903 */ 0904 H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, 0905 const unsigned long long *buffer, size_t size); 0906 0907 /** 0908 *------------------------------------------------------------------------- 0909 * \ingroup H5LT 0910 * 0911 * \brief Creates and writes an attribute. 0912 * 0913 * \param[in] loc_id Identifier of the object (dataset or group) 0914 * to create the attribute within 0915 * \param[in] obj_name The name of the object to attach the attribute 0916 * \param[in] attr_name The attribute name 0917 * \param[in] buffer Buffer with data to be written to the attribute 0918 * \param[in] size The size of the 1D array (one in the case of a 0919 * scalar attribute). This value is used by 0920 * H5Screate_simple() to create the dataspace. 0921 * 0922 * \return \herr_t 0923 * 0924 * \details H5LTset_attribute_float() creates and writes a numerical 0925 * floating point attribute named \p attr_name and attaches 0926 * it to the object specified by the name \p obj_name. 0927 * The attribute has a dimensionality of 1. The HDF5 datatype 0928 * of the attribute is #H5T_NATIVE_FLOAT. 0929 * 0930 */ 0931 H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name, 0932 const float *buffer, size_t size); 0933 0934 /** 0935 *------------------------------------------------------------------------- 0936 * \ingroup H5LT 0937 * 0938 * \brief Creates and writes an attribute. 0939 * 0940 * \param[in] loc_id Identifier of the object (dataset or group) 0941 * to create the attribute within 0942 * \param[in] obj_name The name of the object to attach the attribute 0943 * \param[in] attr_name The attribute name 0944 * \param[in] buffer Buffer with data to be written to the attribute 0945 * \param[in] size The size of the 1D array (one in the case of a 0946 * scalar attribute). This value is used by 0947 * H5Screate_simple() to create the dataspace. 0948 * 0949 * \return \herr_t 0950 * 0951 * \details H5LTset_attribute_double() creates and writes a numerical 0952 * attribute named \p attr_name and attaches 0953 * it to the object specified by the name \p obj_name. 0954 * The attribute has a dimensionality of 1. The HDF5 datatype 0955 * of the attribute is #H5T_NATIVE_DOUBLE. 0956 * 0957 */ 0958 H5_HLDLL herr_t H5LTset_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_name, 0959 const double *buffer, size_t size); 0960 0961 /*------------------------------------------------------------------------- 0962 * 0963 * Get attribute functions 0964 * 0965 *------------------------------------------------------------------------- 0966 */ 0967 0968 /** 0969 *------------------------------------------------------------------------- 0970 * \ingroup H5LT 0971 * 0972 * \brief Reads an attribute from disk. 0973 * 0974 * \param[in] loc_id Identifier of the object (dataset or group) 0975 * to read the attribute from 0976 * \param[in] obj_name The name of the object that the attribute is 0977 * attached to 0978 * \param[in] attr_name The attribute name 0979 * \param[in] mem_type_id Identifier of the memory datatype 0980 * \param[out] data Buffer with data 0981 * 0982 * \return \herr_t 0983 * 0984 * \details H5LTget_attribute() reads an attribute named 0985 * \p attr_name with the memory type \p mem_type_id. 0986 * 0987 */ 0988 H5_HLDLL herr_t H5LTget_attribute(hid_t loc_id, const char *obj_name, const char *attr_name, 0989 hid_t mem_type_id, void *data); 0990 0991 /** 0992 *------------------------------------------------------------------------- 0993 * \ingroup H5LT 0994 * 0995 * \brief Reads an attribute from disk. 0996 * 0997 * \param[in] loc_id Identifier of the object (dataset or group) 0998 * to read the attribute from 0999 * \param[in] obj_name The name of the object that the attribute is 1000 * attached to 1001 * \param[in] attr_name The attribute name 1002 * \param[out] data Buffer with data 1003 * 1004 * \return \herr_t 1005 * 1006 * \details H5LTget_attribute_string() reads an attribute named 1007 * \p attr_name that is attached to the object specified 1008 * by the name \p obj_name. The datatype is a string. 1009 * 1010 * \version 1.8.9 The content of the buffer returned by the Fortran 1011 * subroutine has changed in this release:\n 1012 * If the returned buffer requires padding, 1013 * h5ltget_attribute_string_f() now employs space 1014 * padding; this buffer was previously returned with a C NULL terminator. 1015 * 1016 */ 1017 H5_HLDLL herr_t H5LTget_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_name, 1018 char *data); 1019 1020 /** 1021 *------------------------------------------------------------------------- 1022 * \ingroup H5LT 1023 * 1024 * \brief Reads an attribute from disk. 1025 * 1026 * \param[in] loc_id Identifier of the object (dataset or group) 1027 * to read the attribute from 1028 * \param[in] obj_name The name of the object that the attribute is 1029 * attached to 1030 * \param[in] attr_name The attribute name 1031 * \param[out] data Buffer with data 1032 * 1033 * \return \herr_t 1034 * 1035 * \details H5LTget_attribute_char() reads an attribute named 1036 * \p attr_name that is attached to the object specified 1037 * by the name \p obj_name. The datatype of the attribute 1038 * is #H5T_NATIVE_CHAR. 1039 * 1040 */ 1041 H5_HLDLL herr_t H5LTget_attribute_char(hid_t loc_id, const char *obj_name, const char *attr_name, char *data); 1042 1043 /** 1044 *------------------------------------------------------------------------- 1045 * \ingroup H5LT 1046 * 1047 * \brief Reads an attribute from disk. 1048 * 1049 * \param[in] loc_id Identifier of the object (dataset or group) 1050 * to read the attribute from 1051 * \param[in] obj_name The name of the object that the attribute is 1052 * attached to 1053 * \param[in] attr_name The attribute name 1054 * \param[out] data Buffer with data 1055 * 1056 * \return \herr_t 1057 * 1058 * \details H5LTget_attribute_uchar() reads an attribute named 1059 * \p attr_name that is attached to the object specified 1060 * by the name \p obj_name. The HDF5 datatype of the 1061 * attribute is #H5T_NATIVE_UCHAR 1062 * 1063 */ 1064 H5_HLDLL herr_t H5LTget_attribute_uchar(hid_t loc_id, const char *obj_name, const char *attr_name, 1065 unsigned char *data); 1066 1067 /** 1068 *------------------------------------------------------------------------- 1069 * \ingroup H5LT 1070 * 1071 * \brief Reads an attribute from disk. 1072 * 1073 * \param[in] loc_id Identifier of the object (dataset or group) 1074 * to read the attribute from 1075 * \param[in] obj_name The name of the object that the attribute is 1076 * attached to 1077 * \param[in] attr_name The attribute name 1078 * \param[out] data Buffer with data 1079 * 1080 * \return \herr_t 1081 * 1082 * \details H5LTget_attribute_short() reads an attribute named 1083 * \p attr_name that is attached to the object specified 1084 * by the name \p obj_name. The HDF5 datatype of the 1085 * attribute is #H5T_NATIVE_SHORT 1086 * 1087 */ 1088 H5_HLDLL herr_t H5LTget_attribute_short(hid_t loc_id, const char *obj_name, const char *attr_name, 1089 short *data); 1090 1091 /** 1092 *------------------------------------------------------------------------- 1093 * \ingroup H5LT 1094 * 1095 * \brief Reads an attribute from disk. 1096 * 1097 * \param[in] loc_id Identifier of the object (dataset or group) 1098 * to read the attribute from 1099 * \param[in] obj_name The name of the object that the attribute is 1100 * attached to 1101 * \param[in] attr_name The attribute name 1102 * \param[out] data Buffer with data 1103 * 1104 * \return \herr_t 1105 * 1106 * \details H5LTget_attribute_ushort() reads an attribute named 1107 * \p attr_name that is attached to the object specified 1108 * by the name \p obj_name. The HDF5 datatype of the 1109 * attribute is #H5T_NATIVE_USHORT. 1110 * 1111 */ 1112 H5_HLDLL herr_t H5LTget_attribute_ushort(hid_t loc_id, const char *obj_name, const char *attr_name, 1113 unsigned short *data); 1114 1115 /** 1116 *------------------------------------------------------------------------- 1117 * \ingroup H5LT 1118 * 1119 * \brief Reads an attribute from disk. 1120 * 1121 * \param[in] loc_id Identifier of the object (dataset or group) 1122 * to read the attribute from 1123 * \param[in] obj_name The name of the object that the attribute is 1124 * attached to 1125 * \param[in] attr_name The attribute name 1126 * \param[out] data Buffer with data 1127 * 1128 * \return \herr_t 1129 * 1130 * \details H5LTget_attribute_int() reads an attribute named 1131 * \p attr_name that is attached to the object specified 1132 * by the name \p obj_name. The HDF5 datatype of the 1133 * attribute is #H5T_NATIVE_INT. 1134 * 1135 */ 1136 H5_HLDLL herr_t H5LTget_attribute_int(hid_t loc_id, const char *obj_name, const char *attr_name, int *data); 1137 1138 /** 1139 *------------------------------------------------------------------------- 1140 * \ingroup H5LT 1141 * 1142 * \brief Reads an attribute from disk. 1143 * 1144 * \param[in] loc_id Identifier of the object (dataset or group) 1145 * to read the attribute from 1146 * \param[in] obj_name The name of the object that the attribute is 1147 * attached to 1148 * \param[in] attr_name The attribute name 1149 * \param[out] data Buffer with data 1150 * 1151 * \return \herr_t 1152 * 1153 * \details H5LTget_attribute_uint() reads an attribute named 1154 * \p attr_name that is attached to the object specified 1155 * by the name \p obj_name. The HDF5 datatype of the 1156 * attribute is #H5T_NATIVE_INT. 1157 * 1158 */ 1159 H5_HLDLL herr_t H5LTget_attribute_uint(hid_t loc_id, const char *obj_name, const char *attr_name, 1160 unsigned int *data); 1161 1162 /** 1163 *------------------------------------------------------------------------- 1164 * \ingroup H5LT 1165 * 1166 * \brief Reads an attribute from disk. 1167 * 1168 * \param[in] loc_id Identifier of the object (dataset or group) 1169 * to read the attribute from 1170 * \param[in] obj_name The name of the object that the attribute is 1171 * attached to 1172 * \param[in] attr_name The attribute name 1173 * \param[out] data Buffer with data 1174 * 1175 * \return \herr_t 1176 * 1177 * \details H5LTget_attribute_long() reads an attribute named 1178 * \p attr_name that is attached to the object specified 1179 * by the name \p obj_name. The HDF5 datatype of the 1180 * attribute is #H5T_NATIVE_LONG. 1181 * 1182 */ 1183 H5_HLDLL herr_t H5LTget_attribute_long(hid_t loc_id, const char *obj_name, const char *attr_name, long *data); 1184 1185 /** 1186 *------------------------------------------------------------------------- 1187 * \ingroup H5LT 1188 * 1189 * \brief Reads a \e long \e long attribute. 1190 * 1191 * \param[in] loc_id Location of the object to which 1192 * the attribute is attached 1193 * \param[in] obj_name That object's name 1194 * \param[in] attr_name Attribute name 1195 * \param[out] data Attribute value 1196 * 1197 * \return \herr_t 1198 * 1199 * \details H5LTget_attribute_long_long() reads the attribute 1200 * specified by \p loc_id and \p obj_name. 1201 * 1202 */ 1203 H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name, const char *attr_name, 1204 long long *data); 1205 1206 /** 1207 *------------------------------------------------------------------------- 1208 * \ingroup H5LT 1209 * 1210 * \brief Reads an attribute from disk. 1211 * 1212 * \param[in] loc_id Identifier of the object (dataset or group) 1213 * to read the attribute from 1214 * \param[in] obj_name The name of the object that the attribute is 1215 * attached to 1216 * \param[in] attr_name The attribute name 1217 * \param[out] data Buffer with data 1218 * 1219 * \return \herr_t 1220 * 1221 * \details H5LTget_attribute_ulong() reads an attribute named 1222 * \p attr_name that is attached to the object specified 1223 * by the name \p obj_name. The HDF5 datatype of the 1224 * attribute is #H5T_NATIVE_ULONG. 1225 * 1226 */ 1227 H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name, 1228 unsigned long *data); 1229 1230 /** 1231 *------------------------------------------------------------------------- 1232 * \ingroup H5LT 1233 * 1234 * \brief Reads an attribute from disk. 1235 * 1236 * \param[in] loc_id Identifier of the object (dataset or group) 1237 * to read the attribute from 1238 * \param[in] obj_name The name of the object that the attribute is 1239 * attached to 1240 * \param[in] attr_name The attribute name 1241 * \param[out] data Buffer with data 1242 * 1243 * \return \herr_t 1244 * 1245 * \details H5LTget_attribute_ullong() reads an attribute named 1246 * \p attr_name that is attached to the object specified 1247 * by the name \p obj_name. The HDF5 datatype of the 1248 * attribute is #H5T_NATIVE_ULLONG. 1249 * 1250 */ 1251 H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, 1252 unsigned long long *data); 1253 1254 /** 1255 *------------------------------------------------------------------------- 1256 * \ingroup H5LT 1257 * 1258 * \brief Reads an attribute from disk. 1259 * 1260 * \param[in] loc_id Identifier of the object (dataset or group) 1261 * to read the attribute from 1262 * \param[in] obj_name The name of the object that the attribute is 1263 * attached to 1264 * \param[in] attr_name The attribute name 1265 * \param[out] data Buffer with data 1266 * 1267 * \return \herr_t 1268 * 1269 * \details H5LTget_attribute_float() reads an attribute named 1270 * \p attr_name that is attached to the object specified 1271 * by the name \p obj_name. The HDF5 datatype of the 1272 * attribute is #H5T_NATIVE_FLOAT. 1273 * 1274 */ 1275 H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name, 1276 float *data); 1277 1278 /** 1279 *------------------------------------------------------------------------- 1280 * \ingroup H5LT 1281 * 1282 * \brief Reads an attribute from disk. 1283 * 1284 * \param[in] loc_id Identifier of the object (dataset or group) 1285 * to read the attribute from 1286 * \param[in] obj_name The name of the object that the attribute is 1287 * attached to 1288 * \param[in] attr_name The attribute name 1289 * \param[out] data Buffer with data 1290 * 1291 * \return \herr_t 1292 * 1293 * \details H5LTget_attribute_double() reads an attribute named 1294 * \p attr_name that is attached to the object specified 1295 * by the name \p obj_name. The HDF5 datatype of the 1296 * attribute is #H5T_NATIVE_DOUBLE. 1297 * 1298 */ 1299 H5_HLDLL herr_t H5LTget_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_name, 1300 double *data); 1301 1302 /*------------------------------------------------------------------------- 1303 * 1304 * Query attribute functions 1305 * 1306 *------------------------------------------------------------------------- 1307 */ 1308 1309 /** 1310 *------------------------------------------------------------------------- 1311 * \ingroup H5LT 1312 * 1313 * \brief Gets the dimensionality of an attribute. 1314 * 1315 * \param[in] loc_id Identifier of the object (dataset or group) 1316 * to read the attribute from 1317 * \param[in] obj_name The name of the object that the attribute is 1318 * attached to 1319 * \param[in] attr_name The attribute name 1320 * \param[out] rank The dimensionality of the attribute 1321 * 1322 * \return \herr_t 1323 * 1324 * \details H5LTget_attribute_ndims() gets the dimensionality of an attribute 1325 * named \p attr_name that is attached to the object specified 1326 * by the name \p obj_name. 1327 * 1328 */ 1329 H5_HLDLL herr_t H5LTget_attribute_ndims(hid_t loc_id, const char *obj_name, const char *attr_name, int *rank); 1330 1331 /** 1332 *------------------------------------------------------------------------- 1333 * \ingroup H5LT 1334 * 1335 * \brief Gets information about an attribute. 1336 * 1337 * \param[in] loc_id Identifier of the object (dataset or group) 1338 * to read the attribute from 1339 * \param[in] obj_name The name of the object that the attribute is 1340 * attached to 1341 * \param[in] attr_name The attribute name 1342 * \param[out] dims The dimensions of the attribute 1343 * \param[out] type_class The class identifier. #H5T_class_t is 1344 * defined in H5Tpublic.h. For a list of valid class 1345 * types see: H5Tget_class(). 1346 * \param[out] type_size The size of the datatype in bytes 1347 * 1348 * \return \herr_t 1349 * 1350 * \details H5LTget_attribute_info() gets information about an attribute 1351 * named \p attr_name attached to the object specified by 1352 * the name \p obj_name. 1353 * 1354 * \par Example 1355 * \snippet H5LT_examples.c get_attribute_info 1356 * 1357 */ 1358 H5_HLDLL herr_t H5LTget_attribute_info(hid_t loc_id, const char *obj_name, const char *attr_name, 1359 hsize_t *dims, H5T_class_t *type_class, size_t *type_size); 1360 1361 /*------------------------------------------------------------------------- 1362 * 1363 * General functions 1364 * 1365 *------------------------------------------------------------------------- 1366 */ 1367 1368 /** 1369 *------------------------------------------------------------------------- 1370 * \ingroup H5LT 1371 * 1372 * \brief Creates an HDF5 datatype given a text description. 1373 * 1374 * \param[in] text A character string containing a DDL 1375 * definition of the datatype to be created 1376 * \param[in] lang_type The language used to describe the datatype. 1377 * The only currently supported language is 1378 * #H5LT_DDL. 1379 * 1380 * \return Returns the datatype identifier(non-negative) if successful; 1381 * otherwise returns a negative value. 1382 * 1383 * \details Given a text description of a datatype, this function creates 1384 * an HDF5 datatype and returns the datatype identifier. 1385 * The text description of the datatype has to comply with the 1386 * \p lang_type definition of HDF5 datatypes. 1387 * Currently, only the DDL(#H5LT_DDL) is supported. 1388 * The complete DDL definition of HDF5 datatypes can be found in 1389 * the specifications chapter of the 1390 * <a href="https://\DOXURL/_s_p_e_c.html"> 1391 * HDF5 User's Guide</a>. 1392 * 1393 * \par Example 1394 * An example of DDL definition of \c enum type is shown as follows. 1395 * \snippet H5LT_examples.c enum 1396 * 1397 */ 1398 H5_HLDLL hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type); 1399 1400 /** 1401 *------------------------------------------------------------------------- 1402 * \ingroup H5LT 1403 * 1404 * \brief Creates a text description of an HDF5 datatype. 1405 * 1406 * \param[in] dtype Identifier of the datatype to be converted 1407 * \param[out] str Buffer for the text description of the datatype 1408 * \param[in] lang_type The language used to describe the datatype. 1409 * The currently supported language is #H5LT_DDL. 1410 * \param[out] len The size of buffer needed to store the text description 1411 * 1412 * \return \herr_t 1413 * 1414 * \details Given an HDF5 datatype identifier, this function creates 1415 * a description of this datatype in \p lang_type language format. 1416 * A preliminary H5LTdtype_to_text() call can be made to determine 1417 * the size of the buffer needed with a NULL passed in for \p str. 1418 * This value is returned as \p len. That value can then be assigned 1419 * to len for a second H5Ttype_to_text() call, which will 1420 * retrieve the actual text description for the datatype. 1421 * 1422 * If \p len is not big enough for the description, the text 1423 * description will be truncated to fit in the buffer. 1424 * 1425 * Currently only DDL (#H5LT_DDL) is supported for \p lang_type. 1426 * The complete DDL definition of HDF5 data types can be found in 1427 * the specifications chapter of the 1428 * <a href="https://\DOXURL/_s_p_e_c.html"> 1429 * HDF5 User's Guide</a>. 1430 * 1431 * \par Example 1432 * An example of DDL definition of \c enum type is shown as follows. 1433 * \snippet H5LT_examples.c enum 1434 * 1435 */ 1436 H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len); 1437 1438 /*------------------------------------------------------------------------- 1439 * 1440 * Utility functions 1441 * 1442 *------------------------------------------------------------------------- 1443 */ 1444 1445 /** 1446 *------------------------------------------------------------------------- 1447 * \ingroup H5LT 1448 * 1449 * \brief Determines whether an attribute exists. 1450 * 1451 * \param[in] loc_id Identifier of the object to which the attribute 1452 * is expected to be attached 1453 * \param[in] name Attribute name 1454 * 1455 * \return \htri_t 1456 * 1457 * \details H5LTfind_attribute() determines whether an attribute named 1458 * \p name exists attached to the object specified 1459 * by \p loc_id. 1460 * 1461 * \p loc_id must be an object identifier and \p name 1462 * must specify an attribute that is expected to be attached 1463 * to that object. 1464 * 1465 */ 1466 H5_HLDLL herr_t H5LTfind_attribute(hid_t loc_id, const char *name); 1467 1468 /** 1469 *------------------------------------------------------------------------- 1470 * \ingroup H5LT 1471 * 1472 * \brief Determines whether an HDF5 path is valid and, optionally, 1473 * whether the path resolves to an HDF5 object. 1474 * 1475 * \param[in] loc_id Identifier of an object in the file 1476 * \param[in] path The path to the object to check; 1477 * links in \p path may be of any type. 1478 * \param[in] check_object_valid If TRUE, determine whether the final 1479 * component of \p path resolves to 1480 * an object; if FALSE, do not check. 1481 * 1482 * \return Upon success: 1483 * \return If \p check_object_valid is set to \c FALSE: 1484 * \return Returns \c TRUE if the path is valid; 1485 * otherwise returns \c FALSE. 1486 * \return If \p check_object_valid is set to \c TRUE: 1487 * \return Returns \c TRUE if the path is valid and 1488 * resolves to an HDF5 object; 1489 * otherwise returns \c FALSE. 1490 * 1491 * \return Upon error, returns a negative value. 1492 * 1493 * \details H5LTpath_valid() checks the validity of \p path relative 1494 * to the identifier of an object, \p loc_id. Optionally, 1495 * \p check_object_valid can be set to determine whether the 1496 * final component of \p path resolves to an HDF5 object; 1497 * if not, the final component is a dangling link. 1498 * 1499 * The meaning of the function's return value depends on the 1500 * value of \p check_object_valid: 1501 * 1502 * If \p check_object_valid is set to \c FALSE, H5LTpath_valid() 1503 * will check all links in \p path to verify that they exist. 1504 * If all the links in \p path exist, the function will 1505 * return \c TRUE; otherwise the function will return \c FALSE. 1506 * 1507 * If \p check_object_valid is set to \c TRUE, 1508 * H5LTpath_valid() will first check the links in \p path, 1509 * as described above. If all the links exist, 1510 * \p check_object_valid will then determine whether the final 1511 * component of \p path resolves to an actual HDF5 object. 1512 * H5LTpath_valid() will return \c TRUE if all the links in 1513 * \p path exist and the final component resolves to an 1514 * actual object; otherwise, it will return \c FALSE. 1515 * 1516 * \p path can be any one of the following: 1517 * 1518 * - An absolute path, which starts with a slash (\c /) 1519 * indicating the file's root group, followed by the members 1520 * - A relative path with respect to \p loc_id 1521 * - A dot (\c .), if \p loc_id is the object identifier for 1522 * the object itself. 1523 * 1524 * If \p path is an absolute path, then \p loc_id can be an 1525 * identifier for any object in the file as it is used only to 1526 * identify the file. If \p path is a relative path, then 1527 * \p loc_id must be a file or a group identifier. 1528 * 1529 * \note 1530 * <b>Note on Behavior Change:</b> 1531 * The behavior of H5LTpath_valid() was changed in the 1.10.0 release 1532 * in the case where the root group, “/”, is the value of path. 1533 * This change is described below: 1534 * - Let \p loc_id denote a valid HDF5 file identifier, and let 1535 * \p check_object_valid be set to true or false. 1536 * A call to H5LTpath_valid() with arguments \p loc_id, “/”, 1537 * and \p check_object_valid returns a positive value; 1538 * in other words, H5LTpath_valid(loc_id, "/", check_object_valid) 1539 * returns a positive value. 1540 * In HDF5 version 1.8.16, this function returns 0. 1541 * - Let ‘root’ denote a valid HDF5 group identifier that refers 1542 * to the root group of an HDF5 file, and let \p check_object_valid 1543 * be set to true or false. 1544 * A call to H5LTpath_valid() with arguments ‘root’, “/”, and 1545 * \p check_object_valid returns a positive value; 1546 * in other words, H5LTpath_valid(root, "/", check_object_valid) 1547 * returns a positive value. 1548 * In HDF5 version 1.8.16, this function returns 0. 1549 * 1550 * \version 1.10.0 Function behavior changed in this release. 1551 * See the “Note on Behavior Change” section above. 1552 * 1553 */ 1554 H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid); 1555 1556 /*------------------------------------------------------------------------- 1557 * 1558 * File image operations functions 1559 * 1560 *------------------------------------------------------------------------- 1561 */ 1562 1563 /** 1564 *------------------------------------------------------------------------- 1565 * \ingroup H5LT 1566 * 1567 * \brief Opens an HDF5 file image in memory. 1568 * 1569 * \param[in] buf_ptr A pointer to the supplied initial image 1570 * \param[in] buf_size Size of the supplied buffer 1571 * \param[in] flags Flags specifying whether to open the image 1572 * read-only or read/write, whether HDF5 is to 1573 * take control of the buffer, and instruction 1574 * regarding releasing the buffer. 1575 * 1576 * \return Returns a file identifier if successful; 1577 * otherwise returns a negative value. 1578 * \warning \Bold{Failure Modes:} 1579 * \warning H5LTopen_file_image() will fail if either \p buf_ptr is NULL 1580 * or \p buf_size equals 0 (zero). 1581 * 1582 * 1583 * \details H5LTopen_file_image() opens the HDF5 file image that is 1584 * located in system memory at the address indicated by 1585 * \p buf_ptr of size \p buf_size. 1586 * H5LTopen_file_image() opens a file image with the 1587 * Core driver, #H5FD_CORE. 1588 * 1589 * A value of NULL for \p buf_ptr is invalid and will 1590 * cause the function to fail. 1591 * 1592 * A value of 0 for \p buf_size is invalid and will cause 1593 * the function to fail. 1594 * 1595 * The flags passed in \p flags specify whether to open the image 1596 * read-only or read/write, whether HDF5 is to take control of the 1597 * buffer, and instruction regarding releasing the buffer. 1598 * Valid values are: 1599 * - #H5LT_FILE_IMAGE_OPEN_RW 1600 * - Specifies opening the file image in read/write mode. 1601 * - Default without this flag: File image will be opened read-only. 1602 * 1603 * - #H5LT_FILE_IMAGE_DONT_COPY 1604 * - Specifies to not copy the provided file image buffer; 1605 * the buffer will be used directly. HDF5 will release the 1606 * file image when finished. 1607 * - Default without this flag: Copy the file image buffer and 1608 * open the copied file image. 1609 * 1610 * - #H5LT_FILE_IMAGE_DONT_RELEASE 1611 * - Specifies that HDF5 is not to release the buffer when 1612 * the file opened with H5LTopen_file_image() is closed; 1613 * releasing the buffer will be left to the application. 1614 * - Default without this flag: HDF5 will automatically 1615 * release the file image buffer after the file image is 1616 * closed. This flag is valid only when used with 1617 * #H5LT_FILE_IMAGE_DONT_COPY. 1618 * 1619 * \note **Motivation:** 1620 * \note H5LTopen_file_image() and other elements of HDF5 1621 * are used to load an image of an HDF5 file into system memory 1622 * and open that image as a regular HDF5 file. An application can 1623 * then use the file without the overhead of disk I/O. 1624 * 1625 * \note **Recommended Reading:** 1626 * \note This function is part of the file image operations feature set. 1627 * It is highly recommended to study the guide 1628 * <a href="https://\RFCURL/HDF5FileImageOperations.pdf"> 1629 * HDF5 File Image Operations</a> before using this feature set.\n 1630 * See the “See Also” section below for links to other elements of 1631 * HDF5 file image operations. 1632 * 1633 * \todo There is no "See Also" section??? 1634 * 1635 * \since 1.8.9 1636 */ 1637 H5_HLDLL hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags); 1638 1639 #ifdef __cplusplus 1640 } 1641 #endif 1642 1643 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |