ldap_delete_ext() instead.
#include <ldap.h>
int ldap_delete( LDAP *ld, const char *dn );
ld |
Connection handle, which is a pointer to an |
dn |
ldap_delete() operation. To check the result of this operation, call ldap_result() and ldap_result2error(). For a list of the possible result codes for an LDAP delete operation, see the result code documentation for the ldap_delete_ext_s() function.
ldap_delete() function removes an entry from the directory.
A newer version of this function, ldap_delete_ext(), is available in this release of the LDAP API. ldap_delete() (the older version of the function) is included only for backward-compatibility. If you are writing a new LDAP client, use ldap_delete_ext() instead of ldap_delete().
If you want more information on ldap_delete(), refer to the LDAP C SDK 1.0 Programmer's Guide.
ldap_delete() function to remove the entry for "Barbara Jensen" from the directory.
#include <ldap.h>
...
LDAP *ld;
LDAPMessage *result;
int msgid, rc;
struct timeval tv;
/* Distinguished name of the entry that you want to delete. */
char *dn = "uid=bjensen, ou=People, o=Airius.com";
...
/* Set up the timeout period to wait for the "modify" operation */
tv.tv_sec = tv.tv_usec = 0;
/* Delete the entry */
if ( ( msgid = ldap_delete( ld, dn ) ) == -1 ) {ldap_perror( ld, "ldap_delete" );
return( 1 );
}
/* Check to see if the operation has completed */
while ( ( rc = ldap_result( ld, msgid, 0, &tv, &result ) ) == 0 ) {...
/* do other work while waiting for the operation to complete */
...
}
/* Check the result to see if any errors occurred */
ldap_result2error( ld, result, 1 );
ldap_perror( ld, "ldap_delete" );
...
ldap_delete_ext().
Last Updated: 10/01/98 17:06:23