]> git.sur5r.net Git - openldap/commitdiff
Moved tcl_back_db_open() and interpreter init to tcl_init.c
authorBen Collins <bcollins@openldap.org>
Wed, 17 Feb 1999 01:53:59 +0000 (01:53 +0000)
committerBen Collins <bcollins@openldap.org>
Wed, 17 Feb 1999 01:53:59 +0000 (01:53 +0000)
servers/slapd/back-tcl/tcl_config.c

index 9030be75afb164ca14d5fd9a31cf8973bcbac97c..2b083c9ef7a5dc3bc0aca81fb9a795902348a8ab 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_config.c,v 1.2 1999/02/16 23:30:36 bcollins Exp $
+ *
+ * $Log: tcl_config.c,v $
+ * Revision 1.2  1999/02/16 23:30:36  bcollins
+ * fixed exit()'s to be return()'s
  *
- * $Log$
  */
 
 #include "portable.h"
@@ -65,6 +68,7 @@ int tcl_back_db_config (
                ti->ti_ii = NULL;
 
                ii = global_i;
+               /* Try to see if it already exists */
                do {
                        if (ii != NULL && !strcasecmp (ii->name, argv[1]))
                        ti->ti_ii = ii;
@@ -72,15 +76,15 @@ int tcl_back_db_config (
                        ii = ii->next;
                } while (ii->next != NULL);
 
-               if (ti->ti_ii == NULL) {        /* we need to make a new one */
-                       ii->next = (struct i_info *) ch_malloc (sizeof (struct i_info));
+               if (ti->ti_ii == NULL) { /* we need to make a new one */
+                       ii->next = (struct i_info *) ch_malloc
+                               (sizeof (struct i_info));
 
                        ii->next->count = 0;
                        ii->next->name = (char *) strdup (argv[1]);
+                       ii->next->interp = NULL;
                        ii->next->next = NULL;
-                       ii->next->interp = Tcl_CreateInterp ();
-                       Tcl_Init (ii->next->interp);
-                       ti->ti_ii = ii;
+                       ti->ti_ii = ii->next;
                }
 
        /* proc for binds */
@@ -182,25 +186,6 @@ int tcl_back_db_config (
        return 0;
 }
 
-int tcl_back_db_open (
-       BackendDB * bd
-)
-{
-       struct tclinfo *ti = (struct tclinfo *) bd->be_private;
-
-       /* raise that count for the interpreter */
-       ti->ti_ii->count++;
-
-       /* now let's (try to) load the script */
-       readtclscript (ti->script_path, ti->ti_ii->interp);
-
-       /* Intall the debug command */
-       Tcl_CreateCommand( ti->ti_ii->interp, "ldap:debug", &tcl_ldap_debug,
-       NULL, NULL);
-
-       return 0;
-}
-
 void readtclscript (char *script, Tcl_Interp * my_tcl)
 {
        int code;