ldapGetValuesLen(3ibx) — Subroutines
NAME
ldapGetValuesLen − Returns an array of pointers (a vector) that point to structures that contain the length and content of binary attribute values.
SYNOPSIS
| #include <libldap.h> | ||
| LDAPBerval ∗∗ ldapGetValuesLen( | LDAP_t ∗ldap_handle, | |
| LDAPM_t ∗directory_entry, | ||
| char ∗attribute_name ); |
INPUT PARAMETERS
ldap_handleThe address of an LDAP handle.
directory_entryThe address of a directory entry, which was returned by a call to either the ldapFirstEntry or ldapNextEntry function.
attribute_nameA pointer to an attribute name, which was returned by a call to either the ldapFirstAttribute or ldapNextAttribute function.
DESCRIPTION
The ldapGetValuesLen function obtains attribute values for binary data. Since binary data does not end with a NULL pointer, you need to know the length of the data in order to read it. LDAP stores binary data (such as jpegPhoto photographs) in structures, whose two members are the length of the binary data in bytes and a pointer to the data itself.
Search through these pointers and access the binary data until you encounter a NULL address in the array of pointers. When you are finished reading the values, free the memory used by the array of pointers by calling the ldapValueFree function.
RETURNS
An array of pointers whose pointers point to structures. These structures have two members that contain the length of the binary data and a pointer to the actual data. The last item in the array of pointers is the NULL address. If the directory entry has no attribute values, this function returns NULL.
RELATED INFORMATION
Functions: ldapFirstAttribute(3), ldapGetValues(3), ldapNextAttribute(3), ldapValueFree(3).