HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
If there is an operational error during the processing of this call such as a duplicate value found,
the function will return LDAP_OPERATIONS_ERROR. If this occurs, please report the problem
to HP technical support.
Memory concerns The vals parameter can be NULL, in which case this function does nothing.
See also slapi_entry_delete_values()
24.29 slapi_entry_dup()
Makes a copy of an entry, its DN, and its attributes.
Description This function returns a copy of an existing “Slapi_Entry” structure. You can call
other front end functions to change the DN and attributes of this entry.
Syntax
#include "slapi-plugin.h"
Slapi_Entry *slapi_entry_dup( const Slapi_Entry *e );
Parameters This function takes the following parameter:
Entry that you want to copy.
e
Returns This function returns the new copy of the entry. If the structure cannot be duplicated,
for example, if no more virtual memory exists, the slapd program terminates.
Memory concerns When you are no longer using the entry, free it from memory by calling the
“slapi_entry_free()” function.
See also “slapi_entry_alloc()”“slapi_entry_free()”
24.30 slapi_entry_first_attr()
Finds the first attribute in an entry. If you want to iterate through the attributes in an entry, use
this function in conjunction with the “slapi_entry_next_attr()” function.
Syntax
#include "slapi-plugin.h"
int slapi_entry_first_attr( const Slapi_Entry *e,
Slapi_Attr **attr );
Parameters This function takes the following parameters:
Entry from which you want to get the attribute.
e
Pointer to the first attribute in the entry.
attr
Returns Returns 0 when successful; any other value returned signals failure.
Memory concerns Do not free the returned attr. This is a pointer into the internal entry data
structure. If you need a copy, use “slapi_attr_dup()”.
See also “slapi_attr_dup()”
24.31 slapi_entry_free()
Frees an entry, its DN, and its attributes from memory.
Description Call this function to free an entry that you have allocated by using the
“slapi_entry_alloc()” function or the “slapi_entry_dup()” function.
Syntax
#include "slapi-plugin.h"
void slapi_entry_free( Slapi_Entry *e );
224 Functions for managing entries