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
13 typedef struct berval {
19 char **ldap_get_values(ld, entry, attr)
26 struct berval **ldap_get_values_len(ld, entry, attr)
33 ldap_count_values(vals)
38 ldap_count_values_len(vals)
48 ldap_value_free_len(vals)
52 These routines are used to retrieve and manipulate attribute values
53 from an LDAP entry as returned by
54 .BR ldap_first_entry (3)
56 .BR ldap_next_entry (3).
58 takes the \fIentry\fP and the attribute \fIattr\fP
59 whose values are desired and returns a NULL-terminated array of the
60 attribute's values. \fIattr\fP may be an attribute type as returned
62 .BR ldap_first_attribute (3)
64 .BR ldap_next_attribute (3),
65 or if the attribute type is known it can simply be given.
67 The number of values in the array can be counted by calling
68 .BR ldap_count_values() .
69 The array of values returned can be freed by calling
70 .BR ldap_value_free() .
72 If the attribute values are binary in nature, and thus not suitable
73 to be returned as an array of char *'s, the
74 .B ldap_get_values_len()
75 routine can be used instead. It takes the same parameters as
76 .BR ldap_get_values() ,
77 but returns a NULL-terminated array of pointers
78 to berval structures, each containing the length of and a pointer
81 The number of values in the array can be counted by calling
82 .BR ldap_count_values_len() .
83 The array of values returned can be freed by calling
84 .BR ldap_value_free_len() .
89 .BR ldap_get_values_len() ,
90 NULL is returned and the
92 field in the \fIld\fP parameter is set to
93 indicate the error. See
95 for a description of possible error codes.
97 These routines dynamically allocate memory which the caller must free
98 using the supplied routines.
101 .BR ldap_first_entry(3),
102 .BR ldap_first_attribute(3),
106 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
108 is derived from University of Michigan LDAP 3.3 Release.