Joshua Haberman
f7713ebc39
Changed C API to use inline functions and computed offsets.
6 years ago
Bo Yang
81fbb4ffa7
Initialize value
6 years ago
Bo Yang
6c910330c4
Fix json parsing for Struct, ListValue and Value.
6 years ago
Joshua Haberman
694d51f4d6
Changed C API to only define structs, a table, and a few minimal inline functions.
6 years ago
Paul Yang
6c4469e189
Fix json encoding/decoding for duration. ( #118 )
...
* Fix json encoding/decoding for duration.
* Use lld for int64_t
* Cast int64_t to long
6 years ago
Sakala Venkata Krishna Rohit
898f640e65
Bugfix on bigendianess by casting size_t to unint32_t
...
The reason for typecasting size_t to unint32_t is that size_t is 8 bytes and uint32_t is only 4 bytes.
If not typecasted Memcpy fails to copy the *correct* four bytes in big endian platforms.
6 years ago
Sakala Venkata Krishna Rohit
6522ae4fb3
Bugfix on bigendianess by casting size_t to unint32_t
...
The reason for typecasting size_t to unint32_t is that size_t is 8 bytes and uint32_t is only 4 bytes.
If not typecasted Memcpy fails to copy the *correct* four bytes in big endian platforms.
6 years ago
Paul Yang
38d674e86f
Fix json parsing for timestamp ( #115 )
...
* Fix json parsing for timestamp
* Fix json encoding for timestamp
* Implement timestamp_machine to parse timestamp
* Remove comparision for size_t and 0
* Increase defined printer size
* Increase size
* Increase parser size
* Mark json_en_timestamp_machine unused
6 years ago
Josh Haberman
e94ac4f757
Moved upb_msg parts that depend on def to a separate msgfactory.{c,h}.
...
Also got rid of the premature "v1" business that was attempting
to create a binary compatibility story.
Also added an in-progress CMakeLists.txt file.
6 years ago
Josh Haberman
1a484d353b
Re-add upb/bindings/stdc++/string.h, which is still used in tests.
6 years ago
Josh Haberman
c0a50de923
Removed a bunch of obsolete code.
...
A lot of this code was experimental or temporarily
useful, but is no longer needed.
6 years ago
Joshua Haberman
636b25be8d
Re-add msg handlers to the .c file also.
6 years ago
Joshua Haberman
7059be68ae
Re-add message handlers to upb/handlers.*.
...
These are still being used by the proto2 bindings.
6 years ago
Joshua Haberman
c8f6a27e6b
Enforced that upb_msg lives in an Arena only, and other simplifying.
...
upb_msg was trying to be general enough that it could either live in
an arena or be allocated with malloc()/free(). This was too much
complexity for too little benefit. We should commit to just saying
that upb_msg is arena-only.
I also ripped out the code to glue upb_msg to the existing
handlers-based encoder/decoder. upb_msg has its own, small, simple
encoder/decoder. I'm trying to whittle down upb_msg to a small
and simple core.
I updated the Lua extension for these changes. Lua needs some more
work to properly create arenas per message. For now I just created
a single global arena.
6 years ago
Bo Yang
a8d1a5933d
Use special eof char to mark end of parsing
6 years ago
Bo Yang
d4caefaade
Move logic away from ragel machine
6 years ago
Bo Yang
f1d7570f30
Remove unused code
6 years ago
Bo Yang
ac9d4468f5
Make value top level
6 years ago
Bo Yang
ae2f1cdb17
Mark unused variable
6 years ago
Bo Yang
cc27a5b576
Update ragel generated file
6 years ago
Bo Yang
9449cf68cc
Make top level wrapper value parsing work
6 years ago
Bo Yang
20f1b6df41
Fix json decoding for wrapper messages
6 years ago
Bo Yang
72e66e2b55
Enable ignore unknown field in json parsing
7 years ago
Bo Yang
1080117f2b
Revert "Prepare upb_value for encoding/decoding map."
...
This reverts commit f30dd0ff0c
.
7 years ago
Bo Yang
f30dd0ff0c
Prepare upb_value for encoding/decoding map.
7 years ago
Bo Yang
86dec3021f
Implement decoding repeated message field.
7 years ago
Bo Yang
0833cf29b3
Bytes type should return size of stringview
7 years ago
Bo Yang
e06cc3d7cc
e->limit is invalidated after growing.
7 years ago
Josh Haberman
cea737028f
Added google/protobuf/descriptor.upb.* to core.
...
This is in preparation for making upb_def capable
of parsing binary descriptors directly.
We leave upb/descriptor/descriptor.upbdefs.* in
place for now, because upb/descriptor/reader.*
still depends on it.
Also removed a bit of cruft from the codegen.
7 years ago
Bo Yang
93aaf99347
Fix parsing sub-message field.
...
Buffer start place needs to be adjusted before parsing sub-message.
7 years ago
Bo Yang
dfe7d3a374
swap condition branches to remove negation
7 years ago
Bo Yang
ba93474aa2
Fix oneof encoding/decoding
7 years ago
Bo Yang
bc7f1eaca0
In case of circular dependency, layout has to be inserted first.
7 years ago
Bo Yang
719f644232
Field missing submsg and hasbit information.
7 years ago
Bo Yang
8c6d0e5545
Conversion from uint64 to uint32 didn't consider sign bit.
7 years ago
Bo Yang
cafebf6bee
For encoding upb needs descriptor type instead of type.
7 years ago
Bo Yang
0a9681874e
Modify TODO
7 years ago
Bo Yang
1e1c54f772
Change parameter type from enum opcode to int.
...
If the compiler elects to represent enum E as a char rather than an int
(per 6.7.2.2p4), the call to va_start() will have undefined behavior.
7 years ago
Bo Yang
ee7b049d19
Initialize tag to make compiler happy.
7 years ago
Joshua Haberman
0776f64830
Fixed JIT for unknown fields. ( #1 )
7 years ago
Bo Yang
dd77460c65
Do not expose encode_unknown
7 years ago
Bo Yang
69dee545ec
Remove upb_pb_encoder_encode_unknown
7 years ago
Bo Yang
6a6e192375
Remove unused declaration.
7 years ago
Bo Yang
6b4e07cc18
Remove upb_addunknown_handlerfunc
7 years ago
Bo Yang
5aa27d91c6
Use upb_sink_putunknown for reserve unknown
7 years ago
Bo Yang
dc9d15084f
Remove upb_addunknown_handlerfunc and upb_handlers_setaddunknown
7 years ago
Bo Yang
0b7904e18c
Reserve unknown fields in upb
...
1. For decoding, an unknownfields will be lazily created on message,
which contains bytes of unknown fields.
2. For encoding, if the unknownfields is present on message, all bytes
contained in it will be serialized.
7 years ago
Joshua Haberman
72c333eb03
Fixed amalgamated build.
7 years ago
Joshua Haberman
058a17f6a6
Fix amalgamated build.
7 years ago
Joshua Haberman
98f513fb8f
Fixed 32-bit build and added generated files.
7 years ago