summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-08-22 18:57:23 +0000
committerPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-08-22 18:57:23 +0000
commit5a9f85b87615078868d3b394370a30b550186cce (patch)
treefd2b911a5708f341fcf2b839d05e8e5653bd99ab /docs
parent494fbd91e4e5574a4cf8dbe69b3f80a08e97e85b (diff)
unittests, change to PB_LTYPE_BYTES data size
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@959 e3a754e5-d11d-0410-8d38-ebb782a927b9
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst1
-rw-r--r--docs/reference.rst4
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst
index ea891237..f2f8dcfd 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -47,6 +47,7 @@ Features and limitations
#) Encoding is focused on writing to streams. For memory buffers only it could be made more efficient.
#) The deprecated Protocol Buffers feature called "groups" is not supported.
#) Fields in the generated structs are ordered by the tag number, instead of the natural ordering in .proto file.
+#) Unknown fields are not preserved when decoding and re-encoding a message.
Getting started
===============
diff --git a/docs/reference.rst b/docs/reference.rst
index 2812958f..2fc3d481 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -61,7 +61,7 @@ Describes a single structure field with memory position in relation to others. T
:type: LTYPE and HTYPE of the field.
:data_offset: Offset of field data, relative to the end of the previous field.
:size_offset: Offset of *bool* flag for optional fields or *size_t* count for arrays, relative to field data.
-:data_size: Size of a single data entry, in bytes.
+:data_size: Size of a single data entry, in bytes. For PB_LTYPE_BYTES, the size of the byte array inside the containing structure.
:array_size: Maximum number of entries in an array, if it is an array type.
:ptr: Pointer to default value for optional fields, or to submessage description for PB_LTYPE_SUBMESSAGE.
@@ -339,7 +339,7 @@ Read and decode all fields of a structure. Reads until EOF on input stream. ::
:dest_struct: Pointer to structure where data will be stored.
:returns: True on success, false on IO error, on detectable errors in field description, if a field encoder returns false or if a required field is missing.
-In Protocol Buffers binary format, EOF is only allowed between fields. If it happens anywhere else, pb_decode will return *false*.
+In Protocol Buffers binary format, EOF is only allowed between fields. If it happens anywhere else, pb_decode will return *false*. If pb_decode returns false, you cannot trust any of the data in the structure.
In addition to EOF, the pb_decode implementation supports terminating a message with a 0 byte. This is compatible with the official Protocol Buffers because 0 is never a valid field tag.