Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nanopb
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
le
nanopb
Commits
4507b006
Commit
4507b006
authored
9 years ago
by
Petteri Aimonen
Browse files
Options
Downloads
Patches
Plain Diff
Add code generator insertion points to files (#178).
parent
3b6099fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generator/nanopb_generator.py
+6
-0
6 additions, 0 deletions
generator/nanopb_generator.py
with
6 additions
and
0 deletions
generator/nanopb_generator.py
+
6
−
0
View file @
4507b006
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment