Chapter 43. Functions for Handling Valuesets

This chapter contains reference information on valueset routines.

Table 43.1. Valueset Routines

Function Description
slapi_valueset_add_value() Adds a Slapi_Value in the Slapi_ValueSet structure.
slapi_valueset_add_value_ext() Enables adding of a Slapi_Value in the Slapi_ValueSet structure without having to duplicate and free the target value.
slapi_valueset_count() Returns the number of values contained in a Slapi_ValueSet structure.
slapi_valueset_done() Frees the values contained in the Slapi_ValueSet structure.
slapi_valueset_find() Finds the value in a valueset using the syntax of an attribute.
slapi_valueset_first_value() Gets the first value of a Slapi_ValueSet structure.
slapi_valueset_free() Frees the specified Slapi_ValueSet structure and its members from memory.
slapi_valueset_init() Resets a Slapi_ValueSet structure to no values.
slapi_valueset_new() Allocates a new Slapi_ValueSet structure.
slapi_valueset_next_value() Gets the next value from a Slapi_ValueSet structure.
slapi_valueset_set_from_smod() Copies the values of Slapi_Mod structure into a Slapi_ValueSet structure.
slapi_valueset_set_valueset() Initializes a Slapi_ValueSet structure from another Slapi_ValueSet structure.

43.1. slapi_valueset_add_value()

Description

This function adds a value in the form of a Slapi_Value structure in a Slapi_ValueSet structure.

Syntax

#include "slapi-plugin.h"
void slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value *addval);

Parameters

This function takes the following parameters:

vs
Pointer to the Slapi_ValueSet structure to which to add the value.
addval
Pointer to the Slapi_Value to add to the Slapi_ValueSet.
Memory Concerns

The value is duplicated from the Slapi_Value structure, which can be freed from memory after using it without altering the Slapi_ValueSet structure.

This function does not verify if the value is already present in the Slapi_ValueSet structure. You can manually check this using slapi_valueset_first_value() and slapi_valueset_next_value().