2 * abandon.c - tcl abandon routine
4 * Copyright 1999, Ben Collins <bcollins@debian.org>, All rights reserved.
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
23 int tcl_back_abandon (
30 char *suf_tcl, *results, *command;
32 struct tclinfo *ti = (struct tclinfo *) be->be_private;
34 if (ti->ti_abandon == NULL) {
38 for ( i = 0; be->be_suffix[i] != NULL; i++ )
40 suf_tcl = Tcl_Merge(i, be->be_suffix);
42 command = (char *) ch_malloc (strlen(ti->ti_abandon) + strlen(suf_tcl)
44 sprintf(command, "%s ABANDON {%ld} {%s}",
45 ti->ti_abandon, op->o_msgid, suf_tcl);
48 ldap_pvt_thread_mutex_lock( &tcl_interpreter_mutex );
49 code = Tcl_GlobalEval(ti->ti_ii->interp, command);
50 results = (char *) strdup(ti->ti_ii->interp->result);
51 ldap_pvt_thread_mutex_unlock( &tcl_interpreter_mutex );
55 Debug(LDAP_DEBUG_ANY, "tcl_abandon_error: %s\n", results, 0, 0);