40 #ifndef UPB_REFCOUNTED_H_ 41 #define UPB_REFCOUNTED_H_ 90 template <
int N>
class InlinedArena;
91 template <
int N>
class InlinedEnvironment;
97 #define UPB_INLINE inline 98 #elif defined (__GNUC__) 99 #define UPB_INLINE static __inline__ 101 #define UPB_INLINE static 106 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) 107 #define UPB_BIG_ENDIAN 112 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) 113 #define UPB_NOINLINE __attribute__((noinline)) 114 #define UPB_NORETURN __attribute__((__noreturn__)) 116 #define UPB_FORCEINLINE 127 #define _upb_snprintf __builtin_snprintf 128 #define _upb_vsnprintf __builtin_vsnprintf 129 #define _upb_va_copy(a, b) __va_copy(a, b) 130 #elif __STDC_VERSION__ >= 199901L 132 #define _upb_snprintf snprintf 133 #define _upb_vsnprintf vsnprintf 134 #define _upb_va_copy(a, b) va_copy(a, b) 136 #error Need implementations of [v]snprintf and va_copy 140 #if ((defined(__cplusplus) && __cplusplus >= 201103L) || \ 141 defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(UPB_NO_CXX11) 151 #include <type_traits> 152 #define UPB_DISALLOW_COPY_AND_ASSIGN(class_name) \ 153 class_name(const class_name&) = delete; \ 154 void operator=(const class_name&) = delete; 155 #define UPB_DISALLOW_POD_OPS(class_name, full_class_name) \ 156 class_name() = delete; \ 157 ~class_name() = delete; \ 158 UPB_DISALLOW_COPY_AND_ASSIGN(class_name) 159 #define UPB_ASSERT_STDLAYOUT(type) \ 160 static_assert(std::is_standard_layout<type>::value, \ 161 #type " must be standard layout"); 162 #define UPB_FINAL final 164 #define UPB_DISALLOW_COPY_AND_ASSIGN(class_name) \ 165 class_name(const class_name&); \ 166 void operator=(const class_name&); 167 #define UPB_DISALLOW_POD_OPS(class_name, full_class_name) \ 170 UPB_DISALLOW_COPY_AND_ASSIGN(class_name) 171 #define UPB_ASSERT_STDLAYOUT(type) 188 #define UPB_C_UPCASTS(ty, base) \ 189 UPB_INLINE base *ty ## _upcast_mutable(ty *p) { return (base*)p; } \ 190 UPB_INLINE const base *ty ## _upcast(const ty *p) { return (const base*)p; } 192 #define UPB_C_UPCASTS2(ty, base, base2) \ 193 UPB_C_UPCASTS(ty, base) \ 194 UPB_INLINE base2 *ty ## _upcast2_mutable(ty *p) { return (base2*)p; } \ 195 UPB_INLINE const base2 *ty ## _upcast2(const ty *p) { return (const base2*)p; } 199 #define UPB_BEGIN_EXTERN_C extern "C" { 200 #define UPB_END_EXTERN_C } 201 #define UPB_PRIVATE_FOR_CPP private: 202 #define UPB_DECLARE_TYPE(cppname, cname) typedef cppname cname; 204 #define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase) \ 205 UPB_DECLARE_TYPE(cppname, cname) \ 206 UPB_C_UPCASTS(cname, cbase) \ 209 class Pointer<cppname> : public PointerBase<cppname, cppbase> { \ 211 explicit Pointer(cppname* ptr) \ 212 : PointerBase<cppname, cppbase>(ptr) {} \ 215 class Pointer<const cppname> \ 216 : public PointerBase<const cppname, const cppbase> { \ 218 explicit Pointer(const cppname* ptr) \ 219 : PointerBase<const cppname, const cppbase>(ptr) {} \ 223 #define UPB_DECLARE_DERIVED_TYPE2(cppname, cppbase, cppbase2, cname, cbase, \ 225 UPB_DECLARE_TYPE(cppname, cname) \ 226 UPB_C_UPCASTS2(cname, cbase, cbase2) \ 229 class Pointer<cppname> : public PointerBase2<cppname, cppbase, cppbase2> { \ 231 explicit Pointer(cppname* ptr) \ 232 : PointerBase2<cppname, cppbase, cppbase2>(ptr) {} \ 235 class Pointer<const cppname> \ 236 : public PointerBase2<const cppname, const cppbase, const cppbase2> { \ 238 explicit Pointer(const cppname* ptr) \ 239 : PointerBase2<const cppname, const cppbase, const cppbase2>(ptr) {} \ 245 #define UPB_BEGIN_EXTERN_C 246 #define UPB_END_EXTERN_C 247 #define UPB_PRIVATE_FOR_CPP 248 #define UPB_DECLARE_TYPE(cppname, cname) \ 250 typedef struct cname cname; 251 #define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase) \ 252 UPB_DECLARE_TYPE(cppname, cname) \ 253 UPB_C_UPCASTS(cname, cbase) 254 #define UPB_DECLARE_DERIVED_TYPE2(cppname, cppbase, cppbase2, \ 255 cname, cbase, cbase2) \ 256 UPB_DECLARE_TYPE(cppname, cname) \ 257 UPB_C_UPCASTS2(cname, cbase, cbase2) 261 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y)) 262 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y)) 264 #define UPB_UNUSED(var) (void)var 269 #define UPB_ASSERT_VAR(var, predicate) UPB_UNUSED(var); assert(predicate) 281 template <
class T>
class Pointer;
293 template<
class To,
class From> To
down_cast(From*
f);
305 template<
class To,
class From> To dyn_cast(From*
f);
314 template <
class T>
inline Pointer<T> upcast(
T *
f) {
return Pointer<T>(
f); }
322 template <
class T,
class F>
inline T* upcast_to(
F *
f) {
323 return static_cast<T*
>(upcast(f));
329 template <
class T,
class Base>
332 explicit PointerBase(
T* ptr) : ptr_(ptr) {}
333 operator T*() {
return ptr_; }
334 operator Base*() {
return (
Base*)ptr_; }
340 template <
class T,
class Base,
class Base2>
341 class PointerBase2 :
public PointerBase<T, Base> {
343 explicit PointerBase2(
T* ptr) : PointerBase<
T,
Base>(ptr) {}
344 operator Base2*() {
return Pointer<Base>(*this); }
366 class upb::ErrorSpace {
382 #define UPB_STATUS_MAX_MESSAGE 128 409 bool ok()
const {
return upb_ok(
this); }
422 void SetFormattedErrorMessage(
const char*
fmt, ...) {
451 #define UPB_STATUS_INIT {true, 0, NULL, {0}} 505 return alloc->
func(alloc,
NULL, 0, size);
511 return alloc->
func(alloc, ptr, oldsize, size);
515 alloc->
func(alloc, ptr, 0, 0);
532 return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
556 #define UPB_ARENA_BLOCK_OVERHEAD (sizeof(size_t)*4) 584 Arena(
void *mem,
size_t len, Allocator*
a) {
615 size_t BytesAllocated()
const {
695 class upb::Environment {
700 Environment(
void *mem,
size_t len, Allocator *
a) : arena_(mem, len, a) {
722 bool ReportError(
const Status* status) {
750 template <
int N>
class upb::InlinedArena :
public upb::Arena {
752 InlinedArena() : Arena(initial_block_,
N,
NULL) {}
753 explicit InlinedArena(Allocator* a) : Arena(initial_block_,
N, a) {}
761 template <
int N>
class upb::InlinedEnvironment :
public upb::Environment {
763 InlinedEnvironment() : Environment(initial_block_,
N,
NULL) {}
764 explicit InlinedEnvironment(Allocator *a)
765 : Environment(initial_block_,
N, a) {}
811 #define SET_TYPE(dest, val) UPB_UNUSED(val) 813 #define SET_TYPE(dest, val) dest = val 846 #define FUNCS(name, membername, type_t, converter, proto_type) \ 847 UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \ 848 val->val = (converter)cval; \ 849 SET_TYPE(val->ctype, proto_type); \ 851 UPB_INLINE upb_value upb_value_ ## name(type_t val) { \ 853 upb_value_set ## name(&ret, val); \ 856 UPB_INLINE type_t upb_value_get ## name(upb_value val) { \ 857 assert(val.ctype == proto_type); \ 858 return (type_t)(converter)val.val; \ 886 #define UPB_TABKEY_NUM(n) n 887 #define UPB_TABKEY_NONE 0 893 #ifdef UPB_BIG_ENDIAN 894 #define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ 895 (uintptr_t)(len4 len3 len2 len1 strval) 897 #define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ 898 (uintptr_t)(len1 len2 len3 len4 strval) 902 char* mem = (
char*)key;
903 if (len) memcpy(len, mem,
sizeof(*len));
904 return mem +
sizeof(*len);
926 #if UINTPTR_MAX == 0xffffffffffffffffULL 927 #define UPB_PTR_IS_64BITS 928 #elif UINTPTR_MAX != 0xffffffff 929 #error Could not determine how many bits pointers are. 939 #ifdef UPB_PTR_IS_64BITS 951 #ifdef UPB_PTR_IS_64BITS 952 #define UPB_TABVALUE_INT_INIT(v) {{v}} 953 #define UPB_TABVALUE_EMPTY_INIT {{-1}} 958 #ifdef UPB_BIG_ENDIAN 959 #define UPB_TABVALUE_INT_INIT(v) {{0, v}} 960 #define UPB_TABVALUE_EMPTY_INIT {{-1, -1}} 962 #define UPB_TABVALUE_INT_INIT(v) {{v, 0}} 963 #define UPB_TABVALUE_EMPTY_INIT {{-1, -1}} 968 #define UPB_TABVALUE_PTR_INIT(v) UPB_TABVALUE_INT_INIT((uintptr_t)v) 970 #undef UPB_PTR_IS_64BITS 1015 # define UPB_TABLE_INIT(count, mask, ctype, size_lg2, entries) \ 1016 {count, mask, ctype, size_lg2, entries} 1018 # ifdef UPB_DEBUG_REFS 1021 # define UPB_TABLE_INIT(count, mask, ctype, size_lg2, entries) \ 1022 {count, mask, ctype, size_lg2, entries, &upb_alloc_debugrefs} 1024 # define UPB_TABLE_INIT(count, mask, ctype, size_lg2, entries) \ 1025 {count, mask, ctype, size_lg2, entries, NULL} 1033 #define UPB_STRTABLE_INIT(count, mask, ctype, size_lg2, entries) \ 1034 {UPB_TABLE_INIT(count, mask, ctype, size_lg2, entries)} 1036 #define UPB_EMPTY_STRTABLE_INIT(ctype) \ 1037 UPB_STRTABLE_INIT(0, 0, ctype, 0, NULL) 1046 #define UPB_INTTABLE_INIT(count, mask, ctype, size_lg2, ent, a, asize, acount) \ 1047 {UPB_TABLE_INIT(count, mask, ctype, size_lg2, ent), a, asize, acount} 1049 #define UPB_EMPTY_INTTABLE_INIT(ctype) \ 1050 UPB_INTTABLE_INIT(0, 0, ctype, 0, NULL, NULL, 0, 0) 1052 #define UPB_ARRAY_EMPTYENT -1 1210 *v = upb_value_int32(0);
1211 if (key < t->array_size) {
1334 template <
class T>
class reffed_ptr;
1344 class upb::RefCounted {
1347 bool IsFrozen()
const;
1353 void Ref(
const void *owner)
const;
1357 void Unref(
const void *owner)
const;
1362 void DonateRef(
const void *from,
const void *to)
const;
1366 void CheckRef(
const void *owner)
const;
1396 #ifdef UPB_DEBUG_REFS 1402 #ifdef UPB_DEBUG_REFS 1404 #define UPB_REFCOUNT_INIT(vtbl, refs, ref2s) \ 1405 {&static_refcount, NULL, vtbl, 0, true, refs, ref2s} 1407 #define UPB_REFCOUNT_INIT(vtbl, refs, ref2s) \ 1408 {&static_refcount, NULL, vtbl, 0, true} 1427 #define UPB_REFCOUNTED_CMETHODS(type, upcastfunc) \ 1428 UPB_INLINE bool type ## _isfrozen(const type *v) { \ 1429 return upb_refcounted_isfrozen(upcastfunc(v)); \ 1431 UPB_INLINE void type ## _ref(const type *v, const void *owner) { \ 1432 upb_refcounted_ref(upcastfunc(v), owner); \ 1434 UPB_INLINE void type ## _unref(const type *v, const void *owner) { \ 1435 upb_refcounted_unref(upcastfunc(v), owner); \ 1437 UPB_INLINE void type ## _donateref(const type *v, const void *from, const void *to) { \ 1438 upb_refcounted_donateref(upcastfunc(v), from, to); \ 1440 UPB_INLINE void type ## _checkref(const type *v, const void *owner) { \ 1441 upb_refcounted_checkref(upcastfunc(v), owner); \ 1444 #define UPB_REFCOUNTED_CPPMETHODS \ 1445 bool IsFrozen() const { \ 1446 return upb::upcast_to<const upb::RefCounted>(this)->IsFrozen(); \ 1448 void Ref(const void *owner) const { \ 1449 return upb::upcast_to<const upb::RefCounted>(this)->Ref(owner); \ 1451 void Unref(const void *owner) const { \ 1452 return upb::upcast_to<const upb::RefCounted>(this)->Unref(owner); \ 1454 void DonateRef(const void *from, const void *to) const { \ 1455 return upb::upcast_to<const upb::RefCounted>(this)->DonateRef(from, to); \ 1457 void CheckRef(const void *owner) const { \ 1458 return upb::upcast_to<const upb::RefCounted>(this)->CheckRef(owner); \ 1493 #define upb_ref2(r, from) \ 1494 upb_refcounted_ref2((const upb_refcounted*)r, (upb_refcounted*)from) 1495 #define upb_unref2(r, from) \ 1496 upb_refcounted_unref2((const upb_refcounted*)r, (upb_refcounted*)from) 1523 inline bool RefCounted::IsFrozen()
const {
1526 inline void RefCounted::Ref(
const void *owner)
const {
1529 inline void RefCounted::Unref(
const void *owner)
const {
1532 inline void RefCounted::DonateRef(
const void *from,
const void *to)
const {
1535 inline void RefCounted::CheckRef(
const void *owner)
const {
1546 #include <algorithm> 1550 template <
class T>
class upb::reffed_ptr {
1552 reffed_ptr() : ptr_(
NULL) {}
1556 reffed_ptr(
U*
val,
const void* ref_donor =
NULL)
1557 : ptr_(upb::upcast(val)) {
1560 ptr_->DonateRef(ref_donor,
this);
1567 reffed_ptr(
const reffed_ptr<U>& other)
1568 : ptr_(upb::upcast(other.
get())) {
1569 if (ptr_) ptr_->Ref(
this);
1572 reffed_ptr(
const reffed_ptr& other)
1573 : ptr_(upb::upcast(other.
get())) {
1574 if (ptr_) ptr_->Ref(
this);
1577 ~reffed_ptr() {
if (ptr_) ptr_->Unref(
this); }
1580 reffed_ptr& operator=(
const reffed_ptr<U>& other) {
1585 reffed_ptr& operator=(
const reffed_ptr& other) {
1593 void swap(reffed_ptr& other) {
1594 if (ptr_ == other.ptr_) {
1598 if (ptr_) ptr_->DonateRef(
this, &other);
1599 if (other.ptr_) other.ptr_->DonateRef(&other,
this);
1608 T* operator->()
const {
1613 T*
get()
const {
return ptr_; }
1618 reffed_ptr(ptr, ref_donor).swap(*
this);
1627 reffed_ptr<U> dyn_cast() {
1628 return reffed_ptr<U>(upb::dyn_cast<
U*>(
get()));
1633 T* ReleaseTo(
const void* new_owner) {
1635 ptr_->DonateRef(
this, new_owner);
1676 #define UPB_MAX_MESSAGE_DEPTH 64 1701 Def* Dup(
const void *owner)
const;
1706 Type def_type()
const;
1709 const char *full_name()
const;
1712 const char *
name()
const;
1718 bool set_full_name(
const char* fullname, upb::Status* s);
1719 bool set_full_name(
const std::string &fullname, upb::Status* s);
1724 FileDef*
file()
const;
1737 static bool Freeze(Def*
const* defs,
size_t n, Status* status);
1738 static bool Freeze(
const std::vector<Def*>& defs, Status* status);
1770 #define UPB_CPP_CASTS(cname, cpptype) \ 1773 inline cpptype *down_cast<cpptype *, Def>(Def * def) { \ 1774 return upb_downcast_##cname##_mutable(def); \ 1777 inline cpptype *dyn_cast<cpptype *, Def>(Def * def) { \ 1778 return upb_dyncast_##cname##_mutable(def); \ 1781 inline const cpptype *down_cast<const cpptype *, const Def>( \ 1783 return upb_downcast_##cname(def); \ 1786 inline const cpptype *dyn_cast<const cpptype *, const Def>(const Def *def) { \ 1787 return upb_dyncast_##cname(def); \ 1790 inline const cpptype *down_cast<const cpptype *, Def>(Def * def) { \ 1791 return upb_downcast_##cname(def); \ 1794 inline const cpptype *dyn_cast<const cpptype *, Def>(Def * def) { \ 1795 return upb_dyncast_##cname(def); \ 1799 #define UPB_CPP_CASTS(cname, cpptype) 1805 #define UPB_DEF_CASTS(lower, upper, cpptype) \ 1806 UPB_INLINE const upb_##lower *upb_dyncast_##lower(const upb_def *def) { \ 1807 if (upb_def_type(def) != UPB_DEF_##upper) return NULL; \ 1808 return (upb_##lower *)def; \ 1810 UPB_INLINE const upb_##lower *upb_downcast_##lower(const upb_def *def) { \ 1811 assert(upb_def_type(def) == UPB_DEF_##upper); \ 1812 return (const upb_##lower *)def; \ 1814 UPB_INLINE upb_##lower *upb_dyncast_##lower##_mutable(upb_def *def) { \ 1815 return (upb_##lower *)upb_dyncast_##lower(def); \ 1817 UPB_INLINE upb_##lower *upb_downcast_##lower##_mutable(upb_def *def) { \ 1818 return (upb_##lower *)upb_downcast_##lower(def); \ 1820 UPB_CPP_CASTS(lower, cpptype) 1822 #define UPB_DEFINE_DEF(cppname, lower, upper, cppmethods, members) \ 1823 UPB_DEFINE_CLASS2(cppname, upb::Def, upb::RefCounted, cppmethods, \ 1825 UPB_DEF_CASTS(lower, upper, cppname) 1827 #define UPB_DECLARE_DEF_TYPE(cppname, lower, upper) \ 1828 UPB_DECLARE_DERIVED_TYPE2(cppname, upb::Def, upb::RefCounted, \ 1829 upb_ ## lower, upb_def, upb_refcounted) \ 1830 UPB_DEF_CASTS(lower, upper, cppname) 1836 #undef UPB_DECLARE_DEF_TYPE 1837 #undef UPB_DEF_CASTS 1838 #undef UPB_CPP_CASTS 1904 #define UPB_MAX_FIELDNUMBER ((1 << 29) - 1) 1913 class upb::FieldDef {
1921 static bool CheckType(
int32_t val);
1922 static bool CheckLabel(
int32_t val);
1923 static bool CheckDescriptorType(
int32_t val);
1924 static bool CheckIntegerFormat(
int32_t val);
1928 static Type ConvertType(
int32_t val);
1929 static Label ConvertLabel(
int32_t val);
1930 static DescriptorType ConvertDescriptorType(
int32_t val);
1931 static IntegerFormat ConvertIntegerFormat(
int32_t val);
1934 static reffed_ptr<FieldDef> New();
1941 FieldDef* Dup(
const void* owner)
const;
1947 const char* full_name()
const;
1949 bool type_is_set()
const;
1951 Label
label()
const;
1952 const char*
name()
const;
1954 bool is_extension()
const;
1966 size_t GetJsonName(
char*
buf,
size_t len)
const;
1971 bool GetJsonName(
T*
str) {
1972 str->resize(GetJsonName(
NULL, 0));
1973 GetJsonName(&(*str)[0], str->size());
1974 return str->size() > 0;
1991 bool packed()
const;
2008 const char* containing_type_name();
2023 bool IsSubMessage()
const;
2024 bool IsString()
const;
2025 bool IsSequence()
const;
2026 bool IsPrimitive()
const;
2039 bool HasPresence()
const;
2043 IntegerFormat integer_format()
const;
2047 bool is_tag_delimited()
const;
2055 int64_t default_int64()
const;
2056 int32_t default_int32()
const;
2059 bool default_bool()
const;
2060 float default_float()
const;
2061 double default_double()
const;
2065 const char *default_string(
size_t* len)
const;
2079 bool EnumHasStringDefault()
const;
2080 bool EnumHasInt32Default()
const;
2086 bool HasSubDef()
const;
2092 const EnumDef* enum_subdef()
const;
2093 const MessageDef* message_subdef()
const;
2097 const Def* subdef()
const;
2102 const char* subdef_name()
const;
2106 bool set_full_name(
const char* fullname, upb::Status* s);
2107 bool set_full_name(
const std::string& fullname, upb::Status* s);
2111 bool set_containing_type_name(
const char *name, Status* status);
2112 bool set_containing_type_name(
const std::string& name, Status* status);
2117 void set_lazy(
bool lazy);
2120 void set_packed(
bool packed);
2126 void set_type(Type type);
2127 void set_label(Label label);
2128 void set_descriptor_type(DescriptorType type);
2129 void set_is_extension(
bool is_extension);
2138 bool set_number(
uint32_t number, upb::Status* s);
2139 bool set_name(
const char* name, upb::Status* s);
2140 bool set_name(
const std::string& name, upb::Status* s);
2145 bool set_json_name(
const char* json_name, upb::Status* s);
2146 bool set_json_name(
const std::string& name, upb::Status* s);
2150 void clear_json_name();
2152 void set_integer_format(IntegerFormat
format);
2153 bool set_tag_delimited(
bool tag_delimited, upb::Status* s);
2161 void set_default_int64(
int64_t val);
2162 void set_default_int32(
int32_t val);
2163 void set_default_uint64(
uint64_t val);
2164 void set_default_uint32(
uint32_t val);
2165 void set_default_bool(
bool val);
2166 void set_default_float(
float val);
2167 void set_default_double(
double val);
2168 bool set_default_string(
const void *str,
size_t len, Status *s);
2169 bool set_default_string(
const std::string &str, Status *s);
2170 void set_default_cstr(
const char *str, Status *s);
2181 bool set_subdef(
const Def* subdef, Status* s);
2182 bool set_enum_subdef(
const EnumDef* subdef, Status* s);
2183 bool set_message_subdef(
const MessageDef* subdef, Status* s);
2184 bool set_subdef_name(
const char* name, Status* s);
2185 bool set_subdef_name(
const std::string &name, Status* s);
2294 #define UPB_MAPENTRY_KEY 1 2295 #define UPB_MAPENTRY_VALUE 2 2302 class upb::MessageDef {
2305 static reffed_ptr<MessageDef> New();
2311 const char* full_name()
const;
2312 const char*
name()
const;
2313 bool set_full_name(
const char* fullname, Status* s);
2314 bool set_full_name(
const std::string& fullname, Status* s);
2319 bool Freeze(Status* s);
2322 int field_count()
const;
2325 int oneof_count()
const;
2342 bool AddField(FieldDef* f, Status* s);
2343 bool AddField(
const reffed_ptr<FieldDef>& f, Status* s);
2352 bool AddOneof(OneofDef* o, Status* s);
2353 bool AddOneof(
const reffed_ptr<OneofDef>& o, Status* s);
2363 void SetPrimitivesHavePresence(
bool have_presence);
2366 FieldDef* FindFieldByNumber(
uint32_t number);
2368 const FieldDef* FindFieldByNumber(
uint32_t number)
const;
2415 MessageDef* Dup(
const void* owner)
const;
2418 void setmapentry(
bool map_entry);
2419 bool mapentry()
const;
2422 class field_iterator
2423 :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
2425 explicit field_iterator(MessageDef* md);
2426 static field_iterator
end(MessageDef* md);
2430 bool operator!=(
const field_iterator& other)
const;
2431 bool operator==(
const field_iterator& other)
const;
2434 upb_msg_field_iter iter_;
2437 class const_field_iterator
2438 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
2440 explicit const_field_iterator(
const MessageDef* md);
2441 static const_field_iterator
end(
const MessageDef* md);
2445 bool operator!=(
const const_field_iterator& other)
const;
2446 bool operator==(
const const_field_iterator& other)
const;
2449 upb_msg_field_iter iter_;
2453 class oneof_iterator
2454 :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
2456 explicit oneof_iterator(MessageDef* md);
2457 static oneof_iterator
end(MessageDef* md);
2461 bool operator!=(
const oneof_iterator& other)
const;
2462 bool operator==(
const oneof_iterator& other)
const;
2465 upb_msg_oneof_iter iter_;
2468 class const_oneof_iterator
2469 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
2471 explicit const_oneof_iterator(
const MessageDef* md);
2472 static const_oneof_iterator
end(
const MessageDef* md);
2476 bool operator!=(
const const_oneof_iterator& other)
const;
2477 bool operator==(
const const_oneof_iterator& other)
const;
2480 upb_msg_oneof_iter iter_;
2483 class FieldAccessor {
2485 explicit FieldAccessor(MessageDef* msg) : msg_(msg) {}
2486 field_iterator begin() {
return msg_->field_begin(); }
2487 field_iterator
end() {
return msg_->field_end(); }
2492 class ConstFieldAccessor {
2494 explicit ConstFieldAccessor(
const MessageDef* msg) : msg_(msg) {}
2495 const_field_iterator begin() {
return msg_->field_begin(); }
2496 const_field_iterator
end() {
return msg_->field_end(); }
2498 const MessageDef* msg_;
2501 class OneofAccessor {
2503 explicit OneofAccessor(MessageDef* msg) : msg_(msg) {}
2504 oneof_iterator begin() {
return msg_->oneof_begin(); }
2505 oneof_iterator
end() {
return msg_->oneof_end(); }
2510 class ConstOneofAccessor {
2512 explicit ConstOneofAccessor(
const MessageDef* msg) : msg_(msg) {}
2513 const_oneof_iterator begin() {
return msg_->oneof_begin(); }
2514 const_oneof_iterator
end() {
return msg_->oneof_end(); }
2516 const MessageDef* msg_;
2519 field_iterator field_begin();
2520 field_iterator field_end();
2521 const_field_iterator field_begin()
const;
2522 const_field_iterator field_end()
const;
2524 oneof_iterator oneof_begin();
2525 oneof_iterator oneof_end();
2526 const_oneof_iterator oneof_begin()
const;
2527 const_oneof_iterator oneof_end()
const;
2529 FieldAccessor fields() {
return FieldAccessor(
this); }
2530 ConstFieldAccessor fields()
const {
return ConstFieldAccessor(
this); }
2531 OneofAccessor oneofs() {
return OneofAccessor(
this); }
2532 ConstOneofAccessor oneofs()
const {
return ConstOneofAccessor(
this); }
2584 const char *name,
size_t len) {
2601 const char *name,
size_t len) {
2655 class upb::EnumDef {
2658 static reffed_ptr<EnumDef> New();
2664 const char* full_name()
const;
2665 const char*
name()
const;
2666 bool set_full_name(
const char* fullname, Status* s);
2667 bool set_full_name(
const std::string& fullname, Status* s);
2670 bool Freeze(Status* s);
2676 int32_t default_value()
const;
2680 bool set_default_value(
int32_t val, Status* status);
2685 int value_count()
const;
2689 bool AddValue(
const char* name,
int32_t num, Status* status);
2693 bool FindValueByName(
const char* name,
int32_t* num)
const;
2698 const char* FindValueByNumber(
int32_t num)
const;
2702 EnumDef* Dup(
const void* owner)
const;
2718 upb_enum_iter iter_;
2758 const char *name,
int32_t *num) {
2783 class upb::OneofDef {
2786 static reffed_ptr<OneofDef> New();
2796 const char*
name()
const;
2797 bool set_name(
const char* name, Status* s);
2798 bool set_name(
const std::string& name, Status* s);
2801 int field_count()
const;
2816 bool AddField(
const reffed_ptr<FieldDef>& field, Status* s);
2838 const FieldDef* FindFieldByNumber(
uint32_t num)
const;
2842 OneofDef* Dup(
const void* owner)
const;
2845 class iterator :
public std::iterator<std::forward_iterator_tag, FieldDef*> {
2847 explicit iterator(OneofDef* md);
2848 static iterator
end(OneofDef* md);
2852 bool operator!=(
const iterator& other)
const;
2853 bool operator==(
const iterator& other)
const;
2856 upb_oneof_iter iter_;
2859 class const_iterator
2860 :
public std::iterator<std::forward_iterator_tag, const FieldDef*> {
2862 explicit const_iterator(
const OneofDef* md);
2863 static const_iterator
end(
const OneofDef* md);
2867 bool operator!=(
const const_iterator& other)
const;
2868 bool operator==(
const const_iterator& other)
const;
2871 upb_oneof_iter iter_;
2876 const_iterator begin()
const;
2877 const_iterator
end()
const;
2900 const void *ref_donor,
2908 const char *name,
size_t length);
2937 class upb::FileDef {
2940 static reffed_ptr<FileDef> New();
2946 const char*
name()
const;
2947 bool set_name(
const char* name, Status* s);
2948 bool set_name(
const std::string& name, Status* s);
2951 const char* package()
const;
2952 bool set_package(
const char* package, Status* s);
2960 int def_count()
const;
2961 const Def* def(
int index)
const;
2962 Def* def(
int index);
2966 int dependency_count()
const;
2967 const FileDef* dependency(
int index)
const;
2976 bool AddDef(Def* def, Status* s);
2978 bool AddEnum(EnumDef* e, Status* s);
2982 bool AddDependency(
const FileDef*
file);
2990 bool Freeze(Status* s);
3045 assert(str.size() == std::strlen(str.c_str()));
3052 inline Def* Def::Dup(
const void* owner)
const {
3056 inline const char* Def::full_name()
const {
return upb_def_fullname(
this); }
3058 inline bool Def::set_full_name(
const char* fullname, Status* s) {
3061 inline bool Def::set_full_name(
const std::string& fullname, Status* s) {
3064 inline bool Def::Freeze(Def*
const* defs,
size_t n, Status* status) {
3067 inline bool Def::Freeze(
const std::vector<Def*>& defs, Status* status) {
3068 return upb_def_freeze((Def*
const*)&defs[0], defs.size(), status);
3071 inline bool FieldDef::CheckType(
int32_t val) {
3074 inline bool FieldDef::CheckLabel(
int32_t val) {
3077 inline bool FieldDef::CheckDescriptorType(
int32_t val) {
3080 inline bool FieldDef::CheckIntegerFormat(
int32_t val) {
3084 assert(CheckType(val));
3087 inline FieldDef::Label FieldDef::ConvertLabel(
int32_t val) {
3088 assert(CheckLabel(val));
3089 return static_cast<FieldDef::Label
>(
val);
3091 inline FieldDef::DescriptorType FieldDef::ConvertDescriptorType(
int32_t val) {
3092 assert(CheckDescriptorType(val));
3093 return static_cast<FieldDef::DescriptorType
>(
val);
3095 inline FieldDef::IntegerFormat FieldDef::ConvertIntegerFormat(
int32_t val) {
3096 assert(CheckIntegerFormat(val));
3097 return static_cast<FieldDef::IntegerFormat
>(
val);
3100 inline reffed_ptr<FieldDef> FieldDef::New() {
3102 return reffed_ptr<FieldDef>(
f, &
f);
3104 inline FieldDef* FieldDef::Dup(
const void* owner)
const {
3107 inline const char* FieldDef::full_name()
const {
3110 inline bool FieldDef::set_full_name(
const char* fullname, Status* s) {
3113 inline bool FieldDef::set_full_name(
const std::string& fullname, Status* s) {
3116 inline bool FieldDef::type_is_set()
const {
3128 inline bool FieldDef::is_extension()
const {
3131 inline size_t FieldDef::GetJsonName(
char* buf,
size_t len)
const {
3134 inline bool FieldDef::lazy()
const {
3137 inline void FieldDef::set_lazy(
bool lazy) {
3140 inline bool FieldDef::packed()
const {
3146 inline void FieldDef::set_packed(
bool packed) {
3155 inline const char* FieldDef::containing_type_name() {
3158 inline bool FieldDef::set_number(
uint32_t number, Status* s) {
3161 inline bool FieldDef::set_name(
const char *name, Status* s) {
3164 inline bool FieldDef::set_name(
const std::string& name, Status* s) {
3167 inline bool FieldDef::set_json_name(
const char *name, Status* s) {
3170 inline bool FieldDef::set_json_name(
const std::string& name, Status* s) {
3173 inline void FieldDef::clear_json_name() {
3176 inline bool FieldDef::set_containing_type_name(
const char *name, Status* s) {
3179 inline bool FieldDef::set_containing_type_name(
const std::string &name,
3186 inline void FieldDef::set_is_extension(
bool is_extension) {
3189 inline void FieldDef::set_descriptor_type(FieldDef::DescriptorType type) {
3192 inline void FieldDef::set_label(
upb_label_t label) {
3195 inline bool FieldDef::IsSubMessage()
const {
3201 inline int64_t FieldDef::default_int64()
const {
3204 inline int32_t FieldDef::default_int32()
const {
3207 inline uint64_t FieldDef::default_uint64()
const {
3210 inline uint32_t FieldDef::default_uint32()
const {
3213 inline bool FieldDef::default_bool()
const {
3216 inline float FieldDef::default_float()
const {
3219 inline double FieldDef::default_double()
const {
3222 inline const char* FieldDef::default_string(
size_t* len)
const {
3225 inline void FieldDef::set_default_int64(
int64_t value) {
3228 inline void FieldDef::set_default_int32(
int32_t value) {
3231 inline void FieldDef::set_default_uint64(
uint64_t value) {
3234 inline void FieldDef::set_default_uint32(
uint32_t value) {
3237 inline void FieldDef::set_default_bool(
bool value) {
3240 inline void FieldDef::set_default_float(
float value) {
3243 inline void FieldDef::set_default_double(
double value) {
3246 inline bool FieldDef::set_default_string(
const void *str,
size_t len,
3250 inline bool FieldDef::set_default_string(
const std::string& str, Status* s) {
3253 inline void FieldDef::set_default_cstr(
const char* str, Status* s) {
3258 inline const MessageDef *FieldDef::message_subdef()
const {
3261 inline const EnumDef *FieldDef::enum_subdef()
const {
3264 inline const char* FieldDef::subdef_name()
const {
3267 inline bool FieldDef::set_subdef(
const Def* subdef, Status* s) {
3270 inline bool FieldDef::set_enum_subdef(
const EnumDef* subdef, Status* s) {
3273 inline bool FieldDef::set_message_subdef(
const MessageDef* subdef, Status* s) {
3276 inline bool FieldDef::set_subdef_name(
const char* name, Status* s) {
3279 inline bool FieldDef::set_subdef_name(
const std::string& name, Status* s) {
3283 inline reffed_ptr<MessageDef> MessageDef::New() {
3285 return reffed_ptr<MessageDef>(
m, &
m);
3287 inline const char *MessageDef::full_name()
const {
3296 inline bool MessageDef::set_full_name(
const char* fullname, Status* s) {
3299 inline bool MessageDef::set_full_name(
const std::string& fullname, Status* s) {
3302 inline bool MessageDef::set_syntax(
upb_syntax_t syntax) {
3305 inline bool MessageDef::Freeze(Status* status) {
3308 inline int MessageDef::field_count()
const {
3311 inline int MessageDef::oneof_count()
const {
3320 inline bool MessageDef::AddOneof(
upb_oneofdef* o, Status* s) {
3323 inline bool MessageDef::AddOneof(
const reffed_ptr<OneofDef>& o, Status* s) {
3326 inline FieldDef* MessageDef::FindFieldByNumber(
uint32_t number) {
3332 inline const FieldDef* MessageDef::FindFieldByNumber(
uint32_t number)
const {
3346 inline MessageDef* MessageDef::Dup(
const void *owner)
const {
3349 inline void MessageDef::setmapentry(
bool map_entry) {
3352 inline bool MessageDef::mapentry()
const {
3355 inline MessageDef::field_iterator MessageDef::field_begin() {
3356 return field_iterator(
this);
3358 inline MessageDef::field_iterator MessageDef::field_end() {
3361 inline MessageDef::const_field_iterator MessageDef::field_begin()
const {
3362 return const_field_iterator(
this);
3364 inline MessageDef::const_field_iterator MessageDef::field_end()
const {
3368 inline MessageDef::oneof_iterator MessageDef::oneof_begin() {
3369 return oneof_iterator(
this);
3371 inline MessageDef::oneof_iterator MessageDef::oneof_end() {
3374 inline MessageDef::const_oneof_iterator MessageDef::oneof_begin()
const {
3375 return const_oneof_iterator(
this);
3377 inline MessageDef::const_oneof_iterator MessageDef::oneof_end()
const {
3381 inline MessageDef::field_iterator::field_iterator(MessageDef* md) {
3386 MessageDef::field_iterator iter(md);
3397 const field_iterator &other)
const {
3401 const field_iterator &other)
const {
3402 return !(*
this == other);
3405 inline MessageDef::const_field_iterator::const_field_iterator(
3406 const MessageDef* md) {
3410 const MessageDef *md) {
3411 MessageDef::const_field_iterator iter(md);
3422 const const_field_iterator &other)
const {
3426 const const_field_iterator &other)
const {
3427 return !(*
this == other);
3430 inline MessageDef::oneof_iterator::oneof_iterator(MessageDef* md) {
3435 MessageDef::oneof_iterator iter(md);
3446 const oneof_iterator &other)
const {
3450 const oneof_iterator &other)
const {
3451 return !(*
this == other);
3454 inline MessageDef::const_oneof_iterator::const_oneof_iterator(
3455 const MessageDef* md) {
3459 const MessageDef *md) {
3460 MessageDef::const_oneof_iterator iter(md);
3471 const const_oneof_iterator &other)
const {
3475 const const_oneof_iterator &other)
const {
3476 return !(*
this == other);
3479 inline reffed_ptr<EnumDef> EnumDef::New() {
3481 return reffed_ptr<EnumDef>(
e, &
e);
3483 inline const char* EnumDef::full_name()
const {
3489 inline bool EnumDef::set_full_name(
const char* fullname, Status* s) {
3492 inline bool EnumDef::set_full_name(
const std::string& fullname, Status* s) {
3495 inline bool EnumDef::Freeze(Status* status) {
3498 inline int32_t EnumDef::default_value()
const {
3501 inline bool EnumDef::set_default_value(
int32_t val, Status* status) {
3505 inline bool EnumDef::AddValue(
const char* name,
int32_t num, Status* status) {
3512 inline bool EnumDef::FindValueByName(
const char* name,
int32_t *num)
const {
3515 inline const char* EnumDef::FindValueByNumber(
int32_t num)
const {
3518 inline EnumDef* EnumDef::Dup(
const void* owner)
const {
3531 inline bool EnumDef::Iterator::Done() {
return upb_enum_done(&iter_); }
3532 inline void EnumDef::Iterator::Next() {
return upb_enum_next(&iter_); }
3534 inline reffed_ptr<OneofDef> OneofDef::New() {
3536 return reffed_ptr<OneofDef>(o, &o);
3545 inline bool OneofDef::set_name(
const char* name, Status* s) {
3548 inline bool OneofDef::set_name(
const std::string& name, Status* s) {
3551 inline int OneofDef::field_count()
const {
3564 inline const FieldDef* OneofDef::FindFieldByNumber(
uint32_t num)
const {
3567 inline OneofDef::iterator OneofDef::begin() {
return iterator(
this); }
3569 inline OneofDef::const_iterator OneofDef::begin()
const {
3570 return const_iterator(
this);
3576 inline OneofDef::iterator::iterator(OneofDef* o) {
3580 OneofDef::iterator iter(o);
3592 return !(*
this == other);
3595 inline OneofDef::const_iterator::const_iterator(
const OneofDef* md) {
3599 const OneofDef *md) {
3600 OneofDef::const_iterator iter(md);
3611 const const_iterator &other)
const {
3615 const const_iterator &other)
const {
3616 return !(*
this == other);
3619 inline reffed_ptr<FileDef> FileDef::New() {
3621 return reffed_ptr<FileDef>(
f, &
f);
3627 inline bool FileDef::set_name(
const char* name, Status* s) {
3630 inline bool FileDef::set_name(
const std::string& name, Status* s) {
3633 inline const char* FileDef::package()
const {
3636 inline bool FileDef::set_package(
const char* package, Status* s) {
3639 inline int FileDef::def_count()
const {
3642 inline const Def* FileDef::def(
int index)
const {
3645 inline Def* FileDef::def(
int index) {
3648 inline int FileDef::dependency_count()
const {
3651 inline const FileDef* FileDef::dependency(
int index)
const {
3654 inline bool FileDef::AddDef(Def* def, Status* s) {
3666 inline bool FileDef::AddDependency(
const FileDef*
file) {
3691 #ifndef UPB_STATICINIT_H_ 3692 #define UPB_STATICINIT_H_ 3696 #error This file cannot be included from C++ 3707 const char *fullname;
3715 bool came_from_user;
3718 #define UPB_DEF_INIT(name, type, vtbl, refs, ref2s) \ 3719 { UPB_REFCOUNT_INIT(vtbl, refs, ref2s), name, NULL, type, false } 3742 bool subdef_is_symbolic;
3743 bool msg_is_symbolic;
3745 bool default_is_string;
3761 #define UPB_FIELDDEF_INIT(label, type, intfmt, tagdelim, is_extension, lazy, \ 3762 packed, name, num, msgdef, subdef, selector_base, \ 3763 index, defaultval, refs, ref2s) \ 3765 UPB_DEF_INIT(name, UPB_DEF_FIELD, &upb_fielddef_vtbl, refs, ref2s), \ 3766 defaultval, {msgdef}, {subdef}, NULL, false, false, \ 3767 type == UPB_TYPE_STRING || type == UPB_TYPE_BYTES, true, is_extension, \ 3768 lazy, packed, intfmt, tagdelim, type, label, num, selector_base, index \ 3777 size_t selector_count;
3797 #define UPB_MSGDEF_INIT(name, selector_count, submsg_field_count, itof, ntof, \ 3798 map_entry, syntax, refs, ref2s) \ 3800 UPB_DEF_INIT(name, UPB_DEF_MSG, &upb_fielddef_vtbl, refs, ref2s), \ 3801 selector_count, submsg_field_count, itof, ntof, map_entry, syntax \ 3817 #define UPB_ENUMDEF_INIT(name, ntoi, iton, defaultval, refs, ref2s) \ 3818 { UPB_DEF_INIT(name, UPB_DEF_ENUM, &upb_enumdef_vtbl, refs, ref2s), ntoi, \ 3835 #define UPB_ONEOFDEF_INIT(name, ntof, itof, refs, ref2s) \ 3836 { UPB_REFCOUNT_INIT(&upb_oneofdef_vtbl, refs, ref2s), name, ntof, itof } 3879 #ifndef UPB_HANDLERS_H 3880 #define UPB_HANDLERS_H 3887 class HandlerAttributes;
3889 template <
class T>
class Handler;
3890 template <
class T>
struct CanonicalType;
3907 #define UPB_MAX_HANDLER_DEPTH 64 3919 UPB_HANDLER_STARTSTR,
3922 UPB_HANDLER_STARTSUBMSG,
3923 UPB_HANDLER_ENDSUBMSG,
3924 UPB_HANDLER_STARTSEQ,
3928 #define UPB_HANDLER_MAX (UPB_HANDLER_ENDSEQ+1) 3930 #define UPB_BREAK NULL 3934 #define UPB_NO_CLOSURE &_upb_noclosure 3963 #define UPB_STARTMSG_SELECTOR 0 3964 #define UPB_ENDMSG_SELECTOR 1 3965 #define UPB_STATIC_SELECTOR_COUNT 2 3968 #define UPB_STARTSTR_SELECTOR 0 3969 #define UPB_STRING_SELECTOR 1 3970 #define UPB_ENDSTR_SELECTOR 2 3977 class upb::HandlerAttributes {
3979 HandlerAttributes();
3980 ~HandlerAttributes();
3985 bool SetHandlerData(
const void *handler_data);
3986 const void* handler_data()
const;
3992 bool SetClosureType(
const void *closure_type);
3993 const void* closure_type()
const;
3999 bool SetReturnClosureType(
const void *return_closure_type);
4000 const void* return_closure_type()
const;
4005 bool SetAlwaysOk(
bool always_ok);
4006 bool always_ok()
const;
4014 const void *handler_data_;
4015 const void *closure_type_;
4016 const void *return_closure_type_;
4020 #define UPB_HANDLERATTR_INITIALIZER {NULL, NULL, NULL, false} 4043 class upb::BufferHandle {
4051 const char*
buffer()
const;
4055 size_t object_offset()
const;
4059 void SetBuffer(
const char* buf,
size_t object_offset);
4064 void SetAttachedObject(
const T*
obj);
4068 const T* GetAttachedObject()
const;
4076 const char *buf,
size_t ofs);
4086 const void *objtype_;
4103 class upb::Handlers {
4105 typedef upb_selector_t Selector;
4108 typedef Handler<void *(*)(void *, const void *)> StartFieldHandler;
4109 typedef Handler<bool (*)(void *, const void *)> EndFieldHandler;
4110 typedef Handler<bool (*)(void *, const void *)> StartMessageHandler;
4111 typedef Handler<bool (*)(void *, const void *, Status*)> EndMessageHandler;
4112 typedef Handler<void *(*)(void *, const void *, size_t)> StartStringHandler;
4113 typedef Handler<
size_t (*)(
void *,
const void *,
const char *,
size_t,
4114 const BufferHandle *)> StringHandler;
4116 template <
class T>
struct ValueHandler {
4117 typedef Handler<bool(*)(void *, const void *, T)>
H;
4130 typedef void GenericFunction();
4132 typedef void HandlersCallback(
const void *closure, upb_handlers *h);
4136 static reffed_ptr<Handlers> New(
const MessageDef *m);
4143 static reffed_ptr<const Handlers> NewFrozen(
const MessageDef *m,
4145 const void *closure);
4155 const Status* status();
4161 bool Freeze(Status* s);
4165 static bool Freeze(Handlers*
const*
handlers,
int n, Status* s);
4166 static bool Freeze(
const std::vector<Handlers*>& handlers, Status* s);
4169 const MessageDef* message_def()
const;
4184 bool SetStartMessageHandler(
const StartMessageHandler& handler);
4194 bool SetEndMessageHandler(
const EndMessageHandler& handler);
4216 bool SetInt32Handler (
const FieldDef* f,
const Int32Handler& h);
4217 bool SetInt64Handler (
const FieldDef* f,
const Int64Handler& h);
4218 bool SetUInt32Handler(
const FieldDef* f,
const UInt32Handler& h);
4219 bool SetUInt64Handler(
const FieldDef* f,
const UInt64Handler& h);
4220 bool SetFloatHandler (
const FieldDef* f,
const FloatHandler& h);
4221 bool SetDoubleHandler(
const FieldDef* f,
const DoubleHandler& h);
4222 bool SetBoolHandler (
const FieldDef* f,
const BoolHandler& h);
4229 bool SetValueHandler(
4269 bool SetStartStringHandler(
const FieldDef* f,
const StartStringHandler& h);
4270 bool SetStringHandler(
const FieldDef* f,
const StringHandler& h);
4271 bool SetEndStringHandler(
const FieldDef* f,
const EndFieldHandler& h);
4287 bool SetStartSequenceHandler(
const FieldDef* f,
const StartFieldHandler& h);
4304 bool SetStartSubMessageHandler(
const FieldDef* f,
const StartFieldHandler& h);
4317 bool SetEndSubMessageHandler(
const FieldDef *f,
const EndFieldHandler &h);
4330 bool SetEndSequenceHandler(
const FieldDef* f,
const EndFieldHandler& h);
4334 bool SetSubHandlers(
const FieldDef* f,
const Handlers*
sub);
4335 const Handlers* GetSubHandlers(
const FieldDef* f)
const;
4339 const Handlers* GetSubHandlers(Selector startsubmsg)
const;
4347 static bool GetSelector(
const FieldDef* f, Type type, Selector* s);
4350 static Selector GetEndSelector(Selector start_selector);
4354 GenericFunction* GetHandler(Selector selector);
4357 bool GetAttributes(Selector selector, HandlerAttributes*
attr);
4360 const void* GetHandlerData(Selector selector);
4372 const upb_handlers *h, upb_selector_t s);
4374 const upb_handlers *h, upb_selector_t s);
4376 struct upb_handlers {
4381 const upb_handlers **
sub;
4382 const void *top_closure_type;
4432 #define UpbMakeHandler(f) upb::MatchFunc(f).template GetFunc<f>() 4435 #define UpbBind(f, d) upb::MatchFunc(f).template GetFunc<f>((d)) 4442 #define UpbMakeHandler(f) upb::MatchFunc(f).GetFunc<f>() 4444 #define UpbBind(f, d) upb::MatchFunc(f).GetFunc<f>((d)) 4451 #define UpbMakeHandlerT(f) upb::MatchFunc(f).template GetFunc<f>() 4454 #define UpbBindT(f, d) upb::MatchFunc(f).template GetFunc<f>((d)) 4459 template <
class T>
class Handler {
4465 template <
class F> Handler(
F func);
4469 void AddCleanup(Handlers* h)
const {
4470 if (cleanup_func_) {
4471 bool ok = h->AddCleanup(cleanup_data_, cleanup_func_);
4477 friend class Handlers;
4479 mutable HandlerAttributes attr_;
4480 mutable bool registered_;
4481 void *cleanup_data_;
4538 const void *closure);
4593 const upb_handlers *sub);
4597 upb_selector_t sel);
4619 class upb::BytesHandler {
4662 #ifndef UPB_HANDLERS_INL_H_ 4663 #define UPB_HANDLERS_INL_H_ 4717 #define UPB_INT32_MAX 0x7fffffffLL 4718 #define UPB_INT32_MIN (-UPB_INT32_MAX - 1) 4719 #define UPB_INT64_MAX 0x7fffffffffffffffLL 4720 #define UPB_INT64_MIN (-UPB_INT64_MAX - 1) 4722 #if INT_MAX == UPB_INT32_MAX && INT_MIN == UPB_INT32_MIN 4723 #define UPB_INT_IS_32BITS 1 4726 #if LONG_MAX == UPB_INT32_MAX && LONG_MIN == UPB_INT32_MIN 4727 #define UPB_LONG_IS_32BITS 1 4730 #if LONG_MAX == UPB_INT64_MAX && LONG_MIN == UPB_INT64_MIN 4731 #define UPB_LONG_IS_64BITS 1 4734 #if LLONG_MAX == UPB_INT64_MAX && LLONG_MIN == UPB_INT64_MIN 4735 #define UPB_LLONG_IS_64BITS 1 4740 #if UPB_INT_IS_32BITS 4741 #define UPB_INT32_T int 4742 #define UPB_UINT32_T unsigned int 4744 #if UPB_LONG_IS_32BITS 4745 #define UPB_TWO_32BIT_TYPES 1 4746 #define UPB_INT32ALT_T long 4747 #define UPB_UINT32ALT_T unsigned long 4750 #elif UPB_LONG_IS_32BITS 4751 #define UPB_INT32_T long 4752 #define UPB_UINT32_T unsigned long 4756 #if UPB_LONG_IS_64BITS 4757 #define UPB_INT64_T long 4758 #define UPB_UINT64_T unsigned long 4760 #if UPB_LLONG_IS_64BITS 4761 #define UPB_TWO_64BIT_TYPES 1 4762 #define UPB_INT64ALT_T long long 4763 #define UPB_UINT64ALT_T unsigned long long 4766 #elif UPB_LLONG_IS_64BITS 4767 #define UPB_INT64_T long long 4768 #define UPB_UINT64_T unsigned long long 4771 #undef UPB_INT32_MAX 4772 #undef UPB_INT32_MIN 4773 #undef UPB_INT64_MAX 4774 #undef UPB_INT64_MIN 4775 #undef UPB_INT_IS_32BITS 4776 #undef UPB_LONG_IS_32BITS 4777 #undef UPB_LONG_IS_64BITS 4778 #undef UPB_LLONG_IS_64BITS 4783 typedef void CleanupFunc(
void *ptr);
4790 class CouldntRemoveConst {};
4791 template <
class T>
struct remove_constptr {
typedef CouldntRemoveConst
type; };
4792 template <
class T>
struct remove_constptr<const T *> {
typedef T *
type; };
4796 template <
class T,
class U>
struct disable_if_same {
typedef void Type; };
4797 template <
class T>
struct disable_if_same<T, T> {};
4799 template <
class T>
void DeletePointer(
void *
p) {
delete static_cast<T
>(
p); }
4801 template <
class T1,
class T2>
4802 struct FirstUnlessVoidOrBool {
4807 struct FirstUnlessVoidOrBool<void, T2> {
4812 struct FirstUnlessVoidOrBool<bool, T2> {
4816 template<
class T,
class U>
4822 struct is_same<T, T> {
4826 template<
class T,
class U>
4835 template <
class C,
class R =
void>
4853 struct UnboundFunc {
4854 CleanupFunc *GetCleanup() {
return NULL; }
4855 void *GetData() {
return NULL; }
4858 template <
class R,
class P1, R F(P1),
class I>
4859 struct Func1 :
public UnboundFunc {
4862 static R Call(P1 p1) {
return F(p1); }
4865 template <
class R,
class P1,
class P2, R F(P1, P2),
class I>
4866 struct Func2 :
public UnboundFunc {
4869 static R Call(P1 p1, P2 p2) {
return F(p1, p2); }
4872 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3),
class I>
4873 struct Func3 :
public UnboundFunc {
4876 static R Call(P1 p1, P2 p2, P3 p3) {
return F(p1, p2, p3); }
4879 template <
class R,
class P1,
class P2,
class P3,
class P4,
R F(P1, P2, P3, P4),
4881 struct Func4 :
public UnboundFunc {
4884 static R Call(P1 p1, P2 p2, P3 p3, P4 p4) {
return F(p1, p2, p3, p4); }
4887 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4888 R F(P1, P2, P3, P4, P5),
class I>
4889 struct Func5 :
public UnboundFunc {
4892 static R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
4893 return F(p1, p2, p3, p4, p5);
4907 explicit BoundFunc(MutableP2 data_) :
data(data_) {}
4908 CleanupFunc *GetCleanup() {
return &DeletePointer<MutableP2>; }
4909 MutableP2 GetData() {
return data; }
4913 template <
class R,
class P1,
class P2, R F(P1, P2),
class I>
4914 struct BoundFunc2 :
public BoundFunc<P2> {
4915 typedef BoundFunc<P2>
Base;
4917 explicit BoundFunc2(
typename Base::MutableP2 arg) : Base(arg) {}
4920 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3),
class I>
4921 struct BoundFunc3 :
public BoundFunc<P2> {
4922 typedef BoundFunc<P2>
Base;
4924 explicit BoundFunc3(
typename Base::MutableP2 arg) : Base(arg) {}
4927 template <
class R,
class P1,
class P2,
class P3,
class P4,
R F(P1, P2, P3, P4),
4929 struct BoundFunc4 :
public BoundFunc<P2> {
4930 typedef BoundFunc<P2>
Base;
4932 explicit BoundFunc4(
typename Base::MutableP2 arg) : Base(arg) {}
4935 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
4936 R F(P1, P2, P3, P4, P5),
class I>
4937 struct BoundFunc5 :
public BoundFunc<P2> {
4938 typedef BoundFunc<P2>
Base;
4940 explicit BoundFunc5(
typename Base::MutableP2 arg) : Base(arg) {}
4950 template <
class R,
class P1>
4953 Func1<R, P1, F, FuncInfo<P1, R> > GetFunc() {
4954 return Func1<R, P1, F, FuncInfo<P1, R> >();
4958 template <
class R,
class P1,
class P2>
4960 template <R F(P1, P2)>
4961 Func2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc() {
4962 return Func2<R, P1, P2, F, FuncInfo<P1, R> >();
4965 template <R F(P1, P2)>
4966 BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc(
4968 return BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> >(param2);
4972 template <
class R,
class P1,
class P2,
class P3>
4974 template <R F(P1, P2, P3)>
4975 Func3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc() {
4976 return Func3<R, P1, P2, P3, F, FuncInfo<P1, R> >();
4979 template <R F(P1, P2, P3)>
4980 BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc(
4982 return BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> >(param2);
4986 template <
class R,
class P1,
class P2,
class P3,
class P4>
4988 template <R F(P1, P2, P3, P4)>
4989 Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc() {
4990 return Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >();
4993 template <R F(P1, P2, P3, P4)>
4994 BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc(
4996 return BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >(param2);
5000 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
5002 template <R F(P1, P2, P3, P4, P5)>
5003 Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc() {
5004 return Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >();
5007 template <R F(P1, P2, P3, P4, P5)>
5008 BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc(
5010 return BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >(param2);
5016 template <
class R,
class P1>
5017 inline FuncSig1<R, P1> MatchFunc(
R (*f)(P1)) {
5019 return FuncSig1<R, P1>();
5022 template <
class R,
class P1,
class P2>
5023 inline FuncSig2<R, P1, P2> MatchFunc(
R (*f)(P1, P2)) {
5025 return FuncSig2<R, P1, P2>();
5028 template <
class R,
class P1,
class P2,
class P3>
5029 inline FuncSig3<R, P1, P2, P3> MatchFunc(
R (*f)(P1, P2, P3)) {
5031 return FuncSig3<R, P1, P2, P3>();
5034 template <
class R,
class P1,
class P2,
class P3,
class P4>
5035 inline FuncSig4<R, P1, P2, P3, P4> MatchFunc(
R (*f)(P1, P2, P3, P4)) {
5037 return FuncSig4<R, P1, P2, P3, P4>();
5040 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
5041 inline FuncSig5<R, P1, P2, P3, P4, P5> MatchFunc(
R (*f)(P1, P2, P3, P4, P5)) {
5043 return FuncSig5<R, P1, P2, P3, P4, P5>();
5049 template <
class R,
class C, R (C::*F)()>
5050 R CallMethod0(
C *obj) {
5051 return ((*obj).*
F)();
5054 template <
class R,
class C,
class P1, R (C::*F)(P1)>
5055 R CallMethod1(
C *obj, P1 arg1) {
5056 return ((*obj).*
F)(arg1);
5059 template <
class R,
class C,
class P1,
class P2, R (C::*F)(P1, P2)>
5060 R CallMethod2(
C *obj, P1 arg1, P2 arg2) {
5061 return ((*obj).*
F)(arg1, arg2);
5064 template <
class R,
class C,
class P1,
class P2,
class P3, R (C::*F)(P1, P2, P3)>
5065 R CallMethod3(
C *obj, P1 arg1, P2 arg2, P3
arg3) {
5066 return ((*obj).*
F)(arg1, arg2,
arg3);
5069 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4,
5070 R (C::*
F)(P1, P2, P3, P4)>
5071 R CallMethod4(C *obj, P1 arg1, P2 arg2, P3 arg3, P4
arg4) {
5072 return ((*obj).*F)(arg1, arg2,
arg3,
arg4);
5079 template <
class R,
class C>
5081 template <R (C::*F)()>
5082 Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> > GetFunc() {
5083 return Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> >();
5087 template <
class R,
class C,
class P1>
5089 template <R (C::*F)(P1)>
5090 Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc() {
5091 return Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >();
5094 template <R (C::*F)(P1)>
5095 BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc(
5097 return BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >(
5102 template <
class R,
class C,
class P1,
class P2>
5104 template <R (C::*F)(P1, P2)>
5105 Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
5107 return Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
5108 FuncInfo<C *, R> >();
5111 template <R (C::*F)(P1, P2)>
5112 BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
5114 return BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
5115 FuncInfo<C *, R> >(param1);
5119 template <
class R,
class C,
class P1,
class P2,
class P3>
5121 template <R (C::*F)(P1, P2, P3)>
5122 Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>, FuncInfo<C *, R> >
5124 return Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
5125 FuncInfo<C *, R> >();
5128 template <R (C::*F)(P1, P2, P3)>
5129 BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
5132 return BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
5133 FuncInfo<C *, R> >(param1);
5137 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4>
5139 template <R (C::*F)(P1, P2, P3, P4)>
5140 Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
5143 return Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
5144 FuncInfo<C *, R> >();
5147 template <R (C::*F)(P1, P2, P3, P4)>
5148 BoundFunc5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
5151 return BoundFunc5<
R, C *, P1, P2, P3, P4,
5152 CallMethod4<R, C, P1, P2, P3, P4, F>, FuncInfo<C *, R> >(
5157 template <
class R,
class C>
5158 inline MethodSig0<R, C> MatchFunc(
R (C::*f)()) {
5160 return MethodSig0<R, C>();
5163 template <
class R,
class C,
class P1>
5164 inline MethodSig1<R, C, P1> MatchFunc(
R (C::*f)(P1)) {
5166 return MethodSig1<R, C, P1>();
5169 template <
class R,
class C,
class P1,
class P2>
5170 inline MethodSig2<R, C, P1, P2> MatchFunc(
R (C::*f)(P1, P2)) {
5172 return MethodSig2<R, C, P1, P2>();
5175 template <
class R,
class C,
class P1,
class P2,
class P3>
5176 inline MethodSig3<R, C, P1, P2, P3> MatchFunc(
R (C::*f)(P1, P2, P3)) {
5178 return MethodSig3<R, C, P1, P2, P3>();
5181 template <
class R,
class C,
class P1,
class P2,
class P3,
class P4>
5182 inline MethodSig4<R, C, P1, P2, P3, P4> MatchFunc(
R (C::*f)(P1, P2, P3, P4)) {
5184 return MethodSig4<R, C, P1, P2, P3, P4>();
5204 template <
class F,
class R,
class Enable =
void>
5205 struct MaybeWrapReturn;
5209 struct MaybeWrapReturn<F, typename F::Return> {
5214 template <
class P1,
class P2,
void F(P1, P2)>
5215 bool ReturnTrue2(P1 p1, P2 p2) {
5220 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3)>
5221 bool ReturnTrue3(P1 p1, P2 p2, P3 p3) {
5227 template <
class P1,
class P2,
void F(P1, P2)>
5228 void *ReturnClosure2(P1 p1, P2 p2) {
5233 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3)>
5234 void *ReturnClosure3(P1 p1, P2 p2, P3 p3) {
5240 template <
class R,
class P1,
class P2, R F(P1, P2)>
5241 void *CastReturnToVoidPtr2(P1 p1, P2 p2) {
5245 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3)>
5246 void *CastReturnToVoidPtr3(P1 p1, P2 p2, P3 p3) {
5247 return F(p1, p2, p3);
5251 template <
class P1,
class P2,
bool F(P1, P2)>
5252 void *ReturnClosureOrBreak2(P1 p1, P2 p2) {
5256 template <
class P1,
class P2,
class P3,
bool F(P1, P2, P3)>
5257 void *ReturnClosureOrBreak3(P1 p1, P2 p2, P3 p3) {
5262 template <
class P1,
class P2,
5263 void F(P1, P2,
const char *,
size_t,
const BufferHandle *)>
5264 size_t ReturnStringLen(P1 p1, P2 p2,
const char *p3,
size_t p4,
5265 const BufferHandle *p5) {
5266 F(p1, p2, p3, p4, p5);
5272 template <
class P1,
class P2,
5273 bool F(P1, P2,
const char *,
size_t,
const BufferHandle *)>
5274 size_t ReturnNOr0(P1 p1, P2 p2,
const char *p3,
size_t p4,
5275 const BufferHandle *p5) {
5276 return F(p1, p2, p3, p4, p5) ? p4 : 0;
5281 template <
class P1,
class P2,
void F(P1, P2),
class I>
5282 struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, bool> {
5283 typedef Func2<bool, P1, P2, ReturnTrue2<P1, P2, F>, I> Func;
5286 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3),
class I>
5287 struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, bool> {
5288 typedef Func3<bool, P1, P2, P3, ReturnTrue3<P1, P2, P3, F>, I> Func;
5293 template <
class P1,
class P2,
void F(P1, P2),
class I>
5294 struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, void *> {
5295 typedef Func2<void *, P1, P2, ReturnClosure2<P1, P2, F>, I> Func;
5298 template <
class P1,
class P2,
class P3,
void F(P1, P2, P3),
class I>
5299 struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, void *> {
5300 typedef Func3<void *, P1, P2, P3, ReturnClosure3<P1, P2, P3, F>, I> Func;
5305 template <
class R,
class P1,
class P2, R *F(P1, P2),
class I>
5306 struct MaybeWrapReturn<Func2<R *, P1, P2,
F, I>,
void *,
5308 typedef Func2<void *, P1, P2, CastReturnToVoidPtr2<R *, P1, P2, F>, I> Func;
5311 template <
class R,
class P1,
class P2,
class P3, R *F(P1, P2, P3),
class I>
5312 struct MaybeWrapReturn<Func3<R *, P1, P2, P3,
F, I>,
void *,
5314 typedef Func3<void *, P1, P2, P3, CastReturnToVoidPtr3<R *, P1, P2, P3, F>, I>
5320 template <
class P1,
class P2,
bool F(P1, P2),
class I>
5321 struct MaybeWrapReturn<Func2<bool, P1, P2, F, I>, void *> {
5322 typedef Func2<void *, P1, P2, ReturnClosureOrBreak2<P1, P2, F>, I> Func;
5325 template <
class P1,
class P2,
class P3,
bool F(P1, P2, P3),
class I>
5326 struct MaybeWrapReturn<Func3<bool, P1, P2, P3, F, I>, void *> {
5327 typedef Func3<void *, P1, P2, P3, ReturnClosureOrBreak3<P1, P2, P3, F>, I>
5333 template <
class P1,
class P2,
5334 void F(P1, P2,
const char *,
size_t,
const BufferHandle *),
class I>
5335 struct MaybeWrapReturn<
5336 Func5<void, P1, P2, const char *,
size_t,
const BufferHandle *,
F, I>,
5338 typedef Func5<
size_t, P1, P2,
const char *,
size_t,
const BufferHandle *,
5339 ReturnStringLen<P1, P2, F>, I> Func;
5344 template <
class P1,
class P2,
5345 bool F(P1, P2,
const char *,
size_t,
const BufferHandle *),
class I>
5346 struct MaybeWrapReturn<
5347 Func5<bool, P1, P2, const char *,
size_t,
const BufferHandle *,
F, I>,
5349 typedef Func5<
size_t, P1, P2,
const char *,
size_t,
const BufferHandle *,
5350 ReturnNOr0<P1, P2, F>, I> Func;
5359 template <
class F,
class T>
5360 struct ConvertParams;
5363 template <
class R,
class P1, R F(P1)>
5364 R IgnoreHandlerData2(
void *p1,
const void *hd) {
5366 return F(static_cast<P1>(p1));
5369 template <
class R,
class P1,
class P2Wrapper,
class P2Wrapped,
5371 R IgnoreHandlerData3(
void *p1,
const void *hd, P2Wrapper p2) {
5373 return F(static_cast<P1>(p1), p2);
5376 template <
class R,
class P1,
class P2,
class P3, R F(P1, P2, P3)>
5377 R IgnoreHandlerData4(
void *p1,
const void *hd, P2 p2, P3 p3) {
5379 return F(static_cast<P1>(p1), p2, p3);
5382 template <
class R,
class P1,
class P2,
class P3,
class P4, R F(P1, P2, P3, P4)>
5383 R IgnoreHandlerData5(
void *p1,
const void *hd, P2 p2, P3 p3, P4 p4) {
5385 return F(static_cast<P1>(p1), p2, p3, p4);
5388 template <
class R,
class P1, R F(P1, const
char*,
size_t)>
5389 R IgnoreHandlerDataIgnoreHandle(
void *p1,
const void *hd,
const char *p2,
5390 size_t p3,
const BufferHandle *
handle) {
5393 return F(static_cast<P1>(p1), p2, p3);
5397 template <
class R,
class P1,
class P2, R F(P1, P2)>
5398 R CastHandlerData2(
void *c,
const void *hd) {
5399 return F(static_cast<P1>(c), static_cast<P2>(hd));
5402 template <
class R,
class P1,
class P2,
class P3Wrapper,
class P3Wrapped,
5403 R
F(P1, P2, P3Wrapped)>
5404 R CastHandlerData3(
void *c,
const void *hd, P3Wrapper p3) {
5405 return F(static_cast<P1>(c), static_cast<P2>(hd), p3);
5408 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
5409 R
F(P1, P2, P3, P4, P5)>
5410 R CastHandlerData5(
void *c,
const void *hd, P3 p3, P4 p4, P5 p5) {
5411 return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4, p5);
5414 template <
class R,
class P1,
class P2, R F(P1, P2, const
char *,
size_t)>
5415 R CastHandlerDataIgnoreHandle(
void *c,
const void *hd,
const char *p3,
5416 size_t p4,
const BufferHandle *handle) {
5418 return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4);
5422 template <
class R,
class P1, R F(P1),
class I,
class T>
5423 struct ConvertParams<Func1<R, P1, F, I>, T> {
5424 typedef Func2<R, void *, const void *, IgnoreHandlerData2<R, P1, F>, I> Func;
5427 template <
class R,
class P1,
class P2, R
F(P1, P2),
class I,
5428 class R2,
class P1_2,
class P2_2,
class P3_2>
5429 struct ConvertParams<Func2<R, P1, P2, F, I>,
5430 R2 (*)(P1_2, P2_2, P3_2)> {
5431 typedef Func3<
R,
void *,
const void *, P3_2,
5432 IgnoreHandlerData3<R, P1, P3_2, P2, F>, I> Func;
5437 template <
class R,
class P1, R F(P1, const
char *,
size_t),
class I,
class T>
5438 struct ConvertParams<Func3<R, P1, const char *,
size_t,
F, I>, T> {
5439 typedef Func5<
R,
void *,
const void *,
const char *,
size_t,
5440 const BufferHandle *, IgnoreHandlerDataIgnoreHandle<R, P1, F>,
5444 template <
class R,
class P1,
class P2,
class P3,
class P4, R
F(P1, P2, P3, P4),
5446 struct ConvertParams<Func4<R, P1, P2, P3, P4, F, I>, T> {
5447 typedef Func5<
R,
void *,
const void *, P2, P3, P4,
5448 IgnoreHandlerData5<R, P1, P2, P3, P4, F>, I> Func;
5452 template <
class R,
class P1,
class P2, R F(P1, P2),
class I,
class T>
5453 struct ConvertParams<BoundFunc2<R, P1, P2, F, I>, T> {
5454 typedef Func2<R, void *, const void *, CastHandlerData2<R, P1, P2, F>, I>
5458 template <
class R,
class P1,
class P2,
class P3, R
F(P1, P2, P3),
class I,
5459 class R2,
class P1_2,
class P2_2,
class P3_2>
5460 struct ConvertParams<BoundFunc3<R, P1, P2, P3, F, I>,
5461 R2 (*)(P1_2, P2_2, P3_2)> {
5462 typedef Func3<
R,
void *,
const void *, P3_2,
5463 CastHandlerData3<R, P1, P2, P3_2, P3, F>, I> Func;
5467 template <
class R,
class P1,
class P2, R
F(P1, P2,
const char *,
size_t),
5469 struct ConvertParams<BoundFunc4<R, P1, P2, const char *,
size_t,
F, I>, T> {
5470 typedef Func5<
R,
void *,
const void *,
const char *,
size_t,
5471 const BufferHandle *, CastHandlerDataIgnoreHandle<R, P1, P2, F>,
5475 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
5476 R
F(P1, P2, P3, P4, P5),
class I,
class T>
5477 struct ConvertParams<BoundFunc5<R, P1, P2, P3, P4, P5, F, I>, T> {
5478 typedef Func5<
R,
void *,
const void *, P3, P4, P5,
5479 CastHandlerData5<R, P1, P2, P3, P4, P5, F>, I> Func;
5484 #define TYPE_METHODS(utype, ltype, ctype, vtype) \ 5485 template <> struct CanonicalType<vtype> { \ 5486 typedef ctype Type; \ 5489 inline bool Handlers::SetValueHandler<vtype>( \ 5490 const FieldDef *f, \ 5491 const Handlers::utype ## Handler& handler) { \ 5492 assert(!handler.registered_); \ 5493 handler.AddCleanup(this); \ 5494 handler.registered_ = true; \ 5495 return upb_handlers_set##ltype(this, f, handler.handler_, &handler.attr_); \ 5498 TYPE_METHODS(
Double,
double,
double,
double)
5499 TYPE_METHODS(
Float,
float,
float,
float)
5504 TYPE_METHODS(
Bool,
bool,
bool,
bool)
5506 #ifdef UPB_TWO_32BIT_TYPES 5511 #ifdef UPB_TWO_64BIT_TYPES 5517 template <>
struct CanonicalType<Status*> {
5518 typedef Status*
Type;
5524 #define TYPE_METHODS(utype, ctype) \ 5525 inline bool Handlers::Set##utype##Handler(const FieldDef *f, \ 5526 const utype##Handler &h) { \ 5527 return SetValueHandler<ctype>(f, h); \ 5530 TYPE_METHODS(
Double,
double)
5531 TYPE_METHODS(
Float,
float)
5536 TYPE_METHODS(
Bool,
bool)
5539 template <
class F>
struct ReturnOf;
5541 template <
class R,
class P1,
class P2>
5542 struct ReturnOf<R (*)(P1, P2)> {
5546 template <
class R,
class P1,
class P2,
class P3>
5547 struct ReturnOf<R (*)(P1, P2, P3)> {
5551 template <
class R,
class P1,
class P2,
class P3,
class P4>
5552 struct ReturnOf<R (*)(P1, P2, P3, P4)> {
5556 template <
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
5557 struct ReturnOf<R (*)(P1, P2, P3, P4, P5)> {
5561 template<
class T>
const void *UniquePtrForType() {
5562 static const char ch = 0;
5568 inline Handler<T>::Handler(F func)
5569 : registered_(
false),
5570 cleanup_data_(func.GetData()),
5571 cleanup_func_(func.GetCleanup()) {
5573 typedef typename ReturnOf<T>::Return Return;
5574 typedef typename ConvertParams<F, T>::Func ConvertedParamsFunc;
5575 typedef typename MaybeWrapReturn<ConvertedParamsFunc, Return>::Func
5577 handler_ = ReturnWrappedFunc().Call;
5585 attr_.SetAlwaysOk(always_ok);
5588 attr_.SetClosureType(UniquePtrForType<typename F::FuncInfo::Closure>());
5596 typedef typename FirstUnlessVoidOrBool<
typename F::FuncInfo::Return,
5597 typename F::FuncInfo::Closure>
::value 5599 attr_.SetReturnClosureType(UniquePtrForType<EffectiveReturn>());
5603 inline Handler<T>::~Handler() {
5604 assert(registered_);
5609 inline bool HandlerAttributes::SetHandlerData(
const void *hd) {
5612 inline const void* HandlerAttributes::handler_data()
const {
5615 inline bool HandlerAttributes::SetClosureType(
const void *type) {
5618 inline const void* HandlerAttributes::closure_type()
const {
5621 inline bool HandlerAttributes::SetReturnClosureType(
const void *type) {
5624 inline const void* HandlerAttributes::return_closure_type()
const {
5627 inline bool HandlerAttributes::SetAlwaysOk(
bool always_ok) {
5630 inline bool HandlerAttributes::always_ok()
const {
5639 inline size_t BufferHandle::object_offset()
const {
5642 inline void BufferHandle::SetBuffer(
const char* buf,
size_t ofs) {
5646 void BufferHandle::SetAttachedObject(
const T* obj) {
5650 const T* BufferHandle::GetAttachedObject()
const {
5656 inline reffed_ptr<Handlers> Handlers::New(
const MessageDef *m) {
5658 return reffed_ptr<Handlers>(
h, &
h);
5660 inline reffed_ptr<const Handlers> Handlers::NewFrozen(
5662 const void *closure) {
5664 return reffed_ptr<const Handlers>(
h, &
h);
5666 inline const Status* Handlers::status() {
5669 inline void Handlers::ClearError() {
5672 inline bool Handlers::Freeze(Status *s) {
5673 upb::Handlers* h =
this;
5676 inline bool Handlers::Freeze(Handlers *
const *handlers,
int n, Status *s) {
5679 inline bool Handlers::Freeze(
const std::vector<Handlers*>& h, Status* status) {
5682 inline const MessageDef *Handlers::message_def()
const {
5688 inline bool Handlers::SetStartMessageHandler(
5689 const Handlers::StartMessageHandler &handler) {
5690 assert(!handler.registered_);
5691 handler.registered_ =
true;
5692 handler.AddCleanup(
this);
5695 inline bool Handlers::SetEndMessageHandler(
5696 const Handlers::EndMessageHandler &handler) {
5697 assert(!handler.registered_);
5698 handler.registered_ =
true;
5699 handler.AddCleanup(
this);
5702 inline bool Handlers::SetStartStringHandler(
const FieldDef *f,
5703 const StartStringHandler &handler) {
5704 assert(!handler.registered_);
5705 handler.registered_ =
true;
5706 handler.AddCleanup(
this);
5709 inline bool Handlers::SetEndStringHandler(
const FieldDef *f,
5710 const EndFieldHandler &handler) {
5711 assert(!handler.registered_);
5712 handler.registered_ =
true;
5713 handler.AddCleanup(
this);
5716 inline bool Handlers::SetStringHandler(
const FieldDef *f,
5717 const StringHandler& handler) {
5718 assert(!handler.registered_);
5719 handler.registered_ =
true;
5720 handler.AddCleanup(
this);
5723 inline bool Handlers::SetStartSequenceHandler(
5724 const FieldDef *f,
const StartFieldHandler &handler) {
5725 assert(!handler.registered_);
5726 handler.registered_ =
true;
5727 handler.AddCleanup(
this);
5730 inline bool Handlers::SetStartSubMessageHandler(
5731 const FieldDef *f,
const StartFieldHandler &handler) {
5732 assert(!handler.registered_);
5733 handler.registered_ =
true;
5734 handler.AddCleanup(
this);
5737 inline bool Handlers::SetEndSubMessageHandler(
const FieldDef *f,
5738 const EndFieldHandler &handler) {
5739 assert(!handler.registered_);
5740 handler.registered_ =
true;
5741 handler.AddCleanup(
this);
5744 inline bool Handlers::SetEndSequenceHandler(
const FieldDef *f,
5745 const EndFieldHandler &handler) {
5746 assert(!handler.registered_);
5747 handler.registered_ =
true;
5748 handler.AddCleanup(
this);
5751 inline bool Handlers::SetSubHandlers(
const FieldDef *f,
const Handlers *sub) {
5754 inline const Handlers *Handlers::GetSubHandlers(
const FieldDef *f)
const {
5757 inline const Handlers *Handlers::GetSubHandlers(Handlers::Selector sel)
const {
5760 inline bool Handlers::GetSelector(
const FieldDef *f,
Handlers::Type type,
5761 Handlers::Selector *s) {
5764 inline Handlers::Selector Handlers::GetEndSelector(Handlers::Selector
start) {
5767 inline Handlers::GenericFunction *Handlers::GetHandler(
5768 Handlers::Selector selector) {
5771 inline const void *Handlers::GetHandlerData(Handlers::Selector selector) {
5775 inline BytesHandler::BytesHandler() {
5779 inline BytesHandler::~BytesHandler() {}
5786 #undef UPB_TWO_32BIT_TYPES 5787 #undef UPB_TWO_64BIT_TYPES 5790 #undef UPB_INT32ALT_T 5791 #undef UPB_UINT32ALT_T 5794 #undef UPB_INT64ALT_T 5795 #undef UPB_UINT64ALT_T 5880 template <
class T> Sink(
const Handlers* handlers,
T* closure);
5883 template <
class T>
void Reset(
const Handlers* handlers,
T* closure);
5889 template <
class T>
T* GetObject()
const;
5907 bool StartMessage();
5908 bool EndMessage(Status* status);
5913 bool PutInt32(Handlers::Selector s,
int32_t val);
5914 bool PutInt64(Handlers::Selector s,
int64_t val);
5915 bool PutUInt32(Handlers::Selector s,
uint32_t val);
5916 bool PutUInt64(Handlers::Selector s,
uint64_t val);
5917 bool PutFloat(Handlers::Selector s,
float val);
5918 bool PutDouble(Handlers::Selector s,
double val);
5919 bool PutBool(Handlers::Selector s,
bool val);
5926 bool StartString(Handlers::Selector s,
size_t size_hint, Sink* sub);
5927 size_t PutStringBuffer(Handlers::Selector s,
const char *buf,
size_t len,
5928 const BufferHandle *
handle);
5929 bool EndString(Handlers::Selector s);
5936 bool StartSubMessage(Handlers::Selector s, Sink* sub);
5937 bool EndSubMessage(Handlers::Selector s);
5945 bool StartSequence(Handlers::Selector s, Sink* sub);
5946 bool EndSequence(Handlers::Selector s);
5955 const upb_handlers *handlers;
5960 class upb::BytesSink {
5968 template <
class T> BytesSink(
const BytesHandler* handler,
T* closure);
5971 template <
class T>
void Reset(
const BytesHandler* handler,
T* closure);
5973 bool Start(
size_t size_hint,
void **subc);
5974 size_t PutBuffer(
void *subc,
const char *buf,
size_t len,
5975 const BufferHandle *handle);
5990 class upb::BufferSource {
5993 BufferSource(
const char* buf,
size_t len, BytesSink*
sink);
6002 static bool PutBuffer(
const char* buf,
size_t len, BytesSink* sink);
6004 template <
class T>
static bool PutBuffer(
const T& str, BytesSink* sink) {
6005 return PutBuffer(str.c_str(), str.size(),
sink);
6031 if (!start)
return true;
6035 return *subc !=
NULL;
6039 const char *buf,
size_t size,
6046 if (!putbuf)
return true;
6058 if (!end)
return true;
6072 if (ret && len != 0) {
6082 #define PUTVAL(type, ctype) \ 6083 UPB_INLINE bool upb_sink_put##type(upb_sink *s, upb_selector_t sel, \ 6085 typedef upb_##type##_handlerfunc functype; \ 6088 if (!s->handlers) return true; \ 6089 func = (functype *)upb_handlers_gethandler(s->handlers, sel); \ 6090 if (!func) return true; \ 6091 hd = upb_handlers_gethandlerdata(s->handlers, sel); \ 6092 return func(s->closure, hd, val); \ 6110 const char *buf,
size_t n,
6118 if (!handler)
return n;
6120 return handler(s->
closure, hd, buf, n, handle);
6124 typedef upb_startmsg_handlerfunc
func;
6130 if (!startmsg)
return true;
6132 return startmsg(s->
closure, hd);
6142 if (!endmsg)
return true;
6144 return endmsg(s->
closure, hd, status);
6157 if (!startseq)
return true;
6170 if (!endseq)
return true;
6172 return endseq(s->
closure, hd);
6185 if (!startstr)
return true;
6198 if (!endstr)
return true;
6200 return endstr(s->
closure, hd);
6216 if (!startsubmsg)
return true;
6229 if (!endsubmsg)
return s->
closure;
6231 return endsubmsg(s->
closure, hd);
6240 template <
class T> Sink::Sink(
const Handlers* handlers,
T* closure) {
6244 inline void Sink::Reset(
const Handlers* handlers,
T* closure) {
6247 inline bool Sink::StartMessage() {
6250 inline bool Sink::EndMessage(Status* status) {
6253 inline bool Sink::PutInt32(Handlers::Selector sel,
int32_t val) {
6254 return upb_sink_putint32(
this, sel, val);
6256 inline bool Sink::PutInt64(Handlers::Selector sel,
int64_t val) {
6257 return upb_sink_putint64(
this, sel, val);
6259 inline bool Sink::PutUInt32(Handlers::Selector sel,
uint32_t val) {
6260 return upb_sink_putuint32(
this, sel, val);
6262 inline bool Sink::PutUInt64(Handlers::Selector sel,
uint64_t val) {
6263 return upb_sink_putuint64(
this, sel, val);
6265 inline bool Sink::PutFloat(Handlers::Selector sel,
float val) {
6266 return upb_sink_putfloat(
this, sel, val);
6268 inline bool Sink::PutDouble(Handlers::Selector sel,
double val) {
6269 return upb_sink_putdouble(
this, sel, val);
6271 inline bool Sink::PutBool(Handlers::Selector sel,
bool val) {
6272 return upb_sink_putbool(
this, sel, val);
6274 inline bool Sink::StartString(Handlers::Selector sel,
size_t size_hint,
6278 inline size_t Sink::PutStringBuffer(Handlers::Selector sel,
const char *buf,
6279 size_t len,
const BufferHandle* handle) {
6282 inline bool Sink::EndString(Handlers::Selector sel) {
6285 inline bool Sink::StartSubMessage(Handlers::Selector sel, Sink* sub) {
6288 inline bool Sink::EndSubMessage(Handlers::Selector sel) {
6291 inline bool Sink::StartSequence(Handlers::Selector sel, Sink* sub) {
6294 inline bool Sink::EndSequence(Handlers::Selector sel) {
6299 BytesSink::BytesSink(
const BytesHandler* handler,
T* closure) {
6300 Reset(handler, closure);
6310 inline size_t BytesSink::PutBuffer(
void *subc,
const char *buf,
size_t len,
6311 const BufferHandle *handle) {
6318 inline bool BufferSource::PutBuffer(
const char *buf,
size_t len,
6358 static bool Set(Handlers *h,
const FieldDef *f,
size_t ofs,
int32_t hasbit);
6362 static const Data* GetData(
const Handlers* h, Handlers::Selector s,
6383 inline bool Shim::Set(Handlers* h,
const FieldDef* f,
size_t ofs,
6387 inline const Shim::Data* Shim::GetData(
const Handlers* h, Handlers::Selector s,
6407 #ifndef UPB_SYMTAB_H_ 6408 #define UPB_SYMTAB_H_ 6413 namespace upb {
class SymbolTable; }
6428 class upb::SymbolTable {
6432 static reffed_ptr<SymbolTable> New();
6461 const Def* Resolve(
const char*
base,
const char* sym)
const;
6465 const Def* Lookup(
const char *sym)
const;
6466 const MessageDef* LookupMessage(
const char *sym)
const;
6467 const EnumDef* LookupEnum(
const char *sym)
const;
6504 bool Add(Def*
const* defs,
size_t n,
void* ref_donor, Status* status);
6506 bool Add(
const std::vector<Def*>& defs,
void *owner, Status* status) {
6507 return Add((Def*
const*)&defs[0], defs.size(), owner, status);
6513 bool AddFile(FileDef*
file, Status* s);
6560 inline reffed_ptr<SymbolTable> SymbolTable::New() {
6562 return reffed_ptr<SymbolTable>(
s, &
s);
6565 inline void SymbolTable::Freeze() {
6568 inline const Def *SymbolTable::Resolve(
const char *base,
6569 const char *sym)
const {
6572 inline const Def* SymbolTable::Lookup(
const char *sym)
const {
6575 inline const MessageDef *SymbolTable::LookupMessage(
const char *sym)
const {
6579 Def*
const* defs,
size_t n,
void* ref_donor, Status* status) {
6582 inline bool SymbolTable::AddFile(FileDef* file, Status* s) {
6595 #ifndef UPB_DESCRIPTOR_H 6596 #define UPB_DESCRIPTOR_H 6629 size_t file_count()
const;
6630 FileDef*
file(
size_t i)
const;
6633 static Handlers* NewHandlers(
const void* owner);
6660 inline size_t Reader::file_count()
const {
6685 #ifndef UPB_DESCRIPTOR_DESCRIPTOR_PROTO_UPB_H_ 6686 #define UPB_DESCRIPTOR_DESCRIPTOR_PROTO_UPB_H_ 6774 return strcmp(
upb_msgdef_fullname(m),
"google.protobuf.DescriptorProto.ExtensionRange") == 0;
6777 return strcmp(
upb_msgdef_fullname(m),
"google.protobuf.DescriptorProto.ReservedRange") == 0;
6834 return strcmp(
upb_msgdef_fullname(m),
"google.protobuf.UninterpretedOption.NamePart") == 0;
6970 class DescriptorProto :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
6973 : reffed_ptr(m, ref_donor) {
6982 class ExtensionRange :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
6984 ExtensionRange(const ::upb::MessageDef* m,
const void *ref_donor =
NULL)
6985 : reffed_ptr(m, ref_donor) {
6989 static ExtensionRange
get() {
6991 return ExtensionRange(m, &m);
6995 class ReservedRange :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
6997 ReservedRange(const ::upb::MessageDef* m,
const void *ref_donor =
NULL)
6998 : reffed_ptr(m, ref_donor) {
7002 static ReservedRange
get() {
7004 return ReservedRange(m, &m);
7012 : reffed_ptr(m, ref_donor) {
7022 class EnumOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7025 : reffed_ptr(m, ref_donor) {
7038 : reffed_ptr(m, ref_donor) {
7048 class EnumValueOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7051 : reffed_ptr(m, ref_donor) {
7064 : reffed_ptr(m, ref_donor) {
7073 class Label :
public ::upb::reffed_ptr<const ::upb::EnumDef> {
7075 Label(const ::upb::EnumDef* e,
const void *ref_donor =
NULL)
7076 : reffed_ptr(e, ref_donor) {
7079 static Label
get() {
7081 return Label(e, &e);
7085 class Type :
public ::upb::reffed_ptr<const ::upb::EnumDef> {
7087 Type(const ::upb::EnumDef* e,
const void *ref_donor =
NULL)
7088 : reffed_ptr(e, ref_donor) {
7098 class FieldOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7101 : reffed_ptr(m, ref_donor) {
7110 class CType :
public ::upb::reffed_ptr<const ::upb::EnumDef> {
7112 CType(const ::upb::EnumDef* e,
const void *ref_donor =
NULL)
7113 : reffed_ptr(e, ref_donor) {
7116 static CType
get() {
7118 return CType(e, &e);
7122 class JSType :
public ::upb::reffed_ptr<const ::upb::EnumDef> {
7124 JSType(const ::upb::EnumDef* e,
const void *ref_donor =
NULL)
7125 : reffed_ptr(e, ref_donor) {
7138 : reffed_ptr(m, ref_donor) {
7151 : reffed_ptr(m, ref_donor) {
7161 class FileOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7164 : reffed_ptr(m, ref_donor) {
7173 class OptimizeMode :
public ::upb::reffed_ptr<const ::upb::EnumDef> {
7175 OptimizeMode(const ::upb::EnumDef* e,
const void *ref_donor =
NULL)
7176 : reffed_ptr(e, ref_donor) {
7179 static OptimizeMode
get() {
7181 return OptimizeMode(e, &e);
7186 class MessageOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7189 : reffed_ptr(m, ref_donor) {
7202 : reffed_ptr(m, ref_donor) {
7212 class MethodOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7215 : reffed_ptr(m, ref_donor) {
7228 : reffed_ptr(m, ref_donor) {
7241 : reffed_ptr(m, ref_donor) {
7251 class ServiceOptions :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7254 : reffed_ptr(m, ref_donor) {
7264 class SourceCodeInfo :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7267 : reffed_ptr(m, ref_donor) {
7276 class Location :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7278 Location(const ::upb::MessageDef* m,
const void *ref_donor =
NULL)
7279 : reffed_ptr(m, ref_donor) {
7293 : reffed_ptr(m, ref_donor) {
7302 class NamePart :
public ::upb::reffed_ptr<const ::upb::MessageDef> {
7304 NamePart(const ::upb::MessageDef* m,
const void *ref_donor =
NULL)
7305 : reffed_ptr(m, ref_donor) {
7309 static NamePart
get() {
7311 return NamePart(m, &m);
7327 #ifndef UPB_DECODER_INT_H_ 7328 #define UPB_DECODER_INT_H_ 7344 #ifndef UPB_DECODER_H_ 7345 #define UPB_DECODER_H_ 7353 class DecoderMethod;
7354 class DecoderMethodOptions;
7371 #define UPB_DECODER_MAX_RESIDUAL_BYTES 14 7378 class upb::pb::DecoderMethodOptions {
7382 explicit DecoderMethodOptions(
const Handlers* dest_handlers);
7387 void set_lazy(
bool lazy);
7389 struct upb_pbdecodermethodopts {
7391 const upb_handlers *handlers;
7399 class upb::pb::DecoderMethod {
7407 const Handlers* dest_handlers()
const;
7410 const BytesHandler* input_handler()
const;
7413 bool is_native()
const;
7417 static reffed_ptr<const DecoderMethod> New(
const DecoderMethodOptions& opts);
7429 #define UPB_PB_DECODER_SIZE 4416 7435 class upb::pb::Decoder {
7446 const DecoderMethod* method()
const;
7467 size_t max_nesting()
const;
7468 bool set_max_nesting(
size_t max);
7488 class upb::pb::CodeCache {
7500 bool allow_jit()
const;
7504 bool set_allow_jit(
bool allow);
7514 const DecoderMethod *GetDecoderMethod(
const DecoderMethodOptions& opts);
7533 const upb_pbdecodermethod *
method,
7543 const upb_handlers *h);
7551 const upb_pbdecodermethod *m);
7553 const upb_pbdecodermethod *m);
7556 const upb_pbdecodermethodopts *opts,
const void *owner);
7578 inline const DecoderMethod* Decoder::method()
const {
7584 inline uint64_t Decoder::BytesParsed()
const {
7587 inline size_t Decoder::max_nesting()
const {
7590 inline bool Decoder::set_max_nesting(
size_t max) {
7595 inline DecoderMethodOptions::DecoderMethodOptions(
const Handlers* h) {
7598 inline void DecoderMethodOptions::set_lazy(
bool lazy) {
7602 inline const Handlers* DecoderMethod::dest_handlers()
const {
7605 inline const BytesHandler* DecoderMethod::input_handler()
const {
7608 inline bool DecoderMethod::is_native()
const {
7612 inline reffed_ptr<const DecoderMethod> DecoderMethod::New(
7613 const DecoderMethodOptions &opts) {
7615 return reffed_ptr<const DecoderMethod>(
m, &
m);
7618 inline CodeCache::CodeCache() {
7621 inline CodeCache::~CodeCache() {
7624 inline bool CodeCache::allow_jit()
const {
7627 inline bool CodeCache::set_allow_jit(
bool allow) {
7630 inline const DecoderMethod *CodeCache::GetDecoderMethod(
7631 const DecoderMethodOptions& opts) {
7667 #define T(type) OP_PARSE_ ## type = UPB_DESCRIPTOR_TYPE_ ## type 7668 T(
DOUBLE),
T(FLOAT),
T(INT64),
T(UINT64),
T(INT32),
T(FIXED64),
T(FIXED32),
7669 T(
BOOL),
T(UINT32),
T(SFIXED32),
T(SFIXED64),
T(SINT32),
T(SINT64),
7675 OP_STARTSUBMSG = 14,
7681 OP_PUSHTAGDELIM = 23,
7682 OP_PUSHLENDELIM = 24,
7685 OP_SETBIGGROUPNUM = 27,
7701 OP_SETDISPATCH = 35,
7710 #define OP_MAX OP_HALT 7742 #ifdef UPB_USE_JIT_X64 7760 #define UPB_DECODER_MAX_NESTING 64 7789 struct upb_pbdecodermethod {
7815 const upb_handlers *dest_handlers_;
7830 const upb_pbdecodermethod *method_;
7836 const char *
buf, *ptr, *
end, *checkpoint;
7839 const char *delim_end;
7842 const char *data_end;
7858 const char *buf_param;
7869 #ifdef UPB_USE_JIT_X64 7874 const void *saved_rsp;
7911 #define LABEL_DISPATCH 0 7915 #define DISPATCH_ENDMSG 0 7919 #define NO_WIRE_TYPE 0xff 7936 return (ofs << 16) | (wt2 << 8) | wt1;
7942 *wt2 = (
uint8_t)(dispatch >> 8);
7943 *ofs = dispatch >> 16;
7953 #define DECODE_OK -1 7954 #define DECODE_MISMATCH -2 7955 #define DECODE_ENDGROUP -3 7957 #define CHECK_RETURN(x) { int32_t ret = x; if (ret >= 0) return ret; } 7965 #ifndef UPB_VARINT_DECODER_H_ 7966 #define UPB_VARINT_DECODER_H_ 7986 #define UPB_MAX_WIRE_TYPE 5 7991 #define UPB_PB_VARINT_MAX_LEN 10 8000 return (n >> 1) ^ -(
int32_t)(n & 1);
8003 return (n >> 1) ^ -(
int64_t)(n & 1);
8038 #define UPB_VARINT_DECODER_CHECK2(name, decode_max8_function) \ 8039 UPB_INLINE upb_decoderet upb_vdecode_check2_ ## name(const char *_p) { \ 8040 uint8_t *p = (uint8_t*)_p; \ 8042 if ((*p & 0x80) == 0) { \ 8044 return upb_decoderet_make(_p + 1, *p & 0x7fU); \ 8046 r = upb_decoderet_make(_p + 2, (*p & 0x7fU) | ((*(p + 1) & 0x7fU) << 7)); \ 8047 if ((*(p + 1) & 0x80) == 0) { \ 8052 return decode_max8_function(r); \ 8059 #undef UPB_VARINT_DECODER_CHECK2 8064 if (
sizeof(
long) == 8)
8065 return upb_vdecode_check2_branch64(p);
8067 return upb_vdecode_check2_branch32(p);
8079 int high_bit = 63 - __builtin_clzll(val);
8083 while(tmp >>= 1) high_bit++;
8085 return val == 0 ? 1 : high_bit / 8 + 1;
8094 if (val == 0) { buf[0] = 0;
return 1; }
8099 if (val) byte |= 0x80
U;
8116 memcpy(&ret, buf, bytes);
8117 assert(ret <= 0xffffffffffU);
8137 #ifndef UPB_ENCODER_H_ 8138 #define UPB_ENCODER_H_ 8151 #define UPB_PBENCODER_MAX_NESTING 100 8159 #define UPB_PB_ENCODER_SIZE 768 8163 class upb::pb::Encoder {
8167 static Encoder*
Create(Environment*
env,
const Handlers* handlers,
8174 static reffed_ptr<const Handlers> NewHandlers(
const MessageDef* msg);
8199 BytesSink* output) {
8205 inline reffed_ptr<const Handlers> Encoder::NewHandlers(
8206 const upb::MessageDef *md) {
8208 return reffed_ptr<const Handlers>(
h, &
h);
8239 #include <stdbool.h> 8258 inline bool LoadDescriptor(
const char* buf,
size_t n, Status* status,
8259 std::vector<reffed_ptr<FileDef> >*
files) {
8263 FileDef** p = parsed_files;
8265 files->push_back(reffed_ptr<FileDef>(*p, &parsed_files));
8276 template <
typename T>
8277 bool LoadDescriptor(
const T&
desc, Status* status,
8278 std::vector<reffed_ptr<FileDef> >*
files) {
8279 return LoadDescriptor(desc.c_str(), desc.size(), status,
files);
8309 class upb::pb::TextPrinter {
8313 static TextPrinter *
Create(Environment *
env,
const upb::Handlers *handlers,
8316 void SetSingleLineMode(
bool single_line);
8322 static reffed_ptr<const Handlers> NewHandlers(
const MessageDef* md);
8345 const upb::Handlers *handlers,
8346 BytesSink *output) {
8349 inline void TextPrinter::SetSingleLineMode(
bool single_line) {
8355 inline reffed_ptr<const Handlers> TextPrinter::NewHandlers(
8356 const MessageDef *md) {
8358 return reffed_ptr<const Handlers>(
h, &
h);
8373 #ifndef UPB_JSON_PARSER_H_ 8374 #define UPB_JSON_PARSER_H_ 8396 #define UPB_JSON_PARSER_SIZE 4112 8402 class upb::json::Parser {
8404 static Parser*
Create(Environment* env,
const ParserMethod* method,
8413 class upb::json::ParserMethod {
8419 static reffed_ptr<const ParserMethod> New(
const upb::MessageDef* md);
8424 const Handlers* dest_handlers()
const;
8427 const BytesHandler* input_handler()
const;
8466 inline const Handlers* ParserMethod::dest_handlers()
const {
8469 inline const BytesHandler* ParserMethod::input_handler()
const {
8473 inline reffed_ptr<const ParserMethod> ParserMethod::New(
8474 const MessageDef* md) {
8476 return reffed_ptr<const ParserMethod>(
m, &
m);
8492 #ifndef UPB_JSON_TYPED_PRINTER_H_ 8493 #define UPB_JSON_TYPED_PRINTER_H_ 8509 #define UPB_JSON_PRINTER_SIZE 176 8514 class upb::json::Printer {
8516 static Printer*
Create(Environment*
env,
const upb::Handlers* handlers,
8526 static reffed_ptr<const Handlers> NewHandlers(
const upb::MessageDef* md,
8527 bool preserve_proto_fieldnames);
8544 bool preserve_fieldnames,
8554 BytesSink* output) {
8558 inline reffed_ptr<const Handlers> Printer::NewHandlers(
8559 const upb::MessageDef *md,
bool preserve_proto_fieldnames) {
8561 md, preserve_proto_fieldnames, &h);
8562 return reffed_ptr<const Handlers>(
h, &
h);
std::integral_constant< std::int32_t, V > int32_t
Definition: Brigand.h:439
const char * upb_filedef_name(const upb_filedef *f)
Definition: upb.c:1989
UPB_BEGIN_EXTERN_C upb_enumdef * upb_enumdef_new(const void *owner)
Definition: upb.c:395
upb_ctype_t ctype
Definition: upb.h:599
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_OneofDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6940
GLboolean GLuint group
Definition: gl2ext.h:780
const upb_msgdef * upbdefs_google_protobuf_EnumValueDescriptorProto_get(const void *owner)
Definition: upb.c:6369
#define UPB_INLINE
Definition: upb.h:101
bool upb_fielddef_isextension(const upb_fielddef *f)
Definition: upb.c:703
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_NamePart_f_name_part(const upb_msgdef *m)
Definition: upb.h:6953
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_f_location(const upb_msgdef *m)
Definition: upb.h:6951
UPB_INLINE int32_t upb_zzdec_32(uint32_t n)
Definition: upb.h:7699
const FieldDescriptor containing_oneof
Definition: descriptor.h:1688
bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f, upb_startstr_handlerfunc *func, upb_handlerattr *attr)
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val, upb_ctype_t ctype)
Definition: upb.h:615
void upb_func()
Definition: upb.h:253
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_aggregate_value(const upb_msgdef *m)
Definition: upb.h:6954
upb_fieldtype_t
Definition: upb.h:1435
GLint GLsizei count
Definition: gl2.h:421
const upb_msgdef * upbdefs_google_protobuf_FileDescriptorSet_get(const void *owner)
Definition: upb.c:6374
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6875
UPB_INLINE bool upbdefs_google_protobuf_DescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6770
UPB_INLINE const void * upb_handlerattr_handlerdata(const upb_handlerattr *attr)
Definition: upb.h:3830
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_f_message_set_wire_format(const upb_msgdef *m)
Definition: upb.h:6929
UPB_INLINE const upb_fielddef * upb_msgdef_ntofz(const upb_msgdef *m, const char *name)
Definition: upb.h:2090
const upb_shim_data * upb_shim_getdata(const upb_handlers *h, upb_selector_t s, upb_fieldtype_t *type)
Definition: upb.c:3558
size_t upb_arena_bytesallocated(const upb_arena *a)
Definition: upb.c:5398
UPB_INLINE bool upbdefs_google_protobuf_FieldOptions_is(const upb_msgdef *m)
Definition: upb.h:6794
void Reset()
Definition: metrics_default.cc:285
int upb_status_errcode(const upb_status *status)
Definition: upb.c:4938
#define UPB_ENDMSG_SELECTOR
Definition: upb.h:3964
void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t)
Definition: upb.c:4665
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_javanano_use_deprecated_package(const upb_msgdef *m)
Definition: upb.h:6922
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_NamePart_f_is_extension(const upb_msgdef *m)
Definition: upb.h:6952
bool upb_double_handlerfunc(void *c, const void *hd, double val)
Definition: upb.h:3807
google_protobuf_FieldDescriptorProto_Label
Definition: upb.h:6248
bool upb_msgdef_addoneof(upb_msgdef *m, upb_oneofdef *o, const void *ref_donor, upb_status *s)
Definition: upb.c:1393
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val)
Definition: upb.c:4544
const char * name
Definition: upb.h:3850
Pointer
Definition: SpecialPointer.h:34
#define UPB_DECLARE_DERIVED_TYPE(cppname, cppbase, cname, cbase)
Definition: upb.h:251
UPB_INLINE bool upbdefs_google_protobuf_OneofDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6815
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_enum_type(const upb_msgdef *m)
Definition: upb.h:6899
upb_symtab_iter
Definition: upb.h:5988
upb_alloc upb_alloc_global
Definition: upb.c:5247
bool upb_int32_handlerfunc(void *c, const void *hd, int32_t val)
Definition: upb.h:3802
int stack[stackrange+1]
Definition: float-mm.c:95
EGLStreamKHR EGLint EGLint EGLint size
Definition: eglext.h:984
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_weak(const upb_msgdef *m)
Definition: upb.h:6897
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6892
unsigned long long uint64_t
Definition: ptypes.h:120
int32_t upb_selector_t
Definition: upb.h:3242
UPB_INLINE bool upbdefs_google_protobuf_ServiceOptions_is(const upb_msgdef *m)
Definition: upb.h:6821
UPB_INLINE upb_decoderet upb_vdecode_fast(const char *p)
Definition: upb.h:7763
void upb_fielddef_setdefaultuint32(upb_fielddef *f, uint32_t val)
Definition: upb.c:1074
const upb_msgdef * upbdefs_google_protobuf_ServiceDescriptorProto_get(const void *owner)
Definition: upb.c:6380
void upb_status_seterrmsg(upb_status *status, const char *msg)
Definition: upb.c:4942
void upb_fielddef_settagdelim(upb_fielddef *f, bool tag_delim)
Definition: upb.c:1035
void upb_arena_setnextblocksize(upb_arena *a, size_t size)
UPB_INLINE const upb_oneofdef * upb_msgdef_ntooz(const upb_msgdef *m, const char *name)
Definition: upb.h:2111
upb_syntax_t upb_filedef_syntax(const upb_filedef *f)
Definition: upb.c:1997
#define UPB_STATUS_MAX_MESSAGE
Definition: upb.h:382
const upb_handlers * upb_textprinter_newhandlers(const upb_msgdef *m, const void *owner)
Definition: upb.c:9482
upb_error_func * error_func_
Definition: upb.h:733
GLsizei GLuint * groups
Definition: gl2ext.h:773
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_oneof_index(const upb_msgdef *m)
Definition: upb.h:6887
const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption_NamePart_get(const void *owner)
Definition: upb.c:6385
#define UPB_REFCOUNTED_CMETHODS(type, upcastfunc)
Definition: upb.h:1427
required HashAlgorithmIdentifier hash
Definition: WebCryptoAPI.idl:276
void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e)
Definition: upb.c:486
void upb_pbdecodermethodopts_init(upb_pbdecodermethodopts *opts, const upb_handlers *h)
Definition: upb.c:7446
UPB_BEGIN_EXTERN_C typedef bool upb_startmsg_handlerfunc(void *c, const void *)
Definition: gtest_unittest.cc:4771
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m)
Definition: upb.c:1474
void * upb_startfield_handlerfunc(void *c, const void *hd)
Definition: upb.h:3800
Iterator
Definition: six.py:544
#define UPB_DECODER_MAX_RESIDUAL_BYTES
upb_bytessink * upb_pbdecoder_input(upb_pbdecoder *d)
Definition: upb.c:8463
const upb_enumdef * upb_fielddef_enumsubdef(const upb_fielddef *f)
Definition: upb.c:866
size_t max_block_size
Definition: upb.h:635
std::vector< TraceArg > args
Definition: event_tracer.cc:256
DOMString p
Definition: WebCryptoAPI.idl:116
const FieldDescriptor * field
Definition: parser_unittest.cc:2279
bool upb_filedef_setname(upb_filedef *f, const char *name, upb_status *s)
Definition: upb.c:2029
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_f_no_standard_descriptor_accessor(const upb_msgdef *m)
Definition: upb.h:6930
bool upb_fielddef_setenumsubdef(upb_fielddef *f, const upb_enumdef *subdef, upb_status *s)
Definition: upb.c:1173
google_protobuf_FieldDescriptorProto_Type
Definition: upb.h:6254
UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key, upb_value *v)
Definition: upb.h:897
UPB_END_EXTERN_C UPB_BEGIN_EXTERN_C upb_filedef * upb_filedef_new(const void *owner)
Definition: upb.c:1954
int32_t upb_fielddef_defaultint32(const upb_fielddef *f)
Definition: upb.c:773
void upb_strtable_uninit2(upb_strtable *table, upb_alloc *a)
Definition: upb.c:4538
bool upb_filedef_setsyntax(upb_filedef *f, upb_syntax_t syntax, upb_status *s)
Definition: upb.c:2053
upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f)
Definition: upb.c:969
bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max)
Definition: upb.c:8471
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gl2.h:403
UPB_INLINE bool upbdefs_google_protobuf_MethodDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6809
const void * upb_handlerattr_returnclosuretype(const upb_handlerattr *attr)
Definition: upb.c:2603
const upb_pbdecodermethod * upb_pbdecoder_method(const upb_pbdecoder *d)
Definition: upb.c:8459
UPB_INLINE void upb_gfree(void *ptr)
Definition: upb.h:535
FieldDescriptorProto * AddExtension(FileDescriptorProto *file, const string &extendee, const string &name, int number, FieldDescriptorProto::Label label, FieldDescriptorProto::Type type)
Definition: descriptor_unittest.cc:113
int c
Definition: cpp_unittests.cpp:275
void upb_arena_init2(upb_arena *a, void *mem, size_t n, upb_alloc *alloc)
Definition: upb.c:5350
int64_t upb_fielddef_defaultint64(const upb_fielddef *f)
Definition: upb.c:768
PyObject * FindOneofByName(PyDescriptorPool *self, PyObject *arg)
Definition: descriptor_pool.cc:291
UPB_INLINE int64_t upb_zzdec_64(uint64_t n)
Definition: upb.h:7702
bool upb_strtable_remove2(upb_strtable *t, const char *key, size_t len, upb_value *val)
Definition: upb.c:4350
bool upb_msgdef_addfield(upb_msgdef *m, upb_fielddef *f, const void *ref_donor, upb_status *s)
Definition: upb.c:1360
DescriptorProto
Definition: descriptor_pb2.py:1637
const upb_json_parsermethod upb_sink * output
Definition: upb.h:8438
UPB_BEGIN_EXTERN_C upb_msgdef * upb_msgdef_new(const void *owner)
Definition: upb.c:1261
GLuint GLuint end
Definition: gl2ext.h:323
upb_deftype_t
Definition: upb.h:1285
void upb_pbdecoder_freejit(mgroup *group)
signed int int32_t
Definition: ptypes.h:101
UPB_INLINE bool upbdefs_google_protobuf_DescriptorProto_ReservedRange_is(const upb_msgdef *m)
Definition: upb.h:6776
upb_decoderet upb_vdecode_max8_branch64(upb_decoderet r)
Definition: upb.c:9545
FileOptions
Definition: descriptor_pb2.py:1702
uint32_t upb_fielddef_index(const upb_fielddef *f)
Definition: upb.c:683
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_f_leading_detached_comments(const upb_msgdef *m)
Definition: upb.h:6947
bool upb_refcounted_init(upb_refcounted *r, const struct upb_refcounted_vtbl *vtbl, const void *owner)
Definition: upb.c:3408
long seed
Definition: float-mm.c:84
Definition: type_traits_unittest.cc:146
rtc::CallSessionFileRotatingLogSink * sink
Definition: peerconnection_jni.cc:2350
bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, upb_handlerattr *attr)
bool upb_int64_handlerfunc(void *c, const void *hd, int64_t val)
Definition: upb.h:3803
unsigned int uint32_t
Definition: ptypes.h:105
void upb_fielddef_setpacked(upb_fielddef *f, bool packed)
Definition: upb.c:1018
size_t upb_strtable_iter_keylength(upb_strtable_iter *i)
Definition: upb.c:4387
void upb_msg_field_next(upb_msg_field_iter *iter)
Definition: upb.c:1478
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_generate_equals_and_hash(const upb_msgdef *m)
Definition: upb.h:6916
upb_oneofdef * upb_oneofdef_dup(const upb_oneofdef *o, const void *owner)
Definition: upb.c:1552
const upb_enumdef * upbdefs_google_protobuf_FieldOptions_JSType_get(const void *owner)
Definition: upb.c:6390
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_extension_range(const upb_msgdef *m)
Definition: upb.h:6862
bool upb_pbcodecache_allowjit(const upb_pbcodecache *c)
Definition: upb.c:7417
uint32_t upb_fielddef_number(const upb_fielddef *f)
Definition: upb.c:699
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_get(const void *owner)
Definition: upb.c:6365
void upb_symtab_freeze(upb_symtab *s)
Definition: upb.c:3608
bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *hfree)
Definition: upb.c:2378
const char * upb_strtable_iter_key(upb_strtable_iter *i)
Definition: upb.c:4382
upb_sink * upb_json_printer_input(upb_json_printer *p)
Definition: upb.c:11983
upb_sink * upb_descreader_input(upb_descreader *r)
Definition: upb.c:6463
int32_t upb_enum_iter_number(upb_enum_iter *iter)
Definition: upb.c:514
upb_errorspace upb_errnoerr
Definition: udis86_types.h:171
void upb_fielddef_setdescriptortype(upb_fielddef *f, int type)
Definition: upb.c:908
upb_label_t upb_fielddef_label(const upb_fielddef *f)
Definition: upb.c:687
UPB_INLINE int upb_value_size(uint64_t val)
Definition: upb.h:7777
bool upb_symtab_done(const upb_symtab_iter *iter)
Definition: upb.c:4004
bool upb_oneof_done(upb_oneof_iter *iter)
Definition: upb.c:1687
UPB_INLINE size_t upb_vencode64(uint64_t val, char *buf)
Definition: upb.h:7792
bool upb_enumdef_freeze(upb_enumdef *e, upb_status *status)
Definition: upb.c:427
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char * bytes
Definition: x509.h:1053
bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v)
Definition: upb.c:4530
void upb_upberr_setoom(upb_status *s)
Definition: upb.c:5181
size_t upb_descreader_filecount(const upb_descreader *r)
Definition: upb.c:7124
bool upb_handlerattr_alwaysok(const upb_handlerattr *attr)
Definition: upb.c:2612
int upb_msgdef_numoneofs(const upb_msgdef *m)
Definition: upb.c:1461
const upb_filedef * upb_def_file(const upb_def *d)
Definition: upb.c:122
const char * upb_fielddef_subdefname(const upb_fielddef *f)
Definition: upb.c:875
bool upb_pbdecodermethod_isnative(const upb_pbdecodermethod *m)
Definition: upb.c:6584
google_protobuf_FieldOptions_JSType
Definition: upb.h:6726
const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo_get(const void *owner)
Definition: upb.c:6382
upb_alloc * upb_arena_alloc(upb_arena *a)
bool upb_refcounted_freeze(upb_refcounted *const *roots, int n, upb_status *s, int maxdepth)
Definition: upb.c:3489
TimeDelta operator*(T a, TimeDelta td)
Definition: timedelta.h:123
unsigned char uint8_t
Definition: skin_detection.h:18
void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg)
Definition: upb.c:7554
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_f_number(const upb_msgdef *m)
Definition: upb.h:6877
SourceCodeInfo
Definition: descriptor_pb2.py:1766
upb_errcode_t
Definition: upb.h:457
UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key, upb_value *v)
Definition: upb.h:925
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: gl2ext.h:134
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6885
UPB_INLINE bool upbdefs_google_protobuf_FileOptions_OptimizeMode_is(const upb_enumdef *e)
Definition: upb.h:6850
upb_syntax_t syntax
Definition: upb.h:3788
AVCFAssetRef CFArrayRef AVCFAssetLoadValuesCompletionCallback callback
Definition: AVFoundationCFSoftLinking.h:99
bool upb_fielddef_enumhasdefaultstr(const upb_fielddef *f)
Definition: upb.c:1127
bool t
Definition: UpdateContents.py:37
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_csharp_namespace(const upb_msgdef *m)
Definition: upb.h:6913
const upb_oneofdef * upb_msgdef_ntoo(const upb_msgdef *m, const char *name, size_t len)
Definition: upb.c:1450
UPB_INLINE upb_decoderet upb_vdecode_max8_fast(upb_decoderet r)
Definition: upb.h:7770
const upb_def * upb_filedef_def(const upb_filedef *f, size_t i)
Definition: upb.c:2009
upb_handlers_tabent table[1]
Definition: upb.h:3689
bool upb_refcounted_isfrozen(const upb_refcounted *r)
Definition: upb.c:3438
const Descriptor * descriptor
Definition: descriptor.cc:271
UPB_INLINE upb_value _upb_value_val(uint64_t val, upb_ctype_t ctype)
Definition: upb.h:621
UPB_INLINE bool upb_sink_startmsg(upb_sink *s)
Definition: upb.h:5688
UPB_INLINE void upb_bufhandle_init(upb_bufhandle *h)
Definition: upb.h:3974
UPB_INLINE void * upb_gmalloc(size_t size)
Definition: upb.h:527
bool upb_oneofdef_addfield(upb_oneofdef *o, upb_fielddef *f, const void *ref_donor, upb_status *s)
Definition: upb.c:1591
int32_t upb_pbdecoder_decode_f64(upb_pbdecoder *d, uint64_t *u64)
Definition: upb.c:7911
const upb_fielddef * upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num)
Definition: upb.c:1673
const char * upb_fielddef_fullname(const upb_fielddef *f)
Definition: upb.c:606
bool upb_symtab_add(upb_symtab *s, upb_def *const *defs, int n, void *ref_donor, upb_status *status)
Definition: upb.c:3776
upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m)
Definition: upb.c:1496
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_f_trailing_comments(const upb_msgdef *m)
Definition: upb.h:6950
double U(int64_t x, double alpha)
Definition: metric_recorder.cc:414
const char * package
Definition: upb.h:3851
bool upb_fielddef_isprimitive(const upb_fielddef *f)
Definition: upb.c:1206
UPB_BEGIN_EXTERN_C const upb_handlers * upb_pb_encoder_newhandlers(const upb_msgdef *m, const void *owner)
Definition: upb.c:9023
const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption_get(const void *owner)
Definition: upb.c:6384
upb_tabkey key
Definition: upb.h:767
char * upb_strdup(const char *s)
Definition: upb.c:4044
bool upb_strtable_done(const upb_strtable_iter *i)
Definition: upb.c:4377
UPB_INLINE bool upb_sink_endsubmsg(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5787
upb_sink * upb_pb_encoder_input(upb_pb_encoder *p)
Definition: upb.c:9066
void upb_fielddef_setdefaultdouble(upb_fielddef *f, double val)
Definition: upb.c:1089
UPB_INLINE const char * upb_bufhandle_buf(const upb_bufhandle *h)
Definition: upb.h:3999
const upb_msgdef * upbdefs_google_protobuf_FieldOptions_get(const void *owner)
Definition: upb.c:6372
UPB_INLINE size_t upb_varint_size(uint64_t val)
Definition: upb.h:7805
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_cc_generic_services(const upb_msgdef *m)
Definition: upb.h:6912
UPB_INLINE bool upbdefs_google_protobuf_UninterpretedOption_NamePart_is(const upb_msgdef *m)
Definition: upb.h:6833
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_f_map_entry(const upb_msgdef *m)
Definition: upb.h:6928
Environment * env
Definition: pseudotcp_parser_fuzzer.cc:44
const upb_tabval * array
Definition: upb.h:804
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6935
void upb_fielddef_setdefaultuint64(upb_fielddef *f, uint64_t val)
Definition: upb.c:1069
const upb_fielddef * upb_oneofdef_ntof(const upb_oneofdef *o, const char *name, size_t length)
Definition: upb.c:1666
int32_t upb_pbdecoder_resume(upb_pbdecoder *d, void *p, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.c:7664
const GLfloat * m
Definition: gl2ext.h:850
bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype)
Definition: upb.c:4481
uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f)
Definition: upb.c:790
bool upb_bool_handlerfunc(void *c, const void *hd, bool val)
Definition: upb.h:3808
bool upb_endfield_handlerfunc(void *c, const void *hd)
Definition: upb.h:3801
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_extension(const upb_msgdef *m)
Definition: upb.h:6861
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_packed(const upb_msgdef *m)
Definition: upb.h:6895
size_t upb_bufhandle_objofs(const upb_bufhandle *h)
Definition: upb.c:2618
google_protobuf_FieldOptions_CType
Definition: upb.h:6275
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_f_leading_comments(const upb_msgdef *m)
Definition: upb.h:6946
uint8_t size_lg2
Definition: upb.h:781
int upb_oneofdef_numfields(const upb_oneofdef *o)
Definition: upb.c:1587
JavaScriptCore arg3
Definition: jsc-trace-profiler-events.d:41
typedef(object or DOMString) AlgorithmIdentifier
upb_func * func
Definition: upb.h:3327
Definition: RenderStyleConstants.h:245
UPB_INLINE bool upbdefs_google_protobuf_FileDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6797
bool upb_msgdef_setsyntax(upb_msgdef *m, upb_syntax_t syntax)
Definition: upb.c:1487
const char * upb_msgdef_fullname(const upb_msgdef *m)
Definition: upb.c:1322
void upb_strtable_next(upb_strtable_iter *i)
Definition: upb.c:4373
upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f)
Definition: upb.c:2475
CFArrayRef array
Definition: AVFoundationCFSoftLinking.h:129
UPB_BEGIN_EXTERN_C upb_textprinter * upb_textprinter_create(upb_env *env, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:9470
signed long long int64_t
Definition: ptypes.h:112
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_name(const upb_msgdef *m)
Definition: upb.h:6957
UPB_BEGIN_EXTERN_C void upb_arena_init(upb_arena *a)
Definition: upb.c:5340
std::integral_constant< std::int64_t, V > int64_t
Definition: Brigand.h:443
UPB_INLINE uintptr_t upb_intkey(uintptr_t key)
Definition: upb.h:832
const struct upb_refcounted_vtbl upb_oneofdef_vtbl
Definition: upb.c:1739
UPB_INLINE const void * upb_bufhandle_objtype(const upb_bufhandle *h)
Definition: upb.h:3996
#define SET_TYPE(dest, val)
Definition: upb.h:813
EGLenum EGLObjectKHR EGLLabelKHR label
Definition: eglext.h:121
std::integral_constant< std::size_t, V > size_t
Definition: Brigand.h:447
PyObject * FindFieldByName(PyDescriptorPool *self, PyObject *arg)
Definition: descriptor_pool.cc:239
UPB_INLINE opcode getop(uint32_t instr)
Definition: upb.h:7409
void upb_fielddef_settype(upb_fielddef *f, upb_fieldtype_t type)
Definition: upb.c:899
bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type, upb_selector_t *s)
Definition: upb.c:2489
int dummy
Definition: voe_standard_test.cc:35
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1053
const char * upb_enumdef_fullname(const upb_enumdef *e)
Definition: upb.c:432
size_t upb_fielddef_getjsonname(const upb_fielddef *f, char *buf, size_t len)
Definition: upb.c:803
Definition: type_traits_unittest.cc:148
UPB_INLINE void upb_bufhandle_uninit(upb_bufhandle *h)
Definition: upb.h:3980
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_type(const upb_msgdef *m)
Definition: upb.h:6889
const char * upb_pbdecoder_getopname(unsigned int op)
bool upb_strtable_insert3(upb_strtable *t, const char *key, size_t len, upb_value val, upb_alloc *a)
Definition: upb.c:4567
void * block_head
Definition: upb.h:638
bool upb_handlers_setstartmsg(upb_handlers *h, upb_startmsg_handlerfunc *func, upb_handlerattr *attr)
Definition: upb.c:2329
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_extension(const upb_msgdef *m)
Definition: upb.h:6900
bool upb_handlers_setint32(upb_handlers *h, const upb_fielddef *f, upb_int32_handlerfunc *func, upb_handlerattr *attr)
size_t upb_pbdecoder_maxnesting(const upb_pbdecoder *d)
Definition: upb.c:8467
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_extendee(const upb_msgdef *m)
Definition: upb.h:6882
std::integral_constant< std::uint64_t, V > uint64_t
Definition: Brigand.h:445
upb_syntax_t syntax
Definition: upb.h:3852
if(!isset( $GET[ 'random_id']))
Definition: cacheable-random-text.php:7
const upb_enumdef * upb_symtab_lookupenum(const upb_symtab *s, const char *sym)
Definition: upb.c:3635
UPB_INLINE void upb_pbdecoder_unpackdispatch(uint64_t dispatch, uint64_t *ofs, uint8_t *wt1, uint8_t *wt2)
Definition: upb.h:7639
const upb_msgdef * upbdefs_google_protobuf_ServiceOptions_get(const void *owner)
Definition: upb.c:6381
void upb_enum_next(upb_enum_iter *iter)
Definition: upb.c:491
bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
const char * upb_fielddef_containingtypename(upb_fielddef *f)
Definition: upb.c:731
zend_class_entry * descriptor_type
bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val)
Definition: upb.c:4490
const struct upb_refcounted_vtbl upb_msgdef_vtbl
Definition: upb.c:1409
upb_handlers * upb_handlers_new(const upb_msgdef *m, const void *owner)
Definition: upb.c:2243
bool upb_fielddef_typeisset(const upb_fielddef *f)
Definition: upb.c:674
bool upb_fielddef_enumhasdefaultint32(const upb_fielddef *f)
Definition: upb.c:1121
bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len, upb_value *val, upb_alloc *alloc)
Definition: upb.c:4597
const upb_handlers * upb_json_printer_newhandlers(const upb_msgdef *md, const void *owner)
Definition: upb.c:11987
UPB_INLINE bool upbdefs_google_protobuf_FileOptions_is(const upb_msgdef *m)
Definition: upb.h:6803
bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype, upb_alloc *a)
Definition: upb.c:4534
void upb_arena_setmaxblocksize(upb_arena *a, size_t size)
UPB_INLINE bool upbdefs_google_protobuf_FieldDescriptorProto_Label_is(const upb_enumdef *e)
Definition: upb.h:6838
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_f_start(const upb_msgdef *m)
Definition: upb.h:6857
bool upb_pbcodecache_setallowjit(upb_pbcodecache *c, bool allow)
Definition: upb.c:7421
UPB_BEGIN_EXTERN_C bool upb_shim_set(upb_handlers *h, const upb_fielddef *f, size_t offset, int32_t hasbit)
Definition: upb.c:3521
void upb_msg_oneof_next(upb_msg_oneof_iter *iter)
Definition: upb.c:1496
bool upb_fielddef_setname(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:754
bool upb_fielddef_issubmsg(const upb_fielddef *f)
Definition: upb.c:1193
ServiceOptions
Definition: descriptor_pb2.py:1737
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_type_name(const upb_msgdef *m)
Definition: upb.h:6890
FieldDescriptorProto
Definition: descriptor_pb2.py:1660
upb_syntax_t
Definition: upb.h:1897
void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter *iter)
Definition: upb.c:1506
bool operator!=(const Handle< T > &a, const Handle< U > &b)
Definition: Handle.h:159
const upb_msgdef * upbdefs_google_protobuf_MethodOptions_get(const void *owner)
Definition: upb.c:6378
#define desc
Definition: extension_set.h:320
size_t upb_filedef_defcount(const upb_filedef *f)
Definition: upb.c:2001
bool upb_byteshandler_setendstr(upb_byteshandler *h, upb_endfield_handlerfunc *func, void *d)
Definition: upb.c:2647
upb_ctype_t ctype
Definition: upb.h:780
FieldOptions
Definition: descriptor_pb2.py:1716
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_string_value(const upb_msgdef *m)
Definition: upb.h:6960
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6927
bool upb_fielddef_lazy(const upb_fielddef *f)
Definition: upb.c:707
UPB_INLINE bool upb_sink_endmsg(upb_sink *s, upb_status *status)
Definition: upb.h:5700
float upb_fielddef_defaultfloat(const upb_fielddef *f)
Definition: upb.c:800
uint32_t static_refcount
Definition: upb.c:2707
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_dependency(const upb_msgdef *m)
Definition: upb.h:6898
char _upb_noclosure
Definition: upb.c:1983
bool upb_byteshandler_setstartstr(upb_byteshandler *h, upb_startstr_handlerfunc *func, void *d)
Definition: upb.c:2633
void upb_msg_oneof_begin(upb_msg_oneof_iter *iter, const upb_msgdef *m)
Definition: upb.c:1492
void upb_symtab_begin(upb_symtab_iter *iter, const upb_symtab *s, upb_deftype_t type)
Definition: upb.c:3992
UPB_INLINE upb_fielddef * upb_msgdef_itof_mutable(upb_msgdef *m, uint32_t i)
Definition: upb.h:2095
void upb_fielddef_setdefaultfloat(upb_fielddef *f, float val)
Definition: upb.c:1084
uintptr_t upb_tabkey
Definition: upb.h:673
UPB_INLINE bool upbdefs_google_protobuf_FileDescriptorSet_is(const upb_msgdef *m)
Definition: upb.h:6800
const upb_handlers * upb_handlers_getsubhandlers_sel(const upb_handlers *h, upb_selector_t sel)
Definition: upb.c:2370
bool upb_inttable_insertptr(upb_inttable *t, const void *key, upb_value val)
Definition: upb.c:4578
bool upb_handlers_setuint32(upb_handlers *h, const upb_fielddef *f, upb_uint32_handlerfunc *func, upb_handlerattr *attr)
void * upb_env_malloc(upb_env *e, size_t size)
Definition: upb.c:1869
WEBCORE_EXPORT Node * last(const ContainerNode &)
Definition: NodeTraversal.cpp:106
UPB_INLINE uint64_t upb_vencode32(uint32_t val)
Definition: upb.h:7811
double upb_fielddef_defaultdouble(const upb_fielddef *f)
Definition: upb.c:805
UPB_INLINE bool upbdefs_google_protobuf_EnumOptions_is(const upb_msgdef *m)
Definition: upb.h:6782
UPB_INLINE bool upb_arrhas(upb_tabval key)
Definition: upb.h:844
GLuint start
Definition: gl2ext.h:323
UPB_INLINE bool upbdefs_google_protobuf_FieldDescriptorProto_Type_is(const upb_enumdef *e)
Definition: upb.h:6841
upb_table t
Definition: upb.h:793
const uint8_t upb_pb_native_wire_types[]
Definition: upb.c:9495
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_cc_enable_arenas(const upb_msgdef *m)
Definition: upb.h:6911
list files
Definition: generate-combined-inspector-json.py:35
uint64_t uint64
Definition: angle_config.h:30
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_string_check_utf8(const upb_msgdef *m)
Definition: upb.h:6921
const char * upb_oneofdef_name(const upb_oneofdef *o)
Definition: upb.c:1570
upb_errorspace * upb_status_errspace(const upb_status *status)
Definition: upb.c:4934
int64_t int64
Definition: angle_config.h:29
Clear
Definition: python_message.py:1326
void * upb_env_realloc(upb_env *e, void *ptr, size_t oldsize, size_t size)
Definition: upb.c:1880
void
Definition: AVFoundationCFSoftLinking.h:81
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6939
const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo_Location_get(const void *owner)
Definition: upb.c:6383
bool upb_def_freeze(upb_def *const *defs, int n, upb_status *s)
Definition: upb.c:319
UPB_END_EXTERN_C typedef upb_inttable_iter upb_oneof_iter
Definition: upb.h:2289
void * upb_alloc_func(void *ud, void *ptr, size_t oldsize, size_t size)
Definition: upb.h:5132
opcode
Definition: upb.h:7405
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6870
EGLStreamKHR EGLint n
Definition: eglext.h:984
VoEFile * file
Definition: voe_cmd_test.cc:59
void upb_symtab_next(upb_symtab_iter *iter)
Definition: upb.c:3999
upb_strtable_iter upb_msg_oneof_iter
Definition: upb.h:1828
bool upb_msg_field_done(const upb_msg_field_iter *iter)
Definition: upb.c:1480
UPB_INLINE upb_fielddef * upb_msgdef_ntof_mutable(upb_msgdef *m, const char *name, size_t len)
Definition: upb.h:2099
void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line)
Definition: upb.c:9489
const upb_msgdef * upbdefs_google_protobuf_OneofDescriptorProto_get(const void *owner)
Definition: upb.c:6379
const upb_def * upb_symtab_iter_def(const upb_symtab_iter *iter)
Definition: upb.c:4008
#define R2(a, b, c, d, k, s, t)
Definition: md4.c:129
upb_value upb_inttable_pop(upb_inttable *t)
Definition: upb.c:4571
GLint GLuint mask
Definition: gl2.h:480
void upb_env_init2(upb_env *e, void *mem, size_t n, upb_alloc *alloc)
Definition: upb.c:5431
EGLSetBlobFuncANDROID EGLGetBlobFuncANDROID get
Definition: eglext.h:426
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_weak_dependency(const upb_msgdef *m)
Definition: upb.h:6909
EGLStreamKHR EGLint EGLint offset
Definition: eglext.h:984
const char * upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len)
Definition: upb.c:810
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_negative_int_value(const upb_msgdef *m)
Definition: upb.h:6958
UPB_INLINE bool upb_sink_endseq(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5728
UPB_INLINE bool upb_bytessink_start(upb_bytessink *s, size_t size_hint, void **subc)
Definition: upb.h:5588
UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key, upb_value val)
Definition: upb.h:873
bool upb_uint64_handlerfunc(void *c, const void *hd, uint64_t val)
Definition: upb.h:3805
UPB_BEGIN_EXTERN_C upb_symtab * upb_symtab_new(const void *owner)
Definition: upb.c:3600
void upb_pbdecoder_reset(upb_pbdecoder *d)
Definition: upb.c:8410
#define UPB_UNUSED(var)
Definition: upb.h:264
bool upb_error_func(void *ud, const upb_status *status)
Definition: upb.h:5134
void * closure
Definition: upb.h:5521
bool upb_filedef_setpackage(upb_filedef *f, const char *package, upb_status *s)
Definition: upb.c:2040
UPB_INLINE bool upb_filedef_addext(upb_filedef *file, upb_fielddef *f, const void *ref_donor, upb_status *s)
Definition: upb.h:3032
void upb_refcounted_ref2(const upb_refcounted *r, upb_refcounted *from)
Definition: upb.c:3456
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_oneof_decl(const upb_msgdef *m)
Definition: upb.h:6866
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_f_value(const upb_msgdef *m)
Definition: upb.h:6872
void upb_handlerfree(void *d)
Definition: upb.h:3276
UPB_INLINE bool upb_filedef_addmsg(upb_filedef *f, upb_msgdef *m, const void *ref_donor, upb_status *s)
Definition: upb.h:3022
UPB_INLINE bool upbdefs_google_protobuf_SourceCodeInfo_is(const upb_msgdef *m)
Definition: upb.h:6824
bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val, upb_alloc *a)
Definition: upb.c:4737
int top
Definition: float-mm.c:109
UPB_BEGIN_EXTERN_C upb_pbdecoder * upb_pbdecoder_create(upb_env *e, const upb_pbdecodermethod *method, upb_sink *output)
Definition: upb.c:8419
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char int len
Definition: x509.h:1053
UPB_INLINE const void * upb_bufhandle_obj(const upb_bufhandle *h)
Definition: upb.h:3993
void upb_env_initonly(upb_env *e)
Definition: upb.c:5420
int ret
Definition: test_unit_dft.c:69
void upb_oneof_iter_setdone(upb_oneof_iter *iter)
Definition: upb.c:1695
const upb_msgdef * upbdefs_google_protobuf_EnumOptions_get(const void *owner)
Definition: upb.c:6368
UPB_INLINE bool upbdefs_google_protobuf_FieldDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6791
TestSubObjConstructor T
Definition: TestTypedefs.idl:84
#define UPB_REFCOUNTED_CPPMETHODS
Definition: upb.h:1444
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ReservedRange_f_start(const upb_msgdef *m)
Definition: upb.h:6859
FileDescriptorProto
Definition: descriptor_pb2.py:1630
FloatingPoint< float > Float
Definition: gtest-internal.h:481
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_py_generic_services(const upb_msgdef *m)
Definition: upb.h:6925
FloatingPoint< double > Double
Definition: gtest-internal.h:482
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6871
size_t next_block_size
Definition: upb.h:634
bool upb_arena_addcleanup(upb_arena *a, upb_cleanup_func *func, void *ud)
Definition: upb.c:5384
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6876
#define UPB_PB_DECODER_SIZE
Definition: upb.h:7429
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6864
const upb_byteshandler * upb_pbdecodermethod_inputhandler(const upb_pbdecodermethod *m)
Definition: upb.c:6579
UPB_INLINE size_t upb_table_size(const upb_table *t)
Definition: upb.h:817
#define UPB_DECLARE_DEF_TYPE(cppname, lower, upper)
Definition: upb.h:1827
size_t upb_filedef_depcount(const upb_filedef *f)
Definition: upb.c:2005
upb_decoderet upb_vdecode_max8_branch32(upb_decoderet r)
Definition: upb.c:9521
_W64 unsigned int uintptr_t
Definition: stdint.h:161
bool upb_pbdecoder_end(void *closure, const void *handler_data)
Definition: upb.c:8340
size_t count
Definition: upb.h:778
const upb_oneofdef * upb_fielddef_containingoneof(const upb_fielddef *f)
Definition: upb.c:723
void upb_pbcodecache_uninit(upb_pbcodecache *c)
Definition: upb.c:7407
const upb_handlers * upb_pbdecodermethod_desthandlers(const upb_pbdecodermethod *m)
Definition: upb.c:6574
size_t upb_string_handlerfunc(void *c, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
Definition: upb.h:3811
const upb_filedef * upb_filedef_dep(const upb_filedef *f, size_t i)
Definition: upb.c:2019
bool upb_enum_done(upb_enum_iter *iter)
Definition: upb.c:492
upb_value upb_strtable_iter_value(const upb_strtable_iter *i)
Definition: upb.c:4394
upb_fielddef * upb_msg_iter_field(const upb_msg_field_iter *iter)
Definition: upb.c:1484
UPB_INLINE void * upb_grealloc(void *ptr, size_t oldsize, size_t size)
Definition: upb.h:531
void upb_handlers_clearerr(upb_handlers *h)
Definition: upb.c:2300
UPB_INLINE bool upb_sink_startsubmsg(upb_sink *s, upb_selector_t sel, upb_sink *sub)
Definition: upb.h:5768
UPB_INLINE size_t upb_sink_putstring(upb_sink *s, upb_selector_t sel, const char *buf, size_t n, const upb_bufhandle *handle)
Definition: upb.h:5674
UPB_INLINE uint32_t upb_zzenc_32(int32_t n)
Definition: upb.h:7705
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_lazy(const upb_msgdef *m)
Definition: upb.h:6894
size_t upb_inttable_count(const upb_inttable *t)
Definition: upb.c:4441
int32_t upb_pbdecoder_decode_f32(upb_pbdecoder *d, uint32_t *u32)
Definition: upb.c:7907
uint64_t val
Definition: upb.h:595
bool upb_byteshandler_setstring(upb_byteshandler *h, upb_string_handlerfunc *func, void *d)
Definition: upb.c:2640
const char * upb_status_errmsg(const upb_status *status)
Definition: upb.c:4940
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_source_code_info(const upb_msgdef *m)
Definition: upb.h:6907
Definition: interfaces.idl:172
GLuint index
Definition: gl2.h:383
UPB_BEGIN_EXTERN_C upb_oneofdef * upb_oneofdef_new(const void *owner)
Definition: upb.c:1533
void upb_handlerattr_init(upb_handlerattr *attr)
Definition: upb.c:2574
upb_alloc_func * func
Definition: upb.h:500
bool upb_strtable_iter_isequal(const upb_strtable_iter *i1, const upb_strtable_iter *i2)
Definition: upb.c:4403
void upb_status_seterrf(upb_status *status, const char *fmt,...)
Definition: upb.c:4949
void upb_fielddef_setlazy(upb_fielddef *f, bool lazy)
Definition: upb.c:1013
OPENSSL_EXPORT X509_ATTRIBUTE * attr
Definition: x509.h:1051
bool upb_enumdef_ntoi(const upb_enumdef *e, const char *name, size_t len, int32_t *num)
Definition: upb.c:494
EGLAttrib * value
Definition: eglext.h:120
size_t upb_pbdecoder_suspend(upb_pbdecoder *d)
Definition: upb.c:7705
UPB_INLINE bool upbdefs_google_protobuf_MessageOptions_is(const upb_msgdef *m)
Definition: upb.h:6806
upb_inttable defs
Definition: upb.h:3854
bool upb_fielddef_packed(const upb_fielddef *f)
Definition: upb.c:711
const upb_filedef * file
Definition: upb.h:3708
unsigned char uint8_t
Definition: ptypes.h:89
const char * upb_enumdef_name(const upb_enumdef *e)
Definition: upb.c:501
UPB_INLINE upb_decoderet upb_decoderet_make(const char *p, uint64_t val)
Definition: upb.h:7716
bool upb_env_reporterror(upb_env *e, const upb_status *status)
Definition: upb.c:1852
unsigned int uint
Definition: bigfib.cpp:41
const upb_byteshandler * upb_json_parsermethod_inputhandler(const upb_json_parsermethod *m)
Definition: upb.c:11998
GLenum func
Definition: gl2.h:481
void upb_msgdef_setmapentry(upb_msgdef *m, bool map_entry)
Definition: upb.c:1465
bool upb_handlers_freeze(upb_handlers *const *handlers, int n, upb_status *s)
Definition: upb.c:2391
upb_filedef ** upb_loaddescriptor(const char *buf, size_t n, const void *owner, upb_status *status)
Definition: upb.c:9781
UPB_INLINE bool upb_sink_endstr(upb_sink *s, upb_selector_t sel)
Definition: upb.h:5756
const char * kPbDecoderSubmessageTooLong
Definition: upb.c:7481
const upb_fielddef * upb_msgdef_ntof(const upb_msgdef *m, const char *name, size_t len)
Definition: upb.c:1443
#define F(b, c, d)
Definition: md4.c:111
Definition: gtest_pred_impl_unittest.cc:56
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6938
const struct _upb_tabent * next
Definition: upb.h:774
bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype)
Definition: upb.c:4292
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6926
UPB_INLINE upb_selector_t upb_handlers_getendselector(upb_selector_t start)
Definition: upb.h:3951
uint32_t MurmurHash2(const void *key, size_t len, uint32_t seed)
Definition: upb.c:4784
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_default_value(const upb_msgdef *m)
Definition: upb.h:6881
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6874
const upb_def * upb_fielddef_subdef(const upb_fielddef *f)
Definition: upb.c:857
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_jstype(const upb_msgdef *m)
Definition: upb.h:6893
const char * upb_fielddef_name(const upb_fielddef *f)
Definition: upb.c:715
const upb_enumdef * upbdefs_google_protobuf_FileOptions_OptimizeMode_get(const void *owner)
Definition: upb.c:6391
#define UPB_DISALLOW_COPY_AND_ASSIGN(class_name)
Definition: upb.h:164
void upb_fielddef_setdefaultbool(upb_fielddef *f, bool val)
Definition: upb.c:1079
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_f_end(const upb_msgdef *m)
Definition: upb.h:6856
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_double_value(const upb_msgdef *m)
Definition: upb.h:6955
bool upb_handlers_setsubhandlers(upb_handlers *h, const upb_fielddef *f, const upb_handlers *sub)
Definition: upb.c:2342
void upb_status_copy(upb_status *to, const upb_status *from)
Definition: upb.c:4972
upb_intfmt_t upb_fielddef_intfmt(const upb_fielddef *f)
Definition: upb.c:691
upb_inttable deps
Definition: upb.h:3855
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_package(const upb_msgdef *m)
Definition: upb.h:6920
void upb_inttable_iter_setdone(upb_inttable_iter *i)
Definition: upb.c:4709
upb_wiretype_t
Definition: upb.h:7677
UPB_INLINE bool upb_sink_startstr(upb_sink *s, upb_selector_t sel, size_t size_hint, upb_sink *sub)
Definition: upb.h:5740
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_output_type(const upb_msgdef *m)
Definition: upb.h:6936
upb_table t
Definition: upb.h:803
OneofDescriptorProto
Definition: descriptor_pb2.py:1667
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_reserved_range(const upb_msgdef *m)
Definition: upb.h:6869
bool upb_env_addcleanup(upb_env *e, upb_cleanup_func *func, void *ud)
Definition: upb.c:1857
bool upb_enumdef_addval(upb_enumdef *e, const char *name, int32_t num, upb_status *status)
Definition: upb.c:441
const upb_pbdecodermethod * upb_pbdecodermethod_new(const upb_pbdecodermethodopts *opts, const void *owner)
Definition: upb.c:6588
const upb_msgdef * upbdefs_google_protobuf_FieldDescriptorProto_get(const void *owner)
Definition: upb.c:6371
#define UPB_ENDSTR_SELECTOR
Definition: upb.h:3970
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6880
upb_label_t
Definition: upb.h:1450
size_t upb_pbdecoder_decode(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.c:8397
UPB_INLINE bool upbdefs_google_protobuf_SourceCodeInfo_Location_is(const upb_msgdef *m)
Definition: upb.h:6827
upb_fielddef * upb_oneof_iter_field(const upb_oneof_iter *iter)
Definition: upb.c:1691
UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e, const char *name, int32_t *num)
Definition: upb.h:2268
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_ReservedRange_f_end(const upb_msgdef *m)
Definition: upb.h:6858
EGLImageKHR EGLint * name
Definition: eglext.h:851
const upb_msgdef * upb_handlers_msgdef(const upb_handlers *h)
Definition: upb.c:2376
size_t bytes_allocated
Definition: upb.h:633
void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o)
Definition: upb.c:1679
bool upb_handlers_setendseq(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_reserved_name(const upb_msgdef *m)
Definition: upb.h:6868
UPB_INLINE const void * upb_handlers_gethandlerdata(const upb_handlers *h, upb_selector_t s)
Definition: upb.h:3911
void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args)
Definition: upb.c:4956
size_t mask
Definition: upb.h:779
#define UPB_PB_ENCODER_SIZE
Definition: upb.h:8159
UPB_BEGIN_EXTERN_C const void * UPB_UNTRACKED_REF
Definition: upb.c:2677
upb_decoderet upb_vdecode_max8_wright(upb_decoderet r)
Definition: upb.c:9597
bool upb_fielddef_setcontainingtypename(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:739
unrestricted float DOUBLE
Definition: TestTypedefs.idl:71
#define UPB_END_EXTERN_C
Definition: upb.h:246
bool upb_handlerattr_setreturnclosuretype(upb_handlerattr *attr, const void *type)
Definition: upb.c:2597
void upb_cleanup_func(void *ud)
Definition: upb.h:5133
Definition: __init__.py:1
def sub(pattern, replacement, s)
Definition: common.py:63
void upb_refcounted_checkref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3485
bool upb_fielddef_setsubdefname(upb_fielddef *f, const char *name, upb_status *s)
Definition: upb.c:1178
bool upb_env_ok(const upb_env *e)
Definition: upb.c:1848
bool _upb_def_validate(upb_def *const *defs, size_t n, upb_status *s)
Definition: upb.c:373
bool upb_inttable_init2(upb_inttable *table, upb_ctype_t ctype, upb_alloc *a)
Definition: upb.c:4728
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_syntax(const upb_msgdef *m)
Definition: upb.h:6908
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_objc_class_prefix(const upb_msgdef *m)
Definition: upb.h:6923
void upb_byteshandler_init(upb_byteshandler *h)
Definition: upb.c:2624
void * cleanup_head
Definition: upb.h:641
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6942
UPB_BEGIN_EXTERN_C upb_descreader * upb_descreader_create(upb_env *e, const upb_handlers *h)
Definition: upb.c:6442
UPB_BEGIN_EXTERN_C upb_json_printer * upb_json_printer_create(upb_env *e, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:11965
void upb_strtable_iter_setdone(upb_strtable_iter *i)
Definition: upb.c:4399
GLboolean GLboolean GLboolean GLboolean a
Definition: gl2ext.h:306
bool upb_fielddef_isstring(const upb_fielddef *f)
Definition: upb.c:1197
UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e)
Definition: upb.h:825
const void * obj_
Definition: upb.h:3389
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_nested_type(const upb_msgdef *m)
Definition: upb.h:6865
bool upb_filedef_adddef(upb_filedef *f, upb_def *def, const void *ref_donor, upb_status *s)
Definition: upb.c:2081
#define true
Definition: float-mm.c:6
upb_filedef * upb_descreader_file(const upb_descreader *r, size_t i)
Definition: upb.c:7128
GenericReader< UTF8<>, UTF8<> > Reader
Reader with UTF8 encoding and default allocator.
Definition: reader.h:1432
void upb_inttable_uninit(upb_inttable *table)
Definition: upb.c:4485
const upb_def * upb_symtab_resolve(const upb_symtab *s, const char *base, const char *sym)
Definition: upb.c:3661
bool upb_fielddef_ismap(const upb_fielddef *f)
Definition: upb.c:1210
upb_errorspace upb_upberr
Definition: upb.c:5179
bool upb_fielddef_isseq(const upb_fielddef *f)
Definition: upb.c:1202
bool upb_strtable_resize(upb_strtable *t, size_t size_lg2)
Definition: upb.c:4303
void upb_inttable_compact(upb_inttable *t)
Definition: upb.c:4591
#define N
Definition: gcc-loops.cpp:14
void upb_refcounted_unref2(const upb_refcounted *r, upb_refcounted *from)
Definition: upb.c:3466
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_ReservedRange_get(const void *owner)
Definition: upb.c:6366
const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Type_get(const void *owner)
Definition: upb.c:6388
UPB_BEGIN_EXTERN_C upb_def * upb_def_dup(const upb_def *def, const void *owner)
Definition: upb.c:82
upb_refcounted base
Definition: upb.h:3848
bool upb_fielddef_setfullname(upb_fielddef *f, const char *fullname, upb_status *s)
bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f, upb_string_handlerfunc *func, upb_handlerattr *attr)
void upb_arena_uninit(upb_arena *a)
Definition: upb.c:5362
MethodDescriptorProto
Definition: descriptor_pb2.py:1695
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6867
GLfloat f
Definition: gl2.h:417
const upb_status * upb_handlers_status(upb_handlers *h)
Definition: upb.c:2295
UPB_INLINE bool upbdefs_google_protobuf_EnumValueDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6785
#define UPB_VARINT_DECODER_CHECK2(name, decode_max8_function)
Definition: upb.h:8038
bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter)
Definition: upb.c:1498
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_number(const upb_msgdef *m)
Definition: upb.h:6886
bool upb_handlers_setint64(upb_handlers *h, const upb_fielddef *f, upb_int64_handlerfunc *func, upb_handlerattr *attr)
upb_ctype_t
Definition: upb.h:582
const upb_msgdef * upbdefs_google_protobuf_MethodDescriptorProto_get(const void *owner)
Definition: upb.c:6377
UPB_INLINE bool upbdefs_google_protobuf_FieldOptions_JSType_is(const upb_enumdef *e)
Definition: upb.h:6847
bool upb_fielddef_setjsonname(upb_fielddef *f, const char *name, upb_status *s)
bool IsMap(const google::protobuf::Field &field, const google::protobuf::Type &type)
Definition: utility.cc:312
const GLfloat * v
Definition: gl2.h:514
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_optimize_for(const upb_msgdef *m)
Definition: upb.h:6924
string expected
Definition: buildtests.py:33
upb_decoderet upb_vdecode_max8_massimino(upb_decoderet r)
Definition: upb.c:9576
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6914
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_identifier_value(const upb_msgdef *m)
Definition: upb.h:6956
bool upb_enumdef_setfullname(upb_enumdef *e, const char *fullname, upb_status *s)
Definition: upb.c:436
void upb_refcounted_unref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3449
UPB_INLINE bool upb_sink_startseq(upb_sink *s, upb_selector_t sel, upb_sink *sub)
Definition: upb.h:5712
const upb_msgdef * upbdefs_google_protobuf_FileDescriptorProto_get(const void *owner)
Definition: upb.c:6373
bool upb_fielddef_setdefaultstr(upb_fielddef *f, const void *str, size_t len, upb_status *s)
Definition: upb.c:1094
UPB_INLINE bool upbdefs_google_protobuf_FieldOptions_CType_is(const upb_enumdef *e)
Definition: upb.h:6844
#define UPB_BREAK
Definition: upb.h:3930
void upb_strtable_uninit(upb_strtable *table)
Definition: upb.c:4296
bool operator==(const Handle< T > &a, const Handle< U > &b)
Definition: Handle.h:144
Definition: safe_conversions.h:16
const upb_msgdef * upb_fielddef_msgsubdef(const upb_fielddef *f)
Definition: upb.c:861
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_f_method(const upb_msgdef *m)
Definition: upb.h:6941
const upb_msgdef * upbdefs_google_protobuf_FileOptions_get(const void *owner)
Definition: upb.c:6375
EGLenum type
Definition: eglext.h:63
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorSet_f_file(const upb_msgdef *m)
Definition: upb.h:6910
void upb_env_uninit(upb_env *e)
Definition: upb.c:1816
UPB_INLINE upb_oneofdef * upb_msgdef_ntoo_mutable(upb_msgdef *m, const char *name, size_t len)
Definition: upb.h:2116
UPB_INLINE size_t upb_bytessink_putbuf(upb_bytessink *s, void *subc, const char *buf, size_t size, const upb_bufhandle *handle)
Definition: upb.h:5603
bool upb_handlerattr_setalwaysok(upb_handlerattr *attr, bool alwaysok)
Definition: upb.c:2607
const void * handler_data_
Definition: upb.h:3318
EGLStreamKHR EGLint EGLint EGLint const void * data
Definition: eglext.h:984
void upb_fielddef_setlabel(upb_fielddef *f, upb_label_t label)
Definition: upb.c:1023
upb_alloc * alloc
Definition: upb.h:1010
UPB_INLINE bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink *sink)
Definition: upb.h:5629
str
Definition: make-dist.py:305
bool upb_enumdef_setdefault(upb_enumdef *e, int32_t val, upb_status *s)
Definition: upb.c:472
upb_alloc alloc
Definition: upb.h:627
upb_intfmt_t
Definition: upb.h:1458
GLsizei const GLchar *const * string
Definition: gl2.h:479
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6944
uint32_t upb_handlers_selectorbaseoffset(const upb_fielddef *f)
Definition: upb.c:2552
rtc::scoped_refptr< PeerConnectionInterface > pc(f->CreatePeerConnection(rtc_config, nullptr, nullptr, observer))
SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.
Definition: reader.h:380
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueOptions_f_deprecated(const upb_msgdef *m)
Definition: upb.h:6879
BigEndianULong UInt32
Definition: OpenTypeTypes.h:64
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6934
bool upb_inttable_push2(upb_inttable *t, upb_value val, upb_alloc *a)
Definition: upb.c:4818
const upb_handlers * upb_handlers_getsubhandlers(const upb_handlers *h, const upb_fielddef *f)
Definition: upb.c:2356
bool upb_handlerattr_sethandlerdata(upb_handlerattr *attr, const void *hd)
Definition: upb.c:2583
#define buffer
Definition: xmlparse.c:622
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_enum_type(const upb_msgdef *m)
Definition: upb.h:6860
EnumValueOptions
Definition: descriptor_pb2.py:1730
const upb_def * upb_symtab_lookup(const upb_symtab *s, const char *sym)
Definition: upb.c:3621
bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val)
Definition: upb.c:4537
UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c)
Definition: upb.h:5669
double max
Definition: DeviceProximityEvent.idl:32
const upb_pbdecodermethod * upb_pbcodecache_getdecodermethod(upb_pbcodecache *c, const upb_pbdecodermethodopts *opts)
Definition: upb.c:7428
UPB_INLINE void * upb_realloc(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
Definition: upb.h:508
uint32_t upb_handlers_selectorcount(const upb_fielddef *f)
Definition: upb.c:2556
bool upb_handlerattr_setclosuretype(upb_handlerattr *attr, const void *type)
Definition: upb.c:2588
upb_alloc * block_alloc
Definition: upb.h:631
GLfloat GLfloat GLfloat GLfloat h
Definition: gl2ext.h:3060
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_ctype(const upb_msgdef *m)
Definition: upb.h:6891
UPB_INLINE upb_def * upb_filedef_mutabledef(upb_filedef *f, int i)
Definition: upb.h:3036
bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func, upb_handlerattr *attr)
Definition: upb.c:2335
UPB_INLINE void upb_bufhandle_setobj(upb_bufhandle *h, const void *obj, const void *type)
Definition: upb.h:3983
MethodOptions
Definition: descriptor_pb2.py:1744
#define UPB_DECLARE_TYPE(cppname, cname)
Definition: upb.h:248
upb_value upb_inttable_iter_value(const upb_inttable_iter *i)
Definition: upb.c:4702
const upb_byteshandler * handler
Definition: upb.h:5545
bool upb_strtable_insert2(upb_strtable *t, const char *key, size_t len, upb_value val)
Definition: upb.c:4322
EnumDescriptorProto
Definition: descriptor_pb2.py:1674
void upb_fielddef_setintfmt(upb_fielddef *f, upb_intfmt_t fmt)
Definition: upb.c:1029
void upb_pbcodecache_init(upb_pbcodecache *c)
Definition: upb.c:7402
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6896
bool upb_handlers_setendsubmsg(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, upb_handlerattr *attr)
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_outer_classname(const upb_msgdef *m)
Definition: upb.h:6919
upb_fielddef * upb_fielddef_dup(const upb_fielddef *f, const void *owner)
Definition: upb.c:638
google::protobuf::scoped_ptr< io::Tokenizer > input_
Definition: parser_unittest.cc:182
const char * name
Definition: upb.h:3827
UPB_INLINE bool upbdefs_google_protobuf_ServiceDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6818
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_label(const upb_msgdef *m)
Definition: upb.h:6884
void upb_pbdecodermethodopts_setlazy(upb_pbdecodermethodopts *opts, bool lazy)
Definition: upb.c:7452
for i
Definition: complexityMeasures.m:24
#define H(b, c, d)
Definition: md4.c:113
UPB_INLINE uint32_t upb_inthash(uintptr_t key)
Definition: upb.h:836
int32_t upb_enumdef_default(const upb_enumdef *e)
Definition: upb.c:467
const char * upb_msgdef_name(const upb_msgdef *m)
Definition: upb.c:1478
bool upb_fielddef_checkdescriptortype(int32_t type)
Definition: upb.c:1227
const upb_handlers * upb_json_parsermethod_desthandlers(const upb_json_parsermethod *m)
Definition: type_traits_unittest.cc:77
size_t upb_env_bytesallocated(const upb_env *e)
Definition: upb.c:1894
const char * upb_enum_iter_name(upb_enum_iter *iter)
Definition: upb.c:510
UPB_INLINE bool upb_bytessink_end(upb_bytessink *s)
Definition: upb.h:5617
#define FUNCS(name, membername, type_t, converter, proto_type)
Definition: upb.h:846
UPB_INLINE uint64_t upb_zzenc_64(int64_t n)
Definition: upb.h:7706
#define UPB_ASSERT_VAR(var, predicate)
Definition: upb.h:269
bool upb_handlers_setdouble(upb_handlers *h, const upb_fielddef *f, upb_double_handlerfunc *func, upb_handlerattr *attr)
bool upb_inttable_lookupptr(const upb_inttable *t, const void *key, upb_value *val)
Definition: upb.c:4582
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_DescriptorProto_f_field(const upb_msgdef *m)
Definition: upb.h:6863
const upb_handlers * upb_descreader_newhandlers(const void *owner)
Definition: upb.c:6467
void upb_handlers_callback(const void *closure, upb_handlers *h)
Definition: upb.h:3836
void * future2
Definition: upb.h:645
bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val)
Definition: upb.c:4587
bool upb_ok(const upb_status *status)
Definition: upb.c:4932
bool upb_fielddef_setsubdef(upb_fielddef *f, const upb_def *subdef, upb_status *s)
Definition: upb.c:1156
uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i)
Definition: upb.c:4697
upb_enumdef * upb_enumdef_dup(const upb_enumdef *e, const void *owner)
Definition: upb.c:412
void upb_status_clear(upb_status *status)
Definition: upb.c:4925
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_client_streaming(const upb_msgdef *m)
Definition: upb.h:6932
size_t objofs_
Definition: upb.h:3391
bool upb_filedef_freeze(upb_filedef *f, upb_status *s)
struct _upb_tabent upb_tabent
int upb_msgdef_numfields(const upb_msgdef *m)
Definition: upb.c:1457
uint64_t val
Definition: upb.h:737
const
Definition: upload.py:398
#define NULL
Definition: common_types.h:41
void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t)
Definition: upb.c:4368
const upb_msgdef * upb_oneofdef_containingtype(const upb_oneofdef *o)
Definition: upb.c:1583
const upb_msgdef * upbdefs_google_protobuf_EnumValueOptions_get(const void *owner)
Definition: upb.c:6370
containing_type
Definition: descriptor_pb2.py:1563
DOMString e
Definition: WebCryptoAPI.idl:115
upb_pb_encoder * upb_pb_encoder_create(upb_env *e, const upb_handlers *h, upb_bytessink *output)
Definition: upb.c:9028
const upb_msgdef * upbdefs_google_protobuf_EnumDescriptorProto_get(const void *owner)
Definition: upb.c:6367
#define UPB_PRIVATE_FOR_CPP
Definition: upb.h:247
bool upb_handlers_setbool(upb_handlers *h, const upb_fielddef *f, upb_bool_handlerfunc *func, upb_handlerattr *attr)
const char * kPbDecoderStackOverflow
Definition: upb.c:7480
BigEndianLong Int32
Definition: OpenTypeTypes.h:63
upb_json_parsermethod * upb_json_parsermethod_new(const upb_msgdef *md, const void *owner)
Definition: upb.c:11977
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_input_type(const upb_msgdef *m)
Definition: upb.h:6933
UPB_END_EXTERN_C typedef upb_strtable_iter upb_enum_iter
Definition: upb.h:2162
upb_sink * upb_textprinter_input(upb_textprinter *p)
Definition: upb.c:9487
JavaScriptCore arg4
Definition: jsc-trace-profiler-events.d:41
const upb_json_parsermethod * m
Definition: upb.h:8438
void upb_env_seterrorfunc(upb_env *e, upb_error_func *func, void *ud)
Definition: upb.c:1837
Definition: Location.idl:44
UPB_INLINE void * upb_malloc(upb_alloc *alloc, size_t size)
Definition: upb.h:503
TypeWithSize< 8 >::UInt UInt64
Definition: gtest-port.h:1493
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
Definition: upb.c:4344
upb_oneofdef * upb_msg_iter_oneof(const upb_msg_oneof_iter *iter)
Definition: upb.c:1502
bool upb_fielddef_checktype(int32_t type)
Definition: upb.c:1224
upb_msgdef * upb_msgdef_dup(const upb_msgdef *m, const void *owner)
Definition: upb.c:1282
char * upb_strdup2(const char *s, size_t len)
Definition: upb.c:4048
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_generic_services(const upb_msgdef *m)
Definition: upb.h:6917
upb_handlers_tabent table[3]
Definition: upb.h:3930
const struct upb_refcounted_vtbl upb_filedef_vtbl
Definition: upb.c:1952
const upb_handlers * upb_handlers_newfrozen(const upb_msgdef *m, const void *owner, upb_handlers_callback *callback, const void *closure)
Definition: upb.c:2270
upb_bytessink * upb_json_parser_input(upb_json_parser *p)
Definition: upb.c:11199
Definition: RenderStyleConstants.h:245
void * upb_startstr_handlerfunc(void *c, const void *hd, size_t size_hint)
Definition: upb.h:3809
UPB_BEGIN_EXTERN_C UPB_INLINE void upb_bytessink_reset(upb_bytessink *s, const upb_byteshandler *h, void *closure)
Definition: upb.h:5582
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumValueDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6878
bool upb_float_handlerfunc(void *c, const void *hd, float val)
Definition: upb.h:3806
void upb_fielddef_setisextension(upb_fielddef *f, bool is_extension)
Definition: upb.c:1008
bool upb_handlers_getattr(const upb_handlers *h, upb_selector_t s, upb_handlerattr *attr)
Definition: upb.c:2362
const upb_msgdef * upb_symtab_lookupmsg(const upb_symtab *s, const char *sym)
Definition: upb.c:3628
bool upb_handlers_setfloat(upb_handlers *h, const upb_fielddef *f, upb_float_handlerfunc *func, upb_handlerattr *attr)
uint32_t uint32
Definition: angle_config.h:28
bool upb_msgdef_lookupname(const upb_msgdef *m, const char *name, size_t len, const upb_fielddef **f, const upb_oneofdef **o)
Definition: upb.c:1636
UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key, upb_value *v)
Definition: upb.h:885
uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f)
Definition: upb.c:785
bool upb_msgdef_setfullname(upb_msgdef *m, const char *fullname, upb_status *s)
Definition: upb.c:1326
upb_refcounted base
Definition: upb.h:3825
UninterpretedOption
Definition: descriptor_pb2.py:1751
Definition: __init__.py:1
bool upb_fielddef_defaultbool(const upb_fielddef *f)
Definition: upb.c:795
void upb_oneof_next(upb_oneof_iter *iter)
Definition: upb.c:1683
Definition: gflags_completions.h:115
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_message_type(const upb_msgdef *m)
Definition: upb.h:6901
bool upb_filedef_adddep(upb_filedef *f, const upb_filedef *dep)
Definition: upb.c:2102
void * error_ud_
Definition: upb.h:734
#define UPB_FINAL
Definition: upb.h:172
Definition: XMLHttpRequest.idl:38
const upb_handlers * handlers
Definition: upb.h:5520
int32_t upb_pbdecoder_decode_varint_slow(upb_pbdecoder *d, uint64_t *u64)
Definition: upb.c:7832
UPB_INLINE size_t upb_strtable_count(const upb_strtable *t)
Definition: upb.h:857
UPB_BEGIN_EXTERN_C upb_fielddef * upb_fielddef_new(const void *owner)
Definition: upb.c:604
#define I(b, c, d)
Definition: md5.c:128
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
Definition: upb.c:678
void * upb_pbdecoder_startjit(void *closure, const void *hd, size_t size_hint)
Definition: upb.c:8329
MessageOptions
Definition: descriptor_pb2.py:1709
string input
Definition: tokenizer_unittest.cc:198
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_EnumOptions_f_allow_alias(const upb_msgdef *m)
Definition: upb.h:6873
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_json_name(const upb_msgdef *m)
Definition: upb.h:6883
FieldDescriptorProto * AddField(DescriptorProto *parent, const string &name, int number, FieldDescriptorProto::Label label, FieldDescriptorProto::Type type)
Definition: descriptor_unittest.cc:101
UPB_BEGIN_EXTERN_C upb_json_parser * upb_json_parser_create(upb_env *e, upb_sink *output)
Definition: upb.c:11173
const char * upb_def_name(const upb_def *d)
Definition: upb.c:91
const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Label_get(const void *owner)
Definition: upb.c:6387
upb_arena * upb_env_arena(upb_env *e)
bool upb_uint32_handlerfunc(void *c, const void *hd, uint32_t val)
Definition: upb.h:3804
UPB_BEGIN_EXTERN_C UPB_INLINE upb_func * upb_handlers_gethandler(const upb_handlers *h, upb_selector_t s)
Definition: upb.h:3903
#define UPB_BEGIN_EXTERN_C
Definition: upb.h:245
void upb_refcounted_ref(const upb_refcounted *r, const void *owner)
Definition: upb.c:3442
void upb_fielddef_setdefaultint32(upb_fielddef *f, int32_t val)
Definition: upb.c:1061
bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status)
Definition: upb.c:4177
FileDescriptorSet
Definition: descriptor_pb2.py:1623
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6903
#define UPB_STARTSTR_SELECTOR
Definition: upb.h:3968
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FieldDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6888
#define UPB_JSON_PRINTER_SIZE
Definition: upb.h:8509
void swap(JSRetainPtr< T > &a, JSRetainPtr< T > &b)
Definition: JSRetainPtr.h:179
UPB_INLINE bool upbdefs_google_protobuf_EnumDescriptorProto_is(const upb_msgdef *m)
Definition: upb.h:6779
void upb_handlerattr_uninit(upb_handlerattr *attr)
Definition: upb.c:2579
#define free
Definition: mbmalloc.h:50
TypeWithSize< 8 >::Int Int64
Definition: gtest-port.h:1492
To down_cast(From *f)
Definition: casts.h:81
const char * p
Definition: upb.h:7712
bool upb_fielddef_setnumber(upb_fielddef *f, uint32_t number, upb_status *s)
Definition: upb.c:885
uint64_t val
Definition: upb.h:7713
#define R(x)
Definition: mangle.cgi.c:21
ServiceDescriptorProto
Definition: descriptor_pb2.py:1688
bool upb_endmsg_handlerfunc(void *c, const void *, upb_status *status)
Definition: upb.h:3799
UPB_END_EXTERN_C typedef upb_inttable_iter upb_msg_field_iter
Definition: upb.h:1827
const upb_tabent * entries
Definition: upb.h:789
bool upb_fielddef_checkintfmt(int32_t fmt)
Definition: upb.c:1225
EnumDescriptorProto * AddEnum(FileDescriptorProto *file, const string &name)
Definition: descriptor_unittest.cc:81
#define UPB_PB_VARINT_MAX_LEN
Definition: upb.h:7991
int32_t upb_pbdecoder_checktag_slow(upb_pbdecoder *d, uint64_t expected)
Definition: upb.c:7952
DescriptorProto * AddMessage(FileDescriptorProto *file, const string &name)
Definition: descriptor_unittest.cc:69
UPB_INLINE bool upbdefs_google_protobuf_UninterpretedOption_is(const upb_msgdef *m)
Definition: upb.h:6830
#define UPB_ARENA_BLOCK_OVERHEAD
Definition: upb.h:556
void upb_msg_field_iter_setdone(upb_msg_field_iter *iter)
Definition: upb.c:1488
void * closure
Definition: upb.h:5546
EnumValueDescriptorProto
Definition: descriptor_pb2.py:1681
void * future1
Definition: upb.h:644
EGLImageKHR EGLint EGLint * handle
Definition: eglext.h:851
void upb_refcounted_visit(const upb_refcounted *r, const upb_refcounted *subobj, void *closure)
Definition: upb.h:1175
const void * upb_handlerattr_closuretype(const upb_handlerattr *attr)
Definition: upb.c:2593
Type
Type of JSON value.
Definition: rapidjson.h:616
CFArrayRef CFTypeRef key
Definition: AVFoundationCFSoftLinking.h:129
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6945
bool upb_fielddef_hassubdef(const upb_fielddef *f)
Definition: upb.c:1215
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MessageOptions_f_uninterpreted_option(const upb_msgdef *m)
Definition: upb.h:6931
bool upb_fielddef_clearjsonname(upb_fielddef *f)
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_MethodDescriptorProto_f_server_streaming(const upb_msgdef *m)
Definition: upb.h:6937
bool upb_inttable_done(const upb_inttable_iter *i)
Definition: upb.c:4687
SubsamplingLevel & operator++(SubsamplingLevel &subsamplingLevel)
Definition: ImageFrame.h:51
Definition: WebKitWebViewSessionState.cpp:89
UPB_INLINE bool upb_msgdef_lookupnamez(const upb_msgdef *m, const char *name, const upb_fielddef **f, const upb_oneofdef **o)
Definition: upb.h:2611
void upb_refcounted_donateref(const upb_refcounted *r, const void *from, const void *to)
Definition: upb.c:3476
int upb_enumdef_numvals(const upb_enumdef *e)
Definition: upb.c:482
void upb_pbdecoder_jit(mgroup *group)
const upb_fielddef * upb_msgdef_itof(const upb_msgdef *m, uint32_t i)
Definition: upb.c:1437
constexpr __visitor_return_type< _Visitor, _Types... >::__type visit(_Visitor &&__visitor, Variant< _Types... > &__v)
Definition: Variant.h:1881
UPB_INLINE uint64_t upb_pbdecoder_packdispatch(uint64_t ofs, uint8_t wt1, uint8_t wt2)
Definition: upb.h:7634
bool upb_msgdef_mapentry(const upb_msgdef *m)
Definition: upb.c:1470
bool upb_fielddef_setmsgsubdef(upb_fielddef *f, const upb_msgdef *subdef, upb_status *s)
Definition: upb.c:1168
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_public_dependency(const upb_msgdef *m)
Definition: upb.h:6905
UPB_INLINE char * upb_tabstr(upb_tabkey key, uint32_t *len)
Definition: upb.h:690
const void * objtype_
Definition: upb.h:3390
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_f_span(const upb_msgdef *m)
Definition: upb.h:6949
bool upb_inttable_iter_isequal(const upb_inttable_iter *i1, const upb_inttable_iter *i2)
Definition: upb.c:4714
upb_descriptortype_t
Definition: upb.h:1465
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301
void swap(optional< T > &x, optional< T > &y) __NOEXCEPT_(__NOEXCEPT_(x.swap(y)))
Definition: Optional.h:1047
void upb_inttable_uninit2(upb_inttable *table, upb_alloc *a)
Definition: upb.c:4732
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_ServiceDescriptorProto_f_options(const upb_msgdef *m)
Definition: upb.h:6943
bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val, upb_alloc *a)
Definition: upb.c:4830
void upb_fielddef_setdefaultcstr(upb_fielddef *f, const char *str, upb_status *s)
Definition: upb.c:1115
UPB_INLINE bool upbdefs_google_protobuf_EnumValueOptions_is(const upb_msgdef *m)
Definition: upb.h:6788
bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, upb_handlerattr *attr)
bool upb_def_setfullname(upb_def *def, const char *fullname, upb_status *s)
Definition: upb.c:74
UPB_INLINE bool upbdefs_google_protobuf_DescriptorProto_ExtensionRange_is(const upb_msgdef *m)
Definition: upb.h:6773
void upb_env_free(upb_env *e, void *ptr)
Definition: upb.c:5463
upb_arena arena_
Definition: upb.h:732
uint64_t upb_pbdecoder_bytesparsed(const upb_pbdecoder *d)
Definition: upb.c:8455
#define d
Definition: float-mm.c:30
UPB_INLINE bool upbdefs_google_protobuf_MethodOptions_is(const upb_msgdef *m)
Definition: upb.h:6812
bool upb_msgdef_freeze(upb_msgdef *m, upb_status *status)
Definition: upb.c:1317
upb_deftype_t upb_def_type(const upb_def *d)
Definition: upb.c:70
bool upb_inttable_push(upb_inttable *t, upb_value val)
Definition: upb.c:4567
const char * upb_filedef_package(const upb_filedef *f)
Definition: upb.c:1993
bool upb_fielddef_istagdelim(const upb_fielddef *f)
Definition: upb.c:695
bool upb_handlers_setuint64(upb_handlers *h, const upb_fielddef *f, upb_uint64_handlerfunc *func, upb_handlerattr *attr)
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_get(const void *owner)
Definition: upb.c:6364
int32_t upb_pbdecoder_skipunknown(upb_pbdecoder *d, int32_t fieldnum, uint8_t wire_type)
Definition: upb.c:7969
upb_handlerattr attr
Definition: upb.h:3339
void upb_inttable_compact2(upb_inttable *t, upb_alloc *a)
Definition: upb.c:4845
GLuint GLsizei GLsizei * length
Definition: gl2.h:435
UPB_INLINE void upb_bufhandle_setbuf(upb_bufhandle *h, const char *buf, size_t ofs)
Definition: upb.h:3988
UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr)
Definition: upb.h:514
UPB_BEGIN_EXTERN_C void upb_env_init(upb_env *e)
Definition: upb.c:1803
#define UPB_STRING_SELECTOR
Definition: upb.h:3969
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_service(const upb_msgdef *m)
Definition: upb.h:6906
Definition: type_traits_unittest.cc:129
const char * buf_
Definition: upb.h:3388
void upb_inttable_next(upb_inttable_iter *i)
Definition: upb.c:4672
upb_msgdef * upb_fielddef_containingtype_mutable(upb_fielddef *f)
Definition: upb.c:727
bool upb_oneofdef_setname(upb_oneofdef *o, const char *name, upb_status *s)
Definition: upb.c:1574
#define PUTVAL(type, ctype)
Definition: upb.h:6082
EnumOptions
Definition: descriptor_pb2.py:1723
int32_t int32
Definition: angle_config.h:27
UPB_INLINE bool upb_filedef_addenum(upb_filedef *f, upb_enumdef *e, const void *ref_donor, upb_status *s)
Definition: upb.h:3027
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_package(const upb_msgdef *m)
Definition: upb.h:6904
const char * upb_enumdef_iton(const upb_enumdef *e, int32_t num)
Definition: upb.c:504
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_go_package(const upb_msgdef *m)
Definition: upb.h:6915
CVPixelBufferRef CVOptionFlags lockFlags CFAllocatorRef allocator
Definition: CoreVideoSoftLink.cpp:56
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileOptions_f_java_multiple_files(const upb_msgdef *m)
Definition: upb.h:6918
void upb_env_reporterrorsto(upb_env *e, upb_status *status)
Definition: upb.c:1843
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_UninterpretedOption_f_positive_int_value(const upb_msgdef *m)
Definition: upb.h:6959
#define UPB_STARTMSG_SELECTOR
Definition: upb.h:3963
bool upb_fielddef_checklabel(int32_t label)
Definition: upb.c:1223
const upb_enumdef * upbdefs_google_protobuf_FieldOptions_CType_get(const void *owner)
Definition: upb.c:6389
UPB_INLINE const upb_fielddef * upb_oneofdef_ntofz(const upb_oneofdef *o, const char *name)
Definition: upb.h:2423
void * upb_pbdecoder_startbc(void *closure, const void *pc, size_t size_hint)
Definition: upb.c:8317
const upb_msgdef * upbdefs_google_protobuf_MessageOptions_get(const void *owner)
Definition: upb.c:6376
GLboolean r
Definition: gl2ext.h:306
upb_tabval val
Definition: upb.h:768
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_FileDescriptorProto_f_name(const upb_msgdef *m)
Definition: upb.h:6902
#define UPB_DISALLOW_POD_OPS(class_name, full_class_name)
Definition: upb.h:167
const char * upb_def_fullname(const upb_def *d)
Definition: upb.c:72
bool upb_fielddef_haspresence(const upb_fielddef *f)
Definition: upb.c:1354
void upb_fielddef_setdefaultint64(upb_fielddef *f, int64_t val)
Definition: upb.c:1056
const upb_msgdef * upb_fielddef_containingtype(const upb_fielddef *f)
Definition: upb.c:719
UPB_INLINE char * upb_gstrdup(const char *s)
Definition: upb.h:822
unsigned long Add(unsigned long a, unsigned long b)
Definition: mod_ops.h:22
google_protobuf_FileOptions_OptimizeMode
Definition: upb.h:6281
upb_handlertype_t
Definition: upb.h:3230
UPB_INLINE const upb_fielddef * upbdefs_google_protobuf_SourceCodeInfo_Location_f_path(const upb_msgdef *m)
Definition: upb.h:6948