35.5. slapi_pblock_set()
#include "slapi-plugin.h" int slapi_pblock_set( Slapi_PBlock *pb, int arg, void *value );
This function takes the following parameters:
|
pb
| Parameter block. |
|
arg
| ID of the name-value pair to set. For a list of IDs that you can specify, see Part V, “Parameter Block Reference” |
|
value
| Pointer to the value that you want to set in the parameter block. |
This function returns one of the following values:
- 0 if successful.
- -1 if an error occurs (for example, if an invalid ID is specified).
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);
slapi_pblock_set(pb, SLAPI_MANAGEDSAIT, 1);
char * strings, char **arrays, Slapi_Backend *, etc.), you can pass in the value directly. For example:
char *target_dn = slapi_ch_strdup(some_dn); slapi_pblock_set(pb, SLAPI_TARGET_DN, target_dn);
slapi_pblock_set(pb, SLAPI_TARGET_DN, NULL);
void *). If the caller allocates the memory passed in, the caller is responsible for freeing that memory. Also, it is recommended to use slapi_pblock_get() to retrieve the value to free, rather than relying on a potentially dangling pointer. See the slapi_pblock_get() example for more details.
SLAPI_PLUGIN_TYPE to extended operation before setting the list of extended operation OIDs for the plug-in.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.