Timestamp:
2016-05-15T16:16:37Z (9 years ago)
Author:
jgeboski <jgeboski@…>
Parents:
4fe91a1
Message:

Implemented ABI checking for external plugins

As of now, bitlbee will load any plugin regardless of the ABI it was
built against. This is really problematic when structures or symbols
are changed within bitlbee. This often leads to the plugin not loading
or the plugin acting in an undefined way. Typically a simple rebuild of
the plugin will resolve such issues, but many users have no idea that
this is required after they have updated bitlbee.

Each plugin must now have an init_plugin_abi() function along with its
init_plugin() function. This new function is called very early in the
plugin loading process to ensure the plugin actually matches the ABI of
bitlbee. The constant value of BITLBEE_ABI_VERSION_CODE is returned by
the function, which embeds the constant value into the plugin. This
value is then read by bitlbee upon every plugin load to ensure that the
proper ABI is use. If not, bitlbee will refuse to load the plugin.

The boiler-plate implementation of init_plugin_abi():

guint init_plugin_abi(void)
{

return BITLBEE_ABI_VERSION_CODE;

}

Third party plugins may also want to provide backwards compatibility
with older bitlbee versions by defining the missing version macro:

#ifndef BITLBEE_ABI_VERSION_CODE
#define BITLBEE_ABI_VERSION_CODE 0
#endif

(No files)

Note: See TracChangeset for help on using the changeset viewer.