1 .TH LDAP_FIRST_MESSAGE 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2004 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
9 OpenLDAP LDAP (libldap, -lldap)
16 int ldap_count_messages( LDAP *ld, LDAPMessage *result )
19 LDAPMessage *ldap_first_message( LDAP *ld, LDAPMessage *result )
22 LDAPMessage *ldap_next_message( LDAP *ld, LDAPMessage *message )
25 These routines are used to step through the messages in a result chain
28 For search operations, the result chain can contain referral, entry
29 and result messages. The
31 function can be used to distinguish between the different message types.
34 .B ldap_first_message()
35 routine is used to retrieve the first message in a result chain.
36 It takes the \fIresult\fP as returned by a call to
40 .BR ldap_search_st (3)
41 and returns a pointer to the first message in the result chain.
43 This pointer should be supplied on a subsequent call to
44 .B ldap_next_message()
45 to get the next message, the result of which should be
46 supplied to the next call to
47 .BR ldap_next_message() ,
49 .B ldap_next_message()
50 will return NULL when there are no more messages.
52 These functions are useful when using routines like
53 .BR ldap_parse_result (3)
54 that only operate on the first result in the chain.
56 A count of the number of messages in the result chain can be obtained
58 .BR ldap_count_messages() .
59 It can also be used to count the number of remaining messages in a chain
60 if called with a message, entry or reference returned by
61 .B ldap_first_message() ,
62 .B ldap_next_message() ,
63 .BR ldap_first_entry (3) ,
64 .BR ldap_next_entry (3) ,
65 .BR ldap_first_reference (3) ,
66 .BR ldap_next_reference (3) .
69 .B ldap_first_message()
71 .BR ldap_next_message() ,
72 NULL is returned. If an error occurs in
73 .BR ldap_count_messages() ,
79 .BR ldap_parse_result (3),
80 .BR ldap_first_entry (3),
81 .BR ldap_first_reference (3)
84 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
86 is derived from University of Michigan LDAP 3.3 Release.