1 .TH LDAP_RESULT 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_result \- Wait for the result of an LDAP operation
13 int ldap_result( LDAP *ld, int msgid, int all,
14 struct timeval *timeout, LDAPMessage **result );
16 int ldap_msgfree( LDAPMessage *msg );
18 int ldap_msgtype( LDAPMessage *msg );
20 int ldap_msgid( LDAPMessage *msg );
25 routine is used to wait for and return the result of
26 an operation previously initiated by one of the LDAP asynchronous
27 operation routines (e.g.,
30 etc.). Those routines all return -1 in case of error, and an
31 invocation identifier upon successful initiation of the operation. The
32 invocation identifier is picked by the library and is guaranteed to be
33 unique across the LDAP session. It can be used to request the result
34 of a specific operation from
36 through the \fImsgid\fP parameter.
40 routine will block or not, depending upon the setting
41 of the \fItimeout\fP parameter.
42 If timeout is not a NULL pointer, it specifies a maximum
43 interval to wait for the selection to complete. If timeout
44 is a NULL pointer, the select blocks indefinitely. To
45 effect a poll, the timeout argument should be a non-NULL
46 pointer, pointing to a zero-valued timeval structure. See
50 If the result of a specific operation is required, \fImsgid\fP should
51 be set to the invocation identifier returned when the operation was
52 initiated, otherwise LDAP_RES_ANY or LDAP_RES_UNSOLICITED should be
53 supplied to wait for any or unsolicited response.
55 The \fIall\fP parameter, if non-zero, causes
57 to return all responses with msgid, otherwise only the
58 next response is returned. This is commonly used to obtain all
59 the responses of a search operation.
61 A search response is made up of zero or
62 more search entries, zero or more search references, and zero or
63 more extended parital responses followed by a search result. If
64 \fIall\fP is set to 0, search entries will be returned one at a
65 time as they come in, via separate calls to
67 If it's set to 1, the search
68 response will only be returned in its entirety, i.e., after all entries,
69 all references, all extended parital responses, and the final search
70 result have been received.
72 Upon success, the type of the result received is returned and the
73 \fIresult\fP parameter will contain the result of the operation. This
74 result should be passed to the LDAP parsing routines,
75 .BR ldap_first_message (3)
76 and friends, for interpretation.
78 The possible result types returned are:
82 LDAP_RES_SEARCH_ENTRY (0x64)
83 LDAP_RES_SEARCH_REFERENCE (0x73)
84 LDAP_RES_SEARCH_RESULT (0x65)
85 LDAP_RES_MODIFY (0x67)
87 LDAP_RES_DELETE (0x6b)
89 LDAP_RES_COMPARE (0x6f)
90 LDAP_RES_EXTENDED (0x78)
91 LDAP_RES_EXTENDED_PARTIAL (0x79)
96 routine is used to free the memory allocated for
100 .BR ldap_search_s (3)
101 and friends. It takes
102 a pointer to the result to be freed and returns the type of the
107 routine returns the type of a message.
111 routine returns the message id of a message.
114 returns -1 if something bad happens, and zero if the
115 timeout specified was exceeded.
123 .BR ldap_first_message (3),
127 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
129 is derived from University of Michigan LDAP 3.3 Release.