NAME
ldapgetvalues, ldapgetvalueslen, ldapcountvalues - LDAP
attribute value handling routines LLIIBBRRAARRYYOpenLDAP LDAP (libldap, -lldap)
SYNOPSIS
##iinncclluuddee <
cchhaarr ****llddaappggeettvvaalluueess((lldd,, eennttrryy,, aattttrr)) LDAP *ld; LDAPMessage *entry; char *attr ssttrruucctt bbeerrvvaall ****llddaappggeettvvaalluueesslleenn((lldd,, eennttrryy,, aattttrr)) LDAP *ld; LDAPMessage *entry; char *attr llddaappccoouunnttvvaalluueess((vvaallss)) char **vals; llddaappccoouunnttvvaalluueesslleenn((vvaallss)) struct berval **vals; llddaappvvaalluueeffrreeee((vvaallss)) char **vals; llddaappvvaalluueeffrreeeelleenn((vvaallss)) struct berval **vals;> DESCRIPTION
These routines are used to retrieve and manipulate attribute values from an LDAP entry as returned by llddaappffiirrsstteennttrryy(3) or llddaappnneexxtteennttrryy(3). llddaappggeettvvaalluueess(()) takes the entry and theattribute attr whose values are desired and returns a NULL-terminated
array of the attribute's values. attr may be an attribute type as returned from llddaappffiirrssttaattttrriibbuuttee(3) or llddaappnneexxttaattttrriibbuuttee(3), or if the attribute type is known it can simply be given. The number of values in the array can be counted by calling llddaappccoouunnttvvaalluueess(()). The array of values returned can be freed by calling llddaappvvaalluueeffrreeee(()). If the attribute values are binary in nature, and thus not suitable to be returned as an array of char *'s, the llddaappggeettvvaalluueesslleenn(()) routinecan be used instead. It takes the same parameters as llddaappggeettvvaall-
uueess(()), but returns a NULL-terminated array of pointers to berval struc-
tures, each containing the length of and a pointer to a value. The number of values in the array can be counted by calling llddaappccoouunnttvvaalluueesslleenn(()). The array of values returned can be freed by calling llddaappvvaalluueeffrreeeelleenn(()). EERRRROORRSS If an error occurs in llddaappggeettvvaalluueess(()) or llddaappggeettvvaalluueesslleenn(()), NULLis returned and the llddeerrrrnnoo field in the ld parameter is set to indi-
cate the error. See llddaappeerrrroorr(3) for a description of possible error codes. NNOOTTEESS These routines dynamically allocate memory which the caller must free using the supplied routines.SEE ALSO
llddaapp(3), llddaappffiirrsstteennttrryy(3), llddaappffiirrssttaattttrriibbuuttee(3), llddaappeerrrroorr(3) AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS OOppeennLLDDAAPP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OOppeennLLDDAAPP is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.2.19 2004/11/26 LDAPGETVALUES(3)