LDAP_GET_VALUESSection: C Library Functions (3)Updated: 2004/06/10 |
LDAP_GET_VALUESSection: C Library Functions (3)Updated: 2004/06/10 |
#include <ldap.h> char **ldap_get_values(ld, entry, attr) LDAP *ld; LDAPMessage *entry; char *attr struct berval **ldap_get_values_len(ld, entry, attr) LDAP *ld; LDAPMessage *entry; char *attr ldap_count_values(vals) char **vals; ldap_count_values_len(vals) struct berval **vals; ldap_value_free(vals) char **vals; ldap_value_free_len(vals) struct berval **vals;
The number of values in the array can be counted by calling ldap_count_values(). The array of values returned can be freed by calling ldap_value_free().
If the attribute values are binary in nature, and thus not suitable to be returned as an array of char *'s, the ldap_get_values_len() routine can be used instead. It takes the same parameters as ldap_get_values(), but returns a NULL-terminated array of pointers to berval structures, each containing the length of and a pointer to a value.
The number of values in the array can be counted by calling ldap_count_values_len(). The array of values returned can be freed by calling ldap_value_free_len().