Lines Matching defs:field

175 /* Maps descriptor type -> upb field type.  */
229 /* Op: an action to be performed for a wire-type/field-type combination. */
237 -1, /* field not found */
259 /* For non-repeated field type. */
260 -1, /* field not found */
279 /* For repeated field type. */
305 uint32_t end_group; /* Set to field number of END_GROUP tag, if any. */
401 return &none; /* Unknown field. */
405 const upb_msglayout_field *field) {
406 const upb_msglayout *subl = layout->submsgs[field->submsg_index];
412 const upb_msglayout_field *field, upb_strview val) {
413 const upb_msglayout *subl = layout->submsgs[field->submsg_index];
436 const upb_msglayout_field *field) {
437 const upb_msglayout *subl = layout->submsgs[field->submsg_index];
438 return decode_group(d, ptr, submsg, subl, field->number);
443 const upb_msglayout_field *field, wireval val,
445 upb_array **arrp = UPB_PTR_AT(msg, field->offset, void);
450 upb_fieldtype_t type = desctype_to_fieldtype[field->descriptortype];
476 upb_msg *submsg = decode_newsubmsg(d, layout, field);
480 if (UPB_UNLIKELY(field->descriptortype == UPB_DTYPE_GROUP)) {
481 ptr = decode_togroup(d, ptr, submsg, layout, field);
483 decode_tosubmsg(d, submsg, layout, field, val.str_val);
514 decode_munge(field->descriptortype, &elem);
532 const upb_msglayout_field *field, wireval val) {
533 upb_map **map_p = UPB_PTR_AT(msg, field->offset, upb_map *);
536 const upb_msglayout *entry = layout->submsgs[field->submsg_index];
540 const upb_msglayout *entry = layout->submsgs[field->submsg_index];
560 decode_tosubmsg(d, &ent.k, layout, field, val.str_val);
568 const upb_msglayout_field *field, wireval val,
570 void *mem = UPB_PTR_AT(msg, field->offset, void);
571 int type = field->descriptortype;
574 if (field->presence < 0) {
576 *UPB_PTR_AT(msg, -field->presence, int32_t) = field->number;
577 } else if (field->presence > 0) {
579 uint32_t hasbit = field->presence;
589 submsg = decode_newsubmsg(d, layout, field);
593 ptr = decode_togroup(d, ptr, submsg, layout, field);
595 decode_tosubmsg(d, submsg, layout, field, val.str_val);
622 const upb_msglayout_field *field;
633 field = upb_find_field(layout, field_number);
638 op = varint_ops[field->descriptortype];
639 decode_munge(field->descriptortype, &val);
646 if (((1 << field->descriptortype) & fixed32_ok) == 0) goto unknown;
653 if (((1 << field->descriptortype) & fixed64_ok) == 0) goto unknown;
657 int ndx = field->descriptortype;
658 if (_upb_isrepeated(field)) ndx += 18;
672 if (field->descriptortype != UPB_DTYPE_GROUP) goto unknown;
683 switch (field->label) {
686 ptr = decode_toarray(d, ptr, msg, layout, field, val, op);
689 decode_tomap(d, msg, layout, field, val);
692 ptr = decode_tomsg(d, ptr, msg, layout, field, val, op);
697 /* Skip unknown field. */
3956 /* Allocate hasbits and set basic field attributes. */
3962 upb_msglayout_field *field = &fields[upb_fielddef_index(f)];
3964 field->number = upb_fielddef_number(f);
3965 field->descriptortype = upb_fielddef_descriptortype(f);
3966 field->label = upb_fielddef_label(f);
3969 field->label = _UPB_LABEL_MAP;
3971 field->label = _UPB_LABEL_PACKED;
3974 /* TODO: we probably should sort the fields by field number to match the
3980 field->submsg_index = submsg_count++;
3981 submsgs[field->submsg_index] = subm->layout;
3987 field->presence = ++hasbit;
3989 field->presence = 0;
4011 /* Allocate oneof fields. Each oneof field consists of a uint32 for the case
4025 /* Calculate field size: the max of all field sizes. */
4179 "type mismatch when resolving field %s, name %s",
4365 upb_status_seterrmsg(ctx->status, "field has no name");
4384 upb_status_seterrf(ctx->status, "invalid field number (%u)", field_number);
4389 /* direct message field. */
4398 upb_status_seterrf(ctx->status, "duplicate field name (%s)", shortname);
4408 upb_status_seterrf(ctx->status, "duplicate field number (%u)",
4441 /* extension field. */
4483 "oneof_index provided for extension field (%s)",
4702 "extension for field '%s' had no extendee",
4714 upb_status_seterrf(ctx->status, "field '%s' is missing type name",
4752 "' for field (%s)",
5152 static bool in_oneof(const upb_msglayout_field *field) {
5153 return field->presence < 0;
5157 const upb_msglayout_field *field) {
5158 UPB_ASSERT(in_oneof(field));
5159 return UPB_PTR_AT(msg, -field->presence, uint32_t);
5163 const upb_msglayout_field *field = upb_fielddef_layout(f);
5164 const char *mem = UPB_PTR_AT(msg, field->offset, char);
5167 : field_size[field->descriptortype];
5173 const upb_msglayout_field *field = upb_fielddef_layout(f);
5174 if (in_oneof(field)) {
5175 return *oneofcase(msg, field) == field->number;
5176 } else if (field->presence > 0) {
5177 uint32_t hasbit = field->presence;
5180 UPB_ASSERT(field->descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
5181 field->descriptortype == UPB_DESCRIPTOR_TYPE_GROUP);
5189 const upb_msglayout_field *field;
5194 field = upb_fielddef_layout(f);
5195 return *oneofcase(msg, field) != 0;
5241 const upb_msglayout_field *field = upb_fielddef_layout(f);
5243 char *mem = UPB_PTR_AT(msg, field->offset, char);
5244 bool wrong_oneof = in_oneof(field) && *oneofcase(msg, field) != field->number;
5264 *oneofcase(msg, field) = field->number;
5272 const upb_msglayout_field *field = upb_fielddef_layout(f);
5273 char *mem = UPB_PTR_AT(msg, field->offset, char);
5275 : field_size[field->descriptortype];
5277 if (in_oneof(field)) {
5278 *oneofcase(msg, field) = field->number;
5291 /* Skip field if unset or empty. */
5425 upb_handlers_tabent table[1]; /* Dynamically-sized field handler array. */
5441 * subhandlers for this submessage field. */
5444 /* The selector for a submessage field is the field index. */
5691 /* STARTSUBMSG selector in sel is the field's selector base. */
5806 /* For each submessage field, get or create a handlers object and set it as
6480 * field, and wire type. */
6532 * this field and handler type. */
6551 #define LABEL_LOOPSTART 1 /* Top of a repeated field loop. */
6553 #define LABEL_FIELD 3 /* Jump backward to find the most recent field. */
6556 /* Generates bytecode to parse a single non-lazy message field. */
6564 /* Don't emit any code for this field at all; it will be parsed as an
6565 * unknown field.
6567 * TODO(haberman): we should change this to parse it as a string field
6569 * start vending unknown fields, a field shouldn't be treated as unknown
6617 /* Generates bytecode to parse a single string or lazy submessage field. */
6656 /* Generates bytecode to parse a single primitive field. */
6759 /* For now we just loop back to the last field of the message (or if none,
7435 * field number) prior to hitting any enclosing submessage end, pushing our
7477 seterr(d, "Saw invalid field number (0)");
7538 * field.
7540 * If the tag is unknown (or the wire type doesn't match), parses the field as
7581 /* Unknown field or ENDGROUP. */
8280 /* Allocates a new tag for this field, and sets it in these handlerattr. */
8440 /* Pre-encode the tag for this field. */
9117 /* For encoding Any value field in binary format. */
9121 /* For decoding Any value field in json format. */
9137 /* The current message in which we're parsing, and the field whose value we're
9145 /* We are in a repeated-field context. We need this flag to decide whether to
9146 * handle the array as a normal repeated field or a
9150 /* We are in a repeated-field context, ready to emit mapentries as
9156 * value field of a single map entry and indicates to all value-field parsers
9162 * message's map field that we're currently parsing. This differs from |f|
9163 * because |f| is the field in the *current* message (i.e., the map-entry
9164 * message itself), not the parent's field that leads to this map. */
9168 * message and indicates to all field parsers (subobjects, strings, numbers,
9169 * and bools) that the parsed field should be serialized as binary data or
9176 /* True if the field to be parsed is unknown. */
9232 /* Whether to proceed if unknown field is met. */
9458 "Base64 input for bytes field not a multiple of 4: %s",
9484 "Non-base64 characters in bytes field: %s",
9524 "Incorrect base64 padding for field: %s (%.*s)",
9635 * processing (field name lookup, string->number conversion, etc). */
10053 "Boolean value specified for non-bool field: %s",
10130 /* Fill null_value field. */
10235 "String specified for bool or submessage field: %s",
10798 * field based on the current contents of the accumulate buffer. */
10804 /* Emit the key field. We do a bit of ad-hoc parsing here because the
10805 * parser state machine has already decided that this is a string field
10854 upb_status_seterrmsg(p->status, "Invalid field type for map key");
10861 /* Helper: emit one map entry (as a submessage in the map field sequence). This
10866 * value parser (invoked next) will emit the mapentry's value field and then
10877 * value field is parsed, and also set a flag to end the frame after the
10892 * the key field value to the sink, and these handlers will pop the frame
10903 /* Set up the value field to receive the map-entry value. */
10943 upb_status_seterrf(p->status, "No such field: %.*s\n", (int)len, buf);
10978 /* send ENDSUBMSG in repeated-field-of-mapentries frame. */
11011 /* Beginning of a map. Start a new parser frame in a repeated-field
11050 "Object specified for non-message/group field: %s",
11157 "Array specified for non-repeated field: %s",
11235 /* Well known types data is represented as value field. */
12278 /* Since the JSON name is different from the regular field name, add an
12426 * message->repeated field->submessage->repeated field->... nesting. */
12625 /* Print a map key given a field name. Called by scalar field handlers and by
13029 * field, and then one value field), so this is not a pressing concern at the
13451 /* This is not the full and correct JSON encoding for the Any value field. It