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

slapi_entry_attr_replace_sv()

Replaces the values of an attribute with the Slapi_Value data value you specify.

Syntax

#include "slapi-plugin.h"
 int slapi_entry_attr_replace_sv( Slapi_Entry *e, const char *type,
     Slapi_Value **vals );

Parameters

This function takes the following parameters:

e

Entry in which you want to replace values.

type

Attribute type which will receive the replaced values.

vals

Array containing the Slapi_Value values that should replace the existing values of the attribute.

Returns

This function returns 0 when successful; any other value returned signals failure.

Description

This function replaces existing attribute values in a specified entry with a single Slapi_Value data value. The function first deletes the existing attribute from the entry, then replaces it with the new value specified.

This function replaces the deprecated slapi_entry_attr_replace() function. This function uses Slapi_Value attribute values instead of the berval attribute values.

Memory Concerns

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