Implement ldap_count_entries, ldap_count_references,

ldap_first_attribute*, ldap_first_entry, ldap_first_reference,
ldap_next_attribute*, ldap_next_entry and ldap_next_reference.
This commit is contained in:
Hans Leidekker 2005-08-30 08:52:39 +00:00 committed by Alexandre Julliard
parent 68f177364d
commit 880b1d3d51
3 changed files with 174 additions and 12 deletions

View File

@ -97,6 +97,96 @@ WLDAP32_LDAP *ldap_conn_from_msg( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
return ld; /* FIXME: not always correct */
}
ULONG WLDAP32_ldap_count_entries( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, res );
if (!ld) return ~0UL;
ret = ldap_count_entries( ld, res );
#endif
return ret;
}
ULONG WLDAP32_ldap_count_references( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
{
ULONG ret = LDAP_NOT_SUPPORTED;
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, res );
if (!ld) return 0;
ret = ldap_count_references( ld, res );
#endif
return ret;
}
PCHAR ldap_first_attributeA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, BerElement** ptr )
{
PCHAR ret = NULL;
#ifdef HAVE_LDAP
WCHAR *retW;
TRACE( "(%p, %p, %p)\n", ld, entry, ptr );
if (!ld || !entry) return NULL;
retW = ldap_first_attributeW( ld, entry, ptr );
ret = strWtoA( retW );
ldap_memfreeW( retW );
#endif
return ret;
}
PWCHAR ldap_first_attributeW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, BerElement** ptr )
{
PWCHAR ret = NULL;
#ifdef HAVE_LDAP
char *retU;
TRACE( "(%p, %p, %p)\n", ld, entry, ptr );
if (!ld || !entry) return NULL;
retU = ldap_first_attribute( ld, entry, ptr );
ret = strUtoW( retU );
ldap_memfree( retU );
#endif
return ret;
}
WLDAP32_LDAPMessage *WLDAP32_ldap_first_entry( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
{
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, res );
if (!ld || !res) return NULL;
return ldap_first_entry( ld, res );
#endif
return NULL;
}
WLDAP32_LDAPMessage *WLDAP32_ldap_first_reference( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res )
{
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, res );
if (!ld) return NULL;
return ldap_first_reference( ld, res );
#endif
return NULL;
}
void ldap_memfreeA( PCHAR block )
{
TRACE( "(%p)\n", block );
@ -121,6 +211,68 @@ ULONG WLDAP32_ldap_msgfree( WLDAP32_LDAPMessage *res )
return ret;
}
PCHAR ldap_next_attributeA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, BerElement *ptr )
{
PCHAR ret = NULL;
#ifdef HAVE_LDAP
WCHAR *retW;
TRACE( "(%p, %p, %p)\n", ld, entry, ptr );
if (!ld || !entry || !ptr) return NULL;
retW = ldap_next_attributeW( ld, entry, ptr );
ret = strWtoA( retW );
ldap_memfreeW( retW );
#endif
return ret;
}
PWCHAR ldap_next_attributeW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, BerElement *ptr )
{
PWCHAR ret = NULL;
#ifdef HAVE_LDAP
char *retU;
TRACE( "(%p, %p, %p)\n", ld, entry, ptr );
if (!ld || !entry || !ptr) return NULL;
retU = ldap_next_attribute( ld, entry, ptr );
ret = strUtoW( retU );
ldap_memfree( retU );
#endif
return ret;
}
WLDAP32_LDAPMessage *WLDAP32_ldap_next_entry( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry )
{
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, entry );
if (!ld || !entry) return NULL;
return ldap_next_entry( ld, entry );
#endif
return NULL;
}
WLDAP32_LDAPMessage *WLDAP32_ldap_next_reference( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry )
{
#ifdef HAVE_LDAP
TRACE( "(%p, %p)\n", ld, entry );
if (!ld || !entry) return NULL;
return ldap_next_reference( ld, entry );
#endif
return NULL;
}
ULONG WLDAP32_ldap_result( WLDAP32_LDAP *ld, ULONG msgid, ULONG all,
struct l_timeval *timeout, WLDAP32_LDAPMessage **res )
{

View File

@ -261,6 +261,8 @@ ULONG ldap_compare_sA(WLDAP32_LDAP*,PCHAR,PCHAR,PCHAR);
ULONG ldap_compare_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,PWCHAR);
ULONG ldap_connect(WLDAP32_LDAP*,LDAP_TIMEVAL*);
WLDAP32_LDAP *ldap_conn_from_msg(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG WLDAP32_ldap_count_entries(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG WLDAP32_ldap_count_references(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG ldap_count_valuesA(PCHAR*);
ULONG ldap_count_valuesW(PWCHAR*);
ULONG WLDAP32_ldap_count_values_len(PBERVAL*);
@ -284,6 +286,10 @@ ULONG ldap_extended_operation_sA(WLDAP32_LDAP*,PCHAR,struct WLDAP32_berval*,PLDA
PCHAR*,struct WLDAP32_berval**);
ULONG ldap_extended_operation_sW(WLDAP32_LDAP*,PWCHAR,struct WLDAP32_berval*,PLDAPControlW*, PLDAPControlW*,
PWCHAR*,struct WLDAP32_berval**);
PCHAR ldap_first_attributeA(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,BerElement**);
PWCHAR ldap_first_attributeW(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,BerElement**);
WLDAP32_LDAPMessage *WLDAP32_ldap_first_entry(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
WLDAP32_LDAPMessage *WLDAP32_ldap_first_reference(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
PCHAR ldap_get_dnA(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
PWCHAR ldap_get_dnW(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
ULONG ldap_get_optionA(WLDAP32_LDAP*,int,void*);
@ -313,6 +319,10 @@ ULONG ldap_modrdn2_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR,INT);
ULONG ldap_modrdn_sA(WLDAP32_LDAP*,PCHAR,PCHAR);
ULONG ldap_modrdn_sW(WLDAP32_LDAP*,PWCHAR,PWCHAR);
ULONG WLDAP32_ldap_msgfree(WLDAP32_LDAPMessage*);
PCHAR ldap_next_attributeA(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,BerElement*);
PWCHAR ldap_next_attributeW(WLDAP32_LDAP*,WLDAP32_LDAPMessage*,BerElement*);
WLDAP32_LDAPMessage *WLDAP32_ldap_next_entry(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
WLDAP32_LDAPMessage *WLDAP32_ldap_next_reference(WLDAP32_LDAP*,WLDAP32_LDAPMessage*);
WLDAP32_LDAP *ldap_openA(PCHAR,ULONG);
WLDAP32_LDAP *ldap_openW(PWCHAR,ULONG);
void WLDAP32_ldap_perror(WLDAP32_LDAP*,const PCHAR);

View File

@ -61,8 +61,8 @@
@ stub ldap_controls_free
@ stub ldap_controls_freeA
@ stub ldap_controls_freeW
@ stub ldap_count_entries
@ stub ldap_count_references
@ cdecl ldap_count_entries(ptr ptr) WLDAP32_ldap_count_entries
@ cdecl ldap_count_references(ptr ptr) WLDAP32_ldap_count_references
@ cdecl ldap_count_values(ptr) ldap_count_valuesA
@ cdecl ldap_count_valuesA(ptr)
@ cdecl ldap_count_valuesW(ptr)
@ -106,11 +106,11 @@
@ cdecl ldap_extended_operationW(ptr wstr ptr ptr ptr ptr)
@ cdecl ldap_extended_operation_sA(ptr str ptr ptr ptr ptr ptr)
@ cdecl ldap_extended_operation_sW(ptr wstr ptr ptr ptr ptr ptr)
@ stub ldap_first_attribute
@ stub ldap_first_attributeA
@ stub ldap_first_attributeW
@ stub ldap_first_entry
@ stub ldap_first_reference
@ cdecl ldap_first_attribute(ptr ptr ptr) ldap_first_attributeA
@ cdecl ldap_first_attributeA(ptr ptr ptr)
@ cdecl ldap_first_attributeW(ptr ptr ptr)
@ cdecl ldap_first_entry(ptr ptr) WLDAP32_ldap_first_entry
@ cdecl ldap_first_reference(ptr ptr) WLDAP32_ldap_first_reference
@ stub ldap_free_controls
@ stub ldap_free_controlsA
@ stub ldap_free_controlsW
@ -160,11 +160,11 @@
@ cdecl ldap_modrdn_sA(ptr str ptr)
@ cdecl ldap_modrdn_sW(ptr wstr ptr)
@ cdecl ldap_msgfree(ptr) WLDAP32_ldap_msgfree
@ stub ldap_next_attribute
@ stub ldap_next_attributeA
@ stub ldap_next_attributeW
@ stub ldap_next_entry
@ stub ldap_next_reference
@ cdecl ldap_next_attribute(ptr ptr ptr) ldap_next_attributeA
@ cdecl ldap_next_attributeA(ptr ptr ptr)
@ cdecl ldap_next_attributeW(ptr ptr ptr)
@ cdecl ldap_next_entry(ptr ptr) WLDAP32_ldap_next_entry
@ cdecl ldap_next_reference(ptr ptr) WLDAP32_ldap_next_reference
@ cdecl ldap_open(str long) ldap_openA
@ cdecl ldap_openA(str long)
@ cdecl ldap_openW(wstr long)