mirror of https://github.com/grpc/grpc.git
All these changes need to go together to make sense - changes to use new version of upb in bazel - allowing includes in build target option - script for generating c code (upb) for protos - generated code for example protos - adding changes for non-bazel builds - change sanity tests to ignore the generated files.pull/18258/head
parent
a89df2e275
commit
319fcdf26e
29 changed files with 3371 additions and 7 deletions
@ -0,0 +1,27 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/any.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/any.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout_field google_protobuf_Any__fields[2] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 9, 1}, |
||||
{2, UPB_SIZE(8, 16), 0, 0, 12, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Any_msginit = { |
||||
NULL, |
||||
&google_protobuf_Any__fields[0], |
||||
UPB_SIZE(16, 32), 2, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
@ -0,0 +1,59 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/any.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ |
||||
#define GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ |
||||
|
||||
#include "upb/generated_util.h" |
||||
|
||||
#include "upb/msg.h" |
||||
|
||||
#include "upb/decode.h" |
||||
#include "upb/encode.h" |
||||
#include "upb/port_def.inc" |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct google_protobuf_Any; |
||||
typedef struct google_protobuf_Any google_protobuf_Any; |
||||
extern const upb_msglayout google_protobuf_Any_msginit; |
||||
|
||||
/* Enums */ |
||||
|
||||
/* google.protobuf.Any */ |
||||
|
||||
UPB_INLINE google_protobuf_Any *google_protobuf_Any_new(upb_arena *arena) { |
||||
return (google_protobuf_Any *)upb_msg_new(&google_protobuf_Any_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Any *google_protobuf_Any_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Any *ret = google_protobuf_Any_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Any_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Any_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE upb_strview google_protobuf_Any_type_url(const google_protobuf_Any *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } |
||||
UPB_INLINE upb_strview google_protobuf_Any_value(const google_protobuf_Any *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 16)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_strview value) { |
||||
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_strview value) { |
||||
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 16)) = value; |
||||
} |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} /* extern "C" */ |
||||
#endif |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
||||
#endif /* GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ */ |
@ -0,0 +1,485 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/descriptor.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/descriptor.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout *const google_protobuf_FileDescriptorSet_submsgs[1] = { |
||||
&google_protobuf_FileDescriptorProto_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FileDescriptorSet__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FileDescriptorSet_msginit = { |
||||
&google_protobuf_FileDescriptorSet_submsgs[0], |
||||
&google_protobuf_FileDescriptorSet__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6] = { |
||||
&google_protobuf_DescriptorProto_msginit, |
||||
&google_protobuf_EnumDescriptorProto_msginit, |
||||
&google_protobuf_FieldDescriptorProto_msginit, |
||||
&google_protobuf_FileOptions_msginit, |
||||
&google_protobuf_ServiceDescriptorProto_msginit, |
||||
&google_protobuf_SourceCodeInfo_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12] = { |
||||
{1, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{2, UPB_SIZE(12, 24), 2, 0, 9, 1}, |
||||
{3, UPB_SIZE(36, 72), 0, 0, 9, 3}, |
||||
{4, UPB_SIZE(40, 80), 0, 0, 11, 3}, |
||||
{5, UPB_SIZE(44, 88), 0, 1, 11, 3}, |
||||
{6, UPB_SIZE(48, 96), 0, 4, 11, 3}, |
||||
{7, UPB_SIZE(52, 104), 0, 2, 11, 3}, |
||||
{8, UPB_SIZE(28, 56), 4, 3, 11, 1}, |
||||
{9, UPB_SIZE(32, 64), 5, 5, 11, 1}, |
||||
{10, UPB_SIZE(56, 112), 0, 0, 5, 3}, |
||||
{11, UPB_SIZE(60, 120), 0, 0, 5, 3}, |
||||
{12, UPB_SIZE(20, 40), 3, 0, 9, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FileDescriptorProto_msginit = { |
||||
&google_protobuf_FileDescriptorProto_submsgs[0], |
||||
&google_protobuf_FileDescriptorProto__fields[0], |
||||
UPB_SIZE(64, 128), 12, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[8] = { |
||||
&google_protobuf_DescriptorProto_msginit, |
||||
&google_protobuf_DescriptorProto_ExtensionRange_msginit, |
||||
&google_protobuf_DescriptorProto_ReservedRange_msginit, |
||||
&google_protobuf_EnumDescriptorProto_msginit, |
||||
&google_protobuf_FieldDescriptorProto_msginit, |
||||
&google_protobuf_MessageOptions_msginit, |
||||
&google_protobuf_OneofDescriptorProto_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = { |
||||
{1, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{2, UPB_SIZE(16, 32), 0, 4, 11, 3}, |
||||
{3, UPB_SIZE(20, 40), 0, 0, 11, 3}, |
||||
{4, UPB_SIZE(24, 48), 0, 3, 11, 3}, |
||||
{5, UPB_SIZE(28, 56), 0, 1, 11, 3}, |
||||
{6, UPB_SIZE(32, 64), 0, 4, 11, 3}, |
||||
{7, UPB_SIZE(12, 24), 2, 5, 11, 1}, |
||||
{8, UPB_SIZE(36, 72), 0, 6, 11, 3}, |
||||
{9, UPB_SIZE(40, 80), 0, 2, 11, 3}, |
||||
{10, UPB_SIZE(44, 88), 0, 0, 9, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_DescriptorProto_msginit = { |
||||
&google_protobuf_DescriptorProto_submsgs[0], |
||||
&google_protobuf_DescriptorProto__fields[0], |
||||
UPB_SIZE(48, 96), 10, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { |
||||
&google_protobuf_ExtensionRangeOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = { |
||||
{1, UPB_SIZE(4, 4), 1, 0, 5, 1}, |
||||
{2, UPB_SIZE(8, 8), 2, 0, 5, 1}, |
||||
{3, UPB_SIZE(12, 16), 3, 0, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit = { |
||||
&google_protobuf_DescriptorProto_ExtensionRange_submsgs[0], |
||||
&google_protobuf_DescriptorProto_ExtensionRange__fields[0], |
||||
UPB_SIZE(16, 24), 3, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_DescriptorProto_ReservedRange__fields[2] = { |
||||
{1, UPB_SIZE(4, 4), 1, 0, 5, 1}, |
||||
{2, UPB_SIZE(8, 8), 2, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit = { |
||||
NULL, |
||||
&google_protobuf_DescriptorProto_ReservedRange__fields[0], |
||||
UPB_SIZE(12, 12), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_ExtensionRangeOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1] = { |
||||
{999, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit = { |
||||
&google_protobuf_ExtensionRangeOptions_submsgs[0], |
||||
&google_protobuf_ExtensionRangeOptions__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1] = { |
||||
&google_protobuf_FieldOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[10] = { |
||||
{1, UPB_SIZE(32, 32), 5, 0, 9, 1}, |
||||
{2, UPB_SIZE(40, 48), 6, 0, 9, 1}, |
||||
{3, UPB_SIZE(24, 24), 3, 0, 5, 1}, |
||||
{4, UPB_SIZE(8, 8), 1, 0, 14, 1}, |
||||
{5, UPB_SIZE(16, 16), 2, 0, 14, 1}, |
||||
{6, UPB_SIZE(48, 64), 7, 0, 9, 1}, |
||||
{7, UPB_SIZE(56, 80), 8, 0, 9, 1}, |
||||
{8, UPB_SIZE(72, 112), 10, 0, 11, 1}, |
||||
{9, UPB_SIZE(28, 28), 4, 0, 5, 1}, |
||||
{10, UPB_SIZE(64, 96), 9, 0, 9, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = { |
||||
&google_protobuf_FieldDescriptorProto_submsgs[0], |
||||
&google_protobuf_FieldDescriptorProto__fields[0], |
||||
UPB_SIZE(80, 128), 10, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = { |
||||
&google_protobuf_OneofOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2] = { |
||||
{1, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{2, UPB_SIZE(12, 24), 2, 0, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_OneofDescriptorProto_msginit = { |
||||
&google_protobuf_OneofDescriptorProto_submsgs[0], |
||||
&google_protobuf_OneofDescriptorProto__fields[0], |
||||
UPB_SIZE(16, 32), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3] = { |
||||
&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, |
||||
&google_protobuf_EnumOptions_msginit, |
||||
&google_protobuf_EnumValueDescriptorProto_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5] = { |
||||
{1, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{2, UPB_SIZE(16, 32), 0, 2, 11, 3}, |
||||
{3, UPB_SIZE(12, 24), 2, 1, 11, 1}, |
||||
{4, UPB_SIZE(20, 40), 0, 0, 11, 3}, |
||||
{5, UPB_SIZE(24, 48), 0, 0, 9, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = { |
||||
&google_protobuf_EnumDescriptorProto_submsgs[0], |
||||
&google_protobuf_EnumDescriptorProto__fields[0], |
||||
UPB_SIZE(32, 64), 5, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { |
||||
{1, UPB_SIZE(4, 4), 1, 0, 5, 1}, |
||||
{2, UPB_SIZE(8, 8), 2, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = { |
||||
NULL, |
||||
&google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], |
||||
UPB_SIZE(12, 12), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_submsgs[1] = { |
||||
&google_protobuf_EnumValueOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = { |
||||
{1, UPB_SIZE(8, 8), 2, 0, 9, 1}, |
||||
{2, UPB_SIZE(4, 4), 1, 0, 5, 1}, |
||||
{3, UPB_SIZE(16, 24), 3, 0, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit = { |
||||
&google_protobuf_EnumValueDescriptorProto_submsgs[0], |
||||
&google_protobuf_EnumValueDescriptorProto__fields[0], |
||||
UPB_SIZE(24, 32), 3, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs[2] = { |
||||
&google_protobuf_MethodDescriptorProto_msginit, |
||||
&google_protobuf_ServiceOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3] = { |
||||
{1, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{2, UPB_SIZE(16, 32), 0, 0, 11, 3}, |
||||
{3, UPB_SIZE(12, 24), 2, 1, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit = { |
||||
&google_protobuf_ServiceDescriptorProto_submsgs[0], |
||||
&google_protobuf_ServiceDescriptorProto__fields[0], |
||||
UPB_SIZE(24, 48), 3, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[1] = { |
||||
&google_protobuf_MethodOptions_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = { |
||||
{1, UPB_SIZE(4, 8), 3, 0, 9, 1}, |
||||
{2, UPB_SIZE(12, 24), 4, 0, 9, 1}, |
||||
{3, UPB_SIZE(20, 40), 5, 0, 9, 1}, |
||||
{4, UPB_SIZE(28, 56), 6, 0, 11, 1}, |
||||
{5, UPB_SIZE(1, 1), 1, 0, 8, 1}, |
||||
{6, UPB_SIZE(2, 2), 2, 0, 8, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = { |
||||
&google_protobuf_MethodDescriptorProto_submsgs[0], |
||||
&google_protobuf_MethodDescriptorProto__fields[0], |
||||
UPB_SIZE(32, 64), 6, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = { |
||||
{1, UPB_SIZE(28, 32), 11, 0, 9, 1}, |
||||
{8, UPB_SIZE(36, 48), 12, 0, 9, 1}, |
||||
{9, UPB_SIZE(8, 8), 1, 0, 14, 1}, |
||||
{10, UPB_SIZE(16, 16), 2, 0, 8, 1}, |
||||
{11, UPB_SIZE(44, 64), 13, 0, 9, 1}, |
||||
{16, UPB_SIZE(17, 17), 3, 0, 8, 1}, |
||||
{17, UPB_SIZE(18, 18), 4, 0, 8, 1}, |
||||
{18, UPB_SIZE(19, 19), 5, 0, 8, 1}, |
||||
{20, UPB_SIZE(20, 20), 6, 0, 8, 1}, |
||||
{23, UPB_SIZE(21, 21), 7, 0, 8, 1}, |
||||
{27, UPB_SIZE(22, 22), 8, 0, 8, 1}, |
||||
{31, UPB_SIZE(23, 23), 9, 0, 8, 1}, |
||||
{36, UPB_SIZE(52, 80), 14, 0, 9, 1}, |
||||
{37, UPB_SIZE(60, 96), 15, 0, 9, 1}, |
||||
{39, UPB_SIZE(68, 112), 16, 0, 9, 1}, |
||||
{40, UPB_SIZE(76, 128), 17, 0, 9, 1}, |
||||
{41, UPB_SIZE(84, 144), 18, 0, 9, 1}, |
||||
{42, UPB_SIZE(24, 24), 10, 0, 8, 1}, |
||||
{44, UPB_SIZE(92, 160), 19, 0, 9, 1}, |
||||
{45, UPB_SIZE(100, 176), 20, 0, 9, 1}, |
||||
{999, UPB_SIZE(108, 192), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FileOptions_msginit = { |
||||
&google_protobuf_FileOptions_submsgs[0], |
||||
&google_protobuf_FileOptions__fields[0], |
||||
UPB_SIZE(112, 208), 21, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_MessageOptions__fields[5] = { |
||||
{1, UPB_SIZE(1, 1), 1, 0, 8, 1}, |
||||
{2, UPB_SIZE(2, 2), 2, 0, 8, 1}, |
||||
{3, UPB_SIZE(3, 3), 3, 0, 8, 1}, |
||||
{7, UPB_SIZE(4, 4), 4, 0, 8, 1}, |
||||
{999, UPB_SIZE(8, 8), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_MessageOptions_msginit = { |
||||
&google_protobuf_MessageOptions_submsgs[0], |
||||
&google_protobuf_MessageOptions__fields[0], |
||||
UPB_SIZE(12, 16), 5, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = { |
||||
{1, UPB_SIZE(8, 8), 1, 0, 14, 1}, |
||||
{2, UPB_SIZE(24, 24), 3, 0, 8, 1}, |
||||
{3, UPB_SIZE(25, 25), 4, 0, 8, 1}, |
||||
{5, UPB_SIZE(26, 26), 5, 0, 8, 1}, |
||||
{6, UPB_SIZE(16, 16), 2, 0, 14, 1}, |
||||
{10, UPB_SIZE(27, 27), 6, 0, 8, 1}, |
||||
{999, UPB_SIZE(28, 32), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FieldOptions_msginit = { |
||||
&google_protobuf_FieldOptions_submsgs[0], |
||||
&google_protobuf_FieldOptions__fields[0], |
||||
UPB_SIZE(32, 40), 7, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_OneofOptions__fields[1] = { |
||||
{999, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_OneofOptions_msginit = { |
||||
&google_protobuf_OneofOptions_submsgs[0], |
||||
&google_protobuf_OneofOptions__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_EnumOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_EnumOptions__fields[3] = { |
||||
{2, UPB_SIZE(1, 1), 1, 0, 8, 1}, |
||||
{3, UPB_SIZE(2, 2), 2, 0, 8, 1}, |
||||
{999, UPB_SIZE(4, 8), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_EnumOptions_msginit = { |
||||
&google_protobuf_EnumOptions_submsgs[0], |
||||
&google_protobuf_EnumOptions__fields[0], |
||||
UPB_SIZE(8, 16), 3, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_EnumValueOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2] = { |
||||
{1, UPB_SIZE(1, 1), 1, 0, 8, 1}, |
||||
{999, UPB_SIZE(4, 8), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_EnumValueOptions_msginit = { |
||||
&google_protobuf_EnumValueOptions_submsgs[0], |
||||
&google_protobuf_EnumValueOptions__fields[0], |
||||
UPB_SIZE(8, 16), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_ServiceOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2] = { |
||||
{33, UPB_SIZE(1, 1), 1, 0, 8, 1}, |
||||
{999, UPB_SIZE(4, 8), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_ServiceOptions_msginit = { |
||||
&google_protobuf_ServiceOptions_submsgs[0], |
||||
&google_protobuf_ServiceOptions__fields[0], |
||||
UPB_SIZE(8, 16), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = { |
||||
{33, UPB_SIZE(16, 16), 2, 0, 8, 1}, |
||||
{34, UPB_SIZE(8, 8), 1, 0, 14, 1}, |
||||
{999, UPB_SIZE(20, 24), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_MethodOptions_msginit = { |
||||
&google_protobuf_MethodOptions_submsgs[0], |
||||
&google_protobuf_MethodOptions__fields[0], |
||||
UPB_SIZE(24, 32), 3, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1] = { |
||||
&google_protobuf_UninterpretedOption_NamePart_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = { |
||||
{2, UPB_SIZE(56, 80), 0, 0, 11, 3}, |
||||
{3, UPB_SIZE(32, 32), 4, 0, 9, 1}, |
||||
{4, UPB_SIZE(8, 8), 1, 0, 4, 1}, |
||||
{5, UPB_SIZE(16, 16), 2, 0, 3, 1}, |
||||
{6, UPB_SIZE(24, 24), 3, 0, 1, 1}, |
||||
{7, UPB_SIZE(40, 48), 5, 0, 12, 1}, |
||||
{8, UPB_SIZE(48, 64), 6, 0, 9, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_UninterpretedOption_msginit = { |
||||
&google_protobuf_UninterpretedOption_submsgs[0], |
||||
&google_protobuf_UninterpretedOption__fields[0], |
||||
UPB_SIZE(64, 96), 7, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = { |
||||
{1, UPB_SIZE(4, 8), 2, 0, 9, 2}, |
||||
{2, UPB_SIZE(1, 1), 1, 0, 8, 2}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = { |
||||
NULL, |
||||
&google_protobuf_UninterpretedOption_NamePart__fields[0], |
||||
UPB_SIZE(16, 32), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_SourceCodeInfo_submsgs[1] = { |
||||
&google_protobuf_SourceCodeInfo_Location_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_SourceCodeInfo__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_SourceCodeInfo_msginit = { |
||||
&google_protobuf_SourceCodeInfo_submsgs[0], |
||||
&google_protobuf_SourceCodeInfo__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_SourceCodeInfo_Location__fields[5] = { |
||||
{1, UPB_SIZE(20, 40), 0, 0, 5, 3}, |
||||
{2, UPB_SIZE(24, 48), 0, 0, 5, 3}, |
||||
{3, UPB_SIZE(4, 8), 1, 0, 9, 1}, |
||||
{4, UPB_SIZE(12, 24), 2, 0, 9, 1}, |
||||
{6, UPB_SIZE(28, 56), 0, 0, 9, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = { |
||||
NULL, |
||||
&google_protobuf_SourceCodeInfo_Location__fields[0], |
||||
UPB_SIZE(32, 64), 5, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_GeneratedCodeInfo_submsgs[1] = { |
||||
&google_protobuf_GeneratedCodeInfo_Annotation_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = { |
||||
&google_protobuf_GeneratedCodeInfo_submsgs[0], |
||||
&google_protobuf_GeneratedCodeInfo__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = { |
||||
{1, UPB_SIZE(20, 32), 0, 0, 5, 3}, |
||||
{2, UPB_SIZE(12, 16), 3, 0, 9, 1}, |
||||
{3, UPB_SIZE(4, 4), 1, 0, 5, 1}, |
||||
{4, UPB_SIZE(8, 8), 2, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = { |
||||
NULL, |
||||
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0], |
||||
UPB_SIZE(24, 48), 4, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/duration.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/duration.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout_field google_protobuf_Duration__fields[2] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 3, 1}, |
||||
{2, UPB_SIZE(8, 8), 0, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Duration_msginit = { |
||||
NULL, |
||||
&google_protobuf_Duration__fields[0], |
||||
UPB_SIZE(16, 16), 2, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
@ -0,0 +1,59 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/duration.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ |
||||
#define GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ |
||||
|
||||
#include "upb/generated_util.h" |
||||
|
||||
#include "upb/msg.h" |
||||
|
||||
#include "upb/decode.h" |
||||
#include "upb/encode.h" |
||||
#include "upb/port_def.inc" |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct google_protobuf_Duration; |
||||
typedef struct google_protobuf_Duration google_protobuf_Duration; |
||||
extern const upb_msglayout google_protobuf_Duration_msginit; |
||||
|
||||
/* Enums */ |
||||
|
||||
/* google.protobuf.Duration */ |
||||
|
||||
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_new(upb_arena *arena) { |
||||
return (google_protobuf_Duration *)upb_msg_new(&google_protobuf_Duration_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Duration *ret = google_protobuf_Duration_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Duration_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); } |
||||
UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value) { |
||||
UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value) { |
||||
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value; |
||||
} |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} /* extern "C" */ |
||||
#endif |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
||||
#endif /* GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ */ |
@ -0,0 +1,79 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/struct.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/struct.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout *const google_protobuf_Struct_submsgs[1] = { |
||||
&google_protobuf_Struct_FieldsEntry_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_Struct__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Struct_msginit = { |
||||
&google_protobuf_Struct_submsgs[0], |
||||
&google_protobuf_Struct__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_Struct_FieldsEntry_submsgs[1] = { |
||||
&google_protobuf_Value_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_Struct_FieldsEntry__fields[2] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 9, 1}, |
||||
{2, UPB_SIZE(8, 16), 0, 0, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit = { |
||||
&google_protobuf_Struct_FieldsEntry_submsgs[0], |
||||
&google_protobuf_Struct_FieldsEntry__fields[0], |
||||
UPB_SIZE(16, 32), 2, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_Value_submsgs[2] = { |
||||
&google_protobuf_ListValue_msginit, |
||||
&google_protobuf_Struct_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_Value__fields[6] = { |
||||
{1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1}, |
||||
{2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1}, |
||||
{3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1}, |
||||
{4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1}, |
||||
{5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1}, |
||||
{6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Value_msginit = { |
||||
&google_protobuf_Value_submsgs[0], |
||||
&google_protobuf_Value__fields[0], |
||||
UPB_SIZE(16, 32), 6, false, |
||||
}; |
||||
|
||||
static const upb_msglayout *const google_protobuf_ListValue_submsgs[1] = { |
||||
&google_protobuf_Value_msginit, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_ListValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 11, 3}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_ListValue_msginit = { |
||||
&google_protobuf_ListValue_submsgs[0], |
||||
&google_protobuf_ListValue__fields[0], |
||||
UPB_SIZE(4, 8), 1, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
@ -0,0 +1,216 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/struct.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ |
||||
#define GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ |
||||
|
||||
#include "upb/generated_util.h" |
||||
|
||||
#include "upb/msg.h" |
||||
|
||||
#include "upb/decode.h" |
||||
#include "upb/encode.h" |
||||
#include "upb/port_def.inc" |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct google_protobuf_Struct; |
||||
struct google_protobuf_Struct_FieldsEntry; |
||||
struct google_protobuf_Value; |
||||
struct google_protobuf_ListValue; |
||||
typedef struct google_protobuf_Struct google_protobuf_Struct; |
||||
typedef struct google_protobuf_Struct_FieldsEntry google_protobuf_Struct_FieldsEntry; |
||||
typedef struct google_protobuf_Value google_protobuf_Value; |
||||
typedef struct google_protobuf_ListValue google_protobuf_ListValue; |
||||
extern const upb_msglayout google_protobuf_Struct_msginit; |
||||
extern const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit; |
||||
extern const upb_msglayout google_protobuf_Value_msginit; |
||||
extern const upb_msglayout google_protobuf_ListValue_msginit; |
||||
|
||||
/* Enums */ |
||||
|
||||
typedef enum { |
||||
google_protobuf_NULL_VALUE = 0 |
||||
} google_protobuf_NullValue; |
||||
|
||||
/* google.protobuf.Struct */ |
||||
|
||||
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_new(upb_arena *arena) { |
||||
return (google_protobuf_Struct *)upb_msg_new(&google_protobuf_Struct_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Struct *ret = google_protobuf_Struct_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Struct_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Struct_serialize(const google_protobuf_Struct *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Struct_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE const google_protobuf_Struct_FieldsEntry* const* google_protobuf_Struct_fields(const google_protobuf_Struct *msg, size_t *len) { return (const google_protobuf_Struct_FieldsEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); } |
||||
|
||||
UPB_INLINE google_protobuf_Struct_FieldsEntry** google_protobuf_Struct_mutable_fields(google_protobuf_Struct *msg, size_t *len) { |
||||
return (google_protobuf_Struct_FieldsEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); |
||||
} |
||||
UPB_INLINE google_protobuf_Struct_FieldsEntry** google_protobuf_Struct_resize_fields(google_protobuf_Struct *msg, size_t len, upb_arena *arena) { |
||||
return (google_protobuf_Struct_FieldsEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); |
||||
} |
||||
UPB_INLINE struct google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_add_fields(google_protobuf_Struct *msg, upb_arena *arena) { |
||||
struct google_protobuf_Struct_FieldsEntry* sub = (struct google_protobuf_Struct_FieldsEntry*)upb_msg_new(&google_protobuf_Struct_FieldsEntry_msginit, arena); |
||||
bool ok = _upb_array_append_accessor( |
||||
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); |
||||
if (!ok) return NULL; |
||||
return sub; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.Struct.FieldsEntry */ |
||||
|
||||
UPB_INLINE google_protobuf_Struct_FieldsEntry *google_protobuf_Struct_FieldsEntry_new(upb_arena *arena) { |
||||
return (google_protobuf_Struct_FieldsEntry *)upb_msg_new(&google_protobuf_Struct_FieldsEntry_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Struct_FieldsEntry *google_protobuf_Struct_FieldsEntry_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Struct_FieldsEntry *ret = google_protobuf_Struct_FieldsEntry_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Struct_FieldsEntry_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Struct_FieldsEntry_serialize(const google_protobuf_Struct_FieldsEntry *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Struct_FieldsEntry_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE upb_strview google_protobuf_Struct_FieldsEntry_key(const google_protobuf_Struct_FieldsEntry *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } |
||||
UPB_INLINE const google_protobuf_Value* google_protobuf_Struct_FieldsEntry_value(const google_protobuf_Struct_FieldsEntry *msg) { return UPB_FIELD_AT(msg, const google_protobuf_Value*, UPB_SIZE(8, 16)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_key(google_protobuf_Struct_FieldsEntry *msg, upb_strview value) { |
||||
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Struct_FieldsEntry *msg, google_protobuf_Value* value) { |
||||
UPB_FIELD_AT(msg, google_protobuf_Value*, UPB_SIZE(8, 16)) = value; |
||||
} |
||||
UPB_INLINE struct google_protobuf_Value* google_protobuf_Struct_FieldsEntry_mutable_value(google_protobuf_Struct_FieldsEntry *msg, upb_arena *arena) { |
||||
struct google_protobuf_Value* sub = (struct google_protobuf_Value*)google_protobuf_Struct_FieldsEntry_value(msg); |
||||
if (sub == NULL) { |
||||
sub = (struct google_protobuf_Value*)upb_msg_new(&google_protobuf_Value_msginit, arena); |
||||
if (!sub) return NULL; |
||||
google_protobuf_Struct_FieldsEntry_set_value(msg, sub); |
||||
} |
||||
return sub; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.Value */ |
||||
|
||||
UPB_INLINE google_protobuf_Value *google_protobuf_Value_new(upb_arena *arena) { |
||||
return (google_protobuf_Value *)upb_msg_new(&google_protobuf_Value_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Value *google_protobuf_Value_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Value *ret = google_protobuf_Value_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Value_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Value_serialize(const google_protobuf_Value *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Value_msginit, arena, len); |
||||
} |
||||
|
||||
typedef enum { |
||||
google_protobuf_Value_kind_null_value = 1, |
||||
google_protobuf_Value_kind_number_value = 2, |
||||
google_protobuf_Value_kind_string_value = 3, |
||||
google_protobuf_Value_kind_bool_value = 4, |
||||
google_protobuf_Value_kind_struct_value = 5, |
||||
google_protobuf_Value_kind_list_value = 6, |
||||
google_protobuf_Value_kind_NOT_SET = 0, |
||||
} google_protobuf_Value_kind_oneofcases; |
||||
UPB_INLINE google_protobuf_Value_kind_oneofcases google_protobuf_Value_kind_case(const google_protobuf_Value* msg) { return UPB_FIELD_AT(msg, int, UPB_SIZE(8, 16)); } |
||||
|
||||
UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 1); } |
||||
UPB_INLINE google_protobuf_NullValue google_protobuf_Value_null_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, google_protobuf_NullValue, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, google_protobuf_NULL_VALUE); } |
||||
UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 2); } |
||||
UPB_INLINE double google_protobuf_Value_number_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); } |
||||
UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 3); } |
||||
UPB_INLINE upb_strview google_protobuf_Value_string_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); } |
||||
UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 4); } |
||||
UPB_INLINE bool google_protobuf_Value_bool_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, false); } |
||||
UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 5); } |
||||
UPB_INLINE const google_protobuf_Struct* google_protobuf_Value_struct_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, const google_protobuf_Struct*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, NULL); } |
||||
UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(8, 16), 6); } |
||||
UPB_INLINE const google_protobuf_ListValue* google_protobuf_Value_list_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, const google_protobuf_ListValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); } |
||||
|
||||
UPB_INLINE void google_protobuf_Value_set_null_value(google_protobuf_Value *msg, google_protobuf_NullValue value) { |
||||
UPB_WRITE_ONEOF(msg, google_protobuf_NullValue, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1); |
||||
} |
||||
UPB_INLINE void google_protobuf_Value_set_number_value(google_protobuf_Value *msg, double value) { |
||||
UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2); |
||||
} |
||||
UPB_INLINE void google_protobuf_Value_set_string_value(google_protobuf_Value *msg, upb_strview value) { |
||||
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3); |
||||
} |
||||
UPB_INLINE void google_protobuf_Value_set_bool_value(google_protobuf_Value *msg, bool value) { |
||||
UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4); |
||||
} |
||||
UPB_INLINE void google_protobuf_Value_set_struct_value(google_protobuf_Value *msg, google_protobuf_Struct* value) { |
||||
UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5); |
||||
} |
||||
UPB_INLINE struct google_protobuf_Struct* google_protobuf_Value_mutable_struct_value(google_protobuf_Value *msg, upb_arena *arena) { |
||||
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)google_protobuf_Value_struct_value(msg); |
||||
if (sub == NULL) { |
||||
sub = (struct google_protobuf_Struct*)upb_msg_new(&google_protobuf_Struct_msginit, arena); |
||||
if (!sub) return NULL; |
||||
google_protobuf_Value_set_struct_value(msg, sub); |
||||
} |
||||
return sub; |
||||
} |
||||
UPB_INLINE void google_protobuf_Value_set_list_value(google_protobuf_Value *msg, google_protobuf_ListValue* value) { |
||||
UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6); |
||||
} |
||||
UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_value(google_protobuf_Value *msg, upb_arena *arena) { |
||||
struct google_protobuf_ListValue* sub = (struct google_protobuf_ListValue*)google_protobuf_Value_list_value(msg); |
||||
if (sub == NULL) { |
||||
sub = (struct google_protobuf_ListValue*)upb_msg_new(&google_protobuf_ListValue_msginit, arena); |
||||
if (!sub) return NULL; |
||||
google_protobuf_Value_set_list_value(msg, sub); |
||||
} |
||||
return sub; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.ListValue */ |
||||
|
||||
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_new(upb_arena *arena) { |
||||
return (google_protobuf_ListValue *)upb_msg_new(&google_protobuf_ListValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_ListValue *ret = google_protobuf_ListValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_ListValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_ListValue_serialize(const google_protobuf_ListValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_ListValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE const google_protobuf_Value* const* google_protobuf_ListValue_values(const google_protobuf_ListValue *msg, size_t *len) { return (const google_protobuf_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); } |
||||
|
||||
UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_mutable_values(google_protobuf_ListValue *msg, size_t *len) { |
||||
return (google_protobuf_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); |
||||
} |
||||
UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_resize_values(google_protobuf_ListValue *msg, size_t len, upb_arena *arena) { |
||||
return (google_protobuf_Value**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); |
||||
} |
||||
UPB_INLINE struct google_protobuf_Value* google_protobuf_ListValue_add_values(google_protobuf_ListValue *msg, upb_arena *arena) { |
||||
struct google_protobuf_Value* sub = (struct google_protobuf_Value*)upb_msg_new(&google_protobuf_Value_msginit, arena); |
||||
bool ok = _upb_array_append_accessor( |
||||
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); |
||||
if (!ok) return NULL; |
||||
return sub; |
||||
} |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} /* extern "C" */ |
||||
#endif |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
||||
#endif /* GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ */ |
@ -0,0 +1,27 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/timestamp.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/timestamp.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout_field google_protobuf_Timestamp__fields[2] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 3, 1}, |
||||
{2, UPB_SIZE(8, 8), 0, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Timestamp_msginit = { |
||||
NULL, |
||||
&google_protobuf_Timestamp__fields[0], |
||||
UPB_SIZE(16, 16), 2, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
@ -0,0 +1,59 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/timestamp.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ |
||||
#define GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ |
||||
|
||||
#include "upb/generated_util.h" |
||||
|
||||
#include "upb/msg.h" |
||||
|
||||
#include "upb/decode.h" |
||||
#include "upb/encode.h" |
||||
#include "upb/port_def.inc" |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct google_protobuf_Timestamp; |
||||
typedef struct google_protobuf_Timestamp google_protobuf_Timestamp; |
||||
extern const upb_msglayout google_protobuf_Timestamp_msginit; |
||||
|
||||
/* Enums */ |
||||
|
||||
/* google.protobuf.Timestamp */ |
||||
|
||||
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_new(upb_arena *arena) { |
||||
return (google_protobuf_Timestamp *)upb_msg_new(&google_protobuf_Timestamp_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Timestamp *ret = google_protobuf_Timestamp_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Timestamp_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Timestamp_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); } |
||||
UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Timestamp_set_seconds(google_protobuf_Timestamp *msg, int64_t value) { |
||||
UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
UPB_INLINE void google_protobuf_Timestamp_set_nanos(google_protobuf_Timestamp *msg, int32_t value) { |
||||
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value; |
||||
} |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} /* extern "C" */ |
||||
#endif |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
||||
#endif /* GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ */ |
@ -0,0 +1,106 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/wrappers.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#include <stddef.h> |
||||
#include "upb/msg.h" |
||||
#include "google/protobuf/wrappers.upb.h" |
||||
|
||||
#include "upb/port_def.inc" |
||||
|
||||
static const upb_msglayout_field google_protobuf_DoubleValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 1, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_DoubleValue_msginit = { |
||||
NULL, |
||||
&google_protobuf_DoubleValue__fields[0], |
||||
UPB_SIZE(8, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_FloatValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 2, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_FloatValue_msginit = { |
||||
NULL, |
||||
&google_protobuf_FloatValue__fields[0], |
||||
UPB_SIZE(4, 4), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_Int64Value__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 3, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Int64Value_msginit = { |
||||
NULL, |
||||
&google_protobuf_Int64Value__fields[0], |
||||
UPB_SIZE(8, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_UInt64Value__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 4, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_UInt64Value_msginit = { |
||||
NULL, |
||||
&google_protobuf_UInt64Value__fields[0], |
||||
UPB_SIZE(8, 8), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_Int32Value__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 5, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_Int32Value_msginit = { |
||||
NULL, |
||||
&google_protobuf_Int32Value__fields[0], |
||||
UPB_SIZE(4, 4), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_UInt32Value__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 13, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_UInt32Value_msginit = { |
||||
NULL, |
||||
&google_protobuf_UInt32Value__fields[0], |
||||
UPB_SIZE(4, 4), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_BoolValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 8, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_BoolValue_msginit = { |
||||
NULL, |
||||
&google_protobuf_BoolValue__fields[0], |
||||
UPB_SIZE(1, 1), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_StringValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 9, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_StringValue_msginit = { |
||||
NULL, |
||||
&google_protobuf_StringValue__fields[0], |
||||
UPB_SIZE(8, 16), 1, false, |
||||
}; |
||||
|
||||
static const upb_msglayout_field google_protobuf_BytesValue__fields[1] = { |
||||
{1, UPB_SIZE(0, 0), 0, 0, 12, 1}, |
||||
}; |
||||
|
||||
const upb_msglayout google_protobuf_BytesValue_msginit = { |
||||
NULL, |
||||
&google_protobuf_BytesValue__fields[0], |
||||
UPB_SIZE(8, 16), 1, false, |
||||
}; |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
@ -0,0 +1,239 @@ |
||||
/* This file was generated by upbc (the upb compiler) from the input
|
||||
* file: |
||||
* |
||||
* google/protobuf/wrappers.proto |
||||
* |
||||
* Do not edit -- your changes will be discarded when the file is |
||||
* regenerated. */ |
||||
|
||||
#ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ |
||||
#define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ |
||||
|
||||
#include "upb/generated_util.h" |
||||
|
||||
#include "upb/msg.h" |
||||
|
||||
#include "upb/decode.h" |
||||
#include "upb/encode.h" |
||||
#include "upb/port_def.inc" |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
struct google_protobuf_DoubleValue; |
||||
struct google_protobuf_FloatValue; |
||||
struct google_protobuf_Int64Value; |
||||
struct google_protobuf_UInt64Value; |
||||
struct google_protobuf_Int32Value; |
||||
struct google_protobuf_UInt32Value; |
||||
struct google_protobuf_BoolValue; |
||||
struct google_protobuf_StringValue; |
||||
struct google_protobuf_BytesValue; |
||||
typedef struct google_protobuf_DoubleValue google_protobuf_DoubleValue; |
||||
typedef struct google_protobuf_FloatValue google_protobuf_FloatValue; |
||||
typedef struct google_protobuf_Int64Value google_protobuf_Int64Value; |
||||
typedef struct google_protobuf_UInt64Value google_protobuf_UInt64Value; |
||||
typedef struct google_protobuf_Int32Value google_protobuf_Int32Value; |
||||
typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value; |
||||
typedef struct google_protobuf_BoolValue google_protobuf_BoolValue; |
||||
typedef struct google_protobuf_StringValue google_protobuf_StringValue; |
||||
typedef struct google_protobuf_BytesValue google_protobuf_BytesValue; |
||||
extern const upb_msglayout google_protobuf_DoubleValue_msginit; |
||||
extern const upb_msglayout google_protobuf_FloatValue_msginit; |
||||
extern const upb_msglayout google_protobuf_Int64Value_msginit; |
||||
extern const upb_msglayout google_protobuf_UInt64Value_msginit; |
||||
extern const upb_msglayout google_protobuf_Int32Value_msginit; |
||||
extern const upb_msglayout google_protobuf_UInt32Value_msginit; |
||||
extern const upb_msglayout google_protobuf_BoolValue_msginit; |
||||
extern const upb_msglayout google_protobuf_StringValue_msginit; |
||||
extern const upb_msglayout google_protobuf_BytesValue_msginit; |
||||
|
||||
/* Enums */ |
||||
|
||||
/* google.protobuf.DoubleValue */ |
||||
|
||||
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_new(upb_arena *arena) { |
||||
return (google_protobuf_DoubleValue *)upb_msg_new(&google_protobuf_DoubleValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_DoubleValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) { |
||||
UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.FloatValue */ |
||||
|
||||
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_new(upb_arena *arena) { |
||||
return (google_protobuf_FloatValue *)upb_msg_new(&google_protobuf_FloatValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_FloatValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue *msg) { return UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) { |
||||
UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.Int64Value */ |
||||
|
||||
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_new(upb_arena *arena) { |
||||
return (google_protobuf_Int64Value *)upb_msg_new(&google_protobuf_Int64Value_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Int64Value_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) { |
||||
UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.UInt64Value */ |
||||
|
||||
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_new(upb_arena *arena) { |
||||
return (google_protobuf_UInt64Value *)upb_msg_new(&google_protobuf_UInt64Value_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_UInt64Value_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value *msg) { return UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) { |
||||
UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.Int32Value */ |
||||
|
||||
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_new(upb_arena *arena) { |
||||
return (google_protobuf_Int32Value *)upb_msg_new(&google_protobuf_Int32Value_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_Int32Value_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) { |
||||
UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.UInt32Value */ |
||||
|
||||
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_new(upb_arena *arena) { |
||||
return (google_protobuf_UInt32Value *)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_UInt32Value_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg) { return UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) { |
||||
UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.BoolValue */ |
||||
|
||||
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_new(upb_arena *arena) { |
||||
return (google_protobuf_BoolValue *)upb_msg_new(&google_protobuf_BoolValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_BoolValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) { |
||||
UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.StringValue */ |
||||
|
||||
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_new(upb_arena *arena) { |
||||
return (google_protobuf_StringValue *)upb_msg_new(&google_protobuf_StringValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_StringValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_StringValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE upb_strview google_protobuf_StringValue_value(const google_protobuf_StringValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_strview value) { |
||||
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
/* google.protobuf.BytesValue */ |
||||
|
||||
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_new(upb_arena *arena) { |
||||
return (google_protobuf_BytesValue *)upb_msg_new(&google_protobuf_BytesValue_msginit, arena); |
||||
} |
||||
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parsenew(upb_strview buf, upb_arena *arena) { |
||||
google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena); |
||||
return (ret && upb_decode(buf, ret, &google_protobuf_BytesValue_msginit)) ? ret : NULL; |
||||
} |
||||
UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue *msg, upb_arena *arena, size_t *len) { |
||||
return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len); |
||||
} |
||||
|
||||
UPB_INLINE upb_strview google_protobuf_BytesValue_value(const google_protobuf_BytesValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } |
||||
|
||||
UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_strview value) { |
||||
UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; |
||||
} |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} /* extern "C" */ |
||||
#endif |
||||
|
||||
#include "upb/port_undef.inc" |
||||
|
||||
#endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ */ |
@ -0,0 +1,66 @@ |
||||
#!/usr/bin/env python2.7 |
||||
|
||||
# Copyright 2015 gRPC authors. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
# TODO: This should ideally be in upb submodule to avoid hardcoding this here. |
||||
|
||||
import re |
||||
import os |
||||
import sys |
||||
import yaml |
||||
|
||||
srcs = [ |
||||
"third_party/upb/google/protobuf/descriptor.upb.c", |
||||
"third_party/upb/upb/decode.c", |
||||
"third_party/upb/upb/def.c", |
||||
"third_party/upb/upb/encode.c", |
||||
"third_party/upb/upb/handlers.c", |
||||
"third_party/upb/upb/msg.c", |
||||
"third_party/upb/upb/msgfactory.c", |
||||
"third_party/upb/upb/sink.c", |
||||
"third_party/upb/upb/table.c", |
||||
"third_party/upb/upb/upb.c", |
||||
] |
||||
|
||||
hdrs = [ |
||||
"third_party/upb/google/protobuf/descriptor.upb.h", |
||||
"third_party/upb/upb/decode.h", |
||||
"third_party/upb/upb/def.h", |
||||
"third_party/upb/upb/encode.h", |
||||
"third_party/upb/upb/handlers.h", |
||||
"third_party/upb/upb/msg.h", |
||||
"third_party/upb/upb/msgfactory.h", |
||||
"third_party/upb/upb/sink.h", |
||||
"third_party/upb/upb/upb.h", |
||||
] |
||||
|
||||
os.chdir(os.path.dirname(sys.argv[0])+'/../..') |
||||
|
||||
out = {} |
||||
|
||||
try: |
||||
out['libs'] = [{ |
||||
'name': 'upb', |
||||
'defaults': 'upb', |
||||
'build': 'private', |
||||
'language': 'c', |
||||
'secure': 'no', |
||||
'src': srcs, |
||||
'headers': hdrs, |
||||
}] |
||||
except: |
||||
pass |
||||
|
||||
print yaml.dump(out) |
@ -1 +1 @@ |
||||
Subproject commit 9ce4a77f61c134bbed28bfd5be5cd7dc0e80f5e3 |
||||
Subproject commit ed9faae0993704b033c594b072d65e1bf19207fa |
@ -0,0 +1,38 @@ |
||||
#!/bin/bash |
||||
|
||||
# Copyright 2016 gRPC authors. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
# REQUIRES: Bazel |
||||
set -ex |
||||
rm -rf src/core/ext/upb-generated |
||||
mkdir src/core/ext/upb-generated |
||||
cd third_party |
||||
cd upb |
||||
bazel build :protoc-gen-upb |
||||
|
||||
cd ../.. |
||||
|
||||
proto_files=( \ |
||||
"google/protobuf/any.proto" \ |
||||
"google/protobuf/struct.proto" \ |
||||
"google/protobuf/wrappers.proto" \ |
||||
"google/protobuf/descriptor.proto" \ |
||||
"google/protobuf/duration.proto" \ |
||||
"google/protobuf/timestamp.proto" ) |
||||
|
||||
for i in "${proto_files[@]}" |
||||
do |
||||
protoc -I=$PWD/third_party/data-plane-api -I=$PWD/third_party/googleapis -I=$PWD/third_party/protobuf -I=$PWD/third_party/protoc-gen-validate $i --upb_out=./src/core/ext/upb-generated --plugin=protoc-gen-upb=third_party/upb/bazel-bin/protoc-gen-upb |
||||
done |
Loading…
Reference in new issue