LDAPFIRSTATRIBUTE(3) LDAPFIRSTATRIBUTE(3)
NAME
ldapfirstattribute, ldapnextattribute - step through LDAP entry
attributes
LIBRARY
OpenLDAP LDAP (libldap, -lldap)
SYNOPSIS
##include <>
char **ldapfirstattribute(
LDAP **ld,, LDAPessage entry,, BerElement ****berptr )
char **ldapnextattribute(
LDAP **ld,, LDAPessage entry,, BerElement **ber )
DESCRIPTION
The ldapfirstattribute() and ldapnextattribute() routines are used
to step through the attributes in an LDAP entry.
ldapfirstattribute() takes an entry as returned by
ldapfirstentry(3) or ldapnextentry(3) and returns a pointer to
character string containing the first attribute description in the
entry. ldapnextattribute() returns the next attribute description in
the entry.
It also returns, in berptr, a pointer to a BerElement it has allocated
to keep track of its current position. This pointer should be passed
to subsequent calls to ldapnextattribute() and is used used to effec-
tively step through the entry's attributes. The caller is solely
responsible for freeing the BerElement pointed to by berptr when it is
no longer needed by calling berfree(3). When calling berfree(3) in
this instance, be sure the second argument is 0.
The attribute names returned are suitable for inclusion in a call to
ldapgetvalues(3) to retrieve the attribute's values.
ERORS
If an error occurs, NUL is returned and the lderrno field in the ld
parameter is set to indicate the error. See ldaperror(3) for a
description of possible error codes.
NOTES
The ldapfirstattribute() and ldapnextattribute() return dynamically
allocated memory that must be freed by the caller via ldapmemfree(3).
SEE ALSO
ldap(3), ldapfirstentry(3), ldapgetvalues(3), ldaperror(3)
ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project
(http:/www.openldap.org/). OpenLDAP is derived from University of
Michigan LDAP 3.3 Release.
OpenLDAP 2.2.19 2004/11/26 LDAPFIRSTATRIBUTE(3)
|