source: branches/samba-3.5.x/lib/smbconf/smbconf.h@ 1075

Last change on this file since 1075 was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 3.6 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 * libsmbconf - Samba configuration library
4 * Copyright (C) Michael Adam 2008
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#ifndef __LIBSMBCONF_H__
21#define __LIBSMBCONF_H__
22
23struct smbconf_ctx;
24
25/* the change sequence number */
26struct smbconf_csn {
27 uint64_t csn;
28};
29
30struct smbconf_service {
31 char *name;
32 uint32_t num_params;
33 char **param_names;
34 char **param_values;
35};
36
37/*
38 * the smbconf API functions
39 */
40bool smbconf_backend_requires_messaging(struct smbconf_ctx *ctx);
41bool smbconf_is_writeable(struct smbconf_ctx *ctx);
42void smbconf_shutdown(struct smbconf_ctx *ctx);
43bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
44 const char *service, const char *param);
45WERROR smbconf_drop(struct smbconf_ctx *ctx);
46WERROR smbconf_get_config(struct smbconf_ctx *ctx,
47 TALLOC_CTX *mem_ctx,
48 uint32_t *num_shares,
49 struct smbconf_service ***services);
50WERROR smbconf_get_share_names(struct smbconf_ctx *ctx,
51 TALLOC_CTX *mem_ctx,
52 uint32_t *num_shares,
53 char ***share_names);
54bool smbconf_share_exists(struct smbconf_ctx *ctx, const char *servicename);
55WERROR smbconf_create_share(struct smbconf_ctx *ctx, const char *servicename);
56WERROR smbconf_get_share(struct smbconf_ctx *ctx,
57 TALLOC_CTX *mem_ctx,
58 const char *servicename,
59 struct smbconf_service **service);
60WERROR smbconf_delete_share(struct smbconf_ctx *ctx,
61 const char *servicename);
62WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
63 const char *service,
64 const char *param,
65 const char *valstr);
66WERROR smbconf_set_global_parameter(struct smbconf_ctx *ctx,
67 const char *param, const char *val);
68WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
69 TALLOC_CTX *mem_ctx,
70 const char *service,
71 const char *param,
72 char **valstr);
73WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
74 TALLOC_CTX *mem_ctx,
75 const char *param,
76 char **valstr);
77WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
78 const char *service, const char *param);
79WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
80 const char *param);
81WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
82 TALLOC_CTX *mem_ctx,
83 const char *service,
84 uint32_t *num_includes, char ***includes);
85WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx,
86 TALLOC_CTX *mem_ctx,
87 uint32_t *num_includes, char ***includes);
88WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
89 const char *service,
90 uint32_t num_includes, const char **includes);
91WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
92 uint32_t num_includes,
93 const char **includes);
94WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service);
95WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx);
96
97WERROR smbconf_transaction_start(struct smbconf_ctx *ctx);
98WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx);
99WERROR smbconf_transaction_cancel(struct smbconf_ctx *ctx);
100
101#endif /* _LIBSMBCONF_H_ */
Note: See TracBrowser for help on using the repository browser.