[Spice-commits] python_modules/codegen.py python_modules/demarshal.py python_modules/marshal.py spice_codegen.py

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 8 21:26:02 UTC 2019


 python_modules/codegen.py   |    2 +-
 python_modules/demarshal.py |   10 +++++-----
 python_modules/marshal.py   |    4 ++--
 spice_codegen.py            |    6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit cb00ccfaab7fa7ecbe5e40a46399c26d0c532082
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Sun Mar 3 18:49:22 2019 +0000

    codegen: Rename --prefix parameter to --suffix
    
    The option is used to add a suffix to public functions, not a
    prefix.
    Currently the option is not used (it was used to generate protocol
    1 code).
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/python_modules/codegen.py b/python_modules/codegen.py
index f7a2048..bfb2351 100644
--- a/python_modules/codegen.py
+++ b/python_modules/codegen.py
@@ -117,7 +117,7 @@ class CodeWriter:
         writer.index_type = self.index_type
         writer.generated = self.generated
         writer.options = self.options
-        writer.public_prefix = self.public_prefix
+        writer.public_suffix = self.public_suffix
 
         return writer
 
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index e59521c..d3147b7 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -1136,9 +1136,9 @@ def write_channel_parser(writer, channel, server):
 def write_get_channel_parser(writer, channel_parsers, max_channel, is_server):
     writer.newline()
     if is_server:
-        function_name = "spice_get_server_channel_parser" + writer.public_prefix
+        function_name = "spice_get_server_channel_parser" + writer.public_suffix
     else:
-        function_name = "spice_get_client_channel_parser" + writer.public_prefix
+        function_name = "spice_get_client_channel_parser" + writer.public_suffix
 
     scope = writer.function(function_name,
                             "spice_parse_channel_func_t",
@@ -1195,15 +1195,15 @@ def write_full_protocol_parser(writer, is_server):
         function_name = "spice_parse_msg"
     else:
         function_name = "spice_parse_reply"
-    scope = writer.function(function_name + writer.public_prefix,
+    scope = writer.function(function_name + writer.public_suffix,
                             "uint8_t *",
                             "uint8_t *message_start, uint8_t *message_end, uint32_t channel, uint16_t message_type, SPICE_GNUC_UNUSED int minor, size_t *size_out, message_destructor_t *free_message")
     scope.variable_def("spice_parse_channel_func_t", "func" )
 
     if is_server:
-        writer.assign("func", "spice_get_server_channel_parser%s(channel, NULL)" % writer.public_prefix)
+        writer.assign("func", "spice_get_server_channel_parser%s(channel, NULL)" % writer.public_suffix)
     else:
-        writer.assign("func", "spice_get_client_channel_parser%s(channel, NULL)" % writer.public_prefix)
+        writer.assign("func", "spice_get_client_channel_parser%s(channel, NULL)" % writer.public_suffix)
 
     with writer.if_block("func != NULL"):
         writer.statement("return func(message_start, message_end, message_type, minor, size_out, free_message)")
diff --git a/python_modules/marshal.py b/python_modules/marshal.py
index 74f3a54..a09b614 100644
--- a/python_modules/marshal.py
+++ b/python_modules/marshal.py
@@ -412,10 +412,10 @@ def write_protocol_marshaller(writer, proto, is_server, private_marshallers):
         writer.header.end_block(newline=False)
         writer.header.writeln(" SpiceMessageMarshallers;")
         writer.header.newline()
-        writer.header.statement("SpiceMessageMarshallers *spice_message_marshallers_get" + writer.public_prefix+"(void)")
+        writer.header.statement("SpiceMessageMarshallers *spice_message_marshallers_get" + writer.public_suffix+"(void)")
         writer.header.newline()
 
-        scope = writer.function("spice_message_marshallers_get" +  writer.public_prefix,
+        scope = writer.function("spice_message_marshallers_get" +  writer.public_suffix,
                                 "SpiceMessageMarshallers *",
                                 "void")
         writer.writeln("static SpiceMessageMarshallers marshallers = {NULL};").newline()
diff --git a/spice_codegen.py b/spice_codegen.py
index 78857f2..f3190da 100755
--- a/spice_codegen.py
+++ b/spice_codegen.py
@@ -145,8 +145,8 @@ parser.add_option("-k", "--keep-identical-file",
 parser.add_option("-i", "--include",
                   action="append", dest="includes", metavar="FILE",
                   help="Include FILE in generated code")
-parser.add_option("--prefix", dest="prefix",
-                  help="set public symbol prefix", default="")
+parser.add_option("--suffix", dest="suffix",
+                  help="set public symbol suffix", default="")
 parser.add_option("--license", dest="license",
                   help="license to use for generated file(s) (LGPL/BSD)", default="LGPL")
 
@@ -226,7 +226,7 @@ else:
     print >> sys.stderr, "Invalid license specified: %s" % options.license
     sys.exit(1)
 
-writer.public_prefix = options.prefix
+writer.public_suffix = options.suffix
 
 writer.writeln("/* this is a file autogenerated by spice_codegen.py */")
 writer.write(license)


More information about the Spice-commits mailing list