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