diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-23 17:32:06 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-23 17:32:06 +0200 |
commit | 01a2852a712a4046f6d9a0214c062bebd14c54f6 (patch) | |
tree | ad45a015886f3f10290e35ee55c1f62c457dfed4 /build-aux/mbim-codegen | |
parent | e4c0ceec8e7b0ac8b397e8a3273a48d12121aed2 (diff) | |
download | libmbim-01a2852a712a4046f6d9a0214c062bebd14c54f6.tar.gz |
mbim-codegen: rename 'byte-array' format to 'unsized-byte-array'
We only used this format type in the Service Activation command, and the format
did indeed not have a specific size field for the byte array.
Diffstat (limited to 'build-aux/mbim-codegen')
-rw-r--r-- | build-aux/mbim-codegen/Message.py | 20 | ||||
-rw-r--r-- | build-aux/mbim-codegen/Struct.py | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py index 0e39570..afa07a7 100644 --- a/build-aux/mbim-codegen/Message.py +++ b/build-aux/mbim-codegen/Message.py @@ -48,7 +48,7 @@ def validate_fields(fields): # Look for array size fields, which need to be always read if field['format'] == 'ref-byte-array': pass - elif field['format'] == 'byte-array': + elif field['format'] == 'unsized-byte-array': pass elif field['format'] == 'uuid': pass @@ -203,7 +203,7 @@ class Message: translations['struct'] = field['struct-type'] if 'struct-type' in field else '' translations['public'] = field['public-format'] if 'public-format' in field else field['format'] - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' const guint32 ${field}_size,\n' ' const guint8 *${field},\n') elif field['format'] == 'uuid': @@ -256,7 +256,7 @@ class Message: translations['struct'] = field['struct-type'] if 'struct-type' in field else '' translations['public'] = field['public-format'] if 'public-format' in field else field['format'] - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' * @${field}_size: size of the ${field} array.\n' ' * @${field}: the \'${name}\' field, given as an array of #guint8 values.\n') elif field['format'] == 'uuid': @@ -309,7 +309,7 @@ class Message: translations['struct'] = field['struct-type'] if 'struct-type' in field else '' translations['public'] = field['public-format'] if 'public-format' in field else field['format'] - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' const guint32 ${field}_size,\n' ' const guint8 *${field},\n') elif field['format'] == 'uuid': @@ -374,7 +374,7 @@ class Message: else: inner_template += (' {\n') - if field['format'] == 'byte-array': + if field['format'] == 'unsized-byte-array': inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, ${field}, ${field}_size);\n') elif field['format'] == 'ref-byte-array': inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, ${field}, ${field}_size);\n') @@ -442,7 +442,7 @@ class Message: translations['public'] = field['public-format'] if 'public-format' in field else field['format'] translations['struct'] = field['struct-type'] if 'struct-type' in field else '' - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' guint32 *${field}_size,\n' ' const guint8 **${field},\n') elif field['format'] == 'uuid': @@ -497,7 +497,7 @@ class Message: translations['struct'] = field['struct-type'] if 'struct-type' in field else '' translations['struct_underscore'] = utils.build_underscore_name_from_camelcase (translations['struct']) - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' * @${field}_size: return location for the size of the ${field} array.\n' ' * @${field}: return location for an array of #guint8 values. Do not free the returned value, it is owned by @message.\n') elif field['format'] == 'uuid': @@ -551,7 +551,7 @@ class Message: translations['public'] = field['public-format'] if 'public-format' in field else field['format'] translations['struct'] = field['struct-type'] if 'struct-type' in field else '' - if field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + if field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' guint32 *${field}_size,\n' ' const guint8 **${field},\n') elif field['format'] == 'uuid': @@ -621,7 +621,7 @@ class Message: translations['condition_value'] = condition['value'] inner_template += ( ' if (!(_${condition_field} ${condition_operation} ${condition_value})) {\n') - if field['format'] == 'byte-array' or \ + if field['format'] == 'unsized-byte-array' or \ field['format'] == 'ref-byte-array': inner_template += ( ' if (${field}_size)\n' @@ -658,7 +658,7 @@ class Message: ' if (${field} != NULL)\n' ' *${field} = _${field};\n' ' offset += 4;\n') - elif field['format'] == 'byte-array': + elif field['format'] == 'unsized-byte-array': inner_template += ( ' const guint8 *tmp;\n' ' guint32 tmpsize;\n' diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py index f7a57d2..8907085 100644 --- a/build-aux/mbim-codegen/Struct.py +++ b/build-aux/mbim-codegen/Struct.py @@ -71,7 +71,7 @@ class Struct: if field['format'] == 'uuid': inner_template = ( ' * @${field_name_underscore}: a #MbimUuid.\n') - elif field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + elif field['format'] =='unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = (' * @${field_name_underscore}_size: size of the ${field_name_underscore} array.\n' ' * @${field_name_underscore}: an array of #guint8 values.\n') elif field['format'] == 'guint32': @@ -119,7 +119,7 @@ class Struct: if field['format'] == 'uuid': inner_template = ( ' MbimUuid ${field_name_underscore};\n') - elif field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + elif field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template = ( ' guint32 ${field_name_underscore}_size;\n' ' guint8 *${field_name_underscore};\n') @@ -193,7 +193,7 @@ class Struct: inner_template = '' if field['format'] == 'uuid': pass - elif field['format'] == 'byte-array' or field['format'] == 'ref-byte-array': + elif field['format'] == 'unsized-byte-array' or field['format'] == 'ref-byte-array': inner_template += ( ' g_free (var->${field_name_underscore});\n') elif field['format'] == 'guint32': @@ -320,7 +320,7 @@ class Struct: ' memcpy (out->${field_name_underscore}, tmp, out->${field_name_underscore}_size);\n' ' offset += 8;\n' ' }\n') - elif field['format'] == 'byte-array': + elif field['format'] == 'unsized-byte-array': inner_template += ( '\n' ' {\n' @@ -461,7 +461,7 @@ class Struct: if field['format'] == 'uuid': inner_template = (' _mbim_struct_builder_append_uuid (builder, &(value->${field}));\n') - elif field['format'] == 'byte-array': + elif field['format'] == 'unsized-byte-array': inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, value->${field}, value->${field}_size);\n') elif field['format'] == 'ref-byte-array': inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, value->${field}, value->${field}_size);\n') |