Files
bproto/template/c/template/include/enums.h.jinja2
2025-04-14 14:43:03 +02:00

26 lines
752 B
Django/Jinja

#pragma once
typedef enum {
{{protocol.name}}_PARSER_RESULT_OK,
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_SIZE,
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_ID,
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_CRC,
} {{protocol.name}}_PARSER_RESULT;
typedef enum {
{%- for msg in messages %}
{{msg.id_name}} = {{msg.id}}{% if not loop.last %},{% endif %}
{%- endfor %}
} {{protocol.name}}_MSG_ID ;
typedef enum {
{%- for msg in messages %}
{{msg.size_name}} = {{msg.size}}{% if not loop.last %},{% endif %}
{%- endfor %}
} {{protocol.name}}_MSG_SIZE;
{% for enum in enums %}
typedef enum {
{%- for v in enum.consts %}
{{ v[0] }} = {{ v[1] }}{% if not loop.last %},{% endif %}
{%- endfor %}
} {{enum.name}};
{% endfor %}