From: Petteri Aimonen Date: Mon, 29 Oct 2012 17:33:33 +0000 (+0200) Subject: Document new generator options X-Git-Tag: 3.99.1~14^2~444 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=ad9a885644d0c3e61eecd796ea227edded96a2b5;p=apps%2Flow-level-can-service.git Document new generator options --- diff --git a/CHANGELOG b/CHANGELOG index 1effb16..c720289 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,13 @@ +nanopb-0.1.7 (not yet released) + Remove "skip" mode from pb_istream_t callbacks. Example implementation had a bug. (issue 37) + Add option to use shorter names for enum values (issue 38) + Improve options support in generator (issues 12, 30) + Add nanopb version number to generated files (issue 36) + Add extern "C" to generated headers (issue 35) + Add names for structs to allow forward declaration (issue 39) + Add buffer size check in example (issue 34) + Fix build warnings on MS compilers (issue 33) + nanopb-0.1.6 Reorganize the field decoder interface (issue 2) Improve performance in submessage decoding (issue 28) diff --git a/docs/concepts.rst b/docs/concepts.rst index 355af25..b18c505 100644 --- a/docs/concepts.rst +++ b/docs/concepts.rst @@ -38,6 +38,20 @@ This file, in turn, requires the file *google/protobuf/descriptor.proto*. This i protoc -I/usr/include -Inanopb/generator -I. -omessage.pb message.proto +The options can be defined in file, message and field scopes:: + + option (nanopb_fileopt).max_size = 20; // File scope + message Message + { + option (nanopb_msgopt).max_size = 30; // Message scope + required string fieldsize = 1 [(nanopb).max_size = 40]; // Field scope + } + +It is also possible to give the options on command line, but then they will affect the whole file. For example:: + + user@host:~$ python ../generator/nanopb_generator.py -s 'max_size: 20' message.pb + + Streams =======