From: Philippe Proulx Date: Thu, 3 Sep 2020 14:11:55 +0000 (-0400) Subject: templates: add licence headers to all templates X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=fdbf874096d3bf7a058b871761e686ce2e84a4ac;p=deliverable%2Fbarectf.git templates: add licence headers to all templates Signed-off-by: Philippe Proulx --- diff --git a/barectf/templates/c/align-statements-comment.j2 b/barectf/templates/c/align-statements-comment.j2 index 1288321..46c7faa 100644 --- a/barectf/templates/c/align-statements-comment.j2 +++ b/barectf/templates/c/align-statements-comment.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% if op.names %} {% if op.names | length == 1 %} /* align for {{ root_ft_prefix_names[op.top_name] }} structure */ diff --git a/barectf/templates/c/barectf.c-macros.j2 b/barectf/templates/c/barectf.c-macros.j2 index b189e75..5ae2501 100644 --- a/barectf/templates/c/barectf.c-macros.j2 +++ b/barectf/templates/c/barectf.c-macros.j2 @@ -1,3 +1,28 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} + {% import 'common.j2' as common %} {% set prefix = common.prefix %} diff --git a/barectf/templates/c/barectf.c.j2 b/barectf/templates/c/barectf.c.j2 index 2d35c92..e80eb7f 100644 --- a/barectf/templates/c/barectf.c.j2 +++ b/barectf/templates/c/barectf.c.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} {% import 'c/common.j2' as c_common %} {% import 'c/barectf.c-macros.j2' as macros %} diff --git a/barectf/templates/c/barectf.h.j2 b/barectf/templates/c/barectf.h.j2 index c2b7bbb..800f49e 100644 --- a/barectf/templates/c/barectf.h.j2 +++ b/barectf/templates/c/barectf.h.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} {% import 'c/common.j2' as c_common %} {% set prefix = common.prefix %} diff --git a/barectf/templates/c/bitfield.h.j2 b/barectf/templates/c/bitfield.h.j2 index 51ea797..163c8d6 100644 --- a/barectf/templates/c/bitfield.h.j2 +++ b/barectf/templates/c/bitfield.h.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} {% set prefix = common.prefix %} {% set ucprefix = common.ucprefix %} diff --git a/barectf/templates/c/close-func-proto.j2 b/barectf/templates/c/close-func-proto.j2 index 9ee497a..a7b9f98 100644 --- a/barectf/templates/c/close-func-proto.j2 +++ b/barectf/templates/c/close-func-proto.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} /* close packet for stream type `{{ stream_type.name }}` */ void {{ common.prefix }}{{ stream_type.name }}_close_packet(struct {{ common.prefix }}{{ stream_type.name }}_ctx *sctx) diff --git a/barectf/templates/c/common.j2 b/barectf/templates/c/common.j2 index 10f064e..f1d7788 100644 --- a/barectf/templates/c/common.j2 +++ b/barectf/templates/c/common.j2 @@ -1,3 +1,28 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} + {# # Common variables and macros (for C templates). #} diff --git a/barectf/templates/c/ctx-init-func-proto.j2 b/barectf/templates/c/ctx-init-func-proto.j2 index 87082bc..a99732f 100644 --- a/barectf/templates/c/ctx-init-func-proto.j2 +++ b/barectf/templates/c/ctx-init-func-proto.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} /* initialize context */ void {{ common.prefix }}init(void *vctx, diff --git a/barectf/templates/c/func-proto-params.j2 b/barectf/templates/c/func-proto-params.j2 index af1ad4b..5d30cc5 100644 --- a/barectf/templates/c/func-proto-params.j2 +++ b/barectf/templates/c/func-proto-params.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% for param in params %} {% set c_type = param.ft | ft_c_type %}, {{ c_type }}{{ ' ' if not c_type.endswith('*') }}{{ prefix }}_{{ param.name }} diff --git a/barectf/templates/c/open-func-proto.j2 b/barectf/templates/c/open-func-proto.j2 index 05fda9a..919543b 100644 --- a/barectf/templates/c/open-func-proto.j2 +++ b/barectf/templates/c/open-func-proto.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} /* open packet for stream type `{{ stream_type.name }}` */ void {{ common.prefix }}{{ stream_type.name }}_open_packet( diff --git a/barectf/templates/c/serialize-align-statements.j2 b/barectf/templates/c/serialize-align-statements.j2 index 9f812cc..49c738b 100644 --- a/barectf/templates/c/serialize-align-statements.j2 +++ b/barectf/templates/c/serialize-align-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% include 'c/align-statements-comment.j2' %} _ALIGN(ctx->at, {{ op.value }}); diff --git a/barectf/templates/c/serialize-write-bit-array-statements.j2 b/barectf/templates/c/serialize-write-bit-array-statements.j2 index 6562e58..2e8443e 100644 --- a/barectf/templates/c/serialize-write-bit-array-statements.j2 +++ b/barectf/templates/c/serialize-write-bit-array-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} {% set bo = 'le' if op.ft.byte_order == barectf_config.ByteOrder.LITTLE_ENDIAN else 'be' %} {{ common.prefix }}bt_bitfield_write_{{ bo }}(&ctx->buf[_BITS_TO_BYTES(ctx->at)], diff --git a/barectf/templates/c/serialize-write-ev-type-id-statements.j2 b/barectf/templates/c/serialize-write-ev-type-id-statements.j2 index 2266335..e773aa7 100644 --- a/barectf/templates/c/serialize-write-ev-type-id-statements.j2 +++ b/barectf/templates/c/serialize-write-ev-type-id-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% set c_type = op.ft | ft_c_type %} {% set src = 'ev_type_id' %} /* write event type ID field */ diff --git a/barectf/templates/c/serialize-write-int-statements.j2 b/barectf/templates/c/serialize-write-int-statements.j2 index 98701a6..e163143 100644 --- a/barectf/templates/c/serialize-write-int-statements.j2 +++ b/barectf/templates/c/serialize-write-int-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} {% set c_type = op.ft | ft_c_type %} {% set src = c_common.op_src(op) %} diff --git a/barectf/templates/c/serialize-write-magic-statements.j2 b/barectf/templates/c/serialize-write-magic-statements.j2 index 581eaa5..8b7c726 100644 --- a/barectf/templates/c/serialize-write-magic-statements.j2 +++ b/barectf/templates/c/serialize-write-magic-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% set c_type = op.ft | ft_c_type %} {% set src = '0xc1fc1fc1UL' %} /* write magic number field */ diff --git a/barectf/templates/c/serialize-write-packet-size-statements.j2 b/barectf/templates/c/serialize-write-packet-size-statements.j2 index 63894f5..0022e44 100644 --- a/barectf/templates/c/serialize-write-packet-size-statements.j2 +++ b/barectf/templates/c/serialize-write-packet-size-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% set c_type = op.ft | ft_c_type %} {% set src = 'ctx->packet_size' %} /* write packet total size field */ diff --git a/barectf/templates/c/serialize-write-real-statements.j2 b/barectf/templates/c/serialize-write-real-statements.j2 index 30fd9d4..15d5675 100644 --- a/barectf/templates/c/serialize-write-real-statements.j2 +++ b/barectf/templates/c/serialize-write-real-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} {% set union_name = 'f2u' if op.ft.size == 32 else 'd2u' %} {% set c_type = 'uint32_t' if op.ft.size == 32 else 'uint64_t' %} diff --git a/barectf/templates/c/serialize-write-saved-int-statements.j2 b/barectf/templates/c/serialize-write-saved-int-statements.j2 index e0afd43..7fba093 100644 --- a/barectf/templates/c/serialize-write-saved-int-statements.j2 +++ b/barectf/templates/c/serialize-write-saved-int-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} {% set c_type = op.ft | ft_c_type %} {% include 'c/serialize-write-statements-comment.j2' %} diff --git a/barectf/templates/c/serialize-write-skip-save-statements.j2 b/barectf/templates/c/serialize-write-skip-save-statements.j2 index 0071533..5a5e332 100644 --- a/barectf/templates/c/serialize-write-skip-save-statements.j2 +++ b/barectf/templates/c/serialize-write-skip-save-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} /* do not write `{{ op.top_name }}` field; save its offset */ sctx->off_{{ c_common.op_src(op) }} = ctx->at; diff --git a/barectf/templates/c/serialize-write-statements-comment.j2 b/barectf/templates/c/serialize-write-statements-comment.j2 index 9a0a4e3..12fd9c6 100644 --- a/barectf/templates/c/serialize-write-statements-comment.j2 +++ b/barectf/templates/c/serialize-write-statements-comment.j2 @@ -1 +1,25 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} /* write `{{ op.top_name }}` field */ diff --git a/barectf/templates/c/serialize-write-stream-type-id-statements.j2 b/barectf/templates/c/serialize-write-stream-type-id-statements.j2 index f3732b2..4384efb 100644 --- a/barectf/templates/c/serialize-write-stream-type-id-statements.j2 +++ b/barectf/templates/c/serialize-write-stream-type-id-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% set c_type = op.ft | ft_c_type %} {% set src = stream_type.id %} /* write stream type ID field */ diff --git a/barectf/templates/c/serialize-write-string-statements.j2 b/barectf/templates/c/serialize-write-string-statements.j2 index 1da8d67..03c76a2 100644 --- a/barectf/templates/c/serialize-write-string-statements.j2 +++ b/barectf/templates/c/serialize-write-string-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} {% include 'c/serialize-write-statements-comment.j2' %} diff --git a/barectf/templates/c/serialize-write-time-statements.j2 b/barectf/templates/c/serialize-write-time-statements.j2 index 004640f..28f5a8a 100644 --- a/barectf/templates/c/serialize-write-time-statements.j2 +++ b/barectf/templates/c/serialize-write-time-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% set c_type = op.ft | ft_c_type %} {% set src = 'ts' %} /* write {{ 'beginning ' if op.top_name == 'timestamp_begin' }}time field */ diff --git a/barectf/templates/c/serialize-write-uuid-statements.j2 b/barectf/templates/c/serialize-write-uuid-statements.j2 index 26d09fc..825b5a8 100644 --- a/barectf/templates/c/serialize-write-uuid-statements.j2 +++ b/barectf/templates/c/serialize-write-uuid-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} /* write UUID */ { static uint8_t uuid[] = { diff --git a/barectf/templates/c/size-align-statements.j2 b/barectf/templates/c/size-align-statements.j2 index 102b714..e09b756 100644 --- a/barectf/templates/c/size-align-statements.j2 +++ b/barectf/templates/c/size-align-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% include 'c/align-statements-comment.j2' %} _ALIGN(at, {{ op.value }}); diff --git a/barectf/templates/c/size-write-bit-array-statements.j2 b/barectf/templates/c/size-write-bit-array-statements.j2 index 9f189a2..676709e 100644 --- a/barectf/templates/c/size-write-bit-array-statements.j2 +++ b/barectf/templates/c/size-write-bit-array-statements.j2 @@ -1,2 +1,26 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} /* add `{{ op.top_name }}` bit array field's size */ at += {{ op.ft.size }}; diff --git a/barectf/templates/c/size-write-string-statements.j2 b/barectf/templates/c/size-write-string-statements.j2 index 2c47fbe..e438c7a 100644 --- a/barectf/templates/c/size-write-string-statements.j2 +++ b/barectf/templates/c/size-write-string-statements.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'c/common.j2' as c_common %} /* add `{{ op.top_name }}` string field's size */ at += _BYTES_TO_BITS(strlen({{ c_common.op_src(op) }}) + 1); diff --git a/barectf/templates/c/trace-func-proto.j2 b/barectf/templates/c/trace-func-proto.j2 index e3e6ba8..9b221ef 100644 --- a/barectf/templates/c/trace-func-proto.j2 +++ b/barectf/templates/c/trace-func-proto.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} /* trace (stream type `{{ stream_type.name }}`, event type `{{ ev_type.name }}`) */ void {{ common.prefix }}{{ stream_type.name }}_trace_{{ ev_type.name }}(struct {{ common.prefix }}{{ stream_type.name }}_ctx *sctx{{ (stream_type, ev_type) | trace_func_params_str }}) diff --git a/barectf/templates/common.j2 b/barectf/templates/common.j2 index 4a05f97..61e490a 100644 --- a/barectf/templates/common.j2 +++ b/barectf/templates/common.j2 @@ -1,3 +1,28 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} + {# # Common variables and macros (for any template). #} diff --git a/barectf/templates/metadata/enum-ft.j2 b/barectf/templates/metadata/enum-ft.j2 index 9a67738..cf6b127 100644 --- a/barectf/templates/metadata/enum-ft.j2 +++ b/barectf/templates/metadata/enum-ft.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} enum : {{ ft | int_ft_str }} { {% for label, mapping in ft.mappings.items() %} {% for rg in mapping.ranges %} diff --git a/barectf/templates/metadata/int-ft.j2 b/barectf/templates/metadata/int-ft.j2 index a172000..968baff 100644 --- a/barectf/templates/metadata/int-ft.j2 +++ b/barectf/templates/metadata/int-ft.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} integer { signed = {{ 'true' if is_signed else 'false' }}; size = {{ ft.size }}; diff --git a/barectf/templates/metadata/metadata.j2 b/barectf/templates/metadata/metadata.j2 index be9d426..b3c39b7 100644 --- a/barectf/templates/metadata/metadata.j2 +++ b/barectf/templates/metadata/metadata.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} {% import 'common.j2' as common %} /* CTF 1.8 */ diff --git a/barectf/templates/metadata/real-ft.j2 b/barectf/templates/metadata/real-ft.j2 index d70fbfd..40f297e 100644 --- a/barectf/templates/metadata/real-ft.j2 +++ b/barectf/templates/metadata/real-ft.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} floating_point { mant_dig = {{ 24 if ft.size == 32 else 53 }}; exp_dig = {{ 8 if ft.size == 32 else 11 }}; diff --git a/barectf/templates/metadata/str-ft.j2 b/barectf/templates/metadata/str-ft.j2 index 6de8a2b..d0d9bea 100644 --- a/barectf/templates/metadata/str-ft.j2 +++ b/barectf/templates/metadata/str-ft.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} string { encoding = UTF8; } diff --git a/barectf/templates/metadata/struct-ft.j2 b/barectf/templates/metadata/struct-ft.j2 index 338d8e3..f75e428 100644 --- a/barectf/templates/metadata/struct-ft.j2 +++ b/barectf/templates/metadata/struct-ft.j2 @@ -1,3 +1,27 @@ +{# + # The MIT License (MIT) + # + # Copyright (c) 2020 Philippe Proulx + # + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + # + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + # + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #} struct { {% for name, member in ft.members.items() %} {#