1 .TH LDAP_GET_VALUES 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2002 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
14 char **ldap_get_values(ld, entry, attr)
21 struct berval **ldap_get_values_len(ld, entry, attr)
28 ldap_count_values(vals)
33 ldap_count_values_len(vals)
43 ldap_value_free_len(vals)
47 These routines are used to retrieve and manipulate attribute values
48 from an LDAP entry as returned by
49 .BR ldap_first_entry (3)
51 .BR ldap_next_entry (3).
53 takes the \fIentry\fP and the attribute \fIattr\fP
54 whose values are desired and returns a NULL-terminated array of the
55 attribute's values. \fIattr\fP may be an attribute type as returned
57 .BR ldap_first_attribute (3)
59 .BR ldap_next_attribute (3),
60 or if the attribute type is known it can simply be given.
62 The number of values in the array can be counted by calling
63 .BR ldap_count_values() .
64 The array of values returned can be freed by calling
65 .BR ldap_value_free() .
67 If the attribute values are binary in nature, and thus not suitable
68 to be returned as an array of char *'s, the
69 .B ldap_get_values_len()
70 routine can be used instead. It takes the same parameters as
71 .BR ldap_get_values() ,
72 but returns a NULL-terminated array of pointers
73 to berval structures, each containing the length of and a pointer
76 The number of values in the array can be counted by calling
77 .BR ldap_count_values_len() .
78 The array of values returned can be freed by calling
79 .BR ldap_value_free_len() .
84 .BR ldap_get_values_len() ,
85 NULL is returned and the
87 field in the \fIld\fP parameter is set to
88 indicate the error. See
90 for a description of possible error codes.
92 These routines dynamically allocate memory which the caller must free
93 using the supplied routines.
96 .BR ldap_first_entry(3),
97 .BR ldap_first_attribute(3),
101 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
103 is derived from University of Michigan LDAP 3.3 Release.