Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-13 10:32:38

0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0002  * Copyright by The HDF Group.                                               *
0003  * All rights reserved.                                                      *
0004  *                                                                           *
0005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
0006  * terms governing use, modification, and redistribution, is contained in    *
0007  * the COPYING file, which can be found at the root of the source code       *
0008  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
0009  * If you do not have access to either file, you may request a copy from     *
0010  * help@hdfgroup.org.                                                        *
0011  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
0012 
0013 /*
0014  * This file contains public declarations for the H5D module.
0015  */
0016 #ifndef H5Dpublic_H
0017 #define H5Dpublic_H
0018 
0019 #include "H5public.h"  /* Generic Functions                        */
0020 #include "H5Ipublic.h" /* Identifiers                              */
0021 
0022 /*****************/
0023 /* Public Macros */
0024 /*****************/
0025 
0026 /* Macros used to "unset" chunk cache configuration parameters */
0027 #define H5D_CHUNK_CACHE_NSLOTS_DEFAULT SIZE_MAX
0028 #define H5D_CHUNK_CACHE_NBYTES_DEFAULT SIZE_MAX
0029 #define H5D_CHUNK_CACHE_W0_DEFAULT     (-1.0)
0030 
0031 /** Bit flags for the H5Pset/get_chunk_opts() \since 1.10.0 */
0032 #define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u)
0033 
0034 /*******************/
0035 /* Public Typedefs */
0036 /*******************/
0037 
0038 //! <!-- [H5D_layout_t_snip] -->
0039 /**
0040  * Values for the H5D_LAYOUT property
0041  */
0042 typedef enum H5D_layout_t {
0043     H5D_LAYOUT_ERROR = -1, /**< error */
0044     H5D_COMPACT      = 0,  /**< raw data is small (< 64KB) */
0045     H5D_CONTIGUOUS   = 1,  /**< contiguous layout */
0046     H5D_CHUNKED      = 2,  /**< chunked or tiled layout */
0047     H5D_VIRTUAL      = 3,  /**< actual data is stored in other datasets */
0048     H5D_NLAYOUTS     = 4   /**< this one must be last! */
0049 } H5D_layout_t;
0050 //! <!-- [H5D_layout_t_snip] -->
0051 
0052 //! <!-- [H5D_chunk_index_t_snip] -->
0053 /**
0054  * Types of chunk index data structures
0055  */
0056 typedef enum H5D_chunk_index_t {
0057     H5D_CHUNK_IDX_BTREE = 0, /**< v1 B-tree index (default)                */
0058     H5D_CHUNK_IDX_SINGLE =
0059         1, /**< Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
0060     H5D_CHUNK_IDX_NONE   = 2, /**< Implicit: No Index (#H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
0061     H5D_CHUNK_IDX_FARRAY = 3, /**< Fixed array (for 0 unlimited dims)       */
0062     H5D_CHUNK_IDX_EARRAY = 4, /**< Extensible array (for 1 unlimited dim)   */
0063     H5D_CHUNK_IDX_BT2    = 5, /**< v2 B-tree index (for >1 unlimited dims)  */
0064     H5D_CHUNK_IDX_NTYPES      /**< This one must be last!                   */
0065 } H5D_chunk_index_t;
0066 //! <!-- [H5D_chunk_index_t_snip] -->
0067 
0068 //! <!-- [H5D_alloc_time_t_snip] -->
0069 /**
0070  * Values for the space allocation time property
0071  */
0072 typedef enum H5D_alloc_time_t {
0073     H5D_ALLOC_TIME_ERROR   = -1, /**< Error */
0074     H5D_ALLOC_TIME_DEFAULT = 0,  /**< Default (layout dependent) */
0075     H5D_ALLOC_TIME_EARLY   = 1,  /**< Allocate on creation */
0076     H5D_ALLOC_TIME_LATE    = 2,  /**< Allocate on first write */
0077     H5D_ALLOC_TIME_INCR    = 3   /**< Allocate incrementally (by chunk) */
0078 } H5D_alloc_time_t;
0079 //! <!-- [H5D_alloc_time_t_snip] -->
0080 
0081 //! <!-- [H5D_space_status_t_snip] -->
0082 /**
0083  * Values for the status of space allocation
0084  */
0085 typedef enum H5D_space_status_t {
0086     H5D_SPACE_STATUS_ERROR          = -1, /**< Error */
0087     H5D_SPACE_STATUS_NOT_ALLOCATED  = 0,  /**< Space has not been allocated for this dataset. */
0088     H5D_SPACE_STATUS_PART_ALLOCATED = 1,  /**< Space has been partially allocated for this dataset.
0089                                                (Used only for datasets with chunked storage.) */
0090     H5D_SPACE_STATUS_ALLOCATED = 2        /**< Space has been allocated for this dataset. */
0091 } H5D_space_status_t;
0092 //! <!-- [H5D_space_status_t_snip] -->
0093 
0094 //! <!-- [H5D_fill_time_t_snip] -->
0095 /**
0096  * Values for time of writing fill value property
0097  */
0098 typedef enum H5D_fill_time_t {
0099     H5D_FILL_TIME_ERROR = -1, /**< Error */
0100     H5D_FILL_TIME_ALLOC = 0,  /**< Fill on allocation */
0101     H5D_FILL_TIME_NEVER = 1,  /**< Never write fill values */
0102     H5D_FILL_TIME_IFSET = 2   /**< Fill if fill-value was set */
0103 } H5D_fill_time_t;
0104 //! <!-- [H5D_fill_time_t_snip] -->
0105 
0106 //! <!-- [H5D_fill_value_t_snip] -->
0107 /**
0108  * Values for fill value status
0109  */
0110 typedef enum H5D_fill_value_t {
0111     H5D_FILL_VALUE_ERROR        = -1, /**< Error */
0112     H5D_FILL_VALUE_UNDEFINED    = 0,  /**< No fill value defined */
0113     H5D_FILL_VALUE_DEFAULT      = 1,  /**< Default fill-value */
0114     H5D_FILL_VALUE_USER_DEFINED = 2   /**< User-defined fill-value */
0115 } H5D_fill_value_t;
0116 //! <!-- [H5D_fill_value_t_snip] -->
0117 
0118 //! <!-- [H5D_vds_view_t_snip] -->
0119 /**
0120  * Values for VDS bounds option
0121  */
0122 typedef enum H5D_vds_view_t {
0123     H5D_VDS_ERROR          = -1, /**< Error */
0124     H5D_VDS_FIRST_MISSING  = 0,  /**< Include all data before the first missing mapped data */
0125     H5D_VDS_LAST_AVAILABLE = 1   /**< Include all available mapped data */
0126 } H5D_vds_view_t;
0127 //! <!-- [H5D_vds_view_t_snip] -->
0128 
0129 //! <!-- [H5D_append_cb_t_snip] -->
0130 /**
0131  * \brief Callback for H5Pset_append_flush()
0132  *
0133  * \dset_id{dataset_id}
0134  * \param[in] cur_dims The current extent of the dataset's dimensions
0135  * \param[in,out] op_data User context
0136  *
0137  * \return \herr_t
0138  *
0139  * \since 1.10.0
0140  *
0141  */
0142 typedef herr_t (*H5D_append_cb_t)(hid_t dataset_id, hsize_t *cur_dims, void *op_data);
0143 //! <!-- [H5D_append_cb_t_snip] -->
0144 
0145 //! <!-- [H5D_operator_t_snip] -->
0146 /**
0147  * \brief Callback for H5Diterate()
0148  *
0149  * \param[in,out] elem Pointer to the memory buffer containing the current dataset
0150  *                     element
0151  * \param[in] type_id Datatype identifier of the elements stored in \p elem
0152  * \param[in] ndim Number of dimensions for the \p point array
0153  * \param[in] point Array containing the location of the element within
0154  *                  the original dataspace
0155  * \param[in,out] operator_data Pointer to any user-defined data associated with
0156  *                the operation
0157  * \return \herr_t_iter
0158  *
0159  * \since 1.10.2
0160  *
0161  */
0162 typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point,
0163                                  void *operator_data);
0164 //! <!-- [H5D_operator_t_snip] -->
0165 
0166 //! <!-- [H5D_scatter_func_t_snip] -->
0167 /**
0168  * \brief Callback for H5Dscatter()
0169  *
0170  * \param[out] src_buf Pointer to the buffer holding the next set of elements to
0171  *                     scatter. On entry, the value of where \p src_buf points to
0172  *                     is undefined. The callback function should set \p src_buf
0173  *                     to point to the next set of elements.
0174  * \param[out] src_buf_bytes_used Pointer to the number of valid bytes in \p src_buf.
0175  *                                On entry, the value where \p src_buf_bytes_used points
0176  *                                to is undefined. The callback function should set
0177  *                                \p src_buf_bytes_used to the of valid bytes in \p src_buf.
0178  *                                This number must be a multiple of the datatype size.
0179  * \param[in,out] op_data User-defined pointer to data required by the callback
0180  *                        function. A pass-through of the \p op_data pointer provided
0181  *                        with the H5Dscatter() function call.
0182  * \return herr_t
0183  *
0184  * \details The callback function should always return at least one
0185  *          element in \p src_buf, and must not return more elements
0186  *          than are remaining to be scattered. This function will be
0187  *          repeatedly called until all elements to be scattered have
0188  *          been returned. The callback function should return zero (0)
0189  *          to indicate success, and a negative value to indicate failure.
0190  *
0191  * \since 1.10.2
0192  *
0193  */
0194 typedef herr_t (*H5D_scatter_func_t)(const void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/,
0195                                      void *op_data);
0196 //! <!-- [H5D_scatter_func_t_snip] -->
0197 
0198 //! <!-- [H5D_gather_func_t_snip] -->
0199 /**
0200  * \brief Callback for H5Dgather()
0201  *
0202  * \param[in] dst_buf Pointer to the destination buffer which has been filled
0203  *                    with the next set of elements gathered. This will always
0204  *                    be identical to the \p dst_buf passed to H5Dgather()
0205  * \param[in] dst_buf_bytes_used  Pointer to the number of valid bytes in
0206  *                                \p dst_buf. This number must be a multiple of
0207  *                                the datatype size.
0208  * \param[in,out] op_data User-defined pointer to data required by the callback
0209  *                        function; a pass-through of the \p op_data pointer
0210  *                        provided with the H5Dgather() function call.
0211  * \return \herr_t
0212  *
0213  * \details The callback function should process, store, or otherwise make use
0214  *          of the data returned in dst_buf before it returns, because the
0215  *          buffer will be overwritten unless it is the last call to the
0216  *          callback. This function will be repeatedly called until all gathered
0217  *          elements have been passed to the callback in dst_buf. The callback
0218  *          function should return zero (0) to indicate success, and a negative
0219  *          value to indicate failure.
0220  *
0221  * \since 1.10.2
0222  *
0223  */
0224 typedef herr_t (*H5D_gather_func_t)(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data);
0225 //! <!-- [H5D_gather_func_t_snip] -->
0226 
0227 //! <!-- [H5D_chunk_iter_op_t_snip] -->
0228 /**
0229  * \brief Callback for H5Dchunk_iter()
0230  *
0231  * \param[in]     offset      Logical position of the chunk's first element in units of dataset elements
0232  * \param[in]     filter_mask Bitmask indicating the filters used when the chunk was written
0233  * \param[in]     addr        Chunk address in the file, taking the user block (if any) into account
0234  * \param[in]     size        Chunk size in bytes, 0 if the chunk does not exist
0235  * \param[in,out] op_data     Pointer to any user-defined data associated with
0236  *                            the operation.
0237  * \return \li Zero (#H5_ITER_CONT) causes the iterator to continue, returning
0238  *              zero when all elements have been processed.
0239  *          \li A positive value (#H5_ITER_STOP) causes the iterator to
0240  *              immediately return that value, indicating short-circuit success.
0241  *          \li A negative (#H5_ITER_ERROR) causes the iterator to immediately
0242  *              return that value, indicating failure.
0243  *
0244  * \callback_note
0245  *
0246  * \since 1.14.0
0247  *
0248  */
0249 typedef int (*H5D_chunk_iter_op_t)(const hsize_t *offset, unsigned filter_mask, haddr_t addr, hsize_t size,
0250                                    void *op_data);
0251 //! <!-- [H5D_chunk_iter_op_t_snip] -->
0252 
0253 /********************/
0254 /* Public Variables */
0255 /********************/
0256 
0257 /*********************/
0258 /* Public Prototypes */
0259 /*********************/
0260 #ifdef __cplusplus
0261 extern "C" {
0262 #endif
0263 
0264 /**
0265  * --------------------------------------------------------------------------
0266  * \ingroup H5D
0267  *
0268  * \brief Creates a new dataset and links it into the file
0269  *
0270  * \fgdta_loc_id
0271  * \param[in] name Name of the dataset to create
0272  * \type_id
0273  * \space_id
0274  * \lcpl_id
0275  * \dcpl_id
0276  * \dapl_id
0277  *
0278  * \return \hid_t{dataset}
0279  *
0280  * \details H5Dcreate2() creates a new dataset named \p name at
0281  *          the location specified by \p loc_id, and associates constant
0282  *          and initial persistent properties with that dataset, including
0283  *          the datatype \p dtype_id, the dataspace \p space_id, and
0284  *          other properties as specified by the dataset creation property
0285  *          list \p dcpl_id and the access property list \p dapl_id,
0286  *          respectively. Once created, the dataset is opened for access.
0287  *
0288  *          \p loc_id may specify a file, group, dataset, named datatype,
0289  *          or attribute.  If an attribute, dataset, or named datatype is
0290  *          specified, then the dataset will be created at the location
0291  *          where the attribute, dataset, or named datatype is attached.
0292  *
0293  *          \p name may be either an absolute path in the file or a relative
0294  *          path from \p loc_id naming the dataset.
0295  *
0296  *          If \p dtype_id is a committed datatype, and if the file location
0297  *          associated with the committed datatype is different from the
0298  *          file location where the dataset will be created, the datatype
0299  *          is copied and converted to a transient type.
0300  *
0301  *          The link creation property list, \p lcpl_id, governs the creation
0302  *          of the link(s) by which the new dataset is accessed and the
0303  *          creation of any intermediate groups that may be missing.
0304  *
0305  *          The datatype and dataspace properties and the dataset creation
0306  *          and access property lists are attached to the dataset, so the
0307  *          caller may derive new datatypes, dataspaces, and creation and
0308  *          access properties from the old ones and reuse them in calls to
0309  *          create additional datasets.  Once created, the dataset can be
0310  *          read from or written to. Reading data from a dataset that was
0311  *          not previously written, the HDF5 library will return default
0312  *          or user-defined fill values.
0313  *
0314  * \par Example
0315  * \snippet H5D_examples.c create
0316  *
0317  * \since 1.8.0
0318  *
0319  * \see H5Dopen2(), H5Dclose(), H5Tset_size()
0320  *
0321  */
0322 H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id,
0323                         hid_t dcpl_id, hid_t dapl_id);
0324 
0325 /**
0326  * --------------------------------------------------------------------------
0327  * \ingroup ASYNC
0328  * \async_variant_of{H5Dcreate}
0329  */
0330 #ifndef H5_DOXYGEN
0331 H5_DLL hid_t H5Dcreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
0332                              const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id,
0333                              hid_t dapl_id, hid_t es_id);
0334 #else
0335 H5_DLL hid_t H5Dcreate_async(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id,
0336                              hid_t dcpl_id, hid_t dapl_id, hid_t es_id);
0337 #endif
0338 
0339 /**
0340  * --------------------------------------------------------------------------
0341  * \ingroup H5D
0342  *
0343  * \brief Creates a dataset in a file without linking it into the file
0344  *        structure
0345  *
0346  * \fgdta_loc_id
0347  * \type_id
0348  * \space_id
0349  * \dcpl_id
0350  * \dapl_id
0351  *
0352  * \return \hid_t{dataset}
0353  *
0354  * \details H5Dcreate_anon() creates a dataset in the file specified
0355  *          by \p loc_id.
0356  *
0357  *          \p loc_id may specify a file, group, dataset, named datatype,
0358  *          or attribute.  If an attribute, dataset, or named datatype is
0359  *          specified, then the dataset will be created at the location
0360  *          where the attribute, dataset, or named datatype is attached.
0361  *
0362  *          The dataset's datatype and dataspace are specified by
0363  *          \p type_id and \p space_id, respectively. These are the
0364  *          datatype and dataspace of the dataset as they will exist in
0365  *          the file, which may differ from the datatype and dataspace
0366  *          in application memory.
0367  *
0368  *          H5Dcreate_anon() returns a new dataset identifier. Using
0369  *          this identifier, the new dataset must be linked into the
0370  *          HDF5 file structure with H5Olink() or it will be deleted
0371  *          when the file is closed.
0372  *
0373  * \since 1.8.0
0374  *
0375  * \see H5Olink(), H5Dcreate()
0376  *
0377  */
0378 H5_DLL hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id);
0379 
0380 /**
0381  * --------------------------------------------------------------------------
0382  * \ingroup H5D
0383  *
0384  * \brief Opens an existing dataset
0385  *
0386  * \fgdta_loc_id
0387  * \param[in] name      Name of the dataset to open
0388  * \dapl_id
0389  *
0390  * \return \hid_t{dataset}
0391  *
0392  * \details H5Dopen2() opens the existing dataset specified
0393  *          by a location identifier and name, \p loc_id and \p name,
0394  *          respectively.
0395  *
0396  *          \p loc_id may specify a file, group, dataset, named datatype,
0397  *          or attribute.  If an attribute, dataset, or named datatype is
0398  *          specified then the dataset will be opened at the location
0399  *          where the attribute, dataset, or named datatype is attached.
0400  *
0401  * \since 1.8.0
0402  *
0403  * \see H5Dcreate2(), H5Dclose()
0404  *
0405  */
0406 H5_DLL hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id);
0407 
0408 /**
0409  * --------------------------------------------------------------------------
0410  * \ingroup ASYNC
0411  * \async_variant_of{H5Dopen}
0412  */
0413 #ifndef H5_DOXYGEN
0414 H5_DLL hid_t H5Dopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
0415                            const char *name, hid_t dapl_id, hid_t es_id);
0416 #else
0417 H5_DLL hid_t H5Dopen_async(hid_t loc_id, const char *name, hid_t dapl_id, hid_t es_id);
0418 #endif
0419 
0420 /**
0421  * --------------------------------------------------------------------------
0422  *\ingroup H5D
0423  *
0424  * \brief Returns an identifier for a copy of the dataspace for a dataset
0425  *
0426  * \dset_id
0427  *
0428  * \return \hid_t{dataspace}
0429  *
0430  * \details H5Dget_space() makes a copy of the dataspace of
0431  *          the dataset specified by \p dset_id. The function returns an
0432  *          identifier for the new copy of the dataspace.
0433  *
0434  *          A dataspace identifier returned from this function should
0435  *          be released with H5Sclose() when the identifier is no longer
0436  *          needed so that resource leaks will not occur.
0437  *
0438  * \since 1.0.0
0439  *
0440  * \par Example
0441  * \snippet H5D_examples.c update
0442  *
0443  * \see H5Sclose()
0444  *
0445  */
0446 H5_DLL hid_t H5Dget_space(hid_t dset_id);
0447 
0448 /**
0449  * --------------------------------------------------------------------------
0450  * \ingroup ASYNC
0451  * \async_variant_of{H5Dget_space}
0452  */
0453 #ifndef H5_DOXYGEN
0454 H5_DLL hid_t H5Dget_space_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
0455                                 hid_t es_id);
0456 #else
0457 H5_DLL hid_t H5Dget_space_async(hid_t dset_id, hid_t es_id);
0458 #endif
0459 
0460 /**
0461  * --------------------------------------------------------------------------
0462  * \ingroup H5D
0463  *
0464  * \brief Determines whether space has been allocated for a dataset
0465  *
0466  * \dset_id
0467  * \param[out] allocation Space allocation status
0468  *
0469  * \return \herr_t
0470  *
0471  * \details H5Dget_space_status() determines whether space has been allocated
0472  *          for the dataset \p dset_id.
0473  *
0474  * \note \Bold{BUG:} Prior to the HDF5 1.14.0, 1.12.2 and 1.10.9 releases,
0475  *       H5Dget_space_status() may return incorrect space allocation status
0476  *       values for datasets with filters applied to them.
0477  *       H5Dget_space_status() calculated the space allocation status by
0478  *       comparing the sum of the sizes of all the allocated chunks in the
0479  *       dataset against the total data size of the dataset, as calculated by
0480  *       the number of elements in the dataset's dataspace multiplied by the
0481  *       dataset's datatype size. If the dataset had any compression filters
0482  *       applied to it and the dataset chunks were successfully compressed,
0483  *       the sum of the sizes of the allocated dataset chunks would generally
0484  *       always be less than the total data size of the dataset, and
0485  *       H5Dget_space_status() wouldn't ever return
0486  *       `H5D_SPACE_STATUS_ALLOCATED`.
0487  *
0488  * \since 1.6.0
0489  *
0490  */
0491 H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
0492 
0493 /**
0494  * --------------------------------------------------------------------------
0495  * \ingroup H5D
0496  *
0497  * \brief Returns an identifier for a copy of the datatype for a dataset
0498  *
0499  * \dset_id
0500  *
0501  * \return \hid_t{datatype}
0502  *
0503  * \details H5Dget_type() returns an identifier of a copy of
0504  *          the datatype for a dataset.
0505  *
0506  *          If a dataset has a named datatype, then an identifier to the
0507  *          opened datatype is returned. Otherwise, the returned datatype
0508  *          is read-only.
0509  *
0510  * \since 1.0.0
0511  *
0512  */
0513 H5_DLL hid_t H5Dget_type(hid_t dset_id);
0514 
0515 /**
0516  * --------------------------------------------------------------------------
0517  * \ingroup H5D
0518  *
0519  * \brief Returns an identifier for a copy of the dataset creation
0520  *        property list for a dataset
0521  *
0522  * \dset_id
0523  *
0524  * \return \hid_t{dataset creation property list}
0525  *
0526  * \details H5Dget_create_plist() returns an identifier for
0527  *          a copy of the dataset creation property list associated with
0528  *          the dataset specified by \p dset_id.
0529  *
0530  *          The creation property list identifier should be released with
0531  *          H5Pclose() to prevent resource leaks.
0532  *
0533  * \since 1.0.0
0534  *
0535  */
0536 H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
0537 
0538 /**
0539  * --------------------------------------------------------------------------
0540  * \ingroup H5D
0541  *
0542  * \brief Returns the dataset access property list associated with
0543  *        a dataset
0544  *
0545  * \dset_id
0546  *
0547  * \return \hid_t{dataset access property list}
0548  *
0549  * \details H5Dget_access_plist() returns a copy of the
0550  *          dataset access property list used to open the specified
0551  *          dataset, \p dset_id. Modifications to the returned property
0552  *          list will have no effect on the dataset it was retrieved from.
0553  *
0554  *          The chunk cache parameters in the returned property lists will
0555  *          be those used by the dataset. If the properties in the file
0556  *          access property list were used to determine the dataset's
0557  *          chunk cache configuration, then those properties will be
0558  *          present in the returned dataset access property list. If
0559  *          the dataset does not use a chunked layout, then the chunk
0560  *          cache properties will be set to the default. The chunk cache
0561  *          properties in the returned list are considered to be “set”,
0562  *          and any use of this list will override the corresponding
0563  *          properties in the file's file access property list.
0564  *
0565  *          All link access properties in the returned list will be set
0566  *          to the default values.
0567  *
0568  * \since 1.8.3
0569  *
0570  */
0571 H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
0572 
0573 /**
0574  * --------------------------------------------------------------------------
0575  * \ingroup H5D
0576  *
0577  * \brief Returns the amount of storage allocated for a dataset
0578  *
0579  * \dset_id
0580  *
0581  * \return Returns the amount of storage space, in bytes, or 0 (zero).
0582  *
0583  * \details H5Dget_storage_size() returns the amount of storage,
0584  *          in bytes, that is allocated in the file for the raw data of
0585  *          the dataset specified by \p dset_id.
0586  *          H5Dget_storage_size() reports only the space required to store
0587  *          the dataset elements, excluding any metadata.
0588  *          \li For contiguous datasets, the returned size equals the current
0589  *          allocated size of the raw data.
0590  *          \li For unfiltered chunked datasets, the returned size is the
0591  *          number of allocated chunks times the chunk size.
0592  *          \li For filtered chunked datasets, the returned size is the
0593  *          space required to store the filtered data. For example, if a
0594  *          compression filter is in use, H5Dget_storage_size() will return
0595  *          the total space required to store the compressed chunks.
0596  *
0597  * \note Note that H5Dget_storage_size() is not generally an
0598  *       appropriate function to use when determining the amount
0599  *       of memory required to work with a dataset. In such
0600  *       circumstances, you must determine the number of data
0601  *       points in a dataset and the size of an individual dataset
0602  *       element. H5Sget_simple_extent_npoints() and H5Tget_size()
0603  *       can be used to calculate that amount.
0604  *
0605  * \warning H5Dget_storage_size() does not differentiate between 0 (zero),
0606  *          the value returned for the storage size of a dataset
0607  *          with no stored values, and 0 (zero), the value returned to
0608  *          indicate an error.
0609  *
0610  * \since 1.2.0
0611  *
0612  */
0613 H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
0614 
0615 /**
0616  * --------------------------------------------------------------------------
0617  * \ingroup H5D
0618  *
0619  * \brief Returns the amount of storage allocated within the file for a
0620  * raw data chunk in a dataset
0621  *
0622  * \dset_id
0623  * \param[in]  offset   Logical offset in the dataset for the chunk to query
0624  * \param[out] chunk_bytes The size in bytes for the chunk
0625  *
0626  * \return \herr_t
0627  *
0628  * \details H5Dget_chunk_storage_size() returns the size in bytes
0629  *          allocated in the file for a raw data chunk as specified by
0630  *          its logical \p offset in the dataset \p dset_id. The size is
0631  *          returned in \p chunk_nbytes. It is the size of the compressed
0632  *          data if the chunk is filtered and the size may be zero if no
0633  *          storage is allocated yet for the dataset.
0634  *
0635  * \since 1.10.2
0636  *
0637  */
0638 H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
0639 
0640 /**
0641  * --------------------------------------------------------------------------
0642  * \ingroup H5D
0643  *
0644  * \brief Retrieves number of chunks that have nonempty intersection with a
0645  *        specified selection
0646  *
0647  * \dset_id
0648  * \param[in]  fspace_id   File dataspace selection identifier
0649  * \param[out] nchunks     Number of chunks in the selection
0650  *
0651  * \return \herr_t
0652  *
0653  * \details H5Dget_num_chunks() retrieves the number of chunks
0654  *          nchunks in a set of selected elements specified by \p fspace_id
0655  *          for a dataset specified by the identifier \p dset_id. If \p
0656  *          fspace_id is #H5S_ALL, the function will retrieve the total
0657  *          number of chunks stored for the dataset.
0658  *
0659  *          \p fspace_id specifies the file dataspace selection.  It is
0660  *          intended to take #H5S_ALL for specifying the current selection.
0661  *
0662  *          \note Please be aware that this function currently does not
0663  *          support non-trivial selections, thus \p fspace_id has no
0664  *          effect. Also, the implementation does not handle the #H5S_ALL
0665  *          macro correctly.  As a workaround, application can get
0666  *          the dataspace for the dataset using H5Dget_space() and pass that
0667  *          in for \p fspace_id.  This will be fixed in a future release.
0668  *
0669  * \since 1.10.5
0670  *
0671  */
0672 H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks);
0673 
0674 /**
0675  * --------------------------------------------------------------------------
0676  * \ingroup H5D
0677  *
0678  * \brief Retrieves information about a chunk specified by its coordinates
0679  *
0680  * \dset_id
0681  * \param[in]  offset      Logical position of the chunk's first element in units of dataset elements
0682  * \param[out] filter_mask Bitmask indicating the filters used when the chunk was written
0683  * \param[out] addr        Chunk address in the file, taking the user block (if any) into account
0684  * \param[out] size        Chunk size in bytes, 0 if the chunk does not exist
0685  *
0686  * \return \herr_t
0687  *
0688  * \details H5Dget_chunk_info_by_coord() retrieves the \p filter_mask, \p size,
0689  *          and \p addr for a chunk in the dataset specified by \p dset_id,
0690  *          using the coordinates specified by \p offset.
0691  *
0692  *          If the queried chunk does not exist in the file, \p size will
0693  *          be set to 0, \p addr to \c HADDR_UNDEF, and the buffer \p
0694  *          filter_mask will not be modified.
0695  *
0696  *          \p offset is a pointer to a one-dimensional array with a size
0697  *          equal to the dataset's rank. Each element is the logical
0698  *          position of the chunk's first element in a dimension.
0699  *
0700  * \note    Prior to HDF5 1.14.4, the reported address did not take the
0701  *          user block into account.
0702  *
0703  * \since 1.10.5
0704  *
0705  */
0706 H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask,
0707                                          haddr_t *addr, hsize_t *size);
0708 
0709 /**
0710  * --------------------------------------------------------------------------
0711  * \ingroup H5D
0712  *
0713  * \brief Iterate over all chunks of a chunked dataset
0714  *
0715  * \dset_id
0716  * \param[in]  dxpl_id  Identifier of a transfer property list
0717  * \param[in]  cb       User callback function, called for every chunk.
0718  * \param[in]  op_data  User-defined pointer to data required by op
0719  *
0720  * \return \herr_t
0721  *
0722  * \details H5Dchunk_iter iterates over all chunks in the dataset, calling the
0723  *          user supplied callback with the details of the chunk and the supplied
0724  *          context \p op_data.
0725  *
0726  * \note    Prior to HDF5 1.14.4, the address passed to the callback did not take
0727  *          the user block into account.
0728  *
0729  * \par Example
0730  * For each chunk, print the allocated chunk size (0 for unallocated chunks).
0731  * \snippet H5D_examples.c H5Dchunk_iter_cb
0732  * Iterate over all chunked datasets and chunks in a file.
0733  * \snippet H5D_examples.c H5Ovisit_cb
0734  *
0735  * \callback_note
0736  *
0737  * \since 1.14.0
0738  *
0739  */
0740 H5_DLL herr_t H5Dchunk_iter(hid_t dset_id, hid_t dxpl_id, H5D_chunk_iter_op_t cb, void *op_data);
0741 
0742 /**
0743  * --------------------------------------------------------------------------
0744  * \ingroup H5D
0745  *
0746  * \brief Retrieves information about a chunk specified by its index
0747  *
0748  * \dset_id
0749  * \param[in]  fspace_id File dataspace selection identifier (See Note below)
0750  * \param[in]  chk_idx   Index of the chunk
0751  * \param[out] offset    Logical position of the chunk's first element in units of dataset elements
0752  * \param[out] filter_mask Bitmask indicating the filters used when the chunk was written
0753  * \param[out] addr      Chunk address in the file, taking the user block (if any) into account
0754  * \param[out] size      Chunk size in bytes, 0 if the chunk does not exist
0755  *
0756  * \return \herr_t
0757  *
0758  * \details H5Dget_chunk_info() retrieves the offset coordinates,
0759  *          \p offset, filter mask, \p filter_mask, size, \p size, and address
0760  *          \p addr for the dataset specified by the identifier \p dset_id and the chunk
0761  *          specified by the index \p index. The chunk belongs to a set of
0762  *          chunks in the selection specified by \p fspace_id. If the queried
0763  *          chunk does not exist in the file, the size will be set to 0 and
0764  *          address to #HADDR_UNDEF. The value pointed to by filter_mask will
0765  *          not be modified. \c NULL can be passed in for any \p out parameters.
0766  *
0767  * \note    Prior to HDF5 1.14.4, the reported address did not take the
0768  *          user block into account.
0769  *
0770  *          \p chk_idx is the chunk index in the selection. The index value
0771  *          may have a value of 0 up to the number of chunks stored in
0772  *          the file that has a nonempty intersection with the file
0773  *          dataspace selection.
0774  *
0775  *          \note As of 1.10.5, the dataspace intersection is not yet
0776  *          supported. Hence, the index is of all the written chunks.
0777  *
0778  *          \p fspace_id specifies the file dataspace selection.  It is
0779  *          intended to take #H5S_ALL to specify the current selection.
0780  *
0781  *          \note Please be aware that this function currently does not
0782  *          support non-trivial selections; thus \p fspace_id has no
0783  *          effect. Also, the implementation does not handle the #H5S_ALL
0784  *          macro correctly.  As a workaround, an application can get
0785  *          the dataspace for the dataset using H5Dget_space() and pass that
0786  *          in for \p fspace_id.  This will be fixed in a future release.
0787  *
0788  * \since 1.10.5
0789  *
0790  */
0791 H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *offset,
0792                                 unsigned *filter_mask, haddr_t *addr, hsize_t *size);
0793 
0794 /**
0795  * --------------------------------------------------------------------------
0796  * \ingroup H5D
0797  *
0798  * \brief Returns dataset address in file
0799  *
0800  * \dset_id
0801  *
0802  * \return Returns the offset in bytes; otherwise, returns #HADDR_UNDEF,
0803  *         a negative value.
0804  *
0805  * \details H5Dget_offset() returns the address in the file of
0806  *          the dataset, \p dset_id. That address is expressed as the
0807  *          offset in bytes from the beginning of the file.
0808  *
0809  * \since 1.6.0
0810  *
0811  */
0812 H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
0813 
0814 /**
0815  * --------------------------------------------------------------------------
0816  * \ingroup H5D
0817  *
0818  * \brief Reads raw data from a dataset into a provided buffer
0819  *
0820  * \dset_id                 Identifier of the dataset to read from
0821  * \param[in] mem_type_id   Identifier of the memory datatype
0822  * \param[in] mem_space_id  Identifier of the memory dataspace
0823  * \param[in] file_space_id Identifier of the dataset's dataspace in the file
0824  * \param[in] dxpl_id       Identifier of a transfer property list
0825  * \param[out] buf          Buffer to receive data read from file
0826  *
0827  * \return \herr_t
0828  *
0829  * \details H5Dread() reads a dataset, specified by its identifier
0830  *          \p dset_id, from the file into an application memory buffer \p
0831  *          buf. Data transfer properties are defined by the argument \p
0832  *          dxpl_id. The memory datatype of the (partial) dataset
0833  *          is identified by the identifier \p mem_type_id. The part
0834  *          of the dataset to read is defined by \p mem_space_id and \p
0835  *          file_space_id.
0836  *
0837  *          \p file_space_id is used to specify only the selection within
0838  *          the file dataset's dataspace. Any dataspace specified in \p
0839  *          file_space_id is ignored by the library and the dataset's
0840  *          dataspace is always used. \p file_space_id can be the constant
0841  *          #H5S_ALL, which indicates that the entire file dataspace,
0842  *          as defined by the current dimensions of the dataset, is to
0843  *          be selected.
0844  *
0845  *          \p mem_space_id is used to specify both the memory dataspace
0846  *          and the selection within that dataspace. \p mem_space_id can
0847  *          be the constant #H5S_ALL, in which case the file dataspace is
0848  *          used for the memory dataspace and the selection defined with \p
0849  *          file_space_id is used for the selection within that dataspace.
0850  *
0851  *          The number of elements selected in the memory dataspace \Emph{must}
0852  *          be equal to the number of elements selected in the file dataspace.
0853  *
0854  *          The behavior of the library for the various combinations of
0855  *          valid dataspace identifiers and #H5S_ALL for the \p mem_space_id
0856  *          and the \p file_space_id parameters is described below:
0857  *
0858  *          <table>
0859  *            <tr>
0860  *              <th>mem_space_id</th>
0861  *              <th>file_space_id</th>
0862  *              <th>Behavior</th>
0863  *            </tr>
0864  *            <tr>
0865  *              <td>valid dataspace ID</td>
0866  *              <td>valid dataspace ID</td>
0867  *              <td>\p mem_space_id specifies the memory dataspace and the
0868  *                  selection within it. \p file_space_id specifies the
0869  *                  selection within the file dataset's dataspace.</td>
0870  *            </tr>
0871  *            <tr>
0872  *              <td>#H5S_ALL</td>
0873  *              <td>valid dataspace ID</td>
0874  *              <td>The file dataset's dataspace is used for the memory
0875  *                  dataspace and the selection specified with \p file_space_id
0876  *                  specifies the selection within it. The combination of the
0877  *                  file dataset's dataspace and the selection from
0878  *                  \p file_space_id is used for memory also.</td>
0879  *            </tr>
0880  *            <tr>
0881  *              <td>valid dataspace ID</td>
0882  *              <td>#H5S_ALL</td>
0883  *              <td>\p mem_space_id specifies the memory dataspace and the
0884  *                  selection within it. The selection within the file
0885  *                  dataset's dataspace is set to the "all" selection.</td>
0886  *            </tr>
0887  *            <tr>
0888  *              <td>#H5S_ALL</td>
0889  *              <td>#H5S_ALL</td>
0890  *              <td>The file dataset's dataspace is used for the memory
0891  *                  dataspace and the selection within the memory dataspace
0892  *                  is set to the "all" selection. The selection within the
0893  *                  file dataset's dataspace is set to the "all" selection.</td>
0894  *            </tr>
0895  *          </table>
0896  *
0897  * \note If no storage space was allocated for the dataset
0898  *       and a fill value is defined, the returned buffer \p buf
0899  *       is filled with the fill value.
0900  *
0901  * \par Example
0902  * \snippet H5D_examples.c read
0903  *
0904  * \since 1.0.0
0905  *
0906  */
0907 H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
0908                       hid_t dxpl_id, void *buf /*out*/);
0909 
0910 /**
0911  * --------------------------------------------------------------------------
0912  * \ingroup H5D
0913  *
0914  * \brief Reads raw data from a set of datasets into the provided buffers
0915  *
0916  * \param[in] count         Number of datasets to read from
0917  * \param[in] dset_id       Identifiers of the datasets to read from
0918  * \param[in] mem_type_id   Identifiers of the memory datatypes
0919  * \param[in] mem_space_id  Identifiers of the memory dataspaces
0920  * \param[in] file_space_id Identifiers of the datasets' dataspaces in the file
0921  * \param[in] dxpl_id       Identifier of a transfer property list
0922  * \param[out] buf          Buffers to receive data read from file
0923  *
0924  * \return \herr_t
0925  *
0926  * \details H5Dread_multi() reads data from \p count datasets, whose identifiers
0927  *          are listed in the \p dset_id array, from the file into multiple
0928  *          application memory buffers listed in the \p buf array. Data transfer
0929  *          properties are defined by the argument \p dxpl_id. The memory
0930  *          datatypes of each dataset are listed by identifier in the \p
0931  *          mem_type_id array. The parts of each dataset to read are listed by
0932  *          identifier in the \p file_space_id array, and the parts of each
0933  *          application memory buffer to read to are listed by identifier in the
0934  *          \p mem_space_id array. All array parameters have length \p count.
0935  *
0936  *          This function will produce the same results as \p count calls to
0937  *          H5Dread(). Information listed in that function about the specifics
0938  *          of its behavior also applies to H5Dread_multi(). By calling
0939  *          H5Dread_multi() instead of multiple calls to H5Dread(), however, the
0940  *          library can in some cases pass information about the entire I/O
0941  *          operation to the file driver, which can improve performance.
0942  *
0943  *          All datasets must be in the same HDF5 file, and each unique dataset
0944  *          may only be listed once. If this function is called collectively in
0945  *          parallel, each rank must pass exactly the same list of datasets in
0946  *          \p dset_id , though the other parameters may differ.
0947  *
0948  * \since 1.14.0
0949  *
0950  * \see H5Dread()
0951  *
0952  */
0953 H5_DLL herr_t H5Dread_multi(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
0954                             hid_t file_space_id[], hid_t dxpl_id, void *buf[] /*out*/);
0955 
0956 /**
0957  * --------------------------------------------------------------------------
0958  * \ingroup ASYNC
0959  * \async_variant_of{H5Dread}
0960  */
0961 #ifndef H5_DOXYGEN
0962 H5_DLL herr_t H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
0963                             hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
0964                             void *buf /*out*/, hid_t es_id);
0965 #else
0966 H5_DLL herr_t H5Dread_async(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
0967                             hid_t dxpl_id, void *buf /*out*/, hid_t es_id);
0968 #endif
0969 
0970 /**
0971  * --------------------------------------------------------------------------
0972  * \ingroup ASYNC
0973  * \async_variant_of{H5Dread_multi}
0974  */
0975 #ifndef H5_DOXYGEN
0976 H5_DLL herr_t H5Dread_multi_async(const char *app_file, const char *app_func, unsigned app_line, size_t count,
0977                                   hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
0978                                   hid_t file_space_id[], hid_t dxpl_id, void *buf[] /*out*/, hid_t es_id);
0979 #else
0980 H5_DLL herr_t H5Dread_multi_async(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
0981                                   hid_t file_space_id[], hid_t dxpl_id, void *buf[] /*out*/, hid_t es_id);
0982 #endif
0983 
0984 /**
0985  * --------------------------------------------------------------------------
0986  * \ingroup H5D
0987  *
0988  * \brief Writes raw data from a buffer to a dataset
0989  *
0990  * \param[in] dset_id        Identifier of the dataset to read from
0991  * \param[in] mem_type_id    Identifier of the memory datatype
0992  * \param[in] mem_space_id   Identifier of the memory dataspace
0993  * \param[in] file_space_id  Identifier of the dataset's dataspace in the file
0994  * \dxpl_id
0995  * \param[out] buf           Buffer with data to be written to the file
0996  *
0997  * \return \herr_t
0998  *
0999  * \details H5Dwrite() writes a (partial) dataset, specified by
1000  *          its identifier \p dset_id, from the application memory buffer \p
1001  *          buf into the file. Data transfer properties are defined by the
1002  *          argument \p dxpl_id. The memory datatype of the (partial)
1003  *          dataset is identified by the identifier \p mem_type_id. The
1004  *          part of the dataset to write is defined by \p mem_space_id
1005  *          and \p file_space_id.
1006  *
1007  *          If \p mem_type_id is either a fixed-length or variable-length
1008  *          string, it is important to set the string length when defining
1009  *          the datatype. String datatypes are derived from #H5T_C_S1
1010  *          (or #H5T_FORTRAN_S1 for Fortran codes), which defaults
1011  *          to 1 character in size. See H5Tset_size() and Creating
1012  *          variable-length string datatypes.
1013  *
1014  *          \p file_space_id is used to specify only the selection within
1015  *          the file dataset's dataspace. Any dataspace specified in \p
1016  *          file_space_id is ignored by the library and the dataset's
1017  *          dataspace is always used. \p file_space_id can be the constant
1018  *          #H5S_ALL, which indicates that the entire file dataspace,
1019  *          as defined by the current dimensions of the dataset, is to
1020  *          be selected.
1021  *
1022  *          \p mem_space_id is used to specify both the memory dataspace
1023  *          and the selection within that dataspace. mem_space_id can be
1024  *          the constant #H5S_ALL, in which case the file dataspace is
1025  *          used for the memory dataspace and the selection defined with \p
1026  *          file_space_id is used for the selection within that dataspace.
1027  *
1028  *          The behavior of the library for the various combinations of
1029  *          valid dataspace IDs and #H5S_ALL for the mem_space_id and
1030  *          thefile_space_id parameters is described below:
1031  *
1032  *          <table>
1033  *          <tr><th>\c mem_space_id</th>
1034  *          <th>\c file_space_id</th>
1035  *          <th>Behavior</th></tr>
1036  *          <tr><td>valid dataspace ID</td>
1037  *              <td>valid dataspace ID</td>
1038  *              <td>\p mem_space_id specifies the memory dataspace and the
1039  *                  selection within it. \p file_space_id specifies the
1040  *                  selection within the file dataset's dataspace.</td></tr>
1041  *          <tr><td>#H5S_ALL</td>
1042  *              <td>valid dataspace ID</td>
1043  *              <td>The file dataset's dataspace is used for the memory
1044  *                  dataspace and the selection specified with \p file_space_id
1045  *                  specifies the selection within it. The combination of the
1046  *                  file dataset's dataspace and the selection from \p
1047  *                  file_space_id is used for memory also. valid dataspace
1048  *                  ID</td></tr>
1049  *          <tr><td>valid dataspace ID</td>
1050  *              <td>#H5S_ALL</td>
1051  *              <td>\p mem_space_id specifies the memory dataspace and the
1052  *                  selection within it. The selection within the file
1053  *                  dataset's dataspace is set to "all" selection.</td></tr>
1054  *          <tr><td>#H5S_ALL</td>
1055  *              <td>#H5S_ALL</td>
1056  *              <td>The file dataset's dataspace is used for the memory
1057  *                  dataspace and the selection within the memory dataspace is
1058  *                  set to the "all" selection. The selection within the file
1059  *                  dataset's dataspace is set to the "all"
1060  *                  selection.</td></tr>
1061  *          </table>
1062  *          Setting an "all" selection indicates that the entire dataspace,
1063  *          as defined by the current dimensions of a dataspace, will
1064  *          be selected. The number of elements selected in the memory
1065  *          dataspace must match the number of elements selected in the
1066  *          file dataspace.
1067  *
1068  *          \p dxpl_id can be the constant #H5P_DEFAULT, in which
1069  *          case the default data transfer properties are used.
1070  *
1071  *          Writing to a dataset will fail if the HDF5 file was not opened
1072  *          with write access permissions.
1073  *
1074  *          If the dataset's space allocation time is set to
1075  *          #H5D_ALLOC_TIME_LATE or #H5D_ALLOC_TIME_INCR and the space for
1076  *          the dataset has not yet been allocated, that space is allocated
1077  *          when the first raw data is written to the dataset. Unused space
1078  *          in the dataset will be written with fill values at the same
1079  *          time if the dataset's fill time is set to #H5D_FILL_TIME_IFSET
1080  *          or #H5D_FILL_TIME_ALLOC.
1081  *
1082  * \par_compr_note
1083  *
1084  * \attention If a dataset's storage layout is 'compact', care must be
1085  *          taken when writing data to the dataset in parallel. A compact
1086  *          dataset's raw data is cached in memory and may be flushed
1087  *          to the file from any of the parallel processes, so parallel
1088  *          applications should always attempt to write identical data to
1089  *          the dataset from all processes.
1090  *
1091  * \par Example
1092  * \snippet H5D_examples.c update
1093  *
1094  * \since 1.0.0
1095  *
1096  * \see H5Pset_fill_time(), H5Pset_alloc_time()
1097  *
1098  */
1099 H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
1100                        hid_t dxpl_id, const void *buf);
1101 
1102 /**
1103  * --------------------------------------------------------------------------
1104  * \ingroup H5D
1105  *
1106  * \brief Writes raw data from a set buffers to a set of datasets
1107  *
1108  * \param[in] count         Number of datasets to write to
1109  * \param[in] dset_id       Identifiers of the datasets to write to
1110  * \param[in] mem_type_id   Identifiers of the memory datatypes
1111  * \param[in] mem_space_id  Identifiers of the memory dataspaces
1112  * \param[in] file_space_id Identifiers of the datasets' dataspaces in the file
1113  * \param[in] dxpl_id       Identifier of a transfer property list
1114  * \param[in] buf           Buffers with data to be written to the file
1115  *
1116  * \return \herr_t
1117  *
1118  * \details H5Dwrite_multi() writes data to \p count datasets, whose identifiers
1119  *          are listed in the \p dset_id array, from multiple application memory
1120  *          buffers listed in the \p buf array. Data transfer properties are
1121  *          defined by the argument \p dxpl_id. The memory datatypes of each
1122  *          dataset are listed by identifier in the \p mem_type_id array. The
1123  *          parts of each dataset to write are listed by identifier in the \p
1124  *          file_space_id array, and the parts of each application memory buffer
1125  *          to write from are listed by identifier in the \p mem_space_id array.
1126  *          All array parameters have length \p count.
1127  *
1128  *          This function will produce the same results as \p count calls to
1129  *          H5Dwrite(). Information listed in that function's documentation
1130  *          about the specifics of its behaviour also apply to H5Dwrite_multi().
1131  *          By calling H5Dwrite_multi() instead of multiple calls to H5Dwrite(),
1132  *          however, the library can in some cases pass information about the
1133  *          entire I/O operation to the file driver, which can improve
1134  *          performance.
1135  *
1136  *          All datasets must be in the same HDF5 file, and each unique dataset
1137  *          may only be listed once. If this function is called collectively in
1138  *          parallel, each rank must pass exactly the same list of datasets in
1139  *          \p dset_id , though the other parameters may differ.
1140  *
1141  * \since 1.14.0
1142  *
1143  * \see H5Dwrite()
1144  *
1145  */
1146 H5_DLL herr_t H5Dwrite_multi(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
1147                              hid_t file_space_id[], hid_t dxpl_id, const void *buf[]);
1148 
1149 /**
1150  * --------------------------------------------------------------------------
1151  * \ingroup ASYNC
1152  * \async_variant_of{H5Dwrite}
1153  */
1154 #ifndef H5_DOXYGEN
1155 H5_DLL herr_t H5Dwrite_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
1156                              hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
1157                              const void *buf, hid_t es_id);
1158 #else
1159 H5_DLL herr_t H5Dwrite_async(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
1160                              hid_t dxpl_id, const void *buf, hid_t es_id);
1161 #endif
1162 
1163 /**
1164  * --------------------------------------------------------------------------
1165  * \ingroup ASYNC
1166  * \async_variant_of{H5Dwrite_multi}
1167  */
1168 #ifndef H5_DOXYGEN
1169 H5_DLL herr_t H5Dwrite_multi_async(const char *app_file, const char *app_func, unsigned app_line,
1170                                    size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
1171                                    hid_t file_space_id[], hid_t dxpl_id, const void *buf[], hid_t es_id);
1172 #else
1173 H5_DLL herr_t H5Dwrite_multi_async(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_space_id[],
1174                                    hid_t file_space_id[], hid_t dxpl_id, const void *buf[], hid_t es_id);
1175 #endif
1176 
1177 /**
1178  * --------------------------------------------------------------------------
1179  * \ingroup H5D
1180  *
1181  * \brief Writes a raw data chunk from a buffer directly to a dataset in a file
1182  *
1183  * \dset_id
1184  * \dxpl_id
1185  * \param[in]  filters  Mask for identifying the filters in use
1186  * \param[in]  offset   Logical position of the chunk's first element in the
1187  *                      dataspace
1188  * \param[in]  data_size    Size of the actual data to be written in bytes
1189  * \param[in]  buf          Buffer containing data to be written to the chunk
1190  *
1191  * \return \herr_t
1192  *
1193  * \details H5Dwrite_chunk() writes a raw data chunk as specified
1194  *          by its logical offset \p offset in a chunked dataset \p dset_id
1195  *          from the application memory buffer \p buf to the dataset in
1196  *          the file. Typically, the data in \p buf is preprocessed in
1197  *          memory by a custom transformation, such as compression. The
1198  *          chunk will bypass the library's internal data transfer
1199  *          pipeline, including filters, and will be written directly to
1200  *          the file. Only one chunk can be written with this function.
1201  *
1202  *          \p filters is a mask providing a record of which filters are
1203  *          used with the chunk. The default value of the mask is
1204  *          zero (0), indicating that all enabled filters are applied. A
1205  *          filter is skipped if the bit corresponding to the filter's
1206  *          position in the pipeline (0 ≤ position < 32) is turned on.
1207  *          This mask is saved with the chunk in the file.
1208  *
1209  *          \p offset is an array specifying the logical position of the
1210  *          first element of the chunk in the dataset's dataspace. The
1211  *          length of the offset array must equal the number of dimensions,
1212  *          or rank, of the dataspace. The values in offset must not exceed
1213  *          the dimension limits and must specify a point that falls on
1214  *          a dataset chunk boundary.
1215  *
1216  *          \p data_size is the size in bytes of the chunk, representing
1217  *          the number of bytes to be read from the buffer \p buf. If the
1218  *          data chunk has been precompressed, \p data_size should be the
1219  *          size of the compressed data.
1220  *
1221  *          \p buf is the memory buffer containing data to be written to
1222  *          the chunk in the file.
1223  *
1224  * \attention Exercise caution when using H5Dread_chunk() and
1225  *          H5Dwrite_chunk(), as they read and write data chunks directly
1226  *          in a file. H5Dwrite_chunk() bypasses hyperslab selection, the
1227  *          conversion of data from one datatype to another, and the filter
1228  *          pipeline to write the chunk. Developers should have experience
1229  *          with these processes before using this function.
1230  *
1231  * \note    H5Dread_chunk() and H5Dwrite_chunk() are currently not supported
1232  *          with parallel HDF5 and do not support variable-length types.
1233  *
1234  * \since 1.10.2
1235  *
1236  */
1237 H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset,
1238                              size_t data_size, const void *buf);
1239 
1240 /**
1241  * --------------------------------------------------------------------------
1242  * \ingroup H5D
1243  *
1244  * \brief Reads a raw data chunk directly from a dataset in a file into
1245  * a buffer
1246  *
1247  * \dset_id
1248  * \dxpl_id
1249  * \param[in]  offset   Logical position of the chunk's first element in the
1250  *                      dataspace
1251  * \param[in,out]  filters  Mask for identifying the filters in use
1252  * \param[out]  buf     Buffer containing data to be read from the chunk
1253  *
1254  * \return \herr_t
1255  *
1256  * \details H5Dread_chunk() reads a raw data chunk as specified by
1257  *          its logical offset \p offset in a chunked dataset \p dset_id
1258  *          from the dataset in the file into the application memory
1259  *          buffer \p buf. The data in \p buf is read directly from the
1260  *          file bypassing the library's internal data transfer pipeline,
1261  *          including filters.
1262  *
1263  *          \p offset is an array specifying the logical position of the
1264  *          first element of the chunk in the dataset's dataspace. The
1265  *          length of the \p offset array must equal the number of dimensions,
1266  *          or rank, of the dataspace. The values in \p offset must not exceed
1267  *          the dimension limits and must specify a point that falls on
1268  *          a dataset chunk boundary.
1269  *
1270  *          The mask \p filters indicates which filters were used when the
1271  *          chunk was written. A zero value (all bits 0) indicates that all
1272  *          enabled filters are applied on the chunk. A filter is skipped if
1273  *          the bit corresponding to the filter's position in the pipeline
1274  *          (0 ≤ position < 32) is turned on.
1275  *
1276  *          \p buf is the memory buffer containing the chunk read from
1277  *          the dataset in the file.
1278  *
1279  * \attention Exercise caution when using H5Dread_chunk() and
1280  *          H5Dwrite_chunk(), as they read and write data chunks directly
1281  *          in a file. H5Dwrite_chunk() bypasses hyperslab selection, the
1282  *          conversion of data from one datatype to another, and the filter
1283  *          pipeline to write the chunk. Developers should have experience
1284  *          with these processes before using this function. Please see
1285  *          \ref subsec_hldo_direct_chunk_using for more information.
1286  *
1287  * \note H5Dread_chunk() and H5Dwrite_chunk() are currently not supported
1288  *       with parallel HDF5 and do not support variable-length datatypes.
1289  *
1290  * \since 1.10.2
1291  *
1292  */
1293 H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters,
1294                             void *buf);
1295 
1296 /**
1297  * --------------------------------------------------------------------------
1298  * \ingroup H5D
1299  *
1300  * \brief Iterates over all selected elements in a dataspace
1301  *
1302  * \param[in,out] buf Buffer containing the elements to iterate over
1303  * \type_id
1304  * \space_id
1305  * \param[in] op Function pointer
1306  * \param[in,out] operator_data User-defined data
1307  *
1308  * \return \success{The return value of the first operator that returns
1309  *                  non-zero, or zero if all members were processed with no
1310  *                  operator returning non-zero.}
1311  * \return \failure{Negative if an error occurs in the library, or the negative
1312  *                  value returned by one of the operators.}
1313  *
1314  * \details H5Diterate() iterates over all the data elements
1315  *          in the memory buffer \p buf, executing the callback function
1316  *          \p op once for each such data element.
1317  *
1318  * \attention Unlike other HDF5 iterators, this iteration operation cannot
1319  *            be restarted at the point of exit; a second H5Diterate()
1320  *            call will always restart at the beginning.
1321  *
1322  * \warning   Modifying the selection of \p space_id during iteration
1323  *            will lead to undefined behavior.
1324  *
1325  * \callback_note
1326  *
1327  * \since 1.10.2
1328  *
1329  */
1330 H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data);
1331 
1332 /**
1333  * --------------------------------------------------------------------------
1334  * \ingroup H5D
1335  *
1336  * \brief Determines the number of bytes required to store variable-length
1337  *        (VL) data
1338  *
1339  * \dset_id
1340  * \type_id
1341  * \space_id
1342  * \param[out] size Size in bytes of the memory buffer required to store
1343  *        the VL data
1344  *
1345  * \return \herr_t
1346  *
1347  * \details H5Dvlen_get_buf_size() determines the number of bytes
1348  *          required to store the VL data from the dataset, using \p
1349  *          space_id for the selection in the dataset on disk and the \p
1350  *          type_id for the memory representation of the VL data in memory.
1351  *          \p size is returned with the number of bytes required to store
1352  *          the VL data in memory.
1353  *
1354  * \since 1.10.2
1355  *
1356  */
1357 H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dset_id, hid_t type_id, hid_t space_id, hsize_t *size);
1358 
1359 /**
1360  * --------------------------------------------------------------------------
1361  * \ingroup H5D
1362  *
1363  * \brief Fills dataspace elements with a fill value in a memory buffer
1364  *
1365  * \param[in] fill          Pointer to the fill value to be used
1366  * \param[in] fill_type_id  Fill value datatype identifier
1367  * \param[in,out] buf       Pointer to the memory buffer containing the
1368  *                          selection to be filled
1369  * \param[in] buf_type_id   Datatype of dataspace elements to be filled
1370  * \space_id
1371  *
1372  * \return \herr_t
1373  *
1374  * \details H5Dfill() fills the dataspace selection, \p space_id, in memory
1375  *          with the fill value specified in \p fill. If \p fill is NULL,
1376  *          a fill value of 0 (zero) is used.
1377  *
1378  *          \p fill_type_id specifies the datatype of the fill value.
1379  *          \p buf specifies the buffer in which the fill elements
1380  *          will be written. \p buf_type_id specifies the datatype of
1381  *          those data elements.
1382  *
1383  * \note Note that if the fill value datatype differs from the memory
1384  *       buffer datatype, the fill value will be converted to the memory
1385  *       buffer datatype before filling the selection.
1386  *
1387  * \note Applications sometimes write data only to portions of an
1388  *       allocated dataset. It is often useful in such cases to fill
1389  *       the unused space with a known fill value.
1390  *
1391  * \see H5Pset_fill_value(), H5Pget_fill_value(), H5Pfill_value_defined(),
1392  *      H5Pset_fill_time(), H5Pget_fill_time(), H5Pcreate(), H5Dcreate_anon()
1393  * \since 1.6.0
1394  *
1395  */
1396 H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_t space_id);
1397 
1398 /**
1399  * --------------------------------------------------------------------------
1400  * \ingroup H5D
1401  *
1402  * \brief Changes the sizes of a dataset's dimensions
1403  *
1404  * \dset_id
1405  * \param[in] size[]   Array containing the new magnitude of each dimension
1406  *                     of the dataset
1407  *
1408  * \return \herr_t
1409  *
1410  * \details H5Dset_extent() sets the current dimensions of the
1411  *          chunked dataset \p dset_id to the sizes specified in size.
1412  *
1413  *          \p size is a 1-dimensional array with n elements, where \p n is
1414  *          the rank of the dataset's current dataspace.
1415  *
1416  *          This function can be applied to the following datasets:
1417  *          - A chunked dataset with unlimited dimensions
1418  *          - A chunked dataset with fixed dimensions if the new dimension
1419  *          sizes are less than the maximum sizes set with maxdims (see
1420  *          H5Screate_simple())
1421  *          - An external dataset with unlimited dimensions
1422  *          - An external dataset with fixed dimensions if the new dimension
1423  *          sizes are less than the maximum sizes set with \p maxdims
1424  *
1425  *          Note that external datasets are always contiguous and can be
1426  *          extended only along the first dimension.
1427  *
1428  *          Space on disk is immediately allocated for the new dataset extent if
1429  *          the dataset's space allocation time is set to #H5D_ALLOC_TIME_EARLY.
1430  *
1431  *          Fill values will be written to the dataset in either of the
1432  *          following situations, but not otherwise:
1433  *
1434  *          - If the dataset's fill time is set to #H5D_FILL_TIME_IFSET and a
1435  *            fill value is defined (see H5Pset_fill_time() and
1436  *            H5Pset_fill_value())
1437  *          - If the dataset's fill time is set to #H5D_FILL_TIME_ALLOC
1438  *            (see H5Pset_alloc_time())
1439  *
1440  * \note If the sizes specified in \p size array are smaller than the dataset's
1441  *       current dimension sizes, H5Dset_extent() will reduce the dataset's
1442  *       dimension sizes to the specified values. It is the user application's
1443  *       responsibility to ensure that valuable data is not lost as
1444  *       H5Dset_extent() does not check.
1445  *
1446  * \note Except for external datasets, H5Dset_extent() is for use with
1447  *       chunked datasets only, not contiguous datasets.
1448  *
1449  * \note A call to H5Dset_extent() affects the dataspace of a dataset.  If a
1450  *       dataspace handle was opened for a dataset prior to a call to
1451  *       H5Dset_extent() then that dataspace handle will no longer reflect the
1452  *       correct dataspace extent of the dataset. H5Dget_space() must be called
1453  *       (after closing the previous handle) to obtain the current dataspace
1454  *       extent.
1455  *
1456  * \since 1.8.0
1457  *
1458  */
1459 H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
1460 
1461 /**
1462  * --------------------------------------------------------------------------
1463  * \ingroup ASYNC
1464  * \async_variant_of{H5Dset_extent}
1465  */
1466 #ifndef H5_DOXYGEN
1467 H5_DLL herr_t H5Dset_extent_async(const char *app_file, const char *app_func, unsigned app_line,
1468                                   hid_t dset_id, const hsize_t size[], hid_t es_id);
1469 #else
1470 H5_DLL herr_t H5Dset_extent_async(hid_t dset_id, const hsize_t size[], hid_t es_id);
1471 #endif
1472 
1473 /**
1474  * --------------------------------------------------------------------------
1475  * \ingroup H5D
1476  *
1477  * \brief Flushes all buffers associated with a dataset to disk
1478  *
1479  * \dset_id
1480  *
1481  * \return \herr_t
1482  *
1483  * \details H5Dflush() causes all buffers associated with a
1484  *          dataset to be immediately flushed to disk without removing
1485  *          the data from the cache.
1486  *
1487  *          \note HDF5 does not possess full control over buffering.
1488  *          H5Dflush() flushes the internal HDF5 buffers and then asks the
1489  *          operating system (the OS) to flush the system buffers for the
1490  *          open files. After that, the OS is responsible for ensuring
1491  *          that the data is actually flushed to disk.
1492  *
1493  * \since 1.10.0
1494  *
1495  */
1496 H5_DLL herr_t H5Dflush(hid_t dset_id);
1497 
1498 /**
1499  * --------------------------------------------------------------------------
1500  * \ingroup H5D
1501  *
1502  * \brief Refreshes all buffers associated with a dataset
1503  *
1504  * \dset_id
1505  *
1506  * \return \herr_t
1507  *
1508  * \details H5Drefresh() causes all buffers associated with a
1509  *          dataset to be cleared and immediately re-loaded with updated
1510  *          contents from disk.
1511  *
1512  *          This function essentially closes the dataset, evicts all
1513  *          metadata associated with it from the cache, and then re-opens
1514  *          the dataset. The reopened dataset is automatically re-registered
1515  *          with the same identifier.
1516  *
1517  * \since 1.10.2
1518  *
1519  */
1520 H5_DLL herr_t H5Drefresh(hid_t dset_id);
1521 
1522 /**
1523  * --------------------------------------------------------------------------
1524  * \ingroup H5D
1525  *
1526  * \brief Scatters data into a selection within a memory buffer
1527  *
1528  * \param[in]  op       Callback function which provides data to be scattered
1529  * \param[in]  op_data  User-defined pointer to data required by op
1530  * \param[in]  type_id  Identifier for the datatype describing the data in
1531  *                      both the source and destination buffers
1532  * \param[in]  dst_space_id    Identifier for the dataspace for destination
1533  * \param[out] dst_buf  Destination buffer which the data will be scattered to
1534  *
1535  * \return \herr_t
1536  *
1537  * \details H5Dscatter() retrieves data from the supplied callback
1538  *          \p op and scatters it to the supplied buffer \p dst_buf in a
1539  *          manner similar to data being written to a dataset.
1540  *
1541  *          \p dst_space_id is a dataspace that defines the extent of \p
1542  *          dst_buf and the selection within it to scatter the data to.
1543  *
1544  *          \p type_id is the datatype of the data to be scattered in both
1545  *          the source and destination buffers.
1546  *
1547  *          \p dst_buf must be at least as large as the number of elements
1548  *          in the extent of \p dst_space_id times the size in bytes of
1549  *          \p type_id.
1550  *
1551  *          To retrieve the data to be scattered, H5Dscatter() repeatedly
1552  *          calls \p op, which should return a valid source buffer, until
1553  *          enough data to fill the selection has been retrieved.
1554  *
1555  * \since 1.10.2
1556  *
1557  */
1558 H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id,
1559                          void *dst_buf);
1560 
1561 /**
1562  * --------------------------------------------------------------------------
1563  * \ingroup H5D
1564  *
1565  * \brief Gathers data from a selection within a memory buffer
1566  * raw data chunk in a dataset
1567  *
1568  * \param[in]  src_space_id  Dataspace identifier for the source buffer
1569  * \param[in]  src_buf   Source buffer which the data will be gathered from
1570  * \param[in]  type_id   Datatype identifier for the source
1571  * \param[in]  dst_buf_size   Size in bytes of \p dst_buf
1572  * \param[out] dst_buf   Destination buffer for the gathered data
1573  * \param[in]  op   Callback function which handles the gathered data
1574  * \param[in]  op_data   User-defined pointer to data required by \p op
1575  *
1576  * \return \herr_t
1577  *
1578  * \details H5Dgather() retrieves data from a selection within the supplied
1579  *          buffer src_buf and passes it to the supplied callback function
1580  *          \p op in a contiguous form.
1581  *
1582  *          The dataspace \p src_space_id describes both the dimensions of
1583  *          the source buffer and the selection within the source buffer
1584  *          to gather data from.
1585  *
1586  *          \p src_buf must be at least the size of the gathered data, that
1587  *          is, the number of elements in the extent of \p src_space_id
1588  *          times the size in bytes of \p type_id.
1589  *
1590  *          The datatype \p type_id describes the data in both the source
1591  *          and destination buffers. This information is used to calculate
1592  *          the element size.
1593  *
1594  *          The data is gathered into \p dst_buf, which needs to be large
1595  *          enough to hold all the data if the callback function \p op is
1596  *          not provided.
1597  *
1598  *          \p op is a callback function that handles the gathered data.
1599  *          It is optional if \p dst_buf is large enough to hold all of the
1600  *          gathered data; required otherwise.
1601  *
1602  *          If no callback function is provided, H5Dgather() simply gathers
1603  *          the data into \p dst_buf and returns. If a callback function is
1604  *          provided, H5Dgather() repeatedly gathers up to \p dst_buf_size
1605  *          bytes to process the serialized data.
1606  *
1607  *          The callback function \p op should process, store, or otherwise,
1608  *          make use of the data returned in \p dst_buf before it returns,
1609  *          because the buffer will be overwritten unless it is the last
1610  *          call to the callback. This function will be repeatedly called
1611  *          until all gathered elements have been passed to the callback
1612  *          in \p dst_buf. The callback function should return zero (0)
1613  *          to indicate success, and a negative value to indicate failure.
1614  *
1615  * \callback_note
1616  *
1617  * \since 1.10.2
1618  *
1619  */
1620 H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size,
1621                         void *dst_buf, H5D_gather_func_t op, void *op_data);
1622 
1623 /**
1624  * --------------------------------------------------------------------------
1625  * \ingroup H5D
1626  *
1627  * \brief Closes the specified dataset
1628  *
1629  * \dset_id
1630  *
1631  * \return \herr_t
1632  *
1633  * \details H5Dclose() terminates access to a dataset via the identifier
1634  *          \p dset_id and releases the underlying resources.
1635  *
1636  * \par Example
1637  * \snippet H5D_examples.c read
1638  *
1639  * \since 1.0.0
1640  *
1641  * \see H5Dcreate2(), H5Dopen2()
1642  *
1643  */
1644 H5_DLL herr_t H5Dclose(hid_t dset_id);
1645 
1646 /**
1647  * --------------------------------------------------------------------------
1648  * \ingroup ASYNC
1649  * \async_variant_of{H5Dclose}
1650  */
1651 #ifndef H5_DOXYGEN
1652 H5_DLL herr_t H5Dclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
1653                              hid_t es_id);
1654 #else
1655 H5_DLL herr_t H5Dclose_async(hid_t dset_id, hid_t es_id);
1656 #endif
1657 /// \cond DEV
1658 /* Internal API routines */
1659 H5_DLL herr_t H5Ddebug(hid_t dset_id);
1660 H5_DLL herr_t H5Dformat_convert(hid_t dset_id);
1661 H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
1662 /// \endcond
1663 
1664 /// \cond DEV
1665 /* API Wrappers for async routines */
1666 /* (Must be defined _after_ the function prototype) */
1667 /* (And must only defined when included in application code, not the library) */
1668 #ifndef H5D_MODULE
1669 #define H5Dcreate_async(...)      H5Dcreate_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1670 #define H5Dopen_async(...)        H5Dopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1671 #define H5Dget_space_async(...)   H5Dget_space_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1672 #define H5Dread_async(...)        H5Dread_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1673 #define H5Dread_multi_async(...)  H5Dread_multi_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1674 #define H5Dwrite_async(...)       H5Dwrite_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1675 #define H5Dwrite_multi_async(...) H5Dwrite_multi_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1676 #define H5Dset_extent_async(...)  H5Dset_extent_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1677 #define H5Dclose_async(...)       H5Dclose_async(__FILE__, __func__, __LINE__, __VA_ARGS__)
1678 
1679 /* Define "wrapper" versions of function calls, to allow compile-time values to
1680  *      be passed in by language wrapper or library layer on top of HDF5.
1681  */
1682 #define H5Dcreate_async_wrap     H5_NO_EXPAND(H5Dcreate_async)
1683 #define H5Dopen_async_wrap       H5_NO_EXPAND(H5Dopen_async)
1684 #define H5Dget_space_async_wrap  H5_NO_EXPAND(H5Dget_space_async)
1685 #define H5Dread_async_wrap       H5_NO_EXPAND(H5Dread_async)
1686 #define H5Dwrite_async_wrap      H5_NO_EXPAND(H5Dwrite_async)
1687 #define H5Dset_extent_async_wrap H5_NO_EXPAND(H5Dset_extent_async)
1688 #define H5Dclose_async_wrap      H5_NO_EXPAND(H5Dclose_async)
1689 #endif /* H5D_MODULE */
1690 /// \endcond
1691 
1692 /* Symbols defined for compatibility with previous versions of the HDF5 API.
1693  *
1694  * Use of these symbols is deprecated.
1695  */
1696 #ifndef H5_NO_DEPRECATED_SYMBOLS
1697 
1698 /** v1 B-tree index \since 1.10.0 */
1699 #define H5D_CHUNK_BTREE H5D_CHUNK_IDX_BTREE
1700 
1701 /* Formerly used to support the H5DOread/write_chunk() API calls.
1702  * These symbols are no longer used in the library.
1703  */
1704 /* Property names for H5DOwrite_chunk */
1705 #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME     "direct_chunk_flag"
1706 #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME  "direct_chunk_filters"
1707 #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME   "direct_chunk_offset"
1708 #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME "direct_chunk_datasize"
1709 /* Property names for H5DOread_chunk */
1710 #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME    "direct_chunk_read_flag"
1711 #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME  "direct_chunk_read_offset"
1712 #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters"
1713 
1714 /* Typedefs */
1715 
1716 /* Function prototypes */
1717 /**
1718  * --------------------------------------------------------------------------
1719  * \ingroup H5D
1720  *
1721  * \brief Creates a dataset at the specified location
1722  *
1723  * \fgdta_loc_id
1724  * \param[in] name Name of the dataset to create
1725  * \type_id
1726  * \space_id
1727  * \dcpl_id
1728  *
1729  * \return \hid_t{dataset}
1730  *
1731  * \deprecation_note{H5Dcreate2() or the macro H5Dcreate()}
1732  *
1733  * \details H5Dcreate1() creates a data set with a name, \p name, in the
1734  *          location specified by the identifier \p loc_id. \p loc_id may be a
1735  *          file, group, dataset, named datatype or attribute.  If an attribute,
1736  *          dataset, or named datatype is specified for \p loc_id then the
1737  *          dataset will be created at the location where the attribute,
1738  *          dataset, or named datatype is attached.
1739  *
1740  *          \p name can be a relative path based at \p loc_id or an absolute
1741  *          path from the root of the file. Use of this function requires that
1742  *          any intermediate groups specified in the path already exist.
1743  *
1744  *          The dataset's datatype and dataspace are specified by \p type_id and
1745  *          \p space_id, respectively. These are the datatype and dataspace of
1746  *          the dataset as it will exist in the file, which may differ from the
1747  *          datatype and dataspace in application memory.
1748  *
1749  *          Names within a group are unique: H5Dcreate1() will return an error
1750  *          if a link with the name specified in name already exists at the
1751  *          location specified in \p loc_id.
1752  *
1753  *          As is the case for any object in a group, the length of a dataset
1754  *          name is not limited.
1755  *
1756  *          \p dcpl_id is an #H5P_DATASET_CREATE property list created with \p
1757  *          H5reate1() and initialized with various property list functions
1758  *          described in Property List Interface.
1759  *
1760  *          H5Dcreate() and H5Dcreate_anon() return an error if the dataset's
1761  *          datatype includes a variable-length (VL) datatype and the fill value
1762  *          is undefined, i.e., set to \c NULL in the dataset creation property
1763  *          list. Such a VL datatype may be directly included, indirectly
1764  *          included as part of a compound or array datatype, or indirectly
1765  *          included as part of a nested compound or array datatype.
1766  *
1767  *          H5Dcreate() and H5Dcreate_anon() return a dataset identifier for
1768  *          success or a negative value for failure. The dataset identifier
1769  *          should eventually be closed by calling H5Dclose() to release the
1770  *          resources it uses.
1771  *
1772  *          See H5Dcreate_anon() for a discussion of the differences between
1773  *          H5Dcreate() and H5Dcreate_anon().
1774  *
1775  *          The HDF5 library provides flexible means of specifying a fill value,
1776  *          of specifying when space will be allocated for a dataset, and of
1777  *          specifying when fill values will be written to a dataset.
1778  *
1779  * \version 1.8.0 Function H5Dcreate() renamed to H5Dcreate1() and deprecated in this release.
1780  * \since 1.0.0
1781  *
1782  * \see H5Dopen2(), H5Dclose(), H5Tset_size()
1783  *
1784  */
1785 H5_DLL hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id);
1786 /**
1787  * --------------------------------------------------------------------------
1788  * \ingroup H5D
1789  *
1790  * \brief Opens an existing dataset
1791  *
1792  * \fgdta_loc_id
1793  * \param[in] name Name of the dataset to access
1794  *
1795  * \return \hid_t{dataset}
1796  *
1797  * \deprecation_note{H5Dopen2() or the macro H5Dopen()}
1798  *
1799  * \details H5Dopen1() opens an existing dataset for access at the location
1800  *          specified by \p loc_id.  \p loc_id may be a file, group, dataset,
1801  *          named datatype or attribute.  If an attribute, dataset, or named
1802  *          datatype is specified for loc_id then the dataset will be opened at
1803  *          the location where the attribute, dataset, or named datatype is
1804  *          attached. name is a dataset name and is used to identify the dataset
1805  *          in the file.
1806  *
1807  *          A dataset opened with this function should be closed with H5Dclose()
1808  *          when the dataset is no longer needed so that resource leaks will not
1809  *          develop.
1810  *
1811  * \version 1.8.0 Function H5Dopen() renamed to H5Dopen1() and deprecated in this release.
1812  * \since 1.0.0
1813  *
1814  */
1815 H5_DLL hid_t H5Dopen1(hid_t loc_id, const char *name);
1816 /**
1817  * --------------------------------------------------------------------------
1818  * \ingroup H5D
1819  *
1820  * \brief Extends a dataset
1821  *
1822  * \dset_id
1823  * \param[in] size Array containing the new size of each dimension
1824  *
1825  * \return \herr_t
1826  *
1827  * \deprecation_note{H5Dset_extent()}
1828  *
1829  * \details H5Dextend() verifies that the dataset is at least of size \p size,
1830  *          extending it if necessary. The length of \p size is the same as
1831  *          that of the dataspace of the dataset being changed.
1832  *
1833  *          This function can be applied to the following datasets:
1834  *          \li Any dataset with unlimited dimensions
1835  *          \li A dataset with fixed dimensions if the current dimension sizes
1836  *              are less than the maximum sizes set with \c maxdims
1837  *              (see H5Screate_simple())
1838  *
1839  *          Space on disk is immediately allocated for the new dataset extent if
1840  *          the dataset's space allocation time is set to
1841  *          #H5D_ALLOC_TIME_EARLY. Fill values will be written to the dataset if
1842  *          the dataset's fill time is set to #H5D_FILL_TIME_IFSET or
1843  *          #H5D_FILL_TIME_ALLOC. (See H5Pset_fill_time() and
1844  *          H5Pset_alloc_time().)
1845  *
1846  *          This function ensures that the dataset dimensions are of at least
1847  *          the sizes specified in size. The function H5Dset_extent() must be
1848  *          used if the dataset dimension sizes are to be reduced.
1849  *
1850  * \version 1.8.0 Function deprecated in this release. Parameter size
1851  *                syntax changed to \TText{const hsize_t size[]} in this release.
1852  * \since 1.0.0
1853  *
1854  */
1855 H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
1856 /**
1857  * --------------------------------------------------------------------------
1858  * \ingroup H5D
1859  *
1860  * \brief Reclaims variable-length (VL) datatype memory buffers
1861  *
1862  * \type_id
1863  * \space_id
1864  * \dxpl_id
1865  * \param[in] buf Pointer to the buffer to be reclaimed
1866  *
1867  * \return \herr_t
1868  *
1869  * \deprecation_note{H5Treclaim()}
1870  *
1871  * \details H5Dvlen_reclaim() reclaims memory buffers created to store VL
1872  *          datatypes.
1873  *
1874  *          The \p type_id must be the datatype stored in the buffer. The \p
1875  *          space_id describes the selection for the memory buffer to free the
1876  *          VL datatypes within. The \p dxpl_id is the dataset transfer property
1877  *          list that was used for the I/O transfer to create the buffer. And
1878  *          \p buf is the pointer to the buffer to be reclaimed.
1879  *
1880  *          The VL structures (\ref hvl_t) in the user's buffer are modified to
1881  *          zero out the VL information after the memory has been reclaimed.
1882  *
1883  *          If nested VL datatypes were used to create the buffer, this routine
1884  *          frees them from the bottom up, releasing all the memory without
1885  *          creating memory leaks.
1886  *
1887  * \version 1.12.0 Function was deprecated
1888  *
1889  * \since 1.2.0
1890  *
1891  */
1892 H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf);
1893 
1894 #endif /* H5_NO_DEPRECATED_SYMBOLS */
1895 
1896 #ifdef __cplusplus
1897 }
1898 #endif
1899 #endif /* H5Dpublic_H */