1 .TH LDAP_GET_VALUES 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2009 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_get_values, ldap_get_values_len, ldap_count_values \- LDAP attribute value handling routines
8 OpenLDAP LDAP (libldap, -lldap)
16 char **ldap_get_values(ld, entry, attr)
23 struct berval **ldap_get_values_len(ld, entry, attr)
30 int ldap_count_values(vals)
35 int ldap_count_values_len(vals)
40 void ldap_value_free(vals)
45 void ldap_value_free_len(vals)
49 These routines are used to retrieve and manipulate attribute values
50 from an LDAP entry as returned by
51 .BR ldap_first_entry (3)
53 .BR ldap_next_entry (3).
55 takes the \fIentry\fP and the attribute \fIattr\fP
56 whose values are desired and returns a NULL-terminated array of the
57 attribute's values. \fIattr\fP may be an attribute type as returned
59 .BR ldap_first_attribute (3)
61 .BR ldap_next_attribute (3),
62 or if the attribute type is known it can simply be given.
64 The number of values in the array can be counted by calling
65 .BR ldap_count_values() .
66 The array of values returned can be freed by calling
67 .BR ldap_value_free() .
69 If the attribute values are binary in nature, and thus not suitable
70 to be returned as an array of char *'s, the
71 .B ldap_get_values_len()
72 routine can be used instead. It takes the same parameters as
73 .BR ldap_get_values() ,
74 but returns a NULL-terminated array of pointers
75 to berval structures, each containing the length of and a pointer
78 The number of values in the array can be counted by calling
79 .BR ldap_count_values_len() .
80 The array of values returned can be freed by calling
81 .BR ldap_value_free_len() .
86 .BR ldap_get_values_len() ,
87 NULL is returned and the
89 field in the \fIld\fP parameter is set to
90 indicate the error. See
92 for a description of possible error codes.
94 These routines dynamically allocate memory which the caller must free
95 using the supplied routines.
98 .BR ldap_first_entry (3),
99 .BR ldap_first_attribute (3),