Netscape DIRECTORY SERVER 6.02 - PLUG-IN Manual page 377

Table of Contents

Advertisement

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 void
argument should always be a pointer to the type of value you are
*value
retrieving:
int connid = 0;
...
retval = slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
is an integer value, so you will pass in a pointer to/address of an
SLAPI_CONN_ID
integer to get the value. Similarly, for a char
to/address of the value. For example:
char *binddn = NULL;
...
retval = slapi_pblock_get(pb, SLAPI_CONN_DN, &binddn);
With certain compilers on some platforms, you may have to cast the value to
.
*)
We recommend that you set the value to
slapi_pblock_get()
to
slapi_pblock_get()
In most instances, the caller should not free the returned value. The value will
usually be freed internally or through the call to
exception is if the value is explicitly set by the caller through
In this case, the caller is responsible for memory management. If the value is freed,
it is strongly recommended that the free is followed by a call to
slapi_pblock_set()
char *someparam = NULL;
...
someparam = slapi_ch_strdup(somestring);
slapi_pblock_set(pb, SOME_PARAM, someparam);
someparam = NULL; /* avoid dangling reference */
...
or
0
to avoid reading from uninitialized memory, in case the call
fails.
with a value of
. For example:
NULL
Functions for Managing Parameter Block
(a string), pass in a pointer
* value
before calling
NULL
slapi_pblock_destroy()
slapi_pblock_set()
Chapter 14
Function Reference
(void
. The
.
377

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.02

Table of Contents