aboutsummaryrefslogtreecommitdiffstats
path: root/generator/nanopb.proto
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 18:34:24 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 18:34:24 +0200
commit0ee4bb96b1e53d16a29869864eff87c8934894ae (patch)
tree8ec4a0822eb8b666f6dac2918a4c0c0051f97b49 /generator/nanopb.proto
parent28b0136ea4dcd045f0422d16a25b7d82b0d2aaee (diff)
Allow defining field type in .proto.
Update issue 30 Status: FixedInGit
Diffstat (limited to 'generator/nanopb.proto')
-rw-r--r--generator/nanopb.proto7
1 files changed, 7 insertions, 0 deletions
diff --git a/generator/nanopb.proto b/generator/nanopb.proto
index a377f63b..e7bea139 100644
--- a/generator/nanopb.proto
+++ b/generator/nanopb.proto
@@ -7,9 +7,16 @@
import "google/protobuf/descriptor.proto";
+enum FieldType {
+ FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
+ FT_CALLBACK = 1; // Always generate a callback field.
+ FT_STATIC = 2; // Generate a static field or raise an exception if not possible.
+}
+
message NanoPBOptions {
optional int32 max_size = 1;
optional int32 max_count = 2;
+ optional FieldType type = 3 [default = FT_DEFAULT];
}
// Protocol Buffers extension number registry