summaryrefslogtreecommitdiff
path: root/upb/def.h
AgeCommit message (Collapse)Author
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-01-26Added a few more missing functions.Josh Haberman
2019-01-26Added missing fielddef function implementations for C++.Josh Haberman
2019-01-24Fixes for Google-internal tests.Josh Haberman
2019-01-23Some more fixes for PHP.Joshua Haberman
2019-01-17Moved some definitions to def.hJoshua Haberman
2019-01-16upb_symtab_add() returns upb_filedef* instead of bool.Joshua Haberman
2019-01-15Merge branch 'arrayapi' into defcleanupJoshua Haberman
2019-01-14WIP.Joshua Haberman
2019-01-12Removed old-style C++ handlers that relied on UB in favor of more normal ones.Joshua Haberman
2019-01-02Some bugfixes.Joshua Haberman
2018-12-22Merge branch 'master' into defcleanupJoshua Haberman
2018-12-20Some fixes for Ruby.Joshua Haberman
2018-12-16Got test_decoder working!Joshua Haberman
2018-12-13Ported some tests.Joshua Haberman
2018-12-12WIP, more progress on refactoring.Joshua Haberman
2018-12-12Add support for encoding Any in jsonBo Yang
2018-12-10WIP, core library compiles now.Joshua Haberman
2018-12-08Merge branch 'master' into defcleanupJoshua Haberman
2018-12-08Merge branch 'cmake-mac-fixes' into defcleanupJoshua Haberman
2018-12-04Implement json decoding for Any message. (#130)Paul Yang
* Implement json decoding for Any message. type url may not appear as the first value in json. As a result, other data cannot be resolved before resolving type url. To solve that, this change caches the start and end position of unparsed values and resolve them in end_any_object when type url has been resolved. * Handle Any in switch * Update json parser size * Fix comments * Sync upstream * Add dependency on upb_pb for upb_json * Debug failed test * Fix cmake * Update test generated files * Remove debug tests
2018-10-21Merge branch 'master' into defcleanupJosh Haberman
2018-09-18Fix json encoding for wrappers, ListValue, Struct and Value. (#126)Paul Yang
* Fix json encoding for wrappers, ListValue, Struct and Value. * Add well_known_type field in upb_msgdef to specify type of well known messages. * Remove comma at end of enum definition. * Group number wrappers * Fix comments * Refactoring to use is_wellknown_{msg/field}
2018-09-11WIP.Josh Haberman
2018-09-06Fix json parsing for Struct, ListValue and Value.Bo Yang
2018-08-29Fix json encoding/decoding for duration. (#118)Paul Yang
* Fix json encoding/decoding for duration. * Use lld for int64_t * Cast int64_t to long
2018-08-24Fix json parsing for timestamp (#115)Paul Yang
* 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
2018-03-07For encoding upb needs descriptor type instead of type.Bo Yang
2017-05-31Add new file option php_namespace.Bo Yang
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
2017-03-14Add new file option php_class_prefix.Bo Yang
This option will be prepended to all php generated classes. The PHP runtime needs to know this option to figure out the class name for specific message.
2017-01-21Ripped out complicated and unused code for replacing defs in a symtab.Josh Haberman
Also hid the dup() functions. We can't quite delete them yet because our current approach for extensions depends on duplicating defs.
2017-01-21Make upb::SymbolTable no longer reference-counted.Josh Haberman
This transitions it from shared ownership to unique ownership.
2017-01-21Moved upb_symtab to def.h/def.c.Josh Haberman
This is in anticipation of removing refcounting and making upb_symtab (soon to be upb_defpool) the unique owner of all defs inside.
2016-11-29New upb_msg code and Lua bindings around it.Josh Haberman
There are still some things that are unfinished, but we are at parity with what Lua had before.
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.
2016-04-21Put oneofs in the same table as fields. (#60)Joshua Haberman
* Put oneofs in the same table as fields. Oneofs and fields are not allowed to have names that conflict, so we might as well put them all in the same table. This also allows an efficient operation that looks for both fields and oneofs in a single lookup. Added support for OneofDef to Lua to allow testing of this. * Addressed PR comments.
2016-04-19Changed schema for JSON test to be defined in a .proto file. (#54)Joshua Haberman
* Changed schema for JSON test to be defined in a .proto file. Before we had lots of code to build these schemas manually, but this was verbose and made it difficult to add to the schema easily. Now we can just write a .proto file and adding fields is easy. To avoid making the tests depend on upbc (and thus Lua) we check in the generated schema. * Made protobuf-compiler a dependency of "make genfiles." * For genfiles download recent protoc that can handle proto3. * Only use new protoc for genfiles.
2016-04-06Refactored upb_def_freeze() a bit per PR comments.Josh Haberman
2016-04-06Changes for PR comments.Josh Haberman
2016-04-05Added upb::FileDef, which represents the file defs are declared in.Josh Haberman
It is entirely optional: MessageDef/EnumDef can still exist on their own. But this can represent a def's file when it is desirable to do so (eg. for code generators). This approach will require that we change the way we handle extensions. But I think it will be a good change overall. Specifically, we previously handled extensions by duplicating the extended message and then adding the extension as a regular field to the duplicated message. This required also duplicating any messages that could reach the extended message. In the new world we will need a way of declaring and looking up extensions separately from the message being extended. This change also involves some notable changes to the generated code: - files are now called foo.upbdefs.h instead of foo.upb.h. This reflects the fact that we might possibly generate several different output files for a .proto file, and this one is just for defs. - we no longer generate selectors in the .h file. - the upbdefs.c no longer vends a SymbolTable. Now it vends the individual messages (and possibly a FileDef later). I think this will compose better once we can generate files where one generated files imports another. We also make the descriptor reader vend a list of FileDefs now. This is the best conceptual match for parsing a FileDescriptorSet.
2016-03-08Make OneofDef stop deriving from Def.Josh Haberman
It is clear now that oneofs are different form other defs in one important way: they are not top-level constructs that can stand on their own in a SymbolTable, for example. If you are iterating over a list of Defs in a SymbolTable, there is no chance you will run into a oneof. To reflect this reality, OneofDef no longer derives from Def, and the UPB_DEF_ONEOF is no longer an enum value that needs to be handled.
2016-02-21Add missing FieldDef::index() definitionMattia Barbon
2016-02-17Addressed code review comments.Josh Haberman
2016-02-17Changed JSON parser/printer to correctly camelCase names.Josh Haberman
2015-10-14Add flag to MessageDef for whether fields have presence.Josh Haberman
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-02-02Support maps in JSON parsing and serialization.Chris Fallin
This is a sync of our internal developing of JSON parsing and serialization. It implements native understanding of MapEntry submessages, so that map fields with (key, value) pairs are serialized as JSON maps (objects) natively rather than as arrays of objects with 'key' and 'value' fields. The parser also now understands how to emit handler calls corresponding to MapEntry objects when processing a map field. This sync also picks up a bugfix in `table.c` to handle an alloc-failed case.
2015-01-14Support oneof defs in upb.Chris Fallin
This change adds support for a OneofDef (upb_oneofdef), which represents a 'oneof' as introduced by Protocol Buffers. This is semantically a union type that contains fields and in turn may be added to a MessageDef. This change does not alter parsing or the handler abstraction in any way, because a oneof has impact only at a higher semantic level (i.e., any sort of storage of the fields in a message object), which is user-specific with respect to upb.
2014-12-15Added msgdef flag to indicate map_entry protos.Chris Fallin
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback