HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Returns This function returns the unique ID value of the entry specified.
Memory concerns Never free this value. If you need a copy, use slapi_ch_strdup().
See also slapi_ch_strdup()
24.38 slapi_entry_has_children()
This function determines if the specified entry has child entries.
Syntax
#include "slapi-plugin.h"
int slapi_entry_has_children(const Slapi_Entry *e);
Parameters This function takes the following parameter:
Entry that you want to test for child entries.
e
Returns This function returns one of the following values:
0 If the entry you supply has no children entries.
1 If the entry you supply has children entries.
24.39 slapi_entry_init()
Initializes the values of an entry with the DN and attribute value pairs you supply.
Description 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.
Syntax
#include "slapi-plugin.h"
void slapi_entry_init(Slapi_Entry *e, char *dn, Slapi_Attr *a);
Parameters This function takes the following parameters:
The entry you want to initialize.
e
The DN of the entry to initialize.
dn
Initialization list of attribute value pairs, supplied as a Slapi_Attr data value.a
Memory concerns 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);l
dn is not freed in this context but will eventually be freed when “slapi_entry_free()” is called.
See also
24.38 slapi_entry_has_children() 227