]> git.sur5r.net Git - openldap/commitdiff
Completed open/close/destroy implementations
authorBen Collins <bcollins@openldap.org>
Wed, 17 Feb 1999 02:02:11 +0000 (02:02 +0000)
committerBen Collins <bcollins@openldap.org>
Wed, 17 Feb 1999 02:02:11 +0000 (02:02 +0000)
servers/slapd/back-tcl/tcl_close.c
servers/slapd/back-tcl/tcl_init.c

index 085a4e41c1939f596903e79eaa117cdedc101d2e..7f9726f684e23a11abffd5a2302efd40786d5059 100644 (file)
@@ -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 );
index f685c32759865a54c2d31f5fed63ede6493ce327..402676dc09bb6c1f326a1b97e0f8685041fd4126 100644 (file)
@@ -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