libsmbconf: add a "path" variable to the conf context.
[Samba.git] / source / lib / smbconf / smbconf.h
blob23b95049712e8f19d31024fe674757f80c152a2c
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 * WARNING: this api is still subject to change.
35 * initialization functions for the available modules
36 * (a dispatcher might be added in the future)
38 WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
39 const char *path);
42 * the smbconf API functions
44 void smbconf_shutdown(struct smbconf_ctx *ctx);
45 bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
46 const char *service, const char *param);
47 WERROR smbconf_drop(struct smbconf_ctx *ctx);
48 WERROR smbconf_get_config(struct smbconf_ctx *ctx,
49 TALLOC_CTX *mem_ctx,
50 uint32_t *num_shares,
51 char ***share_names, uint32_t **num_params,
52 char ****param_names, char ****param_values);
53 WERROR smbconf_get_share_names(struct smbconf_ctx *ctx,
54 TALLOC_CTX *mem_ctx,
55 uint32_t *num_shares,
56 char ***share_names);
57 bool smbconf_share_exists(struct smbconf_ctx *ctx, const char *servicename);
58 WERROR smbconf_create_share(struct smbconf_ctx *ctx, const char *servicename);
59 WERROR smbconf_get_share(struct smbconf_ctx *ctx,
60 TALLOC_CTX *mem_ctx,
61 const char *servicename, uint32_t *num_params,
62 char ***param_names, char ***param_values);
63 WERROR smbconf_delete_share(struct smbconf_ctx *ctx,
64 const char *servicename);
65 WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
66 const char *service,
67 const char *param,
68 const char *valstr);
69 WERROR smbconf_set_global_parameter(struct smbconf_ctx *ctx,
70 const char *param, const char *val);
71 WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
72 TALLOC_CTX *mem_ctx,
73 const char *service,
74 const char *param,
75 char **valstr);
76 WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
77 TALLOC_CTX *mem_ctx,
78 const char *param,
79 char **valstr);
80 WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
81 const char *service, const char *param);
82 WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
83 const char *param);
85 #endif /* _LIBSMBCONF_H_ */