Chapter 48. Functions for Registering and Unregistering Object Extensions

This chapter contains reference information on routines for registering object extensions. This set of functions provides a means for extending core server objects; this functionality is provided so that you can efficiently pass state information between plug-in calls. Typically, a plug-in might register both a pre-operation and post-operation call. It is very convenient for the plug-in to associate its private data with the operation object that is passed through the parameter block.

Table 48.1. Routines for Registering Object Extensions

Function Description
slapi_get_object_extension() Retrieves a pointer to the plug-in extension.
slapi_register_object_extension() Registers a plug-in's object extension.
slapi_set_object_extension() Changes a plug-in's object extension.

48.1. slapi_get_object_extension()

Description

A plug-in retrieves a pointer to its own extension by calling slapi_get_object_extension with the object from which the extension is to be retrieved. The factory uses objecttype to find the offset into the object where the extension block is stored. The extension handle is then used to find the appropriate extension within the block.

Syntax

#include "slapi-plugin.h"
void *slapi_get_object_extension(int objecttype, void *object, int extensionhandle);

Parameters

This function takes the following parameters:

objecttype
The object type handle that was returned from the slapi_register_object_extension() call.
object
A pointer to the core server object from which the extension is to be retrieved.
extensionhandle
The extension handle that was returned from the slapi_register_object_extension() call.
Returns

This function returns a pointer to the plug-in's extension.