libsmbconf: don't mark the API as "subject to change" any longer.
[Samba/bjacke.git] / source / lib / smbconf / smbconf.h
blobc04be7f9816f3d15f1ee7c2f473ab5e00570f292
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_H__
21 #define __LIBSMBCONF_H__
23 struct smbconf_ctx;
25 /* the change sequence number */
26 struct smbconf_csn {
27 uint64_t csn;
31 * initialization functions for the available modules
32 * (a dispatcher might be added in the future)
34 WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
35 const char *path);
37 WERROR smbconf_init_txt_simple(TALLOC_CTX *mem_ctx,
38 struct smbconf_ctx **conf_ctx,
39 const char *path,
40 bool verbatim);
43 * the smbconf API functions
45 void smbconf_shutdown(struct smbconf_ctx *ctx);
46 bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
47 const char *service, const char *param);
48 WERROR smbconf_drop(struct smbconf_ctx *ctx);
49 WERROR smbconf_get_config(struct smbconf_ctx *ctx,
50 TALLOC_CTX *mem_ctx,
51 uint32_t *num_shares,
52 char ***share_names, uint32_t **num_params,
53 char ****param_names, char ****param_values);
54 WERROR smbconf_get_share_names(struct smbconf_ctx *ctx,
55 TALLOC_CTX *mem_ctx,
56 uint32_t *num_shares,
57 char ***share_names);
58 bool smbconf_share_exists(struct smbconf_ctx *ctx, const char *servicename);
59 WERROR smbconf_create_share(struct smbconf_ctx *ctx, const char *servicename);
60 WERROR smbconf_get_share(struct smbconf_ctx *ctx,
61 TALLOC_CTX *mem_ctx,
62 const char *servicename, uint32_t *num_params,
63 char ***param_names, char ***param_values);
64 WERROR smbconf_delete_share(struct smbconf_ctx *ctx,
65 const char *servicename);
66 WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
67 const char *service,
68 const char *param,
69 const char *valstr);
70 WERROR smbconf_set_global_parameter(struct smbconf_ctx *ctx,
71 const char *param, const char *val);
72 WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
73 TALLOC_CTX *mem_ctx,
74 const char *service,
75 const char *param,
76 char **valstr);
77 WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
78 TALLOC_CTX *mem_ctx,
79 const char *param,
80 char **valstr);
81 WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
82 const char *service, const char *param);
83 WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
84 const char *param);
85 WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
86 TALLOC_CTX *mem_ctx,
87 const char *service,
88 uint32_t *num_includes, char ***includes);
89 WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx,
90 TALLOC_CTX *mem_ctx,
91 uint32_t *num_includes, char ***includes);
92 WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
93 const char *service,
94 uint32_t num_includes, const char **includes);
95 WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
96 uint32_t num_includes,
97 const char **includes);
98 WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service);
99 WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx);
101 #endif /* _LIBSMBCONF_H_ */