Compiling A Directory Server Plug-In - Netscape DIRECTORY SERVER 6.02 - PLUG-IN Manual

Table of Contents

Advertisement

Compiling a Directory Server Plug-In

Code Example 2-4
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
SLAPI_PLUGIN_VERSION_01 ) != 0 ||
/* Set up the server to call searchdn_preop_search()
before each LDAP search operation. */
slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN,
(void *) searchdn_preop_search ) !=0 ) {
/* If a problem occurs, log an error message, return -1.*/
slapi_log_error(SLAPI_LOG_PLUGIN,"searchdn_preop_init",
"Error registering function.\n" );
return( -1 );
}
/* If the plug-in was successfully registered, log a
message and return 0. */
slapi_log_error( SLAPI_LOG_PLUGIN, "searchdn_preop_init",
"Plug-in successfully registered.\n" );
return( 0 );
}
Compiling a Directory Server Plug-In
Keep in mind the following tips when compiling your server plug-in:
You need to compile and link your code as a shared object or library on UNIX
or as a dynamic link library (DLL) on Windows platforms. For example, on
Solaris, specify
command.
Some compilers require that you provide special flags when compiling code to
be used in a shared object or DLL. For example, on Solaris, you must specify
the
position-independent code. Consult the documentation for your platform
compiler and linker for details.
Make sure that the
is in your include path. Use
for Windows NT and Windows 2000 plug-ins.
On Windows platforms, link to the
located in this directory:
36
Netscape Directory Server Plug-In Programmer's Guide • May 2002
An Example Initialization Function (Continued)
ld -G <objects> -o <shared_object>
or
flag, which specifies that you want to generate
-Kpic
-KPIC
<server_root>/plugins/slapd/slapi/include
<server_root>\plugins\slapd\slapi\include
libslapd.lib
<server_root>\plugins\slapd\slapi\lib
as your link
directory
import library, which is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.02

Table of Contents