ldap_compare(3ldap)
ldap_compare, ldap_compare_s --
LDAP compare operations
Synopsis
#include <lber.h>
#include <ldap.h>
int ldap_compare_s(LDAP
ld, char
dn, char
attr, char
value);
int ldap_compare(LDAP
ld, char
dn, char
attr, char
value);
Description
The ldap_compare_s routine is used to perform an LDAP
compare operation synchronously. It takes dn, the DN
of the entry upon which to perform the compare, and attr and
value, the attribute type and value with which those found in
the entry will be compared. It returns an LDAP error code, which
will be LDAP_COMPARE_TRUE if the entry contains the attribute
value, and LDAP_COMPARE_FALSE if it does not. Otherwise, some
other error code is returned.
The ldap_compare routine is used to perform an LDAP
compare operation asynchronously. It takes the same parameters as
ldap_compare_s, but returns the message ID of the
request it initiated. The result of the compare can be obtained by a
subsequent call to
ldap_result(3ldap).
Note that there is no way to compare binary values.
Return values
ldap_compare_s returns an LDAP error code which can be
interpreted by calling one of the routines documented on the
ldap_perror(3ldap)
manual page. ldap_compare returns -1 if initiating the request
fails. It returns the non-negative message ID of the request on
success.
References
Intro(3ldap),
ldap_perror(3ldap)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.