]> git.sur5r.net Git - openldap/blob - servers/slapd/back-perl/close.c
4ad62899ecc4f5e25108892bef7d10c0ffa95c08
[openldap] / servers / slapd / back-perl / close.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1999-2003 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 /*
7  *       Copyright 1999, John C. Quillan, All rights reserved.
8  *       Portions Copyright 2002, myinternet Limited. All rights reserved.
9  *
10  *       Redistribution and use in source and binary forms are permitted only
11  *       as authorized by the OpenLDAP Public License.  A copy of this
12  *       license is available at http://www.OpenLDAP.org/license.html or
13  *       in file LICENSE in the top-level directory of the distribution.
14  */
15
16 #include "portable.h"
17 /* init.c - initialize shell backend */
18         
19 #include <stdio.h>
20
21 #include "slap.h"
22 #ifdef HAVE_WIN32_ASPERL
23 #include "asperl_undefs.h"
24 #endif
25
26 #include <EXTERN.h>
27 #include <perl.h>
28
29 #include "perl_back.h"
30
31 /**********************************************************
32  *
33  * Close
34  *
35  **********************************************************/
36
37 int
38 perl_back_close(
39         BackendInfo *bd
40 )
41 {
42         ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );  
43
44         perl_destruct(PERL_INTERPRETER);
45
46         ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );        
47
48         return 0;
49 }
50
51 int
52 perl_back_destroy(
53         BackendInfo *bd
54 )
55 {
56         perl_free(PERL_INTERPRETER);
57         PERL_INTERPRETER = NULL;
58
59         ldap_pvt_thread_mutex_destroy( &perl_interpreter_mutex );       
60
61         return 0;
62 }
63
64 int
65 perl_back_db_destroy(
66         BackendDB *be
67 )
68 {
69         free( be->be_private );
70         be->be_private = NULL;
71
72         return 0;
73 }