]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
Merge in all -devel changes made since branch was created.
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2
3 #include "portable.h"
4
5 #include <stdio.h>
6
7 #include <ac/socket.h>
8
9 #include "slap.h"
10 #include "shell.h"
11
12 #ifdef SLAPD_SHELL_DYNAMIC
13
14 int back_shell_LTX_init_module(int argc, char *argv[]) {
15     BackendInfo bi;
16
17     memset( &bi, 0, sizeof(bi) );
18     bi.bi_type = "shell";
19     bi.bi_init = shell_back_initialize;
20
21     backend_add(&bi);
22     return 0;
23 }
24
25 #endif /* SLAPD_SHELL_DYNAMIC */
26
27 int
28 shell_back_initialize(
29     BackendInfo *bi
30 )
31 {
32         bi->bi_open = 0;
33         bi->bi_config = 0;
34         bi->bi_close = 0;
35         bi->bi_destroy = 0;
36
37         bi->bi_db_init = shell_back_db_init;
38         bi->bi_db_config = shell_back_db_config;
39         bi->bi_db_open = 0;
40         bi->bi_db_close = 0;
41         bi->bi_db_destroy = shell_back_db_destroy;
42
43         bi->bi_op_bind = shell_back_bind;
44         bi->bi_op_unbind = shell_back_unbind;
45         bi->bi_op_search = shell_back_search;
46         bi->bi_op_compare = shell_back_compare;
47         bi->bi_op_modify = shell_back_modify;
48         bi->bi_op_modrdn = shell_back_modrdn;
49         bi->bi_op_add = shell_back_add;
50         bi->bi_op_delete = shell_back_delete;
51         bi->bi_op_abandon = shell_back_abandon;
52
53         bi->bi_acl_group = 0;
54
55         bi->bi_connection_init = 0;
56         bi->bi_connection_destroy = 0;
57
58         return 0;
59 }
60
61 int
62 shell_back_db_init(
63     Backend     *be
64 )
65 {
66         struct shellinfo        *si;
67
68         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
69
70         be->be_private = si;
71
72         return si == NULL;
73 }
74
75 int
76 shell_back_db_destroy(
77     Backend     *be
78 )
79 {
80         free( be->be_private );
81         return 0;
82 }