General
Information
The basic idea behind a plugin flow is as follows;
- Plugin is loaded.
- Plugin registers event handlers for any events
it cares to know about.
- BZFS runs.
- BZFS calls installed event handlers as the
event conditions happen.
- Code in plugin handlers modify the data passed
in with the event, or perform new actions based on the event using
other API functions.
- BZFS returns from the event call and uses any
modified data.
- BZFS runs, performing any event calls as they
happen, until it finally terminates normally.
- Plugin is unloaded when bzfs is quit, or plugin
is manually unloaded using the /unloadplugin command.
- Plugin unregisters any event handlers it had
installed.
This allows for a plugin to do many different
things depending on what events it hooks itself into. Plugins can hook
into any number of events they wish and are allowed to do anything the
developer wishes to do. A plugin does not have access to 100% of the
internals of BZFS. It must access it by using the BZFS API set of
functions as described below. Most of these API functions will directly
map to internal bzfs functions. In fact there are many cases where
internal features of bzfs use the same API functions that plugins can
use. Plugins may also link in any external library and call any
external functions or code that they wish.
As always open source projects are evolving. If
you do not see an API function that you need, please let us know and we
can try to add it for you, or code it in yourself, and submit it as a
patch.
|