1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-01 16:23:49 +03:00

r11813: Const-ify name resolution method list and use string list

utilities to set the context field.

rafal
This commit is contained in:
Rafal Szczesniak
2005-11-20 21:33:30 +00:00
committed by Gerald (Jerry) Carter
parent fb9a3c7ef3
commit 5da8b457c3
2 changed files with 2 additions and 11 deletions

View File

@@ -26,7 +26,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
{ {
/* default name resolution methods */ /* default name resolution methods */
const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL }; const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL };
int nr_count = 0, nr_i;
struct libnet_context *ctx; struct libnet_context *ctx;
@@ -46,15 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
} }
ctx->event_ctx = ev; ctx->event_ctx = ev;
/* count name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, nr_methods);
while (nr_methods[nr_count]) nr_count++;
/* assign name resolution methods */
ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1);
for (nr_i = 0; nr_i < nr_count; nr_i++) {
ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]);
}
ctx->name_res_methods[nr_i] = NULL;
return ctx; return ctx;
} }

View File

@@ -33,7 +33,7 @@ struct libnet_context {
struct policy_handle user_handle; struct policy_handle user_handle;
/* name resolution methods */ /* name resolution methods */
char **name_res_methods; const char **name_res_methods;
struct event_context *event_ctx; struct event_context *event_ctx;
}; };