Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_mods_insert_at()

Inserts an LDAPMod anywhere in a Slapi_Mods.

Syntax

#include "slapi-plugin.h"
 void slapi_mods_insert_at(Slapi_Mods *smods, LDAPMod *mod, int pos);

Parameters

This function takes the following parameters:

smods

Pointer to an initialized Slapi_Mods.

mod

Pointer to the LDAPMod to be inserted.

pos

Position at which to insert the new mod. Minimum value is 0. Maximum value is the current number of mods .

Description

This function inserts an LDAPMod at a given position in Slapi_Mods. Position 0 (zero) refers to the first mod. A position equal to the current number of mods causes an append. mods at and above the specified position are moved up by one, and the given position refers to the newly inserted mod.

Memory Concerns

Responsibility for the LDAPMod is transferred to the Slapi_Mods.

This function must not be used on a Slapi_Mods initialized with slapi_mods_init_byref().