summaryrefslogtreecommitdiffstats
path: root/src/H5VLconnector.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2021-06-02 20:29:46 (GMT)
committerGitHub <noreply@github.com>2021-06-02 20:29:46 (GMT)
commit4b7f34acc16c7d071a5c1d4519ba2a01354e51db (patch)
tree944c634b581e30979afd91ef05fcef4db4a062da /src/H5VLconnector.h
parent88a83d56c07f7c462d1866a2a2642a9f2e37dd22 (diff)
downloadhdf5-4b7f34acc16c7d071a5c1d4519ba2a01354e51db.zip
hdf5-4b7f34acc16c7d071a5c1d4519ba2a01354e51db.tar.gz
hdf5-4b7f34acc16c7d071a5c1d4519ba2a01354e51db.tar.bz2
Combo set of async and other changes (#161)
* Update API tracing for new H5VL_request_status_t typedef * Finish converting internal event set operations to use list iterator callbacks, instead of directly accessing the list structure * Add H5VL_REQUEST_GET_ERR_STACK operation to request subclass, for retrieving a copy of the error stack for a failed asynchronous operation * Remove 'canceled' event status from Java constants * Be safer about releasing resources when inserting a newly opened/created object or file into an event set * Remove H5EStest, add H5ES_WAIT_NONE for 0 timeout, and revise parameters to H5ESwait, to make it more "aggregate". * Remove H5ES_STATUS_CANCELED from Java wrappers also * Apply patch for dynamically registering optional VOL operations * (a) Add async APIs for H5O module as listed in jira issue ID-283. (b) Remove verification of name parameter in async related routines for H55A and H5L modules because it is checked in H5VL_setup* routine. (c) Modify h5dump expected output due to the async changes. * Corrections based on PR feedback. * Further changes to make based on PR feedback. * Remove H5Dwait & H5Fwait (moved to the async connector). Added H5atclose routine. Updated 'optional op' operations. * Fix missed merge marker, and reformatted line * Update API tracing infrastructure for H5atclose callback * Clean up some warnings * Normalize against develop branch * Correct level of indirection * Add doxygen info for H5is_library_terminating and regression tests for it and H5atclose * Relocate prototype (and doxygen info) for H5Aclose * Align w/changes on develop * Move group package initialization code to H5Gint.c, and update tracing macros * Change non-static function declarations to be static * Correct GCC diagnostic macro * Ensure that H5TSpublic.h header gets installed (#129) * Finish moving API routines that invoke VOL framework to main source files. * Fix position of H5Fmount and H5Funmount * Add 'wrapper' versions of async calls, to allow language wrappers and layers on top of HDF5 to pass in their application information. * Add wrappers for dynamically registered optional operations * Fix typo * Update doxygen comment for H5atclose with additional detail. * Add H5VL\*_vararg versions of H5VL routines that use va_list parameters * Implement and test H5S_BLOCK * Switch H5Aexists\*_async and H5Lexists\*_async to use flag to return status, instead of return value. Make the corresponding changes through most of the v1 and v2 B-tree code. Clean up warnings in H5public.h and cmpd_dtransform.c. * Add H5Iregister_future routine and tests. * Correct return value for H5Lexists_async * Add H5_DLL macro to public H5ES API routines * Update supported -> flags parameter for introspect_query callback * Remove my email address. Update passthrough VOL connector ID. * Fix comment for post_open_api_common * Remove unused non-blocking VOL connector * Minor cleanup in async branch in preparation for merge to develop * Update CMake and the Autotools to use the new pass-through VOL ID * Finish another iteration on public H5ES routines, along with running the code reformatter * Another round of reformatting * Fix for SWMR daily test failures (#160) The H5I_register_using_existing_id() call did not initialize the future ID callbacks, causing the library to segfault when it tried to resolve those function pointers. * Added selective async APIs (#150) * Added selective async APIs Description: Added the following APIs: H5Ropen_attr_async H5Ropen_object_async H5Ropen_region_async H5Mcreate_async H5Mopen_async H5Mput_async H5Mget_async H5Mclose_async H5Tcommit_async H5Topen_async H5Tcopy_async H5Tclose_async - Updated an expected output file to include a new internal function in the error stack for the failure case. * Updated async APIs per reviews, including removing async version of H5Tcopy. * Removed statements that were added by mistake in the previous commit. * Fix compile issues in H5M and warnings elsewhere * Reformat code * Brings VOL_LIST changes from develop. (#163) * Remove H5Dwait and H5Fwait calls, which were incorrectly brought back in * Tiny cleanup of H5Lcreate_hard_async * Run source formatter * Allow for canceled operation in wait_cb * Attempt to fix switch on string value * Re-run source formatter * Add H5S_BLOCK testfile to CMake clean target * Add H5Pset_vol_async API routine and 'get_cap_flags' VOL introspection callback * Clean up warnings * Add H5P(set\|get)_vol_implicit_async API routines to allow \/ disallow implicit asynchronous operations (default is disallowed) * Run formatting script * Remove H5VL_REQUEST_WAIT\* * Warning cleanup * Eliminate strdup()s on statically allocated strings * Warning cleanup * Split H5VLrestore_lib_state into H5VLstart_lib_state and H5VLrestore_lib_state, and rename H5VLreset_lib_state to H5VLfinish_lib_state. * Duplicate strings when building err_info to return to applicatin * Move connector author routines into seperate header files, all included in the new hdf5dev.h header * Run bin/trace to add TRACE macros * Allow H5ES_NONE as a valid, but no-op, parameter to all H5ES API routines that accept an event set ID * Clean up formatting * Remove H5Pset/get_vol_implicit_async * Clean up warning * Remove H5Pget_vol_async and replace with more generic H5Pget_vol_cap_flags * Clean up warnings * Add H5ESfree_err_info convenience routine * Fix typo * Correct matching for cached VOL plugins * Add developer header file * Update for C99 compatibility * Add missing trace macro * Stop clang-format from messing with the trace macros. Don't set up VOL wrappers for 'infrastructure' objects like requests and blobs * Fix warning about formatting a directory * Clean up formatting for H5E_BEGIN_TRY / H5E_END_TRY * Reduce scope of H5ES__close * Enable CMake checks for various types on MacOS * Clean up properly when H5CX_retrieve_state() fails. Also clean up many compiler warnings. * Committing clang-format changes * Merge from develop * Fix mis-placed assert * Remove commented-out code * Re-add macro for unsetenv on Windows (I think it accidentally was merged out) * Strengthen sanity check from error report to assertion * Committing clang-format changes * Add units to the comments for a few fields * Switch 'get execution time' operation for async request tokens to be an optional operation and query if connector supports operation before retrieving it. * Committing clang-format changes * Remove H5ESget_time_estimate * Committing clang-format changes * Create developer header for datatype routines and move type conversion register/unregister routines there. * Simplify internal H5VL_setup_name_args and H5VL_setup_idx_args routines * Add H5VLlink_optional_op, allowing dynamicly registered optional operations for the link VOL subclass, also added H5VL_loc_params argument to the link 'optional' callback to allow them to work correctly. * Run bin/format_source on current code * Add H5VLobject_optional_op, allowing dynamicly registered optional operations for the object VOL subclass, also added H5VL_loc_params argument to the object 'optional' callback to allow them to work correctly. * Run bin/format_source on current code * Committing clang-format changes * Revert "Switch 'get execution time' operation for async request tokens to be an optional operation and query if connector supports operation before retrieving it." This reverts commit 5ac92014da2682bdba62d7a2524b8d90e38f6b19. * Committing clang-format changes * Convert attribute 'get' operation to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Update tracing macros * Convert attribute 'specific' operation to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Convert dataset 'get' and 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also, minor tweaks to attribute 'get' and 'specific' operation parameters. * Convert datatype 'get' and 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also, minor tweaks to H5O_refresh_metadata arguments. * Reduce warnings * Reduce warnings * Track change to datatype 'get' callback * Fix bug with file pointer getting invalidated when object closed * Reformat source * Convert file and group VOL classes 'get' and 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also small cleanup to the attribute get name operation. Also moved 'mount' and 'unmount' operations to be group specific operations, instead of file specific, to better align with their behavior (mounted files are on groups, so a group is what is operated on). * Remove remainder of merge conflict marking * Convert link VOL class 'create' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Remove some unused local variables * Convert link VOL class 'get' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also refactor 'get name by idx' routines to return actual length of name with a parameter instead of the return value, and move some callback context structs for the link interface from the private header file into the source code module, to reduce their visibility scope. * Update tracing macros * Convert link VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Convert object VOL class 'get' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Convert object VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also refactor H5G_loc_exists, et al, to return 'exists' flag in a parameter and errors with the function return value, instead of overloading both into the return value. And, corrected logic error in test/links.c around non-existant objects in a file. * Convert request VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. * Convert blob VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Also removes the H5VL_BLOB_GETSIZE operation, as it's unused in the library and the blob ID size for a container is now returned with H5VL_FILE_GET_CONT_INFO. * Add 'const' to several parameters that are only queried. * Convert all VOL classes' 'optional' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs. Convert several 'get' routines to return the length of an array in a parameter instead of combining it into the return value. Move several routines to be in less public namespace. Correct direct_chunk test to verify that parameters aren't modified on error. * Switch get/specific/optional VOL callback argument structures to be 'async-friendly'. Also other minor cleanups and bug-fixes. * Add H5Pset_dataset_io_hyperslab_selection / H5S_PLIST feature, to allow skipping H5Dget_space + H5Sselect_hyperslab for async operation * Add dynamic optional operations for request objects * Update dynamic operation test for optional request operations * Update a comment for an operation argument * Run trace and format_source scripts * Committing clang-format changes * Committing clang-format changes Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org> Co-authored-by: vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com> Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org> Co-authored-by: Dana Robinson <derobins@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5VLconnector.h')
-rw-r--r--src/H5VLconnector.h883
1 files changed, 742 insertions, 141 deletions
diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h
index 63613bc..af3530c 100644
--- a/src/H5VLconnector.h
+++ b/src/H5VLconnector.h
@@ -20,6 +20,7 @@
/* Public headers needed by this file */
#include "H5public.h" /* Generic Functions */
#include "H5Apublic.h" /* Attributes */
+#include "H5Dpublic.h" /* Datasets */
#include "H5ESpublic.h" /* Event Stack */
#include "H5Fpublic.h" /* Files */
#include "H5Ipublic.h" /* IDs */
@@ -33,8 +34,10 @@
/*****************/
/* Capability flags for connector */
-#define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */
-#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */
+#define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */
+#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */
+#define H5VL_CAP_FLAG_ASYNC 0x02 /* Connector performs operations asynchronously*/
+#define H5VL_CAP_FLAG_NATIVE_FILES 0x04 /* Connector produces native file format */
/* Container info version */
#define H5VL_CONTAINER_INFO_VERSION 0x01 /* Container info struct version */
@@ -42,11 +45,64 @@
/* The maximum size allowed for blobs */
#define H5VL_MAX_BLOB_ID_SIZE (16) /* Allow for 128-bits blob IDs */
+/* # of optional operations reserved for the native VOL connector */
+#define H5VL_RESERVED_NATIVE_OPTIONAL 1024
+
/*******************/
/* Public Typedefs */
/*******************/
-/* types for attribute GET callback */
+/* Types for different ways that objects are located in an HDF5 container */
+typedef enum H5VL_loc_type_t {
+ H5VL_OBJECT_BY_SELF,
+ H5VL_OBJECT_BY_NAME,
+ H5VL_OBJECT_BY_IDX,
+ H5VL_OBJECT_BY_TOKEN
+} H5VL_loc_type_t;
+
+typedef struct H5VL_loc_by_name {
+ const char *name;
+ hid_t lapl_id;
+} H5VL_loc_by_name_t;
+
+typedef struct H5VL_loc_by_idx {
+ const char * name;
+ H5_index_t idx_type;
+ H5_iter_order_t order;
+ hsize_t n;
+ hid_t lapl_id;
+} H5VL_loc_by_idx_t;
+
+typedef struct H5VL_loc_by_token {
+ H5O_token_t *token;
+} H5VL_loc_by_token_t;
+
+/* Structure to hold parameters for object locations.
+ * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
+ *
+ * Note: Leave loc_by_token as the first union member so we
+ * can perform the simplest initialization of the struct
+ * without raising warnings.
+ *
+ * Note: BY_SELF requires no union members.
+ */
+typedef struct H5VL_loc_params_t {
+ H5I_type_t obj_type;
+ H5VL_loc_type_t type;
+ union {
+ H5VL_loc_by_token_t loc_by_token;
+ H5VL_loc_by_name_t loc_by_name;
+ H5VL_loc_by_idx_t loc_by_idx;
+ } loc_data;
+} H5VL_loc_params_t;
+
+/* Struct for all 'optional' callbacks */
+typedef struct H5VL_optional_args_t {
+ int op_type; /* Operation to perform */
+ void *args; /* Pointer to operation's argument struct */
+} H5VL_optional_args_t;
+
+/* Values for attribute 'get' operations */
typedef enum H5VL_attr_get_t {
H5VL_ATTR_GET_ACPL, /* creation property list */
H5VL_ATTR_GET_INFO, /* info */
@@ -56,18 +112,115 @@ typedef enum H5VL_attr_get_t {
H5VL_ATTR_GET_TYPE /* datatype */
} H5VL_attr_get_t;
-/* types for attribute SPECFIC callback */
+/* Parameters for attribute 'get_name' operation */
+typedef struct H5VL_attr_get_name_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ size_t buf_size; /* Size of attribute name buffer */
+ char * buf; /* Buffer for attribute name (OUT) */
+ size_t * attr_name_len; /* Actual length of attribute name (OUT) */
+} H5VL_attr_get_name_args_t;
+
+/* Parameters for attribute 'get_info' operation */
+typedef struct H5VL_attr_get_info_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ const char * attr_name; /* Attribute name (for get_info_by_name) */
+ H5A_info_t * ainfo; /* Attribute info (OUT) */
+} H5VL_attr_get_info_args_t;
+
+/* Parameters for attribute 'get' operations */
+typedef struct H5VL_attr_get_args_t {
+ H5VL_attr_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_ATTR_GET_ACPL */
+ struct {
+ hid_t acpl_id; /* Attribute creation property list ID (OUT) */
+ } get_acpl;
+
+ /* H5VL_ATTR_GET_INFO */
+ H5VL_attr_get_info_args_t get_info; /* Attribute info */
+
+ /* H5VL_ATTR_GET_NAME */
+ H5VL_attr_get_name_args_t get_name; /* Attribute name */
+
+ /* H5VL_ATTR_GET_SPACE */
+ struct {
+ hid_t space_id; /* Dataspace ID (OUT) */
+ } get_space;
+
+ /* H5VL_ATTR_GET_STORAGE_SIZE */
+ struct {
+ hsize_t *data_size; /* Size of attribute in file (OUT) */
+ } get_storage_size;
+
+ /* H5VL_ATTR_GET_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID (OUT) */
+ } get_type;
+ } args;
+} H5VL_attr_get_args_t;
+
+/* Values for attribute 'specific' operation */
typedef enum H5VL_attr_specific_t {
- H5VL_ATTR_DELETE, /* H5Adelete(_by_name/idx) */
- H5VL_ATTR_EXISTS, /* H5Aexists(_by_name) */
- H5VL_ATTR_ITER, /* H5Aiterate(_by_name) */
- H5VL_ATTR_RENAME /* H5Arename(_by_name) */
+ H5VL_ATTR_DELETE, /* H5Adelete(_by_name) */
+ H5VL_ATTR_DELETE_BY_IDX, /* H5Adelete_by_idx */
+ H5VL_ATTR_EXISTS, /* H5Aexists(_by_name) */
+ H5VL_ATTR_ITER, /* H5Aiterate(_by_name) */
+ H5VL_ATTR_RENAME /* H5Arename(_by_name) */
} H5VL_attr_specific_t;
+/* Parameters for attribute 'iterate' operation */
+typedef struct H5VL_attr_iterate_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t * idx; /* Start/stop iteration index (IN/OUT) */
+ H5A_operator2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_attr_iterate_args_t;
+
+/* Parameters for attribute 'delete_by_idx' operation */
+typedef struct H5VL_attr_delete_by_idx_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t n; /* Iteration index */
+} H5VL_attr_delete_by_idx_args_t;
+
+/* Parameters for attribute 'specific' operations */
+typedef struct H5VL_attr_specific_args_t {
+ H5VL_attr_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_ATTR_DELETE */
+ struct {
+ const char *name; /* Name of attribute to delete */
+ } del;
+
+ /* H5VL_ATTR_DELETE_BY_IDX */
+ H5VL_attr_delete_by_idx_args_t delete_by_idx;
+
+ /* H5VL_ATTR_EXISTS */
+ struct {
+ const char *name; /* Name of attribute to check */
+ hbool_t * exists; /* Whether attribute exists (OUT) */
+ } exists;
+
+ /* H5VL_ATTR_ITER */
+ H5VL_attr_iterate_args_t iterate;
+
+ /* H5VL_ATTR_RENAME */
+ struct {
+ const char *old_name; /* Name of attribute to rename */
+ const char *new_name; /* New attribute name */
+ } rename;
+ } args;
+} H5VL_attr_specific_args_t;
+
/* Typedef for VOL connector attribute optional VOL operations */
typedef int H5VL_attr_optional_t;
-/* types for dataset GET callback */
+/* Values for dataset 'get' operation */
typedef enum H5VL_dataset_get_t {
H5VL_DATASET_GET_DAPL, /* access property list */
H5VL_DATASET_GET_DCPL, /* creation property list */
@@ -77,32 +230,146 @@ typedef enum H5VL_dataset_get_t {
H5VL_DATASET_GET_TYPE /* datatype */
} H5VL_dataset_get_t;
-/* types for dataset SPECFIC callback */
+/* Parameters for dataset 'get' operations */
+typedef struct H5VL_dataset_get_args_t {
+ H5VL_dataset_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATASET_GET_DAPL */
+ struct {
+ hid_t dapl_id; /* Dataset access property list ID (OUT) */
+ } get_dapl;
+
+ /* H5VL_DATASET_GET_DCPL */
+ struct {
+ hid_t dcpl_id; /* Dataset creation property list ID (OUT) */
+ } get_dcpl;
+
+ /* H5VL_DATASET_GET_SPACE */
+ struct {
+ hid_t space_id; /* Dataspace ID (OUT) */
+ } get_space;
+
+ /* H5VL_DATASET_GET_SPACE_STATUS */
+ struct {
+ H5D_space_status_t *status; /* Storage space allocation status (OUT) */
+ } get_space_status;
+
+ /* H5VL_DATASET_GET_STORAGE_SIZE */
+ struct {
+ hsize_t *storage_size; /* Size of dataset's storage (OUT) */
+ } get_storage_size;
+
+ /* H5VL_DATASET_GET_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID (OUT) */
+ } get_type;
+ } args;
+} H5VL_dataset_get_args_t;
+
+/* Values for dataset 'specific' operation */
typedef enum H5VL_dataset_specific_t {
H5VL_DATASET_SET_EXTENT, /* H5Dset_extent */
H5VL_DATASET_FLUSH, /* H5Dflush */
- H5VL_DATASET_REFRESH, /* H5Drefresh */
- H5VL_DATASET_WAIT, /* H5Dwait */
- H5VL_DATASET_CHUNK_ITER /* H5Dchunk_iter */
+ H5VL_DATASET_REFRESH /* H5Drefresh */
} H5VL_dataset_specific_t;
+/* Parameters for dataset 'specific' operations */
+typedef struct H5VL_dataset_specific_args_t {
+ H5VL_dataset_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATASET_SET_EXTENT */
+ struct {
+ const hsize_t *size; /* New dataspace extent */
+ } set_extent;
+
+ /* H5VL_DATASET_FLUSH */
+ struct {
+ hid_t dset_id; /* Dataset ID (IN) */
+ } flush;
+
+ /* H5VL_DATASET_REFRESH */
+ struct {
+ hid_t dset_id; /* Dataset ID (IN) */
+ } refresh;
+ } args;
+} H5VL_dataset_specific_args_t;
+
/* Typedef for VOL connector dataset optional VOL operations */
typedef int H5VL_dataset_optional_t;
-/* types for datatype GET callback */
+/* Values for datatype 'get' operation */
typedef enum H5VL_datatype_get_t {
- H5VL_DATATYPE_GET_BINARY, /* get serialized form of transient type */
- H5VL_DATATYPE_GET_TCPL /* datatype creation property list */
+ H5VL_DATATYPE_GET_BINARY_SIZE, /* Get size of serialized form of transient type */
+ H5VL_DATATYPE_GET_BINARY, /* Get serialized form of transient type */
+ H5VL_DATATYPE_GET_TCPL /* Datatype creation property list */
} H5VL_datatype_get_t;
-/* types for datatype SPECFIC callback */
-typedef enum H5VL_datatype_specific_t { H5VL_DATATYPE_FLUSH, H5VL_DATATYPE_REFRESH } H5VL_datatype_specific_t;
+/* Parameters for datatype 'get' operations */
+typedef struct H5VL_datatype_get_args_t {
+ H5VL_datatype_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATATYPE_GET_BINARY_SIZE */
+ struct {
+ size_t *size; /* Size of serialized form of datatype (OUT) */
+ } get_binary_size;
+
+ /* H5VL_DATATYPE_GET_BINARY */
+ struct {
+ void * buf; /* Buffer to store serialized form of datatype (OUT) */
+ size_t buf_size; /* Size of serialized datatype buffer */
+ } get_binary;
+
+ /* H5VL_DATATYPE_GET_TCPL */
+ struct {
+ hid_t tcpl_id; /* Named datatype creation property list ID (OUT) */
+ } get_tcpl;
+ } args;
+} H5VL_datatype_get_args_t;
+
+/* Values for datatype 'specific' operation */
+typedef enum H5VL_datatype_specific_t {
+ H5VL_DATATYPE_FLUSH, /* H5Tflush */
+ H5VL_DATATYPE_REFRESH /* H5Trefresh */
+} H5VL_datatype_specific_t;
+
+/* Parameters for datatype 'specific' operations */
+typedef struct H5VL_datatype_specific_args_t {
+ H5VL_datatype_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATATYPE_FLUSH */
+ struct {
+ hid_t type_id; /* Named datatype ID (IN) */
+ } flush;
+
+ /* H5VL_DATATYPE_REFRESH */
+ struct {
+ hid_t type_id; /* Named datatype ID (IN) */
+ } refresh;
+ } args;
+} H5VL_datatype_specific_args_t;
/* Typedef and values for native VOL connector named datatype optional VOL operations */
typedef int H5VL_datatype_optional_t;
/* (No optional named datatype VOL operations currently) */
-/* types for file GET callback */
+/* Info for H5VL_FILE_GET_CONT_INFO */
+typedef struct H5VL_file_cont_info_t {
+ unsigned version; /* version information (keep first) */
+ uint64_t feature_flags; /* Container feature flags */
+ /* (none currently defined) */
+ size_t token_size; /* Size of tokens */
+ size_t blob_id_size; /* Size of blob IDs */
+} H5VL_file_cont_info_t;
+
+/* Values for file 'get' operation */
typedef enum H5VL_file_get_t {
H5VL_FILE_GET_CONT_INFO, /* file get container info */
H5VL_FILE_GET_FAPL, /* file access property list */
@@ -114,59 +381,296 @@ typedef enum H5VL_file_get_t {
H5VL_FILE_GET_OBJ_IDS /* object ids in file */
} H5VL_file_get_t;
-/* types for file SPECIFIC callback */
+/* Parameters for file 'get_name' operation */
+typedef struct H5VL_file_get_name_args_t {
+ H5I_type_t type; /* ID type of object pointer */
+ size_t buf_size; /* Size of file name buffer (IN) */
+ char * buf; /* Buffer for file name (OUT) */
+ size_t * file_name_len; /* Actual length of file name (OUT) */
+} H5VL_file_get_name_args_t;
+
+/* Parameters for file 'get_obj_ids' operation */
+typedef struct H5VL_file_get_obj_ids_args_t {
+ unsigned types; /* Type of objects to count */
+ size_t max_objs; /* Size of array of object IDs */
+ hid_t * oid_list; /* Array of object IDs (OUT) */
+ size_t * count; /* # of objects (OUT) */
+} H5VL_file_get_obj_ids_args_t;
+
+/* Parameters for file 'get' operations */
+typedef struct H5VL_file_get_args_t {
+ H5VL_file_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_FILE_GET_CONT_INFO */
+ struct {
+ H5VL_file_cont_info_t *info; /* Container info (OUT) */
+ } get_cont_info;
+
+ /* H5VL_FILE_GET_FAPL */
+ struct {
+ hid_t fapl_id; /* File access property list (OUT) */
+ } get_fapl;
+
+ /* H5VL_FILE_GET_FCPL */
+ struct {
+ hid_t fcpl_id; /* File creation property list (OUT) */
+ } get_fcpl;
+
+ /* H5VL_FILE_GET_FILENO */
+ struct {
+ unsigned long *fileno; /* File "number" (OUT) */
+ } get_fileno;
+
+ /* H5VL_FILE_GET_INTENT */
+ struct {
+ unsigned *flags; /* File open/create intent flags (OUT) */
+ } get_intent;
+
+ /* H5VL_FILE_GET_NAME */
+ H5VL_file_get_name_args_t get_name;
+
+ /* H5VL_FILE_GET_OBJ_COUNT */
+ struct {
+ unsigned types; /* Type of objects to count */
+ size_t * count; /* # of objects (OUT) */
+ } get_obj_count;
+
+ /* H5VL_FILE_GET_OBJ_IDS */
+ H5VL_file_get_obj_ids_args_t get_obj_ids;
+ } args;
+} H5VL_file_get_args_t;
+
+/* Values for file 'specific' operation */
typedef enum H5VL_file_specific_t {
H5VL_FILE_FLUSH, /* Flush file */
H5VL_FILE_REOPEN, /* Reopen the file */
- H5VL_FILE_MOUNT, /* Mount a file */
- H5VL_FILE_UNMOUNT, /* Unmount a file */
H5VL_FILE_IS_ACCESSIBLE, /* Check if a file is accessible */
H5VL_FILE_DELETE, /* Delete a file */
- H5VL_FILE_IS_EQUAL, /* Check if two files are the same */
- H5VL_FILE_WAIT /* Wait for async operations to complete */
+ H5VL_FILE_IS_EQUAL /* Check if two files are the same */
} H5VL_file_specific_t;
+/* Parameters for file 'specific' operations */
+typedef struct H5VL_file_specific_args_t {
+ H5VL_file_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_FILE_FLUSH */
+ struct {
+ H5I_type_t obj_type; /* Type of object to use */
+ H5F_scope_t scope; /* Scope of flush operation */
+ } flush;
+
+ /* H5VL_FILE_REOPEN */
+ struct {
+ void **file; /* File object for new file (OUT) */
+ } reopen;
+
+ /* H5VL_FILE_IS_ACCESSIBLE */
+ struct {
+ const char *filename; /* Name of file to check */
+ hid_t fapl_id; /* File access property list to use */
+ hbool_t * accessible; /* Whether file is accessible with FAPL settings (OUT) */
+ } is_accessible;
+
+ /* H5VL_FILE_DELETE */
+ struct {
+ const char *filename; /* Name of file to delete */
+ hid_t fapl_id; /* File access property list to use */
+ } del;
+
+ /* H5VL_FILE_IS_EQUAL */
+ struct {
+ void * obj2; /* Second file object to compare against */
+ hbool_t *same_file; /* Whether files are the same (OUT) */
+ } is_equal;
+ } args;
+} H5VL_file_specific_args_t;
+
/* Typedef for VOL connector file optional VOL operations */
typedef int H5VL_file_optional_t;
-/* types for group GET callback */
+/* Values for group 'get' operation */
typedef enum H5VL_group_get_t {
H5VL_GROUP_GET_GCPL, /* group creation property list */
H5VL_GROUP_GET_INFO /* group info */
} H5VL_group_get_t;
-/* types for group SPECFIC callback */
-typedef enum H5VL_group_specific_t { H5VL_GROUP_FLUSH, H5VL_GROUP_REFRESH } H5VL_group_specific_t;
+/* Parameters for group 'get_info' operation */
+typedef struct H5VL_group_get_info_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5G_info_t * ginfo; /* Group info (OUT) */
+} H5VL_group_get_info_args_t;
+
+/* Parameters for group 'get' operations */
+typedef struct H5VL_group_get_args_t {
+ H5VL_group_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_GROUP_GET_GCPL */
+ struct {
+ hid_t gcpl_id; /* Group creation property list (OUT) */
+ } get_gcpl;
+
+ /* H5VL_GROUP_GET_INFO */
+ H5VL_group_get_info_args_t get_info; /* Group info */
+ } args;
+} H5VL_group_get_args_t;
+
+/* Values for group 'specific' operation */
+typedef enum H5VL_group_specific_t {
+ H5VL_GROUP_MOUNT, /* Mount a file on a group */
+ H5VL_GROUP_UNMOUNT, /* Unmount a file on a group */
+ H5VL_GROUP_FLUSH, /* H5Gflush */
+ H5VL_GROUP_REFRESH /* H5Grefresh */
+} H5VL_group_specific_t;
+
+/* Parameters for group 'mount' operation */
+typedef struct H5VL_group_spec_mount_args_t {
+ const char *name; /* Name of location to mount child file */
+ void * child_file; /* Pointer to child file object */
+ hid_t fmpl_id; /* File mount property list to use */
+} H5VL_group_spec_mount_args_t;
+
+/* Parameters for group 'specific' operations */
+typedef struct H5VL_group_specific_args_t {
+ H5VL_group_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_GROUP_MOUNT */
+ H5VL_group_spec_mount_args_t mount;
+
+ /* H5VL_GROUP_UNMOUNT */
+ struct {
+ const char *name; /* Name of location to unmount child file */
+ } unmount;
+
+ /* H5VL_GROUP_FLUSH */
+ struct {
+ hid_t grp_id; /* Group ID (IN) */
+ } flush;
+
+ /* H5VL_GROUP_REFRESH */
+ struct {
+ hid_t grp_id; /* Group ID (IN) */
+ } refresh;
+ } args;
+} H5VL_group_specific_args_t;
/* Typedef for VOL connector group optional VOL operations */
typedef int H5VL_group_optional_t;
-/* link create types for VOL */
-typedef enum H5VL_link_create_type_t {
+/* Link create types for VOL */
+typedef enum H5VL_link_create_t {
H5VL_LINK_CREATE_HARD,
H5VL_LINK_CREATE_SOFT,
H5VL_LINK_CREATE_UD
-} H5VL_link_create_type_t;
+} H5VL_link_create_t;
-/* types for link GET callback */
+/* Parameters for link 'create' operations */
+typedef struct H5VL_link_create_args_t {
+ H5VL_link_create_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_CREATE_HARD */
+ struct {
+ void * curr_obj; /* Current object */
+ H5VL_loc_params_t curr_loc_params; /* Location parameters for current object */
+ } hard;
+
+ /* H5VL_LINK_CREATE_SOFT */
+ struct {
+ const char *target; /* Target of soft link */
+ } soft;
+
+ /* H5VL_LINK_CREATE_UD */
+ struct {
+ H5L_type_t type; /* Type of link to create */
+ const void *buf; /* Buffer that contains link info */
+ size_t buf_size; /* Size of link info buffer */
+ } ud;
+ } args;
+} H5VL_link_create_args_t;
+
+/* Values for link 'get' operation */
typedef enum H5VL_link_get_t {
H5VL_LINK_GET_INFO, /* link info */
H5VL_LINK_GET_NAME, /* link name */
H5VL_LINK_GET_VAL /* link value */
} H5VL_link_get_t;
-/* types for link SPECIFIC callback */
+/* Parameters for link 'get' operations */
+typedef struct H5VL_link_get_args_t {
+ H5VL_link_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_GET_INFO */
+ struct {
+ H5L_info2_t *linfo; /* Pointer to link's info (OUT) */
+ } get_info;
+
+ /* H5VL_LINK_GET_NAME */
+ struct {
+ size_t name_size; /* Size of link name buffer (IN) */
+ char * name; /* Buffer for link name (OUT) */
+ size_t *name_len; /* Actual length of link name (OUT) */
+ } get_name;
+
+ /* H5VL_LINK_GET_VAL */
+ struct {
+ size_t buf_size; /* Size of link value buffer (IN) */
+ void * buf; /* Buffer for link value (OUT) */
+ } get_val;
+ } args;
+} H5VL_link_get_args_t;
+
+/* Values for link 'specific' operation */
typedef enum H5VL_link_specific_t {
H5VL_LINK_DELETE, /* H5Ldelete(_by_idx) */
H5VL_LINK_EXISTS, /* link existence */
H5VL_LINK_ITER /* H5Literate/visit(_by_name) */
} H5VL_link_specific_t;
+/* Parameters for link 'iterate' operation */
+typedef struct H5VL_link_iterate_args_t {
+ hbool_t recursive; /* Whether iteration is recursive */
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t * idx_p; /* Start/stop iteration index (OUT) */
+ H5L_iterate2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_link_iterate_args_t;
+
+/* Parameters for link 'specific' operations */
+typedef struct H5VL_link_specific_args_t {
+ H5VL_link_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_DELETE */
+ /* No args */
+
+ /* H5VL_LINK_EXISTS */
+ struct {
+ hbool_t *exists; /* Whether link exists (OUT) */
+ } exists;
+
+ /* H5VL_LINK_ITER */
+ H5VL_link_iterate_args_t iterate;
+ } args;
+} H5VL_link_specific_args_t;
+
/* Typedef and values for native VOL connector link optional VOL operations */
typedef int H5VL_link_optional_t;
/* (No optional link VOL operations currently) */
-/* types for object GET callback */
+/* Values for object 'get' operation */
typedef enum H5VL_object_get_t {
H5VL_OBJECT_GET_FILE, /* object file */
H5VL_OBJECT_GET_NAME, /* object name */
@@ -174,7 +678,38 @@ typedef enum H5VL_object_get_t {
H5VL_OBJECT_GET_INFO /* H5Oget_info(_by_idx|name) */
} H5VL_object_get_t;
-/* types for object SPECIFIC callback */
+/* Parameters for object 'get' operations */
+typedef struct H5VL_object_get_args_t {
+ H5VL_object_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_OBJECT_GET_FILE */
+ struct {
+ void **file; /* File object (OUT) */
+ } get_file;
+
+ /* H5VL_OBJECT_GET_NAME */
+ struct {
+ size_t buf_size; /* Size of name buffer (IN) */
+ char * buf; /* Buffer for name (OUT) */
+ size_t *name_len; /* Actual length of name (OUT) */
+ } get_name;
+
+ /* H5VL_OBJECT_GET_TYPE */
+ struct {
+ H5O_type_t *obj_type; /* Type of object (OUT) */
+ } get_type;
+
+ /* H5VL_OBJECT_GET_INFO */
+ struct {
+ unsigned fields; /* Flags for fields to retrieve */
+ H5O_info2_t *oinfo; /* Pointer to object info (OUT) */
+ } get_info;
+ } args;
+} H5VL_object_get_args_t;
+
+/* Values for object 'specific' operation */
typedef enum H5VL_object_specific_t {
H5VL_OBJECT_CHANGE_REF_COUNT, /* H5Oincr/decr_refcount */
H5VL_OBJECT_EXISTS, /* H5Oexists_by_name */
@@ -184,6 +719,51 @@ typedef enum H5VL_object_specific_t {
H5VL_OBJECT_REFRESH /* H5{D|G|O|T}refresh */
} H5VL_object_specific_t;
+/* Parameters for object 'visit' operation */
+typedef struct H5VL_object_visit_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ unsigned fields; /* Flags for fields to provide in 'info' object for 'op' callback */
+ H5O_iterate2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_object_visit_args_t;
+
+/* Parameters for object 'specific' operations */
+typedef struct H5VL_object_specific_args_t {
+ H5VL_object_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_OBJECT_CHANGE_REF_COUNT */
+ struct {
+ int delta; /* Amount to modify object's refcount */
+ } change_rc;
+
+ /* H5VL_OBJECT_EXISTS */
+ struct {
+ hbool_t *exists; /* Whether object exists (OUT) */
+ } exists;
+
+ /* H5VL_OBJECT_LOOKUP */
+ struct {
+ H5O_token_t *token_ptr; /* Pointer to token for lookup (OUT) */
+ } lookup;
+
+ /* H5VL_OBJECT_VISIT */
+ H5VL_object_visit_args_t visit;
+
+ /* H5VL_OBJECT_FLUSH */
+ struct {
+ hid_t obj_id; /* Object ID (IN) */
+ } flush;
+
+ /* H5VL_OBJECT_REFRESH */
+ struct {
+ hid_t obj_id; /* Object ID (IN) */
+ } refresh;
+ } args;
+} H5VL_object_specific_args_t;
+
/* Typedef for VOL connector object optional VOL operations */
typedef int H5VL_object_optional_t;
@@ -200,82 +780,64 @@ typedef enum H5VL_request_status_t {
H5VL_REQUEST_STATUS_CANCELED /* Operation has not completed and was canceled */
} H5VL_request_status_t;
-/* types for async request SPECIFIC callback */
+/* Values for async request 'specific' operation */
typedef enum H5VL_request_specific_t {
- H5VL_REQUEST_WAITANY, /* Wait until any request completes */
- H5VL_REQUEST_WAITSOME, /* Wait until at least one requesst completes */
- H5VL_REQUEST_WAITALL, /* Wait until all requests complete */
- H5VL_REQUEST_GET_ERR_STACK /* Retrieve error stack for failed operation */
+ H5VL_REQUEST_GET_ERR_STACK, /* Retrieve error stack for failed operation */
+ H5VL_REQUEST_GET_EXEC_TIME /* Retrieve execution time for operation */
} H5VL_request_specific_t;
+/* Parameters for request 'specific' operations */
+typedef struct H5VL_request_specific_args_t {
+ H5VL_request_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_REQUEST_GET_ERR_STACK */
+ struct {
+ hid_t err_stack_id; /* Error stack ID for operation (OUT) */
+ } get_err_stack;
+
+ /* H5VL_REQUEST_GET_EXEC_TIME */
+ struct {
+ uint64_t *exec_ts; /* Timestamp for start of task execution (OUT) */
+ uint64_t *exec_time; /* Duration of task execution (in ns) (OUT) */
+ } get_exec_time;
+ } args;
+} H5VL_request_specific_args_t;
+
/* Typedef and values for native VOL connector request optional VOL operations */
typedef int H5VL_request_optional_t;
/* (No optional request VOL operations currently) */
-/* types for 'blob' SPECIFIC callback */
+/* Values for 'blob' 'specific' operation */
typedef enum H5VL_blob_specific_t {
- H5VL_BLOB_DELETE, /* Delete a blob (by ID) */
- H5VL_BLOB_GETSIZE, /* Get size of blob */
- H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */
- H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */
+ H5VL_BLOB_DELETE, /* Delete a blob (by ID) */
+ H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */
+ H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */
} H5VL_blob_specific_t;
-/* Typedef and values for native VOL connector blob optional VOL operations */
-typedef int H5VL_blob_optional_t;
-/* (No optional blob VOL operations currently) */
-
-/* Types for different ways that objects are located in an HDF5 container */
-typedef enum H5VL_loc_type_t {
- H5VL_OBJECT_BY_SELF,
- H5VL_OBJECT_BY_NAME,
- H5VL_OBJECT_BY_IDX,
- H5VL_OBJECT_BY_TOKEN
-} H5VL_loc_type_t;
+/* Parameters for blob 'specific' operations */
+typedef struct H5VL_blob_specific_args_t {
+ H5VL_blob_specific_t op_type; /* Operation to perform */
-typedef struct H5VL_loc_by_name {
- const char *name;
- hid_t lapl_id;
-} H5VL_loc_by_name_t;
-
-typedef struct H5VL_loc_by_idx {
- const char * name;
- H5_index_t idx_type;
- H5_iter_order_t order;
- hsize_t n;
- hid_t lapl_id;
-} H5VL_loc_by_idx_t;
+ /* Parameters for each operation */
+ union {
+ /* H5VL_BLOB_DELETE */
+ /* No args */
-typedef struct H5VL_loc_by_token {
- H5O_token_t *token;
-} H5VL_loc_by_token_t;
+ /* H5VL_BLOB_ISNULL */
+ struct {
+ hbool_t *isnull; /* Whether blob ID is "null" (OUT) */
+ } is_null;
-/* Structure to hold parameters for object locations.
- * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
- *
- * Note: Leave loc_by_token as the first union member so we
- * can perform the simplest initialization of the struct
- * without raising warnings.
- *
- * Note: BY_SELF requires no union members.
- */
-typedef struct H5VL_loc_params_t {
- H5I_type_t obj_type;
- H5VL_loc_type_t type;
- union {
- H5VL_loc_by_token_t loc_by_token;
- H5VL_loc_by_name_t loc_by_name;
- H5VL_loc_by_idx_t loc_by_idx;
- } loc_data;
-} H5VL_loc_params_t;
+ /* H5VL_BLOB_SETNULL */
+ /* No args */
+ } args;
+} H5VL_blob_specific_args_t;
-/* Info for H5VL_FILE_GET_CONT_INFO */
-typedef struct H5VL_file_cont_info_t {
- unsigned version; /* version information (keep first) */
- uint64_t feature_flags; /* Container feature flags */
- /* (none currently defined) */
- size_t token_size; /* Size of tokens */
- size_t blob_id_size; /* Size of blob IDs */
-} H5VL_file_cont_info_t;
+/* Typedef and values for native VOL connector blob optional VOL operations */
+typedef int H5VL_blob_optional_t;
+/* (No optional blob VOL operations currently) */
/* VOL connector info fields & callbacks */
typedef struct H5VL_info_class_t {
@@ -310,11 +872,10 @@ typedef struct H5VL_attr_class_t {
hid_t dxpl_id, void **req);
herr_t (*read)(void *attr, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req);
herr_t (*write)(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *attr, hid_t dxpl_id, void **req);
} H5VL_attr_class_t;
@@ -328,11 +889,9 @@ typedef struct H5VL_dataset_class_t {
void *buf, void **req);
herr_t (*write)(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
const void *buf, void **req);
- herr_t (*get)(void *obj, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *dset, hid_t dxpl_id, void **req);
} H5VL_dataset_class_t;
@@ -342,11 +901,9 @@ typedef struct H5VL_datatype_class_t {
hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req);
void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *dt, hid_t dxpl_id, void **req);
} H5VL_datatype_class_t;
@@ -355,11 +912,9 @@ typedef struct H5VL_file_class_t {
void *(*create)(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
void **req);
void *(*open)(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *file, hid_t dxpl_id, void **req);
} H5VL_file_class_t;
@@ -369,30 +924,28 @@ typedef struct H5VL_group_class_t {
hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req);
void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *grp, hid_t dxpl_id, void **req);
} H5VL_group_class_t;
/* H5L routines */
typedef struct H5VL_link_class_t {
- herr_t (*create)(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params,
- hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req, va_list arguments);
+ herr_t (*create)(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
void **req);
herr_t (*move)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
void **req);
- herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args, hid_t dxpl_id,
+ void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
} H5VL_link_class_t;
/* H5O routines */
@@ -402,12 +955,12 @@ typedef struct H5VL_object_class_t {
herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, void *dst_obj,
const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args, hid_t dxpl_id,
+ void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
} H5VL_object_class_t;
/* Asynchronous request 'notify' callback */
@@ -427,6 +980,7 @@ struct H5VL_class_t;
/* Container/connector introspection routines */
typedef struct H5VL_introspect_class_t {
herr_t (*get_conn_cls)(void *obj, H5VL_get_conn_lvl_t lvl, const struct H5VL_class_t **conn_cls);
+ herr_t (*get_cap_flags)(const void *info, unsigned *cap_flags);
herr_t (*opt_query)(void *obj, H5VL_subclass_t cls, int opt_type, uint64_t *flags);
} H5VL_introspect_class_t;
@@ -435,8 +989,8 @@ typedef struct H5VL_request_class_t {
herr_t (*wait)(void *req, uint64_t timeout, H5VL_request_status_t *status);
herr_t (*notify)(void *req, H5VL_request_notify_t cb, void *ctx);
herr_t (*cancel)(void *req, H5VL_request_status_t *status);
- herr_t (*specific)(void *req, H5VL_request_specific_t specific_type, va_list arguments);
- herr_t (*optional)(void *req, H5VL_request_optional_t opt_type, va_list arguments);
+ herr_t (*specific)(void *req, H5VL_request_specific_args_t *args);
+ herr_t (*optional)(void *req, H5VL_optional_args_t *args);
herr_t (*free)(void *req);
} H5VL_request_class_t;
@@ -444,8 +998,8 @@ typedef struct H5VL_request_class_t {
typedef struct H5VL_blob_class_t {
herr_t (*put)(void *obj, const void *buf, size_t size, void *blob_id, void *ctx);
herr_t (*get)(void *obj, const void *blob_id, void *buf, size_t size, void *ctx);
- herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, va_list arguments);
- herr_t (*optional)(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments);
+ herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_args_t *args);
+ herr_t (*optional)(void *obj, void *blob_id, H5VL_optional_args_t *args);
} H5VL_blob_class_t;
/* Object token routines */
@@ -490,8 +1044,8 @@ typedef struct H5VL_class_t {
H5VL_token_class_t token_cls; /**< VOL connector object token class callbacks */
/* Catch-all */
- herr_t (*optional)(void *obj, int op_type, hid_t dxpl_id, void **req,
- va_list arguments); /**< Optional callback */
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req); /**< Optional callback */
} H5VL_class_t;
//! <!-- [H5VL_class_t_snip] -->
@@ -557,6 +1111,53 @@ H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name);
*/
H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value);
+/* User-defined optional operations */
+H5_DLL herr_t H5VLregister_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL herr_t H5VLfind_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL herr_t H5VLunregister_opt_operation(H5VL_subclass_t subcls, const char *op_name);
+H5_DLL herr_t H5VLattr_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t attr_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLdataset_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t dset_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLdatatype_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t type_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLfile_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t file_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLgroup_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t group_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t loc_id, const char *name, hid_t lapl_id, H5VL_optional_args_t *args,
+ hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t loc_id, const char *name, hid_t lapl_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLrequest_optional_op(void *req, hid_t connector_id, H5VL_optional_args_t *args);
+
+/* API Wrappers for "optional_op" routines */
+/* (Must be defined _after_ the function prototype) */
+/* (And must only defined when included in application code, not the library) */
+#ifndef H5VL_MODULE
+/* Inject application compile-time macros into function calls */
+#define H5VLattr_optional_op(...) H5VLattr_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLdataset_optional_op(...) H5VLdataset_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLdatatype_optional_op(...) H5VLdatatype_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLfile_optional_op(...) H5VLfile_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLgroup_optional_op(...) H5VLgroup_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLlink_optional_op(...) H5VLlink_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLobject_optional_op(...) H5VLobject_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+
+/* Define "wrapper" versions of function calls, to allow compile-time values to
+ * be passed in by language wrapper or library layer on top of HDF5.
+ */
+#define H5VLattr_optional_op_wrap H5_NO_EXPAND(H5VLattr_optional_op)
+#define H5VLdataset_optional_op_wrap H5_NO_EXPAND(H5VLdataset_optional_op)
+#define H5VLdatatype_optional_op_wrap H5_NO_EXPAND(H5VLdatatype_optional_op)
+#define H5VLfile_optional_op_wrap H5_NO_EXPAND(H5VLfile_optional_op)
+#define H5VLgroup_optional_op_wrap H5_NO_EXPAND(H5VLgroup_optional_op)
+#define H5VLlink_optional_op_wrap H5_NO_EXPAND(H5VLlink_optional_op)
+#define H5VLobject_optional_op_wrap H5_NO_EXPAND(H5VLobject_optional_op)
+#endif /* H5VL_MODULE */
+
#ifdef __cplusplus
}
#endif