An Example Pre-Operation Plug-InChapter 4 A Quick Example 51Compiling the Plug-In ExampleOn Solaris, you can use the following Makefile to compile the example. (Thissample Makefile assumes that the source code is stored in srchxmpl.c and thatyou are compiling a plug-in named srchxmpl.so.)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 );}Code Example 4-1 Sample Pre-Operation Search and Initialization Functions (Continued)