1LDAP_FIRST_ATTRIBUTE(3) Library Functions Manual LDAP_FIRST_ATTRIBUTE(3)
2
3
4
6 ldap_first_attribute, ldap_next_attribute - step through LDAP entry at‐
7 tributes
8
10 OpenLDAP LDAP (libldap, -lldap)
11
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
22 The ldap_first_attribute() and ldap_next_attribute() routines are used
23 to step through the attributes in an LDAP entry. ldap_first_attri‐
24 bute() takes an entry as returned by ldap_first_entry(3) or
25 ldap_next_entry(3) and returns a pointer to character string containing
26 the first attribute description in the entry. ldap_next_attribute()
27 returns the next attribute description in the entry.
28
29 It also returns, in berptr, a pointer to a BerElement it has allocated
30 to keep track of its current position. This pointer should be passed
31 to subsequent calls to ldap_next_attribute() and is used to effectively
32 step through the entry's attributes. The caller is solely responsible
33 for freeing the BerElement pointed to by berptr when it is no longer
34 needed by calling ber_free(3). When calling ber_free(3) in this in‐
35 stance, be sure the second argument is 0.
36
37 The attribute names returned are suitable for inclusion in a call to
38 ldap_get_values(3) to retrieve the attribute's values.
39
41 If an error occurs, NULL is returned and the ld_errno field in the ld
42 parameter is set to indicate the error. See ldap_error(3) for a de‐
43 scription of possible error codes.
44
46 The ldap_first_attribute() and ldap_next_attribute() return dynamically
47 allocated memory that must be freed by the caller via ldap_memfree(3).
48
50 ldap(3), ldap_first_entry(3), ldap_get_values(3), ldap_error(3)
51
53 OpenLDAP Software is developed and maintained by The OpenLDAP Project
54 <http://www.openldap.org/>. OpenLDAP Software is derived from the Uni‐
55 versity of Michigan LDAP 3.3 Release.
56
57
58
59OpenLDAP 2.4.57 2021/01/18 LDAP_FIRST_ATTRIBUTE(3)