ldap_first_message

Returns a pointer to the first message type, LDAP_RES_SEARCH_ENTRY, LDAP_RES_SEARCH_RESULT, or LDAP_RES_SEARCH_REFERENCE in a result chain.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  LDAPMessage *ldap_first_message (
     LDAP          *ld,
     LDAPMessage   *res);
  
  

Parameters

ld

(IN) Points to the handle for the LDAP session.

res

(IN) Points to the result chain returned by the ldap_result function or a synchronous search function.

Return Values

NULL

No more messages or failure

>0

Pointer to a message

Remarks

If ldap_first_message encounters an error, the function returns NULL and sets the LDAP_OPT_RESULT_CODE option in the LDAP session handle.

Use the ldap_count_messages function to determine the number of messages in the chain. Use the ldap_next_message function to retrieve subsequent messages.

See Also

ldap_next_message, ldap_count_messages, ldap_search, ldap_search_ext, ldap_search_ext_s, ldap_search_s, ldap_search_st