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

Re: library questions: LDAPMessage, msgid, ...



LDAPMessage* foo;
ldap_search_s(ld, ..., &foo);
LDAPMessage* bar=ldap_first_entry(ld, foo);
ldap_msgfree(foo);

This destroys bar as well, right?  So I'll have to keep a reference to
foo along with bar to ensure foo isn't garbage collected while bar is
still in use.

How do I distinguish error from end-of-list with
ldap_{first,next}_entry?  Do I just check errcode after
ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &errcode)?

Also, judging by draft-ietf-ldapext-ldap-c-api-xx.txt, it seems this
is missing from ldap.h (in 2.1.22):
#define LDAP_OPT_RESULT_CODE LDAP_OPT_ERROR_NUMBER


paul