From 3c01aba949cdc0e5ca13601810af11950da98a10 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 21 Aug 2005 13:00:00 +0200 Subject: [PATCH] Adjusted 'Custom services' description to the actual implementation (cont'd) --- PLUGINS.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PLUGINS.html b/PLUGINS.html index c0e1d5f6..29d83513 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -887,14 +887,13 @@ virtual bool Service(const char *Id, void *Data = NULL); Id is a unique identification string that identifies the service protocol. To avoid collisions, the string should contain a service name, the plugin name (unless the service is not related to a single plugin) and a protocol version number. -Data points to a custom data structure or is NULL to detect whether -the plugin supports this service. For each id string there should be a specification -that describes the format of the data structure, and any change to the format should -be reflected by a change of the id string. +Data points to a custom data structure. For each id string +there should be a specification that describes the format of the data +structure, and any change to the format should be reflected by a change +of the id string.

The function shall return true for any service id string it handles, and false -otherwise. The function shall not perform any actions as long as Data is -NULL. The plugins have to agreee in which situations the service +otherwise. The plugins have to agreee in which situations the service may be called, for example whether the service may be called from every thread, or just from the main thread. A possible implementation could look like this: @@ -915,6 +914,8 @@ bool cPluginHello::Service(const char *Id, void *Data) }

+Plugins should expect to be called with Data set to NULL and may use +this as a 'service supported' check without performing any actions.

To send messages to, or request services from a specific plugin, one plugin can directly call another plugin's service function: