From d58ccabab7fd097737bee91b9fcb4f2ee48c2a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 13 May 2025 14:11:01 +0200 Subject: utils: codegen: ipc: Add `deserializer()` function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `deserializer()` in `serializer.tmpl` to have a single function that generates all the necessary functions into the template specialization like `serializer()`. This also avoids the duplication of some conditional logic. Signed-off-by: Barnabás Pőcze Reviewed-by: Paul Elder Reviewed-by: Jacopo Mondi --- .../ipc/generators/libcamera_templates/serializer.tmpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl') diff --git a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl index 114e349c..d07836cc 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl @@ -317,3 +317,17 @@ return ret; } {%- endmacro %} + +{# + # \brief Deserialize a struct + # + # Generate code for IPADataSerializer specialization, for deserializing \a struct. + #} +{%- macro deserializer(struct) %} +{%- if struct|has_fd %} +{{deserializer_fd(struct)}} +{%- else %} +{{deserializer_no_fd(struct)}} +{{deserializer_fd_simple(struct)}} +{%- endif %} +{%- endmacro %} -- cgit v1.2.1