Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/H5VLconnector.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0002  * Copyright by The HDF Group.                                               *
0003  * All rights reserved.                                                      *
0004  *                                                                           *
0005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
0006  * terms governing use, modification, and redistribution, is contained in    *
0007  * the COPYING file, which can be found at the root of the source code       *
0008  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
0009  * If you do not have access to either file, you may request a copy from     *
0010  * help@hdfgroup.org.                                                        *
0011  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
0012 
0013 /*
0014  * This file contains public declarations for authoring VOL connectors.
0015  */
0016 
0017 #ifndef H5VLconnector_H
0018 #define H5VLconnector_H
0019 
0020 /* Public headers needed by this file */
0021 #include "H5public.h"   /* Generic Functions                    */
0022 #include "H5Apublic.h"  /* Attributes                           */
0023 #include "H5Dpublic.h"  /* Datasets                             */
0024 #include "H5ESpublic.h" /* Event Stack                          */
0025 #include "H5Fpublic.h"  /* Files                                */
0026 #include "H5Ipublic.h"  /* IDs                                  */
0027 #include "H5Lpublic.h"  /* Links                                */
0028 #include "H5Opublic.h"  /* Objects                              */
0029 #include "H5Rpublic.h"  /* References                           */
0030 #include "H5VLpublic.h" /* Virtual Object Layer                 */
0031 
0032 /*****************/
0033 /* Public Macros */
0034 /*****************/
0035 
0036 /* Container info version */
0037 #define H5VL_CONTAINER_INFO_VERSION 0x01 /* Container info struct version */
0038 
0039 /* The maximum size allowed for blobs */
0040 #define H5VL_MAX_BLOB_ID_SIZE (16) /* Allow for 128-bits blob IDs */
0041 
0042 /* # of optional operations reserved for the native VOL connector */
0043 #define H5VL_RESERVED_NATIVE_OPTIONAL 1024
0044 
0045 /*******************/
0046 /* Public Typedefs */
0047 /*******************/
0048 
0049 /* Types for different ways that objects are located in an HDF5 container */
0050 typedef enum H5VL_loc_type_t {
0051     H5VL_OBJECT_BY_SELF,
0052     H5VL_OBJECT_BY_NAME,
0053     H5VL_OBJECT_BY_IDX,
0054     H5VL_OBJECT_BY_TOKEN
0055 } H5VL_loc_type_t;
0056 
0057 typedef struct H5VL_loc_by_name {
0058     const char *name;
0059     hid_t       lapl_id;
0060 } H5VL_loc_by_name_t;
0061 
0062 typedef struct H5VL_loc_by_idx {
0063     const char     *name;
0064     H5_index_t      idx_type;
0065     H5_iter_order_t order;
0066     hsize_t         n;
0067     hid_t           lapl_id;
0068 } H5VL_loc_by_idx_t;
0069 
0070 typedef struct H5VL_loc_by_token {
0071     H5O_token_t *token;
0072 } H5VL_loc_by_token_t;
0073 
0074 /* Structure to hold parameters for object locations.
0075  * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
0076  *
0077  * Note: Leave loc_by_token as the first union member so we
0078  *       can perform the simplest initialization of the struct
0079  *       without raising warnings.
0080  *
0081  * Note: BY_SELF requires no union members.
0082  */
0083 typedef struct H5VL_loc_params_t {
0084     H5I_type_t      obj_type;
0085     H5VL_loc_type_t type;
0086     union {
0087         H5VL_loc_by_token_t loc_by_token;
0088         H5VL_loc_by_name_t  loc_by_name;
0089         H5VL_loc_by_idx_t   loc_by_idx;
0090     } loc_data;
0091 } H5VL_loc_params_t;
0092 
0093 /* Struct for all 'optional' callbacks */
0094 typedef struct H5VL_optional_args_t {
0095     int   op_type; /* Operation to perform */
0096     void *args;    /* Pointer to operation's argument struct */
0097 } H5VL_optional_args_t;
0098 
0099 /* Values for attribute 'get' operations */
0100 typedef enum H5VL_attr_get_t {
0101     H5VL_ATTR_GET_ACPL,         /* creation property list              */
0102     H5VL_ATTR_GET_INFO,         /* info                                */
0103     H5VL_ATTR_GET_NAME,         /* access property list                */
0104     H5VL_ATTR_GET_SPACE,        /* dataspace                           */
0105     H5VL_ATTR_GET_STORAGE_SIZE, /* storage size                        */
0106     H5VL_ATTR_GET_TYPE          /* datatype                            */
0107 } H5VL_attr_get_t;
0108 
0109 /* Parameters for attribute 'get_name' operation */
0110 typedef struct H5VL_attr_get_name_args_t {
0111     H5VL_loc_params_t loc_params;    /* Location parameters for object access */
0112     size_t            buf_size;      /* Size of attribute name buffer */
0113     char             *buf;           /* Buffer for attribute name (OUT) */
0114     size_t           *attr_name_len; /* Actual length of attribute name (OUT) */
0115 } H5VL_attr_get_name_args_t;
0116 
0117 /* Parameters for attribute 'get_info' operation */
0118 typedef struct H5VL_attr_get_info_args_t {
0119     H5VL_loc_params_t loc_params; /* Location parameters for object access */
0120     const char       *attr_name;  /* Attribute name (for get_info_by_name) */
0121     H5A_info_t       *ainfo;      /* Attribute info (OUT) */
0122 } H5VL_attr_get_info_args_t;
0123 
0124 /* Parameters for attribute 'get' operations */
0125 typedef struct H5VL_attr_get_args_t {
0126     H5VL_attr_get_t op_type; /* Operation to perform */
0127 
0128     /* Parameters for each operation */
0129     union {
0130         /* H5VL_ATTR_GET_ACPL */
0131         struct {
0132             hid_t acpl_id; /* Attribute creation property list ID (OUT) */
0133         } get_acpl;
0134 
0135         /* H5VL_ATTR_GET_INFO */
0136         H5VL_attr_get_info_args_t get_info; /* Attribute info */
0137 
0138         /* H5VL_ATTR_GET_NAME */
0139         H5VL_attr_get_name_args_t get_name; /* Attribute name */
0140 
0141         /* H5VL_ATTR_GET_SPACE */
0142         struct {
0143             hid_t space_id; /* Dataspace ID (OUT) */
0144         } get_space;
0145 
0146         /* H5VL_ATTR_GET_STORAGE_SIZE */
0147         struct {
0148             hsize_t *data_size; /* Size of attribute in file (OUT) */
0149         } get_storage_size;
0150 
0151         /* H5VL_ATTR_GET_TYPE */
0152         struct {
0153             hid_t type_id; /* Datatype ID (OUT) */
0154         } get_type;
0155     } args;
0156 } H5VL_attr_get_args_t;
0157 
0158 /* Values for attribute 'specific' operation */
0159 typedef enum H5VL_attr_specific_t {
0160     H5VL_ATTR_DELETE,        /* H5Adelete(_by_name)  */
0161     H5VL_ATTR_DELETE_BY_IDX, /* H5Adelete_by_idx     */
0162     H5VL_ATTR_EXISTS,        /* H5Aexists(_by_name)  */
0163     H5VL_ATTR_ITER,          /* H5Aiterate(_by_name) */
0164     H5VL_ATTR_RENAME         /* H5Arename(_by_name)  */
0165 } H5VL_attr_specific_t;
0166 
0167 /* Parameters for attribute 'iterate' operation */
0168 typedef struct H5VL_attr_iterate_args_t {
0169     H5_index_t      idx_type; /* Type of index to iterate over */
0170     H5_iter_order_t order;    /* Order of index iteration */
0171     hsize_t        *idx;      /* Start/stop iteration index (IN/OUT) */
0172     H5A_operator2_t op;       /* Iteration callback function */
0173     void           *op_data;  /* Iteration callback context */
0174 } H5VL_attr_iterate_args_t;
0175 
0176 /* Parameters for attribute 'delete_by_idx' operation */
0177 typedef struct H5VL_attr_delete_by_idx_args_t {
0178     H5_index_t      idx_type; /* Type of index to iterate over */
0179     H5_iter_order_t order;    /* Order of index iteration */
0180     hsize_t         n;        /* Iteration index */
0181 } H5VL_attr_delete_by_idx_args_t;
0182 
0183 /* Parameters for attribute 'specific' operations */
0184 typedef struct H5VL_attr_specific_args_t {
0185     H5VL_attr_specific_t op_type; /* Operation to perform */
0186 
0187     /* Parameters for each operation */
0188     union {
0189         /* H5VL_ATTR_DELETE */
0190         struct {
0191             const char *name; /* Name of attribute to delete */
0192         } del;
0193 
0194         /* H5VL_ATTR_DELETE_BY_IDX */
0195         H5VL_attr_delete_by_idx_args_t delete_by_idx;
0196 
0197         /* H5VL_ATTR_EXISTS */
0198         struct {
0199             const char *name;   /* Name of attribute to check */
0200             hbool_t    *exists; /* Whether attribute exists (OUT) */
0201         } exists;
0202 
0203         /* H5VL_ATTR_ITER */
0204         H5VL_attr_iterate_args_t iterate;
0205 
0206         /* H5VL_ATTR_RENAME */
0207         struct {
0208             const char *old_name; /* Name of attribute to rename */
0209             const char *new_name; /* New attribute name */
0210         } rename;
0211     } args;
0212 } H5VL_attr_specific_args_t;
0213 
0214 /* Typedef for VOL connector attribute optional VOL operations */
0215 typedef int H5VL_attr_optional_t;
0216 
0217 /* Values for dataset 'get' operation */
0218 typedef enum H5VL_dataset_get_t {
0219     H5VL_DATASET_GET_DAPL,         /* access property list                */
0220     H5VL_DATASET_GET_DCPL,         /* creation property list              */
0221     H5VL_DATASET_GET_SPACE,        /* dataspace                           */
0222     H5VL_DATASET_GET_SPACE_STATUS, /* space status                        */
0223     H5VL_DATASET_GET_STORAGE_SIZE, /* storage size                        */
0224     H5VL_DATASET_GET_TYPE          /* datatype                            */
0225 } H5VL_dataset_get_t;
0226 
0227 /* Parameters for dataset 'get' operations */
0228 typedef struct H5VL_dataset_get_args_t {
0229     H5VL_dataset_get_t op_type; /* Operation to perform */
0230 
0231     /* Parameters for each operation */
0232     union {
0233         /* H5VL_DATASET_GET_DAPL */
0234         struct {
0235             hid_t dapl_id; /* Dataset access property list ID (OUT) */
0236         } get_dapl;
0237 
0238         /* H5VL_DATASET_GET_DCPL */
0239         struct {
0240             hid_t dcpl_id; /* Dataset creation property list ID (OUT) */
0241         } get_dcpl;
0242 
0243         /* H5VL_DATASET_GET_SPACE */
0244         struct {
0245             hid_t space_id; /* Dataspace ID (OUT) */
0246         } get_space;
0247 
0248         /* H5VL_DATASET_GET_SPACE_STATUS */
0249         struct {
0250             H5D_space_status_t *status; /* Storage space allocation status (OUT) */
0251         } get_space_status;
0252 
0253         /* H5VL_DATASET_GET_STORAGE_SIZE */
0254         struct {
0255             hsize_t *storage_size; /* Size of dataset's storage (OUT) */
0256         } get_storage_size;
0257 
0258         /* H5VL_DATASET_GET_TYPE */
0259         struct {
0260             hid_t type_id; /* Datatype ID (OUT) */
0261         } get_type;
0262     } args;
0263 } H5VL_dataset_get_args_t;
0264 
0265 /* Values for dataset 'specific' operation */
0266 typedef enum H5VL_dataset_specific_t {
0267     H5VL_DATASET_SET_EXTENT, /* H5Dset_extent                       */
0268     H5VL_DATASET_FLUSH,      /* H5Dflush                            */
0269     H5VL_DATASET_REFRESH     /* H5Drefresh                          */
0270 } H5VL_dataset_specific_t;
0271 
0272 /* Parameters for dataset 'specific' operations */
0273 typedef struct H5VL_dataset_specific_args_t {
0274     H5VL_dataset_specific_t op_type; /* Operation to perform */
0275 
0276     /* Parameters for each operation */
0277     union {
0278         /* H5VL_DATASET_SET_EXTENT */
0279         struct {
0280             const hsize_t *size; /* New dataspace extent */
0281         } set_extent;
0282 
0283         /* H5VL_DATASET_FLUSH */
0284         struct {
0285             hid_t dset_id; /* Dataset ID (IN) */
0286         } flush;
0287 
0288         /* H5VL_DATASET_REFRESH */
0289         struct {
0290             hid_t dset_id; /* Dataset ID (IN) */
0291         } refresh;
0292     } args;
0293 } H5VL_dataset_specific_args_t;
0294 
0295 /* Typedef for VOL connector dataset optional VOL operations */
0296 typedef int H5VL_dataset_optional_t;
0297 
0298 /* Values for datatype 'get' operation */
0299 typedef enum H5VL_datatype_get_t {
0300     H5VL_DATATYPE_GET_BINARY_SIZE, /* Get size of serialized form of transient type */
0301     H5VL_DATATYPE_GET_BINARY,      /* Get serialized form of transient type         */
0302     H5VL_DATATYPE_GET_TCPL         /* Datatype creation property list               */
0303 } H5VL_datatype_get_t;
0304 
0305 /* Parameters for datatype 'get' operations */
0306 typedef struct H5VL_datatype_get_args_t {
0307     H5VL_datatype_get_t op_type; /* Operation to perform */
0308 
0309     /* Parameters for each operation */
0310     union {
0311         /* H5VL_DATATYPE_GET_BINARY_SIZE */
0312         struct {
0313             size_t *size; /* Size of serialized form of datatype (OUT) */
0314         } get_binary_size;
0315 
0316         /* H5VL_DATATYPE_GET_BINARY */
0317         struct {
0318             void  *buf;      /* Buffer to store serialized form of datatype (OUT) */
0319             size_t buf_size; /* Size of serialized datatype buffer */
0320         } get_binary;
0321 
0322         /* H5VL_DATATYPE_GET_TCPL */
0323         struct {
0324             hid_t tcpl_id; /* Named datatype creation property list ID (OUT) */
0325         } get_tcpl;
0326     } args;
0327 } H5VL_datatype_get_args_t;
0328 
0329 /* Values for datatype 'specific' operation */
0330 typedef enum H5VL_datatype_specific_t {
0331     H5VL_DATATYPE_FLUSH,  /* H5Tflush */
0332     H5VL_DATATYPE_REFRESH /* H5Trefresh */
0333 } H5VL_datatype_specific_t;
0334 
0335 /* Parameters for datatype 'specific' operations */
0336 typedef struct H5VL_datatype_specific_args_t {
0337     H5VL_datatype_specific_t op_type; /* Operation to perform */
0338 
0339     /* Parameters for each operation */
0340     union {
0341         /* H5VL_DATATYPE_FLUSH */
0342         struct {
0343             hid_t type_id; /* Named datatype ID (IN) */
0344         } flush;
0345 
0346         /* H5VL_DATATYPE_REFRESH */
0347         struct {
0348             hid_t type_id; /* Named datatype ID (IN) */
0349         } refresh;
0350     } args;
0351 } H5VL_datatype_specific_args_t;
0352 
0353 /* Typedef and values for native VOL connector named datatype optional VOL operations */
0354 typedef int H5VL_datatype_optional_t;
0355 /* (No optional named datatype VOL operations currently) */
0356 
0357 /* Info for H5VL_FILE_GET_CONT_INFO */
0358 typedef struct H5VL_file_cont_info_t {
0359     unsigned version;       /* version information (keep first) */
0360     uint64_t feature_flags; /* Container feature flags          */
0361                             /* (none currently defined)         */
0362     size_t token_size;      /* Size of tokens                   */
0363     size_t blob_id_size;    /* Size of blob IDs                 */
0364 } H5VL_file_cont_info_t;
0365 
0366 /* Values for file 'get' operation */
0367 typedef enum H5VL_file_get_t {
0368     H5VL_FILE_GET_CONT_INFO, /* file get container info              */
0369     H5VL_FILE_GET_FAPL,      /* file access property list            */
0370     H5VL_FILE_GET_FCPL,      /* file creation property list          */
0371     H5VL_FILE_GET_FILENO,    /* file number                          */
0372     H5VL_FILE_GET_INTENT,    /* file intent                          */
0373     H5VL_FILE_GET_NAME,      /* file name                            */
0374     H5VL_FILE_GET_OBJ_COUNT, /* object count in file                 */
0375     H5VL_FILE_GET_OBJ_IDS    /* object ids in file                   */
0376 } H5VL_file_get_t;
0377 
0378 /* Parameters for file 'get_name' operation */
0379 typedef struct H5VL_file_get_name_args_t {
0380     H5I_type_t type;          /* ID type of object pointer */
0381     size_t     buf_size;      /* Size of file name buffer (IN) */
0382     char      *buf;           /* Buffer for file name (OUT) */
0383     size_t    *file_name_len; /* Actual length of file name (OUT) */
0384 } H5VL_file_get_name_args_t;
0385 
0386 /* Parameters for file 'get_obj_ids' operation */
0387 typedef struct H5VL_file_get_obj_ids_args_t {
0388     unsigned types;    /* Type of objects to count */
0389     size_t   max_objs; /* Size of array of object IDs */
0390     hid_t   *oid_list; /* Array of object IDs (OUT) */
0391     size_t  *count;    /* # of objects (OUT) */
0392 } H5VL_file_get_obj_ids_args_t;
0393 
0394 /* Parameters for file 'get' operations */
0395 typedef struct H5VL_file_get_args_t {
0396     H5VL_file_get_t op_type; /* Operation to perform */
0397 
0398     /* Parameters for each operation */
0399     union {
0400         /* H5VL_FILE_GET_CONT_INFO */
0401         struct {
0402             H5VL_file_cont_info_t *info; /* Container info (OUT) */
0403         } get_cont_info;
0404 
0405         /* H5VL_FILE_GET_FAPL */
0406         struct {
0407             hid_t fapl_id; /* File access property list (OUT) */
0408         } get_fapl;
0409 
0410         /* H5VL_FILE_GET_FCPL */
0411         struct {
0412             hid_t fcpl_id; /* File creation property list (OUT) */
0413         } get_fcpl;
0414 
0415         /* H5VL_FILE_GET_FILENO */
0416         struct {
0417             unsigned long *fileno; /* File "number" (OUT) */
0418         } get_fileno;
0419 
0420         /* H5VL_FILE_GET_INTENT */
0421         struct {
0422             unsigned *flags; /* File open/create intent flags (OUT) */
0423         } get_intent;
0424 
0425         /* H5VL_FILE_GET_NAME */
0426         H5VL_file_get_name_args_t get_name;
0427 
0428         /* H5VL_FILE_GET_OBJ_COUNT */
0429         struct {
0430             unsigned types; /* Type of objects to count */
0431             size_t  *count; /* # of objects (OUT) */
0432         } get_obj_count;
0433 
0434         /* H5VL_FILE_GET_OBJ_IDS */
0435         H5VL_file_get_obj_ids_args_t get_obj_ids;
0436     } args;
0437 } H5VL_file_get_args_t;
0438 
0439 /* Values for file 'specific' operation */
0440 typedef enum H5VL_file_specific_t {
0441     H5VL_FILE_FLUSH,         /* Flush file                       */
0442     H5VL_FILE_REOPEN,        /* Reopen the file                  */
0443     H5VL_FILE_IS_ACCESSIBLE, /* Check if a file is accessible    */
0444                              /* Note for VOL connector authors:  */
0445                              /*  Only return an error from this  */
0446                              /*  callback if it is not possible  */
0447                              /*  to determine if a file (or      */
0448                              /*  container) is accessible.       */
0449                              /*  It is _not_ an error to return  */
0450                              /*  a 'false' value for the         */
0451                              /*  'accessible' argument.          */
0452     H5VL_FILE_DELETE,        /* Delete a file                    */
0453     H5VL_FILE_IS_EQUAL       /* Check if two files are the same  */
0454 } H5VL_file_specific_t;
0455 
0456 /* Parameters for file 'specific' operations */
0457 typedef struct H5VL_file_specific_args_t {
0458     H5VL_file_specific_t op_type; /* Operation to perform */
0459 
0460     /* Parameters for each operation */
0461     union {
0462         /* H5VL_FILE_FLUSH */
0463         struct {
0464             H5I_type_t  obj_type; /* Type of object to use */
0465             H5F_scope_t scope;    /* Scope of flush operation */
0466         } flush;
0467 
0468         /* H5VL_FILE_REOPEN */
0469         struct {
0470             void **file; /* File object for new file (OUT) */
0471         } reopen;
0472 
0473         /* H5VL_FILE_IS_ACCESSIBLE */
0474         struct {
0475             const char *filename;   /* Name of file to check */
0476             hid_t       fapl_id;    /* File access property list to use */
0477             hbool_t    *accessible; /* Whether file is accessible with FAPL settings (OUT) */
0478         } is_accessible;
0479 
0480         /* H5VL_FILE_DELETE */
0481         struct {
0482             const char *filename; /* Name of file to delete */
0483             hid_t       fapl_id;  /* File access property list to use */
0484         } del;
0485 
0486         /* H5VL_FILE_IS_EQUAL */
0487         struct {
0488             void    *obj2;      /* Second file object to compare against */
0489             hbool_t *same_file; /* Whether files are the same (OUT) */
0490         } is_equal;
0491     } args;
0492 } H5VL_file_specific_args_t;
0493 
0494 /* Typedef for VOL connector file optional VOL operations */
0495 typedef int H5VL_file_optional_t;
0496 
0497 /* Values for group 'get' operation */
0498 typedef enum H5VL_group_get_t {
0499     H5VL_GROUP_GET_GCPL, /* group creation property list     */
0500     H5VL_GROUP_GET_INFO  /* group info                       */
0501 } H5VL_group_get_t;
0502 
0503 /* Parameters for group 'get_info' operation */
0504 typedef struct H5VL_group_get_info_args_t {
0505     H5VL_loc_params_t loc_params; /* Location parameters for object access */
0506     H5G_info_t       *ginfo;      /* Group info (OUT) */
0507 } H5VL_group_get_info_args_t;
0508 
0509 /* Parameters for group 'get' operations */
0510 typedef struct H5VL_group_get_args_t {
0511     H5VL_group_get_t op_type; /* Operation to perform */
0512 
0513     /* Parameters for each operation */
0514     union {
0515         /* H5VL_GROUP_GET_GCPL */
0516         struct {
0517             hid_t gcpl_id; /* Group creation property list (OUT) */
0518         } get_gcpl;
0519 
0520         /* H5VL_GROUP_GET_INFO */
0521         H5VL_group_get_info_args_t get_info; /* Group info */
0522     } args;
0523 } H5VL_group_get_args_t;
0524 
0525 /* Values for group 'specific' operation */
0526 typedef enum H5VL_group_specific_t {
0527     H5VL_GROUP_MOUNT,   /* Mount a file on a group          */
0528     H5VL_GROUP_UNMOUNT, /* Unmount a file on a group        */
0529     H5VL_GROUP_FLUSH,   /* H5Gflush                         */
0530     H5VL_GROUP_REFRESH  /* H5Grefresh                       */
0531 } H5VL_group_specific_t;
0532 
0533 /* Parameters for group 'mount' operation */
0534 typedef struct H5VL_group_spec_mount_args_t {
0535     const char *name;       /* Name of location to mount child file */
0536     void       *child_file; /* Pointer to child file object */
0537     hid_t       fmpl_id;    /* File mount property list to use */
0538 } H5VL_group_spec_mount_args_t;
0539 
0540 /* Parameters for group 'specific' operations */
0541 typedef struct H5VL_group_specific_args_t {
0542     H5VL_group_specific_t op_type; /* Operation to perform */
0543 
0544     /* Parameters for each operation */
0545     union {
0546         /* H5VL_GROUP_MOUNT */
0547         H5VL_group_spec_mount_args_t mount;
0548 
0549         /* H5VL_GROUP_UNMOUNT */
0550         struct {
0551             const char *name; /* Name of location to unmount child file */
0552         } unmount;
0553 
0554         /* H5VL_GROUP_FLUSH */
0555         struct {
0556             hid_t grp_id; /* Group ID (IN) */
0557         } flush;
0558 
0559         /* H5VL_GROUP_REFRESH */
0560         struct {
0561             hid_t grp_id; /* Group ID (IN) */
0562         } refresh;
0563     } args;
0564 } H5VL_group_specific_args_t;
0565 
0566 /* Typedef for VOL connector group optional VOL operations */
0567 typedef int H5VL_group_optional_t;
0568 
0569 /* Link create types for VOL */
0570 typedef enum H5VL_link_create_t {
0571     H5VL_LINK_CREATE_HARD,
0572     H5VL_LINK_CREATE_SOFT,
0573     H5VL_LINK_CREATE_UD
0574 } H5VL_link_create_t;
0575 
0576 /* Parameters for link 'create' operations */
0577 typedef struct H5VL_link_create_args_t {
0578     H5VL_link_create_t op_type; /* Operation to perform */
0579 
0580     /* Parameters for each operation */
0581     union {
0582         /* H5VL_LINK_CREATE_HARD */
0583         struct {
0584             void             *curr_obj;        /* Current object */
0585             H5VL_loc_params_t curr_loc_params; /* Location parameters for current object */
0586         } hard;
0587 
0588         /* H5VL_LINK_CREATE_SOFT */
0589         struct {
0590             const char *target; /* Target of soft link */
0591         } soft;
0592 
0593         /* H5VL_LINK_CREATE_UD */
0594         struct {
0595             H5L_type_t  type;     /* Type of link to create */
0596             const void *buf;      /* Buffer that contains link info */
0597             size_t      buf_size; /* Size of link info buffer */
0598         } ud;
0599     } args;
0600 } H5VL_link_create_args_t;
0601 
0602 /* Values for link 'get' operation */
0603 typedef enum H5VL_link_get_t {
0604     H5VL_LINK_GET_INFO, /* link info                         */
0605     H5VL_LINK_GET_NAME, /* link name                         */
0606     H5VL_LINK_GET_VAL   /* link value                        */
0607 } H5VL_link_get_t;
0608 
0609 /* Parameters for link 'get' operations */
0610 typedef struct H5VL_link_get_args_t {
0611     H5VL_link_get_t op_type; /* Operation to perform */
0612 
0613     /* Parameters for each operation */
0614     union {
0615         /* H5VL_LINK_GET_INFO */
0616         struct {
0617             H5L_info2_t *linfo; /* Pointer to link's info (OUT) */
0618         } get_info;
0619 
0620         /* H5VL_LINK_GET_NAME */
0621         struct {
0622             size_t  name_size; /* Size of link name buffer (IN) */
0623             char   *name;      /* Buffer for link name (OUT) */
0624             size_t *name_len;  /* Actual length of link name (OUT) */
0625         } get_name;
0626 
0627         /* H5VL_LINK_GET_VAL */
0628         struct {
0629             size_t buf_size; /* Size of link value buffer (IN) */
0630             void  *buf;      /* Buffer for link value (OUT) */
0631         } get_val;
0632     } args;
0633 } H5VL_link_get_args_t;
0634 
0635 /* Values for link 'specific' operation */
0636 typedef enum H5VL_link_specific_t {
0637     H5VL_LINK_DELETE, /* H5Ldelete(_by_idx)                */
0638     H5VL_LINK_EXISTS, /* link existence                    */
0639     H5VL_LINK_ITER    /* H5Literate/visit(_by_name)              */
0640 } H5VL_link_specific_t;
0641 
0642 /* Parameters for link 'iterate' operation */
0643 typedef struct H5VL_link_iterate_args_t {
0644     hbool_t         recursive; /* Whether iteration is recursive */
0645     H5_index_t      idx_type;  /* Type of index to iterate over */
0646     H5_iter_order_t order;     /* Order of index iteration */
0647     hsize_t        *idx_p;     /* Start/stop iteration index (OUT) */
0648     H5L_iterate2_t  op;        /* Iteration callback function */
0649     void           *op_data;   /* Iteration callback context */
0650 } H5VL_link_iterate_args_t;
0651 
0652 /* Parameters for link 'specific' operations */
0653 typedef struct H5VL_link_specific_args_t {
0654     H5VL_link_specific_t op_type; /* Operation to perform */
0655 
0656     /* Parameters for each operation */
0657     union {
0658         /* H5VL_LINK_DELETE */
0659         /* No args */
0660 
0661         /* H5VL_LINK_EXISTS */
0662         struct {
0663             hbool_t *exists; /* Whether link exists (OUT) */
0664         } exists;
0665 
0666         /* H5VL_LINK_ITER */
0667         H5VL_link_iterate_args_t iterate;
0668     } args;
0669 } H5VL_link_specific_args_t;
0670 
0671 /* Typedef and values for native VOL connector link optional VOL operations */
0672 typedef int H5VL_link_optional_t;
0673 /* (No optional link VOL operations currently) */
0674 
0675 /* Values for object 'get' operation */
0676 typedef enum H5VL_object_get_t {
0677     H5VL_OBJECT_GET_FILE, /* object file                       */
0678     H5VL_OBJECT_GET_NAME, /* object name                       */
0679     H5VL_OBJECT_GET_TYPE, /* object type                       */
0680     H5VL_OBJECT_GET_INFO  /* H5Oget_info(_by_idx|name)         */
0681 } H5VL_object_get_t;
0682 
0683 /* Parameters for object 'get' operations */
0684 typedef struct H5VL_object_get_args_t {
0685     H5VL_object_get_t op_type; /* Operation to perform */
0686 
0687     /* Parameters for each operation */
0688     union {
0689         /* H5VL_OBJECT_GET_FILE */
0690         struct {
0691             void **file; /* File object (OUT) */
0692         } get_file;
0693 
0694         /* H5VL_OBJECT_GET_NAME */
0695         struct {
0696             size_t  buf_size; /* Size of name buffer (IN) */
0697             char   *buf;      /* Buffer for name (OUT) */
0698             size_t *name_len; /* Actual length of name (OUT) */
0699         } get_name;
0700 
0701         /* H5VL_OBJECT_GET_TYPE */
0702         struct {
0703             H5O_type_t *obj_type; /* Type of object (OUT) */
0704         } get_type;
0705 
0706         /* H5VL_OBJECT_GET_INFO */
0707         struct {
0708             unsigned     fields; /* Flags for fields to retrieve */
0709             H5O_info2_t *oinfo;  /* Pointer to object info (OUT) */
0710         } get_info;
0711     } args;
0712 } H5VL_object_get_args_t;
0713 
0714 /* Values for object 'specific' operation */
0715 typedef enum H5VL_object_specific_t {
0716     H5VL_OBJECT_CHANGE_REF_COUNT, /* H5Oincr/decr_refcount             */
0717     H5VL_OBJECT_EXISTS,           /* H5Oexists_by_name                 */
0718     H5VL_OBJECT_LOOKUP,           /* Lookup object                     */
0719     H5VL_OBJECT_VISIT,            /* H5Ovisit(_by_name)                */
0720     H5VL_OBJECT_FLUSH,            /* H5{D|G|O|T}flush                  */
0721     H5VL_OBJECT_REFRESH           /* H5{D|G|O|T}refresh                */
0722 } H5VL_object_specific_t;
0723 
0724 /* Parameters for object 'visit' operation */
0725 typedef struct H5VL_object_visit_args_t {
0726     H5_index_t      idx_type; /* Type of index to iterate over */
0727     H5_iter_order_t order;    /* Order of index iteration */
0728     unsigned        fields;   /* Flags for fields to provide in 'info' object for 'op' callback */
0729     H5O_iterate2_t  op;       /* Iteration callback function */
0730     void           *op_data;  /* Iteration callback context */
0731 } H5VL_object_visit_args_t;
0732 
0733 /* Parameters for object 'specific' operations */
0734 typedef struct H5VL_object_specific_args_t {
0735     H5VL_object_specific_t op_type; /* Operation to perform */
0736 
0737     /* Parameters for each operation */
0738     union {
0739         /* H5VL_OBJECT_CHANGE_REF_COUNT */
0740         struct {
0741             int delta; /* Amount to modify object's refcount */
0742         } change_rc;
0743 
0744         /* H5VL_OBJECT_EXISTS */
0745         struct {
0746             hbool_t *exists; /* Whether object exists (OUT) */
0747         } exists;
0748 
0749         /* H5VL_OBJECT_LOOKUP */
0750         struct {
0751             H5O_token_t *token_ptr; /* Pointer to token for lookup (OUT) */
0752         } lookup;
0753 
0754         /* H5VL_OBJECT_VISIT */
0755         H5VL_object_visit_args_t visit;
0756 
0757         /* H5VL_OBJECT_FLUSH */
0758         struct {
0759             hid_t obj_id; /* Object ID (IN) */
0760         } flush;
0761 
0762         /* H5VL_OBJECT_REFRESH */
0763         struct {
0764             hid_t obj_id; /* Object ID (IN) */
0765         } refresh;
0766     } args;
0767 } H5VL_object_specific_args_t;
0768 
0769 /* Typedef for VOL connector object optional VOL operations */
0770 typedef int H5VL_object_optional_t;
0771 
0772 /* Status values for async request operations */
0773 typedef enum H5VL_request_status_t {
0774     H5VL_REQUEST_STATUS_IN_PROGRESS, /* Operation has not yet completed                       */
0775     H5VL_REQUEST_STATUS_SUCCEED,     /* Operation has completed, successfully                 */
0776     H5VL_REQUEST_STATUS_FAIL,        /* Operation has completed, but failed                   */
0777     H5VL_REQUEST_STATUS_CANT_CANCEL, /* An attempt to cancel this operation was made, but it  */
0778                                      /*  can't be canceled immediately.  The operation has    */
0779                                      /*  not completed successfully or failed, and is not yet */
0780                                      /*  in progress.  Another attempt to cancel it may be    */
0781                                      /*  attempted and may (or may not) succeed.              */
0782     H5VL_REQUEST_STATUS_CANCELED     /* Operation has not completed and was canceled          */
0783 } H5VL_request_status_t;
0784 
0785 /* Values for async request 'specific' operation */
0786 typedef enum H5VL_request_specific_t {
0787     H5VL_REQUEST_GET_ERR_STACK, /* Retrieve error stack for failed operation */
0788     H5VL_REQUEST_GET_EXEC_TIME  /* Retrieve execution time for operation */
0789 } H5VL_request_specific_t;
0790 
0791 /* Parameters for request 'specific' operations */
0792 typedef struct H5VL_request_specific_args_t {
0793     H5VL_request_specific_t op_type; /* Operation to perform */
0794 
0795     /* Parameters for each operation */
0796     union {
0797         /* H5VL_REQUEST_GET_ERR_STACK */
0798         struct {
0799             hid_t err_stack_id; /* Error stack ID for operation (OUT) */
0800         } get_err_stack;
0801 
0802         /* H5VL_REQUEST_GET_EXEC_TIME */
0803         struct {
0804             uint64_t *exec_ts;   /* Timestamp for start of task execution (OUT) */
0805             uint64_t *exec_time; /* Duration of task execution (in ns) (OUT) */
0806         } get_exec_time;
0807     } args;
0808 } H5VL_request_specific_args_t;
0809 
0810 /* Typedef and values for native VOL connector request optional VOL operations */
0811 typedef int H5VL_request_optional_t;
0812 /* (No optional request VOL operations currently) */
0813 
0814 /* Values for 'blob' 'specific' operation */
0815 typedef enum H5VL_blob_specific_t {
0816     H5VL_BLOB_DELETE, /* Delete a blob (by ID) */
0817     H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */
0818     H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */
0819 } H5VL_blob_specific_t;
0820 
0821 /* Parameters for blob 'specific' operations */
0822 typedef struct H5VL_blob_specific_args_t {
0823     H5VL_blob_specific_t op_type; /* Operation to perform */
0824 
0825     /* Parameters for each operation */
0826     union {
0827         /* H5VL_BLOB_DELETE */
0828         /* No args */
0829 
0830         /* H5VL_BLOB_ISNULL */
0831         struct {
0832             hbool_t *isnull; /* Whether blob ID is "null" (OUT) */
0833         } is_null;
0834 
0835         /* H5VL_BLOB_SETNULL */
0836         /* No args */
0837     } args;
0838 } H5VL_blob_specific_args_t;
0839 
0840 /* Typedef and values for native VOL connector blob optional VOL operations */
0841 typedef int H5VL_blob_optional_t;
0842 /* (No optional blob VOL operations currently) */
0843 
0844 /* VOL connector info fields & callbacks */
0845 typedef struct H5VL_info_class_t {
0846     size_t size;                     /* Size of the VOL info                         */
0847     void *(*copy)(const void *info); /* Callback to create a copy of the VOL info    */
0848     herr_t (*cmp)(int *cmp_value, const void *info1, const void *info2); /* Callback to compare VOL info */
0849     herr_t (*free)(void *info);                     /* Callback to release a VOL info               */
0850     herr_t (*to_str)(const void *info, char **str); /* Callback to serialize connector's info into a string */
0851     herr_t (*from_str)(const char *str,
0852                        void      **info); /* Callback to deserialize a string into connector's info */
0853 } H5VL_info_class_t;
0854 
0855 /* VOL object wrap / retrieval callbacks */
0856 /* (These must be implemented by "pass through" VOL connectors, and should not be implemented by terminal VOL
0857  * connectors) */
0858 typedef struct H5VL_wrap_class_t {
0859     void *(*get_object)(const void *obj); /* Callback to retrieve underlying object       */
0860     herr_t (*get_wrap_ctx)(
0861         const void *obj,
0862         void      **wrap_ctx); /* Callback to retrieve the object wrapping context for the connector */
0863     void *(*wrap_object)(void *obj, H5I_type_t obj_type,
0864                          void *wrap_ctx); /* Callback to wrap a library object */
0865     void *(*unwrap_object)(void *obj);    /* Callback to unwrap a library object */
0866     herr_t (*free_wrap_ctx)(
0867         void *wrap_ctx); /* Callback to release the object wrapping context for the connector */
0868 } H5VL_wrap_class_t;
0869 
0870 /* H5A routines */
0871 typedef struct H5VL_attr_class_t {
0872     void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t type_id,
0873                     hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req);
0874     void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *attr_name, hid_t aapl_id,
0875                   hid_t dxpl_id, void **req);
0876     herr_t (*read)(void *attr, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req);
0877     herr_t (*write)(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req);
0878     herr_t (*get)(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req);
0879     herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_args_t *args,
0880                        hid_t dxpl_id, void **req);
0881     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
0882     herr_t (*close)(void *attr, hid_t dxpl_id, void **req);
0883 } H5VL_attr_class_t;
0884 
0885 /* H5D routines */
0886 typedef struct H5VL_dataset_class_t {
0887     void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t lcpl_id,
0888                     hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req);
0889     void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t dapl_id,
0890                   hid_t dxpl_id, void **req);
0891     herr_t (*read)(size_t count, void *dset[], hid_t mem_type_id[], hid_t mem_space_id[],
0892                    hid_t file_space_id[], hid_t dxpl_id, void *buf[], void **req);
0893     herr_t (*write)(size_t count, void *dset[], hid_t mem_type_id[], hid_t mem_space_id[],
0894                     hid_t file_space_id[], hid_t dxpl_id, const void *buf[], void **req);
0895     herr_t (*get)(void *obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req);
0896     herr_t (*specific)(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req);
0897     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
0898     herr_t (*close)(void *dset, hid_t dxpl_id, void **req);
0899 } H5VL_dataset_class_t;
0900 
0901 /* H5T routines*/
0902 typedef struct H5VL_datatype_class_t {
0903     void *(*commit)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t type_id,
0904                     hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req);
0905     void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id,
0906                   hid_t dxpl_id, void **req);
0907     herr_t (*get)(void *obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req);
0908     herr_t (*specific)(void *obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req);
0909     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
0910     herr_t (*close)(void *dt, hid_t dxpl_id, void **req);
0911 } H5VL_datatype_class_t;
0912 
0913 /* H5F routines */
0914 typedef struct H5VL_file_class_t {
0915     void *(*create)(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
0916                     void **req);
0917     void *(*open)(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
0918     herr_t (*get)(void *obj, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req);
0919     herr_t (*specific)(void *obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req);
0920     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
0921     herr_t (*close)(void *file, hid_t dxpl_id, void **req);
0922 } H5VL_file_class_t;
0923 
0924 /* H5G routines */
0925 typedef struct H5VL_group_class_t {
0926     void *(*create)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t lcpl_id,
0927                     hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req);
0928     void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id,
0929                   hid_t dxpl_id, void **req);
0930     herr_t (*get)(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req);
0931     herr_t (*specific)(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req);
0932     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
0933     herr_t (*close)(void *grp, hid_t dxpl_id, void **req);
0934 } H5VL_group_class_t;
0935 
0936 /* H5L routines */
0937 typedef struct H5VL_link_class_t {
0938     herr_t (*create)(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
0939                      hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
0940     herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
0941                    const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
0942                    void **req);
0943     herr_t (*move)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
0944                    const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
0945                    void **req);
0946     herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args, hid_t dxpl_id,
0947                   void **req);
0948     herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_args_t *args,
0949                        hid_t dxpl_id, void **req);
0950     herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
0951                        hid_t dxpl_id, void **req);
0952 } H5VL_link_class_t;
0953 
0954 /* H5O routines */
0955 typedef struct H5VL_object_class_t {
0956     void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type, hid_t dxpl_id,
0957                   void **req);
0958     herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, void *dst_obj,
0959                    const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id,
0960                    hid_t dxpl_id, void **req);
0961     herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args, hid_t dxpl_id,
0962                   void **req);
0963     herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_args_t *args,
0964                        hid_t dxpl_id, void **req);
0965     herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
0966                        hid_t dxpl_id, void **req);
0967 } H5VL_object_class_t;
0968 
0969 /* Asynchronous request 'notify' callback */
0970 typedef herr_t (*H5VL_request_notify_t)(void *ctx, H5VL_request_status_t status);
0971 
0972 /* "Levels" for 'get connector class' introspection callback */
0973 typedef enum H5VL_get_conn_lvl_t {
0974     H5VL_GET_CONN_LVL_CURR, /* Get "current" connector (for this object) */
0975     H5VL_GET_CONN_LVL_TERM  /* Get "terminal" connector (for this object) */
0976                             /* (Recursively called, for pass-through connectors) */
0977                             /* (Connectors that "split" must choose which connector to return) */
0978 } H5VL_get_conn_lvl_t;
0979 
0980 /* Forward declaration of H5VL_class_t, defined later in this file */
0981 struct H5VL_class_t;
0982 
0983 /* Container/connector introspection routines */
0984 typedef struct H5VL_introspect_class_t {
0985     herr_t (*get_conn_cls)(void *obj, H5VL_get_conn_lvl_t lvl, const struct H5VL_class_t **conn_cls);
0986     herr_t (*get_cap_flags)(const void *info, uint64_t *cap_flags);
0987     herr_t (*opt_query)(void *obj, H5VL_subclass_t cls, int opt_type, uint64_t *flags);
0988 } H5VL_introspect_class_t;
0989 
0990 /* Async request operation routines */
0991 typedef struct H5VL_request_class_t {
0992     herr_t (*wait)(void *req, uint64_t timeout, H5VL_request_status_t *status);
0993     herr_t (*notify)(void *req, H5VL_request_notify_t cb, void *ctx);
0994     herr_t (*cancel)(void *req, H5VL_request_status_t *status);
0995     herr_t (*specific)(void *req, H5VL_request_specific_args_t *args);
0996     herr_t (*optional)(void *req, H5VL_optional_args_t *args);
0997     herr_t (*free)(void *req);
0998 } H5VL_request_class_t;
0999 
1000 /* 'blob' routines */
1001 typedef struct H5VL_blob_class_t {
1002     herr_t (*put)(void *obj, const void *buf, size_t size, void *blob_id, void *ctx);
1003     herr_t (*get)(void *obj, const void *blob_id, void *buf, size_t size, void *ctx);
1004     herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_args_t *args);
1005     herr_t (*optional)(void *obj, void *blob_id, H5VL_optional_args_t *args);
1006 } H5VL_blob_class_t;
1007 
1008 /* Object token routines */
1009 typedef struct H5VL_token_class_t {
1010     herr_t (*cmp)(void *obj, const H5O_token_t *token1, const H5O_token_t *token2, int *cmp_value);
1011     herr_t (*to_str)(void *obj, H5I_type_t obj_type, const H5O_token_t *token, char **token_str);
1012     herr_t (*from_str)(void *obj, H5I_type_t obj_type, const char *token_str, H5O_token_t *token);
1013 } H5VL_token_class_t;
1014 
1015 /**
1016  * \ingroup H5VLDEV
1017  * Class information for each VOL connector
1018  */
1019 //! <!-- [H5VL_class_t_snip] -->
1020 typedef struct H5VL_class_t {
1021     /* Overall connector fields & callbacks */
1022     unsigned           version;          /**< VOL connector class struct version number */
1023     H5VL_class_value_t value;            /**< Value to identify connector               */
1024     const char        *name;             /**< Connector name (MUST be unique!)          */
1025     unsigned           conn_version;     /**< Version number of connector               */
1026     uint64_t           cap_flags;        /**< Capability flags for connector            */
1027     herr_t (*initialize)(hid_t vipl_id); /**< Connector initialization callback         */
1028     herr_t (*terminate)(void);           /**< Connector termination callback            */
1029 
1030     /* VOL framework */
1031     H5VL_info_class_t info_cls; /**< VOL info fields & callbacks  */
1032     H5VL_wrap_class_t wrap_cls; /**< VOL object wrap / retrieval callbacks */
1033 
1034     /* Data Model */
1035     H5VL_attr_class_t     attr_cls;     /**< Attribute (H5A*) class callbacks */
1036     H5VL_dataset_class_t  dataset_cls;  /**< Dataset (H5D*) class callbacks   */
1037     H5VL_datatype_class_t datatype_cls; /**< Datatype (H5T*) class callbacks  */
1038     H5VL_file_class_t     file_cls;     /**< File (H5F*) class callbacks      */
1039     H5VL_group_class_t    group_cls;    /**< Group (H5G*) class callbacks     */
1040     H5VL_link_class_t     link_cls;     /**< Link (H5L*) class callbacks      */
1041     H5VL_object_class_t   object_cls;   /**< Object (H5O*) class callbacks    */
1042 
1043     /* Infrastructure / Services */
1044     H5VL_introspect_class_t introspect_cls; /**< Container/connector introspection class callbacks */
1045     H5VL_request_class_t    request_cls;    /**< Asynchronous request class callbacks */
1046     H5VL_blob_class_t       blob_cls;       /**< 'Blob' class callbacks */
1047     H5VL_token_class_t      token_cls;      /**< VOL connector object token class callbacks */
1048 
1049     /* Catch-all */
1050     herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
1051                        void **req); /**< Optional callback */
1052 } H5VL_class_t;
1053 //! <!-- [H5VL_class_t_snip] -->
1054 
1055 /********************/
1056 /* Public Variables */
1057 /********************/
1058 
1059 /*********************/
1060 /* Public Prototypes */
1061 /*********************/
1062 
1063 #ifdef __cplusplus
1064 extern "C" {
1065 #endif
1066 
1067 /* Helper routines for VOL connector authors */
1068 /**
1069  * \ingroup H5VLDEV
1070  * \brief Registers a new VOL connector
1071  *
1072  * \param[in] cls A pointer to the plugin structure to register
1073  * \vipl_id
1074  * \return \hid_t{VOL connector}
1075  *
1076  * \details H5VLregister_connector() registers a new VOL connector as a member
1077  *          of the virtual object layer class. This VOL connector identifier is
1078  *          good until the library is closed or the connector is unregistered.
1079  *
1080  *          \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL
1081  *          initialization property list of class #H5P_VOL_INITIALIZE created
1082  *          with H5Pcreate(). When created, this property list contains no
1083  *          library properties. If a VOL connector author decides that
1084  *          initialization-specific data are needed, they can be added to the
1085  *          empty list and retrieved by the connector in the VOL connector's
1086  *          initialize callback. Use of the VOL initialization property list is
1087  *          uncommon, as most VOL-specific properties are added to the file
1088  *          access property list via the connector's API calls which set the
1089  *          VOL connector for the file open/create. For more information, see
1090  *          the \ref_vol_doc.
1091  *
1092  *          H5VL_class_t is defined in H5VLconnector.h in the source code. It
1093  *          contains class information for each VOL connector:
1094  *          \snippet this H5VL_class_t_snip
1095  *
1096  * \since 1.12.0
1097  *
1098  */
1099 H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
1100 /**
1101  * \ingroup H5VLDEV
1102  */
1103 H5_DLL void *H5VLobject(hid_t obj_id);
1104 /**
1105  * \ingroup H5VLDEV
1106  */
1107 H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id);
1108 /**
1109  * \ingroup H5VLDEV
1110  */
1111 H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name);
1112 /**
1113  * \ingroup H5VLDEV
1114  */
1115 H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value);
1116 
1117 /* User-defined optional operations */
1118 H5_DLL herr_t H5VLregister_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
1119 H5_DLL herr_t H5VLfind_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
1120 H5_DLL herr_t H5VLunregister_opt_operation(H5VL_subclass_t subcls, const char *op_name);
1121 H5_DLL herr_t H5VLattr_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1122                                    hid_t attr_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1123 H5_DLL herr_t H5VLdataset_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1124                                       hid_t dset_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1125 H5_DLL herr_t H5VLdatatype_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1126                                        hid_t type_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1127 H5_DLL herr_t H5VLfile_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1128                                    hid_t file_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1129 H5_DLL herr_t H5VLgroup_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1130                                     hid_t group_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1131 H5_DLL herr_t H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1132                                    hid_t loc_id, const char *name, hid_t lapl_id, H5VL_optional_args_t *args,
1133                                    hid_t dxpl_id, hid_t es_id);
1134 H5_DLL herr_t H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_line,
1135                                      hid_t loc_id, const char *name, hid_t lapl_id,
1136                                      H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
1137 H5_DLL herr_t H5VLrequest_optional_op(void *req, hid_t connector_id, H5VL_optional_args_t *args);
1138 
1139 /* API Wrappers for "optional_op" routines */
1140 /* (Must be defined _after_ the function prototype) */
1141 /* (And must only defined when included in application code, not the library) */
1142 #ifndef H5VL_MODULE
1143 /* Inject application compile-time macros into function calls */
1144 #define H5VLattr_optional_op(...)     H5VLattr_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1145 #define H5VLdataset_optional_op(...)  H5VLdataset_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1146 #define H5VLdatatype_optional_op(...) H5VLdatatype_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1147 #define H5VLfile_optional_op(...)     H5VLfile_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1148 #define H5VLgroup_optional_op(...)    H5VLgroup_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1149 #define H5VLlink_optional_op(...)     H5VLlink_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1150 #define H5VLobject_optional_op(...)   H5VLobject_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
1151 
1152 /* Define "wrapper" versions of function calls, to allow compile-time values to
1153  *      be passed in by language wrapper or library layer on top of HDF5.
1154  */
1155 #define H5VLattr_optional_op_wrap     H5_NO_EXPAND(H5VLattr_optional_op)
1156 #define H5VLdataset_optional_op_wrap  H5_NO_EXPAND(H5VLdataset_optional_op)
1157 #define H5VLdatatype_optional_op_wrap H5_NO_EXPAND(H5VLdatatype_optional_op)
1158 #define H5VLfile_optional_op_wrap     H5_NO_EXPAND(H5VLfile_optional_op)
1159 #define H5VLgroup_optional_op_wrap    H5_NO_EXPAND(H5VLgroup_optional_op)
1160 #define H5VLlink_optional_op_wrap     H5_NO_EXPAND(H5VLlink_optional_op)
1161 #define H5VLobject_optional_op_wrap   H5_NO_EXPAND(H5VLobject_optional_op)
1162 #endif /* H5VL_MODULE */
1163 
1164 #ifdef __cplusplus
1165 }
1166 #endif
1167 
1168 #endif /* H5VLconnector_H */