libsmbconf: Remove use of some Samba3-specific macros.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 21 Jan 2009 17:50:16 +0000 (18:50 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 21 Jan 2009 17:50:16 +0000 (18:50 +0100)
lib/smbconf/smbconf.c
lib/smbconf/smbconf_private.h
lib/smbconf/smbconf_txt.c
lib/smbconf/smbconf_util.c

index d723f0b1408e25493d49d656606d1adb3b0d7ae0..bcab0b97cd9afd276ac956dc1441dd35094735aa 100644 (file)
@@ -130,7 +130,7 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
                goto done;
        }
 
-       tmp_services = TALLOC_ARRAY(tmp_ctx, struct smbconf_service *,
+       tmp_services = talloc_array(tmp_ctx, struct smbconf_service *,
                                    tmp_num_shares);
 
        if (tmp_services == NULL) {
index b0333e981aabe61da133484f512bc24e4f0fe0a4..c9e44181c6e57e1ff7c12daa6b6af55b57a16bed 100644 (file)
 #ifndef __LIBSMBCONF_PRIVATE_H__
 #define __LIBSMBCONF_PRIVATE_H__
 
+#ifndef GLOBAL_NAME
+#define GLOBAL_NAME "global"
+#endif
+
+#include "lib/smbconf/smbconf.h"
+
 struct smbconf_ops {
        WERROR (*init)(struct smbconf_ctx *ctx, const char *path);
        int (*shutdown)(struct smbconf_ctx *ctx);
index c4d2d2b1af3d158b646bb2e0f6d1e60a6e6aacac..1df4a9fdb73c0a5dd3ddf65f9d11969d65b335d1 100644 (file)
@@ -79,7 +79,7 @@ static bool smbconf_txt_do_section(const char *section, void *private_data)
        cache->current_share = cache->num_shares;
        cache->num_shares++;
 
-       cache->param_names = TALLOC_REALLOC_ARRAY(cache,
+       cache->param_names = talloc_realloc(cache,
                                                  cache->param_names,
                                                  char **,
                                                  cache->num_shares);
@@ -88,7 +88,7 @@ static bool smbconf_txt_do_section(const char *section, void *private_data)
        }
        cache->param_names[cache->current_share] = NULL;
 
-       cache->param_values = TALLOC_REALLOC_ARRAY(cache,
+       cache->param_values = talloc_realloc(cache,
                                                   cache->param_values,
                                                   char **,
                                                   cache->num_shares);
@@ -97,7 +97,7 @@ static bool smbconf_txt_do_section(const char *section, void *private_data)
        }
        cache->param_values[cache->current_share] = NULL;
 
-       cache->num_params = TALLOC_REALLOC_ARRAY(cache,
+       cache->num_params = talloc_realloc(cache,
                                                 cache->num_params,
                                                 uint32_t,
                                                 cache->num_shares);
@@ -170,7 +170,7 @@ static WERROR smbconf_txt_init_cache(struct smbconf_ctx *ctx)
                smbconf_txt_flush_cache(ctx);
        }
 
-       pd(ctx)->cache = TALLOC_ZERO_P(pd(ctx), struct txt_cache);
+       pd(ctx)->cache = talloc_zero(pd(ctx), struct txt_cache);
 
        if (pd(ctx)->cache == NULL) {
                return WERR_NOMEM;
@@ -229,7 +229,7 @@ static WERROR smbconf_txt_init(struct smbconf_ctx *ctx, const char *path)
                return WERR_NOMEM;
        }
 
-       ctx->data = TALLOC_ZERO_P(ctx, struct txt_private_data);
+       ctx->data = talloc_zero(ctx, struct txt_private_data);
        if (ctx->data == NULL) {
                return WERR_NOMEM;
        }
@@ -420,7 +420,7 @@ static WERROR smbconf_txt_get_share(struct smbconf_ctx *ctx,
 
        tmp_ctx = talloc_stackframe();
 
-       tmp_service = TALLOC_ZERO_P(tmp_ctx, struct smbconf_service);
+       tmp_service = talloc_zero(tmp_ctx, struct smbconf_service);
        if (tmp_service == NULL) {
                werr = WERR_NOMEM;
                goto done;
index 5eb5e963ed9279d36287b84b1009d9905f355eab..b309a3454b13d5fee8ad164b9d99ac30fca7236c 100644 (file)
@@ -49,7 +49,7 @@ WERROR smbconf_init_internal(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
                return WERR_INVALID_PARAM;
        }
 
-       ctx = TALLOC_ZERO_P(mem_ctx, struct smbconf_ctx);
+       ctx = talloc_zero(mem_ctx, struct smbconf_ctx);
        if (ctx == NULL) {
                return WERR_NOMEM;
        }
@@ -86,7 +86,7 @@ WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
                return WERR_INVALID_PARAM;
        }
 
-       new_array = TALLOC_REALLOC_ARRAY(mem_ctx, *array, char *, count + 1);
+       new_array = talloc_realloc(mem_ctx, *array, char *, count + 1);
        if (new_array == NULL) {
                return WERR_NOMEM;
        }