|
VMS Help LDAP, Search Results, Retrieving the Values of an Attribute *Conan The Librarian |
The ldap_get_values() and ldap_get_values_len() functions are
used to retrieve the values of a given attribute from an entry.
The ldap_count_values() and ldap_count_values_len() functions
are used to count the returned values. The ldap_value_free() and
ldap_value_free_len() functions are used to free the values.
char **ldap_get_values(
LDAP *ld,
LDAPMessage *entry,
char *attr
);
struct berval **ldap_get_values_len(
LDAP *ld,
LDAPMessage *entry,
char *attr
);
int ldap_count_values( char **vals )
int ldap_count_values_len( struct berval **vals );
void ldap_value_free( char **vals );
void ldap_value_free_len( struct berval **vals );
Parameters are as follows:
ld The session handle.
entry The entry from which to retrieve values, as returned by
ldap_first_entry() or ldap_next_entry().
attr The attribute whose values are to be retrieved, as returned
by ldap_first_attribute() or ldap_next_attribute(), or a
caller- supplied string (for example, "mail").
vals The values returned by a previous call to ldap_get_
values() or ldap_get_values_len().
Two forms of the various calls are provided. The first form is
only suitable for use with non-binary character string data. The
second _len form is used with any kind of data.
The ldap_get_values() and ldap_get_values_len() functions return
NULL if no values are found for attr or if an error occurs.
The ldap_count_values() and ldap_count_values_len() functions
return -1 if an error occurs such as the vals parameter being
invalid.
Note that the values returned are dynamically allocated and
should be freed by calling either ldap_value_free() or ldap_
value_free_len() when no longer in use.
|
|