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
7       attribute 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
41       ldap_next_entry(3).   ldap_get_values()  takes  the   entry   and   the
42       attribute  attr  whose values are desired and returns a NULL-terminated
43       array of the attribute's values.  attr may  be  an  attribute  type  as
44       returned  from ldap_first_attribute(3) or ldap_next_attribute(3), or if
45       the attribute 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.4.50                   2020/04/28                LDAP_GET_VALUES(3)
Impressum