2 * Copyright 1999, John C. Quillan, All rights reserved.
4 * Redistribution and use in source and binary forms are permitted only
5 * as authorized by the OpenLDAP Public License. A copy of this
6 * license is available at http://www.OpenLDAP.org/license.html or
7 * in file LICENSE in the top-level directory of the distribution.
11 /* init.c - initialize shell backend */
14 /* #include <ac/types.h>
15 #include <ac/socket.h>
23 #include "perl_back.h"
26 PerlInterpreter *perl_interpreter = NULL;
27 ldap_pvt_thread_mutex_t perl_interpreter_mutex;
30 /**********************************************************
34 **********************************************************/
41 char *embedding[] = { "", "-e", "0" };
43 if( perl_interpreter == NULL ) {
44 perl_interpreter = perl_alloc();
45 perl_construct(perl_interpreter);
46 perl_parse(perl_interpreter, NULL, 3, embedding, (char **)NULL);
47 perl_run(perl_interpreter);
49 ldap_pvt_thread_mutex_init( &perl_interpreter_mutex,
50 ldap_pvt_thread_mutexattr_default );
53 be->be_private = (PerlBackend *) ch_malloc( sizeof(PerlBackend) );
54 memset(&be->be_private, 0, sizeof(PerlBackend));
56 Debug( LDAP_DEBUG_ANY, "Here in perl backend\n", 0, 0, 0 );