summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-29 14:15:32 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-29 15:44:09 +1000
commit7384a2b0b7c373b97b44705b994d0eb040300d5a (patch)
treee8998eb66cac672210e8272434ae64bb460d719e /source4
parent658f55bbb73a199fa51fc945216660be76fffc1b (diff)
downloadsamba-7384a2b0b7c373b97b44705b994d0eb040300d5a.tar.gz
samba-7384a2b0b7c373b97b44705b994d0eb040300d5a.tar.bz2
samba-7384a2b0b7c373b97b44705b994d0eb040300d5a.zip
s4-param Merge struct parm_struct with version from source3/
Diffstat (limited to 'source4')
-rw-r--r--source4/param/loadparm.c18
-rw-r--r--source4/param/loadparm.h9
-rw-r--r--source4/param/pyparam.c2
3 files changed, 15 insertions, 14 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index b1e3a00f4c..cbe579c7a5 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1138,9 +1138,9 @@ void *lpcfg_parm_ptr(struct loadparm_context *lp_ctx,
struct loadparm_service *service, struct parm_struct *parm)
{
if (service == NULL) {
- if (parm->pclass == P_LOCAL)
+ if (parm->p_class == P_LOCAL)
return ((char *)lp_ctx->sDefault)+parm->offset;
- else if (parm->pclass == P_GLOBAL)
+ else if (parm->p_class == P_GLOBAL)
return ((char *)lp_ctx->globals)+parm->offset;
else return NULL;
} else {
@@ -1181,7 +1181,7 @@ static void copy_service(struct loadparm_service *pserviceDest,
bool not_added;
for (i = 0; parm_table[i].label; i++)
- if (parm_table[i].offset != -1 && parm_table[i].pclass == P_LOCAL &&
+ if (parm_table[i].offset != -1 && parm_table[i].p_class == P_LOCAL &&
(bcopyall || pcopymapDest[i])) {
void *src_ptr =
((char *)pserviceSource) + parm_table[i].offset;
@@ -1721,7 +1721,7 @@ bool lpcfg_do_service_parameter(struct loadparm_context *lp_ctx,
return true;
}
- if (parm_table[parmnum].pclass == P_GLOBAL) {
+ if (parm_table[parmnum].p_class == P_GLOBAL) {
DEBUG(0,
("Global parameter %s found in service section!\n",
pszParmName));
@@ -1736,7 +1736,7 @@ bool lpcfg_do_service_parameter(struct loadparm_context *lp_ctx,
* entries with the same data pointer */
for (i = 0; parm_table[i].label; i++)
if (parm_table[i].offset == parm_table[parmnum].offset &&
- parm_table[i].pclass == parm_table[parmnum].pclass)
+ parm_table[i].p_class == parm_table[parmnum].p_class)
service->copymap[i] = false;
return set_variable(service, parmnum, parm_ptr, pszParmName,
@@ -2041,7 +2041,7 @@ static void dump_globals(struct loadparm_context *lp_ctx, FILE *f,
fprintf(f, "# Global parameters\n[global]\n");
for (i = 0; parm_table[i].label; i++)
- if (parm_table[i].pclass == P_GLOBAL &&
+ if (parm_table[i].p_class == P_GLOBAL &&
parm_table[i].offset != -1 &&
(i == 0 || (parm_table[i].offset != parm_table[i - 1].offset))) {
if (!show_defaults && (lp_ctx->flags[i] & FLAG_DEFAULT))
@@ -2076,7 +2076,7 @@ static void dump_a_service(struct loadparm_service * pService, struct loadparm_s
fprintf(f, "\n[%s]\n", pService->szService);
for (i = 0; parm_table[i].label; i++) {
- if (parm_table[i].pclass == P_LOCAL &&
+ if (parm_table[i].p_class == P_LOCAL &&
parm_table[i].offset != -1 &&
(*parm_table[i].label != '-') &&
(i == 0 || (parm_table[i].offset != parm_table[i - 1].offset)))
@@ -2159,7 +2159,7 @@ struct parm_struct *lpcfg_next_parameter(struct loadparm_context *lp_ctx, int sn
struct loadparm_service *pService = lp_ctx->services[snum];
for (; parm_table[*i].label; (*i)++) {
- if (parm_table[*i].pclass == P_LOCAL &&
+ if (parm_table[*i].p_class == P_LOCAL &&
parm_table[*i].offset != -1 &&
(*parm_table[*i].label != '-') &&
((*i) == 0 ||
@@ -2280,7 +2280,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
parm_table[i].offset != -1 &&
!(lp_ctx->flags[i] & FLAG_CMDLINE)) {
char **r;
- if (parm_table[i].pclass == P_LOCAL) {
+ if (parm_table[i].p_class == P_LOCAL) {
r = (char **)(((char *)lp_ctx->sDefault) + parm_table[i].offset);
} else {
r = (char **)(((char *)lp_ctx->globals) + parm_table[i].offset);
diff --git a/source4/param/loadparm.h b/source4/param/loadparm.h
index 4fc28e7f05..db583436b4 100644
--- a/source4/param/loadparm.h
+++ b/source4/param/loadparm.h
@@ -46,17 +46,18 @@ struct loadparm_context;
struct parm_struct {
const char *label;
parm_type type;
- parm_class pclass;
- int offset;
+ parm_class p_class;
+ offset_t offset;
bool (*special)(struct loadparm_context *lpcfg_ctx,
int snum, const char *, char **);
const struct enum_list *enum_list;
+ unsigned flags;
union {
- int bvalue;
+ bool bvalue;
int ivalue;
char *svalue;
char cvalue;
- const char **lvalue;
+ char **lvalue;
} def;
};
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index e1ba18415d..cab009746d 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -74,7 +74,7 @@ static PyObject *py_lp_ctx_get_helper(struct loadparm_context *lp_ctx, const cha
}
parm = lpcfg_parm_struct(param_name);
- if (parm == NULL || parm->pclass == P_GLOBAL) {
+ if (parm == NULL || parm->p_class == P_GLOBAL) {
return NULL;
}
parm_ptr = lpcfg_parm_ptr(lp_ctx, service, parm);