Sun Java System Directory Server Enterprise Edition 6.0 Developer's Guide

slapi_entry_merge_values_sv()

Merges (adds) an 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.

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 either LDAP_SUCCESS or LDAP_NO_SUCH_ATTRIBUTE .

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.

Notice that if this function fails, it leaves the values for type within a pointer to e in an indeterminate state. The present value set may be truncated.

Memory Concerns

This function makes a copy of vals. vals can be NULL.