herr_t H5PLset_loading_state( unsigned int plugin_control_mask )
IN: The list of dynamic plugin types to enable or disable. A plugin bit set to0(zero) prevents use of that dynamic plugin. A plugin bit set to1(one) enables use of that dynamic plugin.
Settingplugin_control_maskto a negative value enables all dynamic plugins. Settingplugin_control_maskto0(zero) disables all dynamic plugins.
The loading of external dynamic plugins can be controlled during runtime with an environment variable,HDF5_PLUGIN_PRELOAD. The environment variable can control the loading of dynamic filters at runtime, but it will disable it for all running programs that access that variable using the library.
H5PL_SET_LOADING_STATE controls the loading of external dynamic plugins during program execution.
H5PL_SET_LOADING_STATE uses one argument to enable or disable individual plugins.
Theplugin_control_maskparameter is an encoded integer in which each bit controls a specific plugin or class of plugins. Bit positions allocated to date are listed in the “Plugin Type/Bit Position” table below.
A plugin bit set to0(zero) prevents the use of the dynamic plugin corresponding to that bit position. A plugin bit set to1(one) allows the use of that dynamic plugin.
All dynamic plugins can be enabled by settingplugin_control_maskto a negative value. A value of0(zero) will disable all dynamic plugins.
H5PL_SET_LOADING_STATEinspects theHDF5_PLUGIN_PRELOADenvironment variable every time it is called. If the environment variable is set to the special::string, all dynamic plugins will be disabled.
The classes of plugins subject to programmatic control are specified in theH5PL_type_tENUM. Since only dynamically loaded filter plugins are currently subject to programmatic control, only one plugin type is defined:
Additional values may be added to theH5PL_type_tENUMas programmatic control is implemented for other plugin types.
Returns a non-negative value if successful; otherwise returns a negative value.
/* Disable plugin X: Requires user to negate the state
* with a 0 in bit position X and AND it with the result
* from an H5PLget_loading_state call. */
int new_setting = curr_setting & ~H5PL_FILTER_PLUGIN ;