_CCodeGenerator.generate_header(): use Jinja 2 templates
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 27 Aug 2020 19:51:52 +0000 (15:51 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Aug 2020 14:44:19 +0000 (10:44 -0400)
commit1b49c7b8d6a0681d5f75402dd7c73ef36f58675d
tree7c27a6590776117245a5e0c545fa30b54cef0fe8
parenta8731bda3155750398e4b1b031523d5692702a40
_CCodeGenerator.generate_header(): use Jinja 2 templates

This patch makes _CCodeGenerator.generate_header() generate the main
barectf header file using Jinja 2 templates.

The master template, `barectf.h.j2`, includes:

`c-common.j2`:
    Common macros for C templates.

`c-ctx-init-func-proto.j2`:
    Context initialization function prototype.

`c-open-func-proto.j2`:
    Packet opening function prototype.

`c-close-func-proto.j2`:
    Packet closing function prototype.

`c-trace-func-proto.j2`:
    Tracing function prototype.

This patch removes a lot of code from `gen.py` and `templates.py` which
now has its equivalent in Jinja 2 templates.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/gen.py
barectf/templates.py
barectf/templates/barectf.h.j2 [new file with mode: 0644]
barectf/templates/c-close-func-proto.j2 [new file with mode: 0644]
barectf/templates/c-common.j2 [new file with mode: 0644]
barectf/templates/c-ctx-init-func-proto.j2 [new file with mode: 0644]
barectf/templates/c-open-func-proto.j2 [new file with mode: 0644]
barectf/templates/c-trace-func-proto.j2 [new file with mode: 0644]
barectf/templates/common.j2
barectf/templates/metadata.j2
This page took 0.023052 seconds and 4 git commands to generate.