[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Why ldap_<first,next>_attribute ?



Hallvard B Furuseth wrote:
> 
> Why has Umich LDAP and ldap-c-api *two* functions
> ldap_first/next_attribute to get the attribute list, instead of just
>         char **ldap_get_attributes(LDAP *, LDAPMessage *)
> which would return a NULL-terminated array of attribute values?
> Can unneeded next_attribute take up much resources, or something?
> But then, I don't remember ever stopping halfway through an
> ldap_first/next_attribute walk anyway.
> 
> I'd like to see ldap_get_attributes above in the API.
> (Though admittedly it's not that hard to implement it by hand:-)


I don't think there is any special reason why the
ldap_first/next_attribute() approach was used instead of just returning
an array.  The implementation of a function like ldap_get_attributes()
is easy, as you say, but might be worth including in the API as a
convenience.  What do others think?

-- 
Mark Smith
Netscape Communications Corp. / Directory Server Engineering
"Got LDAP?"