source: branches/samba-3.3.x/source/lib/smbconf/smbconf_private.h

Last change on this file was 223, checked in by Herwig Bauernfeind, 16 years ago

Update Samba 3.3 branch to 3.3.3

File size: 3.4 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_PRIVATE_H__
21#define __LIBSMBCONF_PRIVATE_H__
22
23struct smbconf_ops {
24 WERROR (*init)(struct smbconf_ctx *ctx, const char *path);
25 int (*shutdown)(struct smbconf_ctx *ctx);
26 bool (*requires_messaging)(struct smbconf_ctx *ctx);
27 bool (*is_writeable)(struct smbconf_ctx *ctx);
28 WERROR (*open_conf)(struct smbconf_ctx *ctx);
29 int (*close_conf)(struct smbconf_ctx *ctx);
30 void (*get_csn)(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
31 const char *service, const char *param);
32 WERROR (*drop)(struct smbconf_ctx *ctx);
33 WERROR (*get_share_names)(struct smbconf_ctx *ctx,
34 TALLOC_CTX *mem_ctx,
35 uint32_t *num_shares,
36 char ***share_names);
37 bool (*share_exists)(struct smbconf_ctx *ctx, const char *service);
38 WERROR (*create_share)(struct smbconf_ctx *ctx, const char *service);
39 WERROR (*get_share)(struct smbconf_ctx *ctx,
40 TALLOC_CTX *mem_ctx,
41 const char *servicename,
42 struct smbconf_service **service);
43 WERROR (*delete_share)(struct smbconf_ctx *ctx,
44 const char *servicename);
45 WERROR (*set_parameter)(struct smbconf_ctx *ctx,
46 const char *service,
47 const char *param,
48 const char *valstr);
49 WERROR (*get_parameter)(struct smbconf_ctx *ctx,
50 TALLOC_CTX *mem_ctx,
51 const char *service,
52 const char *param,
53 char **valstr);
54 WERROR (*delete_parameter)(struct smbconf_ctx *ctx,
55 const char *service, const char *param);
56 WERROR (*get_includes)(struct smbconf_ctx *ctx,
57 TALLOC_CTX *mem_ctx,
58 const char *service,
59 uint32_t *num_includes, char ***includes);
60 WERROR (*set_includes)(struct smbconf_ctx *ctx,
61 const char *service,
62 uint32_t num_includes, const char **includes);
63 WERROR (*delete_includes)(struct smbconf_ctx *ctx,
64 const char *service);
65 WERROR (*transaction_start)(struct smbconf_ctx *ctx);
66 WERROR (*transaction_commit)(struct smbconf_ctx *ctx);
67 WERROR (*transaction_cancel)(struct smbconf_ctx *ctx);
68};
69
70struct smbconf_ctx {
71 const char *path;
72 struct smbconf_ops *ops;
73 void *data; /* private data for use in backends */
74};
75
76WERROR smbconf_init_internal(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
77 const char *path, struct smbconf_ops *ops);
78
79WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
80 char ***array,
81 uint32_t count,
82 const char *string);
83
84bool smbconf_find_in_array(const char *string, char **list,
85 uint32_t num_entries, uint32_t *entry);
86
87bool smbconf_reverse_find_in_array(const char *string, char **list,
88 uint32_t num_entries, uint32_t *entry);
89
90#endif
Note: See TracBrowser for help on using the repository browser.