Initializes the values of an entry with the DN and attribute value pairs you supply.
#include "slapi-plugin.h" void slapi_entry_init(Slapi_Entry *e, char *dn, Slapi_Attr *a);
This function takes the following parameters:
The entry you want to initialize.
The DN of the entry you are initializing.
Initialization list of attribute value pairs, supplied as a Slapi_Attr data value.
This function initializes the attributes and the corresponding attribute values of an entry. Also, during the course of processing, the unique ID of the entry is set to NULL and the flag value is set to 0.
Use this function to initialize a Slapi_Entry pointer.
This function should always be used after slapi_entry_alloc() , and never otherwise. For example:
Slapi_Entry *e = slapi_entry_alloc(); slapi_entry_init(e, NULL, NULL);
To set the DN in the entry:
slapi_sdn_set_dn_passin(slapi_entry_get_sdn(e), dn);
In this case, the dn argument is not copied, but is consumed by the function. To copy the argument, see the following example:
char *dn = slapi_ch_strdup(some_dn); Slapi_Entry *e = slapi_entry_alloc(); slapi_entry_init(e, dn, NULL);
dn is not freed in this context, but is eventually be freed when slapi_entry_free() is called.