diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-21 06:56:13 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-21 06:56:13 (GMT) |
commit | 8939a2190f50ab42c6b59c0d2df33ac66bb625e7 (patch) | |
tree | add67102c16433e043e348b6ffd34544101b2b42 /src/H5PLint.c | |
parent | 23ff0240ae18d52ac8164c7a55d698e7b2cd5dcc (diff) | |
download | hdf5-8939a2190f50ab42c6b59c0d2df33ac66bb625e7.zip hdf5-8939a2190f50ab42c6b59c0d2df33ac66bb625e7.tar.gz hdf5-8939a2190f50ab42c6b59c0d2df33ac66bb625e7.tar.bz2 |
Add info_to_str and str_to_info "management" callbacks for serializing and
deserializing a connector's info object.
Diffstat (limited to 'src/H5PLint.c')
-rw-r--r-- | src/H5PLint.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/H5PLint.c b/src/H5PLint.c index 166b300..bbe71fe 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -30,7 +30,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5MMprivate.h" /* Memory management */ #include "H5PLpkg.h" /* Plugin */ -#include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5Zprivate.h" /* Filter pipeline */ @@ -236,7 +235,7 @@ done: *------------------------------------------------------------------------- */ const void * -H5PL_load(H5PL_type_t type, H5PL_key_t key) +H5PL_load(H5PL_type_t type, const H5PL_key_t *key) { H5PL_search_params_t search_params; /* Plugin search parameters */ hbool_t found = FALSE; /* Whether the plugin was found */ @@ -263,7 +262,7 @@ H5PL_load(H5PL_type_t type, H5PL_key_t key) /* Set up the search parameters */ search_params.type = type; - search_params.key.id = key.id; + search_params.key.id = key->id; /* Search in the table of already loaded plugin libraries */ if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) @@ -308,7 +307,8 @@ done: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" herr_t -H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, hbool_t *success, const void **plugin_info) +H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, + hbool_t *success, const void **plugin_info) { H5PL_HANDLE handle = NULL; H5PL_get_plugin_info_t get_plugin_info = NULL; @@ -350,29 +350,44 @@ H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, hbool_t *success, HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get filter info from plugin") /* If the filter IDs match, we're done. Set the output parameters. */ - if (filter_info->id == key.id) { + if (filter_info->id == key->id) { *plugin_info = (const void *)filter_info; *success = TRUE; } break; } + case H5PL_TYPE_VOL: { - const H5VL_class_t *cls = NULL; + const H5VL_class_t *cls; /* Get the plugin info */ - if (NULL == (cls = (const H5VL_class_t *)(*get_plugin_info)())) + if(NULL == (cls = (const H5VL_class_t *)(*get_plugin_info)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL driver info from plugin") - /* If the plugin names match, we're done. Set the output parameters. */ - if (cls->name && !HDstrcmp(cls->name, key.name)) { - *plugin_info = (const void *)cls; - *success = TRUE; - } + /* Which kind of key are we looking for? */ + if(key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { + /* If the plugin names match, we're done. Set the output parameters. */ + if(cls->name && !HDstrcmp(cls->name, key->vol.u.name)) { + *plugin_info = (const void *)cls; + *success = TRUE; + } /* end if */ + } /* end if */ + else { + /* Sanity check */ + HDassert(key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); + + /* If the plugin values match, we're done. Set the output parameters. */ + if(cls->value == key->vol.u.value) { + *plugin_info = (const void *)cls; + *success = TRUE; + } /* end if */ + } /* end else */ break; } + case H5PL_TYPE_ERROR: case H5PL_TYPE_NONE: default: |