param: Move per-share parameters into a seperate file, to share with s3
authorAndrew Bartlett <abartlet@samba.org>
Thu, 7 Jul 2011 12:03:30 +0000 (22:03 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 8 Jul 2011 09:23:23 +0000 (11:23 +0200)
This will allow the struct loadparm_service to be in common between
the two loadparm implementations in the tree.

Andrew Bartlett

buildtools/wafsamba/wafsamba.py
lib/param/param_functions.c [new file with mode: 0644]
lib/param/param_structs.h [new file with mode: 0644]
source4/param/loadparm.c
source4/param/wscript_build

index d76afc4..3858770 100644 (file)
@@ -108,6 +108,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   external_library=False,
                   realname=None,
                   autoproto=None,
+                  autoproto_extra_source='',
                   group='libraries',
                   depends_on='',
                   local_include=True,
@@ -168,6 +169,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                         cflags         = cflags,
                         group          = subsystem_group,
                         autoproto      = autoproto,
+                        autoproto_extra_source=autoproto_extra_source,
                         depends_on     = depends_on,
                         hide_symbols   = hide_symbols,
                         pyext          = pyext or (target_type == "PYTHON"),
diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c
new file mode 100644 (file)
index 0000000..e68e34a
--- /dev/null
@@ -0,0 +1,23 @@
+FN_LOCAL_STRING(pathname, szPath)
+FN_LOCAL_LIST(hostsallow, szHostsallow)
+FN_LOCAL_LIST(hostsdeny, szHostsdeny)
+FN_LOCAL_STRING(comment, comment)
+FN_LOCAL_STRING(fstype, fstype)
+FN_LOCAL_LIST(ntvfs_handler, ntvfs_handler)
+FN_LOCAL_BOOL(msdfs_root, bMSDfsRoot)
+FN_LOCAL_BOOL(browseable, bBrowseable)
+FN_LOCAL_BOOL(readonly, bRead_only)
+FN_LOCAL_BOOL(print_ok, bPrint_ok)
+FN_LOCAL_BOOL(map_hidden, bMap_hidden)
+FN_LOCAL_BOOL(map_archive, bMap_archive)
+FN_LOCAL_BOOL(strict_locking, bStrictLocking)
+FN_LOCAL_BOOL(oplocks, bOplocks)
+FN_LOCAL_BOOL(strict_sync, bStrictSync)
+FN_LOCAL_BOOL(ci_filesystem, bCIFileSystem)
+FN_LOCAL_BOOL(map_system, bMap_system)
+FN_LOCAL_INTEGER(max_connections, iMaxConnections)
+FN_LOCAL_INTEGER(csc_policy, iCSCPolicy)
+FN_LOCAL_INTEGER(create_mask, iCreate_mask)
+FN_LOCAL_INTEGER(force_create_mode, iCreate_force_mode)
+FN_LOCAL_INTEGER(dir_mask, iDir_mask)
+FN_LOCAL_INTEGER(force_dir_mode, iDir_force_mode)
diff --git a/lib/param/param_structs.h b/lib/param/param_structs.h
new file mode 100644 (file)
index 0000000..f076ce1
--- /dev/null
@@ -0,0 +1,13 @@
+#define LOADPARM_EXTRA_LOCALS                          \
+       struct parmlist_entry *param_opt;               \
+       char *szService;                                \
+       char *szCopy;                                   \
+       char *szInclude;                                \
+       char *szPrintername;                            \
+       int bAvailable;                                 \
+       int iMaxPrintJobs;                              \
+       char *volume;                                   \
+       struct bitmap *copymap;                         \
+       char dummy[3];          /* for alignment */
+
+#include "param_local.h"
index b936343..3678829 100644 (file)
@@ -70,6 +70,7 @@
 #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
 
@@ -88,20 +89,7 @@ static bool defaults_saved = false;
        char *panic_action;                                             \
        int bPreferredMaster;
 
-#define LOADPARM_EXTRA_LOCALS                          \
-       struct parmlist_entry *param_opt;               \
-       char *szService;                                \
-       char *szCopy;                                   \
-       char *szInclude;                                \
-       char *szPrintername;                            \
-       int bAvailable;                                 \
-       int iMaxPrintJobs;                              \
-       char *volume;                                   \
-       struct bitmap *copymap;                         \
-       char dummy[3];          /* for alignment */
-
 #include "param_global.h"
-#include "param_local.h"
 
 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
 
@@ -1450,6 +1438,8 @@ static struct loadparm_context *global_loadparm_context;
         return((service != NULL)? service->val : sDefault->val); \
  }
 
+#include "lib/param/param_functions.c"
+
 FN_GLOBAL_INTEGER(server_role, server_role)
 FN_GLOBAL_LIST(smb_ports, smb_ports)
 FN_GLOBAL_INTEGER(nbt_port, nbt_port)
@@ -1536,29 +1526,6 @@ FN_GLOBAL_INTEGER(cli_minprotocol, cli_minprotocol)
 FN_GLOBAL_INTEGER(security, security)
 FN_GLOBAL_BOOL(paranoid_server_security, paranoid_server_security)
 
-FN_LOCAL_STRING(pathname, szPath)
-FN_LOCAL_LIST(hostsallow, szHostsallow)
-FN_LOCAL_LIST(hostsdeny, szHostsdeny)
-FN_LOCAL_STRING(comment, comment)
-FN_LOCAL_STRING(fstype, fstype)
-FN_LOCAL_LIST(ntvfs_handler, ntvfs_handler)
-FN_LOCAL_BOOL(msdfs_root, bMSDfsRoot)
-FN_LOCAL_BOOL(browseable, bBrowseable)
-FN_LOCAL_BOOL(readonly, bRead_only)
-FN_LOCAL_BOOL(print_ok, bPrint_ok)
-FN_LOCAL_BOOL(map_hidden, bMap_hidden)
-FN_LOCAL_BOOL(map_archive, bMap_archive)
-FN_LOCAL_BOOL(strict_locking, bStrictLocking)
-FN_LOCAL_BOOL(oplocks, bOplocks)
-FN_LOCAL_BOOL(strict_sync, bStrictSync)
-FN_LOCAL_BOOL(ci_filesystem, bCIFileSystem)
-FN_LOCAL_BOOL(map_system, bMap_system)
-FN_LOCAL_INTEGER(max_connections, iMaxConnections)
-FN_LOCAL_INTEGER(csc_policy, iCSCPolicy)
-FN_LOCAL_INTEGER(create_mask, iCreate_mask)
-FN_LOCAL_INTEGER(force_create_mode, iCreate_force_mode)
-FN_LOCAL_INTEGER(dir_mask, iDir_mask)
-FN_LOCAL_INTEGER(force_dir_mode, iDir_force_mode)
 FN_GLOBAL_INTEGER(server_signing, server_signing)
 FN_GLOBAL_INTEGER(client_signing, client_signing)
 
index 8cd9955..a56191d 100644 (file)
@@ -6,7 +6,7 @@ bld.SAMBA_GENERATOR('s3_param_h',
                     rule='${PERL} ${SRC[1].abspath(env)} ${SRC[0].abspath(env)} --file ${TGT}')
 
 bld.SAMBA_GENERATOR('param_local_h',
-                    source= 'loadparm.c ../../script/mkparamdefs.pl',
+                    source= '../../lib/param/param_functions.c ../../script/mkparamdefs.pl',
                     target='param_local.h',
                     rule='${PERL} ${SRC[1].abspath(env)} ${SRC[0].abspath(env)} --file ${TGT} --generate-scope=LOCAL')
 
@@ -23,6 +23,7 @@ bld.SAMBA_LIBRARY('samba-hostconfig',
        public_deps='samba-util bitmap',
        public_headers='param.h',
        autoproto='param_proto.h',
+        autoproto_extra_source='../../lib/param/param_functions.c'
        )