Table of Contents | Previous | Next | Index

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

ldap_count_values_len()

The ldap_count_values_len() function returns the number of values in an array of berval structures. Use the ldap_count_values() function instead of this function if the array contains strings.

For additional information, see "Getting the Values of an Attribute" on page 131.

Syntax

#include <ldap.h>
int ldap_count_values_len( struct berval **vals );

Parameters

This function has the following parameters:

values

Array of berval structures.

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="jpegPhoto";
struct berval **bvals;
int count;
...
/* Get the values of the jpegPhoto attribute */
bvals = ldap_get_values_len( ld, e, a );
/* Count the values of the attribute */
count = ldap_count_values_len( vals );
...

See Also

ldap_count_values(), ldap_get_values_len().


Table of Contents | Previous | Next | Index

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