_CCodeGenerator.generate_c_src(): use Jinja 2 templates
[deliverable/barectf.git] / barectf / templates / c / common.j2
1 {#
2 # Common variables and macros (for C templates).
3 #}
4
5 {% import 'common.j2' as common %}
6
7 {# generic barectf context structure name #}
8 {% set ctx_struct_name %}{{ common.prefix }}ctx{% endset %}
9
10 {#
11 # Generates the name of a tracing function for the stream type
12 # `stream_type` and the event type `ev_type`.
13 #
14 # Example:
15 #
16 # barectf_my_stream_trace_my_event
17 #}
18 {% macro trace_func_name(stream_type, ev_type) %}
19 {{ common.prefix }}{{ stream_type.name }}_trace_{{ ev_type.name }}
20 {%- endmacro %}
21
22 {#
23 # Generates the name of a source variable from the names of the
24 # operation `op`.
25 #
26 # Example:
27 #
28 # ep_msg_id
29 #}
30 {% macro op_src(op) %}
31 {{ op.names | join('_') }}
32 {%- endmacro %}
This page took 0.02974 seconds and 4 git commands to generate.