14.17. slapi_compute_output_t
#include "slapi-plugin.h" typedef int (*slapi_compute_output_t) (computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);
The function has the following parameters:
One of the following values:
- 0 if the function successfully BER-encodes the computed attribute and adds it to the BER element to be sent to the client.
- An LDAP error code if an error occurred.
slapi_compute_output_t specifies the prototype for a callback function that BER-encodes a computed attribute and appends it to the BER element to be sent to the client. You do not need to define a function of this type. The server will pass a function of this type your slapi_compute_callback_t function. In your slapi_compute_callback_t function, you need to call this slapi_compute_output_t function.
static int my_compute_callback(computed_attr_context *c, char* type,
Slapi_Entry *e, slapi_compute_output_t outputfn)
{
...
int rc;
Slapi_Attr my_computed_attr;
...
/* Call the output function after creating the computed
attribute and setting its values. */
rc = (*outputfn) (c, &my_computed_attr, e);
...
}
slapi_compute_output_t function outputfn is passed in as an argument to my_compute_callback function. After generating the computed attribute, you need to call outputfn, passing it the context, the newly created attribute, and the entry. outputfn BER-encodes the attribute and appends it to the BER element to be sent to the client. You do not need to define outputfn yourself. You just need to call the function passed in as the last statement from the callback.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.