1LDAP_GET_VALUES(3)         Library Functions Manual         LDAP_GET_VALUES(3)
2
3
4

NAME

6       ldap_get_values,  ldap_get_values_len,  ldap_count_values - LDAP attri‐
7       bute value handling routines
8

LIBRARY

10       OpenLDAP LDAP (libldap, -lldap)
11

SYNOPSIS

13       #include <ldap.h>
14
15
16       char **ldap_get_values(ld, entry, attr)
17       LDAP *ld;
18       LDAPMessage *entry;
19       char *attr;
20
21       struct berval **ldap_get_values_len(ld, entry, attr)
22       LDAP *ld;
23       LDAPMessage *entry;
24       char *attr;
25
26       int ldap_count_values(vals)
27       char **vals;
28
29       int ldap_count_values_len(vals)
30       struct berval **vals;
31
32       void ldap_value_free(vals)
33       char **vals;
34
35       void ldap_value_free_len(vals)
36       struct berval **vals;
37

DESCRIPTION

39       These routines are used to retrieve  and  manipulate  attribute  values
40       from  an LDAP entry as returned by ldap_first_entry(3) or ldap_next_en‐
41       try(3).  ldap_get_values() takes the entry and the attribute attr whose
42       values  are  desired  and returns a NULL-terminated array of the attri‐
43       bute's values.   attr  may  be  an  attribute  type  as  returned  from
44       ldap_first_attribute(3)  or ldap_next_attribute(3), or if the attribute
45       type is known it can simply be given.
46
47       The  number  of  values  in  the  array  can  be  counted  by   calling
48       ldap_count_values().   The  array  of  values  returned can be freed by
49       calling ldap_value_free().
50
51       If the attribute values are binary in nature, and thus not suitable  to
52       be  returned as an array of char *'s, the ldap_get_values_len() routine
53       can be used instead.  It takes the  same  parameters  as  ldap_get_val‐
54       ues(), but returns a NULL-terminated array of pointers to berval struc‐
55       tures, each containing the length of and a pointer to a value.
56
57       The  number  of  values  in  the  array  can  be  counted  by   calling
58       ldap_count_values_len().   The array of values returned can be freed by
59       calling ldap_value_free_len().
60

ERRORS

62       If an error occurs in ldap_get_values() or ldap_get_values_len(),  NULL
63       is  returned and the ld_errno field in the ld parameter is set to indi‐
64       cate the error.  See ldap_error(3) for a description of possible  error
65       codes.
66

NOTES

68       These  routines  dynamically allocate memory which the caller must free
69       using the supplied routines.
70

SEE ALSO

72       ldap(3), ldap_first_entry(3), ldap_first_attribute(3), ldap_error(3)
73

ACKNOWLEDGEMENTS

75       OpenLDAP Software is developed and maintained by The  OpenLDAP  Project
76       <http://www.openldap.org/>.  OpenLDAP Software is derived from the Uni‐
77       versity of Michigan LDAP 3.3 Release.
78
79
80
81OpenLDAP 2.6.3                    2022/07/14                LDAP_GET_VALUES(3)
Impressum