HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
#include "slapi-plugin.h"
void slapi_pblock_init( Slapi_PBlock *pb );
Parameters This function takes the following parameter:
Parameter block.
pb
Memory concerns The parameter block that is to be freed must have been created using
“slapi_pblock_new()”. When you are finished with the parameter block, you must free it using
the “slapi_pblock_destroy()”.
NOTE:
The search results will not be freed from the parameter block by slapi_pblock_init(). Any
internal search results must be freed with the “slapi_free_search_results_internal()” function
before calling slapi_pblock_init(), otherwise the search results will be leaked.
See also
“slapi_pblock_destroy()”
“slapi_pblock_new()”
35.4 slapi_pblock_new()
Creates a new parameter block.
Syntax
#include "slapi-plugin.h"
Slapi_PBlock *slapi_pblock_new();
Returns This function returns a pointer to the new parameter block.
Memory concerns The pblock pointer allocated with this function must always be freed by
“slapi_pblock_destroy()”. The use of other memory de-allocators (for example, free()) is not
supported and may lead to crashes or memory leaks.
35.5 slapi_pblock_set()
Sets the value of a name-value pair in a parameter block.
Syntax
#include "slapi-plugin.h"
int slapi_pblock_set( Slapi_PBlock *pb, int arg, void *value );
Parameters This function takes the following parameters:
Parameter block.
pb
ID of the name-value pair to set. For a list of IDs that you can specify, see
Part V “Parameter block reference”
arg
Pointer to the value that you want to set in the parameter block.
value
Returns This function returns one of the following values:
0 if successful.
-1 if an error occurs (for example, if an invalid ID is specified).
Memory concerns The value to be passed in must always be a pointer, even for integer
arguments. For example, if you wanted to do a search with the ManageDSAIT control:
int managedsait = 1; ... slapi_pblock_set(pb, SLAPI_MANAGEDSAIT, &managedsait);
A call similar to the following example will cause a crash:
35.4 slapi_pblock_new() 289