summaryrefslogtreecommitdiffstats
path: root/pb.h
AgeCommit message (Collapse)AuthorFilesLines
2017-02-22Extend inline / fixed length bytes array support (issue #244)Petteri Aimonen1-37/+21
Adds support for proto3 and POINTER field types to have fixed length bytes arrays. Also changed the .proto option to a separate fixed_length:true, while also supporting the old FT_INLINE option. Restructured the generator and decoder logic to threat the inline bytes fields more like "just another field type".
2017-02-12Zero-valued extension fields were mistakenly ignored by encoder. (issue #242)Petteri Aimonen1-2/+7
2016-12-31Fix multiple oneofs in same message (issue #229)Petteri Aimonen1-0/+2
Previously the field iterator logic didn't know whether two oneof fields were part of the same union, or separate. This caused wrong pointers to be calculated if multiple oneofs were inside a single message. This commit fixes this by using dataoffset of PB_SIZE_MAX to indicate union fields after the first field. Theoretically PB_SIZE_MAX is also a valid value for data offset, which could cause errors. Adding a compile-time assert for this is somewhat difficult. However I consider it extremely unlikely that there is any platform that could trigger this situation, as it would require 255 bytes of extra data/padding between two protobuf oneof fields. On 64-bit architectures the worst case is 16 bytes, and even esoteric platforms only align to 64 bytes or so. Manual modification of the generated .pb.h file could trigger this, but even then it would require pretty bad luck to happen.
2016-10-30Setting version to 0.3.8-devPetteri Aimonen1-1/+1
2016-10-30Publishing nanopb-0.3.7Petteri Aimonen1-1/+1
2016-10-09Add proto3 option to handle singular fieldsBernhard Krämer1-0/+13
2016-08-04Add inline allocation of bytes fieldsTom Roeder1-2/+25
This commit adds a new FT_INLINE allocation type that forces bytes fields to be inlined into the struct. E.g., pb_byte_t my_bytes[32]. This requires max_size for the bytes field. The FT_INLINE type is represented as a new LTYPE: FT_LTYPE_FIXED_LENGTH_BYTES. This commit also updates the documentation with FT_INLINE and FT_LTYPE_FIXED_LENGTH_BYTES. Added an AUTHORS file in apparent order of appearance in the git log history from $(git log --all).
2016-06-19Setting version to 0.3.7-devPetteri Aimonen1-1/+1
2016-06-19Publishing nanopb-0.3.6Petteri Aimonen1-1/+1
2016-02-13Setting version to 0.3.6-devPetteri Aimonen1-1/+1
2016-02-13Publishing nanopb-0.3.5Petteri Aimonen1-1/+1
2016-01-27Remove obsolete __BIG_ENDIAN__ compilation option.Petteri Aimonen1-4/+0
This is now handled automatically using shift operations.
2016-01-27Replace uint8_t with a pb_byte_t typedef.Petteri Aimonen1-11/+15
This supports platforms where uint8_t does not exist. If you are using a custom pb_syshdr.h, this may require adding definitions for uint_least8_t etc.
2016-01-27Modify the int size STATIC_ASSERTS to work with CHAR_BITS!=8.Petteri Aimonen1-9/+3
This will still catch the most common bug of long int vs. long long int. The uint8_t checks do not seem necessary, test for this will be added in later commit.
2015-11-14Add testcase for anonymous unions + few fixes.Petteri Aimonen1-2/+2
Fixes compilation error with anonymous unions when it is not the last field in message. Also fixes extraneous newlines in header file. Cleanup the pb.h extraneous use of ##.
2015-11-10Add option to allow for anonymous unionsBenjamin Kamath1-1/+16
2015-09-26Setting version to 0.3.5-devPetteri Aimonen1-1/+1
2015-09-26Publishing nanopb-0.3.4Petteri Aimonen1-1/+1
2015-09-12Fix handling of unsigned 8- or 16-bit enums.Petteri Aimonen1-1/+2
Previously unsigned enums would throw errors on decoding if the value went outside the signed range (issue #164). Currently only helps for enums defined within the same file, but solving issue #165 will make it work for multiple files also.
2015-04-10Setting version to 0.3.4-devPetteri Aimonen1-1/+1
2015-04-10Publishing nanopb-0.3.3Petteri Aimonen1-1/+1
2015-01-24Setting version to nanopb-0.3.3-devPetteri Aimonen1-1/+1
2015-01-24Publishing nanopb-0.3.2Petteri Aimonen1-1/+1
2015-01-11Bugfixes for oneof support.Petteri Aimonen1-1/+1
Fixes crashes / memory leaks when using pointer type fields. Also fixes initialization of which_oneof fields.
2015-01-04Implement support for oneofs (C unions).Petteri Aimonen1-0/+18
Basic test included, should probably add an oneof to the AllTypes test also. Update issue 131 Status: Started
2015-01-03Change PB_RETURN_ERROR() macro to avoid compiler warnings.Petteri Aimonen1-11/+10
Update issue 140 Status: FixedInGit
2014-12-26Add support for POINTER type in extensionsPetteri Aimonen1-2/+4
2014-12-22Add compilation option to disable struct packing.Petteri Aimonen1-1/+10
Update issue 136 Status: FixedInGit
2014-09-16Set version to nanopb-0.3.2-devPetteri Aimonen1-1/+1
2014-09-11Publishing nanopb-0.3.1Petteri Aimonen1-1/+1
2014-08-26Setting version to 0.3.1-devPetteri Aimonen1-1/+1
2014-08-26Publishing nanopb-0.3.0Petteri Aimonen1-1/+1
2014-08-19Add #if guard for .pb.h version.Petteri Aimonen1-14/+6
The version in PB_PROTO_HEADER_VERSION can be bumped whenever there is a breaking change to the generated files, and it will then alert to the difference. Update issue 129 Status: FixedInGit
2014-08-18Rename poorly named identifier to avoid name conflicts.Petteri Aimonen1-14/+14
Update issue 106 Status: FixedInGit
2014-08-18Rename UNUSED() and STATIC_ASSERT() macros with PB_ prefix.Petteri Aimonen1-18/+22
This avoids possible namespace conflicts with other macros.
2014-08-18Change the _count fields to use pb_size_t datatype.Petteri Aimonen1-2/+5
Update issue 82 Status: FixedInGit
2014-08-09Setting version to 0.3.0-devPetteri Aimonen1-1/+1
2014-08-09Publishing nanopb-0.2.9Petteri Aimonen1-1/+1
2014-05-30Add PB_PACKED_STRUCT support for Keil MDK-ARM toolchainPetteri Aimonen1-2/+2
Patch from Jon Read. Update issue 119 Status: FixedInGit
2014-05-20Setting version to 0.2.9-devPetteri Aimonen1-1/+1
2014-05-20Publishing nanopb-0.2.8Petteri Aimonen1-1/+1
2014-04-07Setting version to 0.2.8-devPetteri Aimonen1-1/+1
2014-04-07Publishing nanopb-0.2.7Petteri Aimonen1-1/+1
2014-04-05Fix unused parameter warning when building without errmsg.Petteri Aimonen1-1/+5
2014-04-05Add a 'found' field to pb_extension_t.Petteri Aimonen1-0/+4
Update issue 112 Status: FixedInGit
2014-03-17More configuration options for dynamic allocPetteri Aimonen1-0/+14
2014-03-15Get rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.Petteri Aimonen1-9/+3
This makes the internal logic much simpler, and also keeps the datatypes more similar between STATIC/POINTER cases. It will still be a bit cumbersome to use because of variable length array member. Macros PB_BYTES_ARRAY_T(n) and PB_BYTES_ARRAY_T_ALLOCSIZE(n) have been added to make life a bit easier. This has the drawback that it is no longer as easy to use externally allocated byte array as input for bytes field in pointer mode. However, this is still easy to do using callbacks, so it shouldn't be a large issue.
2014-02-24Beginnings of malloc support in pb_decodePetteri Aimonen1-0/+4
2014-02-15Setting version to 0.2.7-devPetteri Aimonen1-1/+1
2014-02-15Publishing nanopb-0.2.6Petteri Aimonen1-1/+1