mldap_add

Listing Directory Functions (mldap)

Adds an entry to the LDAP directory.

int mldap_add( char *transaction, char *dn, <List of Attributes>, LAST );
transaction A transaction name for this step. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
dn A Distinguished Name entry. Use the following format: "DN=RDN1, RDN2,"...
List of Attributes DN entry attributes and values. To mark the end of an attribute, use the ENDITEM string.
LAST A marker indicating the end of the argument list.

The mldap_add function adds an entry to an LDAP directory.

This function is for use with global sessions. For multiple sessions, use the mldap_add_ex function, which allows you to specify a session identifier.

Return Values

If this function succeeds, it returns E_OK. Otherwise, it returns a negative value.

Parameterization

The following argument(s) can be parameterized with standard parameterization: dn

Example

In the following example, the mldap_add function adds an entry for Sally R. Jones, assigning a single value to each attribute.

mldap_add("LDAP Add",
         "DN=cn=Sally R. Jones,OU=Sales,OU=demo,DC=TECHNO,DC=com",
         "Name=givenName", "Value=Sally", ENDITEM,
         "Name=initials", "Value=R", ENDITEM,
         "Name=sn", "Value=Jones", ENDITEM,
         "Name=objectClass", "Value=contact", ENDITEM,
         LAST );

In the following example, the mldap_add function adds an entry for Sally R. Jones, assigning multiple values to an attribute.

mldap_add("LDAP Add",
         "DN=cn=Sally R. Jones,OU=Sales,OU=demo,DC=TECHNO,DC=com",
         "Name=initials", "Value=S", "Value=R", "Value=J", ENDITEM,
         "Name=objectClass", "Value=contact", ENDITEM,
         LAST );