return WERR_NOT_SUPPORTED;
}
- werr = smbconf_init(ctx, &conf_ctx);
+ werr = smbconf_init_reg(ctx, &conf_ctx);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
.delete_parameter = smbconf_reg_delete_parameter
};
+WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx)
+{
+ return smbconf_init(mem_ctx, conf_ctx, &smbconf_ops_reg);
+}
+
/**********************************************************************
*
* After the work with the configuration is completed, smbconf_shutdown()
* should be called.
*/
-WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx)
+WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
+ struct smbconf_ops *ops)
{
WERROR werr = WERR_OK;
struct smbconf_ctx *ctx;
return WERR_NOMEM;
}
- ctx->ops = &smbconf_ops_reg;
+ ctx->ops = ops;
werr = ctx->ops->init(ctx);
if (!W_ERROR_IS_OK(werr)) {
* (Backends and possibly remote support being added ...)
*/
-WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx);
+WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx);
void smbconf_shutdown(struct smbconf_ctx *ctx);
bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
const char *service, const char *param);
struct smbconf_ops *ops;
};
+WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
+ struct smbconf_ops *ops);
+
#endif
WERROR werr;
struct smbconf_ctx *ctx;
- werr = smbconf_init(r, &ctx);
+ werr = smbconf_init_reg(r, &ctx);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
WERROR werr = WERR_OK;
struct smbconf_ctx *ctx;
- werr = smbconf_init(r, &ctx);
+ werr = smbconf_init_reg(r, &ctx);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
if (conf_ctx == NULL) {
/* first time */
- werr = smbconf_init(NULL, &conf_ctx);
+ werr = smbconf_init_reg(NULL, &conf_ctx);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
if (lp_config_backend_is_registry()) {
if (conf_ctx == NULL) {
WERROR werr;
- werr = smbconf_init(NULL, &conf_ctx);
+ werr = smbconf_init_reg(NULL, &conf_ctx);
if (!W_ERROR_IS_OK(werr)) {
DEBUG(0, ("error opening configuration: %s\n",
dos_errstr(werr)));
struct smbconf_ctx *conf_ctx;
int ret = -1;
- werr = smbconf_init(mem_ctx, &conf_ctx);
+ werr = smbconf_init_reg(mem_ctx, &conf_ctx);
if (!W_ERROR_IS_OK(werr)) {
return -1;