Go to the documentation of this file.
2 #define _XOPEN_SOURCE 700
5 #if UINTPTR_MAX == 0xffffffff
6 #define UPB_SIZE(size32, size64) size32
8 #define UPB_SIZE(size32, size64) size64
11 #define UPB_FIELD_AT(msg, fieldtype, offset) \
12 *(fieldtype*)((const char*)(msg) + offset)
14 #define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
15 UPB_FIELD_AT(msg, int, case_offset) == case_val \
16 ? UPB_FIELD_AT(msg, fieldtype, offset) \
19 #define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
20 UPB_FIELD_AT(msg, int, case_offset) = case_val; \
21 UPB_FIELD_AT(msg, fieldtype, offset) = value;
159 {8,
UPB_SIZE(72, 112), 10, 0, 11, 1},
277 {11,
UPB_SIZE(44, 64), 13, 0, 9, 1},
285 {36,
UPB_SIZE(52, 80), 14, 0, 9, 1},
286 {37,
UPB_SIZE(60, 96), 15, 0, 9, 1},
287 {39,
UPB_SIZE(68, 112), 16, 0, 9, 1},
288 {40,
UPB_SIZE(76, 128), 17, 0, 9, 1},
289 {41,
UPB_SIZE(84, 144), 18, 0, 9, 1},
290 {42,
UPB_SIZE(24, 24), 10, 0, 8, 1},
291 {999,
UPB_SIZE(92, 160), 0, 0, 11, 3},
329 {999,
UPB_SIZE(28, 32), 0, 0, 11, 3},
405 {999,
UPB_SIZE(20, 24), 0, 0, 11, 3},
536 int32_t group_number;
543 #define CHK(x) if (!(x)) { return false; }
548 int group_number,
char *msg,
555 const char *
p = *ptr;
559 CHK(bitpos < 70 &&
p < limit);
561 *
val |= (uint64_t)(
byte & 0x7F) << bitpos;
564 }
while (
byte & 0x80);
580 CHK(limit - *ptr >= 8);
581 memcpy(
val, *ptr, 8);
588 CHK(limit - *ptr >= 4);
589 memcpy(
val, *ptr, 4);
595 int *field_number,
int *wire_type) {
598 *field_number = tag >> 3;
599 *wire_type = tag & 7;
604 return (
n >> 1) ^ -(int32_t)(
n & 1);
608 return (
n >> 1) ^ -(int64_t)(
n & 1);
617 limit - *ptr >= (int32_t)
len);
625 memcpy((
char*)msg + ofs, &
val,
sizeof(
val));
635 int field_number,
int wire_type) {
664 size_t needed = arr->
len + elements;
671 while (new_size < needed) {
680 arr->
data = new_data;
681 arr->
size = new_size;
686 if (arr->
size - arr->
len < elements) {
694 arr->
len += elements;
722 int32_t hasbit =
field->presence;
724 frame->
msg[hasbit / 8] |= (1 << (hasbit % 8));
735 char *field_mem = frame->
msg +
field->offset;
752 }
else if (
field->presence < 0) {
754 }
else if (
field->presence > 0) {
764 char *submsg = *(
void **)submsg_slot;
773 *(
void**)submsg_slot = submsg;
782 const char *field_start,
794 memcpy(field_mem, &
val,
sizeof(
val));
799 uint32_t val32 =
val;
800 memcpy(field_mem, &val32,
sizeof(val32));
804 bool valbool =
val != 0;
805 memcpy(field_mem, &valbool,
sizeof(valbool));
810 memcpy(field_mem, &decoded,
sizeof(decoded));
815 memcpy(field_mem, &decoded,
sizeof(decoded));
827 const char *field_start,
840 memcpy(field_mem, &
val,
sizeof(
val));
851 const char *field_start,
864 memcpy(field_mem, &
val,
sizeof(
val));
876 int elements =
data.size / elem_size;
879 CHK((
size_t)(elements * elem_size) ==
data.size);
882 memcpy(field_mem,
data.data,
data.size);
887 const char *field_start,
892 #define VARINT_CASE(ctype, decode) { \
893 const char *ptr = val.data; \
894 const char *limit = ptr + val.size; \
895 while (ptr < limit) { \
899 CHK(upb_decode_varint(&ptr, limit, &val)); \
900 decoded = (decode)(val); \
901 field_mem = upb_array_add(arr, 1); \
903 memcpy(field_mem, &decoded, sizeof(ctype)); \
913 memcpy(field_mem, &
val,
sizeof(
val));
955 *(
void**)field_mem = submsg;
968 const char *field_start,
982 memcpy(field_mem, &
val,
sizeof(
val));
1000 uint32_t field_number) {
1015 const char *field_start =
d->ptr;
1022 switch (wire_type) {
1042 CHK(field_number != 0);
1050 const char *limit) {
1055 frame.
limit = limit;
1057 while (
d->ptr < frame.
limit) {
1069 int group_number,
char *msg,
1073 frame.
limit = limit;
1077 while (
d->ptr < frame.
limit) {
1105 if (!ret)
return NULL;
1116 return c >= low && c <= high;
1130 for (
i = 0;
i <
len;
i++) {
1133 if (
start || !full) {
1141 s,
"invalid name: path components must start with a letter (%s)",
1183 if (
d->fullname ==
NULL) {
1185 }
else if ((
p = strrchr(
d->fullname,
'.')) ==
NULL) {
1196 if (!
upb_isident(fullname, strlen(fullname),
true,
s)) {
1215 const void *owner) {
1230 return name ?
name :
"(anonymous)";
1239 if (!
f->type_is_set_) {
1247 "only length-delimited submessage fields may be lazy");
1254 if (
f->subdef_is_symbolic) {
1261 if (subdef ==
NULL) {
1269 "subdef of field %s.%s is not frozen or being frozen",
1287 UPB_ASSERT(has_default_name || has_default_number);
1289 if (!has_default_name) {
1291 "enum default for field %s.%s (%d) is not in the enum",
1297 if (!has_default_number) {
1299 "enum default for field %s.%s (%s) is not in the enum",
1317 "Field %s refers to mapentry message but is not "
1342 const uint32_t high_bit = 1 << 30;
1367 m->submsg_field_count = 0;
1377 m->submsg_field_count = 0;
1388 m->submsg_field_count++;
1396 for (
i = 0;
i <
n;
i++) {
1402 m->selector_count = selector;
1408 if (upb_handlers_getselector(f, type, &sel)) upb_inttable_insert(&t, sel, v);
1415 v = upb_value_bool(
true);
1462 if (!strcmp(
name,
"google.protobuf.Any")) {
1464 }
else if (!strcmp(
name,
"google.protobuf.FieldMask")) {
1466 }
else if (!strcmp(
name,
"google.protobuf.Duration")) {
1468 }
else if (!strcmp(
name,
"google.protobuf.Timestamp")) {
1470 }
else if (!strcmp(
name,
"google.protobuf.DoubleValue")) {
1472 }
else if (!strcmp(
name,
"google.protobuf.FloatValue")) {
1474 }
else if (!strcmp(
name,
"google.protobuf.Int64Value")) {
1476 }
else if (!strcmp(
name,
"google.protobuf.UInt64Value")) {
1478 }
else if (!strcmp(
name,
"google.protobuf.Int32Value")) {
1480 }
else if (!strcmp(
name,
"google.protobuf.UInt32Value")) {
1482 }
else if (!strcmp(
name,
"google.protobuf.BoolValue")) {
1484 }
else if (!strcmp(
name,
"google.protobuf.StringValue")) {
1486 }
else if (!strcmp(
name,
"google.protobuf.BytesValue")) {
1488 }
else if (!strcmp(
name,
"google.protobuf.Value")) {
1490 }
else if (!strcmp(
name,
"google.protobuf.ListValue")) {
1492 }
else if (!strcmp(
name,
"google.protobuf.Struct")) {
1504 for (
i = 0;
i <
n;
i++) {
1506 if (upb_def_isfrozen(def)) {
1510 }
else if (def->
type == UPB_DEF_FIELD) {
1517 if (def->
type == UPB_DEF_ENUM &&
1526 for (
i = 0;
i <
n;
i++) {
1529 upb_enumdef *e = upb_dyncast_enumdef_mutable(def);
1545 for (
i = 0;
i <
n;
i++) {
1573 const upb_def *def = upb_enumdef_upcast(e);
1597 if (!e)
return NULL;
1599 if (!
upb_def_init(upb_enumdef_upcast_mutable(e), UPB_DEF_ENUM,
1616 upb_def *
d = upb_enumdef_upcast_mutable(e);
1696 size_t len, int32_t *num) {
1701 if (num) *num = upb_value_getint32(
v);
1708 upb_value_getcstr(
v) :
NULL;
1725 if (
f->type_is_set_ &&
f->default_is_string &&
f->defaultval.bytes)
1736 const upb_def *def = upb_fielddef_upcast(
f);
1754 if (
f->subdef_is_symbolic)
1756 if (
f->msg_is_symbolic)
1766 if (
f->default_is_string &&
f->defaultval.bytes) {
1768 str_t *
s =
f->defaultval.bytes;
1771 if (!
f->default_is_string) {
1793 if (!
f->default_is_string) {
1795 *
val =
f->defaultval.sint;
1798 if (
f->defaultval.bytes) {
1800 str_t *
s =
f->defaultval.bytes;
1819 if (!
f)
return NULL;
1820 if (!
upb_def_init(upb_fielddef_upcast_mutable(
f), UPB_DEF_FIELD,
1828 f->subdef_is_symbolic =
false;
1829 f->msg_is_symbolic =
false;
1833 f->type_is_set_ =
false;
1834 f->tagdelim =
false;
1835 f->is_extension_ =
false;
1852 return f->type_is_set_;
1881 return f->is_extension_;
1899 bool ucase_next =
false;
1901 #define WRITE(byte) \
1903 if (dst < len) buf[dst - 1] = byte; \
1904 else if (dst == len) buf[dst - 1] = '\0'
1936 return f->msg_is_symbolic ?
NULL :
f->msg.def;
1948 return f->msg_is_symbolic ?
f->msg.name :
NULL;
1973 f->msg.name = name_copy;
1974 f->msg_is_symbolic =
true;
1994 return f->defaultval.sint;
2005 return f->defaultval.sint;
2011 return f->defaultval.uint;
2016 return f->defaultval.uint;
2021 return f->defaultval.uint;
2026 return f->defaultval.flt;
2031 return f->defaultval.dbl;
2044 if (
len) *
len = strlen(ret);
2048 if (
f->default_is_string) {
2058 f->default_is_string =
false;
2069 f->defaultval.bytes =
newstr(
"", 0);
2070 f->default_is_string =
true;
2075 f->default_is_string =
true;
2076 f->defaultval.bytes =
NULL;
2082 return f->subdef_is_symbolic ?
NULL :
f->sub.def;
2087 return def ? upb_dyncast_msgdef(def) :
NULL;
2092 return def ? upb_dyncast_enumdef(def) :
NULL;
2100 if (
f->subdef_is_symbolic) {
2102 }
else if (
f->sub.def) {
2112 s,
"cannot change field number after adding to a message");
2128 f->type_is_set_ =
true;
2234 f->is_extension_ = is_extension;
2244 f->packed_ = packed;
2261 f->tagdelim = tag_delim;
2262 f->tagdelim = tag_delim;
2266 if (!
f->type_is_set_ || upb_fielddef_isfrozen(
f) ||
2271 if (
f->default_is_string) {
2272 str_t *
s =
f->defaultval.bytes;
2276 f->default_is_string =
false;
2282 f->defaultval.sint =
value;
2289 f->defaultval.sint =
value;
2295 f->defaultval.uint =
value;
2300 f->defaultval.uint =
value;
2305 f->defaultval.uint =
value;
2310 f->defaultval.flt =
value;
2315 f->defaultval.dbl =
value;
2325 if (
f->default_is_string) {
2326 str_t *
s =
f->defaultval.bytes;
2334 f->defaultval.bytes = str2;
2335 f->default_is_string =
true;
2359 if (upb_dyncast_msgdef(subdef))
return true;
2363 if (upb_dyncast_enumdef(subdef))
return true;
2373 if (
f->subdef_is_symbolic) {
2375 }
else if (
f->sub.def) {
2386 f->sub.def = subdef;
2387 f->subdef_is_symbolic =
false;
2420 f->sub.name = name_copy;
2421 f->subdef_is_symbolic =
true;
2453 if (
f->msg_is_symbolic || !
f->msg.def)
return true;
2461 static bool between(int32_t
x, int32_t low, int32_t high) {
2462 return x >= low &&
x <= high;
2479 const upb_def *def = upb_msgdef_upcast(
m);
2485 visit(
r, upb_fielddef_upcast2(
f), closure);
2491 visit(
r, upb_oneofdef_upcast(
f), closure);
2510 if (!
m)
return NULL;
2519 m->map_entry =
false;
2531 upb_def *
d = upb_msgdef_upcast_mutable(
m);
2584 f->msg_is_symbolic =
false;
2589 if (ref_donor) upb_fielddef_unref(
f, ref_donor);
2608 if (ref_donor) upb_fielddef_unref(
f, ref_donor);
2665 if (ref_donor) upb_oneofdef_unref(o, ref_donor);
2724 m->map_entry = map_entry;
2728 return m->map_entry;
2732 return m->well_known_type;
2796 visit(
r, upb_fielddef_upcast2(
f), closure);
2877 const void *ref_donor,
2946 if (ref_donor) upb_fielddef_unref(
f, ref_donor);
3024 f->phpprefix =
NULL;
3025 f->phpnamespace =
NULL;
3061 return f->phpprefix;
3065 return f->phpnamespace;
3084 return upb_value_getconstptr(
v);
3094 return upb_value_getconstptr(
v);
3114 package = upb_gstrdup(package);
3132 f->phpprefix = phpprefix;
3139 if (!phpnamespace) {
3144 f->phpnamespace = phpnamespace;
3187 if (ref_donor) upb_def_unref(def, ref_donor);
3188 if (def->
type == UPB_DEF_MSG) {
3189 upb_downcast_msgdef_mutable(def)->syntax =
f->syntax;
3201 upb_filedef_ref(dep,
f);
3213 upb_def_unref(def,
s);
3232 upb_value_getptr(
v) :
NULL;
3239 upb_value_getptr(
v) :
NULL;
3240 return def ? upb_dyncast_msgdef(def) :
NULL;
3247 upb_value_getptr(
v) :
NULL;
3248 return def ? upb_dyncast_msgdef(def) :
NULL;
3254 upb_value_getptr(
v) :
NULL;
3255 return def ? upb_dyncast_enumdef(def) :
NULL;
3261 const char *
base,
const char *sym) {
3262 if(strlen(sym) == 0)
return NULL;
3293 size_t add_objs_size;
3296 if (
n == 0 && !freeze_also) {
3306 for (
i = 0;
i <
n;
i++) {
3308 const char *fullname;
3311 if (upb_def_isfrozen(def)) {
3319 status,
"Anonymous defs cannot be added to a symtab");
3323 f = upb_dyncast_fielddef_mutable(def);
3328 "Standalone fielddefs must have a containing type "
3329 "(extendee) name set");
3344 upb_def_donateref(def, ref_donor,
s);
3347 if (upb_dyncast_fielddef_mutable(def)) {
3375 if (subdef ==
NULL) {
3378 if (subdef ==
NULL) {
3380 status,
"couldn't resolve name '%s' in message '%s'",
name,
base);
3396 add_defs =
upb_gmalloc(
sizeof(
void*) * add_objs_size);
3397 if (add_defs ==
NULL)
goto oom_err;
3414 add_objs[freeze_n++] = freeze_also;
3428 for (
i = 0;
i < add_n;
i++) {
3445 upb_def_donateref(def,
s, ref_donor);
3476 for (
i = 0;
i <
n;
i++) {
3480 ret =
symtab_add(
s, defs,
n,
NULL, upb_filedef_upcast_mutable(file), status);
3489 if (iter->
type == UPB_DEF_ANY)
3520 #define UPB_PB_VARINT_MAX_LEN 10
3521 #define CHK(x) do { if (!(x)) { return false; } } while(0)
3548 if (
val < 128) {
buf[0] =
val;
return 1; }
3551 uint8_t
byte =
val & 0x7fU;
3553 if (
val)
byte |= 0x80U;
3564 char *
buf, *ptr, *limit;
3569 while (ret <
bytes) {
3576 size_t old_size = e->
limit - e->
buf;
3582 memmove(new_buf + new_size - old_size, e->
buf, old_size);
3584 e->
ptr = new_buf + new_size - (e->
limit - e->
ptr);
3585 e->
limit = new_buf + new_size;
3630 UPB_ASSERT(
sizeof(
double) ==
sizeof(uint64_t));
3631 memcpy(&u64, &
d,
sizeof(uint64_t));
3637 UPB_ASSERT(
sizeof(
float) ==
sizeof(uint32_t));
3638 memcpy(&u32, &
d,
sizeof(uint32_t));
3644 uint32_t
offset = ~
f->presence;
3645 memcpy(&ret, msg +
offset,
sizeof(ret));
3650 uint32_t hasbit =
f->presence;
3652 return msg[hasbit / 8] & (1 << (hasbit % 8));
3673 if (arr ==
NULL || arr->
len == 0) {
3679 #define VARINT_CASE(ctype, encode) { \
3680 ctype *start = arr->data; \
3681 ctype *ptr = start + arr->len; \
3682 size_t pre_len = e->limit - e->ptr; \
3685 CHK(upb_put_varint(e, encode)); \
3686 } while (ptr != start); \
3687 CHK(upb_put_varint(e, e->limit - e->ptr - pre_len)); \
3692 switch (
f->descriptortype) {
3730 }
while (ptr !=
start);
3743 }
while (ptr !=
start);
3756 }
while (ptr !=
start);
3771 bool skip_zero_value) {
3772 #define CASE(ctype, type, wire_type, encodeval) do { \
3773 ctype val = *(ctype*)field_mem; \
3774 if (skip_zero_value && val == 0) { \
3777 return upb_put_ ## type(e, encodeval) && \
3778 upb_put_tag(e, f->number, wire_type); \
3781 switch (
f->descriptortype) {
3809 if (skip_zero_value && view.
size == 0) {
3818 void *submsg = *(
void **)field_mem;
3820 if (submsg ==
NULL) {
3829 void *submsg = *(
void **)field_mem;
3831 if (submsg ==
NULL) {
3846 size_t pre_len = e->
limit - e->
ptr;
3847 const char *unknown;
3848 size_t unknown_size;
3850 for (
i =
m->field_count - 1;
i >= 0;
i--) {
3856 bool skip_empty =
false;
3857 if (
f->presence == 0) {
3860 }
else if (
f->presence > 0) {
3922 memset(mem, 0,
size);
3944 upb_msgdef_unref(
h->msg,
h);
3960 if (sub)
visit(
r, upb_handlers_upcast(sub), closure);
3979 if (!
h)
return NULL;
3982 s->callback(
s->closure,
h);
4000 if (!sub_mh)
goto oom;
4002 upb_handlers_unref(sub_mh, &sub_mh);
4008 upb_handlers_unref(
h, owner);
4014 #define SUBH(h, selector) (h->sub[selector])
4017 #define SUBH_F(h, f) SUBH(h, f->index_)
4025 &
h->status_,
"type mismatch: field %s does not belong to message %s",
4032 "type mismatch: cannot register handler type %d for field %s",
4055 const void *closure_type;
4056 const void **context_closure_type;
4062 "incorrect handler type for this field.");
4066 if (
h->table[sel].func) {
4068 "cannot change handler once it has been set.");
4087 context_closure_type = &
h->top_closure_type;
4090 if (closure_type && *context_closure_type &&
4091 closure_type != *context_closure_type) {
4095 "closure type does not match for field %s",
4099 &
h->status_,
"closure type does not match for message-level handler");
4105 *context_closure_type = closure_type;
4111 const void *table_return_type =
4113 if (return_type && table_return_type && return_type != table_return_type) {
4118 if (table_return_type && !return_type)
4123 h->table[sel].attr = set_attr;
4139 ret =
h->top_closure_type;
4168 const void *closure_type;
4170 const void *return_closure_type;
4173 if (
h->table[sel].func)
return true;
4175 attr = &
h->table[sel].attr;
4177 if (closure_type && return_closure_type &&
4178 closure_type != return_closure_type) {
4180 "expected start handler to return sub type for field %f",
4197 if (!
h)
return NULL;
4200 upb_msgdef_ref(
h->msg,
h);
4205 if (!
h->sub)
goto oom;
4225 const void *closure) {
4238 if (!ret)
return NULL;
4240 r = upb_handlers_upcast_mutable(ret);
4257 #define SETTER(name, handlerctype, handlertype) \
4258 bool upb_handlers_set ## name(upb_handlers *h, const upb_fielddef *f, \
4259 handlerctype func, upb_handlerattr *attr) { \
4260 int32_t sel = trygetsel(h, f, handlertype); \
4261 return doset(h, sel, f, handlertype, (upb_func*)func, attr); \
4324 *attr =
h->table[sel].attr;
4352 for (
i = 0;
i <
n;
i++) {
4381 bool hashandler =
false;
4415 upb_handlers_unref(sub, &sub);
4460 *
s =
f->selector_base;
4464 *
s =
f->selector_base;
4466 *
s =
f->selector_base + 3;
4473 *
s =
f->selector_base + 1;
4480 *
s =
f->selector_base + 2;
4487 *
s =
f->selector_base - 2;
4491 *
s =
f->selector_base - 1;
4503 *
s =
f->selector_base;
4534 memcpy(attr, &from,
sizeof(*attr));
4583 memset(
h, 0,
sizeof(*
h));
4621 #define MSG_WRITER(type, ctype) \
4622 bool upb_msg_set ## type (void *c, const void *hd, ctype val) { \
4624 const upb_msg_handlerdata *d = hd; \
4625 if (d->hasbit > 0) \
4626 *(uint8_t*)&m[d->hasbit / 8] |= 1 << (d->hasbit % 8); \
4627 *(ctype*)&m[d->offset] = val; \
4640 size_t offset, int32_t hasbit) {
4645 if (!
d)
return false;
4653 #define TYPE(u, l) \
4654 case UPB_TYPE_##u: \
4655 ok = upb_handlers_set##l(h, f, upb_msg_set##l, &attr); break;
4665 TYPE(DOUBLE,
double);
4704 *hasbit =
d->hasbit;
4715 #define PTR_AT(msg, ofs, type) (type*)((char*)msg + ofs)
4716 #define VOIDPTR_AT(msg, ofs) PTR_AT(msg, ofs, void)
4717 #define ENCODE_MAX_NESTING 64
4718 #define CHECK_TRUE(x) if (!(x)) { return false; }
4722 #define upb_alignof(t) offsetof(struct { char c; t x; }, x)
4755 return sizeof(
void*);
4765 return sizeof(
void*);
4812 #define DEREF(msg, ofs, type) *PTR_AT(msg, ofs, type)
4825 size_t unknown_size;
4873 UPB_ASSERT(field_index >= 0 && field_index < l->field_count);
4874 return &l->
fields[field_index];
4878 return field->presence < 0;
4905 memset(msg, 0, l->
size);
4937 uint32_t hasbit =
field->presence;
4938 return DEREF(msg, hasbit / 8,
char) | (1 << (hasbit % 8));
4959 #define DEREF_ARR(arr, i, type) ((type*)arr->data)[i]
4995 if (
i == arr->
len) {
4998 if (
i == arr->
size) {
5011 arr->
data = new_data;
5012 arr->
size = new_size;
5035 const char **out_key,
size_t *out_len) {
5039 *out_key =
key->str.data;
5040 *out_len =
key->str.size;
5048 *out_key = (
const char*)
key;
5093 map->key_type = ktype;
5094 map->val_type = vtype;
5109 return map->key_type;
5113 return map->val_type;
5118 const char *key_str;
5125 memcpy(
val, &tabval,
sizeof(tabval));
5133 const char *key_str;
5144 memcpy(&removed, &removedtabval,
sizeof(removed));
5151 const char *key_str;
5173 i->key_type =
map->key_type;
5218 return (
val & (
val - 1)) == 0;
5224 return (
val + align - 1) & ~(align - 1);
5228 return (
n +
d - 1) /
d;
5245 return sizeof(
void*);
5255 return sizeof(
void*);
5283 size_t submsg_count = 0;
5296 memset(l, 0,
sizeof(*l));
5299 submsgs =
upb_gmalloc(submsg_count *
sizeof(*submsgs));
5302 (!submsgs && submsg_count)) {
5337 field->submsg_index = submsg_count++;
5338 submsgs[
field->submsg_index] = sub_layout;
5342 field->presence = (hasbit++);
5344 field->presence = 0;
5373 size_t case_size =
sizeof(uint32_t);
5374 size_t field_size = 0;
5375 uint32_t case_offset;
5376 uint32_t data_offset;
5436 upb_handlers_unref(
h,
f);
5456 return upb_value_getptr(
v);
5470 #if UINTPTR_MAX == 0xffffffff
5471 #define UPB_SIZE(size32, size64) size32
5473 #define UPB_SIZE(size32, size64) size64
5476 #define UPB_FIELD_AT(msg, fieldtype, offset) \
5477 *(fieldtype*)((const char*)(msg) + offset)
5479 #define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
5480 UPB_FIELD_AT(msg, int, case_offset) == case_val \
5481 ? UPB_FIELD_AT(msg, fieldtype, offset) \
5484 #define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
5485 UPB_FIELD_AT(msg, int, case_offset) = case_val; \
5486 UPB_FIELD_AT(msg, fieldtype, offset) = value;
5490 #undef UPB_READ_ONEOF
5491 #undef UPB_WRITE_ONEOF
5519 #ifdef UPB_THREAD_UNSAFE
5521 static void atomic_inc(uint32_t *
a) { (*a)++; }
5522 static bool atomic_dec(uint32_t *
a) {
return --(*a) == 0; }
5524 #elif defined(__GNUC__) || defined(__clang__)
5526 static void atomic_inc(uint32_t *
a) { __sync_fetch_and_add(
a, 1); }
5527 static bool atomic_dec(uint32_t *
a) {
return __sync_sub_and_fetch(
a, 1) == 0; }
5529 #elif defined(WIN32)
5531 #include <Windows.h>
5533 static void atomic_inc(upb_atomic_t *
a) { InterlockedIncrement(&
a->val); }
5534 static bool atomic_dec(upb_atomic_t *
a) {
5535 return InterlockedDecrement(&
a->val) == 0;
5539 #error Atomic primitives not defined for your platform/CPU. \
5540 Implement them or compile with UPB_THREAD_UNSAFE.
5560 return atomic_dec(
group);
5567 #ifdef UPB_DEBUG_REFS
5569 #ifdef UPB_THREAD_UNSAFE
5571 static void upb_lock() {}
5572 static void upb_unlock() {}
5592 static void *upb_debugrefs_allocfunc(
upb_alloc *alloc,
void *ptr,
5593 size_t oldsize,
size_t size) {
5600 void *ret = realloc(ptr,
size);
5610 upb_alloc upb_alloc_debugrefs = {&upb_debugrefs_allocfunc};
5617 static trackedref *trackedref_new(
bool is_ref2) {
5618 trackedref *ret =
upb_malloc(&upb_alloc_debugrefs,
sizeof(*ret));
5620 ret->is_ref2 = is_ref2;
5632 trackedref *
ref = upb_value_getptr(
v);
5642 trackedref *
ref = trackedref_new(ref2);
5644 &upb_alloc_debugrefs);
5651 &upb_alloc_debugrefs);
5669 ref = upb_value_getptr(
v);
5671 if (--
ref->count == 0) {
5693 ref = upb_value_getptr(
v);
5716 ref = upb_value_getptr(
v);
5717 count = upb_value_int32(
ref->count);
5731 check_state *
s = closure;
5743 newcount = upb_value_getint32(
v) - 1;
5746 &upb_alloc_debugrefs);
5758 getref2s(
r, &state.ref2);
5761 if (
r->vtbl->visit)
r->vtbl->visit(
r, visit_check, &state);
5766 if (
r->vtbl->visit)
r->vtbl->visit(
r,
v, closure);
5770 r->refs =
upb_malloc(&upb_alloc_debugrefs,
sizeof(*
r->refs));
5771 r->ref2s =
upb_malloc(&upb_alloc_debugrefs,
sizeof(*
r->ref2s));
5779 upb_free(&upb_alloc_debugrefs,
r->refs);
5780 upb_free(&upb_alloc_debugrefs,
r->ref2s);
5813 if (
r->vtbl->visit)
r->vtbl->visit(
r,
v, closure);
5865 upb_value_getuint64(
v) : 0;
5872 return upb_value_getuint64(
v);
5895 if (++t->
index == 0x80000000) {
5927 return (
getattr(t,
r) >> 2) & 0x7FFFFFFF;
5952 return upb_value_getptr(
v);
5958 uint64_t leader_slot;
5963 leader_slot = (
getattr(t,
r) >> 8) + 1;
5966 if (upb_value_getptr(
v)) {
5967 return upb_value_getptr(
v);
6035 volatile bool ret =
false;
6050 if (setjmp(t.
err) != 0)
goto err4;
6053 for (
i = 0;
i <
n;
i++) {
6105 if (move == leader) {
6115 leader->
next = move;
6143 if (
obj->group ==
NULL || *
obj->group == 0) {
6185 return r->group == r2->
group;
6203 do { from->
group =
r->group; }
while ((from = from->
next) !=
base);
6255 const void *owner) {
6261 #ifdef UPB_BIG_ENDIAN
6270 r->individual_count = 0;
6271 r->is_frozen =
false;
6273 if (!
r->group)
return false;
6281 return r->is_frozen;
6335 for (
i = 0;
i <
n;
i++) {
6338 ret =
freeze(roots,
n,
s, maxdepth);
6351 if (ret &&
len != 0) {
6380 size_t new_size = sink->
size;
6386 while (sink->
len +
len > new_size) {
6390 if (new_size != sink->
size) {
6392 sink->
size = new_size;
6395 memcpy(sink->
ptr + sink->
len, ptr,
len);
6439 #define UPB_MAXARRSIZE 16
6442 #define ARRAY_SIZE(x) \
6443 ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
6463 while (
v >>= 1) ret++;
6464 ret = pow2 ? ret : ret + 1;
6477 if (
len == SIZE_MAX)
return NULL;
6543 if (!t->
entries)
return false;
6573 if (eql(e->
key,
key))
return e;
6618 if (chain == mainpos_e) {
6622 mainpos_e->
next = new_e;
6628 *new_e = *mainpos_e;
6629 while (chain->
next != mainpos_e) {
6633 chain->
next = new_e;
6638 our_e->
key = tabkey;
6647 if (eql(chain->
key,
key)) {
6651 if (removed) *removed = chain->
key;
6671 if (removed) *removed =
rm->key;
6701 uint32_t
len = (uint32_t)
k2.str.len;
6704 memcpy(
str, &
len,
sizeof(uint32_t));
6705 memcpy(
str +
sizeof(uint32_t),
k2.str.str,
k2.str.len + 1);
6706 return (uintptr_t)
str;
6718 return len ==
k2.str.len && memcmp(
str,
k2.str.str,
len) == 0;
6722 return init(&t->
t, ctype, 2,
a);
6771 if (tabkey == 0)
return false;
6799 return &
i->t->t.entries[
i->index];
6808 i->index =
next(&
i->t->t,
i->index);
6834 i->index = SIZE_MAX;
6853 return k1 ==
k2.num;
6861 if (key < t->array_size) {
6881 #if defined(UPB_DEBUG_TABLE) && !defined(NDEBUG)
6899 if (!
init(&t->
t, ctype, hsize_lg2,
a))
return false;
6932 if (key < t->array_size) {
6969 if (!table_v)
return false;
6976 if (!table_v)
return false;
6983 if (key < t->array_size) {
7055 for (size_lg2 =
ARRAY_SIZE(counts) - 1; size_lg2 > 0; size_lg2--) {
7056 if (counts[size_lg2] == 0) {
7059 }
else if (arr_count >= (1 << size_lg2) *
MIN_DENSITY) {
7063 arr_count -= counts[size_lg2];
7070 size_t arr_size = max[size_lg2] + 1;
7072 size_t hash_size = hash_count ? (hash_count /
MAX_LOAD) + 1 : 0;
7073 size_t hashsize_lg2 =
log2ceil(hash_size);
7092 return &
i->t->t.entries[
i->index];
7097 return i->t->array[
i->index];
7103 i->array_part =
true;
7123 if (
i->array_part) {
7124 return i->index >=
i->t->array_size ||
7145 i->index = SIZE_MAX;
7146 i->array_part =
false;
7157 #ifdef UPB_UNALIGNED_READS_OK
7171 const uint32_t
m = 0x5bd1e995;
7172 const int32_t
r = 24;
7175 uint32_t
h = seed ^
len;
7178 const uint8_t *
data = (
const uint8_t *)
key;
7180 uint32_t k = *(uint32_t *)
data;
7195 case 3:
h ^=
data[2] << 16;
7196 case 2:
h ^=
data[1] << 8;
7217 #define MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
7220 const uint32_t
m = 0x5bd1e995;
7221 const int32_t
r = 24;
7222 const uint8_t *
data = (
const uint8_t *)
key;
7223 uint32_t
h = seed ^
len;
7224 uint8_t align = (uintptr_t)
data & 3;
7226 if(align && (
len >= 4)) {
7228 uint32_t t = 0,
d = 0;
7233 case 1: t |=
data[2] << 16;
7234 case 2: t |=
data[1] << 8;
7235 case 3: t |=
data[0];
7251 d = *(uint32_t *)
data;
7252 t = (t >> sr) | (
d << sl);
7272 case 3:
d |=
data[2] << 16;
7273 case 2:
d |=
data[1] << 8;
7274 case 1:
d |=
data[0];
7277 k = (t >> sr) | (
d << sl);
7287 case 3:
h ^=
data[2] << 16;
7288 case 2:
h ^=
data[1] << 8;
7293 case 3:
d |=
data[2] << 16;
7294 case 2:
d |=
data[1] << 8;
7295 case 1:
d |=
data[0];
7296 case 0:
h ^= (t >> sr) | (
d << sl);
h *=
m;
7307 uint32_t k = *(uint32_t *)
data;
7319 case 3:
h ^=
data[2] << 16;
7320 case 2:
h ^=
data[1] << 8;
7354 const char *ellipsis =
"...";
7355 size_t len = strlen(ellipsis);
7357 memcpy(status->
msg +
sizeof(status->
msg) -
len, ellipsis,
len);
7374 if (!status)
return;
7377 status->
msg[0] =
'\0';
7391 if (!status)
return;
7392 status->
ok_ =
false;
7393 strncpy(status->
msg, msg,
sizeof(status->
msg));
7405 if (!status)
return;
7406 status->
ok_ =
false;
7407 _upb_vsnprintf(status->
msg,
sizeof(status->
msg),
fmt,
args);
7427 return realloc(ptr,
size);
7461 block->
next =
a->block_head;
7464 block->
owned = owned;
7466 a->block_head = block;
7481 a->next_block_size =
UPB_MIN(block_size * 2,
a->max_block_size);
7509 ret = (
char*)block + block->
used;
7513 memcpy(ret, ptr, oldsize);
7518 a->bytes_allocated +=
size;
7527 a->bytes_allocated = 0;
7528 a->next_block_size = 256;
7529 a->max_block_size = 16384;
7530 a->cleanup_head =
NULL;
7531 a->block_head =
NULL;
7542 a->block_alloc = alloc;
7568 a->cleanup_head =
NULL;
7569 a->block_head =
NULL;
7580 ent->
next =
a->cleanup_head;
7581 a->cleanup_head = ent;
7587 return a->bytes_allocated;
7677 #ifdef UPB_DEBUG_REFS
7682 UPB_MSGDEF_INIT(
"google.protobuf.DescriptorProto", 41, 8,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[0], 11, 10),
UPB_STRTABLE_INIT(10, 15,
UPB_CTYPE_PTR, 4, &
strentries[0]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[0], &reftables[1]),
7683 UPB_MSGDEF_INIT(
"google.protobuf.DescriptorProto.ExtensionRange", 5, 0,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[11], 3, 2),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[16]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[2], &reftables[3]),
7684 UPB_MSGDEF_INIT(
"google.protobuf.DescriptorProto.ReservedRange", 5, 0,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[14], 3, 2),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[20]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[4], &reftables[5]),
7685 UPB_MSGDEF_INIT(
"google.protobuf.EnumDescriptorProto", 12, 2,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[17], 4, 3),
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_PTR, 2, &
strentries[24]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[6], &reftables[7]),
7686 UPB_MSGDEF_INIT(
"google.protobuf.EnumOptions", 9, 1,
UPB_INTTABLE_INIT(1, 1,
UPB_CTYPE_PTR, 1, &
intentries[0], &
arrays[21], 4, 2),
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_PTR, 2, &
strentries[28]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[8], &reftables[9]),
7687 UPB_MSGDEF_INIT(
"google.protobuf.EnumValueDescriptorProto", 9, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[25], 4, 3),
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_PTR, 2, &
strentries[32]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[10], &reftables[11]),
7688 UPB_MSGDEF_INIT(
"google.protobuf.EnumValueOptions", 8, 1,
UPB_INTTABLE_INIT(1, 1,
UPB_CTYPE_PTR, 1, &
intentries[2], &
arrays[29], 2, 1),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[36]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[12], &reftables[13]),
7689 UPB_MSGDEF_INIT(
"google.protobuf.FieldDescriptorProto", 24, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[31], 11, 10),
UPB_STRTABLE_INIT(10, 15,
UPB_CTYPE_PTR, 4, &
strentries[40]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[14], &reftables[15]),
7690 UPB_MSGDEF_INIT(
"google.protobuf.FieldOptions", 13, 1,
UPB_INTTABLE_INIT(1, 1,
UPB_CTYPE_PTR, 1, &
intentries[4], &
arrays[42], 11, 6),
UPB_STRTABLE_INIT(7, 15,
UPB_CTYPE_PTR, 4, &
strentries[56]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[16], &reftables[17]),
7691 UPB_MSGDEF_INIT(
"google.protobuf.FileDescriptorProto", 43, 6,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[53], 13, 12),
UPB_STRTABLE_INIT(12, 15,
UPB_CTYPE_PTR, 4, &
strentries[72]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[18], &reftables[19]),
7692 UPB_MSGDEF_INIT(
"google.protobuf.FileDescriptorSet", 7, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[66], 2, 1),
UPB_STRTABLE_INIT(1, 3,
UPB_CTYPE_PTR, 2, &
strentries[88]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[20], &reftables[21]),
7693 UPB_MSGDEF_INIT(
"google.protobuf.FileOptions", 38, 1,
UPB_INTTABLE_INIT(1, 1,
UPB_CTYPE_PTR, 1, &
intentries[6], &
arrays[68], 42, 17),
UPB_STRTABLE_INIT(18, 31,
UPB_CTYPE_PTR, 5, &
strentries[92]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[22], &reftables[23]),
7694 UPB_MSGDEF_INIT(
"google.protobuf.MessageOptions", 11, 1,
UPB_INTTABLE_INIT(1, 1,
UPB_CTYPE_PTR, 1, &
intentries[8], &
arrays[110], 8, 4),
UPB_STRTABLE_INIT(5, 7,
UPB_CTYPE_PTR, 3, &
strentries[124]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[24], &reftables[25]),
7695 UPB_MSGDEF_INIT(
"google.protobuf.MethodDescriptorProto", 16, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[118], 7, 6),
UPB_STRTABLE_INIT(6, 7,
UPB_CTYPE_PTR, 3, &
strentries[132]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[26], &reftables[27]),
7696 UPB_MSGDEF_INIT(
"google.protobuf.MethodOptions", 8, 1,
UPB_INTTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
intentries[10], &
arrays[125], 1, 0),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[140]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[28], &reftables[29]),
7697 UPB_MSGDEF_INIT(
"google.protobuf.OneofDescriptorProto", 6, 0,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[126], 2, 1),
UPB_STRTABLE_INIT(1, 3,
UPB_CTYPE_PTR, 2, &
strentries[144]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[30], &reftables[31]),
7698 UPB_MSGDEF_INIT(
"google.protobuf.ServiceDescriptorProto", 12, 2,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[128], 4, 3),
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_PTR, 2, &
strentries[148]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[32], &reftables[33]),
7699 UPB_MSGDEF_INIT(
"google.protobuf.ServiceOptions", 8, 1,
UPB_INTTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
intentries[14], &
arrays[132], 1, 0),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[152]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[34], &reftables[35]),
7700 UPB_MSGDEF_INIT(
"google.protobuf.SourceCodeInfo", 7, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[133], 2, 1),
UPB_STRTABLE_INIT(1, 3,
UPB_CTYPE_PTR, 2, &
strentries[156]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[36], &reftables[37]),
7701 UPB_MSGDEF_INIT(
"google.protobuf.SourceCodeInfo.Location", 20, 0,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[135], 7, 5),
UPB_STRTABLE_INIT(5, 7,
UPB_CTYPE_PTR, 3, &
strentries[160]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[38], &reftables[39]),
7702 UPB_MSGDEF_INIT(
"google.protobuf.UninterpretedOption", 19, 1,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[142], 9, 7),
UPB_STRTABLE_INIT(7, 15,
UPB_CTYPE_PTR, 4, &
strentries[168]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[40], &reftables[41]),
7703 UPB_MSGDEF_INIT(
"google.protobuf.UninterpretedOption.NamePart", 7, 0,
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_PTR, 0,
NULL, &
arrays[151], 3, 2),
UPB_STRTABLE_INIT(2, 3,
UPB_CTYPE_PTR, 2, &
strentries[184]),
false,
UPB_SYNTAX_PROTO2,
UPB_WELLKNOWN_UNSPECIFIED, &reftables[42], &reftables[43]),
7707 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"aggregate_value", 8, &
msgs[20],
NULL, 16, 6, {0},&reftables[44], &reftables[45]),
7708 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"allow_alias", 2, &
msgs[4],
NULL, 7, 1, {0},&reftables[46], &reftables[47]),
7709 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"cc_enable_arenas", 31, &
msgs[11],
NULL, 24, 12, {0},&reftables[48], &reftables[49]),
7710 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"cc_generic_services", 16, &
msgs[11],
NULL, 18, 6, {0},&reftables[50], &reftables[51]),
7711 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"client_streaming", 5, &
msgs[13],
NULL, 14, 4, {0},&reftables[52], &reftables[53]),
7712 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"csharp_namespace", 37, &
msgs[11],
NULL, 28, 14, {0},&reftables[54], &reftables[55]),
7713 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_ENUM, 0,
false,
false,
false,
false,
"ctype", 1, &
msgs[8], (
const upb_def*)(&
enums[2]), 7, 1, {0},&reftables[56], &reftables[57]),
7714 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"default_value", 7, &
msgs[7],
NULL, 17, 7, {0},&reftables[58], &reftables[59]),
7715 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"dependency", 3, &
msgs[9],
NULL, 31, 8, {0},&reftables[60], &reftables[61]),
7716 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 3, &
msgs[8],
NULL, 9, 3, {0},&reftables[62], &reftables[63]),
7717 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 33, &
msgs[14],
NULL, 7, 1, {0},&reftables[64], &reftables[65]),
7718 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 3, &
msgs[12],
NULL, 9, 3, {0},&reftables[66], &reftables[67]),
7719 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 23, &
msgs[11],
NULL, 22, 10, {0},&reftables[68], &reftables[69]),
7720 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 1, &
msgs[6],
NULL, 7, 1, {0},&reftables[70], &reftables[71]),
7721 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 3, &
msgs[4],
NULL, 8, 2, {0},&reftables[72], &reftables[73]),
7722 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"deprecated", 33, &
msgs[17],
NULL, 7, 1, {0},&reftables[74], &reftables[75]),
7723 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_DOUBLE, 0,
false,
false,
false,
false,
"double_value", 6, &
msgs[20],
NULL, 12, 4, {0},&reftables[76], &reftables[77]),
7724 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"end", 2, &
msgs[2],
NULL, 4, 1, {0},&reftables[78], &reftables[79]),
7725 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"end", 2, &
msgs[1],
NULL, 4, 1, {0},&reftables[80], &reftables[81]),
7726 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"enum_type", 5, &
msgs[9], (
const upb_def*)(&
msgs[3]), 14, 1, {0},&reftables[82], &reftables[83]),
7727 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"enum_type", 4, &
msgs[0], (
const upb_def*)(&
msgs[3]), 19, 2, {0},&reftables[84], &reftables[85]),
7728 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"extendee", 2, &
msgs[7],
NULL, 8, 2, {0},&reftables[86], &reftables[87]),
7729 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"extension", 6, &
msgs[0], (
const upb_def*)(&
msgs[7]), 25, 4, {0},&reftables[88], &reftables[89]),
7730 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"extension", 7, &
msgs[9], (
const upb_def*)(&
msgs[7]), 20, 3, {0},&reftables[90], &reftables[91]),
7731 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"extension_range", 5, &
msgs[0], (
const upb_def*)(&
msgs[1]), 22, 3, {0},&reftables[92], &reftables[93]),
7732 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"field", 2, &
msgs[0], (
const upb_def*)(&
msgs[7]), 13, 0, {0},&reftables[94], &reftables[95]),
7733 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"file", 1, &
msgs[10], (
const upb_def*)(&
msgs[9]), 6, 0, {0},&reftables[96], &reftables[97]),
7734 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"go_package", 11, &
msgs[11],
NULL, 15, 5, {0},&reftables[98], &reftables[99]),
7735 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"identifier_value", 3, &
msgs[20],
NULL, 7, 1, {0},&reftables[100], &reftables[101]),
7736 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"input_type", 2, &
msgs[13],
NULL, 8, 2, {0},&reftables[102], &reftables[103]),
7737 UPB_FIELDDEF_INIT(
UPB_LABEL_REQUIRED,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"is_extension", 2, &
msgs[21],
NULL, 6, 1, {0},&reftables[104], &reftables[105]),
7738 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"java_generate_equals_and_hash", 20, &
msgs[11],
NULL, 21, 9, {0},&reftables[106], &reftables[107]),
7739 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"java_generic_services", 17, &
msgs[11],
NULL, 19, 7, {0},&reftables[108], &reftables[109]),
7740 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"java_multiple_files", 10, &
msgs[11],
NULL, 14, 4, {0},&reftables[110], &reftables[111]),
7741 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"java_outer_classname", 8, &
msgs[11],
NULL, 10, 2, {0},&reftables[112], &reftables[113]),
7742 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"java_package", 1, &
msgs[11],
NULL, 7, 1, {0},&reftables[114], &reftables[115]),
7743 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"java_string_check_utf8", 27, &
msgs[11],
NULL, 23, 11, {0},&reftables[116], &reftables[117]),
7744 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"javanano_use_deprecated_package", 38, &
msgs[11],
NULL, 31, 15, {0},&reftables[118], &reftables[119]),
7745 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"json_name", 10, &
msgs[7],
NULL, 21, 9, {0},&reftables[120], &reftables[121]),
7746 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_ENUM, 0,
false,
false,
false,
false,
"jstype", 6, &
msgs[8], (
const upb_def*)(&
enums[3]), 11, 5, {0},&reftables[122], &reftables[123]),
7747 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_ENUM, 0,
false,
false,
false,
false,
"label", 4, &
msgs[7], (
const upb_def*)(&
enums[0]), 12, 4, {0},&reftables[124], &reftables[125]),
7748 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"lazy", 5, &
msgs[8],
NULL, 10, 4, {0},&reftables[126], &reftables[127]),
7749 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"leading_comments", 3, &
msgs[19],
NULL, 9, 2, {0},&reftables[128], &reftables[129]),
7750 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"leading_detached_comments", 6, &
msgs[19],
NULL, 17, 4, {0},&reftables[130], &reftables[131]),
7751 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"location", 1, &
msgs[18], (
const upb_def*)(&
msgs[19]), 6, 0, {0},&reftables[132], &reftables[133]),
7752 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"map_entry", 7, &
msgs[12],
NULL, 10, 4, {0},&reftables[134], &reftables[135]),
7753 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"message_set_wire_format", 1, &
msgs[12],
NULL, 7, 1, {0},&reftables[136], &reftables[137]),
7754 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"message_type", 4, &
msgs[9], (
const upb_def*)(&
msgs[0]), 11, 0, {0},&reftables[138], &reftables[139]),
7755 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"method", 2, &
msgs[16], (
const upb_def*)(&
msgs[13]), 7, 0, {0},&reftables[140], &reftables[141]),
7756 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"name", 2, &
msgs[20], (
const upb_def*)(&
msgs[21]), 6, 0, {0},&reftables[142], &reftables[143]),
7757 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[5],
NULL, 5, 1, {0},&reftables[144], &reftables[145]),
7758 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[9],
NULL, 23, 6, {0},&reftables[146], &reftables[147]),
7759 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[3],
NULL, 9, 2, {0},&reftables[148], &reftables[149]),
7760 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[16],
NULL, 9, 2, {0},&reftables[150], &reftables[151]),
7761 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[15],
NULL, 3, 0, {0},&reftables[152], &reftables[153]),
7762 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[13],
NULL, 5, 1, {0},&reftables[154], &reftables[155]),
7763 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[7],
NULL, 5, 1, {0},&reftables[156], &reftables[157]),
7764 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name", 1, &
msgs[0],
NULL, 33, 8, {0},&reftables[158], &reftables[159]),
7765 UPB_FIELDDEF_INIT(
UPB_LABEL_REQUIRED,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"name_part", 1, &
msgs[21],
NULL, 3, 0, {0},&reftables[160], &reftables[161]),
7766 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT64,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"negative_int_value", 5, &
msgs[20],
NULL, 11, 3, {0},&reftables[162], &reftables[163]),
7767 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"nested_type", 3, &
msgs[0], (
const upb_def*)(&
msgs[0]), 16, 1, {0},&reftables[164], &reftables[165]),
7768 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"no_standard_descriptor_accessor", 2, &
msgs[12],
NULL, 8, 2, {0},&reftables[166], &reftables[167]),
7769 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"number", 3, &
msgs[7],
NULL, 11, 3, {0},&reftables[168], &reftables[169]),
7770 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"number", 2, &
msgs[5],
NULL, 8, 2, {0},&reftables[170], &reftables[171]),
7771 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"objc_class_prefix", 36, &
msgs[11],
NULL, 25, 13, {0},&reftables[172], &reftables[173]),
7772 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"oneof_decl", 8, &
msgs[0], (
const upb_def*)(&
msgs[15]), 29, 6, {0},&reftables[174], &reftables[175]),
7773 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"oneof_index", 9, &
msgs[7],
NULL, 20, 8, {0},&reftables[176], &reftables[177]),
7774 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_ENUM, 0,
false,
false,
false,
false,
"optimize_for", 9, &
msgs[11], (
const upb_def*)(&
enums[4]), 13, 3, {0},&reftables[178], &reftables[179]),
7775 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 7, &
msgs[0], (
const upb_def*)(&
msgs[12]), 26, 5, {0},&reftables[180], &reftables[181]),
7776 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 8, &
msgs[9], (
const upb_def*)(&
msgs[11]), 21, 4, {0},&reftables[182], &reftables[183]),
7777 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 8, &
msgs[7], (
const upb_def*)(&
msgs[8]), 4, 0, {0},&reftables[184], &reftables[185]),
7778 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 4, &
msgs[13], (
const upb_def*)(&
msgs[14]), 4, 0, {0},&reftables[186], &reftables[187]),
7779 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 3, &
msgs[16], (
const upb_def*)(&
msgs[17]), 8, 1, {0},&reftables[188], &reftables[189]),
7780 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 3, &
msgs[3], (
const upb_def*)(&
msgs[4]), 8, 1, {0},&reftables[190], &reftables[191]),
7781 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"options", 3, &
msgs[5], (
const upb_def*)(&
msgs[6]), 4, 0, {0},&reftables[192], &reftables[193]),
7782 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"output_type", 3, &
msgs[13],
NULL, 11, 3, {0},&reftables[194], &reftables[195]),
7783 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"package", 2, &
msgs[9],
NULL, 26, 7, {0},&reftables[196], &reftables[197]),
7784 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"packed", 2, &
msgs[8],
NULL, 8, 2, {0},&reftables[198], &reftables[199]),
7785 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
true,
"path", 1, &
msgs[19],
NULL, 5, 0, {0},&reftables[200], &reftables[201]),
7786 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"php_class_prefix", 40, &
msgs[11],
NULL, 32, 16, {0},&reftables[202], &reftables[203]),
7787 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"php_namespace", 41, &
msgs[11],
NULL, 35, 17, {0},&reftables[204], &reftables[205]),
7788 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_UINT64,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"positive_int_value", 4, &
msgs[20],
NULL, 10, 2, {0},&reftables[206], &reftables[207]),
7789 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"public_dependency", 10, &
msgs[9],
NULL, 36, 9, {0},&reftables[208], &reftables[209]),
7790 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"py_generic_services", 18, &
msgs[11],
NULL, 20, 8, {0},&reftables[210], &reftables[211]),
7791 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"reserved_name", 10, &
msgs[0],
NULL, 38, 9, {0},&reftables[212], &reftables[213]),
7792 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"reserved_range", 9, &
msgs[0], (
const upb_def*)(&
msgs[2]), 32, 7, {0},&reftables[214], &reftables[215]),
7793 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"server_streaming", 6, &
msgs[13],
NULL, 15, 5, {0},&reftables[216], &reftables[217]),
7794 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"service", 6, &
msgs[9], (
const upb_def*)(&
msgs[16]), 17, 2, {0},&reftables[218], &reftables[219]),
7795 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"source_code_info", 9, &
msgs[9], (
const upb_def*)(&
msgs[18]), 22, 5, {0},&reftables[220], &reftables[221]),
7796 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
true,
"span", 2, &
msgs[19],
NULL, 8, 1, {0},&reftables[222], &reftables[223]),
7797 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"start", 1, &
msgs[2],
NULL, 3, 0, {0},&reftables[224], &reftables[225]),
7798 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"start", 1, &
msgs[1],
NULL, 3, 0, {0},&reftables[226], &reftables[227]),
7799 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BYTES, 0,
false,
false,
false,
false,
"string_value", 7, &
msgs[20],
NULL, 13, 5, {0},&reftables[228], &reftables[229]),
7800 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"syntax", 12, &
msgs[9],
NULL, 40, 11, {0},&reftables[230], &reftables[231]),
7801 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"trailing_comments", 4, &
msgs[19],
NULL, 12, 3, {0},&reftables[232], &reftables[233]),
7802 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_ENUM, 0,
false,
false,
false,
false,
"type", 5, &
msgs[7], (
const upb_def*)(&
enums[1]), 13, 5, {0},&reftables[234], &reftables[235]),
7803 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_STRING, 0,
false,
false,
false,
false,
"type_name", 6, &
msgs[7],
NULL, 14, 6, {0},&reftables[236], &reftables[237]),
7804 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[12], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[238], &reftables[239]),
7805 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[17], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[240], &reftables[241]),
7806 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[11], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[242], &reftables[243]),
7807 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[14], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[244], &reftables[245]),
7808 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[8], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[246], &reftables[247]),
7809 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[6], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[248], &reftables[249]),
7810 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"uninterpreted_option", 999, &
msgs[4], (
const upb_def*)(&
msgs[20]), 6, 0, {0},&reftables[250], &reftables[251]),
7811 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_MESSAGE, 0,
false,
false,
false,
false,
"value", 2, &
msgs[3], (
const upb_def*)(&
msgs[5]), 7, 0, {0},&reftables[252], &reftables[253]),
7812 UPB_FIELDDEF_INIT(
UPB_LABEL_OPTIONAL,
UPB_TYPE_BOOL, 0,
false,
false,
false,
false,
"weak", 10, &
msgs[8],
NULL, 12, 6, {0},&reftables[254], &reftables[255]),
7813 UPB_FIELDDEF_INIT(
UPB_LABEL_REPEATED,
UPB_TYPE_INT32,
UPB_INTFMT_VARIABLE,
false,
false,
false,
false,
"weak_dependency", 11, &
msgs[9],
NULL, 39, 10, {0},&reftables[256], &reftables[257]),
7817 UPB_ENUMDEF_INIT(
"google.protobuf.FieldDescriptorProto.Label",
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_INT32, 2, &
strentries[188]),
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_CSTR, 0,
NULL, &
arrays[154], 4, 3), 0, &reftables[258], &reftables[259]),
7818 UPB_ENUMDEF_INIT(
"google.protobuf.FieldDescriptorProto.Type",
UPB_STRTABLE_INIT(18, 31,
UPB_CTYPE_INT32, 5, &
strentries[192]),
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_CSTR, 0,
NULL, &
arrays[158], 19, 18), 0, &reftables[260], &reftables[261]),
7819 UPB_ENUMDEF_INIT(
"google.protobuf.FieldOptions.CType",
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_INT32, 2, &
strentries[224]),
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_CSTR, 0,
NULL, &
arrays[177], 3, 3), 0, &reftables[262], &reftables[263]),
7820 UPB_ENUMDEF_INIT(
"google.protobuf.FieldOptions.JSType",
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_INT32, 2, &
strentries[228]),
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_CSTR, 0,
NULL, &
arrays[180], 3, 3), 0, &reftables[264], &reftables[265]),
7821 UPB_ENUMDEF_INIT(
"google.protobuf.FileOptions.OptimizeMode",
UPB_STRTABLE_INIT(3, 3,
UPB_CTYPE_INT32, 2, &
strentries[232]),
UPB_INTTABLE_INIT(0, 0,
UPB_CTYPE_CSTR, 0,
NULL, &
arrays[183], 4, 3), 0, &reftables[266], &reftables[267]),
8274 #ifdef UPB_DEBUG_REFS
8548 upb_msgdef_ref(
m, owner);
8553 upb_enumdef_ref(e, owner);
8601 return strlen(
str) ==
n && memcmp(
str,
buf,
n) == 0;
8627 #define UPB_MAX_MESSAGE_NESTING 64
8650 if (!ret)
return NULL;
8651 memcpy(ret,
buf,
n);
8700 index =
r->stack[
r->stack_len-1].start - 1;
8761 return upb_value_getptr(
val);
8815 package = upb_gstrndup(buf, n);
8836 const char *
buf,
size_t n,
8839 char *php_namespace;
8914 upb_fielddef_unref(
r->f,
r);
8937 r->saw_number =
false;
8938 r->saw_name =
false;
8958 r->saw_number =
true;
8967 if(!
r->saw_number || !
r->saw_name) {
9016 r->default_string =
NULL;
9026 bool success =
true;
9047 unsigned long val = strtoul(
str, &
end, 0);
9056 unsigned long long val = strtoul(
str, &
end, 0);
9081 if (strcmp(
str,
"false") == 0)
9083 else if (strcmp(
str,
"true") == 0)
9104 if (
r->default_string) {
9241 free(name_null_terminated);
9267 static size_t msg_name(
void *closure,
const void *hd,
const char *
buf,
9302 upb_fielddef_unref(
r->f,
r);
9347 #define F(msg, field) upbdefs_google_protobuf_ ## msg ## _f_ ## field(m)
9453 while (
r->stack_len > 0) {
9474 r->default_string =
NULL;
9486 return upb_value_getptr(
v);
9499 upb_msgdef_unref(
m, &
m);
9518 #ifdef UPB_DUMP_BYTECODE
9523 #define EMPTYLABEL -1
9530 #ifdef UPB_USE_JIT_X64
9554 g->bytecode_end =
NULL;
9564 if (
method->dest_handlers_) {
9589 upb_pbdecodermethod_unref(ret, &ret);
9604 return m->dest_handlers_;
9613 return m->is_native_;
9617 const upb_pbdecodermethodopts *opts,
const void *owner) {
9623 upb_pbdecodermethod_ref(ret, owner);
9664 switch (
getop(instr)) {
9673 switch (
getop(instruction)) {
9690 static int32_t
getofs(uint32_t instruction) {
9692 return (int32_t)instruction >> 8;
9694 return (int8_t)(instruction >> 8);
9698 static void setofs(uint32_t *instruction, int32_t ofs) {
9700 *instruction =
getop(*instruction) | ofs << 8;
9702 *instruction = (*instruction & ~0xff00) | ((ofs & 0xff) << 8);
9720 int ofs =
getofs(*codep);
9722 codep = ofs ? codep + ofs :
NULL;
9741 }
else if (
label < 0) {
9756 if (c->
pc ==
g->bytecode_end) {
9758 size_t oldsize =
g->bytecode_end -
g->bytecode;
9759 size_t newsize =
UPB_MAX(oldsize * 2, 64);
9761 g->bytecode =
upb_grealloc(
g->bytecode, oldsize *
sizeof(uint32_t),
9762 newsize *
sizeof(uint32_t));
9763 g->bytecode_end =
g->bytecode + newsize;
9764 c->
pc =
g->bytecode + ofs;
9775 uintptr_t ptr = (uintptr_t)va_arg(ap,
void*);
9778 if (
sizeof(uintptr_t) >
sizeof(uint32_t))
9779 put32(c, (uint64_t)ptr >> 32);
9792 case OP_PARSE_DOUBLE:
9793 case OP_PARSE_FLOAT:
9794 case OP_PARSE_INT64:
9795 case OP_PARSE_UINT64:
9796 case OP_PARSE_INT32:
9797 case OP_PARSE_FIXED64:
9798 case OP_PARSE_FIXED32:
9800 case OP_PARSE_UINT32:
9801 case OP_PARSE_SFIXED32:
9802 case OP_PARSE_SFIXED64:
9803 case OP_PARSE_SINT32:
9804 case OP_PARSE_SINT64:
9817 put32(c, va_arg(ap,
int));
9826 uint32_t instruction = op;
9827 int label = va_arg(ap,
int);
9829 put32(c, instruction);
9834 int label = va_arg(ap,
int);
9835 uint64_t tag = va_arg(ap, uint64_t);
9836 uint32_t instruction = op | (tag << 16);
9839 put32(c, instruction);
9843 int label = va_arg(ap,
int);
9844 uint64_t tag = va_arg(ap, uint64_t);
9847 put32(c, instruction);
9849 put32(c, tag >> 32);
9857 #if defined(UPB_USE_JIT_X64) || defined(UPB_DUMP_BYTECODE)
9861 #define EXPAND_AND_QUOTE(x) QUOTE(x)
9862 #define OPNAME(x) OP_##x
9863 #define OP(x) case OPNAME(x): return EXPAND_AND_QUOTE(OPNAME(x));
9864 #define T(x) OP(PARSE_##x)
9867 T(DOUBLE)
T(FLOAT)
T(INT64)
T(UINT64)
T(INT32)
T(FIXED64)
T(FIXED32)
9868 T(BOOL)
T(UINT32)
T(SFIXED32)
T(SFIXED64)
T(SINT32)
T(SINT64)
9869 OP(STARTMSG) OP(ENDMSG) OP(STARTSEQ) OP(ENDSEQ) OP(STARTSUBMSG)
9870 OP(ENDSUBMSG) OP(STARTSTR) OP(STRING) OP(ENDSTR) OP(CALL) OP(RET)
9871 OP(PUSHLENDELIM) OP(PUSHTAGDELIM) OP(SETDELIM) OP(CHECKDELIM)
9872 OP(BRANCH) OP(TAG1) OP(TAG2) OP(TAGN) OP(SETDISPATCH) OP(POP)
9873 OP(SETBIGGROUPNUM) OP(DISPATCH) OP(HALT)
9875 return "<unknown op>";
9882 #ifdef UPB_DUMP_BYTECODE
9884 static void dumpbc(uint32_t *
p, uint32_t *
end, FILE *
f) {
9889 fprintf(
f,
"%p %8tx",
p,
p -
begin);
9890 uint32_t instr = *
p++;
9891 uint8_t op =
getop(instr);
9914 case OP_PARSE_DOUBLE:
9915 case OP_PARSE_FLOAT:
9916 case OP_PARSE_INT64:
9917 case OP_PARSE_UINT64:
9918 case OP_PARSE_INT32:
9919 case OP_PARSE_FIXED64:
9920 case OP_PARSE_FIXED32:
9922 case OP_PARSE_UINT32:
9923 case OP_PARSE_SFIXED32:
9924 case OP_PARSE_SFIXED64:
9925 case OP_PARSE_SINT32:
9926 case OP_PARSE_SINT64:
9935 fprintf(
f,
" %d", instr >> 8);
9938 fprintf(
f,
" %d", *
p++);
9947 fprintf(
f,
" tag:0x%x", instr >> 16);
9954 uint64_t tag = *
p++;
9955 tag |= (uint64_t)*
p++ << 32;
9956 fprintf(
f,
" tag:0x%llx", (
long long)tag);
9957 fprintf(
f,
" n:%d", instr >> 16);
9979 int wire_type,
int dest) {
10024 uint64_t repacked =
repack(upb_value_getuint64(
v), wire_type);
10038 if (fn >= 1 << 24) {
10054 ? upb_value_getptr(
v)
10085 #define LABEL_LOOPSTART 1
10086 #define LABEL_LOOPBREAK 2
10087 #define LABEL_FIELD 3
10088 #define LABEL_ENDMSG 4
10221 putop(c, parse_type, sel);
10228 putop(c, parse_type, sel);
10240 putop(c, parse_type, sel);
10249 uint32_t* start_pc;
10286 if (c->
pc == start_pc) {
10359 m->code_base.ptr =
g->bytecode +
m->code_base.ofs;
10370 #ifdef UPB_USE_JIT_X64
10373 g->jit_code =
NULL;
10396 const void *owner) {
10416 g->bytecode_end = c->
pc;
10419 #ifdef UPB_DUMP_BYTECODE
10421 FILE *
f = fopen(
"/tmp/upb-bytecode",
"w");
10423 dumpbc(
g->bytecode,
g->bytecode_end, stderr);
10424 dumpbc(
g->bytecode,
g->bytecode_end,
f);
10427 f = fopen(
"/tmp/upb-bytecode.bin",
"wb");
10429 fwrite(
g->bytecode, 1,
g->bytecode_end -
g->bytecode,
f);
10451 mgroup_unref(
group, c);
10479 return upb_value_getptr(
v);
10487 opts->handlers =
h;
10488 opts->lazy =
false;
10509 #include <inttypes.h>
10510 #include <stddef.h>
10512 #ifdef UPB_DUMP_BYTECODE
10516 #define CHECK_SUSPEND(x) if (!(x)) return upb_pbdecoder_suspend(d);
10521 "Submessage end extends past enclosing submessage.";
10569 #ifdef UPB_USE_JIT_X64
10570 if (
d->method_->is_native_) {
10573 size_t ret = entries *
sizeof(
void*) * 2;
10574 ret +=
sizeof(
void*) * 10;
10579 return entries *
sizeof(uint32_t*);
10612 return d->data_end -
d->ptr;
10617 return d->end -
d->ptr;
10622 return d->bufstart_ofs + (
d->ptr -
d->buf);
10627 return d->top->end_ofs -
offset(
d);
10641 return in_buf(
p,
d->residual,
d->residual_end);
10647 size_t delim_ofs =
d->top->end_ofs -
d->bufstart_ofs;
10648 if (delim_ofs <= (
size_t)(
d->end -
d->buf)) {
10649 d->delim_end =
d->buf + delim_ofs;
10650 d->data_end =
d->delim_end;
10652 d->data_end =
d->end;
10653 d->delim_end =
NULL;
10666 d->bufstart_ofs += (
d->end -
d->buf);
10675 d->checkpoint =
d->ptr;
10688 seterr(
d,
"Skipped value extended beyond enclosing submessage.");
10699 d->bufstart_ofs += (
d->end -
d->buf);
10700 d->residual_end =
d->residual;
10702 return d->size_param +
d->skip;
10718 d->size_param =
size;
10719 d->handle = handle;
10724 if (
d->skip &&
d->skip >=
size) {
10726 d->bufstart_ofs +=
size;
10736 d->buf_param =
buf;
10741 seterr(
d,
"Passed NULL buffer over non-skippable region.");
10745 if (
d->residual_end >
d->residual) {
10752 d->checkpoint =
d->ptr;
10756 size_t skip_bytes =
d->skip;
10763 if (
d->top->groupnum < 0) {
10775 if (
d->checkpoint ==
d->residual) {
10777 d->ptr =
d->residual;
10780 size_t ret =
d->size_param - (
d->end -
d->checkpoint);
10784 d->bufstart_ofs += (
d->checkpoint -
d->buf);
10785 d->residual_end =
d->residual;
10800 if (
d->checkpoint ==
d->residual) {
10802 UPB_ASSERT((
d->residual_end -
d->residual) +
d->size_param <=
10803 sizeof(
d->residual));
10805 d->bufstart_ofs -= (
d->residual_end -
d->residual);
10807 memcpy(
d->residual_end,
d->buf_param,
d->size_param);
10808 d->residual_end +=
d->size_param;
10814 d->ptr =
d->checkpoint;
10817 memcpy(
d->residual,
d->ptr, save);
10818 d->residual_end =
d->residual + save;
10823 return d->size_param;
10850 }
else if (
d->data_end ==
d->delim_end) {
10851 seterr(
d,
"Submessage ended in the middle of a value or group");
10875 memcpy(
buf,
d->ptr, ret);
10878 memcpy((
char *)
buf + ret,
d->buf_param, copy);
10901 uint8_t
byte = 0x80;
10904 for(bitpos = 0; bitpos < 70 && (
byte & 0x80); bitpos += 7) {
10906 *u64 |= (uint64_t)(
byte & 0x7F) << bitpos;
10908 if(bitpos == 70 && (
byte & 0x80)) {
10943 if (ret >= 0)
return ret;
10945 seterr(
d,
"Unterminated 32-bit varint");
10991 }
else if (fr ==
d->limit) {
11011 d->top->groupnum = arg;
11019 uint64_t expected) {
11023 if (read ==
bytes &&
data == expected) {
11028 }
else if (read <
bytes && memcmp(&
data, &expected, read) == 0) {
11036 uint8_t wire_type) {
11043 wire_type = tag & 0x7;
11044 fieldnum = tag >> 3;
11047 if (fieldnum == 0) {
11048 seterr(
d,
"Saw invalid field number (0)");
11052 switch (wire_type) {
11074 if (fieldnum == -
d->top->groupnum) {
11076 }
else if (fieldnum ==
d->top->groupnum) {
11079 seterr(
d,
"Unmatched ENDGROUP tag.");
11084 seterr(
d,
"Invalid wire type");
11088 if (
d->top->groupnum >= 0) {
11103 d->pc =
d->top->base + upb_value_getuint64(
v);
11122 wire_type = tag & 0x7;
11123 fieldnum = tag >> 3;
11129 uint64_t
v = upb_value_getuint64(
val);
11130 if (wire_type == (
v & 0xff)) {
11131 d->pc =
d->top->base + (
v >> 16);
11133 }
else if (wire_type == ((
v >> 8) & 0xff)) {
11137 d->pc =
d->top->base + upb_value_getuint64(
val);
11178 #define VMCASE(op, code) \
11179 case op: { code; if (consumes_input(op)) checkpoint(d); break; }
11180 #define PRIMITIVE_OP(type, wt, name, convfunc, ctype) \
11181 VMCASE(OP_PARSE_ ## type, { \
11183 CHECK_RETURN(decode_ ## wt(d, &val)); \
11184 upb_sink_put ## name(&d->top->sink, arg, (convfunc)(val)); \
11188 int32_t instruction;
11194 instruction = *
d->pc++;
11195 op =
getop(instruction);
11196 arg = instruction >> 8;
11200 #ifdef UPB_DUMP_BYTECODE
11201 fprintf(stderr,
"s_ofs=%d buf_ofs=%d data_rem=%d buf_rem=%d delim_rem=%d "
11204 (
int)(
d->ptr -
d->buf),
11205 (
int)(
d->data_end -
d->ptr),
11206 (
int)(
d->end -
d->ptr),
11207 (
int)((
d->top->end_ofs -
d->bufstart_ofs) - (
d->ptr -
d->buf)),
11208 (
int)(
d->pc - 1 -
group->bytecode),
11231 d->top->base =
d->pc - 1;
11232 memcpy(&
d->top->dispatch,
d->pc,
sizeof(
void*));
11233 d->pc +=
sizeof(
void*) /
sizeof(uint32_t);
11268 seterr(
d,
"Tried to skip past end of string.");
11271 int32_t ret =
skip(
d,
n);
11292 d->top->groupnum = *
d->pc++;
11312 if (
d->ptr ==
d->delim_end)
11316 d->callstack[
d->call_len++] =
d->pc;
11321 d->pc =
d->callstack[--
d->call_len];
11329 expected = (arg >> 8) & 0xff;
11330 if (*
d->ptr == expected) {
11347 expected = (arg >> 8) & 0xffff;
11350 memcpy(&actual,
d->ptr, 2);
11351 if (expected == actual) {
11359 if (result >= 0)
return result;
11365 memcpy(&expected,
d->pc, 8);
11369 if (result >= 0)
return result;
11375 return d->size_param;
11388 d->bufstart_ofs = 0;
11390 d->callstack[0] = &
halt;
11401 d->bufstart_ofs = 0;
11413 if (
d->residual_end >
d->residual) {
11414 seterr(
d,
"Unexpected EOF: decoder still has buffered unparsed data");
11419 seterr(
d,
"Unexpected EOF inside skipped data");
11424 seterr(
d,
"Unexpected EOF inside delimited string");
11430 d->top->end_ofs =
end;
11432 #ifdef UPB_USE_JIT_X64
11433 if (
method->is_native_) {
11435 if (
d->top !=
d->stack)
11436 d->stack->end_ofs = 0;
11441 const uint32_t *
p =
d->pc;
11442 d->stack->end_ofs =
end;
11444 if (
p !=
method->code_base.ptr)
p--;
11456 if (
d->call_len != 0) {
11457 seterr(
d,
"Unexpected EOF inside submessage or group");
11479 d->top->groupnum = 0;
11480 d->ptr =
d->residual;
11481 d->buf =
d->residual;
11482 d->end =
d->residual;
11483 d->residual_end =
d->residual;
11488 const size_t default_max_nesting = 64;
11494 if (!
d)
return NULL;
11499 if (!
d->stack || !
d->callstack) {
11504 d->limit =
d->stack + default_max_nesting - 1;
11505 d->stack_size = default_max_nesting;
11512 if (
d->method_->dest_handlers_) {
11513 if (sink->
handlers !=
d->method_->dest_handlers_)
11537 return d->stack_size;
11543 if (max < (
size_t)(
d->top -
d->stack)) {
11548 if (max >
d->stack_size) {
11566 d->stack_size = max;
11569 d->limit =
d->stack + max - 1;
11714 size_t old_size = e->
limit - e->
buf;
11716 size_t new_size = old_size;
11718 while (new_size < needed) {
11724 if (new_buf ==
NULL) {
11730 e->
limit = new_buf + new_size;
11800 size_t new_size = old_size * 2;
11804 if (new_buf ==
NULL) {
11838 const char *ptr = e->
buf;
11839 for (
s = e->
segbuf; s <= e->segptr;
s++) {
11909 memcpy(&ret, &
d,
sizeof(uint64_t));
11915 memcpy(&ret, &
d,
sizeof(uint32_t));
11925 if (e->
depth++ == 0) {
11935 if (--e->
depth == 0) {
11977 #define T(type, ctype, convert, encode) \
11978 static bool encode_scalar_##type(void *e, const void *hd, ctype val) { \
11979 return encode_tag(e, hd) && encode(e, (convert)(val)) && commit(e); \
11981 static bool encode_packed_##type(void *e, const void *hd, ctype val) { \
11983 return encode(e, (convert)(val)); \
12006 static void newhandlers_callback(
const void *closure,
upb_handlers *
h) {
12036 #define T(upper, lower, upbtype) \
12037 case UPB_DESCRIPTOR_TYPE_##upper: \
12039 upb_handlers_set##upbtype(h, f, encode_packed_##lower, &attr); \
12041 upb_handlers_set##upbtype(h, f, encode_scalar_##lower, &attr); \
12046 T(DOUBLE,
double,
double);
12047 T(FLOAT,
float,
float);
12052 T(BOOL,
bool,
bool);
12056 T(SFIXED32, sfixed32,
int32);
12057 T(SFIXED64, sfixed64,
int64);
12058 T(SINT32, sint32,
int32);
12059 T(SINT64, sint64,
int64);
12099 const void *owner) {
12105 const size_t initial_bufsize = 256;
12106 const size_t initial_segbufsize = 16;
12108 const size_t stack_size = 64;
12114 if (!e)
return NULL;
12124 e->
limit = e->
buf + initial_bufsize;
12152 upb_pbdecodermethodopts opts;
12183 upb_filedef_ref(ret[
i], owner);
12190 upb_handlers_unref(reader_h, &reader_h);
12191 upb_pbdecodermethod_unref(decoder_m, &decoder_m);
12204 #include <inttypes.h>
12205 #include <stdarg.h>
12207 #include <string.h>
12218 #define CHECK(x) if ((x) < 0) goto err;
12221 const char *last = strrchr(longname,
'.');
12222 return last ? last + 1 : longname;
12227 if (!
p->single_line_)
12228 for (
i = 0;
i <
p->indent_depth_;
i++)
12234 const char ch = (
p->single_line_ ?
' ' :
'\n');
12240 bool preserve_utf8) {
12242 char dstbuf[4096], *
dst = dstbuf, *dstend = dstbuf +
sizeof(dstbuf);
12247 const bool use_hex =
false;
12248 bool last_hex_escape =
false;
12251 bool is_hex_escape;
12253 if (dstend -
dst < 4) {
12258 is_hex_escape =
false;
12260 case '\n': *(
dst++) =
'\\'; *(
dst++) =
'n';
break;
12261 case '\r': *(
dst++) =
'\\'; *(
dst++) =
'r';
break;
12262 case '\t': *(
dst++) =
'\\'; *(
dst++) =
't';
break;
12263 case '\"': *(
dst++) =
'\\'; *(
dst++) =
'\"';
break;
12264 case '\'': *(
dst++) =
'\\'; *(
dst++) =
'\'';
break;
12265 case '\\': *(
dst++) =
'\\'; *(
dst++) =
'\\';
break;
12270 if ((!preserve_utf8 || (uint8_t)*
buf < 0x80) &&
12272 sprintf(
dst, (use_hex ?
"\\x%02x" :
"\\%03o"), (uint8_t)*
buf);
12273 is_hex_escape = use_hex;
12279 last_hex_escape = is_hex_escape;
12297 _upb_va_copy(args_copy,
args);
12298 len = _upb_vsnprintf(
NULL, 0,
fmt, args_copy);
12303 if (!
str)
return false;
12319 if (
p->indent_depth_ == 0) {
12329 if (
p->indent_depth_ == 0) {
12335 #define TYPE(name, ctype, fmt) \
12336 static bool textprinter_put ## name(void *closure, const void *handler_data, \
12338 upb_textprinter *p = closure; \
12339 const upb_fielddef *f = handler_data; \
12340 CHECK(indent(p)); \
12341 putf(p, "%s: " fmt, upb_fielddef_name(f), val); \
12342 CHECK(endfield(p)); \
12360 #define STRINGIFY_HELPER(x) #x
12361 #define STRINGIFY_MACROVAL(x) STRINGIFY_HELPER(x)
12384 if (!textprinter_putint32(closure, handler_data,
val))
12391 size_t size_hint) {
12421 const char *
name = handler_data;
12423 putf(
p,
"%s {%c",
name,
p->single_line_ ?
' ' :
'\n');
12424 p->indent_depth_++;
12433 p->indent_depth_--;
12502 p->single_line_ = single_line;
12503 p->indent_depth_ = 0;
12512 if (!
p)
return NULL;
12522 const void *owner) {
12529 p->single_line_ = single_line;
12562 const char *
p =
r.p;
12563 uint32_t low = (uint32_t)
r.val;
12566 b = *(
p++); low |= (
b & 0x7fU) << 14;
if (!(
b & 0x80))
goto done;
12567 b = *(
p++); low |= (
b & 0x7fU) << 21;
if (!(
b & 0x80))
goto done;
12568 b = *(
p++); low |= (
b & 0x7fU) << 28;
12569 high = (
b & 0x7fU) >> 4;
if (!(
b & 0x80))
goto done;
12570 b = *(
p++); high |= (
b & 0x7fU) << 3;
if (!(
b & 0x80))
goto done;
12571 b = *(
p++); high |= (
b & 0x7fU) << 10;
if (!(
b & 0x80))
goto done;
12572 b = *(
p++); high |= (
b & 0x7fU) << 17;
if (!(
b & 0x80))
goto done;
12573 b = *(
p++); high |= (
b & 0x7fU) << 24;
if (!(
b & 0x80))
goto done;
12574 b = *(
p++); high |= (
b & 0x7fU) << 31;
if (!(
b & 0x80))
goto done;
12578 r.val = ((uint64_t)high << 32) | low;
12585 const char *
p =
r.p;
12586 uint64_t
val =
r.val;
12589 b = *(
p++);
val |= (
b & 0x7fU) << 14;
if (!(
b & 0x80))
goto done;
12590 b = *(
p++);
val |= (
b & 0x7fU) << 21;
if (!(
b & 0x80))
goto done;
12591 b = *(
p++);
val |= (
b & 0x7fU) << 28;
if (!(
b & 0x80))
goto done;
12592 b = *(
p++);
val |= (
b & 0x7fU) << 35;
if (!(
b & 0x80))
goto done;
12593 b = *(
p++);
val |= (
b & 0x7fU) << 42;
if (!(
b & 0x80))
goto done;
12594 b = *(
p++);
val |= (
b & 0x7fU) << 49;
if (!(
b & 0x80))
goto done;
12595 b = *(
p++);
val |= (
b & 0x7fU) << 56;
if (!(
b & 0x80))
goto done;
12596 b = *(
p++);
val |= (
b & 0x7fU) << 63;
if (!(
b & 0x80))
goto done;
12605 #line 1 "upb/json/parser.rl"
12631 #include <stdint.h>
12633 #include <stdlib.h>
12634 #include <string.h>
12639 #define UPB_JSON_MAX_DEPTH 64
12699 size_t parse(
void *closure,
const void *hd,
const char *
buf,
size_t size,
12701 static bool end(
void *closure,
const void *hd);
12725 size_t new_size = sink->
size;
12730 while (sink->
len +
len > new_size) {
12734 if (new_size != sink->
size) {
12735 sink->
ptr = realloc(sink->
ptr, new_size);
12736 sink->
size = new_size;
12739 memcpy(sink->
ptr + sink->
len, ptr,
len);
12753 sink->
ptr = malloc(sink->
size);
12771 const char *before_type_url_start;
12772 const char *before_type_url_end;
12775 const char *after_type_url_start;
12821 bool is_unknown_field;
12886 inner =
p->top + 1;
12904 #define PARSER_CHECK_RETURN(x) if (!(x)) return false
12935 &frame->
sink,
p->ignore_json_unknown);
13001 if ((
p->top + 1) ==
p->limit) {
13021 if (SIZE_MAX -
a <
b)
return false;
13028 size_t ret =
a *
b;
13029 if (
b != 0 && ret /
b !=
a) {
13041 -1, -1, -1, -1, -1, -1, -1, -1,
13042 -1, -1, -1, -1, -1, -1, -1, -1,
13043 -1, -1, -1, -1, -1, -1, -1, -1,
13044 -1, -1, -1, -1, -1, -1, -1, -1,
13045 -1, -1, -1, -1, -1, -1, -1, -1,
13046 -1, -1, -1, 62, -1, -1, -1, 63,
13047 52, 53, 54, 55, 56, 57, 58, 59,
13048 60, 61, -1, -1, -1, -1, -1, -1,
13049 -1, 0, 1, 2, 3, 4, 5, 6,
13050 07, 8, 9, 10, 11, 12, 13, 14,
13051 15, 16, 17, 18, 19, 20, 21, 22,
13052 23, 24, 25, -1, -1, -1, -1, -1,
13053 -1, 26, 27, 28, 29, 30, 31, 32,
13054 33, 34, 35, 36, 37, 38, 39, 40,
13055 41, 42, 43, 44, 45, 46, 47, 48,
13056 49, 50, 51, -1, -1, -1, -1, -1,
13057 -1, -1, -1, -1, -1, -1, -1, -1,
13058 -1, -1, -1, -1, -1, -1, -1, -1,
13059 -1, -1, -1, -1, -1, -1, -1, -1,
13060 -1, -1, -1, -1, -1, -1, -1, -1,
13061 -1, -1, -1, -1, -1, -1, -1, -1,
13062 -1, -1, -1, -1, -1, -1, -1, -1,
13063 -1, -1, -1, -1, -1, -1, -1, -1,
13064 -1, -1, -1, -1, -1, -1, -1, -1,
13065 -1, -1, -1, -1, -1, -1, -1, -1,
13066 -1, -1, -1, -1, -1, -1, -1, -1,
13067 -1, -1, -1, -1, -1, -1, -1, -1,
13068 -1, -1, -1, -1, -1, -1, -1, -1,
13069 -1, -1, -1, -1, -1, -1, -1, -1,
13070 -1, -1, -1, -1, -1, -1, -1, -1,
13071 -1, -1, -1, -1, -1, -1, -1, -1,
13072 -1, -1, -1, -1, -1, -1, -1, -1
13086 const char *limit = ptr +
len;
13087 for (; ptr < limit; ptr += 4) {
13091 if (limit - ptr < 4) {
13093 "Base64 input for bytes field not a multiple of 4: %s",
13105 if (
val & 0x80000000) {
13120 "Non-base64 characters in bytes field: %s",
13124 }
if (ptr[2] ==
'=') {
13129 if (ptr[0] ==
'=' || ptr[1] ==
'=' || ptr[3] !=
'=') {
13145 if (ptr[0] ==
'=' || ptr[1] ==
'=' || ptr[2] ==
'=') {
13161 "Incorrect base64 padding for field: %s (%.*s)",
13195 p->accumulated =
NULL;
13196 p->accumulated_len = 0;
13202 size_t old_size =
p->accumulate_buf_size;
13203 size_t new_size =
UPB_MAX(old_size, 128);
13204 while (new_size < need) {
13215 p->accumulate_buf = mem;
13216 p->accumulate_buf_size = new_size;
13227 if (!
p->accumulated && can_alias) {
13228 p->accumulated =
buf;
13229 p->accumulated_len =
len;
13243 if (
p->accumulated !=
p->accumulate_buf) {
13244 memcpy(
p->accumulate_buf,
p->accumulated,
p->accumulated_len);
13245 p->accumulated =
p->accumulate_buf;
13248 memcpy(
p->accumulate_buf +
p->accumulated_len,
buf,
len);
13249 p->accumulated_len +=
len;
13258 *
len =
p->accumulated_len;
13259 return p->accumulated;
13305 p->string_selector = sel;
13310 switch (
p->multipart_state) {
13313 &
p->status,
"Internal error: unexpected state MULTIPART_INACTIVE");
13368 if (!
p->capture)
return;
13401 case 'r':
return '\r';
13402 case 't':
return '\t';
13403 case 'n':
return '\n';
13404 case 'f':
return '\f';
13405 case 'b':
return '\b';
13406 case '/':
return '/';
13407 case '"':
return '"';
13408 case '\\':
return '\\';
13429 if (
ch >=
'0' &&
ch <=
'9') {
13430 p->digit += (
ch -
'0');
13431 }
else if (
ch >=
'a' &&
ch <=
'f') {
13432 p->digit += ((
ch -
'a') + 10);
13435 p->digit += ((
ch -
'A') + 10);
13440 uint32_t codepoint =
p->digit;
13445 if (codepoint <= 0x7F) {
13446 utf8[0] = codepoint;
13448 }
else if (codepoint <= 0x07FF) {
13449 utf8[1] = (codepoint & 0x3F) | 0x80;
13451 utf8[0] = (codepoint & 0x1F) | 0xC0;
13454 utf8[2] = (codepoint & 0x3F) | 0x80;
13456 utf8[1] = (codepoint & 0x3F) | 0x80;
13458 utf8[0] = (codepoint & 0x0F) | 0xE0;
13508 if (
p->top->f ==
NULL) {
13544 size_t len = strlen(
buf);
13545 const char *bufend =
buf +
len;
13550 double inf = 1.0 / 0.0;
13554 if (
len == 0 ||
buf[0] ==
' ') {
13566 if (
errno == ERANGE ||
end != bufend) {
13576 unsigned long val = strtoul(
buf, &
end, 0);
13577 if (
end != bufend) {
13590 if (
errno == ERANGE ||
end != bufend) {
13598 unsigned long val = strtoul(
p->accumulated, &
end, 0);
13599 if (
end != bufend) {
13601 }
else if (
errno == ERANGE) {
13617 if (
len == strlen(
"Infinity") && strcmp(
buf,
"Infinity") == 0) {
13620 }
else if (
len == strlen(
"-Infinity") && strcmp(
buf,
"-Infinity") == 0) {
13624 if (
errno == ERANGE ||
end != bufend) {
13630 #define CASE(capitaltype, smalltype, ctype, min, max) \
13631 case UPB_TYPE_ ## capitaltype: { \
13632 if (modf(val, &dummy) != 0 || val > max || val < min) { \
13635 upb_sink_put ## smalltype(&p->top->sink, parser_getsel(p), \
13689 if (
p->top->f ==
NULL) {
13695 "Boolean value specified for non-bool field: %s",
13728 if (
p->top->is_unknown_field) {
13756 const char *zero_ptr =
"0";
13831 if (
p->top->f ==
NULL) {
13836 if (
p->top->is_any) {
13851 inner->
m =
p->top->m;
13852 inner->
f =
p->top->f;
13876 "String specified for bool or submessage field: %s",
13891 inner =
p->top + 1;
13903 if (strncmp(
buf,
"type.googleapis.com/", 20) == 0 &&
len > 20) {
13909 if (payload_type ==
NULL) {
13911 &
p->status,
"Cannot find packed type: %.*s\n", (
int)
len,
buf);
13921 &
p->status,
"Invalid type url: %.*s\n", (
int)
len,
buf);
13936 if (
p->top->f ==
NULL) {
13941 if (
p->top->is_any) {
13948 p->accumulated,
p->accumulated_len)) {
13968 int32_t int_val = 0;
13973 upb_sink_putint32(&
p->top->sink, sel, int_val);
14055 char seconds_buf[14];
14056 char nanos_buf[12];
14058 int64_t seconds = 0;
14061 const char *seconds_membername =
"seconds";
14062 const char *nanos_membername =
"nanos";
14063 size_t fraction_start;
14071 memset(seconds_buf, 0, 14);
14072 memset(nanos_buf, 0, 12);
14077 for (fraction_start = 0; fraction_start <
len &&
buf[fraction_start] !=
'.';
14081 memcpy(seconds_buf,
buf, fraction_start);
14082 seconds = strtol(seconds_buf, &
end, 10);
14083 if (
errno == ERANGE ||
end != seconds_buf + fraction_start) {
14090 if (seconds > 315576000000) {
14092 "maximum acceptable value is "
14098 if (seconds < -315576000000) {
14100 "minimum acceptable value is "
14107 nanos_buf[0] =
'0';
14108 memcpy(nanos_buf + 1,
buf + fraction_start,
len - fraction_start);
14109 val = strtod(nanos_buf, &
end);
14110 if (
errno == ERANGE ||
end != nanos_buf +
len - fraction_start + 1) {
14117 nanos =
val * 1000000000;
14118 if (seconds < 0) nanos = -nanos;
14236 memset(&
p->tm, 0,
sizeof(
struct tm));
14246 char nanos_buf[12];
14250 const char *nanos_membername =
"nanos";
14252 memset(nanos_buf, 0, 12);
14262 "error parsing timestamp: at most 9-digit fraction.");
14268 nanos_buf[0] =
'0';
14269 memcpy(nanos_buf + 1,
buf,
len);
14270 val = strtod(nanos_buf, &
end);
14272 if (
errno == ERANGE ||
end != nanos_buf +
len + 1) {
14279 nanos =
val * 1000000000;
14302 #define EPOCH_YEAR 1970
14303 #define TM_YEAR_BASE 1900
14306 return (year % 4) == 0 && (year % 100 != 0 || (year % 400) == 0);
14311 { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
14313 { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
14316 int64_t
epoch(
int year,
int yday,
int hour,
int min,
int sec) {
14319 int64_t leap_days = years / 4 - years / 100 + years / 400;
14321 int64_t days = years * 365 + yday + leap_days;
14322 int64_t hours = days * 24 + hour;
14323 int64_t mins = hours * 60 + min;
14324 int64_t secs = mins * 60 + sec;
14329 int sec = tp->tm_sec;
14330 int min = tp->tm_min;
14331 int hour = tp->tm_hour;
14332 int mday = tp->tm_mday;
14333 int mon = tp->tm_mon;
14338 int yday = mon_yday + mday;
14340 return epoch(year, yday, hour, min, sec);
14348 const char *seconds_membername =
"seconds";
14356 if (
buf[0] !=
'Z') {
14357 if (sscanf(
buf + 1,
"%2d:00", &hours) != 1) {
14363 if (
buf[0] ==
'+') {
14370 seconds += 3600 * hours;
14373 if (seconds < -62135596800) {
14375 "minimum acceptable value is "
14376 "0001-01-01T00:00:00Z");
14419 inner->
m =
p->top->m;
14420 inner->
f =
p->top->f;
14429 const char *limit = ptr +
len;
14431 for (;ptr < limit; ptr++) {
14432 if (*ptr >=
'A' && *ptr <=
'Z' && !
first) {
14433 char lower = tolower(*ptr);
14449 p->accumulated,
p->accumulated_len)) {
14480 if (
p->top->f ==
NULL) {
14496 if (
len == 4 && !strncmp(
buf,
"true", 4)) {
14500 }
else if (
len == 5 && !strncmp(
buf,
"false", 5)) {
14506 "Map bool key not 'true' or 'false'");
14553 mapfield =
p->top->mapfield;
14557 p->top->f = mapfield;
14560 inner->
m = mapentrymsg;
14577 p->top->is_mapentry =
true;
14578 p->top->mapfield = mapfield;
14579 if (
p->top->f ==
NULL) {
14592 p->top->is_unknown_field =
true;
14597 if (
p->top->is_any) {
14599 }
else if (
p->top->is_map) {
14607 p->top->f = upb_value_getconstptr(
v);
14611 }
else if (
p->ignore_json_unknown) {
14612 p->top->is_unknown_field =
true;
14628 if (
len == 5 && strncmp(
buf,
"@type",
len) == 0) {
14630 p->top->f = upb_value_getconstptr(
v);
14634 p->top->is_unknown_field =
true;
14642 if (
p->top->is_mapentry) {
14651 mapfield =
p->top->mapfield;
14661 p->top->is_unknown_field =
false;
14675 if (
p->top->is_unknown_field) {
14716 p->top->is_any =
true;
14717 p->top->any_frame =
14721 p->top->is_any =
false;
14722 p->top->any_frame =
NULL;
14728 "Object specified for non-message/group field: %s",
14764 if (
p->top->is_map) {
14771 bool is_unknown =
p->top->m ==
NULL;
14814 p->top->is_repeated)) {
14819 p->top->is_repeated)) {
14826 if (
p->top->is_unknown_field) {
14836 "Array specified for non-repeated field: %s",
14847 inner->
m =
p->top->m;
14848 inner->
f =
p->top->f;
14862 if (
p->top->is_unknown_field) {
14885 if (!
p->top->is_map &&
p->top->m !=
NULL) {
14891 if (!
p->top->is_map &&
p->top->m !=
NULL) {
14903 p->top->any_frame->before_type_url_start = ptr;
14904 p->top->any_frame->before_type_url_end = ptr;
14908 const char *value_membername =
"value";
14909 bool is_well_known_packed =
false;
14910 const char *packed_end = ptr + 1;
14924 is_well_known_packed =
true;
14927 p->top->any_frame->before_type_url_start =
14928 memchr(
p->top->any_frame->before_type_url_start,
':',
14929 p->top->any_frame->before_type_url_end -
14930 p->top->any_frame->before_type_url_start);
14931 if (
p->top->any_frame->before_type_url_start ==
NULL) {
14936 p->top->any_frame->before_type_url_start++;
14940 p->top->any_frame->after_type_url_start =
14941 memchr(
p->top->any_frame->after_type_url_start,
':',
14943 p->top->any_frame->after_type_url_start);
14944 if (
p->top->any_frame->after_type_url_start ==
NULL) {
14949 p->top->any_frame->after_type_url_start++;
14956 p->top->any_frame->before_type_url_start,
14957 p->top->any_frame->before_type_url_end -
14958 p->top->any_frame->before_type_url_start,
NULL)) {
14962 if (!is_well_known_packed) {
14978 p->top->any_frame->after_type_url_start,
14979 packed_end -
p->top->any_frame->after_type_url_start,
NULL)) {
14983 if (!is_well_known_packed) {
14990 if (!
end(
p->top->any_frame->parser,
NULL)) {
14994 p->top->is_any =
false;
15003 inner =
p->top + 1;
15009 p->top->any_frame->stringsink.len,
NULL);
15036 const char *membername =
"paths";
15056 const char *membername =
"value";
15073 const char *nullmember =
"null_value";
15074 const char *numbermember =
"number_value";
15075 const char *stringmember =
"string_value";
15076 const char *boolmember =
"bool_value";
15077 const char *structmember =
"struct_value";
15078 const char *listmember =
"list_value";
15079 const char *membername =
"";
15083 membername = nullmember;
15086 membername = numbermember;
15089 membername = stringmember;
15092 membername = boolmember;
15095 membername = structmember;
15098 membername = listmember;
15117 const char *membername =
"values";
15134 const char *membername =
"fields";
15151 return p->top ==
p->stack &&
p->top->f ==
NULL && !
p->top->is_unknown_field;
15159 return p->top->f !=
NULL &&
15166 return p->top->f !=
NULL &&
15180 return p->top->f !=
NULL &&
15194 return p->top->f !=
NULL &&
15207 #define CHECK_RETURN_TOP(x) if (!(x)) goto error
15228 #line 2789 "upb/json/parser.rl"
15232 #line 2592 "upb/json/parser.c"
15234 0, 1, 0, 1, 1, 1, 3, 1,
15235 4, 1, 6, 1, 7, 1, 8, 1,
15236 9, 1, 11, 1, 12, 1, 13, 1,
15237 14, 1, 15, 1, 16, 1, 17, 1,
15238 18, 1, 19, 1, 20, 1, 22, 1,
15239 23, 1, 24, 1, 35, 1, 37, 1,
15240 39, 1, 40, 1, 42, 1, 43, 1,
15241 44, 1, 46, 1, 48, 1, 49, 1,
15242 50, 1, 51, 1, 53, 1, 54, 2,
15243 4, 9, 2, 5, 6, 2, 7, 3,
15244 2, 7, 9, 2, 21, 26, 2, 25,
15245 10, 2, 27, 28, 2, 29, 30, 2,
15246 32, 34, 2, 33, 31, 2, 38, 36,
15247 2, 40, 42, 2, 45, 2, 2, 46,
15248 54, 2, 47, 36, 2, 49, 54, 2,
15249 50, 54, 2, 51, 54, 2, 52, 41,
15250 2, 53, 54, 3, 32, 34, 35, 4,
15255 0, 0, 12, 13, 18, 23, 28, 29,
15256 30, 31, 32, 33, 34, 35, 36, 37,
15257 38, 43, 44, 48, 53, 58, 63, 67,
15258 71, 74, 77, 79, 83, 87, 89, 91,
15259 96, 98, 100, 109, 115, 121, 127, 133,
15260 135, 139, 142, 144, 146, 149, 150, 154,
15261 156, 158, 160, 162, 163, 165, 167, 168,
15262 170, 172, 173, 175, 177, 178, 180, 182,
15263 183, 185, 187, 191, 193, 195, 196, 197,
15264 198, 199, 201, 206, 208, 210, 212, 221,
15265 222, 222, 222, 227, 232, 237, 238, 239,
15266 240, 241, 241, 242, 243, 244, 244, 245,
15267 246, 247, 247, 252, 253, 257, 262, 267,
15268 272, 276, 276, 279, 282, 285, 288, 291,
15269 294, 294, 294, 294, 294, 294
15273 32, 34, 45, 91, 102, 110, 116, 123,
15274 9, 13, 48, 57, 34, 32, 93, 125,
15275 9, 13, 32, 44, 93, 9, 13, 32,
15276 93, 125, 9, 13, 97, 108, 115, 101,
15277 117, 108, 108, 114, 117, 101, 32, 34,
15278 125, 9, 13, 34, 32, 58, 9, 13,
15279 32, 93, 125, 9, 13, 32, 44, 125,
15280 9, 13, 32, 44, 125, 9, 13, 32,
15281 34, 9, 13, 45, 48, 49, 57, 48,
15282 49, 57, 46, 69, 101, 48, 57, 69,
15283 101, 48, 57, 43, 45, 48, 57, 48,
15284 57, 48, 57, 46, 69, 101, 48, 57,
15285 34, 92, 34, 92, 34, 47, 92, 98,
15286 102, 110, 114, 116, 117, 48, 57, 65,
15287 70, 97, 102, 48, 57, 65, 70, 97,
15288 102, 48, 57, 65, 70, 97, 102, 48,
15289 57, 65, 70, 97, 102, 34, 92, 45,
15290 48, 49, 57, 48, 49, 57, 46, 115,
15291 48, 57, 115, 48, 57, 34, 46, 115,
15292 48, 57, 48, 57, 48, 57, 48, 57,
15293 48, 57, 45, 48, 57, 48, 57, 45,
15294 48, 57, 48, 57, 84, 48, 57, 48,
15295 57, 58, 48, 57, 48, 57, 58, 48,
15296 57, 48, 57, 43, 45, 46, 90, 48,
15297 57, 48, 57, 58, 48, 48, 34, 48,
15298 57, 43, 45, 90, 48, 57, 34, 44,
15299 34, 44, 34, 44, 34, 45, 91, 102,
15300 110, 116, 123, 48, 57, 34, 32, 93,
15301 125, 9, 13, 32, 44, 93, 9, 13,
15302 32, 93, 125, 9, 13, 97, 108, 115,
15303 101, 117, 108, 108, 114, 117, 101, 32,
15304 34, 125, 9, 13, 34, 32, 58, 9,
15305 13, 32, 93, 125, 9, 13, 32, 44,
15306 125, 9, 13, 32, 44, 125, 9, 13,
15307 32, 34, 9, 13, 32, 9, 13, 32,
15308 9, 13, 32, 9, 13, 32, 9, 13,
15309 32, 9, 13, 32, 9, 13, 0
15313 0, 8, 1, 3, 3, 3, 1, 1,
15314 1, 1, 1, 1, 1, 1, 1, 1,
15315 3, 1, 2, 3, 3, 3, 2, 2,
15316 1, 3, 0, 2, 2, 0, 0, 3,
15317 2, 2, 9, 0, 0, 0, 0, 2,
15318 2, 1, 2, 0, 1, 1, 2, 0,
15319 0, 0, 0, 1, 0, 0, 1, 0,
15320 0, 1, 0, 0, 1, 0, 0, 1,
15321 0, 0, 4, 0, 0, 1, 1, 1,
15322 1, 0, 3, 2, 2, 2, 7, 1,
15323 0, 0, 3, 3, 3, 1, 1, 1,
15324 1, 0, 1, 1, 1, 0, 1, 1,
15325 1, 0, 3, 1, 2, 3, 3, 3,
15326 2, 0, 1, 1, 1, 1, 1, 1,
15331 0, 2, 0, 1, 1, 1, 0, 0,
15332 0, 0, 0, 0, 0, 0, 0, 0,
15333 1, 0, 1, 1, 1, 1, 1, 1,
15334 1, 0, 1, 1, 1, 1, 1, 1,
15335 0, 0, 0, 3, 3, 3, 3, 0,
15336 1, 1, 0, 1, 1, 0, 1, 1,
15337 1, 1, 1, 0, 1, 1, 0, 1,
15338 1, 0, 1, 1, 0, 1, 1, 0,
15339 1, 1, 0, 1, 1, 0, 0, 0,
15340 0, 1, 1, 0, 0, 0, 1, 0,
15341 0, 0, 1, 1, 1, 0, 0, 0,
15342 0, 0, 0, 0, 0, 0, 0, 0,
15343 0, 0, 1, 0, 1, 1, 1, 1,
15344 1, 0, 1, 1, 1, 1, 1, 1,
15349 0, 0, 11, 13, 18, 23, 28, 30,
15350 32, 34, 36, 38, 40, 42, 44, 46,
15351 48, 53, 55, 59, 64, 69, 74, 78,
15352 82, 85, 89, 91, 95, 99, 101, 103,
15353 108, 111, 114, 124, 128, 132, 136, 140,
15354 143, 147, 150, 153, 155, 158, 160, 164,
15355 166, 168, 170, 172, 174, 176, 178, 180,
15356 182, 184, 186, 188, 190, 192, 194, 196,
15357 198, 200, 202, 207, 209, 211, 213, 215,
15358 217, 219, 221, 226, 229, 232, 235, 244,
15359 246, 247, 248, 253, 258, 263, 265, 267,
15360 269, 271, 272, 274, 276, 278, 279, 281,
15361 283, 285, 286, 291, 293, 297, 302, 307,
15362 312, 316, 317, 320, 323, 326, 329, 332,
15363 335, 336, 337, 338, 339, 340
15367 0, 2, 3, 4, 5, 6, 7, 8,
15368 0, 3, 1, 9, 1, 11, 12, 1,
15369 11, 10, 13, 14, 12, 13, 1, 14,
15370 1, 1, 14, 10, 15, 1, 16, 1,
15371 17, 1, 18, 1, 19, 1, 20, 1,
15372 21, 1, 22, 1, 23, 1, 24, 1,
15373 25, 26, 27, 25, 1, 28, 1, 29,
15374 30, 29, 1, 30, 1, 1, 30, 31,
15375 32, 33, 34, 32, 1, 35, 36, 27,
15376 35, 1, 36, 26, 36, 1, 37, 38,
15377 39, 1, 38, 39, 1, 41, 42, 42,
15378 40, 43, 1, 42, 42, 43, 40, 44,
15379 44, 45, 1, 45, 1, 45, 40, 41,
15380 42, 42, 39, 40, 47, 48, 46, 50,
15381 51, 49, 52, 52, 52, 52, 52, 52,
15382 52, 52, 53, 1, 54, 54, 54, 1,
15383 55, 55, 55, 1, 56, 56, 56, 1,
15384 57, 57, 57, 1, 59, 60, 58, 61,
15385 62, 63, 1, 64, 65, 1, 66, 67,
15386 1, 68, 1, 67, 68, 1, 69, 1,
15387 66, 67, 65, 1, 70, 1, 71, 1,
15388 72, 1, 73, 1, 74, 1, 75, 1,
15389 76, 1, 77, 1, 78, 1, 79, 1,
15390 80, 1, 81, 1, 82, 1, 83, 1,
15391 84, 1, 85, 1, 86, 1, 87, 1,
15392 88, 1, 89, 89, 90, 91, 1, 92,
15393 1, 93, 1, 94, 1, 95, 1, 96,
15394 1, 97, 1, 98, 1, 99, 99, 100,
15395 98, 1, 102, 1, 101, 104, 105, 103,
15396 1, 1, 101, 106, 107, 108, 109, 110,
15397 111, 112, 107, 1, 113, 1, 114, 115,
15398 117, 118, 1, 117, 116, 119, 120, 118,
15399 119, 1, 120, 1, 1, 120, 116, 121,
15400 1, 122, 1, 123, 1, 124, 1, 125,
15401 126, 1, 127, 1, 128, 1, 129, 130,
15402 1, 131, 1, 132, 1, 133, 134, 135,
15403 136, 134, 1, 137, 1, 138, 139, 138,
15404 1, 139, 1, 1, 139, 140, 141, 142,
15405 143, 141, 1, 144, 145, 136, 144, 1,
15406 145, 135, 145, 1, 146, 147, 147, 1,
15407 148, 148, 1, 149, 149, 1, 150, 150,
15408 1, 151, 151, 1, 152, 152, 1, 1,
15413 1, 0, 2, 107, 3, 6, 10, 13,
15414 16, 106, 4, 3, 106, 4, 5, 7,
15415 8, 9, 108, 11, 12, 109, 14, 15,
15416 110, 16, 17, 111, 18, 18, 19, 20,
15417 21, 22, 111, 21, 22, 24, 25, 31,
15418 112, 26, 28, 27, 29, 30, 33, 113,
15419 34, 33, 113, 34, 32, 35, 36, 37,
15420 38, 39, 33, 113, 34, 41, 42, 46,
15421 42, 46, 43, 45, 44, 114, 48, 49,
15422 50, 51, 52, 53, 54, 55, 56, 57,
15423 58, 59, 60, 61, 62, 63, 64, 65,
15424 66, 67, 73, 72, 68, 69, 70, 71,
15425 72, 115, 74, 67, 72, 76, 116, 76,
15426 116, 77, 79, 81, 82, 85, 90, 94,
15427 98, 80, 117, 117, 83, 82, 80, 83,
15428 84, 86, 87, 88, 89, 117, 91, 92,
15429 93, 117, 95, 96, 97, 117, 98, 99,
15430 105, 100, 100, 101, 102, 103, 104, 105,
15431 103, 104, 117, 106, 106, 106, 106, 106,
15436 0, 0, 113, 107, 53, 0, 0, 0,
15437 125, 59, 45, 0, 55, 0, 0, 0,
15438 0, 0, 0, 0, 0, 0, 0, 0,
15439 0, 0, 101, 51, 47, 0, 0, 45,
15440 49, 49, 104, 0, 0, 0, 0, 0,
15441 3, 0, 0, 0, 0, 0, 5, 15,
15442 0, 0, 71, 7, 13, 0, 74, 9,
15443 9, 9, 77, 80, 11, 37, 37, 37,
15444 0, 0, 0, 39, 0, 41, 86, 0,
15445 0, 0, 17, 19, 0, 21, 23, 0,
15446 25, 27, 0, 29, 31, 0, 33, 35,
15447 0, 135, 83, 135, 0, 0, 0, 0,
15448 0, 92, 0, 89, 89, 98, 43, 0,
15449 131, 95, 113, 107, 53, 0, 0, 0,
15450 125, 59, 69, 110, 45, 0, 55, 0,
15451 0, 0, 0, 0, 0, 119, 0, 0,
15452 0, 122, 0, 0, 0, 116, 0, 101,
15453 51, 47, 0, 0, 45, 49, 49, 104,
15454 0, 0, 128, 0, 57, 63, 65, 61,
15459 0, 0, 0, 0, 0, 0, 0, 0,
15460 0, 0, 0, 0, 0, 0, 0, 0,
15461 0, 0, 0, 0, 0, 0, 0, 0,
15462 0, 1, 0, 1, 0, 0, 1, 1,
15463 0, 0, 0, 0, 0, 0, 0, 0,
15464 0, 0, 0, 0, 0, 0, 0, 0,
15465 0, 0, 0, 0, 0, 0, 0, 0,
15466 0, 0, 0, 0, 0, 0, 0, 0,
15467 0, 0, 0, 0, 0, 0, 0, 0,
15468 0, 0, 0, 0, 0, 0, 0, 0,
15469 0, 0, 0, 0, 0, 0, 0, 0,
15470 0, 0, 0, 0, 0, 0, 0, 0,
15471 0, 0, 0, 0, 0, 0, 0, 0,
15472 0, 0, 0, 57, 63, 65, 61, 67,
15487 #line 2792 "upb/json/parser.rl"
15494 int cs =
parser->current_state;
15495 int *stack =
parser->parser_stack;
15498 const char *
p =
buf;
15500 const char *eof = &
eof_ch;
15502 parser->handle = handle;
15510 #line 2870 "upb/json/parser.c"
15513 unsigned int _trans;
15515 unsigned int _nacts;
15528 const char *_lower = _keys;
15530 const char *_upper = _keys + _klen - 1;
15532 if ( _upper < _lower )
15535 _mid = _lower + ((_upper-_lower) >> 1);
15536 if ( (*
p) < *_mid )
15538 else if ( (*
p) > *_mid )
15541 _trans += (
unsigned int)(_mid - _keys);
15551 const char *_lower = _keys;
15553 const char *_upper = _keys + (_klen<<1) - 2;
15555 if ( _upper < _lower )
15558 _mid = _lower + (((_upper-_lower) >> 1) & ~1);
15559 if ( (*
p) < _mid[0] )
15561 else if ( (*
p) > _mid[1] )
15564 _trans += (
unsigned int)((_mid - _keys)>>1);
15579 _nacts = (
unsigned int) *_acts++;
15580 while ( _nacts-- > 0 )
15582 switch ( *_acts++ )
15585 #line 2597 "upb/json/parser.rl"
15586 {
p--; {cs = stack[--
top];
goto _again;} }
15589 #line 2599 "upb/json/parser.rl"
15590 {
p--; {stack[
top++] = cs; cs = 23;
goto _again;} }
15593 #line 2603 "upb/json/parser.rl"
15597 #line 2604 "upb/json/parser.rl"
15601 #line 2610 "upb/json/parser.rl"
15605 #line 2611 "upb/json/parser.rl"
15609 #line 2612 "upb/json/parser.rl"
15613 #line 2618 "upb/json/parser.rl"
15617 #line 2624 "upb/json/parser.rl"
15618 {
p--; {cs = stack[--
top];
goto _again;} }
15621 #line 2629 "upb/json/parser.rl"
15625 #line 2630 "upb/json/parser.rl"
15629 #line 2634 "upb/json/parser.rl"
15633 #line 2635 "upb/json/parser.rl"
15637 #line 2639 "upb/json/parser.rl"
15641 #line 2640 "upb/json/parser.rl"
15645 #line 2644 "upb/json/parser.rl"
15649 #line 2645 "upb/json/parser.rl"
15653 #line 2649 "upb/json/parser.rl"
15657 #line 2650 "upb/json/parser.rl"
15661 #line 2654 "upb/json/parser.rl"
15665 #line 2655 "upb/json/parser.rl"
15669 #line 2660 "upb/json/parser.rl"
15673 #line 2661 "upb/json/parser.rl"
15677 #line 2663 "upb/json/parser.rl"
15678 {
p--; {cs = stack[--
top];
goto _again;} }
15681 #line 2668 "upb/json/parser.rl"
15685 #line 2670 "upb/json/parser.rl"
15689 #line 2671 "upb/json/parser.rl"
15693 #line 2673 "upb/json/parser.rl"
15697 #line 2674 "upb/json/parser.rl"
15701 #line 2676 "upb/json/parser.rl"
15702 {
p--; {cs = stack[--
top];
goto _again;} }
15705 #line 2681 "upb/json/parser.rl"
15709 #line 2682 "upb/json/parser.rl"
15713 #line 2687 "upb/json/parser.rl"
15717 #line 2688 "upb/json/parser.rl"
15721 #line 2694 "upb/json/parser.rl"
15722 {
p--; {cs = stack[--
top];
goto _again;} }
15725 #line 2699 "upb/json/parser.rl"
15728 {stack[
top++] = cs; cs = 47;
goto _again;}
15730 {stack[
top++] = cs; cs = 40;
goto _again;}
15732 {stack[
top++] = cs; cs = 75;
goto _again;}
15734 {stack[
top++] = cs; cs = 32;
goto _again;}
15739 #line 2712 "upb/json/parser.rl"
15740 {
p--; {stack[
top++] = cs; cs = 78;
goto _again;} }
15743 #line 2717 "upb/json/parser.rl"
15753 #line 2724 "upb/json/parser.rl"
15757 #line 2727 "upb/json/parser.rl"
15767 #line 2738 "upb/json/parser.rl"
15777 #line 2747 "upb/json/parser.rl"
15787 #line 2759 "upb/json/parser.rl"
15791 #line 2763 "upb/json/parser.rl"
15795 #line 2768 "upb/json/parser.rl"
15799 #line 2769 "upb/json/parser.rl"
15803 #line 2771 "upb/json/parser.rl"
15807 #line 2772 "upb/json/parser.rl"
15811 #line 2774 "upb/json/parser.rl"
15815 #line 2776 "upb/json/parser.rl"
15819 #line 2778 "upb/json/parser.rl"
15823 #line 2780 "upb/json/parser.rl"
15827 #line 2781 "upb/json/parser.rl"
15831 #line 2786 "upb/json/parser.rl"
15832 {
p--; {cs = stack[--
top];
goto _again;} }
15834 #line 3194 "upb/json/parser.c"
15847 unsigned int __nacts = (
unsigned int) *__acts++;
15848 while ( __nacts-- > 0 ) {
15849 switch ( *__acts++ ) {
15851 #line 2595 "upb/json/parser.rl"
15852 {
p--; {cs = stack[--
top];
if (
p == pe )
15857 #line 2769 "upb/json/parser.rl"
15861 #line 2774 "upb/json/parser.rl"
15865 #line 2776 "upb/json/parser.rl"
15869 #line 2778 "upb/json/parser.rl"
15873 #line 2781 "upb/json/parser.rl"
15876 #line 3236 "upb/json/parser.c"
15884 #line 2814 "upb/json/parser.rl"
15895 parser->current_state = cs;
15901 static bool end(
void *closure,
const void *hd) {
15916 return parser->current_state >= 106;
15928 #line 3288 "upb/json/parser.c"
15934 #line 2857 "upb/json/parser.rl"
15935 p->current_state = cs;
15936 p->parser_top =
top;
15940 p->accumulated =
NULL;
15993 if (field_len >
len) {
16028 if (!
p)
return false;
16033 p->accumulate_buf =
NULL;
16034 p->accumulate_buf_size = 0;
16041 p->top->is_any =
true;
16042 p->top->any_frame =
16046 p->top->is_any =
false;
16047 p->top->any_frame =
NULL;
16066 const void* owner) {
16096 #include <string.h>
16097 #include <stdint.h>
16141 bool preserve_fieldnames) {
16144 if (preserve_fieldnames) {
16146 ret->
len = strlen(ret->
ptr);
16179 if (!
p->first_elem_[
p->depth_]) {
16182 p->first_elem_[
p->depth_] =
false;
16192 unsigned char uc = (
unsigned char)c;
16198 case '"':
return "\\\"";
16199 case '\\':
return "\\\\";
16200 case '\b':
return "\\b";
16201 case '\f':
return "\\f";
16202 case '\n':
return "\\n";
16203 case '\r':
return "\\r";
16204 case '\t':
return "\\t";
16205 default:
return NULL;
16213 const char* unescaped_run =
NULL;
16215 for (
i = 0;
i <
len;
i++) {
16223 char escape_buf[8];
16225 unsigned char byte = (
unsigned char)c;
16226 _upb_snprintf(escape_buf,
sizeof(escape_buf),
"\\u%04x", (
int)
byte);
16235 if (unescaped_run) {
16237 unescaped_run =
NULL;
16243 if (unescaped_run ==
NULL) {
16244 unescaped_run = &
buf[
i];
16250 if (unescaped_run) {
16255 #define CHKLENGTH(x) if (!(x)) return -1;
16262 const char inf[] =
"\"Infinity\"";
16265 if (
val == (1.0 / 0.0)) {
16268 return strlen(
inf);
16269 }
else if (
val == (-1.0 / 0.0)) {
16287 size_t n = _upb_snprintf(
buf,
length,
"%s", (
val ?
"true" :
"false"));
16320 static bool putkey(
void *closure,
const void *handler_data) {
16330 #define CHKFMT(val) if ((val) == (size_t)-1) return false;
16331 #define CHK(val) if (!(val)) return false;
16333 #define TYPE_HANDLERS(type, fmt_func) \
16334 static bool put##type(void *closure, const void *handler_data, type val) { \
16335 upb_json_printer *p = closure; \
16337 size_t length = fmt_func(val, data, sizeof(data)); \
16338 UPB_UNUSED(handler_data); \
16340 print_data(p, data, length); \
16343 static bool scalar_##type(void *closure, const void *handler_data, \
16345 CHK(putkey(closure, handler_data)); \
16346 CHK(put##type(closure, handler_data, val)); \
16349 static bool repeated_##type(void *closure, const void *handler_data, \
16351 upb_json_printer *p = closure; \
16353 CHK(put##type(closure, handler_data, val)); \
16357 #define TYPE_HANDLERS_MAPKEY(type, fmt_func) \
16358 static bool putmapkey_##type(void *closure, const void *handler_data, \
16360 upb_json_printer *p = closure; \
16362 size_t length = fmt_func(val, data, sizeof(data)); \
16363 UPB_UNUSED(handler_data); \
16364 print_data(p, "\"", 1); \
16365 print_data(p, data, length); \
16366 print_data(p, "\":", 2); \
16385 #undef TYPE_HANDLERS
16386 #undef TYPE_HANDLERS_MAPKEY
16397 const char *symbolic_name;
16402 if (symbolic_name) {
16404 putstring(
p, symbolic_name, strlen(symbolic_name));
16407 putint32_t(closure,
NULL,
val);
16417 if (symbolic_name) {
16419 putstring(
p, symbolic_name, strlen(symbolic_name));
16460 p->first_elem_[
p->depth_] =
true;
16472 if (
p->depth_ == 0) {
16484 if (
p->depth_ == 0) {
16490 static void *
startseq(
void *closure,
const void *handler_data) {
16494 p->first_elem_[
p->depth_] =
true;
16499 static bool endseq(
void *closure,
const void *handler_data) {
16507 static void *
startmap(
void *closure,
const void *handler_data) {
16511 p->first_elem_[
p->depth_] =
true;
16516 static bool endmap(
void *closure,
const void *handler_data) {
16524 static size_t putstr(
void *closure,
const void *handler_data,
const char *
str,
16534 static size_t putbytes(
void *closure,
const void *handler_data,
const char *
str,
16539 static const char base64[] =
16540 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16544 const char *limit =
data +
sizeof(
data);
16545 const unsigned char *from = (
const unsigned char*)
str;
16547 size_t remaining =
len;
16555 while (remaining > 2) {
16556 if (limit - to < 4) {
16562 to[0] =
base64[from[0] >> 2];
16563 to[1] =
base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
16564 to[2] =
base64[((from[1] & 0xf) << 2) | (from[2] >> 6)];
16565 to[3] =
base64[from[2] & 0x3f];
16572 switch (remaining) {
16574 to[0] =
base64[from[0] >> 2];
16575 to[1] =
base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
16576 to[2] =
base64[(from[1] & 0xf) << 2];
16582 to[0] =
base64[from[0] >> 2];
16583 to[1] =
base64[((from[0] & 0x3) << 4)];
16598 size_t size_hint) {
16608 const char *
str,
size_t len,
16622 size_t size_hint) {
16632 const char *
str,
size_t len,
16646 size_t size_hint) {
16655 const char *
str,
size_t len,
16676 const char *
str,
size_t len,
16684 const char *
str,
size_t len,
16693 const char *
str,
size_t len,
16703 bool preserve_fieldnames,
16799 set_enum_hd(
h, value_field, preserve_fieldnames, &enum_attr);
16816 p->seconds = seconds;
16821 static bool putnanos(
void *closure,
const void *handler_data,
16830 size_t size_hint) {
16839 const char *
str,
size_t len,
16854 p->first_elem_[
p->depth_] =
true;
16863 p->first_elem_[
p->depth_] =
true;
16875 void *closure,
const void *handler_data,
16876 size_t size_hint) {
16885 void *closure,
const void *handler_data,
16886 const char *
str,
size_t len,
16888 const char* limit =
str +
len;
16889 bool upper =
false;
16890 size_t result_len = 0;
16891 for (;
str < limit;
str++) {
16896 if (upper && *
str >=
'a' && *
str <=
'z') {
16897 char upper_char = toupper(*
str);
16898 CHK(
putstr(closure, handler_data, &upper_char, 1, handle));
16912 p->first_elem_[
p->depth_] =
true;
16917 static bool putnull(
void *closure,
const void *handler_data,
16929 if (
p->depth_ == 0) {
16935 #define UPB_DURATION_MAX_JSON_LEN 23
16936 #define UPB_DURATION_MAX_NANO_LEN 9
16948 if (
p->seconds < -315576000000) {
16950 "minimum acceptable value is "
16955 if (
p->seconds > 315576000000) {
16957 "maximum acceptable value is "
16962 _upb_snprintf(
buffer,
sizeof(
buffer),
"%ld", (
long)
p->seconds);
16963 base_len = strlen(
buffer);
16965 if (
p->nanos != 0) {
16967 _upb_snprintf(nanos_buffer,
sizeof(nanos_buffer),
"%.9f",
16968 p->nanos / 1000000000.0);
16971 nanos_buffer[
i] ==
'0';
i--) {
16972 nanos_buffer[
i] = 0;
16974 strcpy(
buffer + base_len, nanos_buffer + 1);
16978 strcpy(
buffer + curr,
"s");
16987 if (
p->depth_ == 0) {
16998 if (
p->depth_ == 0) {
17004 #define UPB_TIMESTAMP_MAX_JSON_LEN 31
17005 #define UPB_TIMESTAMP_BEFORE_NANO_LEN 19
17006 #define UPB_TIMESTAMP_MAX_NANO_LEN 9
17012 time_t time =
p->seconds;
17015 size_t year_length =
17018 if (
p->seconds < -62135596800) {
17020 "minimum acceptable value is "
17021 "0001-01-01T00:00:00Z");
17025 if (
p->seconds > 253402300799) {
17027 "maximum acceptable value is "
17028 "9999-12-31T23:59:59Z");
17033 for (
i = 0;
i < 4 - year_length;
i++) {
17038 "%Y-%m-%dT%H:%M:%S", gmtime(&time));
17039 if (
p->nanos != 0) {
17041 _upb_snprintf(nanos_buffer,
sizeof(nanos_buffer),
"%.9f",
17042 p->nanos / 1000000000.0);
17045 nanos_buffer[
i] ==
'0';
i--) {
17046 nanos_buffer[
i] = 0;
17052 strcpy(
buffer + curr,
"Z");
17061 if (
p->depth_ == 0) {
17073 if (
p->depth_ == 0) {
17080 void *closure,
const void *handler_data,
upb_status *s) {
17084 if (
p->depth_ == 0) {
17091 void *closure,
const void *handler_data) {
17094 if (
p->depth_ == 0) {
17102 void *closure,
const void *handler_data,
upb_status *s) {
17107 if (
p->depth_ == 0) {
17114 void *closure,
const void *handler_data,
size_t size_hint) {
17253 #define WRAPPER_SETHANDLERS(wrapper, type, putmethod) \
17254 void printer_sethandlers_##wrapper(const void *closure, upb_handlers *h) { \
17255 const upb_msgdef *md = upb_handlers_msgdef(h); \
17256 const upb_fielddef* f = upb_msgdef_itof(md, 1); \
17257 upb_handlerattr empty_attr = UPB_HANDLERATTR_INITIALIZER; \
17258 upb_handlers_setstartmsg(h, printer_startmsg_noframe, &empty_attr); \
17259 upb_handlers_setendmsg(h, printer_endmsg_noframe, &empty_attr); \
17260 upb_handlers_set##type(h, f, putmethod, &empty_attr); \
17261 UPB_UNUSED(closure); \
17274 #undef WRAPPER_SETHANDLERS
17315 const bool *preserve_fieldnames_ptr = closure;
17316 const bool preserve_fieldnames = *preserve_fieldnames_ptr;
17349 #define WRAPPER(wellknowntype, name) \
17350 case wellknowntype: \
17351 printer_sethandlers_##name(closure, h); \
17370 #define TYPE(type, name, ctype) \
17372 if (upb_fielddef_isseq(f)) { \
17373 upb_handlers_set##name(h, f, repeated_##ctype, &empty_attr); \
17375 upb_handlers_set##name(h, f, scalar_##ctype, &name_attr); \
17469 if (!
p)
return NULL;
17488 bool preserve_fieldnames,
17489 const void *owner) {
17495 #undef UPB_FIELD_AT
17496 #undef UPB_READ_ONEOF
17497 #undef UPB_WRITE_ONEOF
static bool end_timestamp_zone(upb_json_parser *p, const char *ptr)
bool upb_double_handlerfunc(void *c, const void *hd, double val)
void upb_arena_uninit(upb_arena *a)
static void capture_suspend(upb_json_parser *p, const char **ptr)
static size_t field_ondefaultval(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
UPB_INLINE upb_decoderet upb_vdecode_fast(const char *p)
bool upb_env_reporterror(upb_env *e, const upb_status *status)
static size_t fmt_uint64_as_number(unsigned long long val, char *buf, size_t length)
const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit
static bool upb_streq(const char *str, const char *buf, size_t n)
const char * upb_filedef_name(const upb_filedef *f)
static void * msg_startmsg(void *closure, const void *hd)
bool upb_strtable_iter_isequal(const upb_strtable_iter *i1, const upb_strtable_iter *i2)
static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7]
static bool haslazyhandlers(const upb_handlers *h, const upb_fielddef *f)
static const upb_enumdef enums[5]
static void end_frame(upb_json_printer *p)
const upb_msgdef * upbdefs_google_protobuf_FieldOptions_get(const void *owner)
static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a)
void upb_pb_encoder_reset(upb_pb_encoder *e)
size_t upb_pbdecoder_suspend(upb_pbdecoder *d)
void upb_mapiter_next(upb_mapiter *i)
upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f)
static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2]
const upb_msgdef * upbdefs_google_protobuf_FileDescriptorSet_get(const void *owner)
static void start_hex(upb_json_parser *p)
bool upb_handlerattr_setclosuretype(upb_handlerattr *attr, const void *type)
#define UPB_MAX_HANDLER_DEPTH
const upb_fielddef * upb_msgdef_ntof(const upb_msgdef *m, const char *name, size_t len)
upb_pb_encoder * upb_pb_encoder_create(upb_env *env, const upb_handlers *h, upb_bytessink *output)
bool upb_int32_handlerfunc(void *c, const void *hd, int32_t val)
static bool field_onpacked(void *closure, const void *hd, bool val)
static void track(const upb_refcounted *r, const void *owner, bool ref2)
const upb_handlers * upb_json_printer_newhandlers(const upb_msgdef *md, bool preserve_fieldnames, const void *owner)
static bool printer_startmsg_fieldmask(void *closure, const void *handler_data)
void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter *iter)
bool _upb_def_validate(upb_def *const *defs, size_t n, upb_status *s)
bool upb_byteshandler_setendstr(upb_byteshandler *h, upb_endfield_handlerfunc *func, void *d)
static bool encode_enddelimfield(void *c, const void *hd)
@ UPB_DESCRIPTOR_TYPE_UINT64
bool upb_inttable_iter_isequal(const upb_inttable_iter *i1, const upb_inttable_iter *i2)
static bool parse_number(upb_json_parser *p, bool is_quoted)
static UPB_NORETURN void oom(tarjan *t)
bool upb_byteshandler_setstring(upb_byteshandler *h, upb_string_handlerfunc *func, void *d)
static const int json_start
bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val)
static void seterr(upb_pbdecoder *d, const char *msg)
void upb_mapiter_free(upb_mapiter *i, upb_alloc *a)
static const unsigned char _json_eof_actions[]
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_get(const void *owner)
void printer_sethandlers_any(const void *closure, upb_handlers *h)
static bool start_delim(upb_pb_encoder *e)
static char suspend_capture
GLuint const GLchar * name
void upb_fielddef_setdescriptortype(upb_fielddef *f, int type)
bool upb_msgdef_addoneof(upb_msgdef *m, upb_oneofdef *o, const void *ref_donor, upb_status *s)
static void start_duration_base(upb_json_parser *p, const char *ptr)
static void putstring(upb_json_printer *p, const char *buf, unsigned int len)
#define UPB_TABKEY_STR(len1, len2, len3, len4, strval)
static bool upb_msglayout_init(const upb_msgdef *m, upb_msglayout *l, upb_msgfactory *factory)
struct cleanup_ent * next
UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key, upb_value *v)
static void crossref(const upb_refcounted *r, const upb_refcounted *subobj, void *_t)
static bool is_wellknown_msg(upb_json_parser *p, upb_wellknowntype_t type)
static bool start_array(upb_json_parser *p)
static void end_member(upb_json_parser *p)
void upb_msgdef_setmapentry(upb_msgdef *m, bool map_entry)
static void unref(const upb_refcounted *r)
static const int json_en_main
const char * upb_filedef_package(const upb_filedef *f)
UPB_INLINE bool upb_inttable_insertptr(upb_inttable *t, const void *key, upb_value val)
static bool does_fieldmask_start(upb_json_parser *p)
bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a)
const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption_NamePart_get(const void *owner)
bool upb_filedef_setphpprefix(upb_filedef *f, const char *phpprefix, upb_status *s)
static bool start_subobject_full(upb_json_parser *p)
void upb_oneof_next(upb_oneof_iter *iter)
void * upb_startfield_handlerfunc(void *c, const void *hd)
static void * repeated_startstr(void *closure, const void *handler_data, size_t size_hint)
static bool printer_startdurationmsg(void *closure, const void *handler_data)
UPB_INLINE int32_t upb_zzdec_32(uint32_t n)
static void release_ref2(const upb_refcounted *obj, const upb_refcounted *subobj, void *closure)
size_t upb_pbdecoder_decode(void *decoder, const void *group, const char *buf, size_t size, const upb_bufhandle *handle)
static const upb_tabent strentries[236]
const upb_enumdef * enumdef
static const int json_en_fieldmask_machine
bool upb_handlers_setsubhandlers(upb_handlers *h, const upb_fielddef *f, const upb_handlers *sub)
@ UPB_DESCRIPTOR_TYPE_FIXED32
upb_fieldtype_t upb_map_keytype(const upb_map *map)
mgroup * newgroup(const void *owner)
const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit
static size_t align_up(size_t val, size_t align)
static bool in_buf(const char *p, const char *buf, const char *end)
static bool is_power_of_two(size_t val)
void upb_fielddef_setdefaultdouble(upb_fielddef *f, double value)
static const char _json_range_lengths[]
@ UPB_HANDLER_STARTSUBMSG
const upb_msglayout_field * fields
static const upb_msglayout_field * upb_find_field(const upb_msglayout *l, uint32_t field_number)
const upb_handlers * upb_pb_encoder_newhandlers(const upb_msgdef *m, const void *owner)
bool upb_pbcodecache_setallowjit(upb_pbcodecache *c, bool allow)
static bool putnull(void *closure, const void *handler_data, int32_t null)
float upb_fielddef_defaultfloat(const upb_fielddef *f)
static bool field_endmsg(void *closure, const void *hd, upb_status *status)
static void start_member(upb_json_parser *p)
#define UPB_DURATION_MAX_NANO_LEN
static UPB_FORCEINLINE void consumebytes(upb_pbdecoder *d, void *buf, size_t bytes)
@ UPB_DESCRIPTOR_TYPE_FIXED64
static bool upb_subdef_typecheck(upb_fielddef *f, const upb_def *subdef, upb_status *s)
static size_t enumval_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
static upb_tabval * inttable_val(upb_inttable *t, uintptr_t key)
bool upb_handlerattr_alwaysok(const upb_handlerattr *attr)
#define UPB_ENUMDEF_INIT(name, ntoi, iton, defaultval, refs, ref2s)
void upb_pbdecoder_freejit(mgroup *group)
void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args)
upb_filedef * upb_filedef_new(const void *owner)
UPB_INLINE int64_t upb_zzdec_64(uint64_t n)
strpc * newstrpc(upb_handlers *h, const upb_fielddef *f, bool preserve_fieldnames)
bool upb_fielddef_haspresence(const upb_fielddef *f)
upb_msgdef * upb_msgdef_new(const void *owner)
@ UPB_DESCRIPTOR_TYPE_INT64
bool upb_filedef_setphpnamespace(upb_filedef *f, const char *phpnamespace, upb_status *s)
uint32_t upb_fielddef_index(const upb_fielddef *f)
@ UPB_WELLKNOWN_STRINGVALUE
upb_enumdef * upb_enumdef_new(const void *owner)
static upb_jsonparser_frame * start_jsonparser_frame(upb_json_parser *p)
@ UPB_WELLKNOWN_UINT64VALUE
static void * encode_startstr(void *c, const void *hd, size_t size_hint)
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val)
static upb_tabent * emptyent(upb_table *t)
static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1]
static void start_minute(upb_json_parser *p, const char *ptr)
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
#define UPB_STRTABLE_INIT(count, mask, ctype, size_lg2, entries)
bool upb_filedef_setsyntax(upb_filedef *f, upb_syntax_t syntax, upb_status *s)
const char * upb_fielddef_name(const upb_fielddef *f)
const unsigned short int __mon_yday[2][13]
upb_fieldtype_t upb_map_valuetype(const upb_map *map)
static bool end_null(upb_json_parser *p)
bool upb_pbcodecache_allowjit(const upb_pbcodecache *c)
const upb_status * upb_handlers_status(upb_handlers *h)
UPB_NOINLINE int32_t upb_pbdecoder_checktag_slow(upb_pbdecoder *d, uint64_t expected)
static uint64_t getattr(const tarjan *t, const upb_refcounted *r)
static void add_field(upb_msgdef *m, upb_fielddef *f, const void *ref_donor)
static void encoder_advance(upb_pb_encoder *e, size_t bytes)
static void * file_startext(void *closure, const void *hd)
const struct upb_refcounted_vtbl upb_fielddef_vtbl
upb_filedef * upb_descreader_file(const upb_descreader *r, size_t i)
static void start_timestamp_zone(upb_json_parser *p, const char *ptr)
static uint32_t inthash(upb_tabkey key)
static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1]
size_t accumulate_buf_size
uint32_t submsg_field_count
static UPB_FORCEINLINE int32_t decode_v32(upb_pbdecoder *d, uint32_t *u32)
#define UPB_JSON_MAX_DEPTH
static bool end_number(upb_json_parser *p, const char *ptr)
#define UPB_SIZE(size32, size64)
static bool upb_append_unknown(upb_decstate *d, upb_decframe *frame, const char *start)
const char * upb_enumdef_fullname(const upb_enumdef *e)
const void * effective_closure_type(upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type)
const upb_def * upb_symtab_resolve(const upb_symtab *s, const char *base, const char *sym)
bool upb_descreader_endcontainer(upb_descreader *r)
static bool textprinter_putenum(void *closure, const void *handler_data, int32_t val)
static void json_parser_any_frame_reset(upb_jsonparser_any_frame *frame)
static void * stringsink_start(void *_sink, const void *hd, size_t size_hint)
static void tarjan_visit(const upb_refcounted *obj, const upb_refcounted *subobj, void *closure)
static bool repeated_endstr(void *closure, const void *handler_data)
static size_t msg_name(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
bool upb_decode(upb_strview buf, void *msg, const upb_msglayout *l)
int32_t upb_fielddef_defaultint32(const upb_fielddef *f)
void upb_fielddef_settype(upb_fielddef *f, upb_fieldtype_t type)
bool upb_fielddef_istagdelim(const upb_fielddef *f)
bool upb_fielddef_hassubdef(const upb_fielddef *f)
#define UPB_TABVALUE_EMPTY_INIT
static int64_t upb_zzdecode_64(uint64_t n)
uint32_t field_rank(const upb_fielddef *f)
static void release_subdef(upb_fielddef *f)
upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m)
static bool upb_decode_32bit(const char **ptr, const char *limit, uint32_t *val)
static bool is_string_wrapper(const upb_msgdef *m)
upb_bytessink * upb_pbdecoder_input(upb_pbdecoder *d)
void upb_env_reporterrorsto(upb_env *e, upb_status *s)
bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func, upb_handlerattr *attr)
GLenum GLuint GLenum GLsizei length
upb_pb_encoder_segment * segbuf
@ UPB_WELLKNOWN_TIMESTAMP
static void upb_arena_addblock(upb_arena *a, void *ptr, size_t size, bool owned)
void printer_sethandlers_mapentry(const void *closure, bool preserve_fieldnames, upb_handlers *h)
#define upb_unref2(r, from)
upb_msg * upb_msg_new(const upb_msglayout *l, upb_arena *a)
static bool textprinter_endsubmsg(void *closure, const void *handler_data)
static bool is_fieldmask(const upb_msgdef *m)
void upb_pbcodecache_init(upb_pbcodecache *c)
static size_t fmt_uint64_as_string(unsigned long long val, char *buf, size_t length)
const upb_msglayout google_protobuf_FieldOptions_msginit
upb_errorspace * error_space_
static bool does_number_wrapper_end(upb_json_parser *p)
UPB_INLINE int upb_value_size(uint64_t val)
uint32_t MurmurHash2(const void *key, size_t len, uint32_t seed)
static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6]
static bool printer_startmsg_noframe(void *closure, const void *handler_data)
upb_array * upb_array_new(upb_fieldtype_t type, upb_arena *a)
void upb_refcounted_checkref(const upb_refcounted *r, const void *owner)
static size_t next(const upb_table *t, size_t i)
const upb_msglayout google_protobuf_EnumDescriptorProto_msginit
static bool parse_number_from_buffer(upb_json_parser *p, const char *buf, bool is_quoted)
void upb_arena_init(upb_arena *a)
static bool capture_end(upb_json_parser *p, const char *ptr)
static bool upb_array_grow(upb_array *arr, size_t elements)
bool upb_fielddef_defaultbool(const upb_fielddef *f)
static upb_tabent * mutable_entries(upb_table *t)
void printer_sethandlers_duration(const void *closure, upb_handlers *h)
upb_filedef ** upb_loaddescriptor(const char *buf, size_t n, const void *owner, upb_status *status)
static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey, upb_value val, uint32_t hash, hashfunc_t *hashfunc, eqlfunc_t *eql)
static void end_any_member(upb_json_parser *p, const char *ptr)
static upb_msgval upb_msgval_read(const void *p, size_t ofs, uint8_t size)
const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit
void upb_env_init2(upb_env *e, void *mem, size_t n, upb_alloc *alloc)
upb_msgval upb_mapiter_key(const upb_mapiter *i)
static uint8_t upb_msg_fieldsize(const upb_msglayout_field *field)
UPB_INLINE void upb_bufhandle_uninit(upb_bufhandle *h)
static bool merged(const upb_refcounted *r, const upb_refcounted *r2)
static bool upb_validate_field(upb_fielddef *f, upb_status *s)
const struct upb_refcounted_vtbl upb_msgdef_vtbl
upb_pb_encoder_segment * seglimit
static int32_t upb_zzdecode_32(uint32_t n)
static void * mapkeyval_startstr(void *closure, const void *handler_data, size_t size_hint)
void upb_pbdecodermethodopts_init(upb_pbdecodermethodopts *opts, const upb_handlers *h)
void descreader_cleanup(void *_r)
void upb_refcounted_visit(const upb_refcounted *r, const upb_refcounted *subobj, void *closure)
static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1]
const upb_msglayout google_protobuf_OneofOptions_msginit
#define UPB_MSGDEF_INIT(name, selector_count, submsg_field_count, itof, ntof, map_entry, syntax, well_known_type, refs, ref2s)
void upb_msgfactory_free(upb_msgfactory *f)
static bool isleap(int year)
bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len, upb_value *val, upb_alloc *alloc)
const upb_msgdef * upb_symtab_lookupmsg(const upb_symtab *s, const char *sym)
const char * upb_status_errmsg(const upb_status *status)
static size_t mapkey_str(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
const UPB_INLINE upb_fielddef * upb_oneofdef_ntofz(const upb_oneofdef *o, const char *name)
static bool msg_onmapentry(void *closure, const void *hd, bool mapentry)
bool upb_ok(const upb_status *status)
upb_byteshandler input_handler_
static bool does_fieldmask_end(upb_json_parser *p)
void upb_inttable_uninit2(upb_inttable *t, upb_alloc *a)
const mgroup * mgroup_new(const upb_handlers *dest, bool allowjit, bool lazy, const void *owner)
void upb_enum_next(upb_enum_iter *iter)
@ UPB_DESCRIPTOR_TYPE_SFIXED32
bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, const upb_handlerattr *attr)
const upb_json_parsermethod * method
const upb_handlers * encoder_handlers
static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1]
bool upb_inttable_push2(upb_inttable *t, upb_value val, upb_alloc *a)
static void visitfield(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
static const upb_fielddef * upb_trygetfield(const upb_refcounted *def)
void upb_fielddef_setdefaultint32(upb_fielddef *f, int32_t value)
uint32_t upb_handlers_selectorbaseoffset(const upb_fielddef *f)
const char * upb_filedef_phpprefix(const upb_filedef *f)
static bool upb_decode_string(const char **ptr, const char *limit, upb_strview *val)
const char * upb_msgdef_name(const upb_msgdef *m)
bool upb_inttable_done(const upb_inttable_iter *i)
void printer_sethandlers_value(const void *closure, upb_handlers *h)
static size_t file_onphpprefix(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
GLuint GLsizei const GLchar * label
static upb_pbdecodermethod * find_submethod(const compiler *c, const upb_pbdecodermethod *method, const upb_fielddef *f)
static void compile_methods(compiler *c)
static bool msg_start(void *closure, const void *hd)
char * upb_strdup2(const char *s, size_t len, upb_alloc *a)
upb_value upb_inttable_iter_value(const upb_inttable_iter *i)
int64_t upb_fielddef_defaultint64(const upb_fielddef *f)
static void do_tarjan(const upb_refcounted *obj, tarjan *t)
void(* free)(upb_refcounted *r)
static bool inteql(upb_tabkey k1, lookupkey_t k2)
static void find_methods(compiler *c, const upb_handlers *h)
const upb_msgdef * upbdefs_google_protobuf_FieldDescriptorProto_get(const void *owner)
void upb_inttable_compact2(upb_inttable *t, upb_alloc *a)
bool upb_fielddef_isprimitive(const upb_fielddef *f)
bool upb_endfield_handlerfunc(void *c, const void *hd)
@ UPB_DESCRIPTOR_TYPE_FLOAT
upb_errorspace * upb_status_errspace(const upb_status *status)
void printer_sethandlers_structvalue(const void *closure, upb_handlers *h)
static bool msg_end(void *closure, const void *hd, upb_status *status)
bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val)
static void * file_startphpnamespace(void *closure, const void *hd, size_t size_hint)
void upb_refcounted_ref(const upb_refcounted *r, const void *owner)
static bool encode_fixed32(upb_pb_encoder *e, uint32_t val)
const upb_enumdef * upb_fielddef_enumsubdef(const upb_fielddef *f)
#define SETTER(name, handlerctype, handlertype)
void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg)
uint32_t upb_fielddef_number(const upb_fielddef *f)
bool upb_enumdef_freeze(upb_enumdef *e, upb_status *status)
static bool end_hex(upb_json_parser *p)
static void start_text(upb_json_parser *p, const char *ptr)
void upb_handlerattr_uninit(upb_handlerattr *attr)
static const char dummy_char
#define PTR_AT(msg, ofs, type)
UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype)
bool upb_enumdef_addval(upb_enumdef *e, const char *name, int32_t num, upb_status *status)
void upb_env_initonly(upb_env *e)
struct _upb_tabent upb_tabent
static void dispatchtarget(compiler *c, upb_pbdecodermethod *method, const upb_fielddef *f, int wire_type)
static char escape_char(char in)
static bool end_stringval(upb_json_parser *p)
static const upb_msglayout_field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2]
bool upb_pbdecodermethod_isnative(const upb_pbdecodermethod *m)
UPB_INLINE bool upbdefs_google_protobuf_EnumDescriptorProto_is(const upb_msgdef *m)
static bool upb_isfield(const upb_refcounted *def)
static const upb_msglayout_field * upb_msg_checkfield(int field_index, const upb_msglayout *l)
static bool default_err(void *ud, const upb_status *status)
#define CHECK_RETURN_TOP(x)
const upb_def * upb_fielddef_subdef(const upb_fielddef *f)
const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo_get(const void *owner)
void upb_stringsink_uninit(upb_stringsink *sink)
static void putop(compiler *c, int op,...)
bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type, upb_selector_t *s)
const upb_msglayout google_protobuf_MethodOptions_msginit
static void refgroup(uint32_t *group)
void upb_pbcodecache_uninit(upb_pbcodecache *c)
bool upb_int64_handlerfunc(void *c, const void *hd, int64_t val)
const upb_msgdef * upbdefs_google_protobuf_MethodDescriptorProto_get(const void *owner)
upb_map * upb_map_new(upb_fieldtype_t ktype, upb_fieldtype_t vtype, upb_arena *a)
static void setattr(tarjan *t, const upb_refcounted *r, uint64_t attr)
static size_t scalar_bytes(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
#define UPB_UNKNOWN_SELECTOR
const upb_filedef * upb_def_file(const upb_def *d)
double upb_fielddef_defaultdouble(const upb_fielddef *f)
const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit
UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype)
#define UPB_STATIC_SELECTOR_COUNT
bool upb_enumdef_ntoi(const upb_enumdef *def, const char *name, size_t len, int32_t *num)
static void free_json_parsermethod(upb_refcounted *r)
bool first_elem_[UPB_MAX_HANDLER_DEPTH *2]
static bool printer_startmsg(void *closure, const void *handler_data)
bool upb_msgdef_lookupname(const upb_msgdef *m, const char *name, size_t len, const upb_fielddef **f, const upb_oneofdef **o)
static void upb_msgval_write(void *p, size_t ofs, upb_msgval val, uint8_t size)
upb_arena * upb_msg_arena(const upb_msg *msg)
struct upb_mapiter upb_mapiter
const upb_handlers * upb_handlers_getsubhandlers_sel(const upb_handlers *h, upb_selector_t sel)
#define TYPE_HANDLERS(type, fmt_func)
void upb_fielddef_setdefaultint64(upb_fielddef *f, int64_t value)
static bool init(upb_table *t, upb_ctype_t ctype, uint8_t size_lg2, upb_alloc *a)
static size_t file_onpackage(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
bool upb_fielddef_packed(const upb_fielddef *f)
size_t upb_descreader_filecount(const upb_descreader *r)
static bool end_minute(upb_json_parser *p, const char *ptr)
static void * repeated_startsubmsg(void *closure, const void *handler_data)
static void * upb_bufsink_start(void *_sink, const void *hd, size_t size_hint)
static bool upb_decode_delimitedfield(upb_decstate *d, upb_decframe *frame, const char *field_start, const upb_msglayout_field *field)
static bool streql(upb_tabkey k1, lookupkey_t k2)
static bool repeated_enum(void *closure, const void *handler_data, int32_t val)
bool upb_filedef_adddef(upb_filedef *f, upb_def *def, const void *ref_donor, upb_status *s)
void upb_pbdecodermethodopts_setlazy(upb_pbdecodermethodopts *opts, bool lazy)
static void visitgroup(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
UPB_INLINE size_t upb_vencode64(uint64_t val, char *buf)
bool upb_fielddef_typeisset(const upb_fielddef *f)
const UPB_INLINE char * json_nice_escape(char c)
UPB_INLINE size_t upb_sink_putstring(upb_sink s, upb_selector_t sel, const char *buf, size_t n, const upb_bufhandle *handle)
static mem_block * upb_arena_allocblock(upb_arena *a, size_t size)
const upb_msgdef * upb_fielddef_msgsubdef(const upb_fielddef *f)
bool upb_error_func(void *ud, const upb_status *status)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END if(!upb_strtable_init(&intern->table, UPB_CTYPE_UINT64))
static bool upb_isletter(char c)
int32_t upb_pbdecoder_resume(upb_pbdecoder *d, void *p, const char *buf, size_t size, const upb_bufhandle *handle)
void upb_mapiter_setdone(upb_mapiter *i)
static bool upb_put_float(upb_encstate *e, float d)
const upb_msglayout google_protobuf_SourceCodeInfo_msginit
#define TYPE_HANDLERS_MAPKEY(type, fmt_func)
static void upb_check_alloc(upb_table *t, upb_alloc *a)
const struct upb_refcounted_vtbl upb_oneofdef_vtbl
upb_selector_t string_selector
void upb_env_init(upb_env *e)
static bool checksetdefault(upb_fielddef *f, upb_fieldtype_t type)
static void * msg_startext(void *closure, const void *hd)
void upb_refcounted_unref2(const upb_refcounted *r, upb_refcounted *from)
static void multipart_start(upb_json_parser *p, upb_selector_t sel)
static bool enum_endmsg(void *closure, const void *hd, upb_status *status)
static const upb_msglayout_field google_protobuf_SourceCodeInfo_Location__fields[5]
bool upb_fielddef_isseq(const upb_fielddef *f)
const upb_msglayout google_protobuf_MessageOptions_msginit
UPB_INLINE opcode getop(uint32_t instr)
static bool upb_isoneof(const upb_refcounted *def)
static bool upb_put_varint(upb_encstate *e, uint64_t val)
static bool upb_decode_64bit(const char **ptr, const char *limit, uint64_t *val)
static bool does_string_wrapper_start(upb_json_parser *p)
static void label(compiler *c, unsigned int label)
static const upb_msglayout *const google_protobuf_GeneratedCodeInfo_submsgs[1]
bool upb_fielddef_checkintfmt(int32_t fmt)
upb_jsonparser_any_frame * any_frame
void upb_byteshandler_init(upb_byteshandler *h)
upb_bufsink * upb_bufsink_new(upb_env *env)
void upb_fielddef_setdefaultcstr(upb_fielddef *f, const char *str, upb_status *s)
zend_class_entry * enum_type
static void json_parser_any_frame_set_after_type_url_start_once(upb_jsonparser_any_frame *frame, const char *ptr)
bool upb_handlers_setbool(upb_handlers *h, const upb_fielddef *f, upb_bool_handlerfunc *func, const upb_handlerattr *attr)
#define UPB_TABVALUE_INT_INIT(v)
static const upb_oneofdef * upb_trygetoneof(const upb_refcounted *def)
const void * upb_handlerattr_closuretype(const upb_handlerattr *attr)
static bool handle_mapentry(upb_json_parser *p)
static void switchtobuf(upb_pbdecoder *d, const char *buf, const char *end)
upb_inttable mergehandlers
UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key, upb_value *v)
upb_jsonparser_frame * top
static void start_timestamp_base(upb_json_parser *p)
static size_t saturating_multiply(size_t a, size_t b)
bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val)
#define UPB_TIMESTAMP_MAX_NANO_LEN
void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o)
static bool parse_mapentry_key(upb_json_parser *p)
static void freefield(upb_refcounted *r)
static bool upb_encode_scalarfield(upb_encstate *e, const char *field_mem, const upb_msglayout *m, const upb_msglayout_field *f, bool skip_zero_value)
bool upb_filedef_setpackage(upb_filedef *f, const char *package, upb_status *s)
int upb_oneofdef_numfields(const upb_oneofdef *o)
static bool encode_endgroup(void *c, const void *hd)
bool upb_filedef_adddep(upb_filedef *f, const upb_filedef *dep)
void upb_msg_oneof_begin(upb_msg_oneof_iter *iter, const upb_msgdef *m)
static const unsigned char _json_indicies[]
#define UPB_ASSERT_DEBUGVAR(expr)
void upb_env_uninit(upb_env *e)
static bool textprinter_putbool(void *closure, const void *handler_data, bool val)
void upb_refcounted_unref(const upb_refcounted *r, const void *owner)
static const uint8_t upb_desctype_to_fieldtype2[]
const upb_msgdef * upbdefs_google_protobuf_MessageOptions_get(const void *owner)
static bool end_delim(upb_pb_encoder *e)
bool upb_strtable_insert3(upb_strtable *t, const char *k, size_t len, upb_value v, upb_alloc *a)
static const upb_msglayout *const google_protobuf_FileDescriptorSet_submsgs[1]
static bool upb_decode_varint32(const char **ptr, const char *limit, uint32_t *val)
void upb_handlers_clearerr(upb_handlers *h)
static bool decoder_push(upb_pbdecoder *d, uint64_t end)
upb_alloc upb_alloc_global
static void * startseq(void *closure, const void *handler_data)
bool upb_fielddef_isstring(const upb_fielddef *f)
void upb_fielddef_setdefaultuint32(upb_fielddef *f, uint32_t value)
static bool consumes_input(opcode op)
static bool upb_skip_unknownfielddata(upb_decstate *d, upb_decframe *frame, int field_number, int wire_type)
static size_t callstacksize(upb_pbdecoder *d, size_t entries)
static void multipart_startaccum(upb_json_parser *p)
const upb_handlers * handlers
UPB_INLINE bool upb_filedef_addmsg(upb_filedef *f, upb_msgdef *m, const void *ref_donor, upb_status *s)
void upb_msg_set(upb_msg *msg, int field_index, upb_msgval val, const upb_msglayout *l)
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo__fields[1]
static size_t putstr_nokey(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
UPB_INLINE upb_value _upb_value_val(uint64_t val, upb_ctype_t ctype)
bool upb_symtab_add(upb_symtab *s, upb_def *const *defs, size_t n, void *ref_donor, upb_status *status)
upb_bytessink * upb_json_parser_input(upb_json_parser *p)
int32_t upb_enumdef_default(const upb_enumdef *e)
bool upb_refcounted_isfrozen(const upb_refcounted *r)
UPB_INLINE size_t upb_varint_size(uint64_t val)
#define upb_ref2(r, from)
bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status)
bool upb_bool_handlerfunc(void *c, const void *hd, bool val)
size_t upb_fielddef_getjsonname(const upb_fielddef *f, char *buf, size_t len)
const upb_msgdef * upb_fielddef_containingtype(const upb_fielddef *f)
static bool upb_put_tag(upb_encstate *e, int field_number, int wire_type)
static bool does_number_wrapper_start(upb_json_parser *p)
bool checkstart(upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type, upb_status *status)
static void textprinter_reset(upb_textprinter *p, bool single_line)
static bool base64_push(upb_json_parser *p, upb_selector_t sel, const char *ptr, size_t len)
static void merge(upb_refcounted *r, upb_refcounted *from)
static uint32_t idx(tarjan *t, const upb_refcounted *r)
UPB_INLINE bool upbdefs_google_protobuf_FileDescriptorProto_is(const upb_msgdef *m)
UPB_INLINE bool upbdefs_google_protobuf_FieldOptions_is(const upb_msgdef *m)
static void visitenum(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
upb_handlers_callback * callback
bool upb_arena_addcleanup(upb_arena *a, upb_cleanup_func *func, void *ud)
static size_t file_ondep(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
static bool putkey(void *closure, const void *handler_data)
static uint32_t lowlink(tarjan *t, const upb_refcounted *r)
static bool endseq_fieldmask(void *closure, const void *handler_data)
bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val, upb_alloc *a)
static const upb_msglayout *const google_protobuf_EnumValueOptions_submsgs[1]
static bool json_parser_any_frame_has_value_after_type_url(upb_jsonparser_any_frame *frame)
static void * scalar_startstr_nokey(void *closure, const void *handler_data, size_t size_hint)
bool upb_filedef_setname(upb_filedef *f, const char *name, upb_status *s)
bool upb_refcounted_init(upb_refcounted *r, const struct upb_refcounted_vtbl *vtbl, const void *owner)
static bool start_stringval(upb_json_parser *p)
static size_t upb_encode_varint(uint64_t val, char *buf)
static bool field_ontype(void *closure, const void *hd, int32_t val)
upb_pbdecoder * upb_pbdecoder_create(upb_env *e, const upb_pbdecodermethod *m, upb_sink *sink)
upb_fielddef * upb_oneof_iter_field(const upb_oneof_iter *iter)
void upb_fielddef_setlazy(upb_fielddef *f, bool lazy)
#define UPB_MAX_MESSAGE_NESTING
static bool encode_tag(upb_pb_encoder *e, const tag_t *tag)
static size_t fmt_int64_as_string(long long val, char *buf, size_t length)
static const upb_msglayout_field google_protobuf_DescriptorProto_ExtensionRange__fields[3]
static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1]
size_t upb_inttable_count(const upb_inttable *t)
bool upb_enumdef_setfullname(upb_enumdef *e, const char *fullname, upb_status *s)
static size_t fmt_float(float val, char *buf, size_t length)
static const signed char b64table[]
void upb_stringsink_init(upb_stringsink *sink)
static void putpush(compiler *c, const upb_fielddef *f)
static bool file_start(void *closure, const void *hd)
bool upb_handlers_setendsubmsg(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, const upb_handlerattr *attr)
void upb_fielddef_setdefaultfloat(upb_fielddef *f, float value)
void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m)
GLboolean GLboolean GLboolean b
static void generate_primitivefield(compiler *c, const upb_fielddef *f, upb_pbdecodermethod *method)
#define UPB_ENDSTR_SELECTOR
static size_t oneof_name(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
static const size_t maxalign
void freestrpc(void *ptr)
bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f, upb_startstr_handlerfunc *func, const upb_handlerattr *attr)
static bool upb_readhasbit(const char *msg, const upb_msglayout_field *f)
UPB_INLINE bool upb_sink_startstr(upb_sink s, upb_selector_t sel, size_t size_hint, upb_sink *sub)
static uint32_t pcofs(compiler *c)
void upb_env_seterrorfunc(upb_env *e, upb_error_func *func, void *ud)
upb_pb_encoder_segment * segptr
#define UPB_HANDLERATTR_INITIALIZER
int32_t upb_pbdecoder_decode_f32(upb_pbdecoder *d, uint32_t *u32)
size_t upb_filedef_depcount(const upb_filedef *f)
#define UPB_MAX_MESSAGE_DEPTH
const upb_symtab * upb_msgfactory_symtab(const upb_msgfactory *f)
const struct upb_refcounted_vtbl upb_enumdef_vtbl
const upb_msgdef * upbdefs_google_protobuf_MethodOptions_get(const void *owner)
@ UPB_WELLKNOWN_BYTESVALUE
static void chkdefaulttype(const upb_fielddef *f, upb_fieldtype_t type)
static bool upb_encode_growbuffer(upb_encstate *e, size_t bytes)
void upb_fielddef_setlabel(upb_fielddef *f, upb_label_t label)
static size_t file_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
upb_strtable files_by_name
void upb_fielddef_setdefaultuint64(upb_fielddef *f, uint64_t value)
upb_sink * upb_pb_encoder_input(upb_pb_encoder *e)
zend_class_entry * message_type
const char * upb_msg_getunknown(const upb_msg *msg, size_t *len)
const char * upb_fielddef_subdefname(const upb_fielddef *f)
static UPB_FORCEINLINE size_t peekbytes(upb_pbdecoder *d, void *buf, size_t bytes)
static const int json_en_value_machine
const void * return_closure_type_
static float as_float(uint32_t n)
UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key, upb_value val)
UPB_INLINE bool upb_arrhas(upb_tabval key)
static bool upb_decode_varintfield(upb_decstate *d, upb_decframe *frame, const char *field_start, const upb_msglayout_field *field)
UPB_INLINE uint64_t upb_vencode32(uint32_t val)
static const short _json_key_offsets[]
upb_json_parsermethod * parser_method
UPB_INLINE void upb_pbdecoder_unpackdispatch(uint64_t dispatch, uint64_t *ofs, uint8_t *wt1, uint8_t *wt2)
static void visitfiledef(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
int32_t upb_enum_iter_number(upb_enum_iter *iter)
upb_decoderet upb_vdecode_max8_branch32(upb_decoderet r)
uint32_t hashfunc_t(upb_tabkey key)
static void checkpoint(upb_pbdecoder *d)
static upb_pb_encoder_segment * top(upb_pb_encoder *e)
static void upb_def_uninit(upb_def *def)
static upb_selector_t parser_getsel(upb_json_parser *p)
static bool json_parser_any_frame_has_value_before_type_url(upb_jsonparser_any_frame *frame)
static int instruction_len(uint32_t instr)
static void * startmap_nokey(void *closure, const void *handler_data)
static bool upb_isalphanum(char c)
#define UPB_ENDMSG_SELECTOR
@ UPB_WIRE_TYPE_START_GROUP
UPB_INLINE upb_def * upb_filedef_mutabledef(upb_filedef *f, int i)
UPB_INLINE bool upbdefs_google_protobuf_FileDescriptorSet_is(const upb_msgdef *m)
void upb_status_seterrmsg(upb_status *status, const char *msg)
static void * upb_arena_doalloc(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max)
const char * upb_pbdecoder_getopname(unsigned int op)
void upb_strtable_next(upb_strtable_iter *i)
GLsizei GLsizei GLuint * obj
static bool mapvalue_endstr(void *closure, const void *handler_data)
@ UPB_WELLKNOWN_BOOLVALUE
upb_sink * upb_json_printer_input(upb_json_printer *p)
const upb_msgdef * upbdefs_google_protobuf_EnumValueDescriptorProto_get(const void *owner)
static bool end_any_object(upb_json_parser *p, const char *ptr)
static size_t upb_bufsink_string(void *_sink, const void *hd, const char *ptr, size_t len, const upb_bufhandle *handle)
const upb_handlers * upb_pbdecodermethod_desthandlers(const upb_pbdecodermethod *m)
const upb_handlers * upb_textprinter_newhandlers(const upb_msgdef *m, const void *owner)
const upb_pbdecodermethod * upb_pbdecoder_method(const upb_pbdecoder *d)
void upb_status_copy(upb_status *to, const upb_status *from)
bool upb_uint64_handlerfunc(void *c, const void *hd, uint64_t val)
static void end_object(upb_json_parser *p)
static void upb_fielddef_uninit_default(upb_fielddef *f)
void upb_refcounted_donateref(const upb_refcounted *r, const void *from, const void *to)
bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len, upb_value *v)
upb_value upb_strtable_iter_value(const upb_strtable_iter *i)
static void set_enum_hd(upb_handlers *h, const upb_fielddef *f, bool preserve_fieldnames, upb_handlerattr *attr)
static bool endmsg(void *c, const void *hd, upb_status *status)
static const upb_tabent * findentry(const upb_table *t, lookupkey_t key, uint32_t hash, eqlfunc_t *eql)
static bool end_month(upb_json_parser *p, const char *ptr)
UPB_INLINE bool upb_sink_putunknown(upb_sink s, const char *buf, size_t n)
static bool end_year(upb_json_parser *p, const char *ptr)
#define UPB_DURATION_MAX_JSON_LEN
static void assign_msg_wellknowntype(upb_msgdef *m)
bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink *sink)
static void end_array(upb_json_parser *p)
#define UPB_MAPENTRY_VALUE
UPB_INLINE bool upb_sink_endseq(upb_sink s, upb_selector_t sel)
static void putchecktag(compiler *c, const upb_fielddef *f, int wire_type, int dest)
void * upb_env_malloc(upb_env *e, size_t size)
int upb_msgdef_numfields(const upb_msgdef *m)
static bool end_fieldmask_path(upb_json_parser *p)
static void start_any_object(upb_json_parser *p, const char *ptr)
static const char * shortname(const char *longname)
UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr)
static bool upb_put_fixed64(upb_encstate *e, uint64_t val)
const struct upb_refcounted_vtbl * vtbl
#define UPB_TIMESTAMP_NANOS
static void end_subobject(upb_json_parser *p)
int upb_status_errcode(const upb_status *status)
void upb_refcounted_ref2(const upb_refcounted *r, upb_refcounted *from)
bool putf(upb_textprinter *p, const char *fmt,...)
static void end_listvalue_object(upb_json_parser *p)
uint32_t upb_handlers_selectorcount(const upb_fielddef *f)
upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f)
void upb_symtab_free(upb_symtab *s)
static const char * msgdef_name(const upb_msgdef *m)
static bool field_onnumber(void *closure, const void *hd, int32_t val)
upb_value upb_inttable_pop(upb_inttable *t)
const void * handler_data_
const upb_handlers * upb_handlers_getsubhandlers(const upb_handlers *h, const upb_fielddef *f)
static const struct upb_refcounted_vtbl vtbl
static const upb_msglayout_field google_protobuf_EnumOptions__fields[3]
#define WRAPPER(wellknowntype, name)
void * upb_pbdecoder_startbc(void *closure, const void *pc, size_t size_hint)
UPB_INLINE void upb_gfree(void *ptr)
const upb_enumdef * upbdefs_google_protobuf_FieldOptions_CType_get(const void *owner)
static size_t upb_msglayout_place(upb_msglayout *l, size_t size)
static void freestr(str_t *s)
struct mem_block mem_block
static void visithandlers(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
const upb_msgdef * upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym, size_t len)
static const char _json_actions[]
static bool end_duration_base(upb_json_parser *p, const char *ptr)
static bool json_parser_any_frame_has_type_url(upb_jsonparser_any_frame *frame)
static bool symtab_add(upb_symtab *s, upb_def *const *defs, size_t n, void *ref_donor, upb_refcounted *freeze_also, upb_status *status)
upb_msgval upb_msg_get(const upb_msg *msg, int field_index, const upb_msglayout *l)
static size_t stacksize(upb_pbdecoder *d, size_t entries)
void upb_descreader_setscopename(upb_descreader *r, char *str)
static const upb_msglayout_field google_protobuf_MessageOptions__fields[5]
static void decoder_pop(upb_pbdecoder *d)
@ UPB_DESCRIPTOR_TYPE_BOOL
static bool reserve(upb_pb_encoder *e, size_t bytes)
static void end_value_object(upb_json_parser *p)
const upb_msgdef * upbdefs_google_protobuf_UninterpretedOption_get(const void *owner)
static const upb_msglayout_field google_protobuf_FileDescriptorSet__fields[1]
bool upb_enum_done(upb_enum_iter *iter)
upb_def * upb_fielddef_subdef_mutable(upb_fielddef *f)
static void check(upb_inttable *t)
static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10]
static upb_value upb_toval(upb_msgval val)
bool upb_handlers_setendseq(upb_handlers *h, const upb_fielddef *f, upb_endfield_handlerfunc *func, const upb_handlerattr *attr)
static upb_tabent * getentry_mutable(upb_table *t, uint32_t hash)
@ UPB_DESCRIPTOR_TYPE_BYTES
bool upb_symtab_done(const upb_symtab_iter *iter)
static void checkref(const upb_refcounted *r, const void *owner, bool ref2)
static bool textprinter_startmsg(void *c, const void *hd)
static const upb_msgdef * refm(const upb_msgdef *m, const void *owner)
UPB_INLINE bool upb_bytessink_start(upb_bytessink s, size_t size_hint, void **subc)
uint64_t upb_pbdecoder_bytesparsed(const upb_pbdecoder *d)
upb_pbdecoder_frame * outer_frame(upb_pbdecoder *d)
static const char prefix[]
void upb_status_clear(upb_status *status)
bool eqlfunc_t(upb_tabkey k1, lookupkey_t k2)
UPB_INLINE size_t upb_table_size(const upb_table *t)
#define MSG_WRITER(type, ctype)
static bool upb_decode_64bitfield(upb_decstate *d, upb_decframe *frame, const char *field_start, const upb_msglayout_field *field)
static const double MIN_DENSITY
static void start_listvalue_object(upb_json_parser *p)
UPB_INLINE bool upb_sink_startmsg(upb_sink s)
static upb_array * upb_getorcreatearr(upb_decframe *frame, const upb_msglayout_field *field)
static void accumulate_clear(upb_json_parser *p)
static const char * enumdefaultstr(const upb_fielddef *f)
static bool upb_def_init(upb_def *def, upb_deftype_t type, const struct upb_refcounted_vtbl *vtbl, const void *owner)
const upb_msgdef * upbdefs_google_protobuf_ServiceDescriptorProto_get(const void *owner)
static const int json_en_timestamp_machine
bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val, upb_msgval *removed)
static const upb_msglayout *const google_protobuf_ServiceOptions_submsgs[1]
bool upb_array_set(upb_array *arr, size_t i, upb_msgval val)
static void generate_msgfield(compiler *c, const upb_fielddef *f, upb_pbdecodermethod *method)
bool upb_fielddef_ismap(const upb_fielddef *f)
UPB_INLINE void upb_bufhandle_init(upb_bufhandle *h)
static bool encode_unknown(void *c, const void *hd, const char *buf, size_t len)
static int32_t skip(upb_pbdecoder *d, size_t bytes)
void upb_fielddef_setpacked(upb_fielddef *f, bool packed)
static bool msg_endext(void *closure, const void *hd)
static void start_fieldmask_object(upb_json_parser *p)
const upb_oneofdef * upb_msgdef_ntoo(const upb_msgdef *m, const char *name, size_t len)
void upb_descreader_startcontainer(upb_descreader *r)
static bool upb_decode_varint(const char **ptr, const char *limit, uint64_t *val)
static void print_comma(upb_json_printer *p)
@ UPB_WELLKNOWN_INT32VALUE
static const upb_msglayout *const google_protobuf_ExtensionRangeOptions_submsgs[1]
static void start_frame(upb_json_printer *p)
bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val, upb_alloc *a)
static void start_hour(upb_json_parser *p, const char *ptr)
const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit
bool upb_inttable_init2(upb_inttable *t, upb_ctype_t ctype, upb_alloc *a)
static bool upb_isident(const char *str, size_t len, bool full, upb_status *s)
static int upb_msg_internalsize(const upb_msglayout *l)
int upb_msgdef_numoneofs(const upb_msgdef *m)
static void tarjan_newgroup(tarjan *t)
static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1]
bool upb_unknown_handlerfunc(void *c, const void *hd, const char *buf, size_t n)
static int32_t labelref(compiler *c, int label)
static bool end_number_nontop(upb_json_parser *p, const char *ptr)
static const upb_tabent * int_tabent(const upb_inttable_iter *i)
static upb_msgval upb_map_fromkey(upb_fieldtype_t type, const char *key, size_t len)
void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t)
static bool printer_endtimestampmsg(void *closure, const void *handler_data, upb_status *s)
upb_bytessink * upb_bufsink_sink(upb_bufsink *sink)
static void untrack(const upb_refcounted *r, const void *owner, bool ref2)
static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[1]
static bool end_membername(upb_json_parser *p)
void upb_inttable_iter_setdone(upb_inttable_iter *i)
#define UPB_DURATION_SECONDS
const void * upb_handlerattr_returnclosuretype(const upb_handlerattr *attr)
static bool enumdefaultint32(const upb_fielddef *f, int32_t *val)
static uint64_t repack(uint64_t dispatch, int new_wt2)
static size_t stringsink_string(void *_sink, const void *hd, const char *ptr, size_t len, const upb_bufhandle *handle)
static upb_selector_t getsel(const upb_fielddef *f, upb_handlertype_t type)
const upb_def * upb_symtab_lookup(const upb_symtab *s, const char *sym)
const upb_msglayout google_protobuf_FieldDescriptorProto_msginit
@ UPB_WIRE_TYPE_END_GROUP
bool upb_fielddef_setenumsubdef(upb_fielddef *f, const upb_enumdef *subdef, upb_status *s)
static void compile_method(compiler *c, upb_pbdecodermethod *method)
static upb_tabval int_arrent(const upb_inttable_iter *i)
bool upb_fielddef_issubmsg(const upb_fielddef *f)
upb_error_func * error_func_
const upb_msglayout google_protobuf_ServiceOptions_msginit
static const upb_msglayout_field google_protobuf_OneofOptions__fields[1]
static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1]
static void freecompiler(compiler *c)
static bool accumulate_realloc(upb_json_parser *p, size_t need)
bool upb_fielddef_checktype(int32_t type)
static void init_frame(upb_jsonparser_frame *frame)
GTEST_API_ const char * fmt
upb_fielddef * upb_fielddef_new(const void *o)
#define UPB_JSON_PRINTER_SIZE
static const upb_msglayout_field google_protobuf_SourceCodeInfo__fields[1]
static bool multipart_text(upb_json_parser *p, const char *buf, size_t len, bool can_alias)
static bool field_startmsg(void *closure, const void *hd)
static const double MAX_LOAD
@ UPB_WELLKNOWN_UNSPECIFIED
static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1]
static void start_structvalue_object(upb_json_parser *p)
const char * upb_msgdef_fullname(const upb_msgdef *m)
const upb_msgdef * upbdefs_google_protobuf_SourceCodeInfo_Location_get(const void *owner)
const struct upb_msglayout *const * submsgs
static uint8_t upb_msg_fielddefsize(const upb_fielddef *f)
static bool textprinter_endstr(void *closure, const void *handler_data)
const upb_enumdef * upbdefs_google_protobuf_FileOptions_OptimizeMode_get(const void *owner)
static bool commit(upb_pb_encoder *e)
UPB_INLINE void upb_strtable_uninit(upb_strtable *table)
void upb_handlerfree(void *d)
const char * upb_enumdef_iton(const upb_enumdef *def, int32_t num)
const upb_fielddef * upb_msgdef_itof(const upb_msgdef *m, uint32_t i)
bool upb_inttable_lookupptr(const upb_inttable *t, const void *key, upb_value *v)
const upb_pbdecodermethod * upb_pbcodecache_getdecodermethod(upb_pbcodecache *c, const upb_pbdecodermethodopts *opts)
@ UPB_WELLKNOWN_INT64VALUE
size_t upb_env_bytesallocated(const upb_env *e)
static bool start_fieldmask_path(upb_json_parser *p)
const char * upb_def_name(const upb_def *d)
void printer_sethandlers_fieldmask(const void *closure, upb_handlers *h)
static int32_t dispatch(upb_pbdecoder *d)
static void * upb_global_allocfunc(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
static upb_selector_t getsel_for_handlertype(upb_json_parser *p, upb_handlertype_t type)
static const upb_msglayout_field google_protobuf_FileOptions__fields[19]
UPB_INLINE bool upb_sink_startseq(upb_sink s, upb_selector_t sel, upb_sink *sub)
static UPB_NORETURN void err(tarjan *t)
static void start_month(upb_json_parser *p, const char *ptr)
void upb_env_free(upb_env *e, void *ptr)
static bool scalar_enum(void *closure, const void *handler_data, int32_t val)
static void start_wrapper_object(upb_json_parser *p)
static int putescaped(upb_textprinter *p, const char *buf, size_t len, bool preserve_utf8)
int back_labels[MAXLABEL]
static void setofs(uint32_t *instruction, int32_t ofs)
void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t)
#define PRIMITIVE_OP(type, wt, name, convfunc, ctype)
static void end_wrapper_object(upb_json_parser *p)
const upb_msgdef * upbdefs_google_protobuf_EnumOptions_get(const void *owner)
void upb_handlerattr_init(upb_handlerattr *attr)
static void new_tag(upb_handlers *h, const upb_fielddef *f, upb_wiretype_t wt, upb_handlerattr *attr)
#define UPB_MAX_FIELDNUMBER
const char * upb_filedef_phpnamespace(const upb_filedef *f)
static bool scalar_endstr(void *closure, const void *handler_data)
@ UPB_WIRE_TYPE_DELIMITED
bool upb_msgdef_mapentry(const upb_msgdef *m)
static bool parser_putbool(upb_json_parser *p, bool val)
bool upb_handlers_setuint32(upb_handlers *h, const upb_fielddef *f, upb_uint32_handlerfunc *func, const upb_handlerattr *attr)
static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2]
static bool upb_decode_32bitfield(upb_decstate *d, upb_decframe *frame, const char *field_start, const upb_msglayout_field *field)
static bool upb_isbetween(char c, char low, char high)
size_t upb_string_handlerfunc(void *c, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
static UPB_FORCEINLINE int32_t decode_fixed64(upb_pbdecoder *d, uint64_t *u64)
const upb_msgdef * upbdefs_google_protobuf_FileOptions_get(const void *owner)
static void assert_accumulate_empty(upb_json_parser *p)
const upb_msgdef * upbdefs_google_protobuf_EnumValueOptions_get(const void *owner)
void upb_pbdecoder_reset(upb_pbdecoder *d)
static bool is_wellknown_field(upb_json_parser *p, upb_wellknowntype_t type)
#define UPB_PB_DECODER_SIZE
static void set_lowlink(tarjan *t, const upb_refcounted *r, uint32_t lowlink)
static void start_timestamp_fraction(upb_json_parser *p, const char *ptr)
bool upb_oneof_done(upb_oneof_iter *iter)
void upb_cleanup_func(void *ud)
const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit
int32_t upb_pbdecoder_decode_f64(upb_pbdecoder *d, uint64_t *u64)
UPB_INLINE uint32_t upb_zzenc_32(int32_t n)
static void start_second(upb_json_parser *p, const char *ptr)
SETUP_TEARDOWN_TESTCONTEXT typedef uint8_t byte
static void * encode_startgroup(void *c, const void *hd)
static bool encode_fixed64(upb_pb_encoder *e, uint64_t val)
struct cleanup_ent cleanup_ent
const upb_byteshandler * upb_json_parsermethod_inputhandler(const upb_json_parsermethod *m)
strpc * newstrpc_str(upb_handlers *h, const char *str)
size_t upb_pbdecoder_maxnesting(const upb_pbdecoder *d)
void upb_symtab_next(upb_symtab_iter *iter)
static void visitoneof(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
static void * upb_array_add(upb_array *arr, size_t elements)
static void uninit(upb_table *t, upb_alloc *a)
bool upb_fieldtype_mapkeyok(upb_fieldtype_t type)
static void * file_startmsg(void *closure, const void *hd)
uint64_t offset(const upb_pbdecoder *d)
static upb_pbdecodermethod * newmethod(const upb_handlers *dest_handlers, mgroup *group)
static bool upb_encode_reserve(upb_encstate *e, size_t bytes)
bool upb_fielddef_setcontainingtypename(upb_fielddef *f, const char *name, upb_status *s)
const char * upb_def_fullname(const upb_def *d)
bool upb_env_addcleanup(upb_env *e, upb_cleanup_func *func, void *ud)
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_ExtensionRange_get(const void *owner)
const upb_msgdef * parent
static upb_refcounted * groupleader(tarjan *t, upb_refcounted *r)
static size_t repeated_bytes(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
void upb_msg_field_iter_setdone(upb_msg_field_iter *iter)
const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit
int cmp_fields(const void *p1, const void *p2)
UPB_INLINE bool upbdefs_google_protobuf_FileOptions_is(const upb_msgdef *m)
static const upb_msgdef msgs[22]
static void start_value_object(upb_json_parser *p, int value_type)
static bool end_second(upb_json_parser *p, const char *ptr)
static void set_name_table(upb_json_parser *p, upb_jsonparser_frame *frame)
static size_t field_onextendee(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
uint32_t individual_count
static const upb_msg_internal * upb_msg_getinternal_const(const upb_msg *msg)
const FieldDescriptor * field
const upb_msglayout google_protobuf_OneofDescriptorProto_msginit
UPB_INLINE upb_strview upb_strview_make(const char *data, size_t size)
static bool rm(upb_table *t, lookupkey_t key, upb_value *val, upb_tabkey *removed, uint32_t hash, eqlfunc_t *eql)
bool upb_handlerattr_sethandlerdata(upb_handlerattr *attr, const void *hd)
GLenum GLuint GLenum GLsizei const GLchar * buf
static void goto_endmsg(upb_pbdecoder *d)
static bool startmsg(void *c, const void *hd)
static void freehandlers(upb_refcounted *r)
UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e)
static size_t align_up_max(size_t size)
const SETUP_TEARDOWN_TESTCONTEXT char * key
const void * UPB_UNTRACKED_REF
static void capture_begin(upb_json_parser *p, const char *ptr)
static bool end_text(upb_json_parser *p, const char *ptr)
static bool upb_put_bytes(upb_encstate *e, const void *data, size_t len)
static bool pushtagdelim(upb_pbdecoder *d, uint32_t arg)
void upb_byteshandler_uninit(upb_byteshandler *h)
static bool encode_bytes(upb_pb_encoder *e, const void *data, size_t len)
char * upb_encode(const void *msg, const upb_msglayout *m, upb_arena *arena, size_t *size)
static uint32_t strhash(upb_tabkey key)
static void freemethod(upb_refcounted *r)
bool upb_handlers_setfloat(upb_handlers *h, const upb_fielddef *f, upb_float_handlerfunc *func, const upb_handlerattr *attr)
static bool enumval_endmsg(void *closure, const void *hd, upb_status *status)
static bool printer_starttimestampmsg(void *closure, const void *handler_data)
bool upb_msgdef_addfield(upb_msgdef *m, upb_fielddef *f, const void *ref_donor, upb_status *s)
size_t upb_bufhandle_objofs(const upb_bufhandle *h)
const char * before_type_url_end
upb_handlers * upb_handlers_new(const upb_msgdef *md, const void *owner)
static const int json_en_string_machine
static size_t repeated_str(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
static void * file_startenum(void *closure, const void *hd)
static size_t bufleft(const upb_pbdecoder *d)
bool upb_fielddef_setnumber(upb_fielddef *f, uint32_t number, upb_status *s)
static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[8]
static int indent(upb_textprinter *p)
static bool field_onlabel(void *closure, const void *hd, int32_t val)
upb_descreader_frame stack[UPB_MAX_MESSAGE_NESTING]
static void put32(compiler *c, uint32_t v)
UPB_INLINE bool upb_sink_endstr(upb_sink s, upb_selector_t sel)
static void release_containingtype(upb_fielddef *f)
@ UPB_DESCRIPTOR_TYPE_UINT32
static void end_fieldmask_object(upb_json_parser *p)
upb_stringsink stringsink
static uint8_t decoder[96]
UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e, const char *name, int32_t *num)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
bool upb_refcounted_freeze(upb_refcounted *const *roots, int n, upb_status *s, int maxdepth)
const upb_json_parsermethod const upb_symtab upb_sink bool ignore_json_unknown
UPB_INLINE bool upb_sink_endsubmsg(upb_sink s, upb_selector_t sel)
bool upb_handlers_setint32(upb_handlers *h, const upb_fielddef *f, upb_int32_handlerfunc *func, const upb_handlerattr *attr)
upb_symtab * upb_symtab_new()
const upb_symtab * symtab
const struct _upb_tabent * next
bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter)
bool upb_def_freeze(upb_def *const *defs, size_t n, upb_status *s)
static const upb_msglayout *const google_protobuf_SourceCodeInfo_submsgs[1]
static void upb_set32(void *msg, size_t ofs, uint32_t val)
static size_t upb_msgval_sizeof(upb_fieldtype_t type)
static int32_t getofs(uint32_t instruction)
static void start_any_member(upb_json_parser *p, const char *ptr)
static void capture_resume(upb_json_parser *p, const char *ptr)
bool upb_fielddef_checklabel(int32_t label)
static bool is_string_wrapper_object(upb_json_parser *p)
static bool lower_camel_push(upb_json_parser *p, upb_selector_t sel, const char *ptr, size_t len)
upb_json_parser * upb_json_parser_create(upb_env *env, const upb_json_parsermethod *method, const upb_symtab *symtab, upb_sink *output, bool ignore_json_unknown)
UPB_INLINE void * upb_realloc(upb_alloc *alloc, void *ptr, size_t oldsize, size_t size)
#define T(type, ctype, convert, encode)
static void start_day(upb_json_parser *p, const char *ptr)
UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c)
const upb_fielddef * mapfield
static size_t textprinter_putstr(void *closure, const void *hd, const char *buf, size_t len, const upb_bufhandle *handle)
static bool printer_endmsg(void *closure, const void *handler_data, upb_status *s)
static uint64_t upb_zzencode_64(int64_t n)
bool upb_fielddef_setname(upb_fielddef *f, const char *name, upb_status *s)
static const int json_en_duration_machine
static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs[2]
static void json_parser_reset(upb_json_parser *p)
static void * upb_array_reserve(upb_array *arr, size_t elements)
static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[10]
@ UPB_DESCRIPTOR_TYPE_MESSAGE
bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f, upb_startfield_handlerfunc *func, const upb_handlerattr *attr)
const upb_msgdef * upb_handlers_msgdef(const upb_handlers *h)
static uint32_t upb_zzencode_32(int32_t n)
static const upb_fielddef fields[107]
static bool upb_decode_field(upb_decstate *d, upb_decframe *frame)
bool upb_handlers_freeze(upb_handlers *const *handlers, int n, upb_status *s)
static void freemsg(upb_refcounted *r)
static int64_t upb_mktime(const struct tm *tp)
static int endfield(upb_textprinter *p)
size_t upb_arena_bytesallocated(const upb_arena *a)
static void set_bytecode_handlers(mgroup *g)
int parser_stack[UPB_JSON_MAX_DEPTH]
static size_t fmt_double(double val, char *buf, size_t length)
static uint64_t get_encoded_tag(const upb_fielddef *f, int wire_type)
const upb_filedef * upb_filedef_dep(const upb_filedef *f, size_t i)
static bool start_number(upb_json_parser *p, const char *ptr)
static upb_def * upb_resolvename(const upb_strtable *t, const char *base, const char *sym)
bool upb_handlers_setdouble(upb_handlers *h, const upb_fielddef *f, upb_double_handlerfunc *func, const upb_handlerattr *attr)
static const char kControlCharLimit
bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func)
#define UPB_UNREACHABLE()
static bool isfull(upb_table *t)
static bool upb_encode_array(upb_encstate *e, const char *field_mem, const upb_msglayout *m, const upb_msglayout_field *f)
static bool file_endext(void *closure, const void *hd)
static const upb_msglayout_field google_protobuf_FieldOptions__fields[7]
#define UPB_INTTABLE_INIT(count, mask, ctype, size_lg2, ent, a, asize, acount)
bool upb_fielddef_setmsgsubdef(upb_fielddef *f, const upb_msgdef *subdef, upb_status *s)
const char * after_type_url_start
@ UPB_DESCRIPTOR_TYPE_SINT32
static upb_oneofdef * upb_descreader_getoneof(upb_descreader *r, uint32_t index)
static size_t file_onphpnamespace(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
void printer_sethandlers_listvalue(const void *closure, upb_handlers *h)
static bool end_fieldmask_path_text(upb_json_parser *p, const char *ptr)
int32_t b64lookup(unsigned char ch)
static void * repeated_startstr_fieldmask(void *closure, const void *handler_data, size_t size_hint)
bool upb_msgdef_setfullname(upb_msgdef *m, const char *fullname, upb_status *s)
bool upb_byteshandler_setstartstr(upb_byteshandler *h, upb_startstr_handlerfunc *func, void *d)
const upb_pbdecodermethod * upb_pbdecodermethod_new(const upb_pbdecodermethodopts *opts, const void *owner)
static void upb_map_tokey(upb_fieldtype_t type, upb_msgval *key, const char **out_key, size_t *out_len)
static void freegroup(upb_refcounted *r)
static void set_delim_end(upb_pbdecoder *d)
@ UPB_WELLKNOWN_FLOATVALUE
static bool upb_decode_fixedpacked(upb_array *arr, upb_strview data, int elem_size)
bool upb_enumdef_setdefault(upb_enumdef *e, int32_t val, upb_status *s)
bool nonbase64(unsigned char ch)
static void * startseq_nokey(void *closure, const void *handler_data)
upb_msgval upb_array_get(const upb_array *arr, size_t i)
UPB_INLINE bool upbdefs_google_protobuf_FieldDescriptorProto_is(const upb_msgdef *m)
static void * textprinter_startstr(void *closure, const void *handler_data, size_t size_hint)
static const int json_en_number_machine
#define UPB_DURATION_NANOS
static int32_t trygetsel(upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type)
UPB_INLINE upb_alloc * upb_arena_alloc(upb_arena *a)
upb_json_parsermethod * upb_json_parsermethod_new(const upb_msgdef *md, const void *owner)
UPB_INLINE bool upbdefs_google_protobuf_MessageOptions_is(const upb_msgdef *m)
static void freefiledef(upb_refcounted *r)
void upb_msg_field_next(upb_msg_field_iter *iter)
const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Type_get(const void *owner)
bool upb_inttable_sizedinit(upb_inttable *t, upb_ctype_t ctype, size_t asize, int hsize_lg2, upb_alloc *a)
static bool does_string_wrapper_end(upb_json_parser *p)
static size_t scalar_str(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
static const upb_tabent intentries[18]
static void end_structvalue_object(upb_json_parser *p)
static bool upb_msg_inoneof(const upb_msglayout_field *field)
const UPB_INLINE void * upb_handlers_gethandlerdata(const upb_handlers *h, upb_selector_t s)
static void * upb_calloc(size_t size)
size_t delim_remaining(const upb_pbdecoder *d)
static upb_def * upb_descreader_last(upb_descreader *r)
upb_msgdef * upb_fielddef_containingtype_mutable(upb_fielddef *f)
UPB_INLINE void upb_bytessink_reset(upb_bytessink *s, const upb_byteshandler *h, void *closure)
const upb_oneofdef * upb_fielddef_containingoneof(const upb_fielddef *f)
UPB_INLINE bool upb_sink_startsubmsg(upb_sink s, upb_selector_t sel, upb_sink *sub)
upb_byteshandler input_handler_
@ UPB_WELLKNOWN_LISTVALUE
const char * kPbDecoderSubmessageTooLong
upb_deftype_t upb_def_type(const upb_def *d)
@ UPB_DESCRIPTOR_TYPE_INT32
static bool printer_endmsg_fieldmask(void *closure, const void *handler_data, upb_status *s)
static UPB_FORCEINLINE int32_t decode_varint(upb_pbdecoder *d, uint64_t *u64)
static void * fileset_startfile(void *closure, const void *hd)
static void advance(upb_pbdecoder *d, size_t len)
bool upb_pbdecoder_end(void *closure, const void *handler_data)
static bool upb_validate_enumdef(const upb_enumdef *e, upb_status *s)
static upb_handlers * newformsg(const upb_msgdef *m, const void *owner, dfs_state *s)
static bool upb_descreader_qualify(upb_filedef *f, char *str, int32_t start)
const upb_handlers * upb_handlers_newfrozen(const upb_msgdef *m, const void *owner, upb_handlers_callback *callback, const void *closure)
upb_sink * upb_textprinter_input(upb_textprinter *p)
static int parse_timestamp_number(upb_json_parser *p)
UPB_INLINE uint64_t upb_zzenc_64(int64_t n)
const upb_def * upb_filedef_def(const upb_filedef *f, size_t i)
#define UPB_TABKEY_NUM(n)
static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2]
static bool is_fieldmask_object(upb_json_parser *p)
void * upb_env_realloc(upb_env *e, void *ptr, size_t oldsize, size_t size)
upb_json_printer * upb_json_printer_create(upb_env *e, const upb_handlers *h, upb_bytessink *output)
char msg[UPB_STATUS_MAX_MESSAGE]
#define UPB_TIMESTAMP_SECONDS
const upb_msglayout google_protobuf_MethodDescriptorProto_msginit
static UPB_FORCEINLINE int32_t decode_fixed32(upb_pbdecoder *d, uint32_t *u32)
static void start_fieldmask_path_text(upb_json_parser *p, const char *ptr)
static size_t file_onsyntax(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
bool upb_msgdef_freeze(upb_msgdef *m, upb_status *status)
static bool end_any_stringval(upb_json_parser *p)
static bool field_onlazy(void *closure, const void *hd, bool val)
void upb_handlers_callback(const void *closure, upb_handlers *h)
zend_class_entry * value_type
static void hexdigit(upb_json_parser *p, const char *ptr)
static void * textprinter_startsubmsg(void *closure, const void *handler_data)
const upb_msglayout google_protobuf_FileDescriptorProto_msginit
char * upb_strdup(const char *s, upb_alloc *a)
bool upb_msg_setscalarhandler(upb_handlers *h, const upb_fielddef *f, size_t offset, int32_t hasbit)
static UPB_NOINLINE int32_t getbytes_slow(upb_pbdecoder *d, void *buf, size_t bytes)
const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit
bool upb_handlerattr_setalwaysok(upb_handlerattr *attr, bool alwaysok)
static void print_enum_symbolic_name(upb_json_printer *p, const upb_enumdef *def, int32_t val)
static bool field_ononeofindex(void *closure, const void *hd, int32_t index)
static size_t encode_strbuf(void *c, const void *hd, const char *buf, size_t len, const upb_bufhandle *h)
static void * startseq_fieldmask(void *closure, const void *handler_data)
static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3]
#define UPB_STRING_SELECTOR
void upb_oneof_iter_setdone(upb_oneof_iter *iter)
static void upb_msglayout_free(upb_msglayout *l)
const upb_handlers * upb_descreader_newhandlers(const void *owner)
static void json_parser_any_frame_set_before_type_url_end(upb_jsonparser_any_frame *frame, const char *ptr)
const upb_fielddef * upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num)
static bool end_bool(upb_json_parser *p, bool val)
static upb_refcounted * pop(tarjan *t)
UPB_INLINE size_t upb_bytessink_putbuf(upb_bytessink s, void *subc, const char *buf, size_t size, const upb_bufhandle *handle)
UPB_NOINLINE int32_t upb_pbdecoder_decode_varint_slow(upb_pbdecoder *d, uint64_t *u64)
bool upb_msgdef_isnumberwrapper(const upb_msgdef *m)
const upb_def * upb_symtab_iter_def(const upb_symtab_iter *iter)
#define DEREF(msg, ofs, type)
static void * scalar_startsubmsg(void *closure, const void *handler_data)
static size_t fmt_int64_as_number(long long val, char *buf, size_t length)
static bool doset(upb_handlers *h, int32_t sel, const upb_fielddef *f, upb_handlertype_t type, upb_func *func, upb_handlerattr *attr)
size_t upb_array_size(const upb_array *arr)
static bool putseconds(void *closure, const void *handler_data, int64_t seconds)
const char * upb_fielddef_fullname(const upb_fielddef *e)
const char * upb_oneofdef_name(const upb_oneofdef *o)
bool upb_handlers_getattr(const upb_handlers *h, upb_selector_t sel, upb_handlerattr *attr)
static const upb_tabent * upb_getentry(const upb_table *t, uint32_t hash)
bool upb_fielddef_enumhasdefaultstr(const upb_fielddef *f)
const char * upb_fielddef_containingtypename(upb_fielddef *f)
static void advancetobuf(upb_pbdecoder *d, const char *buf, size_t len)
#define UPB_FIELDDEF_INIT(label, type, intfmt, tagdelim, is_extension, lazy, packed, name, num, msgdef, subdef, selector_base, index, defaultval, refs, ref2s)
upb_func * upb_handlers_gethandler(const upb_handlers *h, upb_selector_t s, const void **handler_data)
static const upb_msglayout *const google_protobuf_DescriptorProto_ExtensionRange_submsgs[1]
static const short _json_index_offsets[]
const upb_msglayout google_protobuf_UninterpretedOption_msginit
void upb_inttable_next(upb_inttable_iter *iter)
static bool escape(upb_json_parser *p, const char *ptr)
static lookupkey_t intkey(uintptr_t key)
static void end_subobject_full(upb_json_parser *p)
static bool msg_endfield(void *closure, const void *hd)
const upb_msgdef * upbdefs_google_protobuf_DescriptorProto_ReservedRange_get(const void *owner)
int upb_enumdef_numvals(const upb_enumdef *e)
const upb_json_parsermethod * m
static void putsel(compiler *c, opcode op, upb_selector_t sel, const upb_handlers *h)
UPB_PRIVATE_FOR_CPP upb_strtable_iter iter
static bool endmap(void *closure, const void *handler_data)
bool upb_fielddef_checkdescriptortype(int32_t type)
const upb_msgdef * upbdefs_google_protobuf_ServiceOptions_get(const void *owner)
const upb_enumdef * upb_symtab_lookupenum(const upb_symtab *s, const char *sym)
void upb_fielddef_settagdelim(upb_fielddef *f, bool tag_delim)
static bool upb_put_fixed32(upb_encstate *e, uint32_t val)
@ UPB_DESCRIPTOR_TYPE_ENUM
static void advance_to_matching(upb_symtab_iter *iter)
static size_t field_ontypename(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
bool upb_msg_has(const upb_msg *msg, int field_index, const upb_msglayout *l)
static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6]
size_t upb_map_size(const upb_map *map)
static compiler * newcompiler(mgroup *group, bool lazy)
const upb_msglayout google_protobuf_FileOptions_msginit
size_t upb_mapiter_sizeof()
static void freeenum(upb_refcounted *r)
void * upb_startstr_handlerfunc(void *c, const void *hd, size_t size_hint)
const char * upb_strtable_iter_key(const upb_strtable_iter *i)
static size_t div_round_up(size_t n, size_t d)
static upb_ctype_t upb_fieldtotabtype(upb_fieldtype_t type)
static void add_jsonname_table(upb_json_parsermethod *m, const upb_msgdef *md)
UPB_INLINE uint32_t upb_inthash(uintptr_t key)
UPB_INLINE upb_msgval upb_msgval_makestr(const char *data, size_t size)
upb_oneofdef * upb_oneofdef_new(const void *owner)
static bool is_top_level(upb_json_parser *p)
static uint32_t * upb_msg_oneofcase(const upb_msg *msg, int field_index, const upb_msglayout *l)
static bool printer_enddurationmsg(void *closure, const void *handler_data, upb_status *s)
@ UPB_DESCRIPTOR_TYPE_SINT64
const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit
static bool unrefgroup(uint32_t *group)
void upb_fielddef_setisextension(upb_fielddef *f, bool is_extension)
UPB_INLINE bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val)
const upb_bufhandle * handle
void upb_strtable_uninit2(upb_strtable *t, upb_alloc *a)
static void push(tarjan *t, const upb_refcounted *r)
UPB_INLINE void upb_inttable_compact(upb_inttable *t)
const struct upb_refcounted_vtbl upb_filedef_vtbl
UPB_INLINE bool upb_bytessink_end(upb_bytessink s)
static void upb_fielddef_init_default(upb_fielddef *f)
static void print_data(upb_json_printer *p, const char *buf, unsigned int len)
static void * msg_startfield(void *closure, const void *hd)
UPB_INLINE bool is_json_escaped(char c)
static void putbuf(upb_pb_encoder *e, const char *buf, size_t len)
static size_t repeated_str_fieldmask(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
static void start_object(upb_json_parser *p)
upb_mapiter * upb_mapiter_new(const upb_map *t, upb_alloc *a)
static bool json_parser_any_frame_has_value(upb_jsonparser_any_frame *frame)
static bool is_number_wrapper_object(upb_json_parser *p)
static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3]
#define UPB_TABVALUE_PTR_INIT(v)
uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f)
const upb_fielddef * upb_oneofdef_ntof(const upb_oneofdef *o, const char *name, size_t length)
void upb_mapiter_begin(upb_mapiter *i, const upb_map *map)
static size_t suspend_save(upb_pbdecoder *d)
void printer_sethandlers_timestamp(const void *closure, upb_handlers *h)
bool op_has_longofs(int32_t instruction)
upb_label_t upb_fielddef_label(const upb_fielddef *f)
static const char _json_trans_targs[]
static size_t begin(const upb_table *t)
upb_msgval upb_mapiter_value(const upb_mapiter *i)
static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2]
bool upb_fielddef_isextension(const upb_fielddef *f)
void upb_fielddef_setdefaultbool(upb_fielddef *f, bool value)
UPB_INLINE void * upb_gmalloc(size_t size)
static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5]
static void upb_setoneofcase(upb_decframe *frame, const upb_msglayout_field *field)
static bool upb_decode_message(upb_decstate *d, const char *limit, int group_number, char *msg, const upb_msglayout *l)
static bool parse_default(char *str, upb_fielddef *f)
int64_t epoch(int year, int yday, int hour, int min, int sec)
static const upb_tabent * str_tabent(const upb_strtable_iter *i)
bool upb_fielddef_enumhasdefaultint32(const upb_fielddef *f)
static void visit(const upb_refcounted *r, upb_refcounted_visit *v, void *closure)
void upb_symtab_begin(upb_symtab_iter *iter, const upb_symtab *s, upb_deftype_t type)
uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i)
static bool lookup(const upb_table *t, lookupkey_t key, upb_value *v, uint32_t hash, eqlfunc_t *eql)
#define UPB_JSON_PARSER_SIZE
static bool upb_decode_tag(const char **ptr, const char *limit, int *field_number, int *wire_type)
UPB_INLINE void upb_inttable_uninit(upb_inttable *table)
static void freeobj(upb_refcounted *o)
UPB_INLINE bool upbdefs_google_protobuf_OneofDescriptorProto_is(const upb_msgdef *m)
static upb_selector_t handlers_getsel(upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type)
const upb_enumdef * upbdefs_google_protobuf_FieldDescriptorProto_Label_get(const void *owner)
upb_cleanup_func * cleanup
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static void freeoneof(upb_refcounted *r)
static bool end_hour(upb_json_parser *p, const char *ptr)
void upb_upberr_setoom(upb_status *status)
UPB_INLINE bool upbdefs_google_protobuf_DescriptorProto_is(const upb_msgdef *m)
static upb_msgdef * upb_descreader_top(upb_descreader *r)
const char * kPbDecoderStackOverflow
static void reghandlers(const void *closure, upb_handlers *h)
static bool checked_add(size_t a, size_t b, size_t *c)
static bool upb_put_fixedarray(upb_encstate *e, const upb_array *arr, size_t size)
const upb_byteshandler * upb_pbdecodermethod_inputhandler(const upb_pbdecodermethod *m)
upb_fielddef * upb_msg_iter_field(const upb_msg_field_iter *iter)
UPB_INLINE void * upb_grealloc(void *ptr, size_t oldsize, size_t size)
static bool check_stack(upb_json_parser *p)
static bool encode_varint(upb_pb_encoder *e, uint64_t val)
const upb_msgdef * upbdefs_google_protobuf_OneofDescriptorProto_get(const void *owner)
static upb_array * upb_getarr(upb_decframe *frame, const upb_msglayout_field *field)
const upb_msglayout google_protobuf_DescriptorProto_msginit
static const upb_tabval * inttable_val_const(const upb_inttable *t, uintptr_t key)
#define STRINGIFY_MACROVAL(x)
bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v)
bool upb_oneofdef_addfield(upb_oneofdef *o, upb_fielddef *f, const void *ref_donor, upb_status *s)
static void * scalar_startstr(void *closure, const void *handler_data, size_t size_hint)
bool upb_oneofdef_setname(upb_oneofdef *o, const char *name, upb_status *s)
const uint8_t upb_pb_native_wire_types[]
static bool mapvalue_enum(void *closure, const void *handler_data, int32_t val)
static void json_parser_any_frame_free(upb_jsonparser_any_frame *frame)
upb_jsonparser_frame * limit
const char * before_type_url_start
const void * closure_type_
bool upb_map_del(upb_map *map, upb_msgval key)
bool upb_fielddef_setsubdefname(upb_fielddef *f, const char *name, upb_status *s)
const upb_msgdef * upbdefs_google_protobuf_FileDescriptorProto_get(const void *owner)
size_t upb_strtable_iter_keylength(const upb_strtable_iter *i)
static bool end_day(upb_json_parser *p, const char *ptr)
upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f)
static const upb_msglayout *const google_protobuf_EnumOptions_submsgs[1]
const upb_handlers * dest_handlers_
static const char _json_trans_keys[]
static upb_msg_internal_withext * upb_msg_getinternalwithext(upb_msg *msg, const upb_msglayout *l)
const upb_msglayout google_protobuf_EnumValueOptions_msginit
static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12]
static uint64_t trygetattr(const tarjan *t, const upb_refcounted *r)
const char * upb_enum_iter_name(upb_enum_iter *iter)
void * upb_pbdecoder_startjit(void *closure, const void *hd, size_t size_hint)
static bool check_field_add(const upb_msgdef *m, const upb_fielddef *f, upb_status *s)
static bool assign_msg_indices(upb_msgdef *m, upb_status *s)
bool upb_float_handlerfunc(void *c, const void *hd, float val)
static const char * accumulate_getptr(upb_json_parser *p, size_t *len)
UPB_INLINE char * upb_gstrdup(const char *s)
const upb_symtab * symtab
static void accumulate(upb_pb_encoder *e)
UPB_INLINE char * upb_tabstr(upb_tabkey key, uint32_t *len)
#define UPB_TIMESTAMP_MAX_JSON_LEN
upb_sink * upb_descreader_input(upb_descreader *r)
bool upb_mapiter_done(const upb_mapiter *i)
const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit
static void start_year(upb_json_parser *p, const char *ptr)
UPB_INLINE void upb_bufhandle_setbuf(upb_bufhandle *h, const char *buf, size_t ofs)
UPB_INLINE void * upb_malloc(upb_alloc *alloc, size_t size)
const upb_enumdef * upbdefs_google_protobuf_FieldOptions_JSType_get(const void *owner)
static color_t color(tarjan *t, const upb_refcounted *r)
static size_t upb_msgval_sizeof2(upb_fieldtype_t type)
static UPB_NOINLINE size_t peekbytes_slow(upb_pbdecoder *d, void *buf, size_t bytes)
static bool endseq(void *closure, const void *handler_data)
static bool freeze(upb_refcounted *const *roots, int n, upb_status *s, int maxdepth)
const upb_msglayout google_protobuf_FileDescriptorSet_msginit
#define UPB_PB_ENCODER_SIZE
GLsizei const GLfloat * value
void printer_sethandlers(const void *closure, upb_handlers *h)
static bool upb_skip_unknowngroup(upb_decstate *d, int field_number, const char *limit)
#define UPB_STARTSTR_SELECTOR
static uint32_t upb_readcase(const char *msg, const upb_msglayout_field *f)
static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1]
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo_Annotation__fields[4]
UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key, upb_value *v)
@ UPB_WELLKNOWN_FIELDMASK
void upb_msg_oneof_next(upb_msg_oneof_iter *iter)
static char * upb_decode_prepareslot(upb_decframe *frame, const upb_msglayout_field *field)
static void generate_delimfield(compiler *c, const upb_fielddef *f, upb_pbdecodermethod *method)
static size_t upb_msg_sizeof(const upb_msglayout *l)
bool upb_handlers_setunknown(upb_handlers *h, upb_unknown_handlerfunc *func, upb_handlerattr *attr)
bool upb_msgdef_setsyntax(upb_msgdef *m, upb_syntax_t syntax)
void upb_bufsink_free(upb_bufsink *sink)
static size_t fmt_bool(bool val, char *buf, size_t length)
static void set_gray(tarjan *t, const upb_refcounted *r)
static void json_parser_any_frame_set_payload_type(upb_json_parser *p, upb_jsonparser_any_frame *frame, const upb_msgdef *payload_type)
UPB_INLINE bool upb_inttable_push(upb_inttable *t, upb_value val)
#define WRAPPER_SETHANDLERS(wrapper, type, putmethod)
static const upb_msglayout_field google_protobuf_MethodOptions__fields[3]
static upb_tabent * findentry_mutable(upb_table *t, lookupkey_t key, uint32_t hash, eqlfunc_t *eql)
static size_t upb_roundup_pow2(size_t bytes)
static bool mapkey_endstr(void *closure, const void *handler_data)
bool upb_encode_message(upb_encstate *e, const char *msg, const upb_msglayout *m, size_t *size)
@ UPB_DESCRIPTOR_TYPE_GROUP
const upb_msglayout google_protobuf_EnumOptions_msginit
static bool start_subobject(upb_json_parser *p)
const upb_json_parsermethod const upb_symtab upb_sink * output
static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3]
@ UPB_WELLKNOWN_UINT32VALUE
static void * scalar_startstr_onlykey(void *closure, const void *handler_data, size_t size_hint)
uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f)
bool upb_msg_getscalarhandlerdata(const upb_handlers *h, upb_selector_t s, upb_fieldtype_t *type, size_t *offset, int32_t *hasbit)
static bool upb_put_double(upb_encstate *e, double d)
static bool file_end(void *closure, const void *hd, upb_status *status)
static bool write_err_to(void *ud, const upb_status *status)
static bool enumval_startmsg(void *closure, const void *hd)
static bool end_timestamp_fraction(upb_json_parser *p, const char *ptr)
const upb_enumdef * enumdef
void upb_arena_init2(upb_arena *a, void *mem, size_t size, upb_alloc *alloc)
upb_oneofdef * upb_msg_iter_oneof(const upb_msg_oneof_iter *iter)
bool upb_uint32_handlerfunc(void *c, const void *hd, uint32_t val)
static bool enumval_onnumber(void *closure, const void *hd, int32_t val)
#define SUBH(h, selector)
UPB_INLINE size_t upb_strtable_count(const upb_strtable *t)
static bool start_any_stringval(upb_json_parser *p)
#define UPB_TIMESTAMP_BEFORE_NANO_LEN
#define UPB_EMPTY_INTTABLE_INIT(ctype)
#define VARINT_CASE(ctype, decode)
static void sethandlers(mgroup *g, bool allowjit)
bool upb_handlers_setstartmsg(upb_handlers *h, upb_startmsg_handlerfunc *func, upb_handlerattr *attr)
bool upb_strtable_done(const upb_strtable_iter *i)
static bool putnanos(void *closure, const void *handler_data, int32_t nanos)
upb_jsonparser_frame stack[UPB_JSON_MAX_DEPTH]
static size_t enum_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
const upb_tabent * entries
upb_msgfactory * upb_msgfactory_new(const upb_symtab *symtab)
static uint32_t * group(tarjan *t, upb_refcounted *r)
@ UPB_DESCRIPTOR_TYPE_SFIXED64
static UPB_FORCEINLINE int32_t getbytes(upb_pbdecoder *d, void *buf, size_t bytes)
GLboolean GLboolean GLboolean GLboolean a
bool upb_fielddef_setdefaultstr(upb_fielddef *f, const void *str, size_t len, upb_status *s)
void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len)
static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_submsgs[1]
size_t upb_filedef_defcount(const upb_filedef *f)
#define UPB_STARTMSG_SELECTOR
void upb_status_seterrf(upb_status *status, const char *fmt,...)
upb_decoderet upb_vdecode_max8_branch64(upb_decoderet r)
static bool end(void *closure, const void *hd)
static uint32_t flt2uint32(float d)
bool upb_dumptostderr(void *closure, const upb_status *status)
static void upb_decode_setpresent(upb_decframe *frame, const upb_msglayout_field *field)
const char * upb_bufsink_getdata(const upb_bufsink *sink, size_t *len)
const char * upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len)
size_t parse(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle)
static void trackfree(const upb_refcounted *r)
static size_t putbytes(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
bool upb_msg_field_done(const upb_msg_field_iter *iter)
bool upb_startmsg_handlerfunc(void *c, const void *)
int32_t upb_pbdecoder_skipunknown(upb_pbdecoder *d, int32_t fieldnum, uint8_t wire_type)
static uint64_t dbl2uint64(double d)
static char * upb_join(const char *base, const char *name)
static void visitmethod(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line)
size_t run_decoder_vm(upb_pbdecoder *d, const mgroup *group, const upb_bufhandle *handle)
UPB_INLINE uint64_t upb_pbdecoder_packdispatch(uint64_t ofs, uint8_t wt1, uint8_t wt2)
static bool end_stringval_nontop(upb_json_parser *p)
static void trackinit(upb_refcounted *r)
bool upb_endmsg_handlerfunc(void *c, const void *, upb_status *status)
upb_intfmt_t upb_fielddef_intfmt(const upb_fielddef *f)
static bool in_residual_buf(const upb_pbdecoder *d, const char *p)
static bool end_any_membername(upb_json_parser *p)
static upb_msg_internal * upb_msg_getinternal(upb_msg *msg)
static lookupkey_t strkey2(const char *str, size_t len)
#define CASE(ctype, type, wire_type, encodeval)
const char * upb_enumdef_name(const upb_enumdef *e)
#define VOIDPTR_AT(msg, ofs)
upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m)
bool upb_handlerattr_setreturnclosuretype(upb_handlerattr *attr, const void *type)
static size_t field_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle)
static bool between(int32_t x, int32_t low, int32_t high)
void upb_fielddef_setintfmt(upb_fielddef *f, upb_intfmt_t fmt)
static void maybeput(compiler *c, opcode op, const upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type)
@ UPB_DESCRIPTOR_TYPE_STRING
void upb_strtable_iter_setdone(upb_strtable_iter *i)
static void multipart_end(upb_json_parser *p)
static const unsigned char _json_trans_actions[]
const uint8_t upb_desctype_to_fieldtype[]
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val, upb_ctype_t ctype)
static const upb_enumdef * refe(const upb_enumdef *e, const void *owner)
static void onmreg(const void *c, upb_handlers *h)
upb_strtable * name_table
upb_textprinter * upb_textprinter_create(upb_env *env, const upb_handlers *h, upb_bytessink *output)
static void json_printer_reset(upb_json_printer *p)
@ UPB_DESCRIPTOR_TYPE_DOUBLE
bool upb_handlers_setint64(upb_handlers *h, const upb_fielddef *f, upb_int64_handlerfunc *func, const upb_handlerattr *attr)
static bool printer_endmsg_noframe(void *closure, const void *handler_data, upb_status *s)
const upb_msgdef * upb_oneofdef_containingtype(const upb_oneofdef *o)
static void nullz(upb_status *status)
void upb_enum_begin(upb_enum_iter *i, const upb_enumdef *e)
static str_t * newstr(const char *data, size_t len)
static void * startmap(void *closure, const void *handler_data)
static void * encode_startdelimfield(void *c, const void *hd)
const Descriptor::ReservedRange const EnumValueDescriptor method
bool upb_def_setfullname(upb_def *def, const char *fullname, upb_status *s)
void upb_pbdecoder_jit(mgroup *group)
GLfloat GLfloat GLfloat GLfloat h
static bool textprinter_endmsg(void *c, const void *hd, upb_status *s)
static bool accumulate_append(upb_json_parser *p, const char *buf, size_t len, bool can_alias)
UPB_INLINE bool upb_filedef_addenum(upb_filedef *f, upb_enumdef *e, const void *ref_donor, upb_status *s)
static void visit_json_parsermethod(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
zend_class_entry * descriptor_type
upb_errorspace upb_upberr
upb_syntax_t upb_filedef_syntax(const upb_filedef *f)
upb_fieldtype_t upb_array_type(const upb_array *arr)
static const char _json_single_lengths[]
const upb_msglayout * upb_msgfactory_getlayout(upb_msgfactory *f, const upb_msgdef *m)
bool upb_mapiter_isequal(const upb_mapiter *i1, const upb_mapiter *i2)
uint32_t upb_oneofdef_index(const upb_oneofdef *o)
static upb_tabval * mutable_array(upb_inttable *t)
static const void ** returntype(upb_handlers *h, const upb_fielddef *f, upb_handlertype_t type)
static double as_double(uint64_t n)
static void visitmsg(const upb_refcounted *r, upb_refcounted_visit *visit, void *closure)
bool upb_strtable_init2(upb_strtable *t, upb_ctype_t ctype, upb_alloc *a)
static upb_msgval upb_msgval_fromval(upb_value val)
bool upb_handlers_setuint64(upb_handlers *h, const upb_fielddef *f, upb_uint64_handlerfunc *func, const upb_handlerattr *attr)
static const char * kUnterminatedVarint
@ UPB_WELLKNOWN_DOUBLEVALUE
static void upb_sethasbit(upb_decframe *frame, const upb_msglayout_field *field)
UPB_INLINE bool upbdefs_google_protobuf_EnumValueDescriptorProto_is(const upb_msgdef *m)
const upb_msgdef * upbdefs_google_protobuf_EnumDescriptorProto_get(const void *owner)
bool upb_fielddef_setsubdef(upb_fielddef *f, const upb_def *subdef, upb_status *s)
upb_descreader * upb_descreader_create(upb_env *e, const upb_handlers *h)
static bool upb_decode_submsg(upb_decstate *d, upb_decframe *frame, const char *limit, const upb_msglayout_field *field, int group_number)
static bool upb_decode_toarray(upb_decstate *d, upb_decframe *frame, const char *field_start, const upb_msglayout_field *field, upb_strview val)
UPB_INLINE bool upb_sink_endmsg(upb_sink s, upb_status *status)
bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f, upb_string_handlerfunc *func, const upb_handlerattr *attr)
static char * upb_gstrndup(const char *buf, size_t n)
static size_t putstr(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
bool upb_fielddef_lazy(const upb_fielddef *f)
static const upb_msglayout_field google_protobuf_DescriptorProto_ReservedRange__fields[2]
static size_t curbufleft(const upb_pbdecoder *d)
#define UPB_PB_VARINT_MAX_LEN
const upb_strtable * name_table
static size_t mapkey_bytes(void *closure, const void *handler_data, const char *str, size_t len, const upb_bufhandle *handle)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:01