Function to load dynamic plugin from a dll

Hello!

Recent versions of HDF5 implement support for dynamically-loaded filters. This is a very useful feature, thank you!

A dynamically-loaded filter is searched for, loaded and registered when HDF5 discovers that it needs to read/write the data using filter ID. HDF5 looks for filters in HDF5_PLUGIN_PATH.

In some cases however is would be preferable that I could also tell HDF5 to load and register the filter by the name of plugin dll file, rather then specify HDF5_PLUGIN_PATH and put plugin dll there.

For example, I'd like to distribute my app.exe, hdf5.dll and my custom hdf5plugin.dll in a single dir. Setting HDF5_PLUGIN_PATH to that dir would be suboptimal, as HDF5 would need to scan all files in the dir to detect plugins, which could be many.

I propose to implement function
herr_t H5PL_load_plugin(char *filename);
which:
1) Loads the specified dll file.
2) Checks if it has H5PLget_plugin_type and H5PLget_plugin_info.
3) Calls these procedures to obtain plugin info.
4) Checks if the filter is not registered yet.
5) Registers the filter by calling H5Zregister.

Best wishes,
Andrey Paramonov

ยทยทยท

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.