summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-26 14:39:02 +0100
committerMichael Adam <obnox@samba.org>2008-03-26 14:55:06 +0100
commit0234cc8bdd25b9727a658485c87e7c1e57ba3224 (patch)
tree3dd4492d05e176f5411b5286d088e11cd8ce6916
parentc2acc30bcbed9081f21dc0e73bc96b5c9edd3516 (diff)
downloadsamba-0234cc8bdd25b9727a658485c87e7c1e57ba3224.tar.gz
samba-0234cc8bdd25b9727a658485c87e7c1e57ba3224.tar.bz2
samba-0234cc8bdd25b9727a658485c87e7c1e57ba3224.zip
net_conf: rename "ctx" to "mem_ctx" for clarity.
There are also smbconf contexts arount... Michael (This used to be commit 5171df66eb54c9819b3b40045755f5e9b2cf36c2)
-rw-r--r--source3/utils/net_conf.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 8a7cc260a3..c21631dd5e 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -168,7 +168,7 @@ static int net_conf_list(struct smbconf_ctx *conf_ctx,
{
WERROR werr = WERR_OK;
int ret = -1;
- TALLOC_CTX *ctx;
+ TALLOC_CTX *mem_ctx;
uint32_t num_shares;
char **share_names;
uint32_t *num_params;
@@ -176,14 +176,14 @@ static int net_conf_list(struct smbconf_ctx *conf_ctx,
char ***param_values;
uint32_t share_count, param_count;
- ctx = talloc_stackframe();
+ mem_ctx = talloc_stackframe();
if (argc != 0) {
net_conf_list_usage(argc, argv);
goto done;
}
- werr = smbconf_get_config(conf_ctx, ctx, &num_shares, &share_names,
+ werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &share_names,
&num_params, &param_names, &param_values);
if (!W_ERROR_IS_OK(werr)) {
d_fprintf(stderr, "Error getting config: %s\n",
@@ -206,7 +206,7 @@ static int net_conf_list(struct smbconf_ctx *conf_ctx,
ret = 0;
done:
- TALLOC_FREE(ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
@@ -216,11 +216,11 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
int ret = -1;
const char *filename = NULL;
const char *servicename = NULL;
- TALLOC_CTX *ctx;
+ TALLOC_CTX *mem_ctx;
struct smbconf_ctx *txt_ctx;
WERROR werr;
- ctx = talloc_stackframe();
+ mem_ctx = talloc_stackframe();
switch (argc) {
case 0:
@@ -237,7 +237,7 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
DEBUG(3,("net_conf_import: reading configuration from file %s.\n",
filename));
- werr = smbconf_init_txt_simple(ctx, &txt_ctx, filename);
+ werr = smbconf_init_txt_simple(mem_ctx, &txt_ctx, filename);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
@@ -251,7 +251,7 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
char **param_names, **param_values;
uint32_t num_params;
- werr = smbconf_get_share(txt_ctx, ctx,
+ werr = smbconf_get_share(txt_ctx, mem_ctx,
servicename,
&num_params,
&param_names,
@@ -271,7 +271,7 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
char **share_names, ***param_names, ***param_values;
uint32_t num_shares, *num_params, sidx;
- werr = smbconf_get_config(txt_ctx, ctx,
+ werr = smbconf_get_config(txt_ctx, mem_ctx,
&num_shares, &share_names,
&num_params, &param_names, &param_values);
if (!W_ERROR_IS_OK(werr)) {
@@ -292,7 +292,7 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
ret = 0;
done:
- TALLOC_FREE(ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
@@ -303,16 +303,16 @@ static int net_conf_listshares(struct smbconf_ctx *conf_ctx,
int ret = -1;
uint32_t count, num_shares = 0;
char **share_names = NULL;
- TALLOC_CTX *ctx;
+ TALLOC_CTX *mem_ctx;
- ctx = talloc_stackframe();
+ mem_ctx = talloc_stackframe();
if (argc != 0) {
net_conf_listshares_usage(argc, argv);
goto done;
}
- werr = smbconf_get_share_names(conf_ctx, ctx, &num_shares,
+ werr = smbconf_get_share_names(conf_ctx, mem_ctx, &num_shares,
&share_names);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -326,7 +326,7 @@ static int net_conf_listshares(struct smbconf_ctx *conf_ctx,
ret = 0;
done:
- TALLOC_FREE(ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
@@ -360,13 +360,13 @@ static int net_conf_showshare(struct smbconf_ctx *conf_ctx,
int ret = -1;
WERROR werr = WERR_OK;
const char *sharename = NULL;
- TALLOC_CTX *ctx;
+ TALLOC_CTX *mem_ctx;
uint32_t num_params;
uint32_t count;
char **param_names;
char **param_values;
- ctx = talloc_stackframe();
+ mem_ctx = talloc_stackframe();
if (argc != 1) {
net_conf_showshare_usage(argc, argv);
@@ -375,7 +375,7 @@ static int net_conf_showshare(struct smbconf_ctx *conf_ctx,
sharename = argv[0];
- werr = smbconf_get_share(conf_ctx, ctx, sharename, &num_params,
+ werr = smbconf_get_share(conf_ctx, mem_ctx, sharename, &num_params,
&param_names, &param_values);
if (!W_ERROR_IS_OK(werr)) {
d_printf("error getting share parameters: %s\n",
@@ -393,7 +393,7 @@ static int net_conf_showshare(struct smbconf_ctx *conf_ctx,
ret = 0;
done:
- TALLOC_FREE(ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}
@@ -652,9 +652,9 @@ static int net_conf_getparm(struct smbconf_ctx *conf_ctx,
char *service = NULL;
char *param = NULL;
char *valstr = NULL;
- TALLOC_CTX *ctx;
+ TALLOC_CTX *mem_ctx;
- ctx = talloc_stackframe();
+ mem_ctx = talloc_stackframe();
if (argc != 2) {
net_conf_getparm_usage(argc, argv);
@@ -663,7 +663,7 @@ static int net_conf_getparm(struct smbconf_ctx *conf_ctx,
service = strdup_lower(argv[0]);
param = strdup_lower(argv[1]);
- werr = smbconf_get_parameter(conf_ctx, ctx, service, param, &valstr);
+ werr = smbconf_get_parameter(conf_ctx, mem_ctx, service, param, &valstr);
if (W_ERROR_EQUAL(werr, WERR_NO_SUCH_SERVICE)) {
d_fprintf(stderr,
@@ -687,7 +687,7 @@ static int net_conf_getparm(struct smbconf_ctx *conf_ctx,
done:
SAFE_FREE(service);
SAFE_FREE(param);
- TALLOC_FREE(ctx);
+ TALLOC_FREE(mem_ctx);
return ret;
}