HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
“slapi_entry_free()”
“slapi_entry_alloc()”
slapi_ch_strdup()
24.40 slapi_entry_merge_values_sv()
Merges (adds) and array of Slapi_Value data values to a specified attribute in an entry. If the
entry does not contain the attribute specified, the attribute is created with the value supplied.
Description This function adds additional Slapi_Value data values to the existing values
contained in an attribute. If the attribute type does not exist, it is created.
If the specified attribute exists in the entry, the function merges the value specified and returns
LDAP_SUCCESS. If the attribute is not found in the entry, the function creates it with the
Slapi_Value specified and returns LDAP_NO_SUCH_ATTRIBUTE.
If this function fails, it leaves the values for type within a pointer to e in an indeterminate state.
The present valueset may be truncated.
rc = delete_values_sv_internal( e, type, vals, 1 /* Ignore Errors */ );
Syntax
#include "slapi-plugin.h"
int slapi_entry_merge_values_sv( Slapi_Entry *e, const
char *type, Slapi_Value **vals );
Parameters This function takes the following parameters:
Entry into which you want to merge values.
e
Attribute type that contains the values you want to merge.
type
Values that you want to merge into the entry. Values are of type Slapi_Value.vals
Returns This function returns one of the following values:
LDAP_SUCCESS.
LDAP_NO_SUCH_ATTRIBUTE.
Memory concerns This function makes a copy of vals. vals can be NULL.
24.41 slapi_entry_next_attr()
Finds the next attribute after prevattr in an entry. To iterate through the attributes in an entry,
use this function in conjunction with the “slapi_entry_first_attr()” function.
Syntax
#include "slapi-plugin.h"
int slapi_entry_next_attr( const Slapi_Entry *e,
Slapi_Attr *prevattr, Slapi_Attr **attr );
Parameters This function takes the following parameters:
Entry from which you want to get the attribute.
e
Previous attribute in the entry.
prevattr
Pointer to the next attribute after prevattr in the entry.attr
Returns This function returns one of the following values:
0 If successful.
-1
If prevattr was the last attribute in the entry.
228 Functions for managing entries