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:

e
Entry into which you want to merge values.
type
Attribute type that contains the values you want to merge.
vals
Values that you want to merge into the entry. Values are of type Slapi_Value.
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.