Includes have to get a special treatment, at least for registry.
Includes are not like other smbconf parameters: they are some kind
of metainformation. "include" has two effects when stated twice so
it can not be stored boldly into registry, since there can only be
one value named "include" in registry per key.
I will provide special handling for includes for the registry backend.
This patch provides the necessary methods in the smbconf API.
Michael
return werr;
}
+
+WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t *num_includes, char ***includes)
+{
+ if (!smbconf_share_exists(ctx, service)) {
+ return WERR_NO_SUCH_SERVICE;
+ }
+
+ return ctx->ops->get_includes(ctx, service, num_includes, includes);
+}
+
+WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t num_includes, const char **includes)
+{
+ if (!smbconf_share_exists(ctx, service)) {
+ return WERR_NO_SUCH_SERVICE;
+ }
+
+ return ctx->ops->set_includes(ctx, service, num_includes, includes);
+}
const char *service, const char *param);
WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
const char *param);
+WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t *num_includes, char ***includes);
+WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t num_includes, const char **includes);
#endif /* _LIBSMBCONF_H_ */
char **valstr);
WERROR (*delete_parameter)(struct smbconf_ctx *ctx,
const char *service, const char *param);
+ WERROR (*get_includes)(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t *num_includes, char ***includes);
+ WERROR (*set_includes)(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t num_includes, const char **includes);
};
struct smbconf_ctx {
return werr;
}
+static WERROR smbconf_reg_get_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t *num_includes,
+ char ***includes)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+static WERROR smbconf_reg_set_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t num_includes,
+ const char **includes)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+
struct smbconf_ops smbconf_ops_reg = {
.init = smbconf_reg_init,
.shutdown = smbconf_reg_shutdown,
.delete_share = smbconf_reg_delete_share,
.set_parameter = smbconf_reg_set_parameter,
.get_parameter = smbconf_reg_get_parameter,
- .delete_parameter = smbconf_reg_delete_parameter
+ .delete_parameter = smbconf_reg_delete_parameter,
+ .get_includes = smbconf_reg_get_includes,
+ .set_includes = smbconf_reg_set_includes,
};
return WERR_NOT_SUPPORTED;
}
+static WERROR smbconf_txt_get_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t *num_includes,
+ char ***includes)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
+static WERROR smbconf_txt_set_includes(struct smbconf_ctx *ctx,
+ const char *service,
+ uint32_t num_includes,
+ const char **includes)
+{
+ return WERR_NOT_SUPPORTED;
+}
+
static struct smbconf_ops smbconf_ops_txt = {
.init = smbconf_txt_init,
.shutdown = smbconf_txt_shutdown,
.delete_share = smbconf_txt_delete_share,
.set_parameter = smbconf_txt_set_parameter,
.get_parameter = smbconf_txt_get_parameter,
- .delete_parameter = smbconf_txt_delete_parameter
+ .delete_parameter = smbconf_txt_delete_parameter,
+ .get_includes = smbconf_txt_get_includes,
+ .set_includes = smbconf_txt_set_includes,
};