Writing a Plug-in FunctionChapter 2 Writing and Compiling Plug-ins 39Working with Parameter BlocksIn the functions you write, you set values in the parameter block that pertain to theoperation you are performing. You can also get data from the parameter blockwhich you can use within your functions. This process is described in the nextsection, “Getting Data from the Parameter Block,” on page 39.You can also set values in the parameter block during the processing of yourplug-in functions. The Directory Server can then use the new data values tocomplete an operation which it might be processing. For details on this, see“Setting Data in the Parameter Block,” on page 40.Some of the data that you can retrieve from the parameter block include entries,attributes, search filters, and distinguished names (DNs). Once you retrieve a pieceof data, you can manipulate it using the front-end API functions. For example, youcan use front-end API functions to verify that an entry complies with the schema oryou can split up a search filter into its individual components. For details, see“Calling Front-End Functions,” on page 41.Getting Data from the Parameter BlockWhen the Directory Server calls your plug-in function, it passes any relevant datato your function in a parameter block. The parameter block is defined as aSlapi_PBlock data type. To access the data in a parameter block, call theslapi_pblock_get() function.In the following example, the searchdn_preop_search() function gets the DN ofthe base DN for the LDAP search operation. It then normalizes the DN, converts allcharacters to lowercase, and writes the converted DN to the error log. The actualDN (not a copy of it) is normalized and converted to lowercase.NOTE Often, slapi_pblock_get() returns a pointer to the actual data.When you call your own functions to modify the value retrieved byslapi_pblock_get(), you are modifying the actual data in theparameter block, not a copy of the data.Code Example 2-1 Getting Data from the Parameter Block#include ...intsearchdn_preop_search( Slapi_PBlock *pb ){char *dn;