ldap_count_values() function returns the number of values in an array of strings. Use the ldap_count_values_len() function instead of this function if the array contains berval structures.
For additional information, see "Getting the Values of an Attribute".
Syntax
#include <ldap.h>
int ldap_count_values( char **values ); Parameters
This function has the following parameters:
values | Array of values. |
#include <ldap.h>
...
LDAP *ld;
LDAPMessage *e;
char *a="cn";
char **vals;
int count;
...
/* Get the values of the cn attribute */
vals = ldap_get_values( ld, e, a );
/* Count the values of the attribute */
count = ldap_count_values( vals );
...
ldap_count_values_len(), ldap_get_values().
Last modified: March 31, 1997
Copyright © 1997 Netscape
Communications Corporation