From 229fcf7119b06385eb6440e54916f871b8bbc323 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 27 Jun 2010 13:19:25 -0700 Subject: upb_def compiles again, though with lots of #if 0. --- descriptor/descriptor_const.h | 128 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) (limited to 'descriptor') diff --git a/descriptor/descriptor_const.h b/descriptor/descriptor_const.h index 36af6f9..42205a6 100644 --- a/descriptor/descriptor_const.h +++ b/descriptor/descriptor_const.h @@ -46,6 +46,134 @@ typedef enum google_protobuf_FileOptions_OptimizeMode { GOOGLE_PROTOBUF_FILEOPTIONS_SPEED = 1 } google_protobuf_FileOptions_OptimizeMode; +/* Constants for field names and numbers. */ + +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_FIELDNUM 1 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_FIELDNAME "name_part" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_IS_EXTENSION_FIELDNUM 2 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_IS_EXTENSION_FIELDNAME "is_extension" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_FIELDNUM 2 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_FIELDNAME "field" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_FIELDNUM 3 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_FIELDNAME "nested_type" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_FIELDNUM 4 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_FIELDNAME "enum_type" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_FIELDNUM 5 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_RANGE_FIELDNAME "extension_range" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_FIELDNUM 6 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSION_FIELDNAME "extension" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_OPTIONS_FIELDNUM 7 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_FIELDNUM 2 +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_FIELDNAME "value" +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_OPTIONS_FIELDNUM 3 +#define GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_FIELDNUM 2 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_IDENTIFIER_VALUE_FIELDNUM 3 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_IDENTIFIER_VALUE_FIELDNAME "identifier_value" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_POSITIVE_INT_VALUE_FIELDNUM 4 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_POSITIVE_INT_VALUE_FIELDNAME "positive_int_value" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NEGATIVE_INT_VALUE_FIELDNUM 5 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NEGATIVE_INT_VALUE_FIELDNAME "negative_int_value" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_DOUBLE_VALUE_FIELDNUM 6 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_DOUBLE_VALUE_FIELDNAME "double_value" +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_STRING_VALUE_FIELDNUM 7 +#define GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_STRING_VALUE_FIELDNAME "string_value" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PACKAGE_FIELDNUM 2 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_PACKAGE_FIELDNAME "package" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_FIELDNUM 3 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_DEPENDENCY_FIELDNAME "dependency" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_FIELDNUM 4 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_FIELDNAME "message_type" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_FIELDNUM 5 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_FIELDNAME "enum_type" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_FIELDNUM 6 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_FIELDNAME "service" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_FIELDNUM 7 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_EXTENSION_FIELDNAME "extension" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_OPTIONS_FIELDNUM 8 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_INPUT_TYPE_FIELDNUM 2 +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_INPUT_TYPE_FIELDNAME "input_type" +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_FIELDNUM 3 +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_FIELDNAME "output_type" +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_FIELDNUM 4 +#define GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NUMBER_FIELDNUM 2 +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NUMBER_FIELDNAME "number" +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_FIELDNUM 3 +#define GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_FIELDNUM 2 +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_FIELDNAME "method" +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_OPTIONS_FIELDNUM 3 +#define GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_FIELDNUM 1 +#define GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_FIELDNAME "file" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_START_FIELDNUM 1 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_START_FIELDNAME "start" +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_END_FIELDNUM 2 +#define GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_END_FIELDNAME "end" +#define GOOGLE_PROTOBUF_FIELDOPTIONS_CTYPE_FIELDNUM 1 +#define GOOGLE_PROTOBUF_FIELDOPTIONS_CTYPE_FIELDNAME "ctype" +#define GOOGLE_PROTOBUF_FIELDOPTIONS_PACKED_FIELDNUM 2 +#define GOOGLE_PROTOBUF_FIELDOPTIONS_PACKED_FIELDNAME "packed" +#define GOOGLE_PROTOBUF_FIELDOPTIONS_DEPRECATED_FIELDNUM 3 +#define GOOGLE_PROTOBUF_FIELDOPTIONS_DEPRECATED_FIELDNAME "deprecated" +#define GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_FIELDNUM 9 +#define GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_FIELDNAME "experimental_map_key" +#define GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_PACKAGE_FIELDNUM 1 +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_PACKAGE_FIELDNAME "java_package" +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_OUTER_CLASSNAME_FIELDNUM 8 +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_OUTER_CLASSNAME_FIELDNAME "java_outer_classname" +#define GOOGLE_PROTOBUF_FILEOPTIONS_OPTIMIZE_FOR_FIELDNUM 9 +#define GOOGLE_PROTOBUF_FILEOPTIONS_OPTIMIZE_FOR_FIELDNAME "optimize_for" +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_MULTIPLE_FILES_FIELDNUM 10 +#define GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_MULTIPLE_FILES_FIELDNAME "java_multiple_files" +#define GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_MESSAGEOPTIONS_MESSAGE_SET_WIRE_FORMAT_FIELDNUM 1 +#define GOOGLE_PROTOBUF_MESSAGEOPTIONS_MESSAGE_SET_WIRE_FORMAT_FIELDNAME "message_set_wire_format" +#define GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_FIELDNUM 1 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_FIELDNAME "name" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_EXTENDEE_FIELDNUM 2 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_EXTENDEE_FIELDNAME "extendee" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NUMBER_FIELDNUM 3 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NUMBER_FIELDNAME "number" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_FIELDNUM 4 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_FIELDNAME "label" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_FIELDNUM 5 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_FIELDNAME "type" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_NAME_FIELDNUM 6 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_NAME_FIELDNAME "type_name" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_FIELDNUM 7 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_FIELDNAME "default_value" +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_FIELDNUM 8 +#define GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_FIELDNAME "options" +#define GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" +#define GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_FIELDNUM 999 +#define GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_FIELDNAME "uninterpreted_option" #ifdef __cplusplus } /* extern "C" */ #endif -- cgit v1.2.3 From a7eaeaaaeca7f0860ecd690f5861e7d72259bf68 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 7 Jul 2010 10:21:39 -0700 Subject: Change descriptor.c/h to be just a byte array of serialized descriptor.proto. --- descriptor/descriptor.c | 2643 ++++++----------------------------------------- descriptor/descriptor.h | 407 +------- 2 files changed, 308 insertions(+), 2742 deletions(-) (limited to 'descriptor') diff --git a/descriptor/descriptor.c b/descriptor/descriptor.c index c722b25..cd50a16 100644 --- a/descriptor/descriptor.c +++ b/descriptor/descriptor.c @@ -1,2351 +1,294 @@ -/* - * This file is a data dump of a protocol buffer into a C structure. - * It was created by the upb compiler (upbc) with the following - * command-line: - * - * ./tools/upbc -i upb_file_descriptor_set -o descriptor/descriptor descriptor/descriptor.proto.pb - * - * This file is a dump of 'descriptor/descriptor.proto.pb'. - * It contains exactly the same data, but in a C structure form - * instead of a serialized protobuf. This file contains no code, - * only data. - * - * This file was auto-generated. Do not edit. */ - -#include "descriptor/descriptor.h" - -static char strdata[] = - ".google.protobuf.DescriptorProto.google.protobuf.DescriptorProto.ExtensionRan" - "ge.google.protobuf.EnumDescriptorProto.google.protobuf.EnumOptions.google.pro" - "tobuf.EnumValueDescriptorProto.google.protobuf.EnumValueOptions.google.protob" - "uf.FieldDescriptorProto.google.protobuf.FieldDescriptorProto.Label.google.pro" - "tobuf.FieldDescriptorProto.Type.google.protobuf.FieldOptions.google.protobuf." - "FieldOptions.CType.google.protobuf.FileDescriptorProto.google.protobuf.FileOp" - "tions.google.protobuf.FileOptions.OptimizeMode.google.protobuf.MessageOptions" - ".google.protobuf.MethodDescriptorProto.google.protobuf.MethodOptions.google.p" - "rotobuf.ServiceDescriptorProto.google.protobuf.ServiceOptions.google.protobuf" - ".UninterpretedOption.google.protobuf.UninterpretedOption.NamePartCODE_SIZECOR" - "DCTypeDescriptorProtoDescriptorProtosEnumDescriptorProtoEnumOptionsEnumValueD" - "escriptorProtoEnumValueOptionsExtensionRangeFieldDescriptorProtoFieldOptionsF" - "ileDescriptorProtoFileDescriptorSetFileOptionsLABEL_OPTIONALLABEL_REPEATEDLAB" - "EL_REQUIREDLabelMessageOptionsMethodDescriptorProtoMethodOptionsNamePartOptim" - "izeModeSPEEDSTRING_PIECEServiceDescriptorProtoServiceOptionsTYPE_BOOLTYPE_BYT" - "ESTYPE_DOUBLETYPE_ENUMTYPE_FIXED32TYPE_FIXED64TYPE_FLOATTYPE_GROUPTYPE_INT32T" - "YPE_INT64TYPE_MESSAGETYPE_SFIXED32TYPE_SFIXED64TYPE_SINT32TYPE_SINT64TYPE_STR" - "INGTYPE_UINT32TYPE_UINT64TypeUninterpretedOptioncom.google.protobufctypedefau" - "lt_valuedependencydeprecateddescriptor/descriptor.protodouble_valueendenum_ty" - "peexperimental_map_keyextendeeextensionextension_rangefalsefieldfilegoogle.pr" - "otobufidentifier_valueinput_typeis_extensionjava_multiple_filesjava_outer_cla" - "ssnamejava_packagelabelmessage_set_wire_formatmessage_typemethodnamename_part" - "negative_int_valuenested_typenumberoptimize_foroptionsoutput_typepackagepacke" - "dpositive_int_valueservicestartstring_valuetypetype_nameuninterpreted_optionv" - "alue"; - -static upb_static_string strings[] = { - UPB_STATIC_STRING_INIT_LEN(&strdata[0], 32), - UPB_STATIC_STRING_INIT_LEN(&strdata[32], 47), - UPB_STATIC_STRING_INIT_LEN(&strdata[79], 36), - UPB_STATIC_STRING_INIT_LEN(&strdata[115], 28), - UPB_STATIC_STRING_INIT_LEN(&strdata[143], 41), - UPB_STATIC_STRING_INIT_LEN(&strdata[184], 33), - UPB_STATIC_STRING_INIT_LEN(&strdata[217], 37), - UPB_STATIC_STRING_INIT_LEN(&strdata[254], 43), - UPB_STATIC_STRING_INIT_LEN(&strdata[297], 42), - UPB_STATIC_STRING_INIT_LEN(&strdata[339], 29), - UPB_STATIC_STRING_INIT_LEN(&strdata[368], 35), - UPB_STATIC_STRING_INIT_LEN(&strdata[403], 36), - UPB_STATIC_STRING_INIT_LEN(&strdata[439], 28), - UPB_STATIC_STRING_INIT_LEN(&strdata[467], 41), - UPB_STATIC_STRING_INIT_LEN(&strdata[508], 31), - UPB_STATIC_STRING_INIT_LEN(&strdata[539], 38), - UPB_STATIC_STRING_INIT_LEN(&strdata[577], 30), - UPB_STATIC_STRING_INIT_LEN(&strdata[607], 39), - UPB_STATIC_STRING_INIT_LEN(&strdata[646], 31), - UPB_STATIC_STRING_INIT_LEN(&strdata[677], 36), - UPB_STATIC_STRING_INIT_LEN(&strdata[713], 45), - UPB_STATIC_STRING_INIT_LEN(&strdata[758], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[767], 4), - UPB_STATIC_STRING_INIT_LEN(&strdata[771], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[776], 15), - UPB_STATIC_STRING_INIT_LEN(&strdata[791], 16), - UPB_STATIC_STRING_INIT_LEN(&strdata[807], 19), - UPB_STATIC_STRING_INIT_LEN(&strdata[826], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[837], 24), - UPB_STATIC_STRING_INIT_LEN(&strdata[861], 16), - UPB_STATIC_STRING_INIT_LEN(&strdata[877], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[891], 20), - UPB_STATIC_STRING_INIT_LEN(&strdata[911], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[923], 19), - UPB_STATIC_STRING_INIT_LEN(&strdata[942], 17), - UPB_STATIC_STRING_INIT_LEN(&strdata[959], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[970], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[984], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[998], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[1012], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1017], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[1031], 21), - UPB_STATIC_STRING_INIT_LEN(&strdata[1052], 13), - UPB_STATIC_STRING_INIT_LEN(&strdata[1065], 8), - UPB_STATIC_STRING_INIT_LEN(&strdata[1073], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1085], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1090], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1102], 22), - UPB_STATIC_STRING_INIT_LEN(&strdata[1124], 14), - UPB_STATIC_STRING_INIT_LEN(&strdata[1138], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1147], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1157], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1168], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1177], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1189], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1201], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1211], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1221], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1231], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1241], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1253], 13), - UPB_STATIC_STRING_INIT_LEN(&strdata[1266], 13), - UPB_STATIC_STRING_INIT_LEN(&strdata[1279], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1290], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1301], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1312], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1323], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1334], 4), - UPB_STATIC_STRING_INIT_LEN(&strdata[1338], 19), - UPB_STATIC_STRING_INIT_LEN(&strdata[1357], 19), - UPB_STATIC_STRING_INIT_LEN(&strdata[1376], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1381], 13), - UPB_STATIC_STRING_INIT_LEN(&strdata[1394], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1404], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1414], 27), - UPB_STATIC_STRING_INIT_LEN(&strdata[1441], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1453], 3), - UPB_STATIC_STRING_INIT_LEN(&strdata[1456], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1465], 20), - UPB_STATIC_STRING_INIT_LEN(&strdata[1485], 8), - UPB_STATIC_STRING_INIT_LEN(&strdata[1493], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1502], 15), - UPB_STATIC_STRING_INIT_LEN(&strdata[1517], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1522], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1527], 4), - UPB_STATIC_STRING_INIT_LEN(&strdata[1531], 15), - UPB_STATIC_STRING_INIT_LEN(&strdata[1546], 16), - UPB_STATIC_STRING_INIT_LEN(&strdata[1562], 10), - UPB_STATIC_STRING_INIT_LEN(&strdata[1572], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1584], 19), - UPB_STATIC_STRING_INIT_LEN(&strdata[1603], 20), - UPB_STATIC_STRING_INIT_LEN(&strdata[1623], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1635], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1640], 23), - UPB_STATIC_STRING_INIT_LEN(&strdata[1663], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1675], 6), - UPB_STATIC_STRING_INIT_LEN(&strdata[1681], 4), - UPB_STATIC_STRING_INIT_LEN(&strdata[1685], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1694], 18), - UPB_STATIC_STRING_INIT_LEN(&strdata[1712], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1723], 6), - UPB_STATIC_STRING_INIT_LEN(&strdata[1729], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1741], 7), - UPB_STATIC_STRING_INIT_LEN(&strdata[1748], 11), - UPB_STATIC_STRING_INIT_LEN(&strdata[1759], 7), - UPB_STATIC_STRING_INIT_LEN(&strdata[1766], 6), - UPB_STATIC_STRING_INIT_LEN(&strdata[1772], 18), - UPB_STATIC_STRING_INIT_LEN(&strdata[1790], 7), - UPB_STATIC_STRING_INIT_LEN(&strdata[1797], 5), - UPB_STATIC_STRING_INIT_LEN(&strdata[1802], 12), - UPB_STATIC_STRING_INIT_LEN(&strdata[1814], 4), - UPB_STATIC_STRING_INIT_LEN(&strdata[1818], 9), - UPB_STATIC_STRING_INIT_LEN(&strdata[1827], 20), - UPB_STATIC_STRING_INIT_LEN(&strdata[1847], 5), +unsigned char descriptor_pb[] = { + 0x0a, 0x9b, 0x1b, 0x0a, 0x1b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x22, 0x47, 0x0a, 0x11, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x12, 0x32, + 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xdc, 0x02, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x12, 0x0f, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x12, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x12, 0x36, 0x0a, 0x0c, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, + 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a, 0x09, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa9, 0x03, 0x0a, 0x0f, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x12, 0x34, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a, + 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x0b, 0x6e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x1a, 0x2c, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0d, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x12, 0x0b, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x22, 0x94, 0x05, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x12, 0x3a, 0x0a, 0x05, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x09, 0x74, 0x79, + 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x12, 0x10, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x15, 0x0a, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, + 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, + 0x36, 0x34, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x0e, 0x0a, + 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, + 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, + 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, + 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, + 0x4f, 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, + 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, + 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, + 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c, 0x12, + 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, + 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, + 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, + 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, 0x12, 0x0f, 0x0a, + 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, + 0x10, 0x11, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, + 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x12, 0x22, 0x43, 0x0a, 0x05, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, + 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, + 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, + 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, + 0x45, 0x44, 0x10, 0x03, 0x22, 0x8c, 0x01, 0x0a, 0x13, 0x45, 0x6e, 0x75, + 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x6c, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e, 0x0a, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x12, 0x32, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x16, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x36, + 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x15, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, + 0x12, 0x0a, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x13, 0x0a, 0x0b, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x0b, 0x46, 0x69, + 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, + 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x1c, 0x0a, 0x14, 0x6a, + 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x12, 0x22, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, + 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, + 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, + 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x05, 0x53, 0x50, 0x45, 0x45, + 0x44, 0x12, 0x43, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x28, + 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, + 0x64, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, + 0x5a, 0x45, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, + 0x80, 0x80, 0x02, 0x22, 0x88, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, + 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, + 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x12, 0x43, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, + 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x80, + 0x02, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x06, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x12, + 0x19, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x14, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x12, 0x43, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, + 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, + 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, + 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, + 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x5d, 0x0a, 0x0b, 0x45, 0x6e, 0x75, + 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, + 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, + 0x80, 0x80, 0x80, 0x02, 0x22, 0x62, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x43, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, + 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x60, 0x0a, 0x0e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, + 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x5f, + 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x43, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, + 0x85, 0x02, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, + 0x12, 0x18, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x12, 0x1a, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x12, 0x1a, 0x0a, 0x12, 0x6e, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x12, 0x14, + 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x12, 0x14, 0x0a, 0x0c, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x1a, 0x33, 0x0a, 0x08, 0x4e, 0x61, + 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x11, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, + 0x09, 0x12, 0x14, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x42, + 0x29, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01 }; - -/* Forward declarations of messages, and array decls. */ -static google_protobuf_DescriptorProto google_protobuf_DescriptorProto_values[18]; - -static google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_array_elems[] = { - &google_protobuf_DescriptorProto_values[0], - &google_protobuf_DescriptorProto_values[1], - &google_protobuf_DescriptorProto_values[2], - &google_protobuf_DescriptorProto_values[3], - &google_protobuf_DescriptorProto_values[4], - &google_protobuf_DescriptorProto_values[5], - &google_protobuf_DescriptorProto_values[6], - &google_protobuf_DescriptorProto_values[7], - &google_protobuf_DescriptorProto_values[8], - &google_protobuf_DescriptorProto_values[9], - &google_protobuf_DescriptorProto_values[10], - &google_protobuf_DescriptorProto_values[11], - &google_protobuf_DescriptorProto_values[12], - &google_protobuf_DescriptorProto_values[13], - &google_protobuf_DescriptorProto_values[14], - &google_protobuf_DescriptorProto_values[15], - &google_protobuf_DescriptorProto_values[16], - &google_protobuf_DescriptorProto_values[17], -}; -static upb_static_array google_protobuf_DescriptorProto_arrays[3] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_array_elems[0], 16), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_array_elems[16], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_array_elems[17], 1), -}; -static google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto_values[1]; - -static google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_array_elems[] = { - &google_protobuf_FileDescriptorProto_values[0], -}; -static upb_static_array google_protobuf_FileDescriptorProto_arrays[1] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_FileDescriptorProto_array_elems[0], 1), -}; -static google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet_values[1]; - -static google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange_values[7]; - -static google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_array_elems[] = { - &google_protobuf_DescriptorProto_ExtensionRange_values[0], - &google_protobuf_DescriptorProto_ExtensionRange_values[1], - &google_protobuf_DescriptorProto_ExtensionRange_values[2], - &google_protobuf_DescriptorProto_ExtensionRange_values[3], - &google_protobuf_DescriptorProto_ExtensionRange_values[4], - &google_protobuf_DescriptorProto_ExtensionRange_values[5], - &google_protobuf_DescriptorProto_ExtensionRange_values[6], -}; -static upb_static_array google_protobuf_DescriptorProto_ExtensionRange_arrays[7] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[0], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[1], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[2], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[3], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[4], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[5], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_DescriptorProto_ExtensionRange_array_elems[6], 1), -}; -static google_protobuf_FileOptions google_protobuf_FileOptions_values[1]; - -static google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto_values[4]; - -static google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_array_elems[] = { - &google_protobuf_EnumDescriptorProto_values[0], - &google_protobuf_EnumDescriptorProto_values[1], - &google_protobuf_EnumDescriptorProto_values[2], - &google_protobuf_EnumDescriptorProto_values[3], -}; -static upb_static_array google_protobuf_EnumDescriptorProto_arrays[3] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumDescriptorProto_array_elems[0], 2), - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumDescriptorProto_array_elems[2], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumDescriptorProto_array_elems[3], 1), -}; -static google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_values[63]; - -static google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_array_elems[] = { - &google_protobuf_FieldDescriptorProto_values[0], - &google_protobuf_FieldDescriptorProto_values[1], - &google_protobuf_FieldDescriptorProto_values[2], - &google_protobuf_FieldDescriptorProto_values[3], - &google_protobuf_FieldDescriptorProto_values[4], - &google_protobuf_FieldDescriptorProto_values[5], - &google_protobuf_FieldDescriptorProto_values[6], - &google_protobuf_FieldDescriptorProto_values[7], - &google_protobuf_FieldDescriptorProto_values[8], - &google_protobuf_FieldDescriptorProto_values[9], - &google_protobuf_FieldDescriptorProto_values[10], - &google_protobuf_FieldDescriptorProto_values[11], - &google_protobuf_FieldDescriptorProto_values[12], - &google_protobuf_FieldDescriptorProto_values[13], - &google_protobuf_FieldDescriptorProto_values[14], - &google_protobuf_FieldDescriptorProto_values[15], - &google_protobuf_FieldDescriptorProto_values[16], - &google_protobuf_FieldDescriptorProto_values[17], - &google_protobuf_FieldDescriptorProto_values[18], - &google_protobuf_FieldDescriptorProto_values[19], - &google_protobuf_FieldDescriptorProto_values[20], - &google_protobuf_FieldDescriptorProto_values[21], - &google_protobuf_FieldDescriptorProto_values[22], - &google_protobuf_FieldDescriptorProto_values[23], - &google_protobuf_FieldDescriptorProto_values[24], - &google_protobuf_FieldDescriptorProto_values[25], - &google_protobuf_FieldDescriptorProto_values[26], - &google_protobuf_FieldDescriptorProto_values[27], - &google_protobuf_FieldDescriptorProto_values[28], - &google_protobuf_FieldDescriptorProto_values[29], - &google_protobuf_FieldDescriptorProto_values[30], - &google_protobuf_FieldDescriptorProto_values[31], - &google_protobuf_FieldDescriptorProto_values[32], - &google_protobuf_FieldDescriptorProto_values[33], - &google_protobuf_FieldDescriptorProto_values[34], - &google_protobuf_FieldDescriptorProto_values[35], - &google_protobuf_FieldDescriptorProto_values[36], - &google_protobuf_FieldDescriptorProto_values[37], - &google_protobuf_FieldDescriptorProto_values[38], - &google_protobuf_FieldDescriptorProto_values[39], - &google_protobuf_FieldDescriptorProto_values[40], - &google_protobuf_FieldDescriptorProto_values[41], - &google_protobuf_FieldDescriptorProto_values[42], - &google_protobuf_FieldDescriptorProto_values[43], - &google_protobuf_FieldDescriptorProto_values[44], - &google_protobuf_FieldDescriptorProto_values[45], - &google_protobuf_FieldDescriptorProto_values[46], - &google_protobuf_FieldDescriptorProto_values[47], - &google_protobuf_FieldDescriptorProto_values[48], - &google_protobuf_FieldDescriptorProto_values[49], - &google_protobuf_FieldDescriptorProto_values[50], - &google_protobuf_FieldDescriptorProto_values[51], - &google_protobuf_FieldDescriptorProto_values[52], - &google_protobuf_FieldDescriptorProto_values[53], - &google_protobuf_FieldDescriptorProto_values[54], - &google_protobuf_FieldDescriptorProto_values[55], - &google_protobuf_FieldDescriptorProto_values[56], - &google_protobuf_FieldDescriptorProto_values[57], - &google_protobuf_FieldDescriptorProto_values[58], - &google_protobuf_FieldDescriptorProto_values[59], - &google_protobuf_FieldDescriptorProto_values[60], - &google_protobuf_FieldDescriptorProto_values[61], - &google_protobuf_FieldDescriptorProto_values[62], -}; -static upb_static_array google_protobuf_FieldDescriptorProto_arrays[18] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[0], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[1], 8), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[9], 7), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[16], 2), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[18], 8), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[26], 3), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[29], 3), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[32], 3), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[35], 4), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[39], 5), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[44], 2), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[46], 5), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[51], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[52], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[53], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[54], 1), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[55], 6), - UPB_STATIC_ARRAY_INIT(&google_protobuf_FieldDescriptorProto_array_elems[61], 2), -}; -static google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto_values[25]; - -static google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_array_elems[] = { - &google_protobuf_EnumValueDescriptorProto_values[0], - &google_protobuf_EnumValueDescriptorProto_values[1], - &google_protobuf_EnumValueDescriptorProto_values[2], - &google_protobuf_EnumValueDescriptorProto_values[3], - &google_protobuf_EnumValueDescriptorProto_values[4], - &google_protobuf_EnumValueDescriptorProto_values[5], - &google_protobuf_EnumValueDescriptorProto_values[6], - &google_protobuf_EnumValueDescriptorProto_values[7], - &google_protobuf_EnumValueDescriptorProto_values[8], - &google_protobuf_EnumValueDescriptorProto_values[9], - &google_protobuf_EnumValueDescriptorProto_values[10], - &google_protobuf_EnumValueDescriptorProto_values[11], - &google_protobuf_EnumValueDescriptorProto_values[12], - &google_protobuf_EnumValueDescriptorProto_values[13], - &google_protobuf_EnumValueDescriptorProto_values[14], - &google_protobuf_EnumValueDescriptorProto_values[15], - &google_protobuf_EnumValueDescriptorProto_values[16], - &google_protobuf_EnumValueDescriptorProto_values[17], - &google_protobuf_EnumValueDescriptorProto_values[18], - &google_protobuf_EnumValueDescriptorProto_values[19], - &google_protobuf_EnumValueDescriptorProto_values[20], - &google_protobuf_EnumValueDescriptorProto_values[21], - &google_protobuf_EnumValueDescriptorProto_values[22], - &google_protobuf_EnumValueDescriptorProto_values[23], - &google_protobuf_EnumValueDescriptorProto_values[24], -}; -static upb_static_array google_protobuf_EnumValueDescriptorProto_arrays[4] = { - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumValueDescriptorProto_array_elems[0], 18), - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumValueDescriptorProto_array_elems[18], 3), - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumValueDescriptorProto_array_elems[21], 2), - UPB_STATIC_ARRAY_INIT(&google_protobuf_EnumValueDescriptorProto_array_elems[23], 2), -}; -static google_protobuf_DescriptorProto google_protobuf_DescriptorProto_values[18] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[34]), /* "FileDescriptorSet" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[0]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[33]), /* "FileDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[1]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = true, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[24]), /* "DescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[2]), - .nested_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_arrays[1]), - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = true, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[31]), /* "FieldDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[4]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumDescriptorProto_arrays[0]), - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[26]), /* "EnumDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[5]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[28]), /* "EnumValueDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[6]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[47]), /* "ServiceDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[7]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[41]), /* "MethodDescriptorProto" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[8]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = true, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[35]), /* "FileOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[9]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumDescriptorProto_arrays[1]), - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[0]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[40]), /* "MessageOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[10]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[1]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = true, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[32]), /* "FieldOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[11]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumDescriptorProto_arrays[2]), - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[2]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[27]), /* "EnumOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[12]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[3]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[29]), /* "EnumValueOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[13]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[4]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[48]), /* "ServiceOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[14]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[5]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = true, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[42]), /* "MethodOptions" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[15]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_ExtensionRange_arrays[6]), - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = true, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[68]), /* "UninterpretedOption" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[16]), - .nested_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_arrays[2]), - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[30]), /* "ExtensionRange" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[3]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .field = true, - .nested_type = false, - .enum_type = false, - .extension_range = false, - .extension = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[43]), /* "NamePart" */ - .field = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FieldDescriptorProto_arrays[17]), - .nested_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension_range = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = 0, /* Not set. */ - }, -}; -static google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto_values[1] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .package = true, - .dependency = false, - .message_type = true, - .enum_type = false, - .service = false, - .extension = false, - .options = true, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[74]), /* "descriptor/descriptor.proto" */ - .package = UPB_STATIC_STRING_PTR_INIT(strings[85]), /* "google.protobuf" */ - .dependency = UPB_ARRAY_NULL_INITIALIZER, /* Not set. */ - .message_type = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_DescriptorProto_arrays[0]), - .enum_type = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .service = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .extension = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - .options = &google_protobuf_FileOptions_values[0], - }, -}; -static google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet_values[1] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .file = true, - }}, - .file = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_FileDescriptorProto_arrays[0]), - }, -}; -static google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange_values[7] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .start = true, - .end = true, - }}, - .start = 1000, - .end = 536870912, - }, -}; -static google_protobuf_FileOptions google_protobuf_FileOptions_values[1] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .java_package = true, - .java_outer_classname = true, - .optimize_for = true, - .java_multiple_files = false, - .uninterpreted_option = false, - }}, - .java_package = UPB_STATIC_STRING_PTR_INIT(strings[69]), /* "com.google.protobuf" */ - .java_outer_classname = UPB_STATIC_STRING_PTR_INIT(strings[25]), /* "DescriptorProtos" */ - .optimize_for = 1, - .java_multiple_files = 0, /* Not set. */ - .uninterpreted_option = {UPB_ARRAY_NULL_INITIALIZER}, /* Not set. */ - }, -}; -static google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto_values[4] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[67]), /* "Type" */ - .value = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumValueDescriptorProto_arrays[0]), - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[39]), /* "Label" */ - .value = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumValueDescriptorProto_arrays[1]), - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[44]), /* "OptimizeMode" */ - .value = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumValueDescriptorProto_arrays[2]), - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[23]), /* "CType" */ - .value = UPB_STATIC_ARRAY_PTR_TYPED_INIT(google_protobuf_EnumValueDescriptorProto_arrays[3]), - .options = 0, /* Not set. */ - }, -}; -static google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto_values[63] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[84]), /* "file" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[11]), /* ".google.protobuf.FileDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[104]), /* "package" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[72]), /* "dependency" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 3, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[94]), /* "message_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 4, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[0]), /* ".google.protobuf.DescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[77]), /* "enum_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 5, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[2]), /* ".google.protobuf.EnumDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[107]), /* "service" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 6, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[17]), /* ".google.protobuf.ServiceDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[80]), /* "extension" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 7, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[6]), /* ".google.protobuf.FieldDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 8, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[12]), /* ".google.protobuf.FileOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[83]), /* "field" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[6]), /* ".google.protobuf.FieldDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[99]), /* "nested_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[0]), /* ".google.protobuf.DescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[77]), /* "enum_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 4, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[2]), /* ".google.protobuf.EnumDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[81]), /* "extension_range" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 5, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[1]), /* ".google.protobuf.DescriptorProto.ExtensionRange" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[80]), /* "extension" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 6, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[6]), /* ".google.protobuf.FieldDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 7, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[14]), /* ".google.protobuf.MessageOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[108]), /* "start" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 5, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[76]), /* "end" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 5, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[79]), /* "extendee" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[100]), /* "number" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 5, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[92]), /* "label" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 4, - .label = 1, - .type = 14, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[7]), /* ".google.protobuf.FieldDescriptorProto.Label" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[110]), /* "type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 5, - .label = 1, - .type = 14, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[8]), /* ".google.protobuf.FieldDescriptorProto.Type" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[111]), /* "type_name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 6, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[71]), /* "default_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 7, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 8, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[9]), /* ".google.protobuf.FieldOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[113]), /* "value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[4]), /* ".google.protobuf.EnumValueDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[3]), /* ".google.protobuf.EnumOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[100]), /* "number" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 5, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[5]), /* ".google.protobuf.EnumValueOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[95]), /* "method" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[15]), /* ".google.protobuf.MethodDescriptorProto" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[18]), /* ".google.protobuf.ServiceOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[87]), /* "input_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[103]), /* "output_type" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[102]), /* "options" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 4, - .label = 1, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[16]), /* ".google.protobuf.MethodOptions" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[91]), /* "java_package" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[90]), /* "java_outer_classname" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 8, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[101]), /* "optimize_for" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 9, - .label = 1, - .type = 14, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[13]), /* ".google.protobuf.FileOptions.OptimizeMode" */ - .default_value = UPB_STATIC_STRING_PTR_INIT(strings[45]), /* "SPEED" */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[89]), /* "java_multiple_files" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 10, - .label = 1, - .type = 8, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STATIC_STRING_PTR_INIT(strings[82]), /* "false" */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[93]), /* "message_set_wire_format" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 8, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STATIC_STRING_PTR_INIT(strings[82]), /* "false" */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[70]), /* "ctype" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 1, - .type = 14, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[10]), /* ".google.protobuf.FieldOptions.CType" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[105]), /* "packed" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 1, - .type = 8, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[73]), /* "deprecated" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 8, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STATIC_STRING_PTR_INIT(strings[82]), /* "false" */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[78]), /* "experimental_map_key" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 9, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[112]), /* "uninterpreted_option" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 999, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[19]), /* ".google.protobuf.UninterpretedOption" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = true, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[96]), /* "name" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 3, - .type = 11, - .type_name = UPB_STATIC_STRING_PTR_INIT(strings[20]), /* ".google.protobuf.UninterpretedOption.NamePart" */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[86]), /* "identifier_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 3, - .label = 1, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[106]), /* "positive_int_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 4, - .label = 1, - .type = 4, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[98]), /* "negative_int_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 5, - .label = 1, - .type = 3, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[75]), /* "double_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 6, - .label = 1, - .type = 1, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[109]), /* "string_value" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 7, - .label = 1, - .type = 12, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[97]), /* "name_part" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 1, - .label = 2, - .type = 9, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .extendee = false, - .number = true, - .label = true, - .type = true, - .type_name = false, - .default_value = false, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[88]), /* "is_extension" */ - .extendee = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .number = 2, - .label = 2, - .type = 8, - .type_name = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .default_value = UPB_STRING_NULL_INITIALIZER, /* Not set. */ - .options = 0, /* Not set. */ - }, -}; -static google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto_values[25] = { - - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[51]), /* "TYPE_DOUBLE" */ - .number = 1, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[55]), /* "TYPE_FLOAT" */ - .number = 2, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[58]), /* "TYPE_INT64" */ - .number = 3, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[66]), /* "TYPE_UINT64" */ - .number = 4, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[57]), /* "TYPE_INT32" */ - .number = 5, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[54]), /* "TYPE_FIXED64" */ - .number = 6, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[53]), /* "TYPE_FIXED32" */ - .number = 7, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[49]), /* "TYPE_BOOL" */ - .number = 8, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[64]), /* "TYPE_STRING" */ - .number = 9, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[56]), /* "TYPE_GROUP" */ - .number = 10, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[59]), /* "TYPE_MESSAGE" */ - .number = 11, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[50]), /* "TYPE_BYTES" */ - .number = 12, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[65]), /* "TYPE_UINT32" */ - .number = 13, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[52]), /* "TYPE_ENUM" */ - .number = 14, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[60]), /* "TYPE_SFIXED32" */ - .number = 15, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[61]), /* "TYPE_SFIXED64" */ - .number = 16, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[62]), /* "TYPE_SINT32" */ - .number = 17, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[63]), /* "TYPE_SINT64" */ - .number = 18, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[36]), /* "LABEL_OPTIONAL" */ - .number = 1, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[38]), /* "LABEL_REQUIRED" */ - .number = 2, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[37]), /* "LABEL_REPEATED" */ - .number = 3, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[45]), /* "SPEED" */ - .number = 1, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[21]), /* "CODE_SIZE" */ - .number = 2, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[22]), /* "CORD" */ - .number = 1, - .options = 0, /* Not set. */ - }, - {.base = {UPB_DATA_FROZEN}, - .set_flags = {.has = { - .name = true, - .number = true, - .options = false, - }}, - .name = UPB_STATIC_STRING_PTR_INIT(strings[46]), /* "STRING_PIECE" */ - .number = 2, - .options = 0, /* Not set. */ - }, -}; -/* The externally-visible definition. */ -google_protobuf_FileDescriptorSet *upb_file_descriptor_set = &google_protobuf_FileDescriptorSet_values[0]; +unsigned int descriptor_pb_len = 3486; diff --git a/descriptor/descriptor.h b/descriptor/descriptor.h index 8c59624..9d51e5b 100644 --- a/descriptor/descriptor.h +++ b/descriptor/descriptor.h @@ -1,402 +1,25 @@ -/* This file was generated by upbc (the upb compiler). Do not edit. */ - -#ifndef DESCRIPTOR_DESCRIPTOR_H -#define DESCRIPTOR_DESCRIPTOR_H - -#include +/* + * upb - a minimalist implementation of protocol buffers. + * + * Copyright (c) 2009 Joshua Haberman. See LICENSE for details. + * + * This file contains declarations for an array that contains the contents + * of descriptor.proto, serialized as a protobuf. xxd is used to create + * the actual definition. + */ + +#ifndef UPB_DESCRIPTOR_H_ +#define UPB_DESCRIPTOR_H_ #ifdef __cplusplus extern "C" { #endif -struct google_protobuf_FileDescriptorSet; -extern struct google_protobuf_FileDescriptorSet *upb_file_descriptor_set; - -/* Forward declarations of all message types. - * So they can refer to each other in possibly-recursive ways. */ - -struct google_protobuf_UninterpretedOption_NamePart; -typedef struct google_protobuf_UninterpretedOption_NamePart - google_protobuf_UninterpretedOption_NamePart; -UPB_DEFINE_MSG_ARRAY(google_protobuf_UninterpretedOption_NamePart) - -struct google_protobuf_DescriptorProto; -typedef struct google_protobuf_DescriptorProto - google_protobuf_DescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_DescriptorProto) - -struct google_protobuf_EnumDescriptorProto; -typedef struct google_protobuf_EnumDescriptorProto - google_protobuf_EnumDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_EnumDescriptorProto) - -struct google_protobuf_UninterpretedOption; -typedef struct google_protobuf_UninterpretedOption - google_protobuf_UninterpretedOption; -UPB_DEFINE_MSG_ARRAY(google_protobuf_UninterpretedOption) - -struct google_protobuf_FileDescriptorProto; -typedef struct google_protobuf_FileDescriptorProto - google_protobuf_FileDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_FileDescriptorProto) - -struct google_protobuf_MethodDescriptorProto; -typedef struct google_protobuf_MethodDescriptorProto - google_protobuf_MethodDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_MethodDescriptorProto) - -struct google_protobuf_EnumValueOptions; -typedef struct google_protobuf_EnumValueOptions - google_protobuf_EnumValueOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_EnumValueOptions) - -struct google_protobuf_EnumValueDescriptorProto; -typedef struct google_protobuf_EnumValueDescriptorProto - google_protobuf_EnumValueDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_EnumValueDescriptorProto) - -struct google_protobuf_ServiceDescriptorProto; -typedef struct google_protobuf_ServiceDescriptorProto - google_protobuf_ServiceDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_ServiceDescriptorProto) - -struct google_protobuf_FileDescriptorSet; -typedef struct google_protobuf_FileDescriptorSet - google_protobuf_FileDescriptorSet; -UPB_DEFINE_MSG_ARRAY(google_protobuf_FileDescriptorSet) - -struct google_protobuf_DescriptorProto_ExtensionRange; -typedef struct google_protobuf_DescriptorProto_ExtensionRange - google_protobuf_DescriptorProto_ExtensionRange; -UPB_DEFINE_MSG_ARRAY(google_protobuf_DescriptorProto_ExtensionRange) - -struct google_protobuf_FieldOptions; -typedef struct google_protobuf_FieldOptions - google_protobuf_FieldOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_FieldOptions) - -struct google_protobuf_FileOptions; -typedef struct google_protobuf_FileOptions - google_protobuf_FileOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_FileOptions) - -struct google_protobuf_MessageOptions; -typedef struct google_protobuf_MessageOptions - google_protobuf_MessageOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_MessageOptions) - -struct google_protobuf_EnumOptions; -typedef struct google_protobuf_EnumOptions - google_protobuf_EnumOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_EnumOptions) - -struct google_protobuf_FieldDescriptorProto; -typedef struct google_protobuf_FieldDescriptorProto - google_protobuf_FieldDescriptorProto; -UPB_DEFINE_MSG_ARRAY(google_protobuf_FieldDescriptorProto) - -struct google_protobuf_ServiceOptions; -typedef struct google_protobuf_ServiceOptions - google_protobuf_ServiceOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_ServiceOptions) - -struct google_protobuf_MethodOptions; -typedef struct google_protobuf_MethodOptions - google_protobuf_MethodOptions; -UPB_DEFINE_MSG_ARRAY(google_protobuf_MethodOptions) - -/* The message definitions themselves. */ - -struct google_protobuf_UninterpretedOption_NamePart { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name_part:1; /* = 1, required. */ - bool is_extension:1; /* = 2, required. */ - } has; - } set_flags; - upb_strptr name_part; - bool is_extension; -}; - -struct google_protobuf_DescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool field:1; /* = 2, repeated. */ - bool nested_type:1; /* = 3, repeated. */ - bool enum_type:1; /* = 4, repeated. */ - bool extension_range:1; /* = 5, repeated. */ - bool extension:1; /* = 6, repeated. */ - bool options:1; /* = 7, optional. */ - } has; - } set_flags; - upb_strptr name; - UPB_MSG_ARRAYPTR(google_protobuf_FieldDescriptorProto) field; - UPB_MSG_ARRAYPTR(google_protobuf_DescriptorProto) nested_type; - UPB_MSG_ARRAYPTR(google_protobuf_EnumDescriptorProto) enum_type; - UPB_MSG_ARRAYPTR(google_protobuf_DescriptorProto_ExtensionRange) extension_range; - UPB_MSG_ARRAYPTR(google_protobuf_FieldDescriptorProto) extension; - google_protobuf_MessageOptions* options; -}; - -struct google_protobuf_EnumDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool value:1; /* = 2, repeated. */ - bool options:1; /* = 3, optional. */ - } has; - } set_flags; - upb_strptr name; - UPB_MSG_ARRAYPTR(google_protobuf_EnumValueDescriptorProto) value; - google_protobuf_EnumOptions* options; -}; - -struct google_protobuf_UninterpretedOption { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 2, repeated. */ - bool identifier_value:1; /* = 3, optional. */ - bool positive_int_value:1; /* = 4, optional. */ - bool negative_int_value:1; /* = 5, optional. */ - bool double_value:1; /* = 6, optional. */ - bool string_value:1; /* = 7, optional. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption_NamePart) name; - upb_strptr identifier_value; - uint64_t positive_int_value; - int64_t negative_int_value; - double double_value; - upb_strptr string_value; -}; - -struct google_protobuf_FileDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool package:1; /* = 2, optional. */ - bool dependency:1; /* = 3, repeated. */ - bool message_type:1; /* = 4, repeated. */ - bool enum_type:1; /* = 5, repeated. */ - bool service:1; /* = 6, repeated. */ - bool extension:1; /* = 7, repeated. */ - bool options:1; /* = 8, optional. */ - } has; - } set_flags; - upb_strptr name; - upb_strptr package; - upb_arrayptr dependency; - UPB_MSG_ARRAYPTR(google_protobuf_DescriptorProto) message_type; - UPB_MSG_ARRAYPTR(google_protobuf_EnumDescriptorProto) enum_type; - UPB_MSG_ARRAYPTR(google_protobuf_ServiceDescriptorProto) service; - UPB_MSG_ARRAYPTR(google_protobuf_FieldDescriptorProto) extension; - google_protobuf_FileOptions* options; -}; - -struct google_protobuf_MethodDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool input_type:1; /* = 2, optional. */ - bool output_type:1; /* = 3, optional. */ - bool options:1; /* = 4, optional. */ - } has; - } set_flags; - upb_strptr name; - upb_strptr input_type; - upb_strptr output_type; - google_protobuf_MethodOptions* options; -}; - -struct google_protobuf_EnumValueOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_EnumValueDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool number:1; /* = 2, optional. */ - bool options:1; /* = 3, optional. */ - } has; - } set_flags; - upb_strptr name; - int32_t number; - google_protobuf_EnumValueOptions* options; -}; - -struct google_protobuf_ServiceDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool method:1; /* = 2, repeated. */ - bool options:1; /* = 3, optional. */ - } has; - } set_flags; - upb_strptr name; - UPB_MSG_ARRAYPTR(google_protobuf_MethodDescriptorProto) method; - google_protobuf_ServiceOptions* options; -}; - -struct google_protobuf_FileDescriptorSet { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool file:1; /* = 1, repeated. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_FileDescriptorProto) file; -}; - -struct google_protobuf_DescriptorProto_ExtensionRange { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool start:1; /* = 1, optional. */ - bool end:1; /* = 2, optional. */ - } has; - } set_flags; - int32_t start; - int32_t end; -}; - -struct google_protobuf_FieldOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool ctype:1; /* = 1, optional. */ - bool packed:1; /* = 2, optional. */ - bool deprecated:1; /* = 3, optional. */ - bool experimental_map_key:1; /* = 9, optional. */ - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - int32_t ctype; - bool packed; - bool deprecated; - upb_strptr experimental_map_key; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_FileOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool java_package:1; /* = 1, optional. */ - bool java_outer_classname:1; /* = 8, optional. */ - bool optimize_for:1; /* = 9, optional. */ - bool java_multiple_files:1; /* = 10, optional. */ - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - upb_strptr java_package; - upb_strptr java_outer_classname; - int32_t optimize_for; - bool java_multiple_files; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_MessageOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool message_set_wire_format:1; /* = 1, optional. */ - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - bool message_set_wire_format; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_EnumOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_FieldDescriptorProto { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool name:1; /* = 1, optional. */ - bool extendee:1; /* = 2, optional. */ - bool number:1; /* = 3, optional. */ - bool label:1; /* = 4, optional. */ - bool type:1; /* = 5, optional. */ - bool type_name:1; /* = 6, optional. */ - bool default_value:1; /* = 7, optional. */ - bool options:1; /* = 8, optional. */ - } has; - } set_flags; - upb_strptr name; - upb_strptr extendee; - int32_t number; - int32_t label; - int32_t type; - upb_strptr type_name; - upb_strptr default_value; - google_protobuf_FieldOptions* options; -}; - -struct google_protobuf_ServiceOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; - -struct google_protobuf_MethodOptions { - upb_data base; - union { - uint8_t bytes[1]; - struct { - bool uninterpreted_option:1; /* = 999, repeated. */ - } has; - } set_flags; - UPB_MSG_ARRAYPTR(google_protobuf_UninterpretedOption) uninterpreted_option; -}; +unsigned char descriptor_pb[] +unsigned int descriptor_pb_len; #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* DESCRIPTOR_DESCRIPTOR_H */ +#endif /* UPB_DESCRIPTOR_H_ */ -- cgit v1.2.3 From 209dce5eb08709bfb5b21e19289b3814619ca6cc Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 7 Jul 2010 10:39:08 -0700 Subject: Defined the function for getting a upb_symtab for descriptor.proto. --- Makefile | 19 +- descriptor/descriptor.h | 4 +- src/upb.c | 38 ++-- src/upb_data.c | 500 ------------------------------------------- src/upb_data.h | 552 ------------------------------------------------ src/upb_def.c | 27 ++- src/upb_def.h | 5 + src/upb_table.c | 2 +- 8 files changed, 63 insertions(+), 1084 deletions(-) delete mode 100644 src/upb_data.c delete mode 100644 src/upb_data.h (limited to 'descriptor') diff --git a/Makefile b/Makefile index 7235ff9..dec18ec 100644 --- a/Makefile +++ b/Makefile @@ -34,20 +34,22 @@ LDLIBS=-lpthread LIBUPB=src/libupb.a LIBUPB_PIC=src/libupb_pic.a LIBUPB_SHARED=src/libupb.so -ALL=deps $(OBJ) $(LIBUPB) $(LIBUPB_PIC) tools/upbc +ALL=deps $(OBJ) $(LIBUPB) $(LIBUPB_PIC) all: $(ALL) clean: rm -rf $(LIBUPB) $(LIBUPB_PIC) rm -rf $(call rwildcard,,*.o) $(call rwildcard,,*.lo) rm -rf benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb* rm -rf tests/tests tests/t.* tests/test_table - rm -rf descriptor/descriptor.proto.pb + rm -rf descriptor/descriptor.pb rm -rf tools/upbc deps cd lang_ext/python && python setup.py clean --all # The core library (src/libupb.a) -SRC=src/upb.c src/upb_decoder.c src/upb_table.c src/upb_def.c src/upb_data.c \ - src/upb_encoder.c descriptor/descriptor.c src/upb_text.c +SRC=src/upb.c src/upb_decoder.c src/upb_table.c src/upb_def.c \ + descriptor/descriptor.c +# Parts of core that are yet to be converted. +OTHERSRC=src/upb_encoder.c src/upb_text.c # Override the optimization level for upb_def.o, because it is not in the # critical path but gets very large when -O3 is used. src/upb_def.o: src/upb_def.c @@ -55,6 +57,7 @@ src/upb_def.o: src/upb_def.c src/upb_def.lo: src/upb_def.c $(CC) $(CFLAGS) $(CPPFLAGS) -Os -c -o $@ $< -fPIC + STATICOBJ=$(patsubst %.c,%.o,$(SRC)) SHAREDOBJ=$(patsubst %.c,%.lo,$(SRC)) # building shared objects is like building static ones, except -fPIC is added. @@ -67,12 +70,12 @@ $(LIBUPB_SHARED): $(SHAREDOBJ) $(CC) -shared -o $(LIBUPB_SHARED) $(SHAREDOBJ) # Regenerating the auto-generated files in descriptor/. -descriptor/descriptor.proto.pb: descriptor/descriptor.proto +descriptor/descriptor.pb: descriptor/descriptor.proto # TODO: replace with upbc - protoc descriptor/descriptor.proto -odescriptor/descriptor.proto.pb + protoc descriptor/descriptor.proto -odescriptor/descriptor.pb -descriptorgen: descriptor/descriptor.proto.pb tools/upbc - ./tools/upbc -i upb_file_descriptor_set -o descriptor/descriptor descriptor/descriptor.proto.pb +descriptorgen: descriptor/descriptor.pb + cd descriptor && xxd -i descriptor.pb > descriptor.c # Language extensions. python: $(LIBUPB_PIC) diff --git a/descriptor/descriptor.h b/descriptor/descriptor.h index 9d51e5b..b598a9a 100644 --- a/descriptor/descriptor.h +++ b/descriptor/descriptor.h @@ -15,8 +15,8 @@ extern "C" { #endif -unsigned char descriptor_pb[] -unsigned int descriptor_pb_len; +extern unsigned char descriptor_pb[]; +extern unsigned int descriptor_pb_len; #ifdef __cplusplus } /* extern "C" */ diff --git a/src/upb.c b/src/upb.c index 189dfe4..3c5efe8 100644 --- a/src/upb.c +++ b/src/upb.c @@ -18,25 +18,25 @@ #ctype}, upb_type_info upb_types[] = { - {0, 0, 0, ""} // There is no type 0. - TYPE_INFO(UPB_WIRE_TYPE_64BIT, double, 1), // DOUBLE - TYPE_INFO(UPB_WIRE_TYPE_32BIT, float, 1), // FLOAT - TYPE_INFO(UPB_WIRE_TYPE_VARINT, int64_t, 1), // INT64 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint64_t, 1), // UINT64 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, int32_t, 1), // INT32 - TYPE_INFO(UPB_WIRE_TYPE_64BIT, uint64_t, 1), // FIXED64 - TYPE_INFO(UPB_WIRE_TYPE_32BIT, uint32_t, 1), // FIXED32 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, bool, 1), // BOOL - TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1), // STRING - TYPE_INFO(UPB_WIRE_TYPE_START_GROUP, void*, 0), // GROUP - TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1), // MESSAGE - TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1), // BYTES - TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint32_t, 1), // UINT32 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint32_t, 1), // ENUM - TYPE_INFO(UPB_WIRE_TYPE_32BIT, int32_t, 1), // SFIXED32 - TYPE_INFO(UPB_WIRE_TYPE_64BIT, int64_t, 1), // SFIXED64 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, int32_t, 1), // SINT32 - TYPE_INFO(UPB_WIRE_TYPE_VARINT, int64_t, 1), // SINT64 + {0, 0, 0, 0, ""}, // There is no type 0. + TYPE_INFO(UPB_WIRE_TYPE_64BIT, double, 1) // DOUBLE + TYPE_INFO(UPB_WIRE_TYPE_32BIT, float, 1) // FLOAT + TYPE_INFO(UPB_WIRE_TYPE_VARINT, int64_t, 1) // INT64 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint64_t, 1) // UINT64 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, int32_t, 1) // INT32 + TYPE_INFO(UPB_WIRE_TYPE_64BIT, uint64_t, 1) // FIXED64 + TYPE_INFO(UPB_WIRE_TYPE_32BIT, uint32_t, 1) // FIXED32 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, bool, 1) // BOOL + TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1) // STRING + TYPE_INFO(UPB_WIRE_TYPE_START_GROUP, void*, 0) // GROUP + TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1) // MESSAGE + TYPE_INFO(UPB_WIRE_TYPE_DELIMITED, void*, 1) // BYTES + TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint32_t, 1) // UINT32 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, uint32_t, 1) // ENUM + TYPE_INFO(UPB_WIRE_TYPE_32BIT, int32_t, 1) // SFIXED32 + TYPE_INFO(UPB_WIRE_TYPE_64BIT, int64_t, 1) // SFIXED64 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, int32_t, 1) // SINT32 + TYPE_INFO(UPB_WIRE_TYPE_VARINT, int64_t, 1) // SINT64 }; void upb_seterr(upb_status *status, enum upb_status_code code, diff --git a/src/upb_data.c b/src/upb_data.c deleted file mode 100644 index 3b4f7ab..0000000 --- a/src/upb_data.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2009 Joshua Haberman. See LICENSE for details. - */ - -#include -#include "upb_data.h" -#include "upb_decoder.h" -#include "upb_def.h" - -static uint32_t round_up_to_pow2(uint32_t v) -{ - /* cf. http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 */ - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - return v; -} - -/* upb_data *******************************************************************/ - -static void data_elem_unref(upb_valueptr p, upb_fielddef *f) { - if(upb_issubmsg(f)) { - upb_msg_unref(*p.msg, upb_downcast_msgdef(f->def)); - } else if(upb_isstring(f)) { - upb_string_unref(*p.str); - } else { - assert(false); - } -} - -static void data_unref(upb_valueptr p, upb_fielddef *f) { - if(upb_isarray(f)) { - upb_array_unref(*p.arr, f); - } else { - data_elem_unref(p, f); - } -} - -INLINE void data_init(upb_data *d, int flags) { - d->v = REFCOUNT_ONE | flags; -} - -static void check_not_frozen(upb_data *d) { - // On one hand I am reluctant to put abort() calls in a low-level library - // that are enabled in a production build. On the other hand, this is a bug - // in the client code that we cannot recover from, and it seems better to get - // the error here than later. - if(upb_data_hasflag(d, UPB_DATA_FROZEN)) abort(); -} - - -/* upb_string *******************************************************************/ - -void _upb_string_setptr(upb_strptr s, char *ptr) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) - s.refcounted->ptr = ptr; - else - s.norefcount->ptr = ptr; -} - -static void _upb_string_set_bytelen(upb_strptr s, upb_strlen_t newlen) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) { - s.refcounted->byte_len = newlen; - } else { - s.norefcount->byte_len = newlen; - } -} - -upb_strptr upb_string_new() { - upb_strptr s; - s.refcounted = malloc(sizeof(struct upb_refcounted_string)); - data_init(s.base, UPB_DATA_HEAPALLOCATED | UPB_DATA_REFCOUNTED); - s.refcounted->byte_size = 0; - s.refcounted->byte_len = 0; - s.refcounted->ptr = NULL; - return s; -} - -static upb_strlen_t string_get_bytesize(upb_strptr s) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) { - return s.refcounted->byte_size; - } else { - return (s.norefcount->byte_size_and_flags & 0xFFFFFFF8) >> 3; - } -} - -static void string_set_bytesize(upb_strptr s, upb_strlen_t newsize) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) { - s.refcounted->byte_size = newsize; - } else { - s.norefcount->byte_size_and_flags &= 0x7; - s.norefcount->byte_size_and_flags |= (newsize << 3); - } -} - -void _upb_string_free(upb_strptr s) -{ - if(string_get_bytesize(s) != 0) free((void*)upb_string_getrobuf(s)); - free(s.base); -} - -void upb_string_resize(upb_strptr s, upb_strlen_t byte_len) { - check_not_frozen(s.base); - if(string_get_bytesize(s) < byte_len) { - // Need to resize. - size_t new_byte_size = round_up_to_pow2(byte_len); - _upb_string_setptr(s, realloc(_upb_string_getptr(s), new_byte_size)); - string_set_bytesize(s, new_byte_size); - } - _upb_string_set_bytelen(s, byte_len); -} - -upb_strptr upb_string_getref(upb_strptr s, int ref_flags) { - if(_upb_data_incref(s.base, ref_flags)) return s; - upb_strptr copy = upb_strdup(s); - if(ref_flags == UPB_REF_FROZEN) - upb_data_setflag(copy.base, UPB_DATA_FROZEN); - return copy; -} - -upb_strptr upb_strreadfile(const char *filename) { - FILE *f = fopen(filename, "rb"); - if(!f) return UPB_STRING_NULL; - if(fseek(f, 0, SEEK_END) != 0) goto error; - long size = ftell(f); - if(size < 0) goto error; - if(fseek(f, 0, SEEK_SET) != 0) goto error; - upb_strptr s = upb_string_new(); - char *buf = upb_string_getrwbuf(s, size); - if(fread(buf, size, 1, f) != 1) goto error; - fclose(f); - return s; - -error: - fclose(f); - return UPB_STRING_NULL; -} - -upb_strptr upb_strdupc(const char *src) { - upb_strptr copy = upb_string_new(); - upb_strlen_t len = strlen(src); - char *buf = upb_string_getrwbuf(copy, len); - memcpy(buf, src, len); - return copy; -} - -void upb_strcat(upb_strptr s, upb_strptr append) { - upb_strlen_t s_len = upb_strlen(s); - upb_strlen_t append_len = upb_strlen(append); - upb_strlen_t newlen = s_len + append_len; - memcpy(upb_string_getrwbuf(s, newlen) + s_len, - upb_string_getrobuf(append), append_len); -} - -upb_strptr upb_strslice(upb_strptr s, int offset, int len) { - upb_strptr slice = upb_string_new(); - len = UPB_MIN((upb_strlen_t)len, upb_strlen(s) - (upb_strlen_t)offset); - memcpy(upb_string_getrwbuf(slice, len), upb_string_getrobuf(s) + offset, len); - return slice; -} - -upb_strptr upb_strdup(upb_strptr s) { - upb_strptr copy = upb_string_new(); - upb_strcpy(copy, s); - return copy; -} - -int upb_strcmp(upb_strptr s1, upb_strptr s2) { - upb_strlen_t common_length = UPB_MIN(upb_strlen(s1), upb_strlen(s2)); - int common_diff = memcmp(upb_string_getrobuf(s1), upb_string_getrobuf(s2), - common_length); - return common_diff == - 0 ? ((int)upb_strlen(s1) - (int)upb_strlen(s2)) : common_diff; -} - - -/* upb_array ******************************************************************/ - -static void _upb_array_setptr(upb_arrayptr a, void *ptr) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) - a.refcounted->elements._void = ptr; - else - a.norefcount->elements._void = ptr; -} - -static void _upb_array_setlen(upb_arrayptr a, upb_strlen_t newlen) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) { - a.refcounted->len = newlen; - } else { - a.norefcount->len = newlen; - } -} - -upb_arrayptr upb_array_new() { - upb_arrayptr a; - a.refcounted = malloc(sizeof(struct upb_refcounted_array)); - data_init(a.base, UPB_DATA_HEAPALLOCATED | UPB_DATA_REFCOUNTED); - a.refcounted->size = 0; - a.refcounted->len = 0; - a.refcounted->elements._void = NULL; - return a; -} - -// ONLY handles refcounted arrays for the moment. -void _upb_array_free(upb_arrayptr a, upb_fielddef *f) -{ - if(upb_elem_ismm(f)) { - for(upb_arraylen_t i = 0; i < a.refcounted->size; i++) { - upb_valueptr p = _upb_array_getptr(a, f, i); - if(!*p.data) continue; - data_elem_unref(p, f); - } - } - if(a.refcounted->size != 0) free(a.refcounted->elements._void); - free(a.refcounted); -} - -static upb_arraylen_t array_get_size(upb_arrayptr a) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) { - return a.refcounted->size; - } else { - return (a.norefcount->base.v & 0xFFFFFFF8) >> 3; - } -} - -static void array_set_size(upb_arrayptr a, upb_arraylen_t newsize) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) { - a.refcounted->size = newsize; - } else { - a.norefcount->base.v &= 0x7; - a.norefcount->base.v |= (newsize << 3); - } -} - -void upb_array_resize(upb_arrayptr a, upb_fielddef *f, upb_strlen_t len) { - check_not_frozen(a.base); - size_t type_size = upb_types[f->type].size; - upb_arraylen_t old_size = array_get_size(a); - if(old_size < len) { - // Need to resize. - size_t new_size = round_up_to_pow2(len); - _upb_array_setptr(a, realloc(_upb_array_getptr_raw(a, 0, 0)._void, new_size * type_size)); - array_set_size(a, new_size); - memset(_upb_array_getptr_raw(a, old_size, type_size)._void, - 0, - (new_size - old_size) * type_size); - } - _upb_array_setlen(a, len); -} - - -/* upb_msg ********************************************************************/ - -static void upb_msg_sethas(upb_msg *msg, upb_fielddef *f) { - msg->data[f->field_index/8] |= (1 << (f->field_index % 8)); -} - -upb_msg *upb_msg_new(upb_msgdef *md) { - upb_msg *msg = malloc(md->size); - memset(msg, 0, md->size); - data_init(&msg->base, UPB_DATA_HEAPALLOCATED | UPB_DATA_REFCOUNTED); - upb_def_ref(UPB_UPCAST(md)); - return msg; -} - -// ONLY handles refcounted messages for the moment. -void _upb_msg_free(upb_msg *msg, upb_msgdef *md) -{ - for(int i = 0; i < md->num_fields; i++) { - upb_fielddef *f = &md->fields[i]; - upb_valueptr p = _upb_msg_getptr(msg, f); - if(!upb_field_ismm(f) || !*p.data) continue; - data_unref(p, f); - } - upb_def_unref(UPB_UPCAST(md)); - free(msg); -} - -void upb_msg_decodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, - upb_status *status) -{ - upb_decoder *d = upb_decoder_new(md); - upb_msgsink *s = upb_msgsink_new(md); - - upb_msgsink_reset(s, msg); - upb_decoder_reset(d, upb_msgsink_sink(s)); - upb_msg_clear(msg, md); - upb_decoder_decode(d, str, status); - - upb_decoder_free(d); - upb_msgsink_free(s); -} - -#if 0 -void upb_msg_encodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, - upb_status *status) -{ - upb_sizebuilder *sb = upb_sizebuilder_new(md); - upb_encoder *e = upb_encoder_new(md); - upb_strsink *sink = upb_strsink_new(); - - // Get sizes. We could avoid performing this step in some cases by having a - // bool in the msgdef indicating whether it or any of its children have - // submessages in the def (groups don't count). - upb_sizebuilder_reset(sb); - upb_msgsrc_produce(msg, md, upb_sizebuilder_sink(sb), true); - - upb_strsink_reset(); - upb_encoder_reset(e, sb, sink); - upb_msgsrc_produce(msg, md, sink, false); -} -#endif - -/* upb_msgsrc ****************************************************************/ - -static void _upb_msgsrc_produceval(upb_value v, upb_fielddef *f, upb_sink *sink, - bool reverse, upb_status *status) -{ - // TODO: We need to check status for failure, but how often? - if(upb_issubmsg(f)) { - upb_msgdef *md = upb_downcast_msgdef(f->def); - upb_sink_onstart(sink, f, status); - upb_msgsrc_produce(v.msg, md, sink, reverse, status); - upb_sink_onend(sink, f, status); - } else if(upb_isstring(f)) { - upb_sink_onstr(sink, f, v.str, 0, upb_strlen(v.str), status); - } else { - upb_sink_onvalue(sink, f, v, status); - } -} - -void upb_msgsrc_produce(upb_msg *msg, upb_msgdef *md, upb_sink *sink, - bool reverse, upb_status *status) -{ - for(int i = 0; i < md->num_fields; i++) { - upb_fielddef *f = &md->fields[reverse ? md->num_fields - i - 1 : i]; - if(!upb_msg_has(msg, f)) continue; - upb_value v = upb_msg_get(msg, f); - if(upb_isarray(f)) { - upb_arrayptr arr = v.arr; - upb_arraylen_t len = upb_array_len(arr); - for(upb_arraylen_t j = 0; j < upb_array_len(arr); j++) { - upb_value elem = upb_array_get(arr, f, reverse ? len - j - 1 : j); - _upb_msgsrc_produceval(elem, f, sink, reverse, status); - } - } else { - _upb_msgsrc_produceval(v, f, sink, reverse, status); - } - } -} - - -/* upb_msgsink ***************************************************************/ - -typedef struct { - upb_msg *msg; - upb_msgdef *md; -} upb_msgsink_frame; - -struct upb_msgsink { - upb_sink base; - upb_msgdef *toplevel_msgdef; - upb_msgsink_frame stack[UPB_MAX_NESTING], *top; -}; - -/* Helper function that returns a pointer to where the next value for field "f" - * should be stored, taking into account whether f is an array that may need to - * be allocated or resized. */ -static upb_valueptr get_valueptr(upb_msg *msg, upb_fielddef *f) -{ - upb_valueptr p = _upb_msg_getptr(msg, f); - if(upb_isarray(f)) { - if(!upb_msg_has(msg, f)) { - if(upb_array_isnull(*p.arr) || !upb_data_only(*p.data)) { - if(!upb_array_isnull(*p.arr)) - upb_array_unref(*p.arr, f); - *p.arr = upb_array_new(); - } - upb_array_truncate(*p.arr); - upb_msg_sethas(msg, f); - } else { - assert(!upb_array_isnull(*p.arr)); - } - upb_arraylen_t oldlen = upb_array_len(*p.arr); - upb_array_resize(*p.arr, f, oldlen + 1); - p = _upb_array_getptr(*p.arr, f, oldlen); - } - return p; -} - -// Callbacks for upb_sink. -// TODO: implement these in terms of public interfaces. - -static upb_sink_status _upb_msgsink_valuecb(upb_sink *s, upb_fielddef *f, - upb_value val, upb_status *status) -{ - (void)status; // No detectable errors can occur. - upb_msgsink *ms = (upb_msgsink*)s; - upb_msg *msg = ms->top->msg; - upb_valueptr p = get_valueptr(msg, f); - upb_msg_sethas(msg, f); - upb_value_write(p, val, f->type); - return UPB_SINK_CONTINUE; -} - -static upb_sink_status _upb_msgsink_strcb(upb_sink *s, upb_fielddef *f, - upb_strptr str, - int32_t start, uint32_t end, - upb_status *status) -{ - (void)status; // No detectable errors can occur. - upb_msgsink *ms = (upb_msgsink*)s; - upb_msg *msg = ms->top->msg; - upb_valueptr p = get_valueptr(msg, f); - upb_msg_sethas(msg, f); - if(end > upb_strlen(str)) abort(); /* TODO: support streaming. */ - if(upb_string_isnull(*p.str) || !upb_data_only(*p.data)) { - if(!upb_string_isnull(*p.str)) - upb_string_unref(*p.str); - *p.str = upb_string_new(); - } - upb_strcpylen(*p.str, upb_string_getrobuf(str) + start, end - start); - return UPB_SINK_CONTINUE; -} - -static upb_sink_status _upb_msgsink_startcb(upb_sink *s, upb_fielddef *f, - upb_status *status) -{ - (void)status; // No detectable errors can occur. - upb_msgsink *ms = (upb_msgsink*)s; - upb_msg *oldmsg = ms->top->msg; - upb_valueptr p = get_valueptr(oldmsg, f); - ms->top++; - - if(upb_isarray(f) || !upb_msg_has(oldmsg, f)) { - upb_msgdef *md = upb_downcast_msgdef(f->def); - if(!*p.msg || !upb_data_only(*p.data)) { - if(*p.msg) - upb_msg_unref(*p.msg, md); - *p.msg = upb_msg_new(md); - } - upb_msg_clear(*p.msg, md); - upb_msg_sethas(oldmsg, f); - } - - ms->top->msg = *p.msg; - return UPB_SINK_CONTINUE; -} - -static upb_sink_status _upb_msgsink_endcb(upb_sink *s, upb_fielddef *f, - upb_status *status) -{ - (void)status; // No detectable errors can occur. - (void)f; // Unused. - upb_msgsink *ms = (upb_msgsink*)s; - ms->top--; - return UPB_SINK_CONTINUE; -} - -static upb_sink_callbacks _upb_msgsink_vtbl = { - _upb_msgsink_valuecb, - _upb_msgsink_strcb, - _upb_msgsink_startcb, - _upb_msgsink_endcb -}; - -// -// External upb_msgsink interface. -// - -upb_msgsink *upb_msgsink_new(upb_msgdef *md) -{ - upb_msgsink *ms = malloc(sizeof(*ms)); - upb_sink_init(&ms->base, &_upb_msgsink_vtbl); - ms->toplevel_msgdef = md; - return ms; -} - -void upb_msgsink_free(upb_msgsink *sink) -{ - free(sink); -} - -upb_sink *upb_msgsink_sink(upb_msgsink *sink) -{ - return &sink->base; -} - -void upb_msgsink_reset(upb_msgsink *ms, upb_msg *msg) -{ - ms->top = ms->stack; - ms->top->msg = msg; - ms->top->md = ms->toplevel_msgdef; -} diff --git a/src/upb_data.h b/src/upb_data.h deleted file mode 100644 index c0f53ff..0000000 --- a/src/upb_data.h +++ /dev/null @@ -1,552 +0,0 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2009 Joshua Haberman. See LICENSE for details. - * - * This file defines the in-memory format for messages, arrays, and strings - * (which are the three dynamically-allocated structures that make up all - * protobufs). - * - * The members of all structs should be considered private. Access should - * only happen through the provided functions. - * - * Unlike Google's protobuf, messages contain *pointers* to strings and arrays - * instead of including them by value. This makes unused strings and arrays - * use less memory, and lets the strings and arrays have multiple possible - * representations (for example, a string could be a slice). It also gives - * us more flexibility wrt refcounting. The cost is that when a field *is* - * being used, the net memory usage is one pointer more than if we had - * included the thing directly. */ - -#ifndef UPB_DATA_H -#define UPB_DATA_H - -#include -#include -#include "upb.h" -#include "upb_atomic.h" -#include "upb_def.h" -#include "upb_srcsink.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* upb_data *******************************************************************/ - -// The "base class" of strings, arrays, and messages. Contains a few flags and -// possibly a reference count. None of the functions for upb_data are public, -// but some of the constants are. - -// typedef upb_atomic_refcount_t upb_data; - -// The flags in upb_data. -typedef enum { - // Set if the object itself was allocated with malloc() and should be freed - // with free(). This flag would be false if the object was allocated on the - // stack or is data from the static segment of an object file. Note that this - // flag does not apply to the data being referenced by a string or array. - // - // If this flag is false, UPB_FLAG_HAS_REFCOUNT must be false also; there is - // no sense refcounting something that does not need to be freed. - UPB_DATA_HEAPALLOCATED = 1, - - // Set if the object is frozen against modification. While an object is - // frozen, it is suitable for concurrent readonly access. Note that this - // flag alone is not a sufficient mechanism for preventing any kind of writes - // to the object's memory, because the object could still have a refcount. - UPB_DATA_FROZEN = (1<<1), - - // Set if the object has an embedded refcount. - UPB_DATA_REFCOUNTED = (1<<2) -} upb_data_flag; - -#define REFCOUNT_MASK 0xFFFFFFF8 -#define REFCOUNT_SHIFT 3 -#define REFCOUNT_ONE (1<v & flag; -} - -// INTERNAL-ONLY -INLINE void upb_data_setflag(upb_data *d, upb_data_flag flag) { - d->v |= flag; -} - -INLINE uint32_t upb_data_getrefcount(upb_data *d) { - int data; - if(upb_data_hasflag(d, UPB_DATA_FROZEN)) - data = upb_atomic_read(d); - else - data = d->v; - return (data & REFCOUNT_MASK) >> REFCOUNT_SHIFT; -} - -// Returns true if the given data has only one owner. -INLINE bool upb_data_only(upb_data *data) { - return !upb_data_hasflag(data, UPB_DATA_REFCOUNTED) || - upb_data_getrefcount(data) == 1; -} - -// Specifies the type of ref that is requested based on the kind of access the -// caller needs to the object. -typedef enum { - // Use when the client plans to perform read-only access to the object, and - // only in one thread at a time. This imposes the least requirements on the - // object; it can be either frozen or not. As a result, requesting a - // reference of this type never performs a copy unless the object has no - // refcount. - // - // A ref of this type can always be explicitly converted to frozen or - // unfrozen later. - UPB_REF_THREADUNSAFE_READONLY = 0, - - // Use when the client plans to perform read-only access, but from multiple - // threads concurrently. This will force the object to eagerly perform any - // parsing that may have been lazily deferred, and will force a copy if the - // object is not current frozen. - // - // Asking for a reference of this type is equivalent to: - // x = getref(y, UPB_REF_THREADUNSAFE_READONLY); - // x = freeze(x); - // ...except it is more efficient. - UPB_REF_FROZEN = 1, - - // Use when the client plans to perform read/write access. As a result, the - // reference will not be thread-safe for concurrent reading *or* writing; the - // object must be externally synchronized if it is being accessed from more - // than one thread. This will force a copy if the object is currently frozen. - // - // Asking for a reference of this type is equivalent to: - // x = getref(y, UPB_REF_THREADUNSAFE_READONLY); - // x = thaw(x); - // ...except it is more efficient. - UPB_REF_MUTABLE = 2 -} upb_reftype; - -// INTERNAL-ONLY FUNCTION: -// Attempts to increment the reference on d with the given type of ref. If -// this is not possible, returns false. -INLINE bool _upb_data_incref(upb_data *d, upb_reftype reftype) { - bool frozen = upb_data_hasflag(d, UPB_DATA_FROZEN); - if((reftype == UPB_REF_FROZEN && !frozen) || - (reftype == UPB_REF_MUTABLE && frozen) || - (upb_data_hasflag(d, UPB_DATA_HEAPALLOCATED) && - !upb_data_hasflag(d, UPB_DATA_REFCOUNTED))) { - return false; - } - // Increment the ref. Only need to use atomic ops if the ref is frozen. - if(upb_data_hasflag(d, UPB_DATA_FROZEN)) upb_atomic_add(d, REFCOUNT_ONE); - else d->v += REFCOUNT_ONE; - return true; -} - -// INTERNAL-ONLY FUNCTION: -// Releases a reference on d, returning true if the object should be deleted. -INLINE bool _upb_data_unref(upb_data *d) { - if(upb_data_hasflag(d, UPB_DATA_HEAPALLOCATED)) { - // A heap-allocated object without a refcount should never be decref'd. - // Its owner owns it exlusively and should free it directly. - assert(upb_data_hasflag(d, UPB_DATA_REFCOUNTED)); - if(upb_data_hasflag(d, UPB_DATA_FROZEN)) { - int32_t old_val = upb_atomic_fetch_and_add(d, -REFCOUNT_ONE); - return (old_val & REFCOUNT_MASK) == REFCOUNT_ONE; - } else { - d->v -= REFCOUNT_ONE; - return (d->v & REFCOUNT_MASK) == 0; - } - } else { - // Non heap-allocated data never should be deleted. - return false; - } -} - -/* upb_string *****************************************************************/ - -// We have several different representations for string, depending on whether -// it has a refcount (and likely in the future, depending on whether it is a -// slice of another string). We could just have one representation with -// members that are sometimes unused, but this is wasteful in memory. The -// flags that are always part of the first word tell us which representation -// to use. -// -// In a way, this is like inheritance but instead of using a virtual pointer, -// we do switch/case in every "virtual" method. This may sound expensive but -// in many cases the different cases compile to exactly the same code, so there -// is no branch. - -struct upb_norefcount_string { - uint32_t byte_size_and_flags; - upb_strlen_t byte_len; - // We expect the data to be 8-bit clean (uint8_t), but char* is such an - // ingrained convention that we follow it. - char *ptr; -}; - -// Used for a string with a refcount. -struct upb_refcounted_string { - upb_data base; - upb_strlen_t byte_len; - char *ptr; - uint32_t byte_size; -}; - - -// Returns a newly constructed, refcounted string which starts out empty. -// Caller owns one ref on it. The returned string will not be frozen. -upb_strptr upb_string_new(void); - -// INTERNAL-ONLY: -// Frees the given string, alone with any memory the string owned. -void _upb_string_free(upb_strptr s); - -// Returns a string to which caller owns a ref, and contains the same contents -// as src. The returned value may be a copy of src, if the requested flags -// were incompatible with src's. -upb_strptr upb_string_getref(upb_strptr s, int ref_flags); - -#define UPB_STRING_NULL_INITIALIZER {NULL} -static const upb_strptr UPB_STRING_NULL = UPB_STRING_NULL_INITIALIZER; -INLINE bool upb_string_isnull(upb_strptr s) { return s.base == NULL; } - -// The caller releases a ref on src, which it must previously have owned a ref -// on. -INLINE void upb_string_unref(upb_strptr s) { - if(_upb_data_unref(s.base)) _upb_string_free(s); -} - -// The string is resized to byte_len. The string must not be frozen. -void upb_string_resize(upb_strptr s, upb_strlen_t len); - -// Returns a buffer to which the caller may write. The string is resized to -// byte_len (which may or may not trigger a reallocation). The string must not -// be frozen. -INLINE char *upb_string_getrwbuf(upb_strptr s, upb_strlen_t byte_len) { - upb_string_resize(s, byte_len); - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) - return s.refcounted->ptr; - else - return s.norefcount->ptr; -} - -INLINE void upb_string_clear(upb_strptr s) { - upb_string_getrwbuf(s, 0); -} - -// INTERNAL-ONLY: -// Gets/sets the pointer. -INLINE char *_upb_string_getptr(upb_strptr s) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) - return s.refcounted->ptr; - else - return s.norefcount->ptr; -} - -// Returns a buffer that the caller may use to read the current contents of -// the string. The number of bytes available is upb_strlen(s). -INLINE const char *upb_string_getrobuf(upb_strptr s) { - return _upb_string_getptr(s); -} - -// Returns the current length of the string. -INLINE upb_strlen_t upb_strlen(upb_strptr s) { - if(upb_data_hasflag(s.base, UPB_DATA_REFCOUNTED)) - return s.refcounted->byte_len; - else - return s.norefcount->byte_len; -} - -/* upb_string library functions ***********************************************/ - -// Named like their counterparts, these are all safe against buffer -// overflow. These only use the public upb_string interface. - -// More efficient than upb_strcmp if all you need is to test equality. -INLINE bool upb_streql(upb_strptr s1, upb_strptr s2) { - upb_strlen_t len = upb_strlen(s1); - if(len != upb_strlen(s2)) { - return false; - } else { - return memcmp(upb_string_getrobuf(s1), upb_string_getrobuf(s2), len) == 0; - } -} - -// Like strcmp(). -int upb_strcmp(upb_strptr s1, upb_strptr s2); - -// Like upb_strcpy, but copies from a buffer and length. -INLINE void upb_strcpylen(upb_strptr dest, const void *src, upb_strlen_t len) { - memcpy(upb_string_getrwbuf(dest, len), src, len); -} - -// Replaces the contents of "dest" with the contents of "src". -INLINE void upb_strcpy(upb_strptr dest, upb_strptr src) { - upb_strcpylen(dest, upb_string_getrobuf(src), upb_strlen(src)); -} - -// Like upb_strcpy, but copies from a NULL-terminated string. -INLINE void upb_strcpyc(upb_strptr dest, const char *src) { - // This does two passes over src, but that is necessary unless we want to - // repeatedly re-allocate dst, which seems worse. - upb_strcpylen(dest, src, strlen(src)); -} - -// Returns a new string whose contents are a copy of s. -upb_strptr upb_strdup(upb_strptr s); - -// Like upb_strdup(), but duplicates a given buffer and length. -INLINE upb_strptr upb_strduplen(const void *src, upb_strlen_t len) { - upb_strptr s = upb_string_new(); - upb_strcpylen(s, src, len); - return s; -} - -// Like upb_strdup(), but duplicates a C NULL-terminated string. -upb_strptr upb_strdupc(const char *src); - -// Appends 'append' to 's' in-place, resizing s if necessary. -void upb_strcat(upb_strptr s, upb_strptr append); - -// Returns a string that is a substring of the given string. Currently this -// returns a copy, but in the future this may return an object that references -// the original string data instead of copying it. Both now and in the future, -// the caller owns a ref on whatever is returned. -upb_strptr upb_strslice(upb_strptr s, int offset, int len); - -// Reads an entire file into a newly-allocated string (caller owns one ref). -upb_strptr upb_strreadfile(const char *filename); - -// Typedef for a read-only string that is allocated statically or on the stack. -// Initialize with the given macro, which must resolve to a const char*. You -// must not dynamically allocate this type. Example usage: -// -// upb_static_string mystr = UPB_STATIC_STRING_INIT("biscuits"); -// upb_strptr mystr_ptr = UPB_STATIC_STRING_PTR_INIT(mystr); -// -// If C99 compund literals are available, the much nicer UPB_STRLIT macro is -// available instead: -// -// upb_strtr mystr_ptr = UPB_STRLIT("biscuits"); -// -typedef struct upb_norefcount_string upb_static_string; -#define UPB_STATIC_STRING_INIT_LEN(str, len) {0 | UPB_DATA_FROZEN, len, str} -#define UPB_STATIC_STRING_INIT(str) UPB_STATIC_STRING_INIT_LEN(str, sizeof(str)-1) -#define UPB_STATIC_STRING_PTR_INIT(static_string) {&static_string} -#define UPB_STRLIT(str) (upb_strptr){&(upb_static_string)UPB_STATIC_STRING_INIT(str)} - -// Allows using upb_strings in printf, ie: -// upb_strptr str = UPB_STRLIT("Hello, World!\n"); -// printf("String is: " UPB_STRFMT, UPB_STRARG(str)); */ -#define UPB_STRARG(str) upb_strlen(str), upb_string_getrobuf(str) -#define UPB_STRFMT "%.*s" - -/* upb_array ******************************************************************/ - -// The comments attached to upb_string above also apply here. -struct upb_norefcount_array { - upb_data base; // We co-opt the refcount for the size. - upb_arraylen_t len; - upb_valueptr elements; -}; - -struct upb_refcounted_array { - upb_data base; - upb_arraylen_t len; - upb_valueptr elements; - upb_arraylen_t size; -}; - -typedef struct upb_norefcount_array upb_static_array; -#define UPB_STATIC_ARRAY_INIT(arr, len) {{0 | UPB_DATA_FROZEN}, len, {._void=arr}} -#define UPB_STATIC_ARRAY_PTR_TYPED_INIT(static_arr) {{&static_arr}} - -#define UPB_ARRAY_NULL_INITIALIZER {NULL} -static const upb_arrayptr UPB_ARRAY_NULL = UPB_ARRAY_NULL_INITIALIZER; -INLINE bool upb_array_isnull(upb_arrayptr a) { return a.base == NULL; } -INLINE bool upb_array_ptreql(upb_arrayptr a1, upb_arrayptr a2) { - return a1.base == a2.base; -} - -#define UPB_MSG_ARRAYPTR(type) type ## _array -#define UPB_DEFINE_MSG_ARRAY(type) \ -typedef struct { upb_arrayptr ptr; } UPB_MSG_ARRAYPTR(type); \ -INLINE upb_arraylen_t type ## _array_len(UPB_MSG_ARRAYPTR(type) a) { \ - return upb_array_len(a.ptr); \ -} \ -INLINE type* type ## _array_get(UPB_MSG_ARRAYPTR(type) a, upb_arraylen_t elem) { \ - return *(type**)_upb_array_getptr_raw(a.ptr, elem, sizeof(void*))._void; \ -} - -// Constructs a newly-allocated, reference-counted array which starts out -// empty. Caller owns one ref on it. -upb_arrayptr upb_array_new(void); - -// Returns the current number of elements in the array. -INLINE size_t upb_array_len(upb_arrayptr a) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) - return a.refcounted->len; - else - return a.norefcount->len; -} - -// INTERNAL-ONLY: -// Frees the given message and releases references on members. -void _upb_array_free(upb_arrayptr a, upb_fielddef *f); - -// INTERNAL-ONLY: -// Returns a pointer to the given elem. -INLINE upb_valueptr _upb_array_getptr_raw(upb_arrayptr a, upb_arraylen_t elem, - size_t type_size) { - upb_valueptr p; - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) - p._void = &a.refcounted->elements.uint8[elem * type_size]; - else - p._void = &a.norefcount->elements.uint8[elem * type_size]; - return p; -} - -INLINE upb_valueptr _upb_array_getptr(upb_arrayptr a, upb_fielddef *f, - upb_arraylen_t elem) { - return _upb_array_getptr_raw(a, elem, upb_types[f->type].size); -} - -INLINE upb_value upb_array_get(upb_arrayptr a, upb_fielddef *f, - upb_arraylen_t elem) { - assert(elem < upb_array_len(a)); - return upb_value_read(_upb_array_getptr(a, f, elem), f->type); -} - -// The caller releases a ref on the given array, which it must previously have -// owned a ref on. -INLINE void upb_array_unref(upb_arrayptr a, upb_fielddef *f) { - if(_upb_data_unref(a.base)) _upb_array_free(a, f); -} - -#if 0 -// Returns an array to which caller owns a ref, and contains the same contents -// as src. The returned value may be a copy of src, if the requested flags -// were incompatible with src's. -INLINE upb_arrayptr upb_array_getref(upb_arrayptr src, int ref_flags); - -// Sets the given element in the array to val. The current length of the array -// must be greater than elem. If the field type is dynamic, the array will -// take a ref on val and release a ref on what was previously in the array. -INLINE void upb_array_set(upb_arrayptr a, upb_fielddef *f, int elem, - upb_value val); - - -// Note that array_append will attempt to take a reference on the given value, -// so to avoid a copy use append_default and get. -INLINE void upb_array_append(upb_arrayptr a, upb_fielddef *f, - upb_value val); -INLINE void upb_array_append_default(upb_arrayptr a, upb_fielddef *f, - upb_value val); -#endif - -INLINE void upb_array_truncate(upb_arrayptr a) { - if(upb_data_hasflag(a.base, UPB_DATA_REFCOUNTED)) - a.refcounted->len = 0; - else - a.norefcount->len = 0; -} - - -/* upb_msg ********************************************************************/ - -// Note that some inline functions for upb_msg are defined in upb_def.h since -// they rely on the defs. - -struct _upb_msg { - upb_data base; - uint8_t data[4]; // We allocate the appropriate amount per message. -}; - -// Creates a new msg of the given type. -upb_msg *upb_msg_new(upb_msgdef *md); - -// INTERNAL-ONLY: -// Frees the given message and releases references on members. -void _upb_msg_free(upb_msg *msg, upb_msgdef *md); - -// INTERNAL-ONLY: -// Returns a pointer to the given field. -INLINE upb_valueptr _upb_msg_getptr(upb_msg *msg, upb_fielddef *f) { - upb_valueptr p; - p._void = &msg->data[f->byte_offset]; - return p; -} - -// Releases a references on msg. -INLINE void upb_msg_unref(upb_msg *msg, upb_msgdef *md) { - if(_upb_data_unref(&msg->base)) _upb_msg_free(msg, md); -} - -// Tests whether the given field is explicitly set, or whether it will return -// a default. -INLINE bool upb_msg_has(upb_msg *msg, upb_fielddef *f) { - return (msg->data[f->field_index/8] & (1 << (f->field_index % 8))) != 0; -} - -// Returns the current value if set, or the default value if not set, of the -// specified field. The caller does *not* own a ref. -INLINE upb_value upb_msg_get(upb_msg *msg, upb_fielddef *f) { - if(upb_msg_has(msg, f)) { - return upb_value_read(_upb_msg_getptr(msg, f), f->type); - } else { - return f->default_value; - } -} - -// Sets the given field to the given value. The msg will take a ref on val, -// and will drop a ref on whatever was there before. -void upb_msg_set(upb_msg *msg, upb_fielddef *f, upb_value val); - -INLINE void upb_msg_clear(upb_msg *msg, upb_msgdef *md) { - memset(msg->data, 0, md->set_flags_bytes); -} - -// A convenience function for decoding an entire protobuf all at once, without -// having to worry about setting up the appropriate objects. -void upb_msg_decodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, - upb_status *status); - -// A convenience function for encoding an entire protobuf all at once. If an -// error occurs, the null string is returned and the status object contains -// the error. -void upb_msg_encodestr(upb_msg *msg, upb_msgdef *md, upb_strptr str, - upb_status *status); - - -/* upb_msgsrc *****************************************************************/ - -// A nonresumable, non-interruptable (but simple and fast) source for pushing -// the data of a upb_msg to a upb_sink. -void upb_msgsrc_produce(upb_msg *msg, upb_msgdef *md, upb_sink *sink, - bool reverse, upb_status *status); - - -/* upb_msgsink ****************************************************************/ - -// A upb_msgsink can accept the data from a source and write it into a message. -struct upb_msgsink; -typedef struct upb_msgsink upb_msgsink; - -// Allocate and free a msgsink, respectively. -upb_msgsink *upb_msgsink_new(upb_msgdef *md); -void upb_msgsink_free(upb_msgsink *sink); - -// Returns the upb_sink (like an upcast). -upb_sink *upb_msgsink_sink(upb_msgsink *sink); - -// Resets the msgsink for the given msg. -void upb_msgsink_reset(upb_msgsink *sink, upb_msg *msg); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/upb_def.c b/src/upb_def.c index 31f14fa..bb1f07a 100644 --- a/src/upb_def.c +++ b/src/upb_def.c @@ -6,6 +6,7 @@ #include #include "descriptor_const.h" +#include "descriptor.h" #include "upb_def.h" #define CHECKSRC(x) if(!(x)) goto src_err @@ -840,6 +841,7 @@ err: upb_deflist_uninit(&defs); } + /* upb_baredecoder ************************************************************/ // upb_baredecoder is a upb_src that can parse a subset of the protocol buffer @@ -977,7 +979,7 @@ static upb_src_vtable upb_baredecoder_src_vtbl = { (upb_src_endmsg_fptr)&upb_baredecoder_endmsg, }; -upb_baredecoder *upb_baredecoder_new(upb_string *str) +static upb_baredecoder *upb_baredecoder_new(upb_string *str) { upb_baredecoder *d = malloc(sizeof(*d)); d->input = upb_string_getref(str); @@ -987,9 +989,30 @@ upb_baredecoder *upb_baredecoder_new(upb_string *str) return d; } -void upb_baredecoder_free(upb_baredecoder *d) +static void upb_baredecoder_free(upb_baredecoder *d) { upb_string_unref(d->input); upb_string_unref(d->str); free(d); } + +static upb_src *upb_baredecoder_src(upb_baredecoder *d) +{ + return &d->src; +} + +upb_symtab *upb_get_descriptor_symtab() +{ + // TODO: implement sharing of symtabs, so that successive calls to this + // function will return the same symtab. + upb_symtab *symtab = upb_symtab_new(); + // TODO: allow upb_strings to be static or on the stack. + upb_string *descriptor = upb_strduplen(descriptor_pb, descriptor_pb_len); + upb_baredecoder *decoder = upb_baredecoder_new(descriptor); + upb_status status; + upb_symtab_addfds(symtab, upb_baredecoder_src(decoder), &status); + assert(upb_ok(&status)); + upb_baredecoder_free(decoder); + upb_string_unref(descriptor); + return symtab; +} diff --git a/src/upb_def.h b/src/upb_def.h index 033dcde..b73b0f9 100644 --- a/src/upb_def.h +++ b/src/upb_def.h @@ -257,6 +257,11 @@ upb_def **upb_symtab_getdefs(upb_symtab *s, int *count, upb_def_type_t type); // more useful? Maybe it should be an option. void upb_symtab_addfds(upb_symtab *s, upb_src *desc, upb_status *status); +// Returns a symtab that defines google.protobuf.DescriptorProto and all other +// types that are defined in descriptor.proto. This allows you to load other +// proto types. The caller owns a ref on the returned symtab. +upb_symtab *upb_get_descriptor_symtab(); + /* upb_def casts **************************************************************/ diff --git a/src/upb_table.c b/src/upb_table.c index 6fd2c20..b91776c 100644 --- a/src/upb_table.c +++ b/src/upb_table.c @@ -232,7 +232,7 @@ void *upb_strtable_next(upb_strtable *t, upb_strtable_entry *cur) { do { cur = (void*)((char*)cur + t->t.entry_size); if(cur == end) return NULL; - } while(upb_string_isnull(cur->key)); + } while(cur->key == NULL); return cur; } -- cgit v1.2.3 From 7a6a702792e769366a8852fc90dbea9cfc9e01c0 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 11 Jul 2010 18:53:27 -0700 Subject: Allow static upb_strings. This can allow strings to reference static data, and reduced the memory footprint of test_def by about 10% (3k). --- core/upb_def.c | 4 +--- core/upb_string.c | 12 ++++++++--- core/upb_string.h | 57 +++++++++++++++++++++++++++++++++++++++++++++---- descriptor/descriptor.c | 7 ++++-- descriptor/descriptor.h | 5 +++-- tests/test_string.c | 33 +++++++++++++++++++++++++++- 6 files changed, 103 insertions(+), 15 deletions(-) (limited to 'descriptor') diff --git a/core/upb_def.c b/core/upb_def.c index b9402c5..c0d72db 100644 --- a/core/upb_def.c +++ b/core/upb_def.c @@ -1018,12 +1018,10 @@ static upb_src *upb_baredecoder_src(upb_baredecoder *d) void upb_symtab_add_descriptorproto(upb_symtab *symtab) { // TODO: allow upb_strings to be static or on the stack. - upb_string *descriptor = upb_strduplen(descriptor_pb, descriptor_pb_len); - upb_baredecoder *decoder = upb_baredecoder_new(descriptor); + upb_baredecoder *decoder = upb_baredecoder_new(&descriptor_str); upb_status status = UPB_STATUS_INIT; upb_symtab_addfds(symtab, upb_baredecoder_src(decoder), &status); upb_baredecoder_free(decoder); - upb_string_unref(descriptor); if(!upb_ok(&status)) { // upb itself is corrupt. diff --git a/core/upb_string.c b/core/upb_string.c index 3563c9e..ca3c669 100644 --- a/core/upb_string.c +++ b/core/upb_string.c @@ -61,12 +61,12 @@ void _upb_string_free(upb_string *str) { } upb_string *upb_string_tryrecycle(upb_string *str) { - if(str == NULL || upb_atomic_read(&str->refcount) > 1) { - return upb_string_new(); - } else { + if(str && upb_atomic_read(&str->refcount) == 1) { str->ptr = NULL; upb_string_release(str); return str; + } else { + return upb_string_new(); } } @@ -125,3 +125,9 @@ upb_string *upb_string_asprintf(const char *format, ...) { va_end(args); return str; } + +upb_string *upb_strdup(upb_string *s) { + upb_string *str = upb_string_new(); + upb_strcpy(str, s); + return str; +} diff --git a/core/upb_string.h b/core/upb_string.h index 5cc0eaf..65ba404 100644 --- a/core/upb_string.h +++ b/core/upb_string.h @@ -63,6 +63,17 @@ struct _upb_string { struct _upb_string *src; }; +// Internal-only initializer for upb_string instances. +#ifdef UPB_HAVE_MSIZE +#define _UPB_STRING_INIT(str, len, refcount) {(char*)str, NULL, len, {refcount}, NULL} +#else +#define _UPB_STRING_INIT(str, len, refcount) {(char*)str, NULL, len, 0, {refcount}, NULL} +#endif + +// Special pseudo-refcounts for static/stack-allocated strings, respectively. +#define _UPB_STRING_REFCOUNT_STATIC -1 +#define _UPB_STRING_REFCOUNT_STACK -2 + // Returns a newly-created, empty, non-finalized string. When the string is no // longer needed, it should be unref'd, never freed directly. upb_string *upb_string_new(); @@ -72,15 +83,21 @@ void _upb_string_free(upb_string *str); // Releases a ref on the given string, which may free the memory. "str" // can be NULL, in which case this is a no-op. INLINE void upb_string_unref(upb_string *str) { - if (str && upb_atomic_unref(&str->refcount)) _upb_string_free(str); + if (str && upb_atomic_read(&str->refcount) > 0 && + upb_atomic_unref(&str->refcount)) { + _upb_string_free(str); + } } +upb_string *upb_strdup(upb_string *s); // Forward-declare. + // Returns a string with the same contents as "str". The caller owns a ref on // the returned string, which may or may not be the same object as "str. INLINE upb_string *upb_string_getref(upb_string *str) { - // If/when we support stack-allocated strings, this will have to allocate - // a new string if the given string is on the stack. - upb_atomic_ref(&str->refcount); + int refcount = upb_atomic_read(&str->refcount); + if (refcount == _UPB_STRING_REFCOUNT_STACK) return upb_strdup(str); + // We don't ref the special <0 refcount for static strings. + if (refcount > 0) upb_atomic_ref(&str->refcount); return str; } @@ -151,6 +168,38 @@ void upb_string_substr(upb_string *str, upb_string *target_str, #define UPB_STRARG(str) upb_string_len(str), upb_string_getrobuf(str) #define UPB_STRFMT "%.*s" +// Macros for constructing upb_string objects statically or on the stack. These +// can be used like: +// +// upb_string static_str = UPB_STATIC_STRING("Foo"); +// +// int main() { +// upb_string stack_str = UPB_STACK_STRING("Foo"); +// // Now: +// // upb_streql(&static_str, &stack_str) == true +// // upb_streql(&static_str, UPB_STRLIT("Foo")) == true +// } +// +// You can also use UPB_STACK_STRING or UPB_STATIC_STRING with character arrays, +// but you must not change the underlying data once you've passed the string on: +// +// void foo() { +// char data[] = "ABC123"; +// upb_string stack_str = UPB_STACK_STR(data); +// bar(&stack_str); +// data[0] = "B"; // NOT ALLOWED!! +// } +// +// TODO: should the stack business just be like attach/detach? The latter seems +// more flexible, though it does require a stack allocation. Maybe put this off +// until there is a clear use case. +#define UPB_STATIC_STRING(str) \ + _UPB_STRING_INIT(str, sizeof(str)-1, _UPB_STRING_REFCOUNT_STATIC) +#define UPB_STATIC_STRING_LEN(str, len) \ + _UPB_STRING_INIT(str, len, _UPB_STRING_REFCOUNT_STATIC) +#define UPB_STACK_STRING(str) _UPB_STRING_INIT(str, _UPB_STRING_REFCOUNT_STACK) +#define UPB_STRLIT(str) &(upb_string)UPB_STATIC_STRING(str) + /* upb_string library functions ***********************************************/ // Named like their counterparts, these are all safe against buffer diff --git a/descriptor/descriptor.c b/descriptor/descriptor.c index cd50a16..ee6b25b 100644 --- a/descriptor/descriptor.c +++ b/descriptor/descriptor.c @@ -1,4 +1,6 @@ -unsigned char descriptor_pb[] = { +#include "descriptor.h" + +static unsigned char descriptor_pb[] = { 0x0a, 0x9b, 0x1b, 0x0a, 0x1b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, @@ -291,4 +293,5 @@ unsigned char descriptor_pb[] = { 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01 }; -unsigned int descriptor_pb_len = 3486; +static const unsigned int descriptor_pb_len = 3486; +upb_string descriptor_str = UPB_STATIC_STRING(descriptor_pb); diff --git a/descriptor/descriptor.h b/descriptor/descriptor.h index b598a9a..f6d3ca3 100644 --- a/descriptor/descriptor.h +++ b/descriptor/descriptor.h @@ -11,12 +11,13 @@ #ifndef UPB_DESCRIPTOR_H_ #define UPB_DESCRIPTOR_H_ +#include "upb_string.h" + #ifdef __cplusplus extern "C" { #endif -extern unsigned char descriptor_pb[]; -extern unsigned int descriptor_pb_len; +extern upb_string descriptor_str; #ifdef __cplusplus } /* extern "C" */ diff --git a/tests/test_string.c b/tests/test_string.c index 46f35b9..7c9ed02 100644 --- a/tests/test_string.c +++ b/tests/test_string.c @@ -3,8 +3,33 @@ #include "upb_string.h" char static_str[] = "Static string."; +upb_string static_upbstr = UPB_STATIC_STRING(static_str); -int main() { +static void test_static() { + // Static string is initialized appropriately. + assert(upb_streql(&static_upbstr, UPB_STRLIT("Static string."))); + + // Taking a ref on a static string returns the same string, and repeated + // refs don't get the string in a confused state. + assert(upb_string_getref(&static_upbstr) == &static_upbstr); + assert(upb_string_getref(&static_upbstr) == &static_upbstr); + assert(upb_string_getref(&static_upbstr) == &static_upbstr); + + // Unreffing a static string does nothing (is not harmful). + upb_string_unref(&static_upbstr); + upb_string_unref(&static_upbstr); + upb_string_unref(&static_upbstr); + upb_string_unref(&static_upbstr); + upb_string_unref(&static_upbstr); + + // Recycling a static string returns a new string (that can be modified). + upb_string *str = upb_string_tryrecycle(&static_upbstr); + assert(str != &static_upbstr); + + upb_string_unref(str); +} + +static void test_dynamic() { upb_string *str = upb_string_new(); assert(str != NULL); upb_string_unref(str); @@ -29,6 +54,7 @@ int main() { const char *robuf2 = upb_string_getrobuf(str); assert(robuf2 == robuf); assert(upb_streqlc(str, "XX")); + assert(upb_streql(str, UPB_STRLIT("XX"))); // Make string alias part of another string. str2 = upb_strdupc("WXYZ"); @@ -79,3 +105,8 @@ int main() { // Unref of NULL is harmless. upb_string_unref(NULL); } + +int main() { + test_static(); + test_dynamic(); +} -- cgit v1.2.3