Table of Contents | Previous | Next | Index

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

ldap_parse_result()

Parses the results of an LDAP operation received from an LDAP server.

Syntax

#include <ldap.h>
int ldap_parse_result( LDAP *ld, LDAPMessage *res,
   int *errcodep, char **matcheddnp, char **errmsgp,
   char ***referralsp, LDAPControl ***serverctrlsp, int freeit);

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.

res

Pointer to the LDAPMessage structure containing the results of an LDAP operation.

errcodep

Pointer to the LDAP result code specifying the result of the operation.

matcheddnp

Pointer to a string specifying the portion of a DN that finds an existing entry (in cases where the server cannot find the entry specified by a DN). See "Receiving the Portion of the DN Matching an Entry" on page 73 for details.

When done, you can free this by calling the ldap_memfree() function.

errmsgp

Pointer to an additional error message string sent from the server.

When done, you can free this by calling the ldap_memfree() function.

referralsp

Pointer to an array of strings representing the referrals returned by the server.

When done, you can free this by calling the ldap_value_free() function.

serverctrlsp

Pointer to an array of LDAPControl structures, which represent the LDAP v3 server controls returned by the server.

When done, you can free this by calling the ldap_controls_free() function.

freeit

Specifies whether or not to automatically free the results of the operation (the LDAPMessage structure specified by the res argument). The parameter can have the following possible values:

Returns

One of the following values:

Description

The ldap_parse_result() function parses the results of an LDAP operation (received from an LDAP server) and retrieves the following information:

Calling this function creates an array of LDAPControl structures that you can pass to subsequent API functions (such as the ldap_parse_sort_control() function).

Note that this function is not intended to be used to parse entries and search references. (Use the ldap_msgtype() function to determine the type of result contained in the LDAPMessage structure.)

Example

See the examples in the following sections:

See Also

ldap_result().


Table of Contents | Previous | Next | Index

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