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

NAME

6       ldap_first_attribute,  ldap_next_attribute  -  step  through LDAP entry
7       attributes
8

LIBRARY

10       OpenLDAP LDAP (libldap, -lldap)
11

SYNOPSIS

13       #include <ldap.h>
14
15       char *ldap_first_attribute(
16            LDAP *ld, LDAPMessage *entry, BerElement **berptr )
17
18       char *ldap_next_attribute(
19            LDAP *ld, LDAPMessage *entry, BerElement *ber )
20

DESCRIPTION

22       The ldap_first_attribute() and ldap_next_attribute() routines are  used
23       to    step    through    the    attributes    in    an    LDAP   entry.
24       ldap_first_attribute()    takes    an    entry    as    returned     by
25       ldap_first_entry(3)  or  ldap_next_entry(3)  and  returns  a pointer to
26       character string containing the  first  attribute  description  in  the
27       entry.  ldap_next_attribute() returns the next attribute description in
28       the entry.
29
30       It also returns, in berptr, a pointer to a BerElement it has  allocated
31       to  keep  track of its current position.  This pointer should be passed
32       to subsequent calls to ldap_next_attribute() and is used to effectively
33       step  through the entry's attributes.  The caller is solely responsible
34       for freeing the BerElement pointed to by berptr when it  is  no  longer
35       needed  by  calling  ber_free(3).   When  calling  ber_free(3)  in this
36       instance, be sure the second argument is 0.
37
38       The attribute names returned are suitable for inclusion in  a  call  to
39       ldap_get_values(3) to retrieve the attribute's values.
40

ERRORS

42       If  an  error occurs, NULL is returned and the ld_errno field in the ld
43       parameter is set to  indicate  the  error.   See  ldap_error(3)  for  a
44       description of possible error codes.
45

NOTES

47       The ldap_first_attribute() and ldap_next_attribute() return dynamically
48       allocated memory that must be freed by the caller via ldap_memfree(3).
49

SEE ALSO

51       ldap(3), ldap_first_entry(3), ldap_get_values(3), ldap_error(3)
52

ACKNOWLEDGEMENTS

54       OpenLDAP Software is developed and maintained by The  OpenLDAP  Project
55       <http://www.openldap.org/>.  OpenLDAP Software is derived from the Uni‐
56       versity of Michigan LDAP 3.3 Release.
57
58
59
60OpenLDAP 2.4.47                   2018/12/19           LDAP_FIRST_ATTRIBUTE(3)
Impressum