Created
March 21, 2010 10:27
-
-
Save thilko/339217 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from: http://www.ietf.org/rfc/rfc1823.txt | |
/* step through each entry returned */ | |
for ( e = ldap_first_entry( ld, res ); e != NULL; | |
e = ldap_next_entry( ld, e ) ) { | |
/* print each attribute */ | |
for ( a = ldap_first_attribute( ld, e, &ptr ); | |
a != NULL; | |
a = ldap_next_attribute( ld, e, ptr ) ) { | |
printf( "attribute: %s0, a ); | |
/* print each value */ | |
vals = ldap_get_values( ld, e, a ); | |
for ( i = 0; vals[i] != NULL; i++ ) { | |
printf( "value: %s0, vals[i] ); | |
} | |
ldap_value_free( vals ); | |
} | |
} | |
/* free the search results */ | |
ldap_msgfree( res ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment