Table of Contents | Previous | Next | Index

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

ldap_msgid()

The ldap_msgid() function determines the message ID of a result obtained by calling ldap_result() or ldap_search_s().

Syntax

#include <ldap.h>
int ldap_msgid( LDAPMessage *lm );

Parameters

This function has the following parameters:

lm

ID of the result to check.

Returns

One of the following values:

Example

The following example prints the message ID from the result obtained from a synchronous LDAP search operation.

#include <stdio.h>
#include <ldap.h>
...
LDAP *ld; 
LDAPMessage *result; 
...
/* Perform a search */ 
if ( ldap_search_s( ld, MY_SEARCHBASE, LDAP_SCOPE_SUBTREE, MY_FILTER, 
      NULL, 0, &result ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "ldap_search_s" ); 
   return( 1 ); 
} 
/* Get and print the message ID */
if ( ldap_msgid( result ) != -1 ) { 
   printf( "Message ID: %d\n" ); 
} else { 
   printf( "An error occurred.\n" ); 
} 
...

See Also

ldap_msgtype(), ldap_result(), ldap_search_s().


Table of Contents | Previous | Next | Index

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