diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-12 22:45:46 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-12 22:45:46 +0200 |
commit | b72136e806e94ac9351b05e7871fa1a05bc3fb2f (patch) | |
tree | de5f245ff93128c1a16073b1f519feaee902048c | |
parent | 9f60c777c3fb9602fcf315c0b89a5a7ceb8f04fc (diff) |
build-aux,mbim-codegen: report ms-struct and ms-struct-array as nullable
These two fields should be treated as optional fields that may or may
not be given in the message response, and therefore %NULL is a valid
output value for them even when the parsing is successful, unlike most
other fields in the MBIM protocol.
-rw-r--r-- | build-aux/mbim-codegen/Message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py index 29de874..7a6673f 100644 --- a/build-aux/mbim-codegen/Message.py +++ b/build-aux/mbim-codegen/Message.py @@ -568,14 +568,14 @@ class Message: elif field['format'] == 'struct': inner_template = (' * @out_${field}: (out)(optional)(transfer full): return location for a newly allocated #${struct}, or %NULL if the \'${name}\' field is not needed. Free the returned value with ${struct_underscore}_free().\n') elif field['format'] == 'ms-struct': - inner_template = (' * @out_${field}: (out)(optional)(transfer full): return location for a newly allocated #${struct}, or %NULL if the \'${name}\' field is not needed. Free the returned value with ${struct_underscore}_free().\n') + inner_template = (' * @out_${field}: (out)(optional)(nullable)(transfer full): return location for a newly allocated #${struct}, or %NULL if the \'${name}\' field is not needed. The availability of this field is not always guaranteed, and therefore %NULL may be given as a valid output. Free the returned value with ${struct_underscore}_free().\n') elif field['format'] == 'struct-array': inner_template = (' * @out_${field}: (out)(optional)(transfer full)(array zero-terminated=1)(element-type ${struct}): return location for a newly allocated array of #${struct} items, or %NULL if the \'${name}\' field is not needed. Free the returned value with ${struct_underscore}_array_free().\n') elif field['format'] == 'ref-struct-array': inner_template = (' * @out_${field}: (out)(optional)(transfer full)(array zero-terminated=1)(element-type ${struct}): return location for a newly allocated array of #${struct} items, or %NULL if the \'${name}\' field is not needed. Free the returned value with ${struct_underscore}_array_free().\n') elif field['format'] == 'ms-struct-array': inner_template = (' * @out_${field}_count: (out)(optional)(transfer none): return location for a #guint32, or %NULL if the field is not needed.\n' - ' * @out_${field}: (out)(optional)(transfer full)(array zero-terminated=1)(element-type ${struct}): return location for a newly allocated array of #${struct} items, or %NULL if the \'${name}\' field is not needed. Free the returned value with ${struct_underscore}_array_free().\n') + ' * @out_${field}: (out)(optional)(nullable)(transfer full)(array zero-terminated=1)(element-type ${struct}): return location for a newly allocated array of #${struct} items, or %NULL if the \'${name}\' field is not needed. The availability of this field is not always guaranteed, and therefore %NULL may be given as a valid output. Free the returned value with ${struct_underscore}_array_free().\n') elif field['format'] == 'ipv4': inner_template = (' * @out_${field}: (out)(optional)(transfer none): return location for a #MbimIPv4, or %NULL if the \'${name}\' field is not needed. Do not free the returned value, it is owned by @message.\n') elif field['format'] == 'ref-ipv4': |