Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_next_attribute()

The ldap_next_attribute() function returns the name of the next attribute in a entry returned by ldap_first_entry() or ldap_next_entry().

The ldap_next_attribute() function also returns a pointer to a BerElement. This pointer is freed by ldap_next_attribute() when there are no more attributes (that is, when ldap_next_attribute() returns NULL). If you do not iterate through all of the attributes, you need to free the BerElement by calling ldap_ber_free(). When calling ldap_ber_free(), make sure to specify that the buffer is not freed (pass 0 for the freebuf parameter).

For more information, see "Getting Attributes from an Entry" on page 129.

Syntax

#include <ldap.h>
char * ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
   BerElement *ber);

Parameters

This function has the following parameters:

ld

Connection handle, which is a pointer to an LDAP structure containing information about the connection to the LDAP server.

entry

Pointer to the LDAPMessage structure representing the entry returned by the ldap_first_entry() or ldap_next_entry() function.

ber

A pointer to a BerElement allocated to keep track of its current position. Pass this pointer to subsequent calls to ldap_next_attribute() to step through the entry's attributes.

Returns

One of the following values:

Example

See the example under ldap_first_attribute().

See Also

ldap_first_attribute(), ldap_getfirstfilter(), ldap_next_entry().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23