]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbconf: pass txt_private_data instead of only cache to do_parameter/section
authorMichael Adam <obnox@samba.org>
Mon, 7 Apr 2008 20:43:33 +0000 (22:43 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 23:28:57 +0000 (01:28 +0200)
in preparation of using the verbatim flag.

Michael

source/lib/smbconf/smbconf.h
source/lib/smbconf/smbconf_txt_simple.c

index 15c2a3b7c9d4a5734a82427fa8e54b352f8e6a67..d333f6c88c6eaf0debca8df9cca6b1aefbb9df6b 100644 (file)
@@ -40,7 +40,7 @@ WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
 
 WERROR smbconf_init_txt_simple(TALLOC_CTX *mem_ctx,
                               struct smbconf_ctx **conf_ctx,
-                              const char *path
+                              const char *path,
                               bool verbatim);
 
 /*
index e56b986025aca4f068b334bf22865370d0b34de9..f734eab5528757d023d20d9838500484898d557c 100644 (file)
@@ -61,7 +61,8 @@ static bool smbconf_txt_do_section(const char *section, void *private_data)
 {
        WERROR werr;
        uint32_t idx;
-       struct txt_cache *cache = (struct txt_cache *)private_data;
+       struct txt_private_data *tpd = (struct txt_private_data *)private_data;
+       struct txt_cache *cache = tpd->cache;
 
        if (smbconf_find_in_array(section, cache->share_names,
                                  cache->num_shares, &idx))
@@ -116,7 +117,8 @@ static bool smbconf_txt_do_parameter(const char *param_name,
        char **param_names, **param_values;
        uint32_t num_params;
        uint32_t idx;
-       struct txt_cache *cache = (struct txt_cache *)private_data;
+       struct txt_private_data *tpd = (struct txt_private_data *)private_data;
+       struct txt_cache *cache = tpd->cache;
 
        if (cache->num_shares == 0) {
                /* not in any share ... */
@@ -184,7 +186,7 @@ static WERROR smbconf_txt_load_file(struct smbconf_ctx *ctx)
        }
 
        if (!pm_process(ctx->path, smbconf_txt_do_section,
-                       smbconf_txt_do_parameter, pd(ctx)->cache))
+                       smbconf_txt_do_parameter, pd(ctx)))
        {
                return WERR_CAN_NOT_COMPLETE;
        }