From cda86869400285afe17db87a9a666fbcc5b918a8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Jul 2011 09:19:43 +1000 Subject: lib/param: Merge struct loadparm_service into common This is handled by a common header and a .c file that is included into both loadparm.c files. In the process, _lp functions were renamed to lp__ to allow the common function definition declarations to be used by source3 and source4 (which have different macro definitions). The only parameter to change type is 'strict_locking' which was a bool, and is now an int, to accommodate the 'Auto' value from source3. Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Fri Jul 8 12:35:56 CEST 2011 on sn-devel-104 --- source4/param/loadparm.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'source4/param/loadparm.c') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 36788290d1..b890ad81a9 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -61,7 +61,6 @@ #include "smb_server/smb_server.h" #include "libcli/raw/signing.h" #include "../lib/util/dlinklist.h" -#include "../lib/util/parmlist.h" #include "param/param.h" #include "param/loadparm.h" #include "libcli/raw/libcliraw.h" @@ -70,7 +69,6 @@ #include "auth/gensec/gensec.h" #include "s3_param.h" #include "../lib/util/bitmap.h" -#include "../lib/param/param_structs.h" #define standard_sub_basic talloc_strdup @@ -1031,7 +1029,7 @@ static struct parm_struct parm_table[] = { .label = "strict locking", .type = P_BOOL, .p_class = P_LOCAL, - .offset = LOCAL_VAR(bStrictLocking), + .offset = LOCAL_VAR(iStrictLocking), .special = NULL, .enum_list = NULL }, @@ -1039,7 +1037,7 @@ static struct parm_struct parm_table[] = { .label = "oplocks", .type = P_BOOL, .p_class = P_LOCAL, - .offset = LOCAL_VAR(bOplocks), + .offset = LOCAL_VAR(bOpLocks), .special = NULL, .enum_list = NULL }, @@ -1420,12 +1418,16 @@ static struct loadparm_context *global_loadparm_context; return(lp_string((const char *)((service != NULL && service->val != NULL) ? service->val : sDefault->val))); \ } +#define FN_LOCAL_CONST_STRING(fn_name,val) FN_LOCAL_STRING(fn_name, val) + #define FN_LOCAL_LIST(fn_name,val) \ _PUBLIC_ const char **lpcfg_ ## fn_name(struct loadparm_service *service, \ struct loadparm_service *sDefault) {\ return(const char **)(service != NULL && service->val != NULL? service->val : sDefault->val); \ } +#define FN_LOCAL_PARM_BOOL(fn_name, val) FN_LOCAL_BOOL(fn_name, val) + #define FN_LOCAL_BOOL(fn_name,val) \ _PUBLIC_ bool lpcfg_ ## fn_name(struct loadparm_service *service, \ struct loadparm_service *sDefault) { \ @@ -1438,6 +1440,16 @@ static struct loadparm_context *global_loadparm_context; return((service != NULL)? service->val : sDefault->val); \ } +#define FN_LOCAL_PARM_INTEGER(fn_name, val) FN_LOCAL_INTEGER(fn_name, val) + +#define FN_LOCAL_PARM_CHAR(fn_name, val) FN_LOCAL_CHAR(fn_name, val) + +#define FN_LOCAL_CHAR(fn_name,val) \ + _PUBLIC_ char lpcfg_ ## fn_name(struct loadparm_service *service, \ + struct loadparm_service *sDefault) { \ + return((service != NULL)? service->val : sDefault->val); \ + } + #include "lib/param/param_functions.c" FN_GLOBAL_INTEGER(server_role, server_role) @@ -3171,8 +3183,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lp_ctx->sDefault->bBrowseable = true; lp_ctx->sDefault->bRead_only = true; lp_ctx->sDefault->bMap_archive = true; - lp_ctx->sDefault->bStrictLocking = true; - lp_ctx->sDefault->bOplocks = true; + lp_ctx->sDefault->iStrictLocking = true; + lp_ctx->sDefault->bOpLocks = true; lp_ctx->sDefault->iCreate_mask = 0744; lp_ctx->sDefault->iCreate_force_mode = 0000; lp_ctx->sDefault->iDir_mask = 0755; -- cgit