Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_count_values()

The 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" on page 131.

Syntax

#include <ldap.h>
int ldap_count_values( char **values );

Parameters

This function has the following parameters:

values

Array of values.

Returns

One of the following values:

Example

The following section of code counts the number of values assigned to an attribute.

#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 );
...

See Also

ldap_count_values_len(), ldap_get_values().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23