H5FDsplitter.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. * Copyright by The HDF Group. *
  3. * All rights reserved. *
  4. * *
  5. * This file is part of HDF5. The full HDF5 copyright notice, including *
  6. * terms governing use, modification, and redistribution, is contained in *
  7. * the COPYING file, which can be found at the root of the source code *
  8. * distribution tree, or in https://www.hdfgroup.org/licenses. *
  9. * If you do not have access to either file, you may request a copy from *
  10. * help@hdfgroup.org. *
  11. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  12. /*
  13. * Purpose: The public header file for the "splitter" driver.
  14. */
  15. #ifndef H5FDsplitter_H
  16. #define H5FDsplitter_H
  17. #define H5FD_SPLITTER (H5FDperform_init(H5FD_splitter_init))
  18. #define H5FD_SPLITTER_VALUE H5_VFD_SPLITTER
  19. /* The version of the H5FD_splitter_vfd_config_t structure used */
  20. #define H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION 1
  21. /* Maximum length of a filename/path string in the Write-Only channel,
  22. * including the NULL-terminator.
  23. */
  24. #define H5FD_SPLITTER_PATH_MAX 4096
  25. /* Semi-unique constant used to help identify structure pointers */
  26. #define H5FD_SPLITTER_MAGIC 0x2B916880
  27. /* ----------------------------------------------------------------------------
  28. * Structure: H5FD_spliiter_vfd_config_t
  29. *
  30. * One-stop shopping for configuring a Splitter VFD (rather than many
  31. * parameters passed into H5Pset/get functions).
  32. *
  33. * magic (int32_t)
  34. * Semi-unique number, used to sanity-check that a given pointer is
  35. * likely (or not) to be this structure type. MUST be first.
  36. * If magic is not H5FD_SPLITTER_MAGIC, the structure (and/or pointer to)
  37. * must be considered invalid.
  38. *
  39. * version (unsigned int)
  40. * Version number of this structure -- informs component membership.
  41. * If not H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION, the structure (and/or
  42. * pointer to) must be considered invalid.
  43. *
  44. * rw_fapl_id (hid_t)
  45. * Library-given identification number of the Read/Write channel driver
  46. * File Access Property List.
  47. * The driver must support read/write access.
  48. * Must be set to H5P_DEFAULT or a valid FAPL ID.
  49. *
  50. * wo_fapl_id (hid_t)
  51. * Library-given identification number of the Read/Write channel driver
  52. * File Access Property List.
  53. * The driver feature flags must include H5FD_FEAT_DEFAULT_VFD_COMPAITBLE.
  54. * Must be set to H5P_DEFAULT or a valid FAPL ID.
  55. *
  56. * wo_file_path (char[H5FD_SPLITTER_PATH_MAX + 1])
  57. * String buffer for the Write-Only channel target file.
  58. * Must be null-terminated, cannot be empty.
  59. *
  60. * log_file_path (char[H5FD_SPLITTER_PATH_MAX + 1])
  61. * String buffer for the Splitter VFD logging output.
  62. * Must be null-terminated.
  63. * If null, no logfile is created.
  64. *
  65. * ignore_wo_errors (hbool_t)
  66. * Toggle flag for how judiciously to respond to errors on the Write-Only
  67. * channel.
  68. *
  69. * ----------------------------------------------------------------------------
  70. */
  71. typedef struct H5FD_splitter_vfd_config_t {
  72. int32_t magic;
  73. unsigned int version;
  74. hid_t rw_fapl_id;
  75. hid_t wo_fapl_id;
  76. char wo_path[H5FD_SPLITTER_PATH_MAX + 1];
  77. char log_file_path[H5FD_SPLITTER_PATH_MAX + 1];
  78. hbool_t ignore_wo_errs;
  79. } H5FD_splitter_vfd_config_t;
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83. H5_DLL hid_t H5FD_splitter_init(void);
  84. /**
  85. * \ingroup FAPL
  86. *
  87. * \todo Add missing documentation
  88. */
  89. H5_DLL herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
  90. /**
  91. * \ingroup FAPL
  92. *
  93. * \todo Add missing documentation
  94. */
  95. H5_DLL herr_t H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif