]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_compare.3
cleanup
[openldap] / doc / man / man3 / ldap_compare.3
1 .TH LDAP_COMPARE 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2006 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_compare, ldap_compare_s, ldap_compare_ext, ldap_compare_ext_s \- Perform an LDAP compare operation.
7 .SH LIBRARY
8 OpenLDAP LDAP (libldap, -lldap)
9 .SH SYNOPSIS
10 .nf
11 .ft B
12 #include <ldap.h>
13 .LP
14 .ft B
15 int ldap_compare_s(ld, dn, attr, value)
16 .ft
17 LDAP *ld;
18 char *dn, *attr, *value;
19 .LP
20 .ft B
21 int ldap_compare(ld, dn, attr, value)
22 .ft
23 LDAP *ld;
24 char *dn, *attr, *value;
25 .LP
26 .ft B
27 int ldap_compare_ext(ld, dn, attr, bvalue, serverctrls, clientctrls, msgidp)
28 .ft
29 LDAP *ld;
30 char *dn, *attr;
31 const struct berval *bvalue;
32 LDAPControl **serverctrls, **clientctrls;
33 int *msgidp;
34 .LP
35 .ft B
36 int ldap_compare_ext_s(ld, dn, attr, bvalue, serverctrls, clientctrls)
37 .ft
38 LDAP *ld;
39 char *dn, *attr;
40 const struct berval *bvalue;
41 LDAPControl **serverctrls, **clientctrls;
42 .SH DESCRIPTION
43 The
44 .B ldap_compare_s()
45 routine is used to perform an LDAP compare operation
46 synchronously.  It takes \fIdn\fP, the DN of the entry upon which to perform
47 the compare, and \fIattr\fP and \fIvalue\fP, the attribute type and value to
48 compare to those found in the entry.  It returns an LDAP error code, which
49 will be LDAP_COMPARE_TRUE if the entry contains the attribute value and
50 LDAP_COMPARE_FALSE if it does not.  Otherwise, some error code is returned.
51 .LP
52 The
53 .B ldap_compare()
54 routine is used to perform an LDAP compare operation
55 asynchronously.  It takes the same parameters as
56 .BR ldap_compare_s() ,
57 but returns the message id of the request it initiated.  The result of
58 the compare can be obtained by a subsequent call to
59 .BR ldap_result (3).
60 .LP
61 The
62 .B ldap_compare_ext()
63 routine  allows  server  and client controls to be 
64 specified to extend the compare request. This routine is asynchronous like 
65 ldap_compare(),  but its return value is an LDAP error code. It stores the 
66 message id of the request in the integer pointed to by msgidp.
67 .LP
68 The
69 .B ldap_compare_ext_s()
70 routine is the synchronous version of
71 .BR ldap_compare_ext().
72 It also returns an LDAP error code indicating success 
73 or failure of the operation.
74 .SH ERRORS
75 .B ldap_compare_s()
76 returns an LDAP error code which can be interpreted
77 by calling one of
78 .BR ldap_perror (3)
79 and friends.  ldap_compare() returns
80 -1 if something went wrong initiating the request.  It returns the
81 non-negative message id of the request if things went ok.
82 .LP
83 .B ldap_compare_ext_s()
84 and
85 .B ldap_compare_ext()
86 return some Non-zero value other than 0x05 or 0x06 in case of failure.
87 0x05 corresponds to LDAP_COMPARE_FALSE and 0x06 corresponds to LDAP_COMPARE_TRUE.
88 .SH BUGS
89 There is no way to compare binary values, but there should be.
90 .SH SEE ALSO
91 .BR ldap (3),
92 .BR ldap_error (3)
93 .SH ACKNOWLEDGEMENTS
94 .B OpenLDAP
95 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
96 .B OpenLDAP
97 is derived from University of Michigan LDAP 3.3 Release.