mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 02:29:34 -05:00
Moved tcl_back_db_open() and interpreter init to tcl_init.c
This commit is contained in:
parent
1d1e8f75b6
commit
78a5ebe216
1 changed files with 11 additions and 26 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue