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

For plug-in
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
directory is in your include path. Use
<server_root>\plugins\slapd\slapi\include
Windows 2000 plug-ins.
On Windows platforms, link to the
located in this directory:
46
Netscape Directory Server Plug-in Programmer's Guide • October 2004
An Example Initialization Function (Continued)
ld -G <objects> -o <shared_object>
or
-Kpic
-KPIC
<server_root>/plugins/slapd/slapi/include
<server_root>\plugins\slapd\slapi\lib
flag, which specifies that you want to generate
libslapd.lib
as your link
for Windows NT and
import library, which is

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Netscape directory server 7.0

Table of Contents