ldap_count_values_len()--Retrieve Count of Binary Attribute Values




Syntax

#include <ldap.h>

struct berval {
	       unsigned long	bv_len;
	       char		*bv_val;
};
 
int ldap_count_values_len(
          struct berval **bvals)



Threadsafe: Yes

The ldap_count_values_len() function returns the number of values in the array returned by the ldap_get_values_len function. The array of values returned can be freed by calling ldap_value_free_len().

Authorities and Locks

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

bvals
(Input) Specifies a pointer to a null-terminated array of pointers to berval structures, as returned by ldap_get_values_len().

Return Value

Number of Values
if the request is successful, ldap_count_values_len() returns the number of values in the array returned by the ldap_get_values_len function.
-1
if the request was not successful.

Error Conditions

If ldap_count_values_len() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() function to retrieve the error information.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_count_values_len API.

Related Information

    ldap_get_values() -- Return an attribute's values.
    ldap_get_values_len() -- Return an attribute's binary values.
    ldap_count_values() -- Return number of values.
    ldap_value_free() -- Free memory allocated by ldap_get_values.
    ldap_value_free_len() -- Free memory allocated by ldap_get_values_len.


Top | LDAP APIs List | APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]