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__
25 /* the change sequence number */
30 struct smbconf_service
{
39 * intialization dispatcher function.
40 * takes source string in the form of "backend:path"
42 WERROR
smbconf_init(TALLOC_CTX
*mem_ctx
, struct smbconf_ctx
**conf_ctx
,
46 * initialization functions for the available modules
49 WERROR
smbconf_init_reg(TALLOC_CTX
*mem_ctx
, struct smbconf_ctx
**conf_ctx
,
52 WERROR
smbconf_init_txt(TALLOC_CTX
*mem_ctx
,
53 struct smbconf_ctx
**conf_ctx
,
57 * the smbconf API functions
59 bool smbconf_backend_requires_messaging(struct smbconf_ctx
*ctx
);
60 void smbconf_shutdown(struct smbconf_ctx
*ctx
);
61 bool smbconf_changed(struct smbconf_ctx
*ctx
, struct smbconf_csn
*csn
,
62 const char *service
, const char *param
);
63 WERROR
smbconf_drop(struct smbconf_ctx
*ctx
);
64 WERROR
smbconf_get_config(struct smbconf_ctx
*ctx
,
67 struct smbconf_service
***services
);
68 WERROR
smbconf_get_share_names(struct smbconf_ctx
*ctx
,
72 bool smbconf_share_exists(struct smbconf_ctx
*ctx
, const char *servicename
);
73 WERROR
smbconf_create_share(struct smbconf_ctx
*ctx
, const char *servicename
);
74 WERROR
smbconf_get_share(struct smbconf_ctx
*ctx
,
76 const char *servicename
,
77 struct smbconf_service
**service
);
78 WERROR
smbconf_delete_share(struct smbconf_ctx
*ctx
,
79 const char *servicename
);
80 WERROR
smbconf_set_parameter(struct smbconf_ctx
*ctx
,
84 WERROR
smbconf_set_global_parameter(struct smbconf_ctx
*ctx
,
85 const char *param
, const char *val
);
86 WERROR
smbconf_get_parameter(struct smbconf_ctx
*ctx
,
91 WERROR
smbconf_get_global_parameter(struct smbconf_ctx
*ctx
,
95 WERROR
smbconf_delete_parameter(struct smbconf_ctx
*ctx
,
96 const char *service
, const char *param
);
97 WERROR
smbconf_delete_global_parameter(struct smbconf_ctx
*ctx
,
99 WERROR
smbconf_get_includes(struct smbconf_ctx
*ctx
,
102 uint32_t *num_includes
, char ***includes
);
103 WERROR
smbconf_get_global_includes(struct smbconf_ctx
*ctx
,
105 uint32_t *num_includes
, char ***includes
);
106 WERROR
smbconf_set_includes(struct smbconf_ctx
*ctx
,
108 uint32_t num_includes
, const char **includes
);
109 WERROR
smbconf_set_global_includes(struct smbconf_ctx
*ctx
,
110 uint32_t num_includes
,
111 const char **includes
);
112 WERROR
smbconf_delete_includes(struct smbconf_ctx
*ctx
, const char *service
);
113 WERROR
smbconf_delete_global_includes(struct smbconf_ctx
*ctx
);
115 #endif /* _LIBSMBCONF_H_ */