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 Datatypes List



 slapi_compute_output_t
Reserved for future use.

slapi_compute_output_t specifies the prototype for a callback function. This function is passed to the slapi_compute_callback_t function.

Syntax

#include "slapi-plugin.h"
typedef int (*slapi_compute_output_t)
(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);

Parameters

The function has the following parameters:
c

Pointer to the computed_attr_context structure containing information relevant to the computed attribute.
a

Pointer to the Slapi_Attr structure representing the generated attribute.
e

Pointer to the Slapi_Entry structure representing the entry to be sent back to the client.

Returns. One of the following values:

Description

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.

For example:

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 created the computed

attribute and setting its values. */

rc = (*outputfn) (c, &my_computed_attr, e);

...

}

In the example above, the 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.

Note that you do not need to define outputfn yourself. You just need to call the function passed in as the last argument.

Example

[To be added]

See Also

 

© Copyright 1998 Netscape Communications Corporation