Lines Matching defs:fields
396 if (l->fields[i].number == field_number) {
397 return &l->fields[i];
541 const upb_msglayout_field *key_field = &entry->fields[0];
542 const upb_msglayout_field *val_field = &entry->fields[1];
554 if (entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
555 entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_GROUP) {
1068 const upb_msglayout_field *key_field = &entry->fields[0];
1069 const upb_msglayout_field *val_field = &entry->fields[1];
1111 const upb_msglayout_field *f = &m->fields[i];
3027 /* Tables for looking up fields by number and name. */
3031 const upb_fielddef *fields;
3166 /* All submessage fields are lower than all other fields.
3167 * Secondly, fields are increasing in order. */
3212 /* Sort fields. upb internally relies on UPB_TYPE_MESSAGE fields having the
3218 upb_fielddef **fields;
3226 fields = upb_gmalloc(n * sizeof(*fields));
3227 if (!fields) {
3241 fields[i] = f;
3244 qsort(fields, n, sizeof(*fields), cmp_fields);
3248 upb_fielddef *f = fields[i];
3255 upb_gfree(fields);
3553 return &f->msgdef->layout->fields[f->layout_index];
3700 return &m->fields[i];
3742 /* We need to skip past any initial fields. */
3750 /* We need to skip past fields to return only oneofs. */
3895 * It computes a dynamic layout for all of the fields in |m|. */
3903 upb_msglayout_field *fields;
3908 fields = upb_malloc(alloc, upb_msgdef_numfields(m) * sizeof(*fields));
3911 if ((!fields && upb_msgdef_numfields(m)) ||
3918 l->fields = fields;
3926 fields[0].number = 1;
3927 fields[1].number = 2;
3928 fields[0].label = UPB_LABEL_OPTIONAL;
3929 fields[1].label = UPB_LABEL_OPTIONAL;
3930 fields[0].presence = 0;
3931 fields[1].presence = 0;
3932 fields[0].descriptortype = upb_fielddef_descriptortype(key);
3933 fields[1].descriptortype = upb_fielddef_descriptortype(val);
3934 fields[0].offset = 0;
3935 fields[1].offset = sizeof(upb_strview);
3936 fields[1].submsg_index = 0;
3950 * 2. regular fields.
3951 * 3. oneof fields.
3962 upb_msglayout_field *field = &fields[upb_fielddef_index(f)];
3974 /* TODO: we probably should sort the fields by field number to match the
3996 /* Allocate non-oneof fields. */
4008 fields[index].offset = upb_msglayout_place(l, field_size);
4011 /* Allocate oneof fields. Each oneof field consists of a uint32 for the case
4041 fields[upb_fielddef_index(f)].offset = data_offset;
4042 fields[upb_fielddef_index(f)].presence = ~case_offset;
4393 f = (upb_fielddef*)&m->fields[m->field_count++];
4427 const upb_msglayout_field *fields = m->layout->fields;
4432 if (fields[i].number == field_number) {
4463 upb_status_seterrf(ctx->status, "proto3 fields cannot be required (%s)",
4476 "fields in oneof must have OPTIONAL label (%s)",
4584 const google_protobuf_FieldDescriptorProto *const *fields;
4624 fields = google_protobuf_DescriptorProto_field(msg_proto, &n);
4626 m->fields = upb_malloc(ctx->alloc, sizeof(*m->fields) * n);
4628 CHK(create_fielddef(ctx, m->full_name, m, fields[i]));
4737 "proto3 fields cannot have explicit defaults (%s)",
4744 "message fields cannot have explicit defaults (%s)",
4888 CHK(resolve_fielddef(ctx, m->full_name, (upb_fielddef*)&m->fields[j]));
6103 /* For fields marked "lazy", parse them lazily or eagerly? */
6569 * start vending unknown fields, a field shouldn't be treated as unknown
6749 /* If there were no fields, or if no handlers were defined, we need to
6751 * fields and check for the end of the message. */
6800 * Others will be parsed as unknown fields. */
7525 /* Unknown group -- continue looping over unknown fields. */
7573 /* We have some unknown fields (or ENDGROUP) to parse. The DISPATCH or TAG
8977 ** - properly check and report errors for unknown fields, stack overflow,
10215 /* For STRING fields we push data directly to the handlers as it is
10216 * parsed. We don't do this yet for BYTES fields, because our base64
11445 const char *membername = "fields";
12425 * repeated fields and messages (maps), and the worst case is a
12626 * startseq for repeated fields. */
13037 * fields explicitly here. */
13498 /* Set up handlers for a timestamp submessage. Instead of printing fields