Remove libmei from extension api. Expose functions marked with "export"
All the libmei functions have been moved to the Sibmei plugin, but the extension API still has a field libmei. So that extensions still work, I provisionally dropped in sibmei5 itself for the old libmei. This however exposes all the functions present in Sibmei, which is not ideal.
In this pull request, I'm suggesting a mechanism to expose only specific functions. As we're using JavaScript-ish function syntax, I used the export keyword before functions that should be exposed. The mechansim goes as follows:
- The compiler recognizes the keyword and duplicates the function, adding the prefix
ExtensionAPI_and a dummy as first parameter (which is needed for calling it as a method from the API object) - It also compiles a list of all exported functions and
- During plugin initialization, all the functions in the list are exposed in the api object
Like this, we can granularly and very easily expose only those functions we consider necessary for extensions without risking to break extensions.
I'm making this a draft pull request because documentation needs to be updated as well. Before continuing, I'm interested in your opinions whether this is a sensible way to go.