Lines Matching refs:objecttype
66 static int get_extension_block(int objecttype, void *object, struct slapi_extension_block **eblock, void **parent)
68 switch ((slapi_extension_t) objecttype) {
103 int objecttype, void *object, void *parent,
108 assert( objecttype < SLAPI_X_EXT_MAX );
109 assert( extensionhandle < registered_extensions.extensions[objecttype].count );
111 assert( registered_extensions.extensions[objecttype].constructors != NULL );
112 constructor = registered_extensions.extensions[objecttype].constructors[extensionhandle];
123 static void free_extension(struct slapi_extension_block *eblock, int objecttype, void *object, void *parent, int extensionhandle )
127 assert( objecttype < SLAPI_X_EXT_MAX );
128 assert( extensionhandle < registered_extensions.extensions[objecttype].count );
131 assert( registered_extensions.extensions[objecttype].destructors != NULL );
132 destructor = registered_extensions.extensions[objecttype].destructors[extensionhandle];
140 void *slapi_get_object_extension(int objecttype, void *object, int extensionhandle)
145 if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
149 if ( extensionhandle < registered_extensions.extensions[objecttype].count ) {
156 void slapi_set_object_extension(int objecttype, void *object, int extensionhandle, void *extension)
161 if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
165 if ( extensionhandle < registered_extensions.extensions[objecttype].count ) {
167 free_extension( eblock, objecttype, object, parent, extensionhandle );
179 int *objecttype,
194 *objecttype = (int)type;
196 re = ®istered_extensions.extensions[*objecttype];
231 int slapi_int_create_object_extensions(int objecttype, void *object)
238 switch ((slapi_extension_t) objecttype) {
255 if ( registered_extensions.extensions[objecttype].active == 0 ) {
260 registered_extensions.extensions[objecttype].active = 1;
266 if ( registered_extensions.extensions[objecttype].count ) {
267 eblock->extensions = (void **)slapi_ch_calloc( registered_extensions.extensions[objecttype].count, sizeof(void *) );
268 for ( i = 0; i < registered_extensions.extensions[objecttype].count; i++ ) {
269 new_extension( eblock, objecttype, object, parent, i );
280 int slapi_int_free_object_extensions(int objecttype, void *object)
287 switch ((slapi_extension_t) objecttype) {
304 for ( i = registered_extensions.extensions[objecttype].count - 1; i >= 0; --i ) {
305 free_extension( eblock, objecttype, object, parent, i );
317 int slapi_int_clear_object_extensions(int objecttype, void *object)
323 if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
332 for ( i = registered_extensions.extensions[objecttype].count - 1; i >= 0; --i ) {
333 free_extension( eblock, objecttype, object, parent, i );
336 for ( i = 0; i < registered_extensions.extensions[objecttype].count; i++ ) {
337 new_extension( eblock, objecttype, object, parent, i );