s4:dlz_bind9: avoid some compiler warnings
[Samba.git] / lib / smbconf / smbconf_private.h
blobe768c30b91eb6cc7e685ad72156ae0fa0457732d
1 /*
2 * Unix SMB/CIFS implementation.
3 * libsmbconf - Samba configuration library
4 * Copyright (C) Michael Adam 2008
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef __LIBSMBCONF_PRIVATE_H__
21 #define __LIBSMBCONF_PRIVATE_H__
23 #ifndef GLOBAL_NAME
24 #define GLOBAL_NAME "global"
25 #endif
27 #include "lib/smbconf/smbconf.h"
29 struct smbconf_ops {
30 sbcErr (*init)(struct smbconf_ctx *ctx, const char *path);
31 int (*shutdown)(struct smbconf_ctx *ctx);
32 bool (*requires_messaging)(struct smbconf_ctx *ctx);
33 bool (*is_writeable)(struct smbconf_ctx *ctx);
34 sbcErr (*open_conf)(struct smbconf_ctx *ctx);
35 int (*close_conf)(struct smbconf_ctx *ctx);
36 void (*get_csn)(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
37 const char *service, const char *param);
38 sbcErr (*drop)(struct smbconf_ctx *ctx);
39 sbcErr (*get_share_names)(struct smbconf_ctx *ctx,
40 TALLOC_CTX *mem_ctx,
41 uint32_t *num_shares,
42 char ***share_names);
43 bool (*share_exists)(struct smbconf_ctx *ctx, const char *service);
44 sbcErr (*create_share)(struct smbconf_ctx *ctx, const char *service);
45 sbcErr (*get_share)(struct smbconf_ctx *ctx,
46 TALLOC_CTX *mem_ctx,
47 const char *servicename,
48 struct smbconf_service **service);
49 sbcErr (*delete_share)(struct smbconf_ctx *ctx,
50 const char *servicename);
51 sbcErr (*set_parameter)(struct smbconf_ctx *ctx,
52 const char *service,
53 const char *param,
54 const char *valstr);
55 sbcErr (*get_parameter)(struct smbconf_ctx *ctx,
56 TALLOC_CTX *mem_ctx,
57 const char *service,
58 const char *param,
59 char **valstr);
60 sbcErr (*delete_parameter)(struct smbconf_ctx *ctx,
61 const char *service, const char *param);
62 sbcErr (*get_includes)(struct smbconf_ctx *ctx,
63 TALLOC_CTX *mem_ctx,
64 const char *service,
65 uint32_t *num_includes, char ***includes);
66 sbcErr (*set_includes)(struct smbconf_ctx *ctx,
67 const char *service,
68 uint32_t num_includes, const char **includes);
69 sbcErr (*delete_includes)(struct smbconf_ctx *ctx,
70 const char *service);
71 sbcErr (*transaction_start)(struct smbconf_ctx *ctx);
72 sbcErr (*transaction_commit)(struct smbconf_ctx *ctx);
73 sbcErr (*transaction_cancel)(struct smbconf_ctx *ctx);
76 struct smbconf_ctx {
77 const char *path;
78 struct smbconf_ops *ops;
79 void *data; /* private data for use in backends */
82 sbcErr smbconf_init_internal(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
83 const char *path, struct smbconf_ops *ops);
85 sbcErr smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
86 char ***array,
87 uint32_t count,
88 const char *string);
90 bool smbconf_find_in_array(const char *string, char **list,
91 uint32_t num_entries, uint32_t *entry);
93 bool smbconf_reverse_find_in_array(const char *string, char **list,
94 uint32_t num_entries, uint32_t *entry);
96 #endif