1 .TH LDAP_GET_VALUES 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-1999 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
12 typedef struct berval {
18 char **ldap_get_values(ld, entry, attr)
25 struct berval **ldap_get_values_len(ld, entry, attr)
32 ldap_count_values(vals)
37 ldap_count_values_len(vals)
47 ldap_value_free_len(vals)
51 These routines are used to retrieve and manipulate attribute values
52 from an LDAP entry as returned by
53 .BR ldap_first_entry (3)
55 .BR ldap_next_entry (3).
57 takes the \fIentry\fP and the attribute \fIattr\fP
58 whose values are desired and returns a NULL-terminated array of the
59 attribute's values. \fIattr\fP may be an attribute type as returned
61 .BR ldap_first_attribute (3)
63 .BR ldap_next_attribute (3),
64 or if the attribute type is known it can simply be given.
66 The number of values in the array can be counted by calling
67 .BR ldap_count_values() .
68 The array of values returned can be freed by calling
69 .BR ldap_value_free() .
71 If the attribute values are binary in nature, and thus not suitable
72 to be returned as an array of char *'s, the
73 .B ldap_get_values_len()
74 routine can be used instead. It takes the same parameters as
75 .BR ldap_get_values() ,
76 but returns a NULL-terminated array of pointers
77 to berval structures, each containing the length of and a pointer
80 The number of values in the array can be counted by calling
81 .BR ldap_count_values_len() .
82 The array of values returned can be freed by calling
83 .BR ldap_value_free_len() .
88 .BR ldap_get_values_len() ,
89 NULL is returned and the
91 field in the \fIld\fP parameter is set to
92 indicate the error. See
94 for a description of possible error codes.
96 These routines dynamically allocate memory which the caller must free
97 using the supplied routines.
100 .BR ldap_first_entry(3),
101 .BR ldap_first_attribute(3),
105 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
107 is derived from University of Michigan LDAP 3.3 Release.