HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Parameters This function takes the following parameters:
Pointer to an initialized Slapi_Mods with valid iterator position.mods
Pointer to the LDAPMod to be inserted.mod
Memory concerns The 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().
See also
“slapi_mods_get_first_mod()”
“slapi_mods_get_next_mod()”
33.46 slapi_mods_insert_smod_at()
Description This function inserts an smod at a given position pos in Slapi_Mods. Position 0
(zero) refers to the first smod. A position equal to the current number of smods(determined by
slapi_mods_get_num_mods() causes an appendsmod at and above the specified position
are moved up by one, and the given position refers to the newly inserted smod. Shift everything
down to make room to insert the new mod.
Syntax
#include "slapi-plugin.h"
void slapi_mods_insert_smod_at(Slapi_Mods *smods,
Slapi_Mod *smod, int pos);
Parameters This function takes the following parameters:
Pointer to an initialized Slapi_Mods.mods
Pointer to the LDAPMod to be inserted.smod
Position at which to insert the new mod. Minimum value is 0. Maximum value is the
current number of mods.
pos
Memory concerns Responsibility for the smod is transferred to the Slapi_Mods.
See also
“slapi_mods_insert_at()”
“slapi_mods_add_ldapmod()” adds to the end of all mods
33.47 slapi_mods_insert_smod_before()
Description This function inserts an smod immediately before the current position of the
Slapi_Mods iterator. The iterator position is unchanged.
Syntax
#include "slapi-plugin.h"
void slapi_mods_insert_smod_before(Slapi_Mods *smods,
Slapi_Mod *smod);
Parameters This function takes the following parameters:
Pointer to an initialized Slapi_Mods.mods
Pointer to the Slapi_Mod to be inserted.smod
Memory concerns The Slapi_Mod argument smod is not duplicated or copied, but the reference
of the Slapi_Mod(smods) is passed into the Slapi_Mods(smods) structure. The responsibility
for the smod is transferred to the Slapi_Mods.
282 Functions for LDAPMod manipulation