28 Commits

Author SHA1 Message Date
Petteri Aimonen
be0b9e047a Rename poorly named identifier to avoid name conflicts.
Update issue 106
Status: FixedInGit
2014-08-18 21:11:10 +03:00
Petteri Aimonen
ab62402059 Documentation updates 2014-03-16 15:52:19 +02:00
Petteri Aimonen
9c196b89ba Add pb_release() function 2014-03-12 21:08:35 +02:00
Petteri Aimonen
287207841d Remove the NANOPB_INTERNALS functions from public API.
These have been deprecated since nanopb-0.1.6 (some since 0.1.3).
Equivalent functions with better interface are available in the API.

Update issue 91
Status: FixedInGit
2013-10-29 16:32:47 +02:00
Petteri Aimonen
5b9ad17dc2 Move the declarations of _pb_ostream_t and _pb_istream_t before first use.
Otherwise Microsoft Visual C++ threats them as C++ classes instead of plain
structs, forbidding use in C linkage functions.

Thanks to Markus Schwarzenberg for the patch.

Update issue 84
Status: Started
2013-09-09 10:53:04 +03:00
Petteri Aimonen
bb985e9927 Add pb_decode_delimited and pb_encode_delimited wrapper functions.
Update issue 74
Status: FixedInGit
2013-07-06 16:16:00 +03:00
Petteri Aimonen
314460c2a5 Clean up the comments in pb_encode.h and pb_decode.h 2013-07-06 15:55:15 +03:00
dch
a968233777 No need to include stdbool.h separately 2013-04-08 10:56:23 +03:00
Petteri Aimonen
4ba6a3027d Add compile-time option PB_BUFFER_ONLY.
This allows slight optimizations if only memory buffer support
(as opposed to stream callbacks) is wanted. On ARM difference
is -12% execution time, -4% code size when enabled.
2013-02-06 20:54:25 +02:00
Petteri Aimonen
3aaa4ad8c2 Add extern "C" to header files.
Update issue 35
Status: FixedInGit
2012-10-29 19:03:19 +02:00
Petteri Aimonen
dcab39a41c Remove the "buf = NULL" => skip requirement from pb_istream_t callbacks.
Rationale: it's easy to implement the callback wrong. Doing so introduces
io errors when unknown fields are present in the input. If code is not
tested with unknown fields, these bugs can remain hidden for long time.

Added a special case for the memory buffer stream, where it gives a small
speed benefit.

Added testcase for skipping fields with test_decode2 implementation.

Update issue 37
Status: FixedInGit
2012-10-18 19:45:28 +03:00
Petteri Aimonen
160f02e4d0 Add pb_decode_noinit and use it from pb_dec_submessage.
This avoids double initialization when decoding nested submessages.
Fixes an issue with submessage arrays that was present in previous
version of this patch.

Update issue 28
Status: FixedInGit
2012-08-26 11:04:55 +03:00
Petteri Aimonen
1463e687e3 Revert "Add pb_decode_noinit and use it from pb_dec_submessage."
The patch breaks default values inside submessage arrays (I think).
Have to add test cases and check back.

This reverts commit f1d7640fe1.
2012-08-26 10:05:46 +03:00
Petteri Aimonen
f1d7640fe1 Add pb_decode_noinit and use it from pb_dec_submessage.
This avoids double initialization when decoding nested submessages.

Update issue 28
Status: FixedInGit
2012-08-26 09:56:11 +03:00
Petteri Aimonen
0fb5e5e068 Implement error messages in the decoder side.
Update issue 7
Status: Started
2012-08-24 21:22:20 +03:00
Petteri Aimonen
9383f305dc Revert "Change the substream implementation in pb_decode."
This reverts commit dc2da0edc5.

Add pb_close_string_substream() for copying back the state.
This makes adding error messages easier in the future, as also
them need to be propagated back from the substream.
2012-08-24 20:43:39 +03:00
Petteri Aimonen
2941e90e04 Reorganize the field decoder interface.
This makes the field decoding functions more intuitive to use.
The old interface is still present if you specify NANOPB_INTERNALS.

Update issue 2
Status: FixedInGit
2012-08-24 20:23:25 +03:00
Petteri Aimonen
dc2da0edc5 Change the substream implementation in pb_decode.
This makes it unnecessary to copy back the state, and also relaxes
the requirements on callbacks (bytes_left will always be valid).
It decreases code size by a few bytes, but may be just slightly slower.
2012-08-24 19:35:17 +03:00
Petteri Aimonen
86257a2a70 Fix a confusing statement in a comment. 2012-08-24 19:25:29 +03:00
Petteri Aimonen
8524de39ce Fix an unsigned vs. signed warning on some compiler. 2012-07-18 21:21:07 +03:00
Petteri Aimonen
e18352d506 Added new functions to public interface in pb_decode.h.
pb_decode_tag and pb_skip_field allow manually iterating the fields
in a message.
2012-06-16 14:07:37 +03:00
Petteri Aimonen
fcfc99f766 Fixed a bunch of bugs related to callback fields.
Most importantly, callback fields in submessages were being overwritten with garbage, causing segfaults.

Additionally, converted PB_LTYPE_FIXED to PB_LTYPE_FIXED32 and PB_LTYPE_FIXED64. This makes the interface
a bit easier to use, and in addition runs faster.


git-svn-id: https://svn.kapsi.fi/jpa/nanopb@975 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-09-13 16:14:08 +00:00
Petteri Aimonen
842d52633d More documentation, small improvements
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@955 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-08-14 20:11:05 +00:00
Petteri Aimonen
a8d0172507 Encoder
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@951 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-08-04 16:49:32 +00:00
Petteri Aimonen
b9ca72e6af git-svn-id: https://svn.kapsi.fi/jpa/nanopb@947 e3a754e5-d11d-0410-8d38-ebb782a927b9 2011-07-28 14:54:03 +00:00
Petteri Aimonen
ead3b734d8 Making code ansi-compatible
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@944 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-27 19:57:43 +00:00
Petteri Aimonen
84304b343a Improvements, array support
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@943 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-27 19:22:11 +00:00
Petteri Aimonen
14bbe22997 First version of decoding
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@942 e3a754e5-d11d-0410-8d38-ebb782a927b9
2011-07-25 20:42:48 +00:00