ldap_count_entries()--Retrieve Count of LDAP Entries




Syntax

#include <ldap.h>
 
int ldap_count_entries(
       LDAP           *ld,
       LDAPMessage    *result)




Threadsafe: Yes

The ldap_count_entries() API returns the number of entries contained in a search result chain. It can also be used to count the number of entries that remain in a chain if called with a message, entry or continuation reference returned by ldap_first_message(), ldap_next_message(), ldap_first_entry(), ldap_next_entry(), ldap_first_reference() or ldap_next_reference(), respectively.

Authorities and Locks

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(),ldap_ssl_init(), or ldap_open().

result
(Input) Specifies the result returned by a call to ldap_result() or by one of synchronous search routines (ldap_search_s() or ldap_search_st()).

Return Value

Number of Entries
if the request is successful, ldap_count_entry() returns the number of entries contained in a search result chain. It can also be used to count the number of entries that remain in a chain if called with a message, entry or continuation reference.
-1
if the request was not successful.

Error Conditions

If ldap_count_entry() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() function to retrieve the error information.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_count_entry API.

Related Information

    ldap_first_entry() -- Return first entry in a chain of search results.
    ldap_next_entry() -- Return next entry in a chain of search results.
    ldap_get_entry_controls_np() -- Extract server controls from an entry.
    ldap_first_reference() -- Return first continuation reference in a chain of search results.
    ldap_next_reference() -- Return next continuation reference in a chain of search results.
    ldap_count_references() -- Return number of continuation reference in a chain of search results.
    ldap_parse_reference_np() -- Extract information from a continuation reference.


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]