Change the callback function to use void**.
NOTE: This change breaks backwards-compatibility by default. If you have old callback functions, you can define PB_OLD_CALLBACK_STYLE to retain the old behaviour. If you want to convert your old callbacks to new signature, you need to do the following: 1) Change decode callback argument to void **arg and encode callback argument to void * const *arg. 2) Change any reference to arg into *arg. The rationale for making the new behaviour the default is that it simplifies the common case of "allocate some memory in decode callback". Update issue 69 Status: FixedInGit
Showing
- docs/concepts.rst 7 additions, 5 deletionsdocs/concepts.rst
- docs/reference.rst 7 additions, 3 deletionsdocs/reference.rst
- example/client.c 1 addition, 1 deletionexample/client.c
- example/server.c 2 additions, 2 deletionsexample/server.c
- pb.h 9 additions, 0 deletionspb.h
- pb_decode.c 8 additions, 2 deletionspb_decode.c
- pb_encode.c 8 additions, 1 deletionpb_encode.c
- tests/decode_unittests.c 2 additions, 2 deletionstests/decode_unittests.c
- tests/encode_unittests.c 2 additions, 2 deletionstests/encode_unittests.c
- tests/test_decode_callbacks.c 8 additions, 8 deletionstests/test_decode_callbacks.c
- tests/test_encode_callbacks.c 4 additions, 4 deletionstests/test_encode_callbacks.c
Loading
Please register or sign in to comment