ldap_get_values_len()--Retrieve a Set of Binary Attribute Values
Syntax
#include <ldap.h>
struct berval {
unsigned long bv_len;
char *bv_val;
};
struct berval **ldap_get_values_len(
LDAP *ld,
LDAPMessage *entry,
const char *attr)
Default Public Authority: *USE
Library Name/Service Program: QSYS/QGLDCLNT
Threadsafe: Yes
The ldap_get_values_len() function is used to retrieve attribute values that are binary in nature from an LDAP entry as returned by ldap_first_entry() or ldap_next_entry().
The ldap_get_values_len() API uses 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. Use ldap_value_free_len() to free the returned attribute values when they are no longer needed.
Authorities and Locks
No IBM® i authority is required.
Parameters
- ld
- (Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
- entry
- (Input) Specifies an LDAP entry as returned from ldap_first_entry() or ldap_next_entry().
- attr
- (Input) Specifies the attribute whose values are desired.
Return Value
- NULL-terminated array of pointers to berval structures
- if the request was successful.
- NULL
- if the request was not successful.
Error Conditions
The ldap_get_values_len() API will return NULL and set the ld_errno error code if not successful. See LDAP Client API Error Conditions for possible LDAP error code values.
Error Messages
The following message may be sent from this function.
| Message ID | Error Message Text |
|---|---|
| CPF3CF2 E | Error(s) occurred during running of ldap_get_values_len API. |
Related Information
- ldap_get_values() -- Return an attribute's values.
- ldap_count_values() -- Return number of values.
- ldap_count_values_len() -- Return number of binary values.
- ldap_value_free() -- Free memory allocated by ldap_get_values().
- ldap_value_free_len() -- Free memory allocated by ldap_get_values_len().
API introduced: V4R3
[ Back to top | LDAP APIs | APIs by category ]