Returning A Value To The Directory Server; Example Of An Initialization Function - Netscape DIRECTORY SERVER 6.01 - PLUG-IN Manual

Table of Contents

Advertisement

For example, if you want to register
search function, include the following code in your initialization function:
slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN, \
(void *) searchdn_preop_search )
SLAPI_PLUGIN_PRE_SEARCH_FN
plug-in function for the LDAP search operation.
NOTE
You can register more than one plug-in function in your initialization function; you
do not need to write an initialization function for each plug-in function that you
need to register. You should, however, define a different initialization function for
each type of plug-in that you are registering.

Returning a Value to the Directory Server

If the initialization function is successful, it should return
should return
exit.

Example of an Initialization Function

The following is an example of an initialization function that registers the
pre-operation plug-in function
function returns, the server will call
search operation is executed.
Code Example 2-4
#include "slapi-plugin.h"
...
#ifdef _WIN32
__declspec(dllexport)
#endif
searchdn_preop_init( Slapi_PBlock *pb )
{
/* Specify the version of the plug-in (set this to "01")*/
If you do not register your plug-in functions, the Directory Server
will not call your plug-in functions. Make sure to register your
plug-in functions.
. If the initialization function returns
-1
An Example Initialization Function
searchdn_preop_search()
is the parameter that specifies the pre-operation
searchdn_preop_search()
searchdn_preop_search()
Chapter 2
Writing Plug-in Initialization Functions
as a pre-operation
. If an error occurs, it
0
, the Directory Server will
-1
. After the initialization
before each LDAP
Writing and Compiling Plug-Ins
35

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.01

Table of Contents