Writing an Initialization Function
In order to add your plug-in to that internal list, you need to write an
initialization function. The initialization function takes a single
argument. The function should set the following parameters:
•
The
filter factory function. See "How the Server Handles the Filter," on page 145,
and "Writing a Filter Factory Function," on page 147, for details.
•
The
indexer factory function if you have defined one. Optional. See "How the
Server Sets Up the Index," on page 139, and "Writing the Indexer Factory
Function," on page 141, for details.
•
The
if you have defined one. Optional. See "Specifying Start and Close Functions,"
on page 156, for details.
•
The
you want made accessible to the plug-in functions. Optional.
You need to register the initialization function so that the server runs the function
when starting up. For how to register matching rule functions, see "Registering
Matching Rule Functions," on page 155.
The following table summarizes the different parameters that the initialization
function should get and set in the parameter block that is passed in.
Table 11-7
Input and Output Parameters Available to a Matching Rule Plug-in Initialization Function
Parameter Name
SLAPI_PLUGIN_ARGC
SLAPI_PLUGIN_ARGV
SLAPI_PLUGIN_MR_FILTER_CREATE_FN
154
Netscape Directory Server Plug-in Programmer's Guide • October 2004
SLAPI_PLUGIN_MR_FILTER_CREATE_FN
SLAPI_PLUGIN_MR_INDEXER_CREATE_FN
SLAPI_PLUGIN_CLOSE_FN
SLAPI_PLUGIN_PRIVATE
Data Type
int
char **
void *
(function pointer)
parameter should be set to the
parameter should be set to the
parameter should be set to the close function
parameter should be set to any private data
Description
Input parameter. Number of
arguments in the plugin
directive, not including the
library name and initialization
function name.
Input parameter. Array of string
arguments in the plugin
directive, not including the
library name and initialization
function name.
Output parameter. The factory
function used for creating
filters.
Slapi_PBlock
Need help?
Do you have a question about the NETSCAPE DIRECTORY SERVER 7.0 - PLUG-IN and is the answer not in the manual?
Questions and answers