HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
char *mail_values[] = { "bab@example.com" , NULL };
char *dn;
...
/* Identify the entry that you want changed */
dn = "cn=Barbara Jensen, ou=Product Development, l=US, dc=example,dc=com" ;
/* Specify that you want to replace the value of an attribute */
attribute1.mod_op = LDAP_MOD_REPLACE;
/* Specify that you want to change the value of the mail attribute */
attribute1.mod_type = "mail" ;
/* Specify the new value of the mail attribute */
attribute1.mod_values = mail_values;
/* Add the change to the list of attributes that you want changed */
list_of_attrs[0] = &attribute_change;
list_of_attrs[1] = NULL;
/* Update the entry with the change */
rcpb = slapi_modify_internal( dn, list_of_attrs, NULL, 1 );
...
Table 14-4 “Front end API functions for entry attribute changes” summarizes the functions
available to specify changes to an attribute in a directory entry.
Table 14-4 Front end API functions for entry attribute changes
Call this functionTo perform this action...
“slapi_entry2mods()”
Translate from entry to LDAPMod.
“slapi_mod_dump()”
Dump the contents of an LDAPMod to the server log.
“slapi_mod_get_ldapmod_byref()”
Get a reference to the LDAPMod in a Slapi_Mod structure.
“slapi_mod_get_ldapmod_passout()”
Retrieve the reference to the LDAPMod contained in a
Slapi_Mod structure.
Syntax This struct definition uses the following syntax:
typedef struct ldapmod {
int mod_op;
char *mod_type;
union mod_vals_u{
char **modv_strvals;
struct berval **modv_bvals;
} mod_vals;
#define mod_values mod_vals.modv_strvals
#define mod_bvalues mod_vals.modv_bvals
} LDAPMod;
Fields This struct definition contains the following fields:
14.4 LDAPMod 119