Netscape DIRECTORY SERVER 6.01 - PLUG-IN Manual page 376

Table of Contents

Advertisement

Functions for Managing Parameter Block
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
retrieving:
int connid = 0;
...
retval = slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
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 */
...
376
Netscape Directory Server Plug-In Programmer's Guide • January 2002
argument should always be a pointer to the type of value you are
*value
is an integer value, so you will pass in a pointer to/address of an
to avoid reading from uninitialized memory, in case the call
fails.
with a value of
(a string), pass in a pointer
* value
or
before calling
0
NULL
slapi_pblock_destroy()
. For example:
NULL
(void
. The
slapi_pblock_set()
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NETSCAPE DIRECTORY SERVER 6.01 - PLUG-IN and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Directory server 6.01

Table of Contents