diff --git a/doc/reference/libpurple/tut_c_plugins.xml b/doc/reference/libpurple/tut_c_plugins.xml
--- a/doc/reference/libpurple/tut_c_plugins.xml
+++ b/doc/reference/libpurple/tut_c_plugins.xml
@@ -36,8 +36,8 @@
#include <purple.h>
-static PurplePluginInfo *
-plugin_query(GError **error)
+static GPluginPluginInfo *
+hello_world_query(GError **error)
{
const gchar * const authors[] = {
"Author Name <e@mail>",
@@ -60,7 +60,7 @@
}
static gboolean
-plugin_load(PurplePlugin *plugin, GError **error)
+hello_world_load(GPluginPlugin *plugin, GError **error)
{
purple_notify_message(plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!",
"This is the Hello World! plugin :)",
@@ -70,12 +70,12 @@
}
static gboolean
-plugin_unload(PurplePlugin *plugin, GError **error)
+hello_world_unload(GPluginPlugin *plugin, GError **error)
{
return TRUE;
}
-PURPLE_PLUGIN_INIT(hello_world, plugin_query, plugin_load, plugin_unload);
+GPLUGIN_NATIVE_PLUGIN_DECLARE(hello_world)
@@ -86,40 +86,52 @@
- plugin_query, plugin_load and
- plugin_unload must be implemented in every plugin. Each of
- these functions can return an error on failure by using
- g_set_error() on the error argument.
+ hello_world_query, hello_world_load and
+ hello_world_unload are functions that must be implemented
+ in every plugin. These functions are named according to the value passed
+ to GPLUGIN_NATIVE_PLUGIN_DECLARE which is described below.
- plugin_query is called when the plugin is probed by the
- plugin system, and returns various information about the plugin in form of a
- newly created PurplePluginInfo instance. For a list of all
- available properties, see
+ hello_world_query is called when the plugin is queried by
+ the plugin system, and returns various information about the plugin in form
+ of a newly created instance of GPluginPluginInfo or a
+ subclass. For a list of all available properties, see
purple_plugin_info_new().
- plugin_load is called when the plugin is loaded so that you
- can initialize any variables, register dynamic types, and so on. Plugins may
- also want to add their preferences to the pref tree--more about that later.
- In this plugin we'll just use it to display a message.
+ If anything should go wrong during the query you can return an error by using
+ g_set_error() on the error argument.
- plugin_unload is called when the plugin is unloaded, and we
- can use it to wrap up everything, and free our variables.
+ hello_world_load is called when the plugin is loaded. That
+ is the user has enabled the plugin or libpurple is loading a plugin that was
+ previously loaded. You can initialize any variables, register dynamic types,
+ and so on in this function. Plugins may also want to add their preferences
+ to the pref tree--more about that later. In this plugin we'll just use it to
+ display a message. Just like
+ hello_world_query if there are any errors that arise, you
+ can call g_set_error() on the error
+ agument and return FALSE.
+
+
+
+ hello_world_unload is called when the plugin is unloaded.
+ That is, when the user has manually unloaded the plugin or the program is
+ shutting down. We can use it to wrap up everything, and free our variables.
+ Again, if there are any errors, you can call
+ g_set_error() on the error argument
+ and return FALSE.
Finally we have
- PURPLE_PLUGIN_INIT().
- It is a macro that every plugin MUST have. It tells libpurple some basic
- things about your plugin, like what name to use if the plugin is compiled
- statically, along with the plugin_query,
- plugin_load, and plugin_unload
- functions.
+ GPLUGIN_NATIVE_PLUGIN_DECLARE().
+ It is a helper macro that makes creating plugins easier. It has a single
+ argument which is the prefix used for the _query,
+ _load, and _unload functions.