generate_param: make it possible to handle generated and synonym flags in iteration
authorMichael Adam <obnox@samba.org>
Tue, 28 Apr 2015 14:47:39 +0000 (16:47 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 Jul 2015 23:55:31 +0000 (01:55 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
script/generate_param.py

index d79c13c7275eee887015b160d31ab5227d8e62a8..ca2b1e977f5661263b3e366dbc706cf6e97d7f0e 100644 (file)
@@ -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"):