HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
46 Functions for managing computed attributes
This chapter contains reference information on computed-attribute routines.
Table 46-1 Routines for computed attributes
DescriptionFunction
Registers a function as an evaluator that the server will call to generate a
computed attribute.
“slapi_compute_add_evaluator()”
Registers callbacks for filter and search rewriting.“slapi_compute_add_search_rewriter()”
Call evaluator functions to see if there is a match with a search filter.“compute_rewrite_search_filter()”
46.1 slapi_compute_add_evaluator()
Description The slapi_compute_add_evaluator() function registers a function of the
slapi_compute_callback_t type as an evaluator of computed attributes.
Before the server sends an entry as a search result back to the client, the server determines if any
of the requested attributes are computed attributes and generates the values for those attributes.
To do this, the server calls each registered evaluator function for each individually requested
attribute. An evaluator function has the type slapi_compute_callback_t. If you want to set up
the server to generate the value of a computed attribute and send the attribute back with each
entry, you can define an evaluator function and register the function with the server by calling
the slapi_compute_add_evaluator() function.
Syntax
#include "slapi-plugin.h"
int slapi_compute_add_evaluator( slapi_compute_callback_t function);
Parameters This function takes the following parameter:
Function registered by the plug-in that will be used in evaluating the computed
attributes.
function
Returns This function returns one of the following values:
0 if the function is successfully registered.
ENOMEM if memory cannot be allocated to register this function.
46.2 slapi_compute_add_search_rewriter()
Description The slapi_compute_add_search_rewriter() function registers callback
functions for filter searching and rewriting.
Syntax
#include "slapi-plugin.h"
int slapi_compute_add_search_rewriter (slapi_search_rewrite_callback_t function);
Parameters This function takes the following parameter:
Function registered by the plug-in to rewrite the search filters.
function
Returns This function returns one of the following values:
-1 if no attribute matched the requested type
0 if one matched and it was processed without error
>0 if an error happened
46.1 slapi_compute_add_evaluator() 363