summaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2016-02-06 13:57:38 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2016-02-06 13:57:38 +0200
commit4507b0066c1a75c4f85d8d595a2236d0c84cb312 (patch)
treefe14a514ae5f3252dc7eee22cc0d2535e138377b /generator/nanopb_generator.py
parent3b6099faa2d829c74c9576f4aa1ce4b237c997db (diff)
Add code generator insertion points to files (#178).
Diffstat (limited to 'generator/nanopb_generator.py')
-rwxr-xr-xgenerator/nanopb_generator.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index d16fd828..3c1f4341 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -812,6 +812,7 @@ class Message:
result += ' char dummy_field;'
result += '\n'.join([str(f) for f in self.ordered_fields])
+ result += '\n/* @@protoc_insertion_point(struct:%s) */' % self.name
result += '\n}'
if self.packed:
@@ -1054,6 +1055,8 @@ class ProtoFile:
noext = os.path.splitext(incfile)[0]
yield options.genformat % (noext + options.extension + '.h')
yield '\n'
+
+ yield '/* @@protoc_insertion_point(includes) */\n'
yield '#if PB_PROTO_HEADER_VERSION != 30\n'
yield '#error Regenerate this file with the current version of nanopb generator.\n'
@@ -1149,6 +1152,7 @@ class ProtoFile:
yield '#endif\n'
# End of header
+ yield '/* @@protoc_insertion_point(eof) */\n'
yield '\n#endif\n'
def generate_source(self, headername, options):
@@ -1161,6 +1165,7 @@ class ProtoFile:
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
yield options.genformat % (headername)
yield '\n'
+ yield '/* @@protoc_insertion_point(includes) */\n'
yield '#if PB_PROTO_HEADER_VERSION != 30\n'
yield '#error Regenerate this file with the current version of nanopb generator.\n'
@@ -1253,6 +1258,7 @@ class ProtoFile:
yield 'PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)\n'
yield '\n'
+ yield '/* @@protoc_insertion_point(eof) */\n'
# ---------------------------------------------------------------------------
# Options parsing for the .proto files