ldap_first_message()--Retrieve First LDAP Message
Syntax
#include <ldap.h> LDAPMessage *ldap_first_message(LDAP *ld, LDAPMessage *result)
Library Name/Service Program: QSYS/QGLDCLNT
Default Public Authority: *USE
Threadsafe: Yes
The ldap_first_message() routine is used to step through the list of messages in a result chain, as returned by ldap_result(). It is used to return a pointer to the first message in the list.
Authorities and Locks
No IBM® i authority is required.
Parameters
- ld
- (Input) The LDAP pointer returned by a previous call to
ldap_init(),
ldap_ssl_init() , or
ldap_open().
- result
- (Input) The result returned by a call to ldap_result() or one of the synchronous search routines (ldap_search_s(), ldap_search_st(), or ldap_search_ext_s()).
Return Value
- LDAPMessage *
- Pointer to the first message.
- NULL
- when no message exists in the result set or if an error occurs.
Error Conditions
If ldap_first_message() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() function to retrieve the error information.
Error Messages
The following message may be sent from this function.
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of ldap_first_message API. |
Related Information
- ldap_count_messages() -- Return the number of message in a result chain.
- ldap_first_entry() -- Retrieve first LDAP entry.
- ldap_first_reference() -- Return first continuation reference in a chain of search results.
- ldap_msgfree() -- Free LDAP result message.
- ldap_msgid() -- Retrieve message ID associated with an LDAP message.
- ldap_msgtype() -- Retrieve type of an LDAP message.
- ldap_next_message() -- Retrieve next LDAP message.
- ldap_result2error() -- Retrieve LDAP error information
API introduced: V4R5
[ Back to top | LDAP APIs | APIs by category ]