summaryrefslogtreecommitdiff
path: root/upb/handlers.h
AgeCommit message (Collapse)Author
2019-05-14More Blaze fixes.Joshua Haberman
2019-03-27Moved macros from upb.h to port_def.inc to avoid leaking them to users. (#160)Joshua Haberman
* Use port_def.inc to prevent macros from leaking to users. * Added helpful comments to port_def.inc/port_undef.inc.
2019-03-27Removed reflection and other extraneous things from the core library. (#158)Joshua Haberman
* Removed reflection and other extraneous things from the core library. * Added missing files and ran buildifier. * New CMakeLists.txt. * Made table its own cc_library() for internal usage.
2019-01-15Added some comments and reversed upb_arena_cleanup() args.Joshua Haberman
2019-01-14WIP.Joshua Haberman
2019-01-12A lot more tests are working now.Joshua Haberman
2019-01-12Removed old-style C++ handlers that relied on UB in favor of more normal ones.Joshua Haberman
2019-01-09upb_refcounted is gone! Some tests still to fix.Joshua Haberman
2018-09-11WIP.Josh Haberman
2018-08-12Re-add message handlers to upb/handlers.*.Joshua Haberman
These are still being used by the proto2 bindings.
2017-09-19Remove upb_addunknown_handlerfuncBo Yang
2017-09-19Remove upb_addunknown_handlerfunc and upb_handlers_setaddunknownBo Yang
2017-09-19Reserve unknown fields in upbBo Yang
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.
2016-05-12Added UPB_ASSERT() that helps avoid unused var warnings.Joshua Haberman
* Added UPB_ASSERT() that helps avoid unused var warnings. * Addressed PR comments. * Fixed assert in the JIT.
2015-07-07Brought into compliance with Google open-source policies.Josh Haberman
- removed myself from Author headers in source files. - removed copyright notices from source file headers. - added CONTRIBUTING.md
2015-06-02Ported upb to C89, for greater portability.Josh Haberman
A large part of this change contains surface-level porting, like moving variable declarations to the top of the block. However there are a few more substantial things too: - moved internal-only struct definitions to a separate file (structdefs.int.h), for greater encapsulation and ABI compatibility. - removed the UPB_UPCAST macro, since it requires access to the internal-only struct definitions. Replaced uses with calls to inline, type-safe casting functions. - removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros. Class and struct definitions are now more explicit -- you get to see the actual class/struct keywords in the source. The casting convenience functions have been moved into UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2(). - the new way that we duplicate base methods in derived types is also more convenient and requires less duplication. It is also less greppable, but hopefully that is not too big a problem. Compiler flags (-std=c89 -pedantic) should help to rigorously enforce that the code is free of C99-isms. A few functions are not available in C89 (strtoll). There are temporary, hacky solutions in place.
2015-05-08Google-internal development.Josh Haberman
2014-12-12Amalgamated distribution (upb.c/upb.h) tool.Chris Fallin
There are a number of tweaks to get this to work: - The #include dependence graph wasn't quite complete, and I had to add a few #includes to get the tool to work. - I had to change a number of symbol names to avoid conflicts between 'static' definitions in different .c files. This could be avoided if the tool were smart enough to rename static symbols to have unique prefixes instead, but (i) this requires semantic understanding of C, and (ii) the macro-defined static functions (e.g., handlers for primitive types in several places) would probably trip this up. Verified that the resulting upb.h/upb.c compiles and doesn't have any unresolved references.
2014-07-02Sync from internal Google development.Josh Haberman
2014-06-26Sync from internal Google development.Josh Haberman
2014-01-21Sync to internal Google development.Josh Haberman
2013-12-20Sync from Google-internal development.Josh Haberman
2013-10-24Merge from Google-internal development:Josh Haberman
- rewritten decoder; interpreted decoder is bytecode-based, JIT decoder no longer falls back to the interpreter. - C++ improvements: C++11-compatible iterators, upb::reffed_ptr for RAII refcounting, better upcast/downcast support. - removed the gross upb_value abstraction from public upb.h.
2013-05-28Fixes to compile on GCC 4.2, as shipped with XCode.Josh Haberman
2013-05-28Merge from Google-internal development.Josh Haberman
- Better error reporting for upb::Def setters. - error reporting for upb::Handlers setters. - made the start/endmsg handlers a little less special-cased.
2013-05-25Synced with Google-internal development.Josh Haberman
C++ handlers are now type-safe; SinkFrame is gone. Various other changes.
2013-05-11Synced with 3 months of Google-internal development.Josh Haberman
Major changes: - Got rid of all bytestream interfaces in favor of using regular handlers. - new Pipeline object represents a upb pipeline, does bump allocation internally to manage memory. - proto2 support now can handle extensions.
2013-02-15Sync with 8 months of Google-internal development.Josh Haberman
Many things have changed and been simplified. The memory-management story for upb_def and upb_handlers is much more robust; upb_def and upb_handlers should be fairly stable interfaces now. There is still much work to do for the runtime component (upb_sink).
2012-03-31Sync from internal Google development.Joshua Haberman
2012-03-24Sync from internal Google development.Joshua Haberman
Many improvements, too many to mention. One significant perf regression warrants investigation: omitfp.parsetoproto2_googlemessage1.upb_jit: 343 -> 252 (-26.53) plain.parsetoproto2_googlemessage1.upb_jit: 334 -> 251 (-24.85) 25% regression for this benchmark is bad, but since I don't think there's any fundamental design issue that caused it I'm going to go ahead with the commit anyway. Can investigate and fix later. Other benchmarks were neutral or showed slight improvement.
2011-12-22Sync with internal Google development.Joshua Haberman
This breaks the open-source build, will follow up with a change to fix it.
2011-11-23Refinement of upb_bytesrc interface.Joshua Haberman
Added a upb_byteregion that tracks a region of the input buffer; decoders use this instead of using a upb_bytesrc directly. upb_byteregion is also used as the way of passing a string to a upb_handlers callback. This symmetry makes decoders compose better; if you want to take a parsed string and decode it as something else, you can take the string directly from the callback and feed it as input to another parser. A commented-out version of a pinning interface is present; I decline to actually implement it (and accept its extra complexity) until/unless it is clear that it is actually a win. But it is included as a proof-of-concept, to show that it fits well with the existing interface.
2011-09-14Small typo fix.Joshua Haberman
2011-09-05Fix typo in handler.hWink Saville
Signed-off-by: Wink Saville <wink@saville.com>
2011-09-04Const invasion: large parts of upb made const-correct.Joshua Haberman
2011-08-31Revised upb_bytesink, refactored upb_textprinter (untested).Joshua Haberman
2011-08-27Add packed field support (untested).Joshua Haberman
2011-08-20Let the JIT emit hasbit-setting code in addition to calling a callback.Joshua Haberman
This leads to a major (20-40%) improvement in the parsetoproto2 benchmark with small messages. We now are faster than proto2 in all apples-to-apples comparisons, at least given the (admittedly limited) set of benchmarks in this source tree.
2011-08-19Some source cleanup/commenting.Joshua Haberman
2011-08-17x86 JIT: add callback specializations for a 10% speedup when parsing to struct.Joshua Haberman
2011-08-12Python: basic SymbolTable support and empty accessors.Joshua Haberman
2011-07-15Directory restructure.Joshua Haberman
Includes are now via upb/foo.h. Files specific to the protobuf format are now in upb/pb (the core library is concerned with message definitions, handlers, and byte streams, but knows nothing about any particular serializationf format).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback