bool is_map_field(const upb_fielddef *field) { const upb_msgdef* subdef = tryget_map_entry_msgdef(field); if (subdef == NULL) return false; // Map fields are a proto3 feature. // If we're using proto2 syntax we need to fallback to the repeated field. return upb_msgdef_syntax(subdef) == UPB_SYNTAX_PROTO3; }
const upb_msgdef *map_entry_msgdef(const upb_fielddef* field) { const upb_msgdef* subdef = tryget_map_entry_msgdef(field); assert(subdef); return subdef; }
bool is_map_field(const upb_fielddef *field) { return tryget_map_entry_msgdef(field) != NULL; }