H5FDcore.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * Programmer: Robb Matzke
  15. * Monday, August 2, 1999
  16. *
  17. * Purpose: The public header file for the core driver.
  18. */
  19. #ifndef H5FDcore_H
  20. #define H5FDcore_H
  21. #define H5FD_CORE (H5FDperform_init(H5FD_core_init))
  22. #define H5FD_CORE_VALUE H5_VFD_CORE
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. H5_DLL hid_t H5FD_core_init(void);
  27. /**
  28. * \ingroup FAPL
  29. *
  30. * \brief Modifies the file access property list to use the #H5FD_CORE driver
  31. *
  32. * \fapl_id
  33. * \param[in] increment Size, in bytes, of memory increments
  34. * \param[in] backing_store Boolean flag indicating whether to write the file
  35. * contents to disk when the file is closed
  36. * \returns \herr_t
  37. *
  38. * \details H5Pset_fapl_core() modifies the file access property list to use the
  39. * #H5FD_CORE driver.
  40. *
  41. * The #H5FD_CORE driver enables an application to work with a file in
  42. * memory, speeding reads and writes as no disk access is made. File
  43. * contents are stored only in memory until the file is closed. The \p
  44. * backing_store parameter determines whether file contents are ever
  45. * written to disk.
  46. *
  47. * \p increment specifies the increment by which allocated memory is to
  48. * be increased each time more memory is required.
  49. *
  50. * While using H5Fcreate() to create a core file, if the \p
  51. * backing_store is set to 1 (TRUE), the file contents are flushed to a
  52. * file with the same name as this core file when the file is closed or
  53. * access to the file is terminated in memory.
  54. *
  55. * The application is allowed to open an existing file with #H5FD_CORE
  56. * driver. While using H5Fopen() to open an existing file, if the \p
  57. * backing_store is set to 1 (TRUE) and the \c flags for H5Fopen() is set to
  58. * #H5F_ACC_RDWR, any change to the file contents are saved to the file
  59. * when the file is closed. If \p backing_store is set to 0 (FALSE) and the \c
  60. * flags for H5Fopen() is set to #H5F_ACC_RDWR, any change to the file
  61. * contents will be lost when the file is closed. If the flags for
  62. * H5Fopen() is set to #H5F_ACC_RDONLY, no change to the file is
  63. * allowed either in memory or on file.
  64. *
  65. * \note Currently this driver cannot create or open family or multi files.
  66. *
  67. * \since 1.4.0
  68. *
  69. */
  70. H5_DLL herr_t H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store);
  71. /**
  72. * \ingroup FAPL
  73. *
  74. * \brief Queries core file driver properties
  75. *
  76. * \fapl_id
  77. * \param[out] increment Size, in bytes, of memory increments
  78. * \param[out] backing_store Boolean flag indicating whether to write the file
  79. * contents to disk when the file is closed
  80. * \returns \herr_t
  81. *
  82. * \details H5Pget_fapl_core() queries the #H5FD_CORE driver properties as set
  83. * by H5Pset_fapl_core().
  84. *
  85. * \since 1.4.0
  86. *
  87. */
  88. H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_store /*out*/);
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92. #endif