EasypluginsSmall plugins which can be called in scripts
|If you want to know how to call easyplugins please have a look at: $system.call()
This part of the documentation handles only the way how to write an easyplugin. An easyplugin is simply a dll/so. You can create one like you normally make such so/dll files. The important thing is that these so/dll-files export some of the following functions.
Exported functions by easyplugin (C/C++-Examples):
_free function (needed)
This function is important! Since KVIrc can not free directly the memory of the dll, the plugins need the _free function so that the memory can be freed by the plugin to prevent memory-leaks.
_load function (optional)
After the plugin has be loaded, KVIrc will call the _load-function. Here you can prepare your plugin stuff.
_unload function ((optional)
This function will be called before the plugins is unloaded. In this function you can clean up memory or other things. After this call there is no guarantee that the plugin will be kept in memory.
_canunload function (optional)
The _canunload-function will be called by KVIrc to check if it may unload the plugin. If return value is true KVIrc will unload the plugin, false means he will try unloading it at the next check.
Important: KVIrc will ignore this if unload of plugins will be forced! So you have to be sure that the _unload function of your plugins cleans up!
This is the general structure of a user function call.
The important thing here is the handling of return values. To return a value to KVIrc you have to allocate memory and write the pointer to it into pBuffer. Have a look at the example for more details.