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 /* 14 * This file contains public declarations for authoring VOL connectors. 15 */ 16 17 #ifndef H5VLconnector_H 18 #define H5VLconnector_H 19 20 /* Public headers needed by this file */ 21 #include "H5public.h" /* Generic Functions */ 22 #include "H5Apublic.h" /* Attributes */ 23 #include "H5ESpublic.h" /* Event Stack */ 24 #include "H5Fpublic.h" /* Files */ 25 #include "H5Ipublic.h" /* IDs */ 26 #include "H5Lpublic.h" /* Links */ 27 #include "H5Opublic.h" /* Objects */ 28 #include "H5Rpublic.h" /* References */ 29 #include "H5VLpublic.h" /* Virtual Object Layer */ 30 31 /*****************/ 32 /* Public Macros */ 33 /*****************/ 34 35 /* Capability flags for connector */ 36 #define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */ 37 #define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */ 38 39 /* Container info version */ 40 #define H5VL_CONTAINER_INFO_VERSION 0x01 /* Container info struct version */ 41 42 /* The maximum size allowed for blobs */ 43 #define H5VL_MAX_BLOB_ID_SIZE (16) /* Allow for 128-bits blob IDs */ 44 45 /*******************/ 46 /* Public Typedefs */ 47 /*******************/ 48 49 /* types for attribute GET callback */ 50 typedef enum H5VL_attr_get_t { 51 H5VL_ATTR_GET_ACPL, /* creation property list */ 52 H5VL_ATTR_GET_INFO, /* info */ 53 H5VL_ATTR_GET_NAME, /* access property list */ 54 H5VL_ATTR_GET_SPACE, /* dataspace */ 55 H5VL_ATTR_GET_STORAGE_SIZE, /* storage size */ 56 H5VL_ATTR_GET_TYPE /* datatype */ 57 } H5VL_attr_get_t; 58 59 /* types for attribute SPECFIC callback */ 60 typedef enum H5VL_attr_specific_t { 61 H5VL_ATTR_DELETE, /* H5Adelete(_by_name/idx) */ 62 H5VL_ATTR_EXISTS, /* H5Aexists(_by_name) */ 63 H5VL_ATTR_ITER, /* H5Aiterate(_by_name) */ 64 H5VL_ATTR_RENAME /* H5Arename(_by_name) */ 65 } H5VL_attr_specific_t; 66 67 /* Typedef for VOL connector attribute optional VOL operations */ 68 typedef int H5VL_attr_optional_t; 69 70 /* types for dataset GET callback */ 71 typedef enum H5VL_dataset_get_t { 72 H5VL_DATASET_GET_DAPL, /* access property list */ 73 H5VL_DATASET_GET_DCPL, /* creation property list */ 74 H5VL_DATASET_GET_SPACE, /* dataspace */ 75 H5VL_DATASET_GET_SPACE_STATUS, /* space status */ 76 H5VL_DATASET_GET_STORAGE_SIZE, /* storage size */ 77 H5VL_DATASET_GET_TYPE /* datatype */ 78 } H5VL_dataset_get_t; 79 80 /* types for dataset SPECFIC callback */ 81 typedef enum H5VL_dataset_specific_t { 82 H5VL_DATASET_SET_EXTENT, /* H5Dset_extent */ 83 H5VL_DATASET_FLUSH, /* H5Dflush */ 84 H5VL_DATASET_REFRESH /* H5Drefresh */ 85 } H5VL_dataset_specific_t; 86 87 /* Typedef for VOL connector dataset optional VOL operations */ 88 typedef int H5VL_dataset_optional_t; 89 90 /* types for datatype GET callback */ 91 typedef enum H5VL_datatype_get_t { 92 H5VL_DATATYPE_GET_BINARY, /* get serialized form of transient type */ 93 H5VL_DATATYPE_GET_TCPL /* datatype creation property list */ 94 } H5VL_datatype_get_t; 95 96 /* types for datatype SPECFIC callback */ 97 typedef enum H5VL_datatype_specific_t { H5VL_DATATYPE_FLUSH, H5VL_DATATYPE_REFRESH } H5VL_datatype_specific_t; 98 99 /* Typedef and values for native VOL connector named datatype optional VOL operations */ 100 typedef int H5VL_datatype_optional_t; 101 /* (No optional named datatype VOL operations currently) */ 102 103 /* types for file GET callback */ 104 typedef enum H5VL_file_get_t { 105 H5VL_FILE_GET_CONT_INFO, /* file get container info */ 106 H5VL_FILE_GET_FAPL, /* file access property list */ 107 H5VL_FILE_GET_FCPL, /* file creation property list */ 108 H5VL_FILE_GET_FILENO, /* file number */ 109 H5VL_FILE_GET_INTENT, /* file intent */ 110 H5VL_FILE_GET_NAME, /* file name */ 111 H5VL_FILE_GET_OBJ_COUNT, /* object count in file */ 112 H5VL_FILE_GET_OBJ_IDS /* object ids in file */ 113 } H5VL_file_get_t; 114 115 /* types for file SPECIFIC callback */ 116 typedef enum H5VL_file_specific_t { 117 H5VL_FILE_FLUSH, /* Flush file */ 118 H5VL_FILE_REOPEN, /* Reopen the file */ 119 H5VL_FILE_MOUNT, /* Mount a file */ 120 H5VL_FILE_UNMOUNT, /* Unmount a file */ 121 H5VL_FILE_IS_ACCESSIBLE, /* Check if a file is accessible */ 122 H5VL_FILE_DELETE, /* Delete a file */ 123 H5VL_FILE_IS_EQUAL /* Check if two files are the same */ 124 } H5VL_file_specific_t; 125 126 /* Typedef for VOL connector file optional VOL operations */ 127 typedef int H5VL_file_optional_t; 128 129 /* types for group GET callback */ 130 typedef enum H5VL_group_get_t { 131 H5VL_GROUP_GET_GCPL, /* group creation property list */ 132 H5VL_GROUP_GET_INFO /* group info */ 133 } H5VL_group_get_t; 134 135 /* types for group SPECFIC callback */ 136 typedef enum H5VL_group_specific_t { H5VL_GROUP_FLUSH, H5VL_GROUP_REFRESH } H5VL_group_specific_t; 137 138 /* Typedef for VOL connector group optional VOL operations */ 139 typedef int H5VL_group_optional_t; 140 141 /* link create types for VOL */ 142 typedef enum H5VL_link_create_type_t { 143 H5VL_LINK_CREATE_HARD, 144 H5VL_LINK_CREATE_SOFT, 145 H5VL_LINK_CREATE_UD 146 } H5VL_link_create_type_t; 147 148 /* types for link GET callback */ 149 typedef enum H5VL_link_get_t { 150 H5VL_LINK_GET_INFO, /* link info */ 151 H5VL_LINK_GET_NAME, /* link name */ 152 H5VL_LINK_GET_VAL /* link value */ 153 } H5VL_link_get_t; 154 155 /* types for link SPECIFIC callback */ 156 typedef enum H5VL_link_specific_t { 157 H5VL_LINK_DELETE, /* H5Ldelete(_by_idx) */ 158 H5VL_LINK_EXISTS, /* link existence */ 159 H5VL_LINK_ITER /* H5Literate/visit(_by_name) */ 160 } H5VL_link_specific_t; 161 162 /* Typedef and values for native VOL connector link optional VOL operations */ 163 typedef int H5VL_link_optional_t; 164 /* (No optional link VOL operations currently) */ 165 166 /* types for object GET callback */ 167 typedef enum H5VL_object_get_t { 168 H5VL_OBJECT_GET_FILE, /* object file */ 169 H5VL_OBJECT_GET_NAME, /* object name */ 170 H5VL_OBJECT_GET_TYPE, /* object type */ 171 H5VL_OBJECT_GET_INFO /* H5Oget_info(_by_idx|name) */ 172 } H5VL_object_get_t; 173 174 /* types for object SPECIFIC callback */ 175 typedef enum H5VL_object_specific_t { 176 H5VL_OBJECT_CHANGE_REF_COUNT, /* H5Oincr/decr_refcount */ 177 H5VL_OBJECT_EXISTS, /* H5Oexists_by_name */ 178 H5VL_OBJECT_LOOKUP, /* Lookup object */ 179 H5VL_OBJECT_VISIT, /* H5Ovisit(_by_name) */ 180 H5VL_OBJECT_FLUSH, /* H5{D|G|O|T}flush */ 181 H5VL_OBJECT_REFRESH /* H5{D|G|O|T}refresh */ 182 } H5VL_object_specific_t; 183 184 /* Typedef for VOL connector object optional VOL operations */ 185 typedef int H5VL_object_optional_t; 186 187 /* types for async request SPECIFIC callback */ 188 typedef enum H5VL_request_specific_t { 189 H5VL_REQUEST_WAITANY, /* Wait until any request completes */ 190 H5VL_REQUEST_WAITSOME, /* Wait until at least one requesst completes */ 191 H5VL_REQUEST_WAITALL /* Wait until all requests complete */ 192 } H5VL_request_specific_t; 193 194 /* Typedef and values for native VOL connector request optional VOL operations */ 195 typedef int H5VL_request_optional_t; 196 /* (No optional request VOL operations currently) */ 197 198 /* types for 'blob' SPECIFIC callback */ 199 typedef enum H5VL_blob_specific_t { 200 H5VL_BLOB_DELETE, /* Delete a blob (by ID) */ 201 H5VL_BLOB_GETSIZE, /* Get size of blob */ 202 H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */ 203 H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */ 204 } H5VL_blob_specific_t; 205 206 /* Typedef and values for native VOL connector blob optional VOL operations */ 207 typedef int H5VL_blob_optional_t; 208 /* (No optional blob VOL operations currently) */ 209 210 /* Types for different ways that objects are located in an HDF5 container */ 211 typedef enum H5VL_loc_type_t { 212 H5VL_OBJECT_BY_SELF, 213 H5VL_OBJECT_BY_NAME, 214 H5VL_OBJECT_BY_IDX, 215 H5VL_OBJECT_BY_TOKEN 216 } H5VL_loc_type_t; 217 218 typedef struct H5VL_loc_by_name { 219 const char *name; 220 hid_t lapl_id; 221 } H5VL_loc_by_name_t; 222 223 typedef struct H5VL_loc_by_idx { 224 const char * name; 225 H5_index_t idx_type; 226 H5_iter_order_t order; 227 hsize_t n; 228 hid_t lapl_id; 229 } H5VL_loc_by_idx_t; 230 231 typedef struct H5VL_loc_by_token { 232 H5O_token_t *token; 233 } H5VL_loc_by_token_t; 234 235 /* Structure to hold parameters for object locations. 236 * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN 237 * 238 * Note: Leave loc_by_token as the first union member so we 239 * can perform the simplest initialization of the struct 240 * without raising warnings. 241 * 242 * Note: BY_SELF requires no union members. 243 */ 244 typedef struct H5VL_loc_params_t { 245 H5I_type_t obj_type; 246 H5VL_loc_type_t type; 247 union { 248 H5VL_loc_by_token_t loc_by_token; 249 H5VL_loc_by_name_t loc_by_name; 250 H5VL_loc_by_idx_t loc_by_idx; 251 } loc_data; 252 } H5VL_loc_params_t; 253 254 /* Info for H5VL_FILE_GET_CONT_INFO */ 255 typedef struct H5VL_file_cont_info_t { 256 unsigned version; /* version information (keep first) */ 257 uint64_t feature_flags; /* Container feature flags */ 258 /* (none currently defined) */ 259 size_t token_size; /* Size of tokens */ 260 size_t blob_id_size; /* Size of blob IDs */ 261 } H5VL_file_cont_info_t; 262 263 /* VOL connector info fields & callbacks */ 264 typedef struct H5VL_info_class_t { 265 size_t size; /* Size of the VOL info */ 266 void *(*copy)(const void *info); /* Callback to create a copy of the VOL info */ 267 herr_t (*cmp)(int *cmp_value, const void *info1, const void *info2); /* Callback to compare VOL info */ 268 herr_t (*free)(void *info); /* Callback to release a VOL info */ 269 herr_t (*to_str)(const void *info, char **str); /* Callback to serialize connector's info into a string */ 270 herr_t (*from_str)(const char *str, 271 void ** info); /* Callback to deserialize a string into connector's info */ 272 } H5VL_info_class_t; 273 274 /* VOL object wrap / retrieval callbacks */ 275 /* (These only need to be implemented by "pass through" VOL connectors) */ 276 typedef struct H5VL_wrap_class_t { 277 void *(*get_object)(const void *obj); /* Callback to retrieve underlying object */ 278 herr_t (*get_wrap_ctx)( 279 const void *obj, 280 void ** wrap_ctx); /* Callback to retrieve the object wrapping context for the connector */ 281 void *(*wrap_object)(void *obj, H5I_type_t obj_type, 282 void *wrap_ctx); /* Callback to wrap a library object */ 283 void *(*unwrap_object)(void *obj); /* Callback to unwrap a library object */ 284 herr_t (*free_wrap_ctx)( 285 void *wrap_ctx); /* Callback to release the object wrapping context for the connector */ 286 } H5VL_wrap_class_t; 287 288 /* H5A routines */ 289 typedef struct H5VL_attr_class_t { 290 void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t type_id, 291 hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); 292 void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t aapl_id, 293 hid_t dxpl_id, void **req); 294 herr_t (*read)(void *attr, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req); 295 herr_t (*write)(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req); 296 herr_t (*get)(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); 297 herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type, 298 hid_t dxpl_id, void **req, va_list arguments); 299 herr_t (*optional)(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req, 300 va_list arguments); 301 herr_t (*close)(void *attr, hid_t dxpl_id, void **req); 302 } H5VL_attr_class_t; 303 304 /* H5D routines */ 305 typedef struct H5VL_dataset_class_t { 306 void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t lcpl_id, 307 hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req); 308 void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t dapl_id, 309 hid_t dxpl_id, void **req); 310 herr_t (*read)(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id, 311 void *buf, void **req); 312 herr_t (*write)(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id, 313 const void *buf, void **req); 314 herr_t (*get)(void *obj, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); 315 herr_t (*specific)(void *obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req, 316 va_list arguments); 317 herr_t (*optional)(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, void **req, 318 va_list arguments); 319 herr_t (*close)(void *dset, hid_t dxpl_id, void **req); 320 } H5VL_dataset_class_t; 321 322 /* H5T routines*/ 323 typedef struct H5VL_datatype_class_t { 324 void *(*commit)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t type_id, 325 hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); 326 void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id, 327 hid_t dxpl_id, void **req); 328 herr_t (*get)(void *obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); 329 herr_t (*specific)(void *obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, 330 va_list arguments); 331 herr_t (*optional)(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, void **req, 332 va_list arguments); 333 herr_t (*close)(void *dt, hid_t dxpl_id, void **req); 334 } H5VL_datatype_class_t; 335 336 /* H5F routines */ 337 typedef struct H5VL_file_class_t { 338 void *(*create)(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, 339 void **req); 340 void *(*open)(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req); 341 herr_t (*get)(void *obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); 342 herr_t (*specific)(void *obj, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, 343 va_list arguments); 344 herr_t (*optional)(void *obj, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req, 345 va_list arguments); 346 herr_t (*close)(void *file, hid_t dxpl_id, void **req); 347 } H5VL_file_class_t; 348 349 /* H5G routines */ 350 typedef struct H5VL_group_class_t { 351 void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t lcpl_id, 352 hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req); 353 void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id, 354 hid_t dxpl_id, void **req); 355 herr_t (*get)(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); 356 herr_t (*specific)(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, 357 va_list arguments); 358 herr_t (*optional)(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req, 359 va_list arguments); 360 herr_t (*close)(void *grp, hid_t dxpl_id, void **req); 361 } H5VL_group_class_t; 362 363 /* H5L routines */ 364 typedef struct H5VL_link_class_t { 365 herr_t (*create)(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params, 366 hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req, va_list arguments); 367 herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, 368 const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, 369 void **req); 370 herr_t (*move)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj, 371 const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, 372 void **req); 373 herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, hid_t dxpl_id, 374 void **req, va_list arguments); 375 herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type, 376 hid_t dxpl_id, void **req, va_list arguments); 377 herr_t (*optional)(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req, 378 va_list arguments); 379 } H5VL_link_class_t; 380 381 /* H5O routines */ 382 typedef struct H5VL_object_class_t { 383 void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, hid_t dxpl_id, 384 void **req); 385 herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, void *dst_obj, 386 const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, 387 hid_t dxpl_id, void **req); 388 herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, hid_t dxpl_id, 389 void **req, va_list arguments); 390 herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type, 391 hid_t dxpl_id, void **req, va_list arguments); 392 herr_t (*optional)(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req, 393 va_list arguments); 394 } H5VL_object_class_t; 395 396 /* Asynchronous request 'notify' callback */ 397 typedef herr_t (*H5VL_request_notify_t)(void *ctx, H5ES_status_t status); 398 399 /* "Levels" for 'get connector class' introspection callback */ 400 typedef enum H5VL_get_conn_lvl_t { 401 H5VL_GET_CONN_LVL_CURR, /* Get "current" connector (for this object) */ 402 H5VL_GET_CONN_LVL_TERM /* Get "terminal" connector (for this object) */ 403 /* (Recursively called, for pass-through connectors) */ 404 /* (Connectors that "split" must choose which connector to return) */ 405 } H5VL_get_conn_lvl_t; 406 407 /* Forward declaration of H5VL_class_t, defined later in this file */ 408 struct H5VL_class_t; 409 410 /* Container/connector introspection routines */ 411 typedef struct H5VL_introspect_class_t { 412 herr_t (*get_conn_cls)(void *obj, H5VL_get_conn_lvl_t lvl, const struct H5VL_class_t **conn_cls); 413 herr_t (*opt_query)(void *obj, H5VL_subclass_t cls, int opt_type, hbool_t *supported); 414 } H5VL_introspect_class_t; 415 416 /* Async request operation routines */ 417 typedef struct H5VL_request_class_t { 418 herr_t (*wait)(void *req, uint64_t timeout, H5ES_status_t *status); 419 herr_t (*notify)(void *req, H5VL_request_notify_t cb, void *ctx); 420 herr_t (*cancel)(void *req); 421 herr_t (*specific)(void *req, H5VL_request_specific_t specific_type, va_list arguments); 422 herr_t (*optional)(void *req, H5VL_request_optional_t opt_type, va_list arguments); 423 herr_t (*free)(void *req); 424 } H5VL_request_class_t; 425 426 /* 'blob' routines */ 427 typedef struct H5VL_blob_class_t { 428 herr_t (*put)(void *obj, const void *buf, size_t size, void *blob_id, void *ctx); 429 herr_t (*get)(void *obj, const void *blob_id, void *buf, size_t size, void *ctx); 430 herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, va_list arguments); 431 herr_t (*optional)(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments); 432 } H5VL_blob_class_t; 433 434 /* Object token routines */ 435 typedef struct H5VL_token_class_t { 436 herr_t (*cmp)(void *obj, const H5O_token_t *token1, const H5O_token_t *token2, int *cmp_value); 437 herr_t (*to_str)(void *obj, H5I_type_t obj_type, const H5O_token_t *token, char **token_str); 438 herr_t (*from_str)(void *obj, H5I_type_t obj_type, const char *token_str, H5O_token_t *token); 439 } H5VL_token_class_t; 440 441 /** 442 * \ingroup H5VLDEV 443 * Class information for each VOL connector 444 */ 445 //! <!-- [H5VL_class_t_snip] --> 446 typedef struct H5VL_class_t { 447 /* Overall connector fields & callbacks */ 448 unsigned version; /**< VOL connector class struct version # */ 449 H5VL_class_value_t value; /**< Value to identify connector */ 450 const char * name; /**< Connector name (MUST be unique!) */ 451 unsigned cap_flags; /**< Capability flags for connector */ 452 herr_t (*initialize)(hid_t vipl_id); /**< Connector initialization callback */ 453 herr_t (*terminate)(void); /**< Connector termination callback */ 454 455 /* VOL framework */ 456 H5VL_info_class_t info_cls; /**< VOL info fields & callbacks */ 457 H5VL_wrap_class_t wrap_cls; /**< VOL object wrap / retrieval callbacks */ 458 459 /* Data Model */ 460 H5VL_attr_class_t attr_cls; /**< Attribute (H5A*) class callbacks */ 461 H5VL_dataset_class_t dataset_cls; /**< Dataset (H5D*) class callbacks */ 462 H5VL_datatype_class_t datatype_cls; /**< Datatype (H5T*) class callbacks */ 463 H5VL_file_class_t file_cls; /**< File (H5F*) class callbacks */ 464 H5VL_group_class_t group_cls; /**< Group (H5G*) class callbacks */ 465 H5VL_link_class_t link_cls; /**< Link (H5L*) class callbacks */ 466 H5VL_object_class_t object_cls; /**< Object (H5O*) class callbacks */ 467 468 /* Infrastructure / Services */ 469 H5VL_introspect_class_t introspect_cls; /**< Container/connector introspection class callbacks */ 470 H5VL_request_class_t request_cls; /**< Asynchronous request class callbacks */ 471 H5VL_blob_class_t blob_cls; /**< 'Blob' class callbacks */ 472 H5VL_token_class_t token_cls; /**< VOL connector object token class callbacks */ 473 474 /* Catch-all */ 475 herr_t (*optional)(void *obj, int op_type, hid_t dxpl_id, void **req, 476 va_list arguments); /**< Optional callback */ 477 } H5VL_class_t; 478 //! <!-- [H5VL_class_t_snip] --> 479 480 /********************/ 481 /* Public Variables */ 482 /********************/ 483 484 /*********************/ 485 /* Public Prototypes */ 486 /*********************/ 487 488 #ifdef __cplusplus 489 extern "C" { 490 #endif 491 492 /* Helper routines for VOL connector authors */ 493 /** 494 * \ingroup H5VLDEV 495 * \brief Registers a new VOL connector 496 * 497 * \param[in] cls A pointer to the plugin structure to register 498 * \vipl_id 499 * \return \hid_t{VOL connector} 500 * 501 * \details H5VLregister_connector() registers a new VOL connector as a member 502 * of the virtual object layer class. This VOL connector identifier is 503 * good until the library is closed or the connector is unregistered. 504 * 505 * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL 506 * initialization property list of class #H5P_VOL_INITIALIZE created 507 * with H5Pcreate(). When created, this property list contains no 508 * library properties. If a VOL connector author decides that 509 * initialization-specific data are needed, they can be added to the 510 * empty list and retrieved by the connector in the VOL connector's 511 * initialize callback. Use of the VOL initialization property list is 512 * uncommon, as most VOL-specific properties are added to the file 513 * access property list via the connector's API calls which set the 514 * VOL connector for the file open/create. For more information, see 515 * the \ref_vol_doc. 516 * 517 * H5VL_class_t is defined in H5VLconnector.h in the source code. It 518 * contains class information for each VOL connector: 519 * \snippet this H5VL_class_t_snip 520 * 521 * \since 1.12.0 522 * 523 */ 524 H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id); 525 /** 526 * \ingroup H5VLDEV 527 */ 528 H5_DLL void *H5VLobject(hid_t obj_id); 529 /** 530 * \ingroup H5VLDEV 531 */ 532 H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id); 533 /** 534 * \ingroup H5VLDEV 535 */ 536 H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name); 537 /** 538 * \ingroup H5VLDEV 539 */ 540 H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value); 541 542 #ifdef __cplusplus 543 } 544 #endif 545 546 #endif /* H5VLconnector_H */ 547