]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-tcl/tcl_init.c
Free IDL_CACHE locks
[openldap] / servers / slapd / back-tcl / tcl_init.c
index 4af70c4e28576a75237b97f6e75360559a91549b..120f46ffb44450f33aed44972301cfc63cd6fcd6 100644 (file)
@@ -1,6 +1,5 @@
+/* $OpenLDAP$ */
 /* tcl_init.c - tcl backend initialization
- *
- * $Id: tcl_init.c,v 1.6 1999/03/03 16:02:10 hallvard Exp $
  *
  * Copyright 1999, Ben Collins <bcollins@debian.org>, All rights reserved.
  *
 
 ldap_pvt_thread_mutex_t tcl_interpreter_mutex;
 
+#ifdef SLAPD_TCL_DYNAMIC
+
+void back_tcl_LTX_init_module(int argc, char *argv[]) {
+   BackendInfo bi;
+
+   memset( &bi, '\0', sizeof(bi) );
+   bi.bi_type = "tcl";
+   bi.bi_init = tcl_back_initialize;
+
+   backend_add(&bi);
+}
+
+#endif /* SLAPD_TCL_DYNAMIC */
+
 int
 tcl_back_initialize (
        BackendInfo * bi
@@ -59,9 +72,7 @@ tcl_back_initialize (
        bi->bi_op_delete = tcl_back_delete;
        bi->bi_op_abandon = tcl_back_abandon;
 
-#ifdef SLAPD_ACLGROUPS
-       bi->bi_acl_group = 0;
-#endif
+       bi->bi_chk_referrals = 0;
 
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
@@ -98,19 +109,39 @@ tcl_back_db_init (
 
        ti = (struct tclinfo *) ch_calloc (1, sizeof (struct tclinfo));
 
+       ti->ti_script_path.bv_len = 0;
+       ti->ti_script_path.bv_val = NULL;
+
        /*
         * For some reason this causes problems
         * specifically set to NULL
         */
-       ti->ti_bind = NULL;
-       ti->ti_unbind = NULL;
-       ti->ti_search = NULL;
-       ti->ti_compare = NULL;
-       ti->ti_modify = NULL;
-       ti->ti_modrdn = NULL;
-       ti->ti_add = NULL;
-       ti->ti_delete = NULL;
-       ti->ti_abandon = NULL;
+       ti->ti_bind.bv_len = 0;
+       ti->ti_bind.bv_val = NULL;
+
+       ti->ti_unbind.bv_len = 0;
+       ti->ti_unbind.bv_val = NULL;
+
+       ti->ti_search.bv_len = 0;
+       ti->ti_search.bv_val = NULL;
+
+       ti->ti_compare.bv_len = 0;
+       ti->ti_compare.bv_val = NULL;
+
+       ti->ti_modify.bv_len = 0;
+       ti->ti_modify.bv_val = NULL;
+
+       ti->ti_modrdn.bv_len = 0;
+       ti->ti_modrdn.bv_val = NULL;
+
+       ti->ti_add.bv_len = 0;
+       ti->ti_add.bv_val = NULL;
+
+       ti->ti_delete.bv_len = 0;
+       ti->ti_delete.bv_val = NULL;
+
+       ti->ti_abandon.bv_len = 0;
+       ti->ti_abandon.bv_val = NULL;
 
        be->be_private = ti;
 
@@ -133,9 +164,9 @@ tcl_back_db_open (
        ti->ti_ii->count++;
 
        /* now let's (try to) load the script */
-       readtclscript (ti->script_path, ti->ti_ii->interp);
+       readtclscript (ti->ti_script_path.bv_val, ti->ti_ii->interp);
 
-       /* Intall the debug command */
+       /* install the debug command */
        Tcl_CreateCommand (ti->ti_ii->interp, "ldap:debug", &tcl_ldap_debug,
                NULL, NULL);