Initial Release 6

Function : LDAP
ldap_next_entry - Retrieve the next entry from a search result chain.
----------------------------------------------------------------------------------------------------------

#include <ldap.h>

LDAPMessage *LNPUBLIC ldap_next_entry(
LDAP *ld,
LDAPMessage *entry);

Description :

This function is used to step through and retrieve the list of entries from a search result chain.

Parameters :

Sample Usage :


    for ( e = ldap_first_entry( ld, result ); e != NULL;
          e = ldap_next_entry( ld, e ) )
    {
         if ( (sdn = ldap_get_dn( ld, e )) != NULL )
         {
             printf( "\tdn: %s\n", sdn );
             ldap_memfree( sdn );
         }
         for ( a = ldap_first_attribute( ld, e, &ber );
               a != NULL; a = ldap_next_attribute( ld, e, ber ) )
         {
             if ((vals = ldap_get_values( ld, e, a)) != NULL )
             {
                 for ( j = 0; vals[j] != NULL; j++ )
                 {
                     printf( "\t%s: %s\n", a, vals[j] );
                 }
                 ldap_value_free( vals );
             }
             ldap_memfree(a);
         }
         ber_free(ber, 0);
    }
    ldap_msgfree( result );


See Also :

ldap_count_entries
----------------------------------------------------------------------------------------------------------