Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_register_object_extension()

Register an object extension.

Syntax

#include "slapi-plugin.h"
int slapi_register_object_extension(
    const char *pluginname,
    const char *objectname,
    slapi_extension_constructor_fnptr constructor,
    slapi_extension_destructor_fnptr destructor,
    int *objecttype,
    int *extensionhandle);

Parameters

This function takes the following parameters:

pluginname

String identifying the plug-in

objectname

Name of the object to extend such as SLAPI_EXT_CONNECTION to add private data to a connection or SLAPI_EXT_OPERATION to add private data to an operation

constructor

Constructor to allocate memory for the object extension and create the extension

destructor

Destructor to free memory used for the object extension

objecttype

Set by the server and used to retrieve the extension

extensionhandle

Set by the server and used to retrieve the extension

Description

This function registers an extension to an object such as a connection or an operation. This mechanism enables a plug-in to store private data with an operation that is passed from a preoperation to a postoperation plug-in for example, something not possible using parameter blocks.

Register object extensions as part of the plug-in initialization function.

Returns

This function returns 0 if successful. Otherwise, it returns -1.

See Also

slapi_extension_constructor_fnptr

slapi_extension_destructor_fnptr

slapi_get_object_extension()

slapi_set_object_extension()