summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2015-04-28 16:47:39 +0200
committerJeremy Allison <jra@samba.org>2015-07-31 01:55:31 +0200
commit36abb6f2d32a5acf5ec44a7b397034c447502553 (patch)
tree2d8ccda02389cc2289754e6f9e90268f90560ab0 /script
parentd1615ab9dfa49fc6ca15a971d63aa54ba6140ef1 (diff)
downloadsamba-36abb6f2d32a5acf5ec44a7b397034c447502553.tar.gz
generate_param: make it possible to handle generated and synonym flags in iteration
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'script')
-rw-r--r--script/generate_param.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/script/generate_param.py b/script/generate_param.py
index d79c13c7275..ca2b1e977f5 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -69,8 +69,9 @@ def iterate_all(path):
synonym = parameter.attrib.get("synonym")
removed = parameter.attrib.get("removed")
generated = parameter.attrib.get("generated_function")
- if synonym == "1" or removed == "1" or generated == "0":
+ if removed == "1":
continue
+
constant = parameter.attrib.get("constant")
parm = parameter.attrib.get("parm")
if name is None or param_type is None or context is None:
@@ -82,7 +83,9 @@ def iterate_all(path):
'context': context,
'function': func,
'constant': (constant == '1'),
- 'parm': (parm == '1')}
+ 'parm': (parm == '1'),
+ 'synonym' : synonym,
+ 'generated' : generated }
# map doc attributes to a section of the generated function
context_dict = {"G": "_GLOBAL", "S": "_LOCAL"}
@@ -98,6 +101,11 @@ def generate_functions(path_in, path_out):
# filter out parameteric options
if ':' in parameter['name']:
continue
+ if parameter['synonym'] == "1":
+ continue
+ if parameter['generated'] == "0":
+ continue
+
output_string = "FN"
temp = context_dict.get(parameter['context'])
if temp is None:
@@ -129,6 +137,10 @@ def make_s3_param_proto(path_in, path_out):
# filter out parameteric options
if ':' in parameter['name']:
continue
+ if parameter['synonym'] == "1":
+ continue
+ if parameter['generated'] == "0":
+ continue
output_string = ""
if parameter['constant']:
@@ -175,6 +187,10 @@ def make_lib_proto(path_in, path_out):
# filter out parameteric options
if ':' in parameter['name']:
continue
+ if parameter['synonym'] == "1":
+ continue
+ if parameter['generated'] == "0":
+ continue
output_string = ""
if parameter['constant']:
@@ -238,6 +254,10 @@ def make_param_defs(path_in, path_out, scope):
# filter out parameteric options
if ':' in parameter['name']:
continue
+ if parameter['synonym'] == "1":
+ continue
+ if parameter['generated'] == "0":
+ continue
if (scope == "GLOBAL" and parameter['context'] != "G" or
scope == "LOCAL" and parameter['context'] != "S"):