1 .TH LDAP_FIRST_MESSAGE 3 "19 September 2001" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2001 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_first_message, ldap_next_message, ldap_count_messages \- Stepping
7 through messages in a result chain
14 int ldap_count_messages( LDAP *ld, LDAPMessage *result )
17 LDAPMessage *ldap_first_message( LDAP *ld, LDAPMessage *result )
20 LDAPMessage *ldap_next_message( LDAP *ld, LDAPMessage *message )
23 These routines are used to step through the messages in a result chain
26 For search operations, the result chain can contain referral, entry
27 and result messages. The
29 function can be used to distinguish between the different message types.
32 .B ldap_first_message()
33 routine is used to retrieve the first message in a result chain.
34 It takes the \fIresult\fP as returned by a call to
38 .BR ldap_search_st (3)
39 and returns a pointer to the first message in the result chain.
41 This pointer should be supplied on a subsequent call to
42 .B ldap_next_message()
43 to get the next message, the result of which should be
44 supplied to the next call to
45 .BR ldap_next_message() ,
47 .B ldap_next_message()
48 will return NULL when there are no more messages.
50 These functions are useful when using routines like
51 .BR ldap_parse_result (3)
52 that only operate on the first result in the chain.
54 A count of the number of messages in the result chain can be obtained
56 .BR ldap_count_messages() .
57 It can also be used to count the number of remaining messages in a chain
58 if called with a message, entry or reference returned by
59 .B ldap_first_message() ,
60 .B ldap_next_message() ,
61 .BR ldap_first_entry (3) ,
62 .BR ldap_next_entry (3) ,
63 .BR ldap_first_reference (3) ,
64 .BR ldap_next_reference (3) .
67 .B ldap_first_message()
69 .BR ldap_next_message() ,
70 NULL is returned. If an error occurs in
71 .BR ldap_count_messages() ,
77 .BR ldap_parse_result(3),
78 .BR ldap_first_entry(3),
79 .BR ldap_first_reference(3)
82 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
84 is derived from University of Michigan LDAP 3.3 Release.