ldap_compare_ext_s() instead.
#include <ldap.h>
int ldap_compare_s( LDAP *ld, const char *dn, const char *attr,
const char *value );
ld |
Connection handle, which is a pointer to an |
dn | Distinguished name (DN) of the entry used in the comparison. |
attr | |
value | Value that you want to compare against the attribute values. |
ldap_compare_ext_s() function.
ldap_compare_s() function compares a value with the value of an attribute in an entry.
A newer version of this function, ldap_compare_ext_s(), is available in this release of the LDAP API. ldap_compare_s() (the older version of the function) is included only for backward-compatibility. If you are writing a new LDAP client, use ldap_compare_ext_s() instead of ldap_compare_s().
If you want more information on ldap_compare_s(), refer to the LDAP C SDK 1.0 Programmer's Guide.
#include <stdio.h>
#include <ldap.h>
LDAP *ld;
char *dn = "uid=bjensen, ou=People, o=Airius.com";
int has_value;
...
has_value = ldap_compare_s( ld, dn, "mail", "bjensen@airius.com" );
switch ( has_value ) {case LDAP_COMPARE_TRUE:
printf( "The mail attribute contains bjensen@airius.com.\n");
break;
case LDAP_COMPARE_FALSE:
printf( "The mail attribute does not contain bjensen@airius.com.\n");
break;
default:
ldap_perror( ld, "ldap_compare_s" );
return( 1 );
}
...
ldap_compare_ext_s().
Last Updated: 10/01/98 17:06:23