H5VLconnector_passthru.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. * This file contains public declarations for authoring VOL connectors
  14. * which act as "passthrough" connectors that forward their API calls to
  15. * an underlying connector.
  16. *
  17. * An example of this might be a logging connector, which creates log messages
  18. * and then passes the call on to an underlying VOL connector.
  19. *
  20. * The functionality required to implement such a connector is specialized
  21. * and non-trivial so it has been split into this header in an effort to keep
  22. * the H5VLconnector.h header easier to understand.
  23. */
  24. #ifndef H5VLconnector_passthru_H
  25. #define H5VLconnector_passthru_H
  26. /* Public headers needed by this file */
  27. #include "H5public.h" /* Generic Functions */
  28. #include "H5Ipublic.h" /* IDs */
  29. #include "H5VLpublic.h" /* Virtual Object Layer */
  30. /* Semi-public headers mainly for VOL connector authors */
  31. #include "H5VLconnector.h"
  32. /*****************/
  33. /* Public Macros */
  34. /*****************/
  35. /*******************/
  36. /* Public Typedefs */
  37. /*******************/
  38. /********************/
  39. /* Public Variables */
  40. /********************/
  41. /*********************/
  42. /* Public Prototypes */
  43. /*********************/
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /* Helper routines for VOL connector authors */
  48. H5_DLL herr_t H5VLcmp_connector_cls(int *cmp, hid_t connector_id1, hid_t connector_id2);
  49. H5_DLL hid_t H5VLwrap_register(void *obj, H5I_type_t type);
  50. H5_DLL herr_t H5VLretrieve_lib_state(void **state);
  51. H5_DLL herr_t H5VLstart_lib_state(void);
  52. H5_DLL herr_t H5VLrestore_lib_state(const void *state);
  53. H5_DLL herr_t H5VLfinish_lib_state(void);
  54. H5_DLL herr_t H5VLfree_lib_state(void *state);
  55. /* Pass-through callbacks */
  56. H5_DLL void * H5VLget_object(void *obj, hid_t connector_id);
  57. H5_DLL herr_t H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx);
  58. H5_DLL void * H5VLwrap_object(void *obj, H5I_type_t obj_type, hid_t connector_id, void *wrap_ctx);
  59. H5_DLL void * H5VLunwrap_object(void *obj, hid_t connector_id);
  60. H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id);
  61. /* Public wrappers for generic callbacks */
  62. H5_DLL herr_t H5VLinitialize(hid_t connector_id, hid_t vipl_id);
  63. H5_DLL herr_t H5VLterminate(hid_t connector_id);
  64. H5_DLL herr_t H5VLget_cap_flags(hid_t connector_id, unsigned *cap_flags);
  65. H5_DLL herr_t H5VLget_value(hid_t connector_id, H5VL_class_value_t *conn_value);
  66. /* Public wrappers for info fields and callbacks */
  67. H5_DLL herr_t H5VLcopy_connector_info(hid_t connector_id, void **dst_vol_info, void *src_vol_info);
  68. H5_DLL herr_t H5VLcmp_connector_info(int *cmp, hid_t connector_id, const void *info1, const void *info2);
  69. H5_DLL herr_t H5VLfree_connector_info(hid_t connector_id, void *vol_info);
  70. H5_DLL herr_t H5VLconnector_info_to_str(const void *info, hid_t connector_id, char **str);
  71. H5_DLL herr_t H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info);
  72. /* Public wrappers for attribute callbacks */
  73. H5_DLL void * H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  74. const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id,
  75. hid_t aapl_id, hid_t dxpl_id, void **req);
  76. H5_DLL void * H5VLattr_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  77. const char *name, hid_t aapl_id, hid_t dxpl_id, void **req);
  78. H5_DLL herr_t H5VLattr_read(void *attr, hid_t connector_id, hid_t dtype_id, void *buf, hid_t dxpl_id,
  79. void **req);
  80. H5_DLL herr_t H5VLattr_write(void *attr, hid_t connector_id, hid_t dtype_id, const void *buf, hid_t dxpl_id,
  81. void **req);
  82. H5_DLL herr_t H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_args_t *args, hid_t dxpl_id,
  83. void **req);
  84. H5_DLL herr_t H5VLattr_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  85. H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
  86. H5_DLL herr_t H5VLattr_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  87. void **req);
  88. H5_DLL herr_t H5VLattr_close(void *attr, hid_t connector_id, hid_t dxpl_id, void **req);
  89. /* Public wrappers for dataset callbacks */
  90. H5_DLL void * H5VLdataset_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  91. const char *name, hid_t lcpl_id, hid_t type_id, hid_t space_id, hid_t dcpl_id,
  92. hid_t dapl_id, hid_t dxpl_id, void **req);
  93. H5_DLL void * H5VLdataset_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  94. const char *name, hid_t dapl_id, hid_t dxpl_id, void **req);
  95. H5_DLL herr_t H5VLdataset_read(void *dset, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id,
  96. hid_t file_space_id, hid_t plist_id, void *buf, void **req);
  97. H5_DLL herr_t H5VLdataset_write(void *dset, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id,
  98. hid_t file_space_id, hid_t plist_id, const void *buf, void **req);
  99. H5_DLL herr_t H5VLdataset_get(void *dset, hid_t connector_id, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
  100. void **req);
  101. H5_DLL herr_t H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_args_t *args,
  102. hid_t dxpl_id, void **req);
  103. H5_DLL herr_t H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  104. void **req);
  105. H5_DLL herr_t H5VLdataset_close(void *dset, hid_t connector_id, hid_t dxpl_id, void **req);
  106. /* Public wrappers for named datatype callbacks */
  107. H5_DLL void * H5VLdatatype_commit(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  108. const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id,
  109. hid_t dxpl_id, void **req);
  110. H5_DLL void * H5VLdatatype_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  111. const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
  112. H5_DLL herr_t H5VLdatatype_get(void *dt, hid_t connector_id, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
  113. void **req);
  114. H5_DLL herr_t H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_args_t *args,
  115. hid_t dxpl_id, void **req);
  116. H5_DLL herr_t H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  117. void **req);
  118. H5_DLL herr_t H5VLdatatype_close(void *dt, hid_t connector_id, hid_t dxpl_id, void **req);
  119. /* Public wrappers for file callbacks */
  120. H5_DLL void * H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
  121. void **req);
  122. H5_DLL void * H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
  123. H5_DLL herr_t H5VLfile_get(void *file, hid_t connector_id, H5VL_file_get_args_t *args, hid_t dxpl_id,
  124. void **req);
  125. H5_DLL herr_t H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_args_t *args, hid_t dxpl_id,
  126. void **req);
  127. H5_DLL herr_t H5VLfile_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  128. void **req);
  129. H5_DLL herr_t H5VLfile_close(void *file, hid_t connector_id, hid_t dxpl_id, void **req);
  130. /* Public wrappers for group callbacks */
  131. H5_DLL void * H5VLgroup_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  132. const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id,
  133. void **req);
  134. H5_DLL void * H5VLgroup_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  135. const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
  136. H5_DLL herr_t H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_args_t *args, hid_t dxpl_id,
  137. void **req);
  138. H5_DLL herr_t H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_args_t *args,
  139. hid_t dxpl_id, void **req);
  140. H5_DLL herr_t H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  141. void **req);
  142. H5_DLL herr_t H5VLgroup_close(void *grp, hid_t connector_id, hid_t dxpl_id, void **req);
  143. /* Public wrappers for link callbacks */
  144. H5_DLL herr_t H5VLlink_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
  145. hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
  146. H5_DLL herr_t H5VLlink_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
  147. const H5VL_loc_params_t *loc_params2, hid_t connector_id, hid_t lcpl_id,
  148. hid_t lapl_id, hid_t dxpl_id, void **req);
  149. H5_DLL herr_t H5VLlink_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
  150. const H5VL_loc_params_t *loc_params2, hid_t connector_id, hid_t lcpl_id,
  151. hid_t lapl_id, hid_t dxpl_id, void **req);
  152. H5_DLL herr_t H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  153. H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
  154. H5_DLL herr_t H5VLlink_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  155. H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
  156. H5_DLL herr_t H5VLlink_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  157. H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
  158. /* Public wrappers for object callbacks */
  159. H5_DLL void * H5VLobject_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  160. H5I_type_t *opened_type, hid_t dxpl_id, void **req);
  161. H5_DLL herr_t H5VLobject_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name,
  162. void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name,
  163. hid_t connector_id, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
  164. H5_DLL herr_t H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  165. H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
  166. H5_DLL herr_t H5VLobject_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  167. H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
  168. H5_DLL herr_t H5VLobject_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
  169. H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
  170. /* Public wrappers for connector/container introspection callbacks */
  171. H5_DLL herr_t H5VLintrospect_get_conn_cls(void *obj, hid_t connector_id, H5VL_get_conn_lvl_t lvl,
  172. const H5VL_class_t **conn_cls);
  173. H5_DLL herr_t H5VLintrospect_get_cap_flags(const void *info, hid_t connector_id, unsigned *cap_flags);
  174. H5_DLL herr_t H5VLintrospect_opt_query(void *obj, hid_t connector_id, H5VL_subclass_t subcls, int opt_type,
  175. uint64_t *flags);
  176. /* Public wrappers for asynchronous request callbacks */
  177. H5_DLL herr_t H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout,
  178. H5VL_request_status_t *status);
  179. H5_DLL herr_t H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, void *ctx);
  180. H5_DLL herr_t H5VLrequest_cancel(void *req, hid_t connector_id, H5VL_request_status_t *status);
  181. H5_DLL herr_t H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_args_t *args);
  182. H5_DLL herr_t H5VLrequest_optional(void *req, hid_t connector_id, H5VL_optional_args_t *args);
  183. H5_DLL herr_t H5VLrequest_free(void *req, hid_t connector_id);
  184. /* Public wrappers for blob callbacks */
  185. H5_DLL herr_t H5VLblob_put(void *obj, hid_t connector_id, const void *buf, size_t size, void *blob_id,
  186. void *ctx);
  187. H5_DLL herr_t H5VLblob_get(void *obj, hid_t connector_id, const void *blob_id, void *buf, size_t size,
  188. void *ctx);
  189. H5_DLL herr_t H5VLblob_specific(void *obj, hid_t connector_id, void *blob_id,
  190. H5VL_blob_specific_args_t *args);
  191. H5_DLL herr_t H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_optional_args_t *args);
  192. /* Public wrappers for token callbacks */
  193. H5_DLL herr_t H5VLtoken_cmp(void *obj, hid_t connector_id, const H5O_token_t *token1,
  194. const H5O_token_t *token2, int *cmp_value);
  195. H5_DLL herr_t H5VLtoken_to_str(void *obj, H5I_type_t obj_type, hid_t connector_id, const H5O_token_t *token,
  196. char **token_str);
  197. H5_DLL herr_t H5VLtoken_from_str(void *obj, H5I_type_t obj_type, hid_t connector_id, const char *token_str,
  198. H5O_token_t *token);
  199. /* Public wrappers for generic 'optional' callback */
  200. H5_DLL herr_t H5VLoptional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
  201. void **req);
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205. #endif /* H5VLconnector_passthru_H */