Compiling The Plug-In Example - Netscape DIRECTORY SERVER 6.02 - PLUG-IN Manual

Table of Contents

Advertisement

Code Example 4-1
slapi_log_error( SLAPI_LOG_PLUGIN, "\tFinal substring",
"%s\n", substr_final );
break;
case LDAP_FILTER_PRESENT:
slapi_log_error( SLAPI_LOG_PLUGIN, "SLAPI_SEARCH_FILTER",
"LDAP_FILTER_PRESENT\n" );
/* For presence filters, get and log the attribute type */
slapi_filter_get_type( filter, &attr_type );
if ( attr_type != NULL )
slapi_log_error( SLAPI_LOG_PLUGIN, "\tSearch for presence of attr",
"%s\n", attr_type );
break;
case LDAP_FILTER_EXTENDED:
slapi_log_error( SLAPI_LOG_PLUGIN, "SLAPI_SEARCH_FILTER",
"LDAP_FILTER_EXTENDED\n" );
break;
default:
slapi_log_error( SLAPI_LOG_PLUGIN, "SLAPI_SEARCH_FILTER",
"Unknown filter type:
slapi_filter_get_choice returned %d\n", filter_type );
break;
}
}
/* For comparison filters, get and log the attribute type */
if ( filter_type == LDAP_FILTER_EQUALITY || LDAP_FILTER_GE ||
LDAP_FILTER_LE || LDAP_FILTER_APPROX ) {
slapi_filter_get_ava( filter, &attr_type, &bval );
if ( ( attr_type != NULL ) && ( bval->bv_val != NULL ) ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "\tAttribute type",
"%s\n", attr_type );
slapi_log_error( SLAPI_LOG_PLUGIN, "\tAttribute value",
"%s\n", bval->bv_val );
}
}
/* Get and log the string representation of the filter */
if ( slapi_pblock_get(pb, SLAPI_SEARCH_STRFILTER, &filter_str) == 0 )
slapi_log_error( SLAPI_LOG_PLUGIN, "SLAPI_SEARCH_STRFILTER",
"%s\n", filter_str );
slapi_log_error( SLAPI_LOG_PLUGIN, "test_preop_search",
"*** DONE ***\n\n" );
return( 0 );
}

Compiling the Plug-In Example

On Solaris, you can use the following Makefile to compile the example. (This
sample Makefile assumes that the source code is stored in
you are compiling a plug-in named
Sample Pre-Operation Search and Initialization Functions (Continued)
.)
srchxmpl.so
Chapter 4
An Example Pre-Operation Plug-In
and that
srchxmpl.c
A Quick Example
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.02

Table of Contents