Table of Contents | Previous | Next | Index

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

ldap_perror()

The ldap_perror() function prints the last LDAP error message to standard output. The routine precedes this error message with the text you supply as the s parameter. For more information, see "Printing Out Error Messages" on page 79.

Syntax

#include <ldap.h>
void ldap_perror( LDAP *ld, const char *s );

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.

s

Text to print out before printing the error message.

Example

The following section of code prints out an error message if the search operation cannot complete successfully.

...
if ( ldap_search_s( ld, my_searchbase, LDAP_SCOPE_SUBTREE, my_filter, 
   get_attr, 0, &result ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "ldap_search_s" );
   return( 1 );
...

See Also

ldap_get_lderrno(), ldap_err2string(), ldap_result2error(), ldap_set_lderrno().


Table of Contents | Previous | Next | Index

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