OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependARM64MAC64.git] / include / H5FDcore.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
14 /*
15  * Programmer:  Robb Matzke
16  *              Monday, August  2, 1999
17  *
18  * Purpose:     The public header file for the core driver.
19  */
20 #ifndef H5FDcore_H
21 #define H5FDcore_H
22
23 #define H5FD_CORE (H5FD_core_init())
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 H5_DLL hid_t H5FD_core_init(void);
29
30 /**
31  * \ingroup FAPL
32  *
33  * \brief Modifies the file access property list to use the #H5FD_CORE driver
34  *
35  * \fapl_id
36  * \param[in] increment Size, in bytes, of memory increments
37  * \param[in] backing_store Boolean flag indicating whether to write the file
38  *            contents to disk when the file is closed
39  * \returns \herr_t
40  *
41  * \details H5Pset_fapl_core() modifies the file access property list to use the
42  *          #H5FD_CORE driver.
43  *
44  *          The #H5FD_CORE driver enables an application to work with a file in
45  *          memory, speeding reads and writes as no disk access is made. File
46  *          contents are stored only in memory until the file is closed. The \p
47  *          backing_store parameter determines whether file contents are ever
48  *          written to disk.
49  *
50  *          \p increment specifies the increment by which allocated memory is to
51  *          be increased each time more memory is required.
52  *
53  *          While using H5Fcreate() to create a core file, if the \p
54  *          backing_store is set to 1 (TRUE), the file contents are flushed to a
55  *          file with the same name as this core file when the file is closed or
56  *          access to the file is terminated in memory.
57  *
58  *          The application is allowed to open an existing file with #H5FD_CORE
59  *          driver. While using H5Fopen() to open an existing file, if the \p
60  *          backing_store is set to 1 (TRUE) and the \c flags for H5Fopen() is set to
61  *          #H5F_ACC_RDWR, any change to the file contents are saved to the file
62  *          when the file is closed. If \p backing_store is set to 0 (FALSE) and the \c
63  *          flags for H5Fopen() is set to #H5F_ACC_RDWR, any change to the file
64  *          contents will be lost when the file is closed. If the flags for
65  *          H5Fopen() is set to #H5F_ACC_RDONLY, no change to the file is
66  *          allowed either in memory or on file.
67  *
68  * \note Currently this driver cannot create or open family or multi files.
69  *
70  * \since 1.4.0
71  *
72  */
73 H5_DLL herr_t H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store);
74
75 /**
76  * \ingroup FAPL
77  *
78  * \brief Queries core file driver properties
79  *
80  * \fapl_id
81  * \param[out] increment Size, in bytes, of memory increments
82  * \param[out] backing_store Boolean flag indicating whether to write the file
83  *             contents to disk when the file is closed
84  * \returns \herr_t
85  *
86  * \details H5Pget_fapl_core() queries the #H5FD_CORE driver properties as set
87  *          by H5Pset_fapl_core().
88  *
89  * \since 1.4.0
90  *
91  */
92 H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_store /*out*/);
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif