24.39. slapi_entry_init()
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.
#include "slapi-plugin.h" void slapi_entry_init(Slapi_Entry *e, Slapi_DN *dn, Slapi_Attr *a);
This function takes the following parameters:
|
e
| The entry you want to initialize. |
|
dn
| The DN of the entry to initialize. |
|
a
| Initialization list of attribute value pairs, supplied as a Slapi_Attr data value. |
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);
slapi_sdn_set_dn_passin(slapi_entry_get_sdn(e), dn);
dn argument is not copied but is consumed by the function. To copy the argument,see the following example:
Slapi_DN *dn = slapi_ch_strdup(some_dn); Slapi_Entry *e = slapi_entry_alloc() slapi_entry_init(e, dn, NULL);l
dn is not freed in this context but will eventually be freed when slapi_entry_free() is called.

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.