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