MAN page from RedHat Other ldap-devel-3.3-3.i386.rpm
LDAP_RESULT
Section: C Library Functions (3)
Updated: 26 November 1994
Index NAME
ldap_result - Wait for the result of an LDAP operation
SYNOPSIS
#include <lber.h>#include <ldap.h>int ldap_result(ld, msgid, all, timeout, result)LDAP *ld;int msgid, all;struct timeval *timeout;LDAPMessage **result;int ldap_msgfree(msg)LDAPMessage *msg;
DESCRIPTION
The
ldap_result()routine is used to wait for and return the result ofan operation previously initiated by one of the LDAP asynchronousoperation routines (e.g.,
ldap_search(3),
ldap_modify(3),etc.). Those routines all return -1 in case of error, and aninvocation identifier upon successful initiation of the operation. Theinvocation identifier is picked by the library and is guaranteed to beunique across the LDAP session. It can be used to request the resultof a specific operation from
ldap_result()through the
msgid parameter.
Theldap_result()routine will block or not, depending upon the settingof the timeout parameter.If timeout is not a NULL pointer, it specifies a maximuminterval to wait for the selection to complete. If timeoutis a NULL pointer, the select blocks indefinitely. Toeffect a poll, the timeout argument should be a non-NULLpointer, pointing to a zero-valued timeval structure. Seeselect(2)for further details.
If the result of a specific operation is required, msgid shouldbe set to the invocation identifier returned when the operation wasinitiated, otherwise LDAP_RES_ANY should be supplied. The allparameter only has meaning for search responses and is used to selectwhether a single entry of the search response should be returned, orall results of the search should be returned.
A search response is made up of zero ormore search entries followed by a search result. If all is setto 0, search entries will be returned one at a time as they come in,via separate calls toldap_result().If it's set to 1, the searchresponse will only be returned in its entirety, i.e., after all entriesand the final search result have been received.
Upon success, the type of the result received is returned and theresult parameter will contain the result of the operation. Thisresult should be passed to the LDAP parsing routines,ldap_first_entry(3)and friends, for interpretation.
The possible result types returned are:
#define LDAP_RES_BIND 0x61L #define LDAP_RES_SEARCH_ENTRY 0x64L #define LDAP_RES_SEARCH_RESULT 0x65L #define LDAP_RES_MODIFY 0x67L #define LDAP_RES_ADD 0x69L #define LDAP_RES_DELETE 0x6bL #define LDAP_RES_MODRDN 0x6dL #define LDAP_RES_COMPARE 0x6fL
Theldap_msgfree()routine is used to free the memory allocated fora result byldap_result()orldap_search_s(3)and friends. It takesa pointer to the result to be freed and returns the type of themessage it freed.
ERRORS
ldap_result()returns -1 if something bad happens, and zero if thetimeout specified was exceeded.
NOTES
This routine mallocs memory for results that it receives. The memorycan be freed by calling
ldap_msgfree.
SEE ALSO
ldap(3),
ldap_search(3),
select(2)
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- ERRORS
- NOTES
- SEE ALSO
This document was created byman2html,using the manual pages.