From 197e77ea8d9a47c29aef3855a7f2c0eac5cf469c Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Wed, 17 Feb 1999 02:02:11 +0000 Subject: [PATCH] Completed open/close/destroy implementations --- servers/slapd/back-tcl/tcl_close.c | 11 +++++++---- servers/slapd/back-tcl/tcl_init.c | 28 +++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/servers/slapd/back-tcl/tcl_close.c b/servers/slapd/back-tcl/tcl_close.c index 085a4e41c1..7f9726f684 100644 --- a/servers/slapd/back-tcl/tcl_close.c +++ b/servers/slapd/back-tcl/tcl_close.c @@ -8,9 +8,12 @@ * license is available at http://www.OpenLDAP.org/license.html or * in file LICENSE in the top-level directory of the distribution. * - * $Id$ + * $Id: tcl_close.c,v 1.2 1999/02/17 00:55:03 bcollins Exp $ + * + * $Log: tcl_close.c,v $ + * Revision 1.2 1999/02/17 00:55:03 bcollins + * Implemented all of the (db_)destroy and (db_)close functions * - * $Log$ */ #include "portable.h" @@ -26,8 +29,6 @@ tcl_back_close ( ) { Tcl_DeleteInterp(global_i->interp); - Tcl_Free(global_i->interp); - free(global_i); return( 0 ); } @@ -37,6 +38,8 @@ tcl_back_destroy( BackendInfo *bi ) { + Tcl_Free(global_i->interp); + free(global_i); ldap_pvt_thread_mutex_destroy( &tcl_interpreter_mutex ); return( 0 ); diff --git a/servers/slapd/back-tcl/tcl_init.c b/servers/slapd/back-tcl/tcl_init.c index f685c32759..402676dc09 100644 --- a/servers/slapd/back-tcl/tcl_init.c +++ b/servers/slapd/back-tcl/tcl_init.c @@ -8,9 +8,12 @@ * license is available at http://www.OpenLDAP.org/license.html or * in file LICENSE in the top-level directory of the distribution. * - * $Id$ + * $Id: tcl_init.c,v 1.2 1999/02/17 00:55:54 bcollins Exp $ + * + * $Log: tcl_init.c,v $ + * Revision 1.2 1999/02/17 00:55:54 bcollins + * Implemented the open, init functions correctly * - * $Log$ */ #include "portable.h" @@ -41,7 +44,7 @@ tcl_back_initialize( ldap_pvt_thread_mutex_init( &tcl_interpreter_mutex ); bi->bi_open = tcl_back_open; - bi->bi_config = tcl_back_config; + bi->bi_config = NULL; bi->bi_close = tcl_back_close; bi->bi_destroy = tcl_back_destroy; @@ -66,6 +69,25 @@ tcl_back_initialize( return 0; } +int +tcl_back_open( + BackendInfo *bi +) +{ + /* Initialize the global interpreter array */ + global_i = (struct i_info *) ch_malloc (sizeof (struct i_info)); + global_i->count = 0; + global_i->name = "default"; + global_i->next = NULL; + global_i->interp = Tcl_CreateInterp (); + Tcl_Init (global_i->interp); + + /* Initialize the global interpreter lock */ + ldap_pvt_thread_mutex_init( &tcl_interpreter_mutex ); + + return( 0 ); +} + int tcl_back_db_init( Backend *be -- 2.39.5