diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-09 11:24:15 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-09 15:23:47 +0200 |
commit | a873852f8e0e4f248e0b7bb9acf6ab232bfcf644 (patch) | |
tree | 53a0647a102d04c92a731ed56ee091b56b3dda55 /build-aux | |
parent | d2e47956d284aa8357c1139db9db88bbf5edd892 (diff) |
qmi-codegen: request creator and response/indication parsers are private
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/qmi-codegen/Client.py | 6 | ||||
-rw-r--r-- | build-aux/qmi-codegen/Message.py | 48 |
2 files changed, 8 insertions, 46 deletions
diff --git a/build-aux/qmi-codegen/Client.py b/build-aux/qmi-codegen/Client.py index 1672f71..5aa9478 100644 --- a/build-aux/qmi-codegen/Client.py +++ b/build-aux/qmi-codegen/Client.py @@ -157,7 +157,7 @@ class Client: ' GError *error = NULL;\n' '\n' ' /* Parse indication */\n' - ' output = ${message_fullname_underscore}_indication_parse (message, &error);\n' + ' output = __${message_fullname_underscore}_indication_parse (message, &error);\n' ' if (!output) {\n' ' g_warning ("Couldn\'t parse \'${message_name}\' indication: %s",\n' ' error ? error->message : "Unknown error");\n' @@ -343,7 +343,7 @@ class Client: ' }\n' '\n' ' /* Parse reply */\n' - ' output = ${message_fullname_underscore}_response_parse (reply, &error);\n' + ' output = __${message_fullname_underscore}_response_parse (reply, &error);\n' ' if (!output)\n' ' g_simple_async_result_take_error (simple, error);\n' ' else\n' @@ -388,7 +388,7 @@ class Client: ' user_data,\n' ' ${underscore}_${message_underscore});\n' '\n' - ' request = ${message_fullname_underscore}_request_create (\n' + ' request = __${message_fullname_underscore}_request_create (\n' ' qmi_client_get_next_transaction_id (QMI_CLIENT (self)),\n' ' qmi_client_get_cid (QMI_CLIENT (self)),\n' ' ${input_var},\n' diff --git a/build-aux/qmi-codegen/Message.py b/build-aux/qmi-codegen/Message.py index 25e6adb..3eaff1c 100644 --- a/build-aux/qmi-codegen/Message.py +++ b/build-aux/qmi-codegen/Message.py @@ -88,21 +88,8 @@ class Message: input_arg_template = 'gpointer unused' if self.input.fields is None else '${container} *input' template = ( '\n' - 'QmiMessage *${underscore}_request_create (\n' - ' guint8 transaction_id,\n' - ' guint8 cid,\n' - ' %s,\n' - ' GError **error);\n' % input_arg_template) - hfile.write(string.Template(template).substitute(translations)) - - # Emit message creator - template = ( - '\n' - '/**\n' - ' * ${underscore}_request_create:\n' - ' */\n' - 'QmiMessage *\n' - '${underscore}_request_create (\n' + 'static QmiMessage *\n' + '__${underscore}_request_create (\n' ' guint8 transaction_id,\n' ' guint8 cid,\n' ' %s,\n' @@ -196,24 +183,8 @@ class Message: template = ( '\n' - '${container} *${underscore}_${type}_parse (\n' - ' QmiMessage *message,\n' - ' GError **error);\n') - hfile.write(string.Template(template).substitute(translations)) - - template = ( - '\n' - '/**\n' - ' * ${underscore}_${type}_parse:\n' - ' * @message: a #QmiMessage ${type}.\n' - ' * @error: Return location for error or %%NULL.\n' - ' *\n' - ' * Parse the \'${name}\' ${type}.\n' - ' *\n' - ' * Returns: a #${container} which should be disposed with ${container_underscore}_unref(), or #NULL if @error is set.\n' - ' */\n' - '${container} *\n' - '${underscore}_${type}_parse (\n' + 'static ${container} *\n' + '__${underscore}_${type}_parse (\n' ' QmiMessage *message,\n' ' GError **error)\n' '{\n' @@ -466,16 +437,7 @@ class Message: '${public_types}' '${public_methods}' '<SUBSECTION Private>\n' - '${private}') - - if self.input: - template += '${fullname_underscore}_request_create\n' - - if self.output.fields is not None: - template += ( - '${fullname_underscore}_${type}_parse\n') - - template += ( + '${private}' '<SUBSECTION Standard>\n' '${standard}' '</SECTION>\n' |