diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2019-03-03 18:49:22 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2019-03-08 21:22:58 +0000 |
commit | cb00ccfaab7fa7ecbe5e40a46399c26d0c532082 (patch) | |
tree | d3a85222075bd486402b507594da35cdd3e9234d /python_modules | |
parent | 302e30ff43401d9b1e7043a5e5c4f186ca997f66 (diff) |
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@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'python_modules')
-rw-r--r-- | python_modules/codegen.py | 2 | ||||
-rw-r--r-- | python_modules/demarshal.py | 10 | ||||
-rw-r--r-- | python_modules/marshal.py | 4 |
3 files changed, 8 insertions, 8 deletions
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() |