Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_delete_s()

Deletes an entry from the directory synchronously.

Note that this is an older function that is included in the LDAP API for backward-compatibility. If you are writing a new LDAP client, use ldap_delete_ext_s() instead.

Syntax

#include <ldap.h>
int ldap_delete_s(LDAP *ld, const char *dn);

Parameters

This function has the following parameters:

ld

Connection handle, which is a pointer to an LDAP structure containing information about the connection to the LDAP server.

dn

Distinguished name (DN) of the entry to remove.

Returns

For a list of possible result codes for an LDAP delete operation, see the result code documentation for the ldap_delete_ext_s() function.

Description

The ldap_delete_s() function removes an entry from the directory.

A newer version of this function, ldap_delete_ext_s(), is available in this release of the LDAP API. ldap_delete_s() (the older version of the function) is included only for backward-compatibility. If you are writing a new LDAP client, use ldap_delete_ext_s() instead of ldap_delete_s().

If you want more information on ldap_delete_s(), refer to the LDAP C SDK 1.0 Programmer's Guide.

Example

The following section of code uses the synchronous ldap_delete_s() function to delete the entry for Barbara Jensen from the directory.

#include <ldap.h>
LDAP *ld;
/* Distinguished name of the entry that you want to delete. */
char *dn = "uid=bjensen, ou=People, o=Airius.com";
...
/* Delete the entry */
if ( ldap_delete_s( ld, dn ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "ldap_delete_s" );
   return( 1 );
}
...

See Also

ldap_delete_ext_s().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23