Complete Contents
Getting Started
Chapter 1 Understanding Server Plug-Ins
Chapter 2 Writing and Compiling Plug-Ins
Chapter 3 Calling the Front-End API Functions
Chapter 4 Quick Start
Chapter 5 Writing Database Plug-Ins
Chapter 6 Writing Pre/Post-Operation Plug-Ins
Chapter 7 Defining Functions for LDAP Operations
Chapter 8 Defining Functions for Database Operations
Chapter 9 Defining Functions for Authentication
Chapter 10 Writing Entry Store/Fetch Plug-Ins
Chapter 11 Writing Extended Operation Plug-Ins
Chapter 12 Writing Matching Rule Plug-Ins
Chapter 13 Data Type and Structure Reference
Chapter 14 Function Reference
Chapter 15 Parameter Reference
Glossary
Previous Next Contents Bookshelf Function List



 slapi_search_internal_callback()
Performs an LDAP search operation to search the directory from your plug-in. Unlike the slapi_search_internal() function, this function allows you to specify callback functions that are invoked when the search operation finds matching entries or entries with referrals.

Syntax

#include "slapi-plugin.h"
int slapi_search_internal_callback( char *ibase, int scope,
char *ifstr, char **attrs, int attrsonly,
void *callback_data, LDAPControl **controls,
plugin_result_callback prc,
plugin_search_entry_callback psec,
plugin_referral_entry_callback prec);

Parameters

The function has the following parameters:
ibase

Distinguished name (DN) of the entry that serves as the starting point for the search. For example, setting base to "o=Ace Industry, c=US" restricts the search to entries at Ace Industry in the United States.
scope

Scope of the search, which can be one of the following values:
ifstr

String representation of the filter to apply in the search.
attrs

A NULL-terminated array of attribute types to return from entries that match filter. If you specify a NULL, all attributes will be returned.
attrsonly

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

A pointer to data that you want passed to the callback functions specified by the prc, psec, and prec arguments.
controls

A NULL-terminated array of LDAP controls (see "LDAPControl" on page  193) that you want applied to the search operation.
prc

Callback function that the server calls to send result codes. The function must have the prototype specified by plugin_result_callback.
psec

Callback function that the server calls when finding a matching entry in the directory. The function must have the prototype specified by plugin_search_entry_callback.
prec

Callback function that the server calls when finding an entry that contains LDAP v3 referrals. The function must have the prototype specified by plugin_referral_entry_callback.

Returns. A new parameter block (see "Slapi_PBlock" on page  215) with the following parameters set:

When you are done working with the search results, you should free the results in the parameter block by calling the slapi_free_search_results_internal() function.

Description. Like the slapi_search_internal() function, the slapi_search_internal_callback() function allows you to search the directory from a plug-in function.

Unlike a search operation requested by a client, no result code, search entries, or referrals are sent to a client by slapi_search_internal_callback(). However, you can write your own callback functions that are invoked when these events occur:

You can also pass data to these callback functions. Specify the data that you want to pass as the callback_data argument of slapi_search_internal_callback().

The rest of the arguments for this function are similar to the arguments for the slapi_search_internal() function.

Example

[To be added]

See Also

 

© Copyright 1998 Netscape Communications Corporation