Chapter 46. Functions for Managing Computed Attributes

This chapter contains reference information on computed-attribute routines.

Table 46.1. Routines for Computed Attributes

Function Description
slapi_compute_add_evaluator() Registers a function as an evaluator that the server will call to generate a computed attribute.
slapi_compute_add_search_rewriter() Registers callbacks for filter and search rewriting.
compute_rewrite_search_filter() Call evaluator functions to see if there is a match with a 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
Function registered by the plug-in that will be used in evaluating the computed attributes.
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.