Skip to content

Commit

Permalink
pathtable
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Sep 8, 2024
1 parent c694476 commit a76e2cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/ncplugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ extern "C" {

/* Known Plugin Dispatchers */
#ifdef USE_HDF5
EXTERNL const NC_PluginPathDispatch NC4_hdf5_pluginpathtable;
EXTERNL const NC_PluginPathDispatch* NC4_hdf5_pluginpathtable;
#endif
#ifdef NETCDF_ENABLE_NCZARR
EXTERNL const NC_PluginPathDispatch NCZ_pluginpathtable;
EXTERNL const NC_PluginPathDispatch* NCZ_pluginpathtable;
#endif

/* See the file netcdf_aux.h for plugin-related utility functions */
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/dplugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ nc_plugin_path_initialize(void)

/* Initialize all the plugin path dispatchers and state*/
#ifdef USE_HDF5
gs->formatxstate.pluginapi[NC_FORMATX_NC_HDF5] = &NC4_hdf5_pluginpathtable;
gs->formatxstate.pluginapi[NC_FORMATX_NC_HDF5] = NC4_hdf5_pluginpathtable;
#endif
#ifdef NETCDF_ENABLE_NCZARR
gs->formatxstate.pluginapi[NC_FORMATX_NCZARR] = &NCZ_pluginpathtable;
gs->formatxstate.pluginapi[NC_FORMATX_NCZARR] = NCZ_pluginpathtable;
#endif
/* Initialize all the plugin path dispatcher states */
for(i=0;i<NC_FORMATX_COUNT;i++) {
Expand Down
6 changes: 5 additions & 1 deletion libhdf5/hdf5plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static int NC4_hdf5_plugin_path_write(void* state, size_t ndirs, char** const di
/**************************************************/
/* The HDF5 Plugin Path Dispatch table and functions */

const NC_PluginPathDispatch NC4_hdf5_pluginpathtable = {
static const NC_PluginPathDispatch pluginpathtable = {
NC_FORMATX_NC_HDF5,
NC_PLUGINPATH_DISPATCH_VERSION,
NC4_hdf5_plugin_path_initialize,
Expand All @@ -47,6 +47,10 @@ const NC_PluginPathDispatch NC4_hdf5_pluginpathtable = {
NC4_hdf5_plugin_path_write
};

const NC_PluginPathDispatch* NC4_hdf5_pluginpathtable = &pluginpathtable;

/**************************************************/

/**
* This function is called as part of nc_initialize.
* Its purpose is to initialize the plugin paths state.
Expand Down
4 changes: 3 additions & 1 deletion libnczarr/zplugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int pluginnamecheck(const char* name);

/**************************************************/
/* The NCZarr Plugin Path Dispatch table and functions */
const NC_PluginPathDispatch NCZ_pluginpathtable = {
static const NC_PluginPathDispatch pluginpathtable = {
NC_FORMATX_NCZARR,
NC_PLUGINPATH_DISPATCH_VERSION,
NCZ_plugin_path_initialize,
Expand All @@ -68,6 +68,8 @@ const NC_PluginPathDispatch NCZ_pluginpathtable = {
NCZ_plugin_path_write,
};

const NC_PluginPathDispatch* NCZ_pluginpathtable = &pluginpathtable;

/**************************************************/
/**
* This function is called as part of nc_initialize.
Expand Down

0 comments on commit a76e2cc

Please sign in to comment.