21.2. slapi_add_controls()

This function specifies an array of LDAPControls, and then either appends the array to the end of a specified array or uses it to create a new array.
An existing array is grown using slapi_ch_realloc(). Otherwise, a new array is created using slapi_ch_malloc().
Syntax

#include "slapi-plugin.h"
void slapi_add_controls(LDAPControl ***ctrlsp, LDAPControl **newctrls, int copy)

Parameters

This function takes the following parameters:

ctrlsp Pointer that will receive the specified LDAPControl array. If ctrls is NULL, then a new array is created using slapi_ch_malloc().
newctrasl The specified LDAPControl array.
copy Sets whether the given controls are copied. If the value is true (0), then all of the controls in newctrls are copied. If the value is false (1), then all of the controls in newctrls are used and owned by the array and must be freed using ldap_controls_free.
Returns

This function returns LDAP_SUCCESS (LDAP result code) if successful.

See Also