Table of Contents | Previous | Next | Index

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

ldap_url_search_s()

The ldap_url_search_s() function searches the directory for matching entries, based on the contents of the URL.

ldap_url_search_s() is a synchronous function, which directly returns the results of the operation. If you want to perform other operations while waiting for the results of this operation, call the asynchronous function ldap_url_search() instead. (For more information on asynchronous and synchronous functions, see "Calling Synchronous and Asynchronous Functions" on page 80.)

For more information on processing LDAP searches specified as URLs, see "Processing an LDAP URL" on page 254.

Syntax

#include <ldap.h>
int ldap_url_search_s( LDAP *ld, char *url, int attrsonly,
   LDAPMessage **res );

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.

url

LDAP URL specifying a search of the directory.

attrsonly

Specifies whether or not attribute values are returned along with the attribute types. This parameter can have the following values:

res

Results of the search (when the call is completed).

Returns

One of the following values:

Example

The following example processes a search request from an LDAP URL.

#include <stdio.h>
#include <ldap.h>
...
LDAP *ld;
LDAPMessage *result;
char *my_url = "ldap://ldap.netscape.com/o=Airius.com?cn,mail,telephoneNumber?sub?(sn=Jensen)";
...
/* Process the search request in the URL */
if ( ldap_url_search_s( ld, my_url, 0, &result ) != LDAP_SUCCESS ) {
   ldap_perror( ld, "ldap_url_search_s" );
   return( 1 );
}
...

See Also

ldap_search(), ldap_search_st().


Table of Contents | Previous | Next | Index

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