You can use the LDAP API to add and delete directory entries and to compare and modify values within existing entries. Any of these operations can be done either synchronously or asynchronously. Effective with LDAP 3, extensions to the add, delete, and modify functions allow you to perform these operations using controls. For more information, see Using Controls.
To make a change to a directory, first create an LDAPMod structure, assigning the appropriate values to each member of the structure. For multiple changes, or to add an entry, create a separate LDAPMod structure for each attribute or change. Pass these structures as an array when you call the modification function.