google-protobuf 4.26.1-x64-mingw-ucrt → 4.27.0.rc.1-x64-mingw-ucrt
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/defs.c +327 -1
- data/ext/google/protobuf_c/glue.c +16 -0
- data/ext/google/protobuf_c/message.c +4 -15
- data/ext/google/protobuf_c/message.h +0 -4
- data/ext/google/protobuf_c/ruby-upb.c +1200 -279
- data/ext/google/protobuf_c/ruby-upb.h +1164 -809
- data/ext/google/protobuf_c/shared_convert.c +5 -2
- data/ext/google/protobuf_c/shared_message.c +0 -30
- data/ext/google/protobuf_c/shared_message.h +0 -4
- data/lib/google/3.1/protobuf_c.so +0 -0
- data/lib/google/3.2/protobuf_c.so +0 -0
- data/lib/google/3.3/protobuf_c.so +0 -0
- data/lib/google/protobuf/descriptor_pb.rb +2 -1
- data/lib/google/protobuf/ffi/descriptor.rb +3 -1
- data/lib/google/protobuf/ffi/descriptor_pool.rb +3 -1
- data/lib/google/protobuf/ffi/enum_descriptor.rb +3 -1
- data/lib/google/protobuf/ffi/ffi.rb +0 -5
- data/lib/google/protobuf/ffi/field_descriptor.rb +4 -2
- data/lib/google/protobuf/ffi/file_descriptor.rb +3 -1
- data/lib/google/protobuf/ffi/internal/convert.rb +1 -1
- data/lib/google/protobuf/ffi/method_descriptor.rb +114 -0
- data/lib/google/protobuf/ffi/oneof_descriptor.rb +3 -1
- data/lib/google/protobuf/ffi/service_descriptor.rb +107 -0
- data/lib/google/protobuf/repeated_field.rb +3 -3
- data/lib/google/protobuf_ffi.rb +2 -0
- metadata +21 -5
@@ -1,5 +1,5 @@
|
|
1
1
|
// Ruby is still using proto3 enum semantics for proto2
|
2
|
-
#define
|
2
|
+
#define UPB_DISABLE_CLOSED_ENUM_CHECKING
|
3
3
|
/* Amalgamated source file */
|
4
4
|
|
5
5
|
/*
|
@@ -114,17 +114,17 @@ Error, UINTPTR_MAX is undefined
|
|
114
114
|
|
115
115
|
// Macros for function attributes on compilers that support them.
|
116
116
|
#ifdef __GNUC__
|
117
|
-
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
|
117
|
+
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline)) static
|
118
118
|
#define UPB_NOINLINE __attribute__((noinline))
|
119
119
|
#define UPB_NORETURN __attribute__((__noreturn__))
|
120
120
|
#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
|
121
121
|
#elif defined(_MSC_VER)
|
122
122
|
#define UPB_NOINLINE
|
123
|
-
#define UPB_FORCEINLINE
|
123
|
+
#define UPB_FORCEINLINE static
|
124
124
|
#define UPB_NORETURN __declspec(noreturn)
|
125
125
|
#define UPB_PRINTF(str, first_vararg)
|
126
126
|
#else /* !defined(__GNUC__) */
|
127
|
-
#define UPB_FORCEINLINE
|
127
|
+
#define UPB_FORCEINLINE static
|
128
128
|
#define UPB_NOINLINE
|
129
129
|
#define UPB_NORETURN
|
130
130
|
#define UPB_PRINTF(str, first_vararg)
|
@@ -306,10 +306,10 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
|
|
306
306
|
|
307
307
|
/* Disable proto2 arena behavior (TEMPORARY) **********************************/
|
308
308
|
|
309
|
-
#ifdef
|
310
|
-
#define
|
309
|
+
#ifdef UPB_DISABLE_CLOSED_ENUM_CHECKING
|
310
|
+
#define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 1
|
311
311
|
#else
|
312
|
-
#define
|
312
|
+
#define UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN 0
|
313
313
|
#endif
|
314
314
|
|
315
315
|
#if defined(__cplusplus)
|
@@ -342,6 +342,12 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
|
|
342
342
|
#define UPB_DESC_MINITABLE(sym) &google__protobuf__##sym##_msg_init
|
343
343
|
#endif
|
344
344
|
|
345
|
+
#ifdef UPB_TRACING_ENABLED
|
346
|
+
#ifdef NDEBUG
|
347
|
+
error UPB_TRACING_ENABLED Tracing should be disabled in production builds
|
348
|
+
#endif
|
349
|
+
#endif
|
350
|
+
|
345
351
|
#ifndef UPB_BASE_STATUS_H_
|
346
352
|
#define UPB_BASE_STATUS_H_
|
347
353
|
|
@@ -556,7 +562,7 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
|
|
556
562
|
}
|
557
563
|
|
558
564
|
// LINT.ThenChange(
|
559
|
-
//
|
565
|
+
// GoogleInternalName1,
|
560
566
|
// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string,
|
561
567
|
// //depot/google3/third_party/upb/bits/typescript/string_view.ts
|
562
568
|
// )
|
@@ -691,12 +697,16 @@ void UPB_PRIVATE(_upb_Arena_SwapIn)(struct upb_Arena* des,
|
|
691
697
|
void UPB_PRIVATE(_upb_Arena_SwapOut)(struct upb_Arena* des,
|
692
698
|
const struct upb_Arena* src);
|
693
699
|
|
700
|
+
// Returns whether |ptr| was allocated directly by |a| (so care must be used
|
701
|
+
// with fused arenas).
|
702
|
+
UPB_API bool UPB_ONLYBITS(_upb_Arena_Contains)(const struct upb_Arena* a,
|
703
|
+
void* ptr);
|
704
|
+
|
694
705
|
UPB_INLINE size_t UPB_PRIVATE(_upb_ArenaHas)(const struct upb_Arena* a) {
|
695
706
|
return (size_t)(a->UPB_ONLYBITS(end) - a->UPB_ONLYBITS(ptr));
|
696
707
|
}
|
697
708
|
|
698
|
-
|
699
|
-
size_t size) {
|
709
|
+
UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size) {
|
700
710
|
void* UPB_PRIVATE(_upb_Arena_SlowMalloc)(struct upb_Arena * a, size_t size);
|
701
711
|
|
702
712
|
size = UPB_ALIGN_MALLOC(size);
|
@@ -716,8 +726,8 @@ UPB_INLINE void* UPB_PRIVATE(_upb_Arena_Malloc)(struct upb_Arena* a,
|
|
716
726
|
return ret;
|
717
727
|
}
|
718
728
|
|
719
|
-
|
720
|
-
|
729
|
+
UPB_API_INLINE void* upb_Arena_Realloc(struct upb_Arena* a, void* ptr,
|
730
|
+
size_t oldsize, size_t size) {
|
721
731
|
oldsize = UPB_ALIGN_MALLOC(oldsize);
|
722
732
|
size = UPB_ALIGN_MALLOC(size);
|
723
733
|
bool is_most_recent_alloc =
|
@@ -733,7 +743,7 @@ UPB_INLINE void* UPB_PRIVATE(_upb_Arena_Realloc)(struct upb_Arena* a, void* ptr,
|
|
733
743
|
return ptr;
|
734
744
|
}
|
735
745
|
|
736
|
-
void* ret =
|
746
|
+
void* ret = upb_Arena_Malloc(a, size);
|
737
747
|
|
738
748
|
if (ret && oldsize > 0) {
|
739
749
|
memcpy(ret, ptr, UPB_MIN(oldsize, size));
|
@@ -742,9 +752,8 @@ UPB_INLINE void* UPB_PRIVATE(_upb_Arena_Realloc)(struct upb_Arena* a, void* ptr,
|
|
742
752
|
return ret;
|
743
753
|
}
|
744
754
|
|
745
|
-
|
746
|
-
|
747
|
-
size_t size) {
|
755
|
+
UPB_API_INLINE void upb_Arena_ShrinkLast(struct upb_Arena* a, void* ptr,
|
756
|
+
size_t oldsize, size_t size) {
|
748
757
|
oldsize = UPB_ALIGN_MALLOC(oldsize);
|
749
758
|
size = UPB_ALIGN_MALLOC(size);
|
750
759
|
// Must be the last alloc.
|
@@ -787,23 +796,25 @@ UPB_API_INLINE upb_Arena* upb_Arena_New(void) {
|
|
787
796
|
return upb_Arena_Init(NULL, 0, &upb_alloc_global);
|
788
797
|
}
|
789
798
|
|
790
|
-
UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size)
|
791
|
-
return UPB_PRIVATE(_upb_Arena_Malloc)(a, size);
|
792
|
-
}
|
799
|
+
UPB_API_INLINE void* upb_Arena_Malloc(struct upb_Arena* a, size_t size);
|
793
800
|
|
794
801
|
UPB_API_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
|
795
|
-
size_t size)
|
796
|
-
return UPB_PRIVATE(_upb_Arena_Realloc)(a, ptr, oldsize, size);
|
797
|
-
}
|
802
|
+
size_t size);
|
798
803
|
|
799
804
|
// Shrinks the last alloc from arena.
|
800
805
|
// REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
|
801
806
|
// We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
|
802
807
|
// this was not the last alloc.
|
803
808
|
UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr,
|
804
|
-
size_t oldsize, size_t size)
|
805
|
-
|
806
|
-
|
809
|
+
size_t oldsize, size_t size);
|
810
|
+
|
811
|
+
#ifdef UPB_TRACING_ENABLED
|
812
|
+
void upb_Arena_SetTraceHandler(void (*initArenaTraceHandler)(const upb_Arena*,
|
813
|
+
size_t size),
|
814
|
+
void (*fuseArenaTraceHandler)(const upb_Arena*,
|
815
|
+
const upb_Arena*),
|
816
|
+
void (*freeArenaTraceHandler)(const upb_Arena*));
|
817
|
+
#endif
|
807
818
|
|
808
819
|
#ifdef __cplusplus
|
809
820
|
} /* extern "C" */
|
@@ -835,7 +846,8 @@ UPB_API_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr,
|
|
835
846
|
extern "C" {
|
836
847
|
#endif
|
837
848
|
|
838
|
-
// LINT.IfChange(
|
849
|
+
// LINT.IfChange(upb_Array)
|
850
|
+
|
839
851
|
// Our internal representation for repeated fields.
|
840
852
|
struct upb_Array {
|
841
853
|
// This is a tagged pointer. Bits #0 and #1 encode the elem size as follows:
|
@@ -844,13 +856,21 @@ struct upb_Array {
|
|
844
856
|
// 2 maps to elem size 8
|
845
857
|
// 3 maps to elem size 16
|
846
858
|
//
|
847
|
-
// Bit #2 contains the frozen/immutable flag
|
859
|
+
// Bit #2 contains the frozen/immutable flag.
|
848
860
|
uintptr_t UPB_ONLYBITS(data);
|
849
861
|
|
850
862
|
size_t UPB_ONLYBITS(size); // The number of elements in the array.
|
851
863
|
size_t UPB_PRIVATE(capacity); // Allocated storage. Measured in elements.
|
852
864
|
};
|
853
865
|
|
866
|
+
UPB_INLINE void UPB_PRIVATE(_upb_Array_ShallowFreeze)(struct upb_Array* arr) {
|
867
|
+
arr->UPB_ONLYBITS(data) |= _UPB_ARRAY_MASK_IMM;
|
868
|
+
}
|
869
|
+
|
870
|
+
UPB_API_INLINE bool upb_Array_IsFrozen(const struct upb_Array* arr) {
|
871
|
+
return (arr->UPB_ONLYBITS(data) & _UPB_ARRAY_MASK_IMM) != 0;
|
872
|
+
}
|
873
|
+
|
854
874
|
UPB_INLINE void UPB_PRIVATE(_upb_Array_SetTaggedPtr)(struct upb_Array* array,
|
855
875
|
void* data, size_t lg2) {
|
856
876
|
UPB_ASSERT(lg2 != 1);
|
@@ -866,15 +886,13 @@ UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const struct upb_Array* array) {
|
|
866
886
|
return lg2;
|
867
887
|
}
|
868
888
|
|
869
|
-
|
870
|
-
const struct upb_Array* array) {
|
889
|
+
UPB_API_INLINE const void* upb_Array_DataPtr(const struct upb_Array* array) {
|
871
890
|
UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array); // Check assertions.
|
872
891
|
return (void*)(array->UPB_ONLYBITS(data) & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
|
873
892
|
}
|
874
893
|
|
875
|
-
|
876
|
-
|
877
|
-
return (void*)UPB_PRIVATE(_upb_Array_DataPtr)(array);
|
894
|
+
UPB_API_INLINE void* upb_Array_MutableDataPtr(struct upb_Array* array) {
|
895
|
+
return (void*)upb_Array_DataPtr(array);
|
878
896
|
}
|
879
897
|
|
880
898
|
UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
|
@@ -898,8 +916,9 @@ UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
|
|
898
916
|
bool UPB_PRIVATE(_upb_Array_Realloc)(struct upb_Array* array, size_t min_size,
|
899
917
|
upb_Arena* arena);
|
900
918
|
|
901
|
-
|
902
|
-
|
919
|
+
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
|
920
|
+
upb_Arena* arena) {
|
921
|
+
UPB_ASSERT(!upb_Array_IsFrozen(array));
|
903
922
|
if (array->UPB_PRIVATE(capacity) < size)
|
904
923
|
return UPB_PRIVATE(_upb_Array_Realloc)(array, size, arena);
|
905
924
|
return true;
|
@@ -908,9 +927,10 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(struct upb_Array* array,
|
|
908
927
|
// Resize without initializing new elements.
|
909
928
|
UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
|
910
929
|
struct upb_Array* array, size_t size, upb_Arena* arena) {
|
930
|
+
UPB_ASSERT(!upb_Array_IsFrozen(array));
|
911
931
|
UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
|
912
932
|
arena); // Allow NULL arena when shrinking.
|
913
|
-
if (!
|
933
|
+
if (!upb_Array_Reserve(array, size, arena)) return false;
|
914
934
|
array->UPB_ONLYBITS(size) = size;
|
915
935
|
return true;
|
916
936
|
}
|
@@ -921,19 +941,18 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
|
|
921
941
|
UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(struct upb_Array* array, size_t i,
|
922
942
|
const void* data,
|
923
943
|
size_t elem_size) {
|
944
|
+
UPB_ASSERT(!upb_Array_IsFrozen(array));
|
924
945
|
UPB_ASSERT(i < array->UPB_ONLYBITS(size));
|
925
946
|
UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array));
|
926
|
-
char* arr_data = (char*)
|
947
|
+
char* arr_data = (char*)upb_Array_MutableDataPtr(array);
|
927
948
|
memcpy(arr_data + (i * elem_size), data, elem_size);
|
928
949
|
}
|
929
950
|
|
930
|
-
|
951
|
+
UPB_API_INLINE size_t upb_Array_Size(const struct upb_Array* arr) {
|
931
952
|
return arr->UPB_ONLYBITS(size);
|
932
953
|
}
|
933
954
|
|
934
|
-
// LINT.ThenChange(
|
935
|
-
// GoogleInternalName1,
|
936
|
-
//)
|
955
|
+
// LINT.ThenChange(GoogleInternalName0)
|
937
956
|
|
938
957
|
#ifdef __cplusplus
|
939
958
|
} /* extern "C" */
|
@@ -983,218 +1002,6 @@ typedef union {
|
|
983
1002
|
|
984
1003
|
#endif /* UPB_MESSAGE_VALUE_H_ */
|
985
1004
|
|
986
|
-
// Must be last.
|
987
|
-
|
988
|
-
typedef struct upb_Array upb_Array;
|
989
|
-
|
990
|
-
#ifdef __cplusplus
|
991
|
-
extern "C" {
|
992
|
-
#endif
|
993
|
-
|
994
|
-
// Creates a new array on the given arena that holds elements of this type.
|
995
|
-
UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
|
996
|
-
|
997
|
-
// Returns the number of elements in the array.
|
998
|
-
UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr) {
|
999
|
-
return UPB_PRIVATE(_upb_Array_Size)(arr);
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
// Returns the given element, which must be within the array's current size.
|
1003
|
-
UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
|
1004
|
-
|
1005
|
-
// Returns a mutating pointer to the given element, which must be within the
|
1006
|
-
// array's current size.
|
1007
|
-
UPB_API upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i);
|
1008
|
-
|
1009
|
-
// Sets the given element, which must be within the array's current size.
|
1010
|
-
UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
|
1011
|
-
|
1012
|
-
// Appends an element to the array. Returns false on allocation failure.
|
1013
|
-
UPB_API bool upb_Array_Append(upb_Array* array, upb_MessageValue val,
|
1014
|
-
upb_Arena* arena);
|
1015
|
-
|
1016
|
-
// Moves elements within the array using memmove().
|
1017
|
-
// Like memmove(), the source and destination elements may be overlapping.
|
1018
|
-
UPB_API void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
|
1019
|
-
size_t count);
|
1020
|
-
|
1021
|
-
// Inserts one or more empty elements into the array.
|
1022
|
-
// Existing elements are shifted right.
|
1023
|
-
// The new elements have undefined state and must be set with `upb_Array_Set()`.
|
1024
|
-
// REQUIRES: `i <= upb_Array_Size(arr)`
|
1025
|
-
UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
|
1026
|
-
upb_Arena* arena);
|
1027
|
-
|
1028
|
-
// Deletes one or more elements from the array.
|
1029
|
-
// Existing elements are shifted left.
|
1030
|
-
// REQUIRES: `i + count <= upb_Array_Size(arr)`
|
1031
|
-
UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
|
1032
|
-
|
1033
|
-
// Changes the size of a vector. New elements are initialized to NULL/0.
|
1034
|
-
// Returns false on allocation failure.
|
1035
|
-
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
|
1036
|
-
|
1037
|
-
// Returns pointer to array data.
|
1038
|
-
UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr) {
|
1039
|
-
return UPB_PRIVATE(_upb_Array_DataPtr)(arr);
|
1040
|
-
}
|
1041
|
-
|
1042
|
-
// Returns mutable pointer to array data.
|
1043
|
-
UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr) {
|
1044
|
-
return UPB_PRIVATE(_upb_Array_MutableDataPtr)(arr);
|
1045
|
-
}
|
1046
|
-
|
1047
|
-
#ifdef __cplusplus
|
1048
|
-
} /* extern "C" */
|
1049
|
-
#endif
|
1050
|
-
|
1051
|
-
|
1052
|
-
#endif /* UPB_MESSAGE_ARRAY_H_ */
|
1053
|
-
|
1054
|
-
#ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
|
1055
|
-
#define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
|
1056
|
-
|
1057
|
-
#include <stddef.h>
|
1058
|
-
#include <stdint.h>
|
1059
|
-
#include <string.h>
|
1060
|
-
|
1061
|
-
|
1062
|
-
#ifndef UPB_BASE_INTERNAL_ENDIAN_H_
|
1063
|
-
#define UPB_BASE_INTERNAL_ENDIAN_H_
|
1064
|
-
|
1065
|
-
#include <stdint.h>
|
1066
|
-
|
1067
|
-
// Must be last.
|
1068
|
-
|
1069
|
-
#ifdef __cplusplus
|
1070
|
-
extern "C" {
|
1071
|
-
#endif
|
1072
|
-
|
1073
|
-
UPB_INLINE bool upb_IsLittleEndian(void) {
|
1074
|
-
const int x = 1;
|
1075
|
-
return *(char*)&x == 1;
|
1076
|
-
}
|
1077
|
-
|
1078
|
-
UPB_INLINE uint32_t upb_BigEndian32(uint32_t val) {
|
1079
|
-
if (upb_IsLittleEndian()) return val;
|
1080
|
-
|
1081
|
-
return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
|
1082
|
-
((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
UPB_INLINE uint64_t upb_BigEndian64(uint64_t val) {
|
1086
|
-
if (upb_IsLittleEndian()) return val;
|
1087
|
-
|
1088
|
-
const uint64_t hi = ((uint64_t)upb_BigEndian32((uint32_t)val)) << 32;
|
1089
|
-
const uint64_t lo = upb_BigEndian32((uint32_t)(val >> 32));
|
1090
|
-
return hi | lo;
|
1091
|
-
}
|
1092
|
-
|
1093
|
-
#ifdef __cplusplus
|
1094
|
-
} /* extern "C" */
|
1095
|
-
#endif
|
1096
|
-
|
1097
|
-
|
1098
|
-
#endif /* UPB_BASE_INTERNAL_ENDIAN_H_ */
|
1099
|
-
|
1100
|
-
#ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
|
1101
|
-
#define UPB_MESSAGE_INTERNAL_EXTENSION_H_
|
1102
|
-
|
1103
|
-
|
1104
|
-
/*
|
1105
|
-
** Our memory representation for parsing tables and messages themselves.
|
1106
|
-
** Functions in this file are used by generated code and possibly reflection.
|
1107
|
-
**
|
1108
|
-
** The definitions in this file are internal to upb.
|
1109
|
-
**/
|
1110
|
-
|
1111
|
-
#ifndef UPB_MESSAGE_INTERNAL_MESSAGE_H_
|
1112
|
-
#define UPB_MESSAGE_INTERNAL_MESSAGE_H_
|
1113
|
-
|
1114
|
-
#include <stdlib.h>
|
1115
|
-
#include <string.h>
|
1116
|
-
|
1117
|
-
|
1118
|
-
#ifndef UPB_MINI_TABLE_MESSAGE_H_
|
1119
|
-
#define UPB_MINI_TABLE_MESSAGE_H_
|
1120
|
-
|
1121
|
-
|
1122
|
-
#ifndef UPB_MINI_TABLE_ENUM_H_
|
1123
|
-
#define UPB_MINI_TABLE_ENUM_H_
|
1124
|
-
|
1125
|
-
#include <stdint.h>
|
1126
|
-
|
1127
|
-
|
1128
|
-
#ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
|
1129
|
-
#define UPB_MINI_TABLE_INTERNAL_ENUM_H_
|
1130
|
-
|
1131
|
-
#include <stdint.h>
|
1132
|
-
|
1133
|
-
// Must be last.
|
1134
|
-
|
1135
|
-
struct upb_MiniTableEnum {
|
1136
|
-
uint32_t UPB_PRIVATE(mask_limit); // Highest that can be tested with mask.
|
1137
|
-
uint32_t UPB_PRIVATE(value_count); // Number of values after the bitfield.
|
1138
|
-
uint32_t UPB_PRIVATE(data)[]; // Bitmask + enumerated values follow.
|
1139
|
-
};
|
1140
|
-
|
1141
|
-
#ifdef __cplusplus
|
1142
|
-
extern "C" {
|
1143
|
-
#endif
|
1144
|
-
|
1145
|
-
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableEnum_CheckValue)(
|
1146
|
-
const struct upb_MiniTableEnum* e, uint32_t val) {
|
1147
|
-
if (UPB_LIKELY(val < 64)) {
|
1148
|
-
const uint64_t mask =
|
1149
|
-
e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
|
1150
|
-
const uint64_t bit = 1ULL << val;
|
1151
|
-
return (mask & bit) != 0;
|
1152
|
-
}
|
1153
|
-
if (UPB_LIKELY(val < e->UPB_PRIVATE(mask_limit))) {
|
1154
|
-
const uint32_t mask = e->UPB_PRIVATE(data)[val / 32];
|
1155
|
-
const uint32_t bit = 1ULL << (val % 32);
|
1156
|
-
return (mask & bit) != 0;
|
1157
|
-
}
|
1158
|
-
|
1159
|
-
// OPT: binary search long lists?
|
1160
|
-
const uint32_t* start =
|
1161
|
-
&e->UPB_PRIVATE(data)[e->UPB_PRIVATE(mask_limit) / 32];
|
1162
|
-
const uint32_t* limit = &e->UPB_PRIVATE(
|
1163
|
-
data)[e->UPB_PRIVATE(mask_limit) / 32 + e->UPB_PRIVATE(value_count)];
|
1164
|
-
for (const uint32_t* p = start; p < limit; p++) {
|
1165
|
-
if (*p == val) return true;
|
1166
|
-
}
|
1167
|
-
return false;
|
1168
|
-
}
|
1169
|
-
|
1170
|
-
#ifdef __cplusplus
|
1171
|
-
} /* extern "C" */
|
1172
|
-
#endif
|
1173
|
-
|
1174
|
-
|
1175
|
-
#endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
|
1176
|
-
|
1177
|
-
// Must be last
|
1178
|
-
|
1179
|
-
typedef struct upb_MiniTableEnum upb_MiniTableEnum;
|
1180
|
-
|
1181
|
-
#ifdef __cplusplus
|
1182
|
-
extern "C" {
|
1183
|
-
#endif
|
1184
|
-
|
1185
|
-
// Validates enum value against range defined by enum mini table.
|
1186
|
-
UPB_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e,
|
1187
|
-
uint32_t val) {
|
1188
|
-
return UPB_PRIVATE(_upb_MiniTableEnum_CheckValue)(e, val);
|
1189
|
-
}
|
1190
|
-
|
1191
|
-
#ifdef __cplusplus
|
1192
|
-
} /* extern "C" */
|
1193
|
-
#endif
|
1194
|
-
|
1195
|
-
|
1196
|
-
#endif /* UPB_MINI_TABLE_ENUM_H_ */
|
1197
|
-
|
1198
1005
|
#ifndef UPB_MINI_TABLE_FIELD_H_
|
1199
1006
|
#define UPB_MINI_TABLE_FIELD_H_
|
1200
1007
|
|
@@ -1293,7 +1100,7 @@ struct upb_MiniTableField {
|
|
1293
1100
|
uint8_t UPB_ONLYBITS(mode);
|
1294
1101
|
};
|
1295
1102
|
|
1296
|
-
#define kUpb_NoSub ((uint16_t)-1)
|
1103
|
+
#define kUpb_NoSub ((uint16_t) - 1)
|
1297
1104
|
|
1298
1105
|
typedef enum {
|
1299
1106
|
kUpb_FieldMode_Map = 0,
|
@@ -1344,17 +1151,17 @@ UPB_PRIVATE(_upb_MiniTableField_GetRep)(const struct upb_MiniTableField* f) {
|
|
1344
1151
|
return (upb_FieldRep)(f->UPB_ONLYBITS(mode) >> kUpb_FieldRep_Shift);
|
1345
1152
|
}
|
1346
1153
|
|
1347
|
-
|
1154
|
+
UPB_API_INLINE bool upb_MiniTableField_IsArray(
|
1348
1155
|
const struct upb_MiniTableField* f) {
|
1349
1156
|
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Array;
|
1350
1157
|
}
|
1351
1158
|
|
1352
|
-
|
1159
|
+
UPB_API_INLINE bool upb_MiniTableField_IsMap(
|
1353
1160
|
const struct upb_MiniTableField* f) {
|
1354
1161
|
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Map;
|
1355
1162
|
}
|
1356
1163
|
|
1357
|
-
|
1164
|
+
UPB_API_INLINE bool upb_MiniTableField_IsScalar(
|
1358
1165
|
const struct upb_MiniTableField* f) {
|
1359
1166
|
return UPB_PRIVATE(_upb_MiniTableField_Mode)(f) == kUpb_FieldMode_Scalar;
|
1360
1167
|
}
|
@@ -1364,18 +1171,18 @@ UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(
|
|
1364
1171
|
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsAlternate) != 0;
|
1365
1172
|
}
|
1366
1173
|
|
1367
|
-
|
1174
|
+
UPB_API_INLINE bool upb_MiniTableField_IsExtension(
|
1368
1175
|
const struct upb_MiniTableField* f) {
|
1369
1176
|
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsExtension) != 0;
|
1370
1177
|
}
|
1371
1178
|
|
1372
|
-
|
1179
|
+
UPB_API_INLINE bool upb_MiniTableField_IsPacked(
|
1373
1180
|
const struct upb_MiniTableField* f) {
|
1374
1181
|
return (f->UPB_ONLYBITS(mode) & kUpb_LabelFlags_IsPacked) != 0;
|
1375
1182
|
}
|
1376
1183
|
|
1377
|
-
|
1378
|
-
|
1184
|
+
UPB_API_INLINE upb_FieldType
|
1185
|
+
upb_MiniTableField_Type(const struct upb_MiniTableField* f) {
|
1379
1186
|
const upb_FieldType type = (upb_FieldType)f->UPB_PRIVATE(descriptortype);
|
1380
1187
|
if (UPB_PRIVATE(_upb_MiniTableField_IsAlternate)(f)) {
|
1381
1188
|
if (type == kUpb_FieldType_Int32) return kUpb_FieldType_Enum;
|
@@ -1385,9 +1192,9 @@ UPB_PRIVATE(_upb_MiniTableField_Type)(const struct upb_MiniTableField* f) {
|
|
1385
1192
|
return type;
|
1386
1193
|
}
|
1387
1194
|
|
1388
|
-
|
1389
|
-
|
1390
|
-
return upb_FieldType_CType(
|
1195
|
+
UPB_API_INLINE
|
1196
|
+
upb_CType upb_MiniTableField_CType(const struct upb_MiniTableField* f) {
|
1197
|
+
return upb_FieldType_CType(upb_MiniTableField_Type(f));
|
1391
1198
|
}
|
1392
1199
|
|
1393
1200
|
UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(
|
@@ -1409,33 +1216,33 @@ UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
|
|
1409
1216
|
return index / 8;
|
1410
1217
|
}
|
1411
1218
|
|
1412
|
-
|
1219
|
+
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
|
1413
1220
|
const struct upb_MiniTableField* f) {
|
1414
1221
|
return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
|
1415
1222
|
}
|
1416
1223
|
|
1417
|
-
|
1224
|
+
UPB_API_INLINE bool upb_MiniTableField_IsInOneof(
|
1418
1225
|
const struct upb_MiniTableField* f) {
|
1419
1226
|
return f->presence < 0;
|
1420
1227
|
}
|
1421
1228
|
|
1422
|
-
|
1229
|
+
UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
|
1423
1230
|
const struct upb_MiniTableField* f) {
|
1424
1231
|
return f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
|
1425
1232
|
f->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
|
1426
1233
|
}
|
1427
1234
|
|
1428
|
-
|
1235
|
+
UPB_API_INLINE bool upb_MiniTableField_HasPresence(
|
1429
1236
|
const struct upb_MiniTableField* f) {
|
1430
|
-
if (
|
1431
|
-
return
|
1237
|
+
if (upb_MiniTableField_IsExtension(f)) {
|
1238
|
+
return upb_MiniTableField_IsScalar(f);
|
1432
1239
|
} else {
|
1433
1240
|
return f->presence != 0;
|
1434
1241
|
}
|
1435
1242
|
}
|
1436
1243
|
|
1437
|
-
|
1438
|
-
|
1244
|
+
UPB_API_INLINE uint32_t
|
1245
|
+
upb_MiniTableField_Number(const struct upb_MiniTableField* f) {
|
1439
1246
|
return f->UPB_ONLYBITS(number);
|
1440
1247
|
}
|
1441
1248
|
|
@@ -1446,7 +1253,7 @@ UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
|
|
1446
1253
|
|
1447
1254
|
UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
|
1448
1255
|
const struct upb_MiniTableField* f) {
|
1449
|
-
UPB_ASSERT(
|
1256
|
+
UPB_ASSERT(upb_MiniTableField_IsInOneof(f));
|
1450
1257
|
return ~(ptrdiff_t)f->presence;
|
1451
1258
|
}
|
1452
1259
|
|
@@ -1454,7 +1261,7 @@ UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(
|
|
1454
1261
|
const struct upb_MiniTableField* f) {
|
1455
1262
|
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
|
1456
1263
|
kUpb_FieldRep_NativePointer);
|
1457
|
-
UPB_ASSUME(
|
1264
|
+
UPB_ASSUME(upb_MiniTableField_IsArray(f));
|
1458
1265
|
UPB_ASSUME(f->presence == 0);
|
1459
1266
|
}
|
1460
1267
|
|
@@ -1462,13 +1269,13 @@ UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(
|
|
1462
1269
|
const struct upb_MiniTableField* f) {
|
1463
1270
|
UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableField_GetRep)(f) ==
|
1464
1271
|
kUpb_FieldRep_NativePointer);
|
1465
|
-
UPB_ASSUME(
|
1272
|
+
UPB_ASSUME(upb_MiniTableField_IsMap(f));
|
1466
1273
|
UPB_ASSUME(f->presence == 0);
|
1467
1274
|
}
|
1468
1275
|
|
1469
1276
|
UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_ElemSizeLg2)(
|
1470
1277
|
const struct upb_MiniTableField* f) {
|
1471
|
-
const upb_FieldType field_type =
|
1278
|
+
const upb_FieldType field_type = upb_MiniTableField_Type(f);
|
1472
1279
|
return UPB_PRIVATE(_upb_FieldType_SizeLg2)(field_type);
|
1473
1280
|
}
|
1474
1281
|
|
@@ -1489,58 +1296,32 @@ typedef struct upb_MiniTableField upb_MiniTableField;
|
|
1489
1296
|
extern "C" {
|
1490
1297
|
#endif
|
1491
1298
|
|
1492
|
-
UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f)
|
1493
|
-
return UPB_PRIVATE(_upb_MiniTableField_CType)(f);
|
1494
|
-
}
|
1299
|
+
UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f);
|
1495
1300
|
|
1496
|
-
UPB_API_INLINE bool upb_MiniTableField_HasPresence(
|
1497
|
-
const upb_MiniTableField* f) {
|
1498
|
-
return UPB_PRIVATE(_upb_MiniTableField_HasPresence)(f);
|
1499
|
-
}
|
1301
|
+
UPB_API_INLINE bool upb_MiniTableField_HasPresence(const upb_MiniTableField* f);
|
1500
1302
|
|
1501
|
-
UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f)
|
1502
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsArray)(f);
|
1503
|
-
}
|
1303
|
+
UPB_API_INLINE bool upb_MiniTableField_IsArray(const upb_MiniTableField* f);
|
1504
1304
|
|
1505
1305
|
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
|
1506
|
-
const upb_MiniTableField* f)
|
1507
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsClosedEnum)(f);
|
1508
|
-
}
|
1306
|
+
const upb_MiniTableField* f);
|
1509
1307
|
|
1510
|
-
UPB_API_INLINE bool upb_MiniTableField_IsExtension(
|
1511
|
-
const upb_MiniTableField* f) {
|
1512
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsExtension)(f);
|
1513
|
-
}
|
1308
|
+
UPB_API_INLINE bool upb_MiniTableField_IsExtension(const upb_MiniTableField* f);
|
1514
1309
|
|
1515
|
-
UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f)
|
1516
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(f);
|
1517
|
-
}
|
1310
|
+
UPB_API_INLINE bool upb_MiniTableField_IsInOneof(const upb_MiniTableField* f);
|
1518
1311
|
|
1519
|
-
UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f)
|
1520
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsMap)(f);
|
1521
|
-
}
|
1312
|
+
UPB_API_INLINE bool upb_MiniTableField_IsMap(const upb_MiniTableField* f);
|
1522
1313
|
|
1523
|
-
UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f)
|
1524
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsPacked)(f);
|
1525
|
-
}
|
1314
|
+
UPB_API_INLINE bool upb_MiniTableField_IsPacked(const upb_MiniTableField* f);
|
1526
1315
|
|
1527
|
-
UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f)
|
1528
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsScalar)(f);
|
1529
|
-
}
|
1316
|
+
UPB_API_INLINE bool upb_MiniTableField_IsScalar(const upb_MiniTableField* f);
|
1530
1317
|
|
1531
1318
|
UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
|
1532
|
-
const upb_MiniTableField* f)
|
1533
|
-
return UPB_PRIVATE(_upb_MiniTableField_IsSubMessage)(f);
|
1534
|
-
}
|
1319
|
+
const upb_MiniTableField* f);
|
1535
1320
|
|
1536
|
-
UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f)
|
1537
|
-
return UPB_PRIVATE(_upb_MiniTableField_Number)(f);
|
1538
|
-
}
|
1321
|
+
UPB_API_INLINE uint32_t upb_MiniTableField_Number(const upb_MiniTableField* f);
|
1539
1322
|
|
1540
1323
|
UPB_API_INLINE upb_FieldType
|
1541
|
-
upb_MiniTableField_Type(const upb_MiniTableField* f)
|
1542
|
-
return UPB_PRIVATE(_upb_MiniTableField_Type)(f);
|
1543
|
-
}
|
1324
|
+
upb_MiniTableField_Type(const upb_MiniTableField* f);
|
1544
1325
|
|
1545
1326
|
#ifdef __cplusplus
|
1546
1327
|
} /* extern "C" */
|
@@ -1549,14 +1330,92 @@ upb_MiniTableField_Type(const upb_MiniTableField* f) {
|
|
1549
1330
|
|
1550
1331
|
#endif /* UPB_MINI_TABLE_FIELD_H_ */
|
1551
1332
|
|
1552
|
-
#ifndef
|
1553
|
-
#define
|
1333
|
+
#ifndef UPB_MINI_TABLE_MESSAGE_H_
|
1334
|
+
#define UPB_MINI_TABLE_MESSAGE_H_
|
1554
1335
|
|
1555
|
-
#include <stdint.h>
|
1556
1336
|
|
1337
|
+
#ifndef UPB_MINI_TABLE_ENUM_H_
|
1338
|
+
#define UPB_MINI_TABLE_ENUM_H_
|
1557
1339
|
|
1558
|
-
#
|
1559
|
-
|
1340
|
+
#include <stdint.h>
|
1341
|
+
|
1342
|
+
|
1343
|
+
#ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
|
1344
|
+
#define UPB_MINI_TABLE_INTERNAL_ENUM_H_
|
1345
|
+
|
1346
|
+
#include <stdint.h>
|
1347
|
+
|
1348
|
+
// Must be last.
|
1349
|
+
|
1350
|
+
struct upb_MiniTableEnum {
|
1351
|
+
uint32_t UPB_PRIVATE(mask_limit); // Highest that can be tested with mask.
|
1352
|
+
uint32_t UPB_PRIVATE(value_count); // Number of values after the bitfield.
|
1353
|
+
uint32_t UPB_PRIVATE(data)[]; // Bitmask + enumerated values follow.
|
1354
|
+
};
|
1355
|
+
|
1356
|
+
#ifdef __cplusplus
|
1357
|
+
extern "C" {
|
1358
|
+
#endif
|
1359
|
+
|
1360
|
+
UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(
|
1361
|
+
const struct upb_MiniTableEnum* e, uint32_t val) {
|
1362
|
+
if (UPB_LIKELY(val < 64)) {
|
1363
|
+
const uint64_t mask =
|
1364
|
+
e->UPB_PRIVATE(data)[0] | ((uint64_t)e->UPB_PRIVATE(data)[1] << 32);
|
1365
|
+
const uint64_t bit = 1ULL << val;
|
1366
|
+
return (mask & bit) != 0;
|
1367
|
+
}
|
1368
|
+
if (UPB_LIKELY(val < e->UPB_PRIVATE(mask_limit))) {
|
1369
|
+
const uint32_t mask = e->UPB_PRIVATE(data)[val / 32];
|
1370
|
+
const uint32_t bit = 1ULL << (val % 32);
|
1371
|
+
return (mask & bit) != 0;
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
// OPT: binary search long lists?
|
1375
|
+
const uint32_t* start =
|
1376
|
+
&e->UPB_PRIVATE(data)[e->UPB_PRIVATE(mask_limit) / 32];
|
1377
|
+
const uint32_t* limit = &e->UPB_PRIVATE(
|
1378
|
+
data)[e->UPB_PRIVATE(mask_limit) / 32 + e->UPB_PRIVATE(value_count)];
|
1379
|
+
for (const uint32_t* p = start; p < limit; p++) {
|
1380
|
+
if (*p == val) return true;
|
1381
|
+
}
|
1382
|
+
return false;
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
#ifdef __cplusplus
|
1386
|
+
} /* extern "C" */
|
1387
|
+
#endif
|
1388
|
+
|
1389
|
+
|
1390
|
+
#endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */
|
1391
|
+
|
1392
|
+
// Must be last
|
1393
|
+
|
1394
|
+
typedef struct upb_MiniTableEnum upb_MiniTableEnum;
|
1395
|
+
|
1396
|
+
#ifdef __cplusplus
|
1397
|
+
extern "C" {
|
1398
|
+
#endif
|
1399
|
+
|
1400
|
+
// Validates enum value against range defined by enum mini table.
|
1401
|
+
UPB_API_INLINE bool upb_MiniTableEnum_CheckValue(const upb_MiniTableEnum* e,
|
1402
|
+
uint32_t val);
|
1403
|
+
|
1404
|
+
#ifdef __cplusplus
|
1405
|
+
} /* extern "C" */
|
1406
|
+
#endif
|
1407
|
+
|
1408
|
+
|
1409
|
+
#endif /* UPB_MINI_TABLE_ENUM_H_ */
|
1410
|
+
|
1411
|
+
#ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
|
1412
|
+
#define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_
|
1413
|
+
|
1414
|
+
#include <stdint.h>
|
1415
|
+
|
1416
|
+
|
1417
|
+
#ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
|
1418
|
+
#define UPB_MINI_TABLE_INTERNAL_SUB_H_
|
1560
1419
|
|
1561
1420
|
// Must be last.
|
1562
1421
|
|
@@ -1569,26 +1428,26 @@ union upb_MiniTableSub {
|
|
1569
1428
|
extern "C" {
|
1570
1429
|
#endif
|
1571
1430
|
|
1572
|
-
|
1431
|
+
UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum(
|
1573
1432
|
const struct upb_MiniTableEnum* subenum) {
|
1574
1433
|
union upb_MiniTableSub out;
|
1575
1434
|
out.UPB_PRIVATE(subenum) = subenum;
|
1576
1435
|
return out;
|
1577
1436
|
}
|
1578
1437
|
|
1579
|
-
|
1438
|
+
UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage(
|
1580
1439
|
const struct upb_MiniTable* submsg) {
|
1581
1440
|
union upb_MiniTableSub out;
|
1582
1441
|
out.UPB_PRIVATE(submsg) = submsg;
|
1583
1442
|
return out;
|
1584
1443
|
}
|
1585
1444
|
|
1586
|
-
|
1445
|
+
UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
|
1587
1446
|
const union upb_MiniTableSub sub) {
|
1588
1447
|
return sub.UPB_PRIVATE(subenum);
|
1589
1448
|
}
|
1590
1449
|
|
1591
|
-
|
1450
|
+
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
|
1592
1451
|
const union upb_MiniTableSub sub) {
|
1593
1452
|
return sub.UPB_PRIVATE(submsg);
|
1594
1453
|
}
|
@@ -1644,10 +1503,16 @@ struct upb_MiniTable {
|
|
1644
1503
|
uint8_t UPB_PRIVATE(table_mask);
|
1645
1504
|
uint8_t UPB_PRIVATE(required_count); // Required fields have the low hasbits.
|
1646
1505
|
|
1506
|
+
#ifdef UPB_TRACING_ENABLED
|
1507
|
+
const char* UPB_PRIVATE(full_name);
|
1508
|
+
#endif
|
1509
|
+
|
1510
|
+
#ifdef UPB_FASTTABLE_ENABLED
|
1647
1511
|
// To statically initialize the tables of variable length, we need a flexible
|
1648
1512
|
// array member, and we need to compile in gnu99 mode (constant initialization
|
1649
1513
|
// of flexible array members is a GNU extension, not in C99 unfortunately.
|
1650
1514
|
_upb_FastTable_Entry UPB_PRIVATE(fasttable)[];
|
1515
|
+
#endif
|
1651
1516
|
};
|
1652
1517
|
// LINT.ThenChange(//depot/google3/third_party/upb/bits/typescript/mini_table.ts)
|
1653
1518
|
|
@@ -1661,8 +1526,7 @@ UPB_INLINE const struct upb_MiniTable* UPB_PRIVATE(_upb_MiniTable_Empty)(void) {
|
|
1661
1526
|
return &UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
1662
1527
|
}
|
1663
1528
|
|
1664
|
-
|
1665
|
-
const struct upb_MiniTable* m) {
|
1529
|
+
UPB_API_INLINE int upb_MiniTable_FieldCount(const struct upb_MiniTable* m) {
|
1666
1530
|
return m->UPB_ONLYBITS(field_count);
|
1667
1531
|
}
|
1668
1532
|
|
@@ -1673,8 +1537,8 @@ UPB_INLINE bool UPB_PRIVATE(_upb_MiniTable_IsEmpty)(
|
|
1673
1537
|
return m == &UPB_PRIVATE(_kUpb_MiniTable_Empty);
|
1674
1538
|
}
|
1675
1539
|
|
1676
|
-
|
1677
|
-
|
1540
|
+
UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
|
1541
|
+
const struct upb_MiniTable* m, uint32_t i) {
|
1678
1542
|
return &m->UPB_ONLYBITS(fields)[i];
|
1679
1543
|
}
|
1680
1544
|
|
@@ -1683,45 +1547,50 @@ UPB_INLINE const union upb_MiniTableSub* UPB_PRIVATE(
|
|
1683
1547
|
return &m->UPB_PRIVATE(subs)[i];
|
1684
1548
|
}
|
1685
1549
|
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
const struct upb_MiniTable* ret = UPB_PRIVATE(_upb_MiniTableSub_Message)(
|
1550
|
+
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_GetSubMessageTable(
|
1551
|
+
const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
|
1552
|
+
UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Message);
|
1553
|
+
const struct upb_MiniTable* ret = upb_MiniTableSub_Message(
|
1691
1554
|
m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)]);
|
1692
1555
|
UPB_ASSUME(ret);
|
1693
1556
|
return UPB_PRIVATE(_upb_MiniTable_IsEmpty)(ret) ? NULL : ret;
|
1694
1557
|
}
|
1695
1558
|
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1559
|
+
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTable_SubMessage(
|
1560
|
+
const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
|
1561
|
+
if (upb_MiniTableField_CType(f) != kUpb_CType_Message) {
|
1562
|
+
return NULL;
|
1563
|
+
}
|
1564
|
+
return upb_MiniTableSub_Message(
|
1701
1565
|
m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)]);
|
1702
1566
|
}
|
1703
1567
|
|
1704
|
-
|
1568
|
+
UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
|
1569
|
+
const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
|
1570
|
+
UPB_ASSERT(upb_MiniTableField_CType(f) == kUpb_CType_Enum);
|
1571
|
+
return upb_MiniTableSub_Enum(
|
1572
|
+
m->UPB_PRIVATE(subs)[f->UPB_PRIVATE(submsg_index)]);
|
1573
|
+
}
|
1574
|
+
|
1575
|
+
UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapKey(
|
1705
1576
|
const struct upb_MiniTable* m) {
|
1706
|
-
UPB_ASSERT(
|
1707
|
-
const struct upb_MiniTableField* f =
|
1708
|
-
|
1709
|
-
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_Number)(f) == 1);
|
1577
|
+
UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
|
1578
|
+
const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 0);
|
1579
|
+
UPB_ASSERT(upb_MiniTableField_Number(f) == 1);
|
1710
1580
|
return f;
|
1711
1581
|
}
|
1712
1582
|
|
1713
|
-
|
1714
|
-
|
1715
|
-
UPB_ASSERT(
|
1716
|
-
const struct upb_MiniTableField* f =
|
1717
|
-
|
1718
|
-
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_Number)(f) == 2);
|
1583
|
+
UPB_API_INLINE const struct upb_MiniTableField* upb_MiniTable_MapValue(
|
1584
|
+
const struct upb_MiniTable* m) {
|
1585
|
+
UPB_ASSERT(upb_MiniTable_FieldCount(m) == 2);
|
1586
|
+
const struct upb_MiniTableField* f = upb_MiniTable_GetFieldByIndex(m, 1);
|
1587
|
+
UPB_ASSERT(upb_MiniTableField_Number(f) == 2);
|
1719
1588
|
return f;
|
1720
1589
|
}
|
1721
1590
|
|
1722
|
-
|
1591
|
+
UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(
|
1723
1592
|
const struct upb_MiniTable* m, const struct upb_MiniTableField* f) {
|
1724
|
-
return
|
1593
|
+
return upb_MiniTable_GetSubMessageTable(m, f) != NULL;
|
1725
1594
|
}
|
1726
1595
|
|
1727
1596
|
// Computes a bitmask in which the |m->required_count| lowest bits are set.
|
@@ -1736,6 +1605,20 @@ UPB_PRIVATE(_upb_MiniTable_RequiredMask)(const struct upb_MiniTable* m) {
|
|
1736
1605
|
return (1ULL << n) - 1;
|
1737
1606
|
}
|
1738
1607
|
|
1608
|
+
#ifdef UPB_TRACING_ENABLED
|
1609
|
+
UPB_INLINE const char* upb_MiniTable_FullName(
|
1610
|
+
const struct upb_MiniTable* mini_table) {
|
1611
|
+
return mini_table->UPB_PRIVATE(full_name);
|
1612
|
+
}
|
1613
|
+
// Initializes tracing proto name from language runtimes that construct
|
1614
|
+
// mini tables dynamically at runtime. The runtime is responsible for passing
|
1615
|
+
// controlling lifetime of name such as storing in same arena as mini_table.
|
1616
|
+
UPB_INLINE void upb_MiniTable_SetFullName(struct upb_MiniTable* mini_table,
|
1617
|
+
const char* full_name) {
|
1618
|
+
mini_table->UPB_PRIVATE(full_name) = full_name;
|
1619
|
+
}
|
1620
|
+
#endif
|
1621
|
+
|
1739
1622
|
#ifdef __cplusplus
|
1740
1623
|
} /* extern "C" */
|
1741
1624
|
#endif
|
@@ -1755,44 +1638,35 @@ UPB_API const upb_MiniTableField* upb_MiniTable_FindFieldByNumber(
|
|
1755
1638
|
const upb_MiniTable* m, uint32_t number);
|
1756
1639
|
|
1757
1640
|
UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_GetFieldByIndex(
|
1758
|
-
const upb_MiniTable* m, uint32_t index)
|
1759
|
-
return UPB_PRIVATE(_upb_MiniTable_GetFieldByIndex)(m, index);
|
1760
|
-
}
|
1641
|
+
const upb_MiniTable* m, uint32_t index);
|
1761
1642
|
|
1762
|
-
UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m)
|
1763
|
-
return UPB_PRIVATE(_upb_MiniTable_FieldCount)(m);
|
1764
|
-
}
|
1643
|
+
UPB_API_INLINE int upb_MiniTable_FieldCount(const upb_MiniTable* m);
|
1765
1644
|
|
1645
|
+
// DEPRECATED: use upb_MiniTable_SubMessage() instead
|
1766
1646
|
// Returns the MiniTable for a message field, NULL if the field is unlinked.
|
1767
1647
|
UPB_API_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
|
1768
|
-
const upb_MiniTable* m, const upb_MiniTableField* f)
|
1769
|
-
|
1770
|
-
|
1648
|
+
const upb_MiniTable* m, const upb_MiniTableField* f);
|
1649
|
+
|
1650
|
+
// Returns the MiniTable for a message field if it is a submessage.
|
1651
|
+
UPB_API_INLINE const upb_MiniTable* upb_MiniTable_SubMessage(
|
1652
|
+
const upb_MiniTable* m, const upb_MiniTableField* f);
|
1771
1653
|
|
1772
1654
|
// Returns the MiniTableEnum for a message field, NULL if the field is unlinked.
|
1773
1655
|
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTable_GetSubEnumTable(
|
1774
|
-
const upb_MiniTable* m, const upb_MiniTableField* f)
|
1775
|
-
return UPB_PRIVATE(_upb_MiniTable_GetSubEnumTable)(m, f);
|
1776
|
-
}
|
1656
|
+
const upb_MiniTable* m, const upb_MiniTableField* f);
|
1777
1657
|
|
1778
1658
|
// Returns the MiniTableField for the key of a map.
|
1779
1659
|
UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapKey(
|
1780
|
-
const upb_MiniTable* m)
|
1781
|
-
return UPB_PRIVATE(_upb_MiniTable_MapKey)(m);
|
1782
|
-
}
|
1660
|
+
const upb_MiniTable* m);
|
1783
1661
|
|
1784
1662
|
// Returns the MiniTableField for the value of a map.
|
1785
1663
|
UPB_API_INLINE const upb_MiniTableField* upb_MiniTable_MapValue(
|
1786
|
-
const upb_MiniTable* m)
|
1787
|
-
return UPB_PRIVATE(_upb_MiniTable_MapValue)(m);
|
1788
|
-
}
|
1664
|
+
const upb_MiniTable* m);
|
1789
1665
|
|
1790
1666
|
// Returns true if this MiniTable field is linked to a MiniTable for the
|
1791
1667
|
// sub-message.
|
1792
|
-
UPB_API_INLINE bool
|
1793
|
-
|
1794
|
-
return UPB_PRIVATE(_upb_MiniTable_MessageFieldIsLinked)(m, f);
|
1795
|
-
}
|
1668
|
+
UPB_API_INLINE bool upb_MiniTable_FieldIsLinked(const upb_MiniTable* m,
|
1669
|
+
const upb_MiniTableField* f);
|
1796
1670
|
|
1797
1671
|
// If this field is in a oneof, returns the first field in the oneof.
|
1798
1672
|
//
|
@@ -1824,68 +1698,129 @@ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m,
|
|
1824
1698
|
|
1825
1699
|
// Must be last.
|
1826
1700
|
|
1701
|
+
typedef struct upb_Array upb_Array;
|
1702
|
+
|
1827
1703
|
#ifdef __cplusplus
|
1828
1704
|
extern "C" {
|
1829
1705
|
#endif
|
1830
1706
|
|
1831
|
-
|
1832
|
-
|
1833
|
-
extern const double kUpb_NaN;
|
1707
|
+
// Creates a new array on the given arena that holds elements of this type.
|
1708
|
+
UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
|
1834
1709
|
|
1835
|
-
//
|
1836
|
-
|
1710
|
+
// Returns the number of elements in the array.
|
1711
|
+
UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr);
|
1837
1712
|
|
1838
|
-
|
1839
|
-
|
1840
|
-
// Must be aligned to 8, which is alignof(upb_Extension)
|
1841
|
-
uint32_t size;
|
1713
|
+
// Returns the given element, which must be within the array's current size.
|
1714
|
+
UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
|
1842
1715
|
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
* Extension data grows backward from size to ext_begin.
|
1847
|
-
* When the two meet, we're out of data and have to realloc.
|
1848
|
-
*
|
1849
|
-
* If we imagine that the final member of this struct is:
|
1850
|
-
* char data[size - overhead]; // overhead = sizeof(upb_Message_Internal)
|
1851
|
-
*
|
1852
|
-
* Then we have:
|
1853
|
-
* unknown data: data[0 .. (unknown_end - overhead)]
|
1854
|
-
* extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
|
1855
|
-
uint32_t unknown_end;
|
1856
|
-
uint32_t ext_begin;
|
1857
|
-
// Data follows, as if there were an array:
|
1858
|
-
// char data[size - sizeof(upb_Message_Internal)];
|
1859
|
-
} upb_Message_Internal;
|
1716
|
+
// Returns a mutating pointer to the given element, which must be within the
|
1717
|
+
// array's current size.
|
1718
|
+
UPB_API upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i);
|
1860
1719
|
|
1861
|
-
//
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1720
|
+
// Sets the given element, which must be within the array's current size.
|
1721
|
+
UPB_API void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
|
1722
|
+
|
1723
|
+
// Appends an element to the array. Returns false on allocation failure.
|
1724
|
+
UPB_API bool upb_Array_Append(upb_Array* array, upb_MessageValue val,
|
1725
|
+
upb_Arena* arena);
|
1726
|
+
|
1727
|
+
// Moves elements within the array using memmove().
|
1728
|
+
// Like memmove(), the source and destination elements may be overlapping.
|
1729
|
+
UPB_API void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
|
1730
|
+
size_t count);
|
1731
|
+
|
1732
|
+
// Inserts one or more empty elements into the array.
|
1733
|
+
// Existing elements are shifted right.
|
1734
|
+
// The new elements have undefined state and must be set with `upb_Array_Set()`.
|
1735
|
+
// REQUIRES: `i <= upb_Array_Size(arr)`
|
1736
|
+
UPB_API bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
|
1737
|
+
upb_Arena* arena);
|
1738
|
+
|
1739
|
+
// Deletes one or more elements from the array.
|
1740
|
+
// Existing elements are shifted left.
|
1741
|
+
// REQUIRES: `i + count <= upb_Array_Size(arr)`
|
1742
|
+
UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
|
1743
|
+
|
1744
|
+
// Reserves |size| elements of storage for the array.
|
1745
|
+
UPB_API_INLINE bool upb_Array_Reserve(struct upb_Array* array, size_t size,
|
1746
|
+
upb_Arena* arena);
|
1747
|
+
|
1748
|
+
// Changes the size of a vector. New elements are initialized to NULL/0.
|
1749
|
+
// Returns false on allocation failure.
|
1750
|
+
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
|
1751
|
+
|
1752
|
+
// Returns pointer to array data.
|
1753
|
+
UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr);
|
1754
|
+
|
1755
|
+
// Returns mutable pointer to array data.
|
1756
|
+
UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr);
|
1757
|
+
|
1758
|
+
// Mark an array and all of its descendents as frozen/immutable.
|
1759
|
+
// If the array elements are messages then |m| must point to the minitable for
|
1760
|
+
// those messages. Otherwise |m| must be NULL.
|
1761
|
+
UPB_API void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m);
|
1762
|
+
|
1763
|
+
// Returns whether an array has been frozen.
|
1764
|
+
UPB_API_INLINE bool upb_Array_IsFrozen(const upb_Array* arr);
|
1765
|
+
|
1766
|
+
#ifdef __cplusplus
|
1767
|
+
} /* extern "C" */
|
1768
|
+
#endif
|
1769
|
+
|
1770
|
+
|
1771
|
+
#endif /* UPB_MESSAGE_ARRAY_H_ */
|
1772
|
+
|
1773
|
+
#ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_
|
1774
|
+
#define UPB_MESSAGE_INTERNAL_ACCESSORS_H_
|
1775
|
+
|
1776
|
+
#include <stddef.h>
|
1777
|
+
#include <stdint.h>
|
1778
|
+
#include <string.h>
|
1779
|
+
|
1780
|
+
|
1781
|
+
#ifndef UPB_BASE_INTERNAL_ENDIAN_H_
|
1782
|
+
#define UPB_BASE_INTERNAL_ENDIAN_H_
|
1783
|
+
|
1784
|
+
#include <stdint.h>
|
1785
|
+
|
1786
|
+
// Must be last.
|
1787
|
+
|
1788
|
+
#ifdef __cplusplus
|
1789
|
+
extern "C" {
|
1790
|
+
#endif
|
1791
|
+
|
1792
|
+
UPB_INLINE bool upb_IsLittleEndian(void) {
|
1793
|
+
const int x = 1;
|
1794
|
+
return *(char*)&x == 1;
|
1869
1795
|
}
|
1870
1796
|
|
1871
|
-
|
1872
|
-
|
1797
|
+
UPB_INLINE uint32_t upb_BigEndian32(uint32_t val) {
|
1798
|
+
if (upb_IsLittleEndian()) return val;
|
1873
1799
|
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
const char* data, size_t len,
|
1878
|
-
upb_Arena* arena);
|
1800
|
+
return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
|
1801
|
+
((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
|
1802
|
+
}
|
1879
1803
|
|
1880
|
-
|
1881
|
-
|
1804
|
+
UPB_INLINE uint64_t upb_BigEndian64(uint64_t val) {
|
1805
|
+
if (upb_IsLittleEndian()) return val;
|
1806
|
+
|
1807
|
+
const uint64_t hi = ((uint64_t)upb_BigEndian32((uint32_t)val)) << 32;
|
1808
|
+
const uint64_t lo = upb_BigEndian32((uint32_t)(val >> 32));
|
1809
|
+
return hi | lo;
|
1810
|
+
}
|
1882
1811
|
|
1883
1812
|
#ifdef __cplusplus
|
1884
1813
|
} /* extern "C" */
|
1885
1814
|
#endif
|
1886
1815
|
|
1887
1816
|
|
1888
|
-
#endif /*
|
1817
|
+
#endif /* UPB_BASE_INTERNAL_ENDIAN_H_ */
|
1818
|
+
|
1819
|
+
#ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_
|
1820
|
+
#define UPB_MESSAGE_INTERNAL_EXTENSION_H_
|
1821
|
+
|
1822
|
+
#include <stddef.h>
|
1823
|
+
|
1889
1824
|
|
1890
1825
|
#ifndef UPB_MINI_TABLE_EXTENSION_H_
|
1891
1826
|
#define UPB_MINI_TABLE_EXTENSION_H_
|
@@ -1913,23 +1848,22 @@ struct upb_MiniTableExtension {
|
|
1913
1848
|
extern "C" {
|
1914
1849
|
#endif
|
1915
1850
|
|
1916
|
-
|
1917
|
-
|
1918
|
-
return
|
1851
|
+
UPB_API_INLINE upb_CType
|
1852
|
+
upb_MiniTableExtension_CType(const struct upb_MiniTableExtension* e) {
|
1853
|
+
return upb_MiniTableField_CType(&e->UPB_PRIVATE(field));
|
1919
1854
|
}
|
1920
1855
|
|
1921
|
-
|
1922
|
-
|
1856
|
+
UPB_API_INLINE uint32_t
|
1857
|
+
upb_MiniTableExtension_Number(const struct upb_MiniTableExtension* e) {
|
1923
1858
|
return e->UPB_PRIVATE(field).UPB_ONLYBITS(number);
|
1924
1859
|
}
|
1925
1860
|
|
1926
|
-
|
1927
|
-
_upb_MiniTableExtension_GetSubMessage)(
|
1861
|
+
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
|
1928
1862
|
const struct upb_MiniTableExtension* e) {
|
1929
|
-
return
|
1863
|
+
return upb_MiniTableSub_Message(e->UPB_PRIVATE(sub));
|
1930
1864
|
}
|
1931
1865
|
|
1932
|
-
|
1866
|
+
UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
|
1933
1867
|
struct upb_MiniTableExtension* e, const struct upb_MiniTable* m) {
|
1934
1868
|
e->UPB_PRIVATE(sub).UPB_PRIVATE(submsg) = m;
|
1935
1869
|
}
|
@@ -1950,24 +1884,16 @@ extern "C" {
|
|
1950
1884
|
#endif
|
1951
1885
|
|
1952
1886
|
UPB_API_INLINE upb_CType
|
1953
|
-
upb_MiniTableExtension_CType(const upb_MiniTableExtension* e)
|
1954
|
-
return UPB_PRIVATE(_upb_MiniTableExtension_CType)(e);
|
1955
|
-
}
|
1887
|
+
upb_MiniTableExtension_CType(const upb_MiniTableExtension* e);
|
1956
1888
|
|
1957
1889
|
UPB_API_INLINE uint32_t
|
1958
|
-
upb_MiniTableExtension_Number(const upb_MiniTableExtension* e)
|
1959
|
-
return UPB_PRIVATE(_upb_MiniTableExtension_Number)(e);
|
1960
|
-
}
|
1890
|
+
upb_MiniTableExtension_Number(const upb_MiniTableExtension* e);
|
1961
1891
|
|
1962
1892
|
UPB_API_INLINE const upb_MiniTable* upb_MiniTableExtension_GetSubMessage(
|
1963
|
-
const upb_MiniTableExtension* e)
|
1964
|
-
return UPB_PRIVATE(_upb_MiniTableExtension_GetSubMessage)(e);
|
1965
|
-
}
|
1893
|
+
const upb_MiniTableExtension* e);
|
1966
1894
|
|
1967
1895
|
UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
|
1968
|
-
upb_MiniTableExtension* e, const upb_MiniTable* m)
|
1969
|
-
UPB_PRIVATE(_upb_MiniTableExtension_SetSubMessage)(e, m);
|
1970
|
-
}
|
1896
|
+
upb_MiniTableExtension* e, const upb_MiniTable* m);
|
1971
1897
|
|
1972
1898
|
#ifdef __cplusplus
|
1973
1899
|
} /* extern "C" */
|
@@ -1986,14 +1912,10 @@ UPB_API_INLINE void upb_MiniTableExtension_SetSubMessage(
|
|
1986
1912
|
// This is rather wasteful for scalars (in the extreme case of bool,
|
1987
1913
|
// it wastes 15 bytes). We accept this because we expect messages to be
|
1988
1914
|
// the most common extension type.
|
1989
|
-
struct
|
1915
|
+
typedef struct {
|
1990
1916
|
const upb_MiniTableExtension* ext;
|
1991
|
-
|
1992
|
-
|
1993
|
-
void* ptr;
|
1994
|
-
char scalar_data[8];
|
1995
|
-
} data;
|
1996
|
-
};
|
1917
|
+
upb_MessageValue data;
|
1918
|
+
} upb_Extension;
|
1997
1919
|
|
1998
1920
|
#ifdef __cplusplus
|
1999
1921
|
extern "C" {
|
@@ -2002,18 +1924,18 @@ extern "C" {
|
|
2002
1924
|
// Adds the given extension data to the given message.
|
2003
1925
|
// |ext| is copied into the message instance.
|
2004
1926
|
// This logically replaces any previously-added extension with this number.
|
2005
|
-
|
1927
|
+
upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(
|
2006
1928
|
struct upb_Message* msg, const upb_MiniTableExtension* ext,
|
2007
1929
|
upb_Arena* arena);
|
2008
1930
|
|
2009
1931
|
// Returns an array of extensions for this message.
|
2010
1932
|
// Note: the array is ordered in reverse relative to the order of creation.
|
2011
|
-
const
|
1933
|
+
const upb_Extension* UPB_PRIVATE(_upb_Message_Getexts)(
|
2012
1934
|
const struct upb_Message* msg, size_t* count);
|
2013
1935
|
|
2014
1936
|
// Returns an extension for a message with a given mini table,
|
2015
1937
|
// or NULL if no extension exists with this mini table.
|
2016
|
-
const
|
1938
|
+
const upb_Extension* UPB_PRIVATE(_upb_Message_Getext)(
|
2017
1939
|
const struct upb_Message* msg, const upb_MiniTableExtension* ext);
|
2018
1940
|
|
2019
1941
|
#ifdef __cplusplus
|
@@ -2342,6 +2264,7 @@ struct upb_Map {
|
|
2342
2264
|
// Strings are represented as '0' because they must be handled specially.
|
2343
2265
|
char key_size;
|
2344
2266
|
char val_size;
|
2267
|
+
bool UPB_PRIVATE(is_frozen);
|
2345
2268
|
|
2346
2269
|
upb_strtable table;
|
2347
2270
|
};
|
@@ -2350,6 +2273,14 @@ struct upb_Map {
|
|
2350
2273
|
extern "C" {
|
2351
2274
|
#endif
|
2352
2275
|
|
2276
|
+
UPB_INLINE void UPB_PRIVATE(_upb_Map_ShallowFreeze)(struct upb_Map* map) {
|
2277
|
+
map->UPB_PRIVATE(is_frozen) = true;
|
2278
|
+
}
|
2279
|
+
|
2280
|
+
UPB_API_INLINE bool upb_Map_IsFrozen(const struct upb_Map* map) {
|
2281
|
+
return map->UPB_PRIVATE(is_frozen);
|
2282
|
+
}
|
2283
|
+
|
2353
2284
|
// Converting between internal table representation and user values.
|
2354
2285
|
//
|
2355
2286
|
// _upb_map_tokey() and _upb_map_fromkey() are inverses.
|
@@ -2407,11 +2338,15 @@ UPB_INLINE void* _upb_map_next(const struct upb_Map* map, size_t* iter) {
|
|
2407
2338
|
}
|
2408
2339
|
|
2409
2340
|
UPB_INLINE void _upb_Map_Clear(struct upb_Map* map) {
|
2341
|
+
UPB_ASSERT(!upb_Map_IsFrozen(map));
|
2342
|
+
|
2410
2343
|
upb_strtable_clear(&map->table);
|
2411
2344
|
}
|
2412
2345
|
|
2413
2346
|
UPB_INLINE bool _upb_Map_Delete(struct upb_Map* map, const void* key,
|
2414
2347
|
size_t key_size, upb_value* val) {
|
2348
|
+
UPB_ASSERT(!upb_Map_IsFrozen(map));
|
2349
|
+
|
2415
2350
|
upb_StringView k = _upb_map_tokey(key, key_size);
|
2416
2351
|
return upb_strtable_remove2(&map->table, k.data, k.size, val);
|
2417
2352
|
}
|
@@ -2431,6 +2366,8 @@ UPB_INLINE upb_MapInsertStatus _upb_Map_Insert(struct upb_Map* map,
|
|
2431
2366
|
const void* key, size_t key_size,
|
2432
2367
|
void* val, size_t val_size,
|
2433
2368
|
upb_Arena* a) {
|
2369
|
+
UPB_ASSERT(!upb_Map_IsFrozen(map));
|
2370
|
+
|
2434
2371
|
upb_StringView strkey = _upb_map_tokey(key, key_size);
|
2435
2372
|
upb_value tabval = {0};
|
2436
2373
|
if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
|
@@ -2458,15 +2395,104 @@ UPB_INLINE size_t _upb_Map_CTypeSize(upb_CType ctype) {
|
|
2458
2395
|
return _upb_Map_CTypeSizeTable[ctype];
|
2459
2396
|
}
|
2460
2397
|
|
2461
|
-
// Creates a new map on the given arena with this key/value type.
|
2462
|
-
struct upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
|
2398
|
+
// Creates a new map on the given arena with this key/value type.
|
2399
|
+
struct upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
|
2400
|
+
|
2401
|
+
#ifdef __cplusplus
|
2402
|
+
} /* extern "C" */
|
2403
|
+
#endif
|
2404
|
+
|
2405
|
+
|
2406
|
+
#endif /* UPB_MESSAGE_INTERNAL_MAP_H_ */
|
2407
|
+
|
2408
|
+
/*
|
2409
|
+
** Our memory representation for parsing tables and messages themselves.
|
2410
|
+
** Functions in this file are used by generated code and possibly reflection.
|
2411
|
+
**
|
2412
|
+
** The definitions in this file are internal to upb.
|
2413
|
+
**/
|
2414
|
+
|
2415
|
+
#ifndef UPB_MESSAGE_INTERNAL_MESSAGE_H_
|
2416
|
+
#define UPB_MESSAGE_INTERNAL_MESSAGE_H_
|
2417
|
+
|
2418
|
+
#include <stdlib.h>
|
2419
|
+
#include <string.h>
|
2420
|
+
|
2421
|
+
|
2422
|
+
// Must be last.
|
2423
|
+
|
2424
|
+
#ifdef __cplusplus
|
2425
|
+
extern "C" {
|
2426
|
+
#endif
|
2427
|
+
|
2428
|
+
extern const float kUpb_FltInfinity;
|
2429
|
+
extern const double kUpb_Infinity;
|
2430
|
+
extern const double kUpb_NaN;
|
2431
|
+
|
2432
|
+
// Internal members of a upb_Message that track unknown fields and/or
|
2433
|
+
// extensions. We can change this without breaking binary compatibility.
|
2434
|
+
|
2435
|
+
typedef struct upb_Message_Internal {
|
2436
|
+
// Total size of this structure, including the data that follows.
|
2437
|
+
// Must be aligned to 8, which is alignof(upb_Extension)
|
2438
|
+
uint32_t size;
|
2439
|
+
|
2440
|
+
/* Offsets relative to the beginning of this structure.
|
2441
|
+
*
|
2442
|
+
* Unknown data grows forward from the beginning to unknown_end.
|
2443
|
+
* Extension data grows backward from size to ext_begin.
|
2444
|
+
* When the two meet, we're out of data and have to realloc.
|
2445
|
+
*
|
2446
|
+
* If we imagine that the final member of this struct is:
|
2447
|
+
* char data[size - overhead]; // overhead = sizeof(upb_Message_Internal)
|
2448
|
+
*
|
2449
|
+
* Then we have:
|
2450
|
+
* unknown data: data[0 .. (unknown_end - overhead)]
|
2451
|
+
* extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
|
2452
|
+
uint32_t unknown_end;
|
2453
|
+
uint32_t ext_begin;
|
2454
|
+
// Data follows, as if there were an array:
|
2455
|
+
// char data[size - sizeof(upb_Message_Internal)];
|
2456
|
+
} upb_Message_Internal;
|
2457
|
+
|
2458
|
+
#ifdef UPB_TRACING_ENABLED
|
2459
|
+
void UPB_PRIVATE(upb_Message_SetNewMessageTraceHandler)(
|
2460
|
+
void (*newMessageTraceHandler)(const upb_MiniTable*, const upb_Arena*));
|
2461
|
+
void UPB_PRIVATE(upb_Message_LogNewMessage)(const upb_MiniTable* mini_table,
|
2462
|
+
const upb_Arena* arena);
|
2463
|
+
#endif
|
2464
|
+
|
2465
|
+
// Inline version upb_Message_New(), for internal use.
|
2466
|
+
UPB_INLINE struct upb_Message* _upb_Message_New(const upb_MiniTable* m,
|
2467
|
+
upb_Arena* a) {
|
2468
|
+
#ifdef UPB_TRACING_ENABLED
|
2469
|
+
UPB_PRIVATE(upb_Message_LogNewMessage)(m, a);
|
2470
|
+
#endif
|
2471
|
+
const int size = m->UPB_PRIVATE(size);
|
2472
|
+
struct upb_Message* msg = (struct upb_Message*)upb_Arena_Malloc(a, size);
|
2473
|
+
if (UPB_UNLIKELY(!msg)) return NULL;
|
2474
|
+
memset(msg, 0, size);
|
2475
|
+
return msg;
|
2476
|
+
}
|
2477
|
+
|
2478
|
+
// Discards the unknown fields for this message only.
|
2479
|
+
void _upb_Message_DiscardUnknown_shallow(struct upb_Message* msg);
|
2480
|
+
|
2481
|
+
// Adds unknown data (serialized protobuf data) to the given message.
|
2482
|
+
// The data is copied into the message instance.
|
2483
|
+
bool UPB_PRIVATE(_upb_Message_AddUnknown)(struct upb_Message* msg,
|
2484
|
+
const char* data, size_t len,
|
2485
|
+
upb_Arena* arena);
|
2486
|
+
|
2487
|
+
bool UPB_PRIVATE(_upb_Message_Realloc)(struct upb_Message* msg, size_t need,
|
2488
|
+
upb_Arena* arena);
|
2463
2489
|
|
2464
2490
|
#ifdef __cplusplus
|
2465
2491
|
} /* extern "C" */
|
2466
2492
|
#endif
|
2467
2493
|
|
2468
2494
|
|
2469
|
-
#endif /*
|
2495
|
+
#endif /* UPB_MESSAGE_INTERNAL_MESSAGE_H_ */
|
2470
2496
|
|
2471
2497
|
#ifndef UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
|
2472
2498
|
#define UPB_MINI_TABLE_INTERNAL_TAGGED_PTR_H_
|
@@ -2487,7 +2513,7 @@ UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(struct upb_Message* ptr, bool empty) {
|
|
2487
2513
|
return (uintptr_t)ptr | (empty ? 1 : 0);
|
2488
2514
|
}
|
2489
2515
|
|
2490
|
-
|
2516
|
+
UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(uintptr_t ptr) {
|
2491
2517
|
return ptr & 1;
|
2492
2518
|
}
|
2493
2519
|
|
@@ -2496,15 +2522,15 @@ UPB_INLINE struct upb_Message* UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(
|
|
2496
2522
|
return (struct upb_Message*)(ptr & ~(uintptr_t)1);
|
2497
2523
|
}
|
2498
2524
|
|
2499
|
-
|
2500
|
-
|
2501
|
-
UPB_ASSERT(!
|
2525
|
+
UPB_API_INLINE struct upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
|
2526
|
+
uintptr_t ptr) {
|
2527
|
+
UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(ptr));
|
2502
2528
|
return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
|
2503
2529
|
}
|
2504
2530
|
|
2505
2531
|
UPB_INLINE struct upb_Message* UPB_PRIVATE(
|
2506
2532
|
_upb_TaggedMessagePtr_GetEmptyMessage)(uintptr_t ptr) {
|
2507
|
-
UPB_ASSERT(
|
2533
|
+
UPB_ASSERT(upb_TaggedMessagePtr_IsEmpty(ptr));
|
2508
2534
|
return UPB_PRIVATE(_upb_TaggedMessagePtr_GetMessage)(ptr);
|
2509
2535
|
}
|
2510
2536
|
|
@@ -2518,13 +2544,51 @@ UPB_INLINE struct upb_Message* UPB_PRIVATE(
|
|
2518
2544
|
#ifndef UPB_MESSAGE_INTERNAL_TYPES_H_
|
2519
2545
|
#define UPB_MESSAGE_INTERNAL_TYPES_H_
|
2520
2546
|
|
2547
|
+
#include <stdint.h>
|
2548
|
+
|
2549
|
+
// Must be last.
|
2550
|
+
|
2551
|
+
#define UPB_OPAQUE(x) x##_opaque
|
2552
|
+
|
2521
2553
|
struct upb_Message {
|
2522
2554
|
union {
|
2523
|
-
|
2555
|
+
uintptr_t UPB_OPAQUE(internal); // tagged pointer, low bit == frozen
|
2524
2556
|
double d; // Forces same size for 32-bit/64-bit builds
|
2525
2557
|
};
|
2526
2558
|
};
|
2527
2559
|
|
2560
|
+
#ifdef __cplusplus
|
2561
|
+
extern "C" {
|
2562
|
+
#endif
|
2563
|
+
|
2564
|
+
UPB_INLINE void UPB_PRIVATE(_upb_Message_ShallowFreeze)(
|
2565
|
+
struct upb_Message* msg) {
|
2566
|
+
msg->UPB_OPAQUE(internal) |= 1ULL;
|
2567
|
+
}
|
2568
|
+
|
2569
|
+
UPB_API_INLINE bool upb_Message_IsFrozen(const struct upb_Message* msg) {
|
2570
|
+
return (msg->UPB_OPAQUE(internal) & 1ULL) != 0;
|
2571
|
+
}
|
2572
|
+
|
2573
|
+
UPB_INLINE struct upb_Message_Internal* UPB_PRIVATE(_upb_Message_GetInternal)(
|
2574
|
+
const struct upb_Message* msg) {
|
2575
|
+
const uintptr_t tmp = msg->UPB_OPAQUE(internal) & ~1ULL;
|
2576
|
+
return (struct upb_Message_Internal*)tmp;
|
2577
|
+
}
|
2578
|
+
|
2579
|
+
UPB_INLINE void UPB_PRIVATE(_upb_Message_SetInternal)(
|
2580
|
+
struct upb_Message* msg, struct upb_Message_Internal* internal) {
|
2581
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2582
|
+
msg->UPB_OPAQUE(internal) = (uintptr_t)internal;
|
2583
|
+
}
|
2584
|
+
|
2585
|
+
#ifdef __cplusplus
|
2586
|
+
} /* extern "C" */
|
2587
|
+
#endif
|
2588
|
+
|
2589
|
+
#undef UPB_OPAQUE
|
2590
|
+
|
2591
|
+
|
2528
2592
|
#endif /* UPB_MESSAGE_INTERNAL_TYPES_H_ */
|
2529
2593
|
|
2530
2594
|
// Must be last.
|
@@ -2703,7 +2767,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(
|
|
2703
2767
|
// bool FooMessage_set_bool_field(const upb_Message* msg, bool val) {
|
2704
2768
|
// const upb_MiniTableField field = {1, 0, 0, /* etc... */};
|
2705
2769
|
// // All value in "field" are compile-time known.
|
2706
|
-
//
|
2770
|
+
// upb_Message_SetBaseField(msg, &field, &value);
|
2707
2771
|
// }
|
2708
2772
|
//
|
2709
2773
|
// // Via UPB_ASSUME().
|
@@ -2726,8 +2790,8 @@ UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(
|
|
2726
2790
|
// of a setter is known to be a non-extension, the arena may be NULL and the
|
2727
2791
|
// returned bool value may be ignored since it will always succeed.
|
2728
2792
|
|
2729
|
-
|
2730
|
-
|
2793
|
+
UPB_API_INLINE bool upb_Message_HasBaseField(const struct upb_Message* msg,
|
2794
|
+
const upb_MiniTableField* field) {
|
2731
2795
|
UPB_ASSERT(upb_MiniTableField_HasPresence(field));
|
2732
2796
|
UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
|
2733
2797
|
if (upb_MiniTableField_IsInOneof(field)) {
|
@@ -2738,19 +2802,19 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Message_HasBaseField)(
|
|
2738
2802
|
}
|
2739
2803
|
}
|
2740
2804
|
|
2741
|
-
|
2742
|
-
|
2743
|
-
UPB_ASSERT(upb_MiniTableField_HasPresence(&
|
2744
|
-
return UPB_PRIVATE(_upb_Message_Getext)(msg,
|
2805
|
+
UPB_API_INLINE bool upb_Message_HasExtension(const struct upb_Message* msg,
|
2806
|
+
const upb_MiniTableExtension* e) {
|
2807
|
+
UPB_ASSERT(upb_MiniTableField_HasPresence(&e->UPB_PRIVATE(field)));
|
2808
|
+
return UPB_PRIVATE(_upb_Message_Getext)(msg, e) != NULL;
|
2745
2809
|
}
|
2746
2810
|
|
2747
|
-
|
2811
|
+
UPB_FORCEINLINE void _upb_Message_GetNonExtensionField(
|
2748
2812
|
const struct upb_Message* msg, const upb_MiniTableField* field,
|
2749
2813
|
const void* default_val, void* val) {
|
2750
2814
|
UPB_ASSUME(!upb_MiniTableField_IsExtension(field));
|
2751
2815
|
if ((upb_MiniTableField_IsInOneof(field) ||
|
2752
2816
|
!UPB_PRIVATE(_upb_MiniTableField_DataIsZero)(field, default_val)) &&
|
2753
|
-
!
|
2817
|
+
!upb_Message_HasBaseField(msg, field)) {
|
2754
2818
|
UPB_PRIVATE(_upb_MiniTableField_DataCopy)(field, val, default_val);
|
2755
2819
|
return;
|
2756
2820
|
}
|
@@ -2761,8 +2825,7 @@ static UPB_FORCEINLINE void _upb_Message_GetNonExtensionField(
|
|
2761
2825
|
UPB_INLINE void _upb_Message_GetExtensionField(
|
2762
2826
|
const struct upb_Message* msg, const upb_MiniTableExtension* mt_ext,
|
2763
2827
|
const void* default_val, void* val) {
|
2764
|
-
const
|
2765
|
-
UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext);
|
2828
|
+
const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getext)(msg, mt_ext);
|
2766
2829
|
const upb_MiniTableField* f = &mt_ext->UPB_PRIVATE(field);
|
2767
2830
|
UPB_ASSUME(upb_MiniTableField_IsExtension(f));
|
2768
2831
|
|
@@ -2773,33 +2836,45 @@ UPB_INLINE void _upb_Message_GetExtensionField(
|
|
2773
2836
|
}
|
2774
2837
|
}
|
2775
2838
|
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2779
|
-
|
2839
|
+
UPB_API_INLINE void upb_Message_SetBaseField(struct upb_Message* msg,
|
2840
|
+
const upb_MiniTableField* f,
|
2841
|
+
const void* val) {
|
2842
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2843
|
+
UPB_ASSUME(!upb_MiniTableField_IsExtension(f));
|
2844
|
+
UPB_PRIVATE(_upb_Message_SetPresence)(msg, f);
|
2780
2845
|
UPB_PRIVATE(_upb_MiniTableField_DataCopy)
|
2781
|
-
(
|
2846
|
+
(f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), val);
|
2782
2847
|
}
|
2783
2848
|
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2849
|
+
UPB_API_INLINE bool upb_Message_SetExtension(struct upb_Message* msg,
|
2850
|
+
const upb_MiniTableExtension* e,
|
2851
|
+
const void* val, upb_Arena* a) {
|
2852
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2787
2853
|
UPB_ASSERT(a);
|
2788
|
-
|
2789
|
-
UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg,
|
2854
|
+
upb_Extension* ext =
|
2855
|
+
UPB_PRIVATE(_upb_Message_GetOrCreateExtension)(msg, e, a);
|
2790
2856
|
if (!ext) return false;
|
2791
2857
|
UPB_PRIVATE(_upb_MiniTableField_DataCopy)
|
2792
|
-
(&
|
2858
|
+
(&e->UPB_PRIVATE(field), &ext->data, val);
|
2793
2859
|
return true;
|
2794
2860
|
}
|
2795
2861
|
|
2796
|
-
|
2797
|
-
|
2862
|
+
UPB_API_INLINE void upb_Message_Clear(struct upb_Message* msg,
|
2863
|
+
const upb_MiniTable* m) {
|
2864
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2865
|
+
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
2798
2866
|
memset(msg, 0, m->UPB_PRIVATE(size));
|
2867
|
+
if (in) {
|
2868
|
+
// Reset the internal buffer to empty.
|
2869
|
+
in->unknown_end = sizeof(upb_Message_Internal);
|
2870
|
+
in->ext_begin = in->size;
|
2871
|
+
UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
|
2872
|
+
}
|
2799
2873
|
}
|
2800
2874
|
|
2801
|
-
|
2802
|
-
|
2875
|
+
UPB_API_INLINE void upb_Message_ClearBaseField(struct upb_Message* msg,
|
2876
|
+
const upb_MiniTableField* f) {
|
2877
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2803
2878
|
if (UPB_PRIVATE(_upb_MiniTableField_HasHasbit)(f)) {
|
2804
2879
|
UPB_PRIVATE(_upb_Message_ClearHasbit)(msg, f);
|
2805
2880
|
} else if (upb_MiniTableField_IsInOneof(f)) {
|
@@ -2812,17 +2887,16 @@ UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearBaseField)(
|
|
2812
2887
|
(f, UPB_PRIVATE(_upb_Message_MutableDataPtr)(msg, f), zeros);
|
2813
2888
|
}
|
2814
2889
|
|
2815
|
-
|
2890
|
+
UPB_API_INLINE void upb_Message_ClearExtension(
|
2816
2891
|
struct upb_Message* msg, const upb_MiniTableExtension* e) {
|
2817
|
-
|
2892
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
2893
|
+
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
2818
2894
|
if (!in) return;
|
2819
|
-
const
|
2820
|
-
|
2821
|
-
struct upb_Extension* ext =
|
2822
|
-
(struct upb_Extension*)UPB_PRIVATE(_upb_Message_Getext)(msg, e);
|
2895
|
+
const upb_Extension* base = UPB_PTR_AT(in, in->ext_begin, upb_Extension);
|
2896
|
+
upb_Extension* ext = (upb_Extension*)UPB_PRIVATE(_upb_Message_Getext)(msg, e);
|
2823
2897
|
if (ext) {
|
2824
2898
|
*ext = *base;
|
2825
|
-
in->ext_begin += sizeof(
|
2899
|
+
in->ext_begin += sizeof(upb_Extension);
|
2826
2900
|
}
|
2827
2901
|
}
|
2828
2902
|
|
@@ -2834,7 +2908,7 @@ UPB_INLINE void _upb_Message_AssertMapIsUntagged(
|
|
2834
2908
|
uintptr_t default_val = 0;
|
2835
2909
|
uintptr_t tagged;
|
2836
2910
|
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
|
2837
|
-
UPB_ASSERT(!
|
2911
|
+
UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(tagged));
|
2838
2912
|
#endif
|
2839
2913
|
}
|
2840
2914
|
|
@@ -2850,7 +2924,7 @@ UPB_INLINE struct upb_Map* _upb_Message_GetOrCreateMutableMap(
|
|
2850
2924
|
map = _upb_Map_New(arena, key_size, val_size);
|
2851
2925
|
// Check again due to: https://godbolt.org/z/7WfaoKG1r
|
2852
2926
|
UPB_PRIVATE(_upb_MiniTableField_CheckIsMap)(field);
|
2853
|
-
|
2927
|
+
upb_Message_SetBaseField(msg, field, &map);
|
2854
2928
|
}
|
2855
2929
|
return map;
|
2856
2930
|
}
|
@@ -2917,12 +2991,6 @@ UPB_API_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
|
|
2917
2991
|
UPB_API bool upb_Map_Delete(upb_Map* map, upb_MessageValue key,
|
2918
2992
|
upb_MessageValue* val);
|
2919
2993
|
|
2920
|
-
// (DEPRECATED and going away soon. Do not use.)
|
2921
|
-
UPB_INLINE bool upb_Map_Delete2(upb_Map* map, upb_MessageValue key,
|
2922
|
-
upb_MessageValue* val) {
|
2923
|
-
return upb_Map_Delete(map, key, val);
|
2924
|
-
}
|
2925
|
-
|
2926
2994
|
// Map iteration:
|
2927
2995
|
//
|
2928
2996
|
// size_t iter = kUpb_Map_Begin;
|
@@ -2931,7 +2999,7 @@ UPB_INLINE bool upb_Map_Delete2(upb_Map* map, upb_MessageValue key,
|
|
2931
2999
|
// ...
|
2932
3000
|
// }
|
2933
3001
|
|
2934
|
-
#define kUpb_Map_Begin ((size_t)-1)
|
3002
|
+
#define kUpb_Map_Begin ((size_t) - 1)
|
2935
3003
|
|
2936
3004
|
// Advances to the next entry. Returns false if no more entries are present.
|
2937
3005
|
// Otherwise returns true and populates both *key and *value.
|
@@ -2966,6 +3034,14 @@ UPB_API bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
|
|
2966
3034
|
UPB_API upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
|
2967
3035
|
UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
|
2968
3036
|
|
3037
|
+
// Mark a map and all of its descendents as frozen/immutable.
|
3038
|
+
// If the map values are messages then |m| must point to the minitable for
|
3039
|
+
// those messages. Otherwise |m| must be NULL.
|
3040
|
+
UPB_API void upb_Map_Freeze(upb_Map* map, const upb_MiniTable* m);
|
3041
|
+
|
3042
|
+
// Returns whether a map has been frozen.
|
3043
|
+
UPB_API_INLINE bool upb_Map_IsFrozen(const upb_Map* map);
|
3044
|
+
|
2969
3045
|
#ifdef __cplusplus
|
2970
3046
|
} /* extern "C" */
|
2971
3047
|
#endif
|
@@ -2991,7 +3067,6 @@ UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
|
|
2991
3067
|
|
2992
3068
|
// Must be last.
|
2993
3069
|
|
2994
|
-
typedef struct upb_Extension upb_Extension;
|
2995
3070
|
typedef struct upb_Message upb_Message;
|
2996
3071
|
|
2997
3072
|
#ifdef __cplusplus
|
@@ -3010,6 +3085,24 @@ void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
|
|
3010
3085
|
// Returns the number of extensions present in this message.
|
3011
3086
|
size_t upb_Message_ExtensionCount(const upb_Message* msg);
|
3012
3087
|
|
3088
|
+
// Mark a message and all of its descendents as frozen/immutable.
|
3089
|
+
UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
|
3090
|
+
|
3091
|
+
// Returns whether a message has been frozen.
|
3092
|
+
UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg);
|
3093
|
+
|
3094
|
+
#ifdef UPB_TRACING_ENABLED
|
3095
|
+
UPB_INLINE void upb_Message_SetNewMessageTraceHandler(
|
3096
|
+
void (*newMessageTraceHandler)(const upb_MiniTable* mini_table,
|
3097
|
+
const upb_Arena* arena)) {
|
3098
|
+
UPB_PRIVATE(upb_Message_SetNewMessageTraceHandler)(newMessageTraceHandler);
|
3099
|
+
}
|
3100
|
+
UPB_INLINE void upb_Message_LogNewMessage(const upb_MiniTable* mini_table,
|
3101
|
+
const upb_Arena* arena) {
|
3102
|
+
UPB_PRIVATE(upb_Message_LogNewMessage)(mini_table, arena);
|
3103
|
+
}
|
3104
|
+
#endif
|
3105
|
+
|
3013
3106
|
#ifdef __cplusplus
|
3014
3107
|
} /* extern "C" */
|
3015
3108
|
#endif
|
@@ -3037,14 +3130,10 @@ extern "C" {
|
|
3037
3130
|
// Users who enable unlinked sub-messages must use this to test whether a
|
3038
3131
|
// message is empty before accessing it. If a message is empty, it must be
|
3039
3132
|
// first promoted using the interfaces in message/promote.h.
|
3040
|
-
|
3041
|
-
return UPB_PRIVATE(_upb_TaggedMessagePtr_IsEmpty)(ptr);
|
3042
|
-
}
|
3133
|
+
UPB_API_INLINE bool upb_TaggedMessagePtr_IsEmpty(upb_TaggedMessagePtr ptr);
|
3043
3134
|
|
3044
|
-
|
3045
|
-
upb_TaggedMessagePtr ptr)
|
3046
|
-
return UPB_PRIVATE(_upb_TaggedMessagePtr_GetNonEmptyMessage)(ptr);
|
3047
|
-
}
|
3135
|
+
UPB_API_INLINE upb_Message* upb_TaggedMessagePtr_GetNonEmptyMessage(
|
3136
|
+
upb_TaggedMessagePtr ptr);
|
3048
3137
|
|
3049
3138
|
#ifdef __cplusplus
|
3050
3139
|
} /* extern "C" */
|
@@ -3068,26 +3157,18 @@ extern "C" {
|
|
3068
3157
|
// Constructors
|
3069
3158
|
|
3070
3159
|
UPB_API_INLINE upb_MiniTableSub
|
3071
|
-
upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum)
|
3072
|
-
return UPB_PRIVATE(_upb_MiniTableSub_FromEnum)(subenum);
|
3073
|
-
}
|
3160
|
+
upb_MiniTableSub_FromEnum(const upb_MiniTableEnum* subenum);
|
3074
3161
|
|
3075
3162
|
UPB_API_INLINE upb_MiniTableSub
|
3076
|
-
upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg)
|
3077
|
-
return UPB_PRIVATE(_upb_MiniTableSub_FromMessage)(submsg);
|
3078
|
-
}
|
3163
|
+
upb_MiniTableSub_FromMessage(const upb_MiniTable* submsg);
|
3079
3164
|
|
3080
3165
|
// Getters
|
3081
3166
|
|
3082
3167
|
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableSub_Enum(
|
3083
|
-
upb_MiniTableSub sub)
|
3084
|
-
return UPB_PRIVATE(_upb_MiniTableSub_Enum)(sub);
|
3085
|
-
}
|
3168
|
+
upb_MiniTableSub sub);
|
3086
3169
|
|
3087
3170
|
UPB_API_INLINE const upb_MiniTable* upb_MiniTableSub_Message(
|
3088
|
-
upb_MiniTableSub sub)
|
3089
|
-
return UPB_PRIVATE(_upb_MiniTableSub_Message)(sub);
|
3090
|
-
}
|
3171
|
+
upb_MiniTableSub sub);
|
3091
3172
|
|
3092
3173
|
#ifdef __cplusplus
|
3093
3174
|
} /* extern "C" */
|
@@ -3108,30 +3189,27 @@ extern "C" {
|
|
3108
3189
|
// Functions ending in Extension() take a (upb_MiniTableExtension*) argument
|
3109
3190
|
// and work only on extensions.
|
3110
3191
|
|
3111
|
-
UPB_API_INLINE void upb_Message_Clear(upb_Message* msg,
|
3112
|
-
const upb_MiniTable* m) {
|
3113
|
-
UPB_PRIVATE(_upb_Message_Clear)(msg, m);
|
3114
|
-
}
|
3192
|
+
UPB_API_INLINE void upb_Message_Clear(upb_Message* msg, const upb_MiniTable* m);
|
3115
3193
|
|
3116
3194
|
UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
|
3117
|
-
const upb_MiniTableField* f)
|
3118
|
-
UPB_PRIVATE(_upb_Message_ClearBaseField)(msg, f);
|
3119
|
-
}
|
3195
|
+
const upb_MiniTableField* f);
|
3120
3196
|
|
3121
|
-
UPB_API_INLINE void upb_Message_ClearExtension(
|
3122
|
-
|
3123
|
-
UPB_PRIVATE(_upb_Message_ClearExtension)(msg, e);
|
3124
|
-
}
|
3197
|
+
UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
|
3198
|
+
const upb_MiniTableExtension* e);
|
3125
3199
|
|
3126
3200
|
UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
|
3127
|
-
const upb_MiniTableField* f)
|
3128
|
-
return UPB_PRIVATE(_upb_Message_HasBaseField)(msg, f);
|
3129
|
-
}
|
3201
|
+
const upb_MiniTableField* f);
|
3130
3202
|
|
3131
3203
|
UPB_API_INLINE bool upb_Message_HasExtension(const upb_Message* msg,
|
3132
|
-
const upb_MiniTableExtension* e)
|
3133
|
-
|
3134
|
-
|
3204
|
+
const upb_MiniTableExtension* e);
|
3205
|
+
|
3206
|
+
UPB_API_INLINE void upb_Message_SetBaseField(upb_Message* msg,
|
3207
|
+
const upb_MiniTableField* f,
|
3208
|
+
const void* val);
|
3209
|
+
|
3210
|
+
UPB_API_INLINE bool upb_Message_SetExtension(upb_Message* msg,
|
3211
|
+
const upb_MiniTableExtension* e,
|
3212
|
+
const void* val, upb_Arena* a);
|
3135
3213
|
|
3136
3214
|
UPB_API_INLINE uint32_t upb_Message_WhichOneofFieldNumber(
|
3137
3215
|
const upb_Message* message, const upb_MiniTableField* oneof_field) {
|
@@ -3157,14 +3235,17 @@ upb_Message_GetField(const upb_Message* msg, const upb_MiniTableField* field,
|
|
3157
3235
|
return ret;
|
3158
3236
|
}
|
3159
3237
|
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3238
|
+
// Sets the value of the given field in the given msg. The return value is true
|
3239
|
+
// if the operation completed successfully, or false if memory allocation
|
3240
|
+
// failed.
|
3241
|
+
UPB_INLINE bool UPB_PRIVATE(_upb_Message_SetField)(
|
3242
|
+
upb_Message* msg, const upb_MiniTableField* field, upb_MessageValue val,
|
3243
|
+
upb_Arena* a) {
|
3163
3244
|
if (upb_MiniTableField_IsExtension(field)) {
|
3164
3245
|
const upb_MiniTableExtension* ext = (const upb_MiniTableExtension*)field;
|
3165
|
-
return
|
3246
|
+
return upb_Message_SetExtension(msg, ext, &val, a);
|
3166
3247
|
} else {
|
3167
|
-
|
3248
|
+
upb_Message_SetBaseField(msg, field, &val);
|
3168
3249
|
return true;
|
3169
3250
|
}
|
3170
3251
|
}
|
@@ -3190,7 +3271,7 @@ UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
|
|
3190
3271
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3191
3272
|
upb_MessageValue val;
|
3192
3273
|
val.bool_val = value;
|
3193
|
-
return
|
3274
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3194
3275
|
}
|
3195
3276
|
|
3196
3277
|
UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
|
@@ -3217,7 +3298,7 @@ UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
|
|
3217
3298
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3218
3299
|
upb_MessageValue val;
|
3219
3300
|
val.int32_val = value;
|
3220
|
-
return
|
3301
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3221
3302
|
}
|
3222
3303
|
|
3223
3304
|
UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
|
@@ -3242,7 +3323,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
|
|
3242
3323
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3243
3324
|
upb_MessageValue val;
|
3244
3325
|
val.uint32_val = value;
|
3245
|
-
return
|
3326
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3246
3327
|
}
|
3247
3328
|
|
3248
3329
|
UPB_API_INLINE void upb_Message_SetClosedEnum(
|
@@ -3254,7 +3335,7 @@ UPB_API_INLINE void upb_Message_SetClosedEnum(
|
|
3254
3335
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3255
3336
|
UPB_ASSERT(upb_MiniTableEnum_CheckValue(
|
3256
3337
|
upb_MiniTable_GetSubEnumTable(msg_mini_table, field), value));
|
3257
|
-
|
3338
|
+
upb_Message_SetBaseField(msg, field, &value);
|
3258
3339
|
}
|
3259
3340
|
|
3260
3341
|
UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
|
@@ -3279,7 +3360,7 @@ UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
|
|
3279
3360
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3280
3361
|
upb_MessageValue val;
|
3281
3362
|
val.int64_val = value;
|
3282
|
-
return
|
3363
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3283
3364
|
}
|
3284
3365
|
|
3285
3366
|
UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
|
@@ -3304,7 +3385,7 @@ UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
|
|
3304
3385
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3305
3386
|
upb_MessageValue val;
|
3306
3387
|
val.uint64_val = value;
|
3307
|
-
return
|
3388
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3308
3389
|
}
|
3309
3390
|
|
3310
3391
|
UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
|
@@ -3329,7 +3410,7 @@ UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
|
|
3329
3410
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3330
3411
|
upb_MessageValue val;
|
3331
3412
|
val.float_val = value;
|
3332
|
-
return
|
3413
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3333
3414
|
}
|
3334
3415
|
|
3335
3416
|
UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
|
@@ -3354,7 +3435,7 @@ UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
|
|
3354
3435
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3355
3436
|
upb_MessageValue val;
|
3356
3437
|
val.double_val = value;
|
3357
|
-
return
|
3438
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3358
3439
|
}
|
3359
3440
|
|
3360
3441
|
UPB_API_INLINE upb_StringView
|
@@ -3371,6 +3452,10 @@ upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
|
|
3371
3452
|
return upb_Message_GetField(msg, field, def).str_val;
|
3372
3453
|
}
|
3373
3454
|
|
3455
|
+
// Sets the value of a `string` or `bytes` field. The bytes of the value are not
|
3456
|
+
// copied, so it is the caller's responsibility to ensure that they remain valid
|
3457
|
+
// for the lifetime of `msg`. That might be done by copying them into the given
|
3458
|
+
// arena, or by fusing that arena with the arena the bytes live in, for example.
|
3374
3459
|
UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
|
3375
3460
|
const upb_MiniTableField* field,
|
3376
3461
|
upb_StringView value, upb_Arena* a) {
|
@@ -3381,7 +3466,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
|
|
3381
3466
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3382
3467
|
upb_MessageValue val;
|
3383
3468
|
val.str_val = value;
|
3384
|
-
return
|
3469
|
+
return UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, a);
|
3385
3470
|
}
|
3386
3471
|
|
3387
3472
|
UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
|
@@ -3397,13 +3482,17 @@ UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
|
|
3397
3482
|
}
|
3398
3483
|
|
3399
3484
|
UPB_API_INLINE const upb_Message* upb_Message_GetMessage(
|
3400
|
-
const upb_Message* msg, const upb_MiniTableField* field
|
3401
|
-
upb_Message* default_val) {
|
3485
|
+
const upb_Message* msg, const upb_MiniTableField* field) {
|
3402
3486
|
upb_TaggedMessagePtr tagged =
|
3403
|
-
upb_Message_GetTaggedMessagePtr(msg, field,
|
3487
|
+
upb_Message_GetTaggedMessagePtr(msg, field, NULL);
|
3404
3488
|
return upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
|
3405
3489
|
}
|
3406
3490
|
|
3491
|
+
UPB_API_INLINE upb_Message* upb_Message_GetMutableMessage(
|
3492
|
+
upb_Message* msg, const upb_MiniTableField* field) {
|
3493
|
+
return (upb_Message*)upb_Message_GetMessage(msg, field);
|
3494
|
+
}
|
3495
|
+
|
3407
3496
|
// For internal use only; users cannot set tagged messages because only the
|
3408
3497
|
// parser and the message copier are allowed to directly create an empty
|
3409
3498
|
// message.
|
@@ -3416,9 +3505,12 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
|
|
3416
3505
|
UPB_ASSUME(upb_MiniTableField_IsScalar(field));
|
3417
3506
|
UPB_ASSERT(upb_MiniTableSub_Message(
|
3418
3507
|
mini_table->UPB_PRIVATE(subs)[field->UPB_PRIVATE(submsg_index)]));
|
3419
|
-
|
3508
|
+
upb_Message_SetBaseField(msg, field, &sub_message);
|
3420
3509
|
}
|
3421
3510
|
|
3511
|
+
// Sets the value of a message-typed field. The `mini_table` and `field`
|
3512
|
+
// parameters belong to `msg`, not `sub_message`. The mini_tables of `msg` and
|
3513
|
+
// `sub_message` must have been linked for this to work correctly.
|
3422
3514
|
UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
|
3423
3515
|
const upb_MiniTable* mini_table,
|
3424
3516
|
const upb_MiniTableField* field,
|
@@ -3473,7 +3565,7 @@ UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
|
|
3473
3565
|
UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(field);
|
3474
3566
|
upb_MessageValue val;
|
3475
3567
|
val.array_val = array;
|
3476
|
-
|
3568
|
+
UPB_PRIVATE(_upb_Message_SetField)(msg, field, val, arena);
|
3477
3569
|
}
|
3478
3570
|
return array;
|
3479
3571
|
}
|
@@ -3509,9 +3601,9 @@ UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap(
|
|
3509
3601
|
const upb_MiniTableField* field, upb_Arena* arena) {
|
3510
3602
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
|
3511
3603
|
const upb_MiniTableField* map_entry_key_field =
|
3512
|
-
&map_entry_mini_table->
|
3604
|
+
&map_entry_mini_table->UPB_ONLYBITS(fields)[0];
|
3513
3605
|
const upb_MiniTableField* map_entry_value_field =
|
3514
|
-
&map_entry_mini_table->
|
3606
|
+
&map_entry_mini_table->UPB_ONLYBITS(fields)[1];
|
3515
3607
|
return _upb_Message_GetOrCreateMutableMap(
|
3516
3608
|
msg, field,
|
3517
3609
|
_upb_Map_CTypeSize(upb_MiniTableField_CType(map_entry_key_field)),
|
@@ -3587,6 +3679,7 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
|
|
3587
3679
|
// Export the newer headers, for legacy users. New users should include the
|
3588
3680
|
// more specific headers directly.
|
3589
3681
|
// IWYU pragma: begin_exports
|
3682
|
+
|
3590
3683
|
#ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
|
3591
3684
|
#define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
|
3592
3685
|
|
@@ -3597,20 +3690,11 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
|
|
3597
3690
|
extern "C" {
|
3598
3691
|
#endif
|
3599
3692
|
|
3600
|
-
// Builds a upb_MiniTableEnum from an enum
|
3601
|
-
// must be for an enum, not a message.
|
3602
|
-
UPB_API upb_MiniTableEnum*
|
3603
|
-
|
3604
|
-
|
3605
|
-
upb_Status* status);
|
3606
|
-
|
3607
|
-
// TODO: Deprecated name; update callers.
|
3608
|
-
UPB_API_INLINE upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data,
|
3609
|
-
size_t len,
|
3610
|
-
upb_Arena* arena,
|
3611
|
-
upb_Status* status) {
|
3612
|
-
return upb_MiniDescriptor_BuildEnum(data, len, arena, status);
|
3613
|
-
}
|
3693
|
+
// Builds a upb_MiniTableEnum from an enum mini descriptor.
|
3694
|
+
// The mini descriptor must be for an enum, not a message.
|
3695
|
+
UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len,
|
3696
|
+
upb_Arena* arena,
|
3697
|
+
upb_Status* status);
|
3614
3698
|
|
3615
3699
|
#ifdef __cplusplus
|
3616
3700
|
} /* extern "C" */
|
@@ -3878,34 +3962,34 @@ struct upb_MiniTableFile {
|
|
3878
3962
|
extern "C" {
|
3879
3963
|
#endif
|
3880
3964
|
|
3881
|
-
|
3965
|
+
UPB_API_INLINE int upb_MiniTableFile_EnumCount(
|
3882
3966
|
const struct upb_MiniTableFile* f) {
|
3883
3967
|
return f->UPB_PRIVATE(enum_count);
|
3884
3968
|
}
|
3885
3969
|
|
3886
|
-
|
3970
|
+
UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
|
3887
3971
|
const struct upb_MiniTableFile* f) {
|
3888
3972
|
return f->UPB_PRIVATE(ext_count);
|
3889
3973
|
}
|
3890
3974
|
|
3891
|
-
|
3975
|
+
UPB_API_INLINE int upb_MiniTableFile_MessageCount(
|
3892
3976
|
const struct upb_MiniTableFile* f) {
|
3893
3977
|
return f->UPB_PRIVATE(msg_count);
|
3894
3978
|
}
|
3895
3979
|
|
3896
|
-
|
3980
|
+
UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableFile_Enum(
|
3897
3981
|
const struct upb_MiniTableFile* f, int i) {
|
3898
3982
|
UPB_ASSERT(i < f->UPB_PRIVATE(enum_count));
|
3899
3983
|
return f->UPB_PRIVATE(enums)[i];
|
3900
3984
|
}
|
3901
3985
|
|
3902
|
-
|
3903
|
-
|
3986
|
+
UPB_API_INLINE const struct upb_MiniTableExtension* upb_MiniTableFile_Extension(
|
3987
|
+
const struct upb_MiniTableFile* f, int i) {
|
3904
3988
|
UPB_ASSERT(i < f->UPB_PRIVATE(ext_count));
|
3905
3989
|
return f->UPB_PRIVATE(exts)[i];
|
3906
3990
|
}
|
3907
3991
|
|
3908
|
-
|
3992
|
+
UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableFile_Message(
|
3909
3993
|
const struct upb_MiniTableFile* f, int i) {
|
3910
3994
|
UPB_ASSERT(i < f->UPB_PRIVATE(msg_count));
|
3911
3995
|
return f->UPB_PRIVATE(msgs)[i];
|
@@ -3927,32 +4011,19 @@ extern "C" {
|
|
3927
4011
|
#endif
|
3928
4012
|
|
3929
4013
|
UPB_API_INLINE const upb_MiniTableEnum* upb_MiniTableFile_Enum(
|
3930
|
-
const upb_MiniTableFile* f, int i)
|
3931
|
-
return UPB_PRIVATE(_upb_MiniTableFile_Enum)(f, i);
|
3932
|
-
}
|
4014
|
+
const upb_MiniTableFile* f, int i);
|
3933
4015
|
|
3934
|
-
UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f)
|
3935
|
-
return UPB_PRIVATE(_upb_MiniTableFile_EnumCount)(f);
|
3936
|
-
}
|
4016
|
+
UPB_API_INLINE int upb_MiniTableFile_EnumCount(const upb_MiniTableFile* f);
|
3937
4017
|
|
3938
4018
|
UPB_API_INLINE const upb_MiniTableExtension* upb_MiniTableFile_Extension(
|
3939
|
-
const upb_MiniTableFile* f, int i)
|
3940
|
-
return UPB_PRIVATE(_upb_MiniTableFile_Extension)(f, i);
|
3941
|
-
}
|
4019
|
+
const upb_MiniTableFile* f, int i);
|
3942
4020
|
|
3943
|
-
UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(
|
3944
|
-
const upb_MiniTableFile* f) {
|
3945
|
-
return UPB_PRIVATE(_upb_MiniTableFile_ExtensionCount)(f);
|
3946
|
-
}
|
4021
|
+
UPB_API_INLINE int upb_MiniTableFile_ExtensionCount(const upb_MiniTableFile* f);
|
3947
4022
|
|
3948
4023
|
UPB_API_INLINE const upb_MiniTable* upb_MiniTableFile_Message(
|
3949
|
-
const upb_MiniTableFile* f, int i)
|
3950
|
-
return UPB_PRIVATE(_upb_MiniTableFile_Message)(f, i);
|
3951
|
-
}
|
4024
|
+
const upb_MiniTableFile* f, int i);
|
3952
4025
|
|
3953
|
-
UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f)
|
3954
|
-
return UPB_PRIVATE(_upb_MiniTableFile_MessageCount)(f);
|
3955
|
-
}
|
4026
|
+
UPB_API_INLINE int upb_MiniTableFile_MessageCount(const upb_MiniTableFile* f);
|
3956
4027
|
|
3957
4028
|
#ifdef __cplusplus
|
3958
4029
|
} /* extern "C" */
|
@@ -4061,6 +4132,7 @@ UPB_INLINE int upb_Decode_LimitDepth(uint32_t decode_options, uint32_t limit) {
|
|
4061
4132
|
return upb_DecodeOptions_MaxDepth(max_depth) | (decode_options & 0xffff);
|
4062
4133
|
}
|
4063
4134
|
|
4135
|
+
// LINT.IfChange
|
4064
4136
|
typedef enum {
|
4065
4137
|
kUpb_DecodeStatus_Ok = 0,
|
4066
4138
|
kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt
|
@@ -4078,12 +4150,21 @@ typedef enum {
|
|
4078
4150
|
// of options.
|
4079
4151
|
kUpb_DecodeStatus_UnlinkedSubMessage = 6,
|
4080
4152
|
} upb_DecodeStatus;
|
4153
|
+
// LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:decode_status)
|
4081
4154
|
|
4082
4155
|
UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size,
|
4083
|
-
upb_Message* msg, const upb_MiniTable*
|
4156
|
+
upb_Message* msg, const upb_MiniTable* mt,
|
4084
4157
|
const upb_ExtensionRegistry* extreg,
|
4085
4158
|
int options, upb_Arena* arena);
|
4086
4159
|
|
4160
|
+
// Same as upb_Decode but with a varint-encoded length prepended.
|
4161
|
+
// On success 'num_bytes_read' will be set to the how many bytes were read,
|
4162
|
+
// on failure the contents of num_bytes_read is undefined.
|
4163
|
+
UPB_API upb_DecodeStatus upb_DecodeLengthPrefixed(
|
4164
|
+
const char* buf, size_t size, upb_Message* msg, size_t* num_bytes_read,
|
4165
|
+
const upb_MiniTable* mt, const upb_ExtensionRegistry* extreg, int options,
|
4166
|
+
upb_Arena* arena);
|
4167
|
+
|
4087
4168
|
#ifdef __cplusplus
|
4088
4169
|
} /* extern "C" */
|
4089
4170
|
#endif
|
@@ -4115,13 +4196,14 @@ enum {
|
|
4115
4196
|
* memory during encode. */
|
4116
4197
|
kUpb_EncodeOption_Deterministic = 1,
|
4117
4198
|
|
4118
|
-
// When set, unknown fields are not
|
4199
|
+
// When set, unknown fields are not encoded.
|
4119
4200
|
kUpb_EncodeOption_SkipUnknown = 2,
|
4120
4201
|
|
4121
4202
|
// When set, the encode will fail if any required fields are missing.
|
4122
4203
|
kUpb_EncodeOption_CheckRequired = 4,
|
4123
4204
|
};
|
4124
4205
|
|
4206
|
+
// LINT.IfChange
|
4125
4207
|
typedef enum {
|
4126
4208
|
kUpb_EncodeStatus_Ok = 0,
|
4127
4209
|
kUpb_EncodeStatus_OutOfMemory = 1, // Arena alloc failed
|
@@ -4130,6 +4212,7 @@ typedef enum {
|
|
4130
4212
|
// kUpb_EncodeOption_CheckRequired failed but the parse otherwise succeeded.
|
4131
4213
|
kUpb_EncodeStatus_MissingRequired = 3,
|
4132
4214
|
} upb_EncodeStatus;
|
4215
|
+
// LINT.ThenChange(//depot/google3/third_party/protobuf/rust/upb.rs:encode_status)
|
4133
4216
|
|
4134
4217
|
UPB_INLINE uint32_t upb_EncodeOptions_MaxDepth(uint16_t depth) {
|
4135
4218
|
return (uint32_t)depth << 16;
|
@@ -4150,6 +4233,12 @@ UPB_API upb_EncodeStatus upb_Encode(const upb_Message* msg,
|
|
4150
4233
|
const upb_MiniTable* l, int options,
|
4151
4234
|
upb_Arena* arena, char** buf, size_t* size);
|
4152
4235
|
|
4236
|
+
// Encodes the message prepended by a varint of the serialized length.
|
4237
|
+
UPB_API upb_EncodeStatus upb_EncodeLengthPrefixed(const upb_Message* msg,
|
4238
|
+
const upb_MiniTable* l,
|
4239
|
+
int options, upb_Arena* arena,
|
4240
|
+
char** buf, size_t* size);
|
4241
|
+
|
4153
4242
|
#ifdef __cplusplus
|
4154
4243
|
} /* extern "C" */
|
4155
4244
|
#endif
|
@@ -4333,6 +4422,7 @@ extern const upb_MiniTable google__protobuf__FileOptions_msg_init;
|
|
4333
4422
|
extern const upb_MiniTable google__protobuf__MessageOptions_msg_init;
|
4334
4423
|
extern const upb_MiniTable google__protobuf__FieldOptions_msg_init;
|
4335
4424
|
extern const upb_MiniTable google__protobuf__FieldOptions__EditionDefault_msg_init;
|
4425
|
+
extern const upb_MiniTable google__protobuf__FieldOptions__FeatureSupport_msg_init;
|
4336
4426
|
extern const upb_MiniTable google__protobuf__OneofOptions_msg_init;
|
4337
4427
|
extern const upb_MiniTable google__protobuf__EnumOptions_msg_init;
|
4338
4428
|
extern const upb_MiniTable google__protobuf__EnumValueOptions_msg_init;
|
@@ -4404,8 +4494,8 @@ typedef struct {
|
|
4404
4494
|
const char* end; // Can read up to SlopBytes bytes beyond this.
|
4405
4495
|
const char* limit_ptr; // For bounds checks, = end + UPB_MIN(limit, 0)
|
4406
4496
|
uintptr_t aliasing;
|
4407
|
-
int limit;
|
4408
|
-
bool error;
|
4497
|
+
int limit; // Submessage limit relative to end
|
4498
|
+
bool error; // To distinguish between EOF and error.
|
4409
4499
|
char patch[kUpb_EpsCopyInputStream_SlopBytes * 2];
|
4410
4500
|
} upb_EpsCopyInputStream;
|
4411
4501
|
|
@@ -4742,7 +4832,7 @@ typedef const char* upb_EpsCopyInputStream_ParseDelimitedFunc(
|
|
4742
4832
|
// fits within this buffer, calls `func` with `ctx` as a parameter, where the
|
4743
4833
|
// pushing and popping of limits is handled automatically and with lower cost
|
4744
4834
|
// than the normal PushLimit()/PopLimit() sequence.
|
4745
|
-
|
4835
|
+
UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast(
|
4746
4836
|
upb_EpsCopyInputStream* e, const char** ptr, int len,
|
4747
4837
|
upb_EpsCopyInputStream_ParseDelimitedFunc* func, void* ctx) {
|
4748
4838
|
if (!upb_EpsCopyInputStream_CheckSubMessageSizeAvailable(e, *ptr, len)) {
|
@@ -4837,6 +4927,7 @@ typedef struct google_protobuf_FileOptions { upb_Message UPB_PRIVATE(base); } go
|
|
4837
4927
|
typedef struct google_protobuf_MessageOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_MessageOptions;
|
4838
4928
|
typedef struct google_protobuf_FieldOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions;
|
4839
4929
|
typedef struct google_protobuf_FieldOptions_EditionDefault { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_EditionDefault;
|
4930
|
+
typedef struct google_protobuf_FieldOptions_FeatureSupport { upb_Message UPB_PRIVATE(base); } google_protobuf_FieldOptions_FeatureSupport;
|
4840
4931
|
typedef struct google_protobuf_OneofOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_OneofOptions;
|
4841
4932
|
typedef struct google_protobuf_EnumOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumOptions;
|
4842
4933
|
typedef struct google_protobuf_EnumValueOptions { upb_Message UPB_PRIVATE(base); } google_protobuf_EnumValueOptions;
|
@@ -4856,6 +4947,7 @@ typedef enum {
|
|
4856
4947
|
google_protobuf_EDITION_UNKNOWN = 0,
|
4857
4948
|
google_protobuf_EDITION_1_TEST_ONLY = 1,
|
4858
4949
|
google_protobuf_EDITION_2_TEST_ONLY = 2,
|
4950
|
+
google_protobuf_EDITION_LEGACY = 900,
|
4859
4951
|
google_protobuf_EDITION_PROTO2 = 998,
|
4860
4952
|
google_protobuf_EDITION_PROTO3 = 999,
|
4861
4953
|
google_protobuf_EDITION_2023 = 1000,
|
@@ -5445,11 +5537,11 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_has_edition(const google_pro
|
|
5445
5537
|
|
5446
5538
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
|
5447
5539
|
const upb_MiniTableField field = {1, UPB_SIZE(52, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
5448
|
-
|
5540
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5449
5541
|
}
|
5450
5542
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
|
5451
5543
|
const upb_MiniTableField field = {2, UPB_SIZE(60, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
5452
|
-
|
5544
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5453
5545
|
}
|
5454
5546
|
UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) {
|
5455
5547
|
upb_MiniTableField field = {3, UPB_SIZE(12, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -5601,7 +5693,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
|
|
5601
5693
|
}
|
5602
5694
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
|
5603
5695
|
const upb_MiniTableField field = {8, UPB_SIZE(32, 88), 66, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
5604
|
-
|
5696
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5605
5697
|
}
|
5606
5698
|
UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
|
5607
5699
|
struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
|
@@ -5613,7 +5705,7 @@ UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorPro
|
|
5613
5705
|
}
|
5614
5706
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
|
5615
5707
|
const upb_MiniTableField field = {9, UPB_SIZE(36, 96), 67, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
5616
|
-
|
5708
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5617
5709
|
}
|
5618
5710
|
UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
|
5619
5711
|
struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
|
@@ -5681,11 +5773,11 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
|
|
5681
5773
|
}
|
5682
5774
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
|
5683
5775
|
const upb_MiniTableField field = {12, UPB_SIZE(68, 120), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
5684
|
-
|
5776
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5685
5777
|
}
|
5686
5778
|
UPB_INLINE void google_protobuf_FileDescriptorProto_set_edition(google_protobuf_FileDescriptorProto *msg, int32_t value) {
|
5687
5779
|
const upb_MiniTableField field = {14, UPB_SIZE(48, 12), 69, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
5688
|
-
|
5780
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
5689
5781
|
}
|
5690
5782
|
|
5691
5783
|
/* google.protobuf.DescriptorProto */
|
@@ -6015,7 +6107,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb
|
|
6015
6107
|
|
6016
6108
|
UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
|
6017
6109
|
const upb_MiniTableField field = {1, UPB_SIZE(48, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
6018
|
-
|
6110
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6019
6111
|
}
|
6020
6112
|
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* size) {
|
6021
6113
|
upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -6169,7 +6261,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
|
|
6169
6261
|
}
|
6170
6262
|
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
|
6171
6263
|
const upb_MiniTableField field = {7, UPB_SIZE(32, 72), 65, 5, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
6172
|
-
|
6264
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6173
6265
|
}
|
6174
6266
|
UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
|
6175
6267
|
struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
|
@@ -6355,15 +6447,15 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const
|
|
6355
6447
|
|
6356
6448
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
|
6357
6449
|
const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6358
|
-
|
6450
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6359
6451
|
}
|
6360
6452
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
|
6361
6453
|
const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6362
|
-
|
6454
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6363
6455
|
}
|
6364
6456
|
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
|
6365
6457
|
const upb_MiniTableField field = {3, UPB_SIZE(20, 24), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
6366
|
-
|
6458
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6367
6459
|
}
|
6368
6460
|
UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) {
|
6369
6461
|
struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
|
@@ -6445,11 +6537,11 @@ UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const goog
|
|
6445
6537
|
|
6446
6538
|
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
|
6447
6539
|
const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6448
|
-
|
6540
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6449
6541
|
}
|
6450
6542
|
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
|
6451
6543
|
const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6452
|
-
|
6544
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6453
6545
|
}
|
6454
6546
|
|
6455
6547
|
/* google.protobuf.ExtensionRangeOptions */
|
@@ -6617,11 +6709,11 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot
|
|
6617
6709
|
}
|
6618
6710
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) {
|
6619
6711
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 64, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6620
|
-
|
6712
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6621
6713
|
}
|
6622
6714
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_features(google_protobuf_ExtensionRangeOptions *msg, google_protobuf_FeatureSet* value) {
|
6623
6715
|
const upb_MiniTableField field = {50, UPB_SIZE(20, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
6624
|
-
|
6716
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6625
6717
|
}
|
6626
6718
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ExtensionRangeOptions_mutable_features(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
|
6627
6719
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ExtensionRangeOptions_features(msg);
|
@@ -6781,23 +6873,23 @@ UPB_INLINE bool google_protobuf_ExtensionRangeOptions_Declaration_has_repeated(c
|
|
6781
6873
|
|
6782
6874
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_number(google_protobuf_ExtensionRangeOptions_Declaration *msg, int32_t value) {
|
6783
6875
|
const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
6784
|
-
|
6876
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6785
6877
|
}
|
6786
6878
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_full_name(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
|
6787
6879
|
const upb_MiniTableField field = {2, UPB_SIZE(20, 24), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
6788
|
-
|
6880
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6789
6881
|
}
|
6790
6882
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_type(google_protobuf_ExtensionRangeOptions_Declaration *msg, upb_StringView value) {
|
6791
6883
|
const upb_MiniTableField field = {3, UPB_SIZE(28, 40), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
6792
|
-
|
6884
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6793
6885
|
}
|
6794
6886
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_reserved(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
|
6795
6887
|
const upb_MiniTableField field = {5, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
6796
|
-
|
6888
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6797
6889
|
}
|
6798
6890
|
UPB_INLINE void google_protobuf_ExtensionRangeOptions_Declaration_set_repeated(google_protobuf_ExtensionRangeOptions_Declaration *msg, bool value) {
|
6799
6891
|
const upb_MiniTableField field = {6, 17, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
6800
|
-
|
6892
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
6801
6893
|
}
|
6802
6894
|
|
6803
6895
|
/* google.protobuf.FieldDescriptorProto */
|
@@ -7015,35 +7107,35 @@ UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const g
|
|
7015
7107
|
|
7016
7108
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
|
7017
7109
|
const upb_MiniTableField field = {1, UPB_SIZE(36, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7018
|
-
|
7110
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7019
7111
|
}
|
7020
7112
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
|
7021
7113
|
const upb_MiniTableField field = {2, UPB_SIZE(44, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7022
|
-
|
7114
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7023
7115
|
}
|
7024
7116
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
7025
7117
|
const upb_MiniTableField field = {3, 12, 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7026
|
-
|
7118
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7027
7119
|
}
|
7028
7120
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
7029
7121
|
const upb_MiniTableField field = {4, 16, 67, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7030
|
-
|
7122
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7031
7123
|
}
|
7032
7124
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
7033
7125
|
const upb_MiniTableField field = {5, 20, 68, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7034
|
-
|
7126
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7035
7127
|
}
|
7036
7128
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
|
7037
7129
|
const upb_MiniTableField field = {6, UPB_SIZE(52, 64), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7038
|
-
|
7130
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7039
7131
|
}
|
7040
7132
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
|
7041
7133
|
const upb_MiniTableField field = {7, UPB_SIZE(60, 80), 70, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7042
|
-
|
7134
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7043
7135
|
}
|
7044
7136
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
|
7045
7137
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 96), 71, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7046
|
-
|
7138
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7047
7139
|
}
|
7048
7140
|
UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
|
7049
7141
|
struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
|
@@ -7055,15 +7147,15 @@ UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorP
|
|
7055
7147
|
}
|
7056
7148
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
|
7057
7149
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 24), 72, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7058
|
-
|
7150
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7059
7151
|
}
|
7060
7152
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
|
7061
7153
|
const upb_MiniTableField field = {10, UPB_SIZE(68, 104), 73, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7062
|
-
|
7154
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7063
7155
|
}
|
7064
7156
|
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
|
7065
7157
|
const upb_MiniTableField field = {17, UPB_SIZE(32, 28), 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
7066
|
-
|
7158
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7067
7159
|
}
|
7068
7160
|
|
7069
7161
|
/* google.protobuf.OneofDescriptorProto */
|
@@ -7137,11 +7229,11 @@ UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_pr
|
|
7137
7229
|
|
7138
7230
|
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
|
7139
7231
|
const upb_MiniTableField field = {1, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7140
|
-
|
7232
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7141
7233
|
}
|
7142
7234
|
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
|
7143
7235
|
const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7144
|
-
|
7236
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7145
7237
|
}
|
7146
7238
|
UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) {
|
7147
7239
|
struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
|
@@ -7319,7 +7411,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable
|
|
7319
7411
|
|
7320
7412
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
|
7321
7413
|
const upb_MiniTableField field = {1, UPB_SIZE(28, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7322
|
-
|
7414
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7323
7415
|
}
|
7324
7416
|
UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* size) {
|
7325
7417
|
upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -7353,7 +7445,7 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
|
|
7353
7445
|
}
|
7354
7446
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
|
7355
7447
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7356
|
-
|
7448
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7357
7449
|
}
|
7358
7450
|
UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
|
7359
7451
|
struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
|
@@ -7493,11 +7585,11 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(co
|
|
7493
7585
|
|
7494
7586
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
|
7495
7587
|
const upb_MiniTableField field = {1, 12, 64, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7496
|
-
|
7588
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7497
7589
|
}
|
7498
7590
|
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
|
7499
7591
|
const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7500
|
-
|
7592
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7501
7593
|
}
|
7502
7594
|
|
7503
7595
|
/* google.protobuf.EnumValueDescriptorProto */
|
@@ -7587,15 +7679,15 @@ UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const googl
|
|
7587
7679
|
|
7588
7680
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
|
7589
7681
|
const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7590
|
-
|
7682
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7591
7683
|
}
|
7592
7684
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
|
7593
7685
|
const upb_MiniTableField field = {2, 12, 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
7594
|
-
|
7686
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7595
7687
|
}
|
7596
7688
|
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
|
7597
7689
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 32), 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7598
|
-
|
7690
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7599
7691
|
}
|
7600
7692
|
UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) {
|
7601
7693
|
struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
|
@@ -7709,7 +7801,7 @@ UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_
|
|
7709
7801
|
|
7710
7802
|
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
|
7711
7803
|
const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7712
|
-
|
7804
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7713
7805
|
}
|
7714
7806
|
UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* size) {
|
7715
7807
|
upb_MiniTableField field = {2, UPB_SIZE(12, 32), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -7743,7 +7835,7 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
|
|
7743
7835
|
}
|
7744
7836
|
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
|
7745
7837
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 40), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7746
|
-
|
7838
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7747
7839
|
}
|
7748
7840
|
UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
|
7749
7841
|
struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
|
@@ -7889,19 +7981,19 @@ UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const
|
|
7889
7981
|
|
7890
7982
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
|
7891
7983
|
const upb_MiniTableField field = {1, UPB_SIZE(20, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7892
|
-
|
7984
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7893
7985
|
}
|
7894
7986
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
|
7895
7987
|
const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7896
|
-
|
7988
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7897
7989
|
}
|
7898
7990
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
|
7899
7991
|
const upb_MiniTableField field = {3, UPB_SIZE(36, 48), 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
7900
|
-
|
7992
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7901
7993
|
}
|
7902
7994
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
|
7903
7995
|
const upb_MiniTableField field = {4, UPB_SIZE(12, 64), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
7904
|
-
|
7996
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7905
7997
|
}
|
7906
7998
|
UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) {
|
7907
7999
|
struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
|
@@ -7913,11 +8005,11 @@ UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescripto
|
|
7913
8005
|
}
|
7914
8006
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
|
7915
8007
|
const upb_MiniTableField field = {5, UPB_SIZE(16, 9), 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
7916
|
-
|
8008
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7917
8009
|
}
|
7918
8010
|
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
|
7919
8011
|
const upb_MiniTableField field = {6, UPB_SIZE(17, 10), 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
7920
|
-
|
8012
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
7921
8013
|
}
|
7922
8014
|
|
7923
8015
|
/* google.protobuf.FileOptions */
|
@@ -8311,83 +8403,83 @@ UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_
|
|
8311
8403
|
|
8312
8404
|
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8313
8405
|
const upb_MiniTableField field = {1, UPB_SIZE(32, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8314
|
-
|
8406
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8315
8407
|
}
|
8316
8408
|
UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8317
8409
|
const upb_MiniTableField field = {8, 40, 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8318
|
-
|
8410
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8319
8411
|
}
|
8320
8412
|
UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
|
8321
8413
|
const upb_MiniTableField field = {9, 12, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8322
|
-
|
8414
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8323
8415
|
}
|
8324
8416
|
UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
|
8325
8417
|
const upb_MiniTableField field = {10, 16, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8326
|
-
|
8418
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8327
8419
|
}
|
8328
8420
|
UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8329
8421
|
const upb_MiniTableField field = {11, UPB_SIZE(48, 56), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8330
|
-
|
8422
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8331
8423
|
}
|
8332
8424
|
UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
8333
8425
|
const upb_MiniTableField field = {16, 17, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8334
|
-
|
8426
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8335
8427
|
}
|
8336
8428
|
UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
8337
8429
|
const upb_MiniTableField field = {17, 18, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8338
|
-
|
8430
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8339
8431
|
}
|
8340
8432
|
UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
|
8341
8433
|
const upb_MiniTableField field = {18, 19, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8342
|
-
|
8434
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8343
8435
|
}
|
8344
8436
|
UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
|
8345
8437
|
const upb_MiniTableField field = {20, 20, 72, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8346
|
-
|
8438
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8347
8439
|
}
|
8348
8440
|
UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
|
8349
8441
|
const upb_MiniTableField field = {23, 21, 73, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8350
|
-
|
8442
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8351
8443
|
}
|
8352
8444
|
UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
|
8353
8445
|
const upb_MiniTableField field = {27, 22, 74, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8354
|
-
|
8446
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8355
8447
|
}
|
8356
8448
|
UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
|
8357
8449
|
const upb_MiniTableField field = {31, 23, 75, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8358
|
-
|
8450
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8359
8451
|
}
|
8360
8452
|
UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8361
8453
|
const upb_MiniTableField field = {36, UPB_SIZE(56, 72), 76, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8362
|
-
|
8454
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8363
8455
|
}
|
8364
8456
|
UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8365
8457
|
const upb_MiniTableField field = {37, UPB_SIZE(64, 88), 77, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8366
|
-
|
8458
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8367
8459
|
}
|
8368
8460
|
UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8369
8461
|
const upb_MiniTableField field = {39, UPB_SIZE(72, 104), 78, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8370
|
-
|
8462
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8371
8463
|
}
|
8372
8464
|
UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8373
8465
|
const upb_MiniTableField field = {40, UPB_SIZE(80, 120), 79, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8374
|
-
|
8466
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8375
8467
|
}
|
8376
8468
|
UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8377
8469
|
const upb_MiniTableField field = {41, UPB_SIZE(88, 136), 80, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8378
|
-
|
8470
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8379
8471
|
}
|
8380
8472
|
UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8381
8473
|
const upb_MiniTableField field = {44, UPB_SIZE(96, 152), 81, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8382
|
-
|
8474
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8383
8475
|
}
|
8384
8476
|
UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
|
8385
8477
|
const upb_MiniTableField field = {45, UPB_SIZE(104, 168), 82, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
8386
|
-
|
8478
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8387
8479
|
}
|
8388
8480
|
UPB_INLINE void google_protobuf_FileOptions_set_features(google_protobuf_FileOptions *msg, google_protobuf_FeatureSet* value) {
|
8389
8481
|
const upb_MiniTableField field = {50, UPB_SIZE(24, 184), 83, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8390
|
-
|
8482
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8391
8483
|
}
|
8392
8484
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FileOptions_mutable_features(google_protobuf_FileOptions* msg, upb_Arena* arena) {
|
8393
8485
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FileOptions_features(msg);
|
@@ -8595,27 +8687,27 @@ UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutab
|
|
8595
8687
|
|
8596
8688
|
UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
|
8597
8689
|
const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8598
|
-
|
8690
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8599
8691
|
}
|
8600
8692
|
UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
|
8601
8693
|
const upb_MiniTableField field = {2, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8602
|
-
|
8694
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8603
8695
|
}
|
8604
8696
|
UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
|
8605
8697
|
const upb_MiniTableField field = {3, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8606
|
-
|
8698
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8607
8699
|
}
|
8608
8700
|
UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
|
8609
8701
|
const upb_MiniTableField field = {7, 12, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8610
|
-
|
8702
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8611
8703
|
}
|
8612
8704
|
UPB_INLINE void google_protobuf_MessageOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_MessageOptions *msg, bool value) {
|
8613
8705
|
const upb_MiniTableField field = {11, 13, 68, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8614
|
-
|
8706
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8615
8707
|
}
|
8616
8708
|
UPB_INLINE void google_protobuf_MessageOptions_set_features(google_protobuf_MessageOptions *msg, google_protobuf_FeatureSet* value) {
|
8617
8709
|
const upb_MiniTableField field = {12, 16, 69, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8618
|
-
|
8710
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8619
8711
|
}
|
8620
8712
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MessageOptions_mutable_features(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
|
8621
8713
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MessageOptions_features(msg);
|
@@ -8693,19 +8785,19 @@ UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf
|
|
8693
8785
|
return ptr;
|
8694
8786
|
}
|
8695
8787
|
UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(google_protobuf_FieldOptions* msg) {
|
8696
|
-
const upb_MiniTableField field = {1, 12, 64,
|
8788
|
+
const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8697
8789
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
8698
8790
|
}
|
8699
8791
|
UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
|
8700
8792
|
int32_t default_val = 0;
|
8701
8793
|
int32_t ret;
|
8702
|
-
const upb_MiniTableField field = {1, 12, 64,
|
8794
|
+
const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8703
8795
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
8704
8796
|
&default_val, &ret);
|
8705
8797
|
return ret;
|
8706
8798
|
}
|
8707
8799
|
UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
|
8708
|
-
const upb_MiniTableField field = {1, 12, 64,
|
8800
|
+
const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8709
8801
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8710
8802
|
}
|
8711
8803
|
UPB_INLINE void google_protobuf_FieldOptions_clear_packed(google_protobuf_FieldOptions* msg) {
|
@@ -8757,19 +8849,19 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_Fiel
|
|
8757
8849
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8758
8850
|
}
|
8759
8851
|
UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(google_protobuf_FieldOptions* msg) {
|
8760
|
-
const upb_MiniTableField field = {6, 20, 68,
|
8852
|
+
const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8761
8853
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
8762
8854
|
}
|
8763
8855
|
UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
|
8764
8856
|
int32_t default_val = 0;
|
8765
8857
|
int32_t ret;
|
8766
|
-
const upb_MiniTableField field = {6, 20, 68,
|
8858
|
+
const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8767
8859
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
8768
8860
|
&default_val, &ret);
|
8769
8861
|
return ret;
|
8770
8862
|
}
|
8771
8863
|
UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
|
8772
|
-
const upb_MiniTableField field = {6, 20, 68,
|
8864
|
+
const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8773
8865
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8774
8866
|
}
|
8775
8867
|
UPB_INLINE void google_protobuf_FieldOptions_clear_weak(google_protobuf_FieldOptions* msg) {
|
@@ -8821,27 +8913,27 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_debug_redact(const google_proto
|
|
8821
8913
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8822
8914
|
}
|
8823
8915
|
UPB_INLINE void google_protobuf_FieldOptions_clear_retention(google_protobuf_FieldOptions* msg) {
|
8824
|
-
const upb_MiniTableField field = {17, 28, 72,
|
8916
|
+
const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8825
8917
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
8826
8918
|
}
|
8827
8919
|
UPB_INLINE int32_t google_protobuf_FieldOptions_retention(const google_protobuf_FieldOptions* msg) {
|
8828
8920
|
int32_t default_val = 0;
|
8829
8921
|
int32_t ret;
|
8830
|
-
const upb_MiniTableField field = {17, 28, 72,
|
8922
|
+
const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8831
8923
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
8832
8924
|
&default_val, &ret);
|
8833
8925
|
return ret;
|
8834
8926
|
}
|
8835
8927
|
UPB_INLINE bool google_protobuf_FieldOptions_has_retention(const google_protobuf_FieldOptions* msg) {
|
8836
|
-
const upb_MiniTableField field = {17, 28, 72,
|
8928
|
+
const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
8837
8929
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8838
8930
|
}
|
8839
8931
|
UPB_INLINE void google_protobuf_FieldOptions_clear_targets(google_protobuf_FieldOptions* msg) {
|
8840
|
-
const upb_MiniTableField field = {19, 32, 0,
|
8932
|
+
const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8841
8933
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
8842
8934
|
}
|
8843
8935
|
UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_protobuf_FieldOptions* msg, size_t* size) {
|
8844
|
-
const upb_MiniTableField field = {19, 32, 0,
|
8936
|
+
const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8845
8937
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
8846
8938
|
if (arr) {
|
8847
8939
|
if (size) *size = arr->UPB_PRIVATE(size);
|
@@ -8852,7 +8944,7 @@ UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_prot
|
|
8852
8944
|
}
|
8853
8945
|
}
|
8854
8946
|
UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
|
8855
|
-
const upb_MiniTableField field = {19, 32, 0,
|
8947
|
+
const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8856
8948
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
8857
8949
|
if (size) {
|
8858
8950
|
*size = arr ? arr->UPB_PRIVATE(size) : 0;
|
@@ -8860,7 +8952,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(cons
|
|
8860
8952
|
return arr;
|
8861
8953
|
}
|
8862
8954
|
UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
|
8863
|
-
const upb_MiniTableField field = {19, 32, 0,
|
8955
|
+
const upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8864
8956
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
8865
8957
|
&field, arena);
|
8866
8958
|
if (size) {
|
@@ -8916,12 +9008,28 @@ UPB_INLINE bool google_protobuf_FieldOptions_has_features(const google_protobuf_
|
|
8916
9008
|
const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8917
9009
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
8918
9010
|
}
|
9011
|
+
UPB_INLINE void google_protobuf_FieldOptions_clear_feature_support(google_protobuf_FieldOptions* msg) {
|
9012
|
+
const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9013
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
9014
|
+
}
|
9015
|
+
UPB_INLINE const google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_feature_support(const google_protobuf_FieldOptions* msg) {
|
9016
|
+
const google_protobuf_FieldOptions_FeatureSupport* default_val = NULL;
|
9017
|
+
const google_protobuf_FieldOptions_FeatureSupport* ret;
|
9018
|
+
const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9019
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
9020
|
+
&default_val, &ret);
|
9021
|
+
return ret;
|
9022
|
+
}
|
9023
|
+
UPB_INLINE bool google_protobuf_FieldOptions_has_feature_support(const google_protobuf_FieldOptions* msg) {
|
9024
|
+
const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9025
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
9026
|
+
}
|
8919
9027
|
UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(google_protobuf_FieldOptions* msg) {
|
8920
|
-
const upb_MiniTableField field = {999, UPB_SIZE(
|
9028
|
+
const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8921
9029
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
8922
9030
|
}
|
8923
9031
|
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* size) {
|
8924
|
-
const upb_MiniTableField field = {999, UPB_SIZE(
|
9032
|
+
const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8925
9033
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
8926
9034
|
if (arr) {
|
8927
9035
|
if (size) *size = arr->UPB_PRIVATE(size);
|
@@ -8932,7 +9040,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fie
|
|
8932
9040
|
}
|
8933
9041
|
}
|
8934
9042
|
UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_upb_array(const google_protobuf_FieldOptions* msg, size_t* size) {
|
8935
|
-
const upb_MiniTableField field = {999, UPB_SIZE(
|
9043
|
+
const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8936
9044
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
8937
9045
|
if (size) {
|
8938
9046
|
*size = arr ? arr->UPB_PRIVATE(size) : 0;
|
@@ -8940,7 +9048,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_u
|
|
8940
9048
|
return arr;
|
8941
9049
|
}
|
8942
9050
|
UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable_upb_array(google_protobuf_FieldOptions* msg, size_t* size, upb_Arena* arena) {
|
8943
|
-
const upb_MiniTableField field = {999, UPB_SIZE(
|
9051
|
+
const upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8944
9052
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
8945
9053
|
&field, arena);
|
8946
9054
|
if (size) {
|
@@ -8950,43 +9058,43 @@ UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable
|
|
8950
9058
|
}
|
8951
9059
|
|
8952
9060
|
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
|
8953
|
-
const upb_MiniTableField field = {1, 12, 64,
|
8954
|
-
|
9061
|
+
const upb_MiniTableField field = {1, 12, 64, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9062
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8955
9063
|
}
|
8956
9064
|
UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
|
8957
9065
|
const upb_MiniTableField field = {2, 16, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8958
|
-
|
9066
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8959
9067
|
}
|
8960
9068
|
UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
|
8961
9069
|
const upb_MiniTableField field = {3, 17, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8962
|
-
|
9070
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8963
9071
|
}
|
8964
9072
|
UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
|
8965
9073
|
const upb_MiniTableField field = {5, 18, 67, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8966
|
-
|
9074
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8967
9075
|
}
|
8968
9076
|
UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
|
8969
|
-
const upb_MiniTableField field = {6, 20, 68,
|
8970
|
-
|
9077
|
+
const upb_MiniTableField field = {6, 20, 68, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9078
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8971
9079
|
}
|
8972
9080
|
UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
|
8973
9081
|
const upb_MiniTableField field = {10, 24, 69, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8974
|
-
|
9082
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8975
9083
|
}
|
8976
9084
|
UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
|
8977
9085
|
const upb_MiniTableField field = {15, 25, 70, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8978
|
-
|
9086
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8979
9087
|
}
|
8980
9088
|
UPB_INLINE void google_protobuf_FieldOptions_set_debug_redact(google_protobuf_FieldOptions *msg, bool value) {
|
8981
9089
|
const upb_MiniTableField field = {16, 26, 71, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
8982
|
-
|
9090
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8983
9091
|
}
|
8984
9092
|
UPB_INLINE void google_protobuf_FieldOptions_set_retention(google_protobuf_FieldOptions *msg, int32_t value) {
|
8985
|
-
const upb_MiniTableField field = {17, 28, 72,
|
8986
|
-
|
9093
|
+
const upb_MiniTableField field = {17, 28, 72, 6, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9094
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
8987
9095
|
}
|
8988
9096
|
UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf_FieldOptions* msg, size_t* size) {
|
8989
|
-
upb_MiniTableField field = {19, 32, 0,
|
9097
|
+
upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
8990
9098
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
8991
9099
|
if (arr) {
|
8992
9100
|
if (size) *size = arr->UPB_PRIVATE(size);
|
@@ -8997,12 +9105,12 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf
|
|
8997
9105
|
}
|
8998
9106
|
}
|
8999
9107
|
UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
|
9000
|
-
upb_MiniTableField field = {19, 32, 0,
|
9108
|
+
upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9001
9109
|
return (int32_t*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
9002
9110
|
&field, size, arena);
|
9003
9111
|
}
|
9004
9112
|
UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) {
|
9005
|
-
upb_MiniTableField field = {19, 32, 0,
|
9113
|
+
upb_MiniTableField field = {19, 32, 0, 7, 14, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9006
9114
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
9007
9115
|
UPB_UPCAST(msg), &field, arena);
|
9008
9116
|
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
|
@@ -9045,7 +9153,7 @@ UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_F
|
|
9045
9153
|
}
|
9046
9154
|
UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) {
|
9047
9155
|
const upb_MiniTableField field = {21, UPB_SIZE(40, 48), 73, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9048
|
-
|
9156
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9049
9157
|
}
|
9050
9158
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutable_features(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
|
9051
9159
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FieldOptions_features(msg);
|
@@ -9055,8 +9163,20 @@ UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FieldOptions_mutab
|
|
9055
9163
|
}
|
9056
9164
|
return sub;
|
9057
9165
|
}
|
9166
|
+
UPB_INLINE void google_protobuf_FieldOptions_set_feature_support(google_protobuf_FieldOptions *msg, google_protobuf_FieldOptions_FeatureSupport* value) {
|
9167
|
+
const upb_MiniTableField field = {22, UPB_SIZE(44, 56), 74, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9168
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9169
|
+
}
|
9170
|
+
UPB_INLINE struct google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_mutable_feature_support(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
|
9171
|
+
struct google_protobuf_FieldOptions_FeatureSupport* sub = (struct google_protobuf_FieldOptions_FeatureSupport*)google_protobuf_FieldOptions_feature_support(msg);
|
9172
|
+
if (sub == NULL) {
|
9173
|
+
sub = (struct google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
|
9174
|
+
if (sub) google_protobuf_FieldOptions_set_feature_support(msg, sub);
|
9175
|
+
}
|
9176
|
+
return sub;
|
9177
|
+
}
|
9058
9178
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* size) {
|
9059
|
-
upb_MiniTableField field = {999, UPB_SIZE(
|
9179
|
+
upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9060
9180
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
9061
9181
|
if (arr) {
|
9062
9182
|
if (size) *size = arr->UPB_PRIVATE(size);
|
@@ -9067,12 +9187,12 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mu
|
|
9067
9187
|
}
|
9068
9188
|
}
|
9069
9189
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t size, upb_Arena* arena) {
|
9070
|
-
upb_MiniTableField field = {999, UPB_SIZE(
|
9190
|
+
upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9071
9191
|
return (google_protobuf_UninterpretedOption**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
9072
9192
|
&field, size, arena);
|
9073
9193
|
}
|
9074
9194
|
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
|
9075
|
-
upb_MiniTableField field = {999, UPB_SIZE(
|
9195
|
+
upb_MiniTableField field = {999, UPB_SIZE(48, 64), 0, 3, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9076
9196
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
9077
9197
|
UPB_UPCAST(msg), &field, arena);
|
9078
9198
|
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
|
@@ -9157,11 +9277,129 @@ UPB_INLINE bool google_protobuf_FieldOptions_EditionDefault_has_edition(const go
|
|
9157
9277
|
|
9158
9278
|
UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_value(google_protobuf_FieldOptions_EditionDefault *msg, upb_StringView value) {
|
9159
9279
|
const upb_MiniTableField field = {2, 16, 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
9160
|
-
|
9280
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9161
9281
|
}
|
9162
9282
|
UPB_INLINE void google_protobuf_FieldOptions_EditionDefault_set_edition(google_protobuf_FieldOptions_EditionDefault *msg, int32_t value) {
|
9163
9283
|
const upb_MiniTableField field = {3, 12, 65, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9164
|
-
|
9284
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9285
|
+
}
|
9286
|
+
|
9287
|
+
/* google.protobuf.FieldOptions.FeatureSupport */
|
9288
|
+
|
9289
|
+
UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_new(upb_Arena* arena) {
|
9290
|
+
return (google_protobuf_FieldOptions_FeatureSupport*)_upb_Message_New(&google__protobuf__FieldOptions__FeatureSupport_msg_init, arena);
|
9291
|
+
}
|
9292
|
+
UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse(const char* buf, size_t size, upb_Arena* arena) {
|
9293
|
+
google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
|
9294
|
+
if (!ret) return NULL;
|
9295
|
+
if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, NULL, 0, arena) !=
|
9296
|
+
kUpb_DecodeStatus_Ok) {
|
9297
|
+
return NULL;
|
9298
|
+
}
|
9299
|
+
return ret;
|
9300
|
+
}
|
9301
|
+
UPB_INLINE google_protobuf_FieldOptions_FeatureSupport* google_protobuf_FieldOptions_FeatureSupport_parse_ex(const char* buf, size_t size,
|
9302
|
+
const upb_ExtensionRegistry* extreg,
|
9303
|
+
int options, upb_Arena* arena) {
|
9304
|
+
google_protobuf_FieldOptions_FeatureSupport* ret = google_protobuf_FieldOptions_FeatureSupport_new(arena);
|
9305
|
+
if (!ret) return NULL;
|
9306
|
+
if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__protobuf__FieldOptions__FeatureSupport_msg_init, extreg, options,
|
9307
|
+
arena) != kUpb_DecodeStatus_Ok) {
|
9308
|
+
return NULL;
|
9309
|
+
}
|
9310
|
+
return ret;
|
9311
|
+
}
|
9312
|
+
UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize(const google_protobuf_FieldOptions_FeatureSupport* msg, upb_Arena* arena, size_t* len) {
|
9313
|
+
char* ptr;
|
9314
|
+
(void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, 0, arena, &ptr, len);
|
9315
|
+
return ptr;
|
9316
|
+
}
|
9317
|
+
UPB_INLINE char* google_protobuf_FieldOptions_FeatureSupport_serialize_ex(const google_protobuf_FieldOptions_FeatureSupport* msg, int options,
|
9318
|
+
upb_Arena* arena, size_t* len) {
|
9319
|
+
char* ptr;
|
9320
|
+
(void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FieldOptions__FeatureSupport_msg_init, options, arena, &ptr, len);
|
9321
|
+
return ptr;
|
9322
|
+
}
|
9323
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_introduced(google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9324
|
+
const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9325
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
9326
|
+
}
|
9327
|
+
UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9328
|
+
int32_t default_val = 0;
|
9329
|
+
int32_t ret;
|
9330
|
+
const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9331
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
9332
|
+
&default_val, &ret);
|
9333
|
+
return ret;
|
9334
|
+
}
|
9335
|
+
UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_introduced(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9336
|
+
const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9337
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
9338
|
+
}
|
9339
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9340
|
+
const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9341
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
9342
|
+
}
|
9343
|
+
UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9344
|
+
int32_t default_val = 0;
|
9345
|
+
int32_t ret;
|
9346
|
+
const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9347
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
9348
|
+
&default_val, &ret);
|
9349
|
+
return ret;
|
9350
|
+
}
|
9351
|
+
UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_deprecated(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9352
|
+
const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9353
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
9354
|
+
}
|
9355
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9356
|
+
const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
9357
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
9358
|
+
}
|
9359
|
+
UPB_INLINE upb_StringView google_protobuf_FieldOptions_FeatureSupport_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9360
|
+
upb_StringView default_val = upb_StringView_FromString("");
|
9361
|
+
upb_StringView ret;
|
9362
|
+
const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
9363
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
9364
|
+
&default_val, &ret);
|
9365
|
+
return ret;
|
9366
|
+
}
|
9367
|
+
UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_deprecation_warning(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9368
|
+
const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
9369
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
9370
|
+
}
|
9371
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_clear_edition_removed(google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9372
|
+
const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9373
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
9374
|
+
}
|
9375
|
+
UPB_INLINE int32_t google_protobuf_FieldOptions_FeatureSupport_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9376
|
+
int32_t default_val = 0;
|
9377
|
+
int32_t ret;
|
9378
|
+
const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9379
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
9380
|
+
&default_val, &ret);
|
9381
|
+
return ret;
|
9382
|
+
}
|
9383
|
+
UPB_INLINE bool google_protobuf_FieldOptions_FeatureSupport_has_edition_removed(const google_protobuf_FieldOptions_FeatureSupport* msg) {
|
9384
|
+
const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9385
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
9386
|
+
}
|
9387
|
+
|
9388
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_introduced(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
|
9389
|
+
const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9390
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9391
|
+
}
|
9392
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_deprecated(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
|
9393
|
+
const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9394
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9395
|
+
}
|
9396
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_deprecation_warning(google_protobuf_FieldOptions_FeatureSupport *msg, upb_StringView value) {
|
9397
|
+
const upb_MiniTableField field = {3, 24, 66, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
9398
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9399
|
+
}
|
9400
|
+
UPB_INLINE void google_protobuf_FieldOptions_FeatureSupport_set_edition_removed(google_protobuf_FieldOptions_FeatureSupport *msg, int32_t value) {
|
9401
|
+
const upb_MiniTableField field = {4, 20, 67, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9402
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9165
9403
|
}
|
9166
9404
|
|
9167
9405
|
/* google.protobuf.OneofOptions */
|
@@ -9251,7 +9489,7 @@ UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable
|
|
9251
9489
|
|
9252
9490
|
UPB_INLINE void google_protobuf_OneofOptions_set_features(google_protobuf_OneofOptions *msg, google_protobuf_FeatureSet* value) {
|
9253
9491
|
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9254
|
-
|
9492
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9255
9493
|
}
|
9256
9494
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_OneofOptions_mutable_features(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
|
9257
9495
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_OneofOptions_features(msg);
|
@@ -9427,19 +9665,19 @@ UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_
|
|
9427
9665
|
|
9428
9666
|
UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
|
9429
9667
|
const upb_MiniTableField field = {2, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9430
|
-
|
9668
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9431
9669
|
}
|
9432
9670
|
UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
|
9433
9671
|
const upb_MiniTableField field = {3, 10, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9434
|
-
|
9672
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9435
9673
|
}
|
9436
9674
|
UPB_INLINE void google_protobuf_EnumOptions_set_deprecated_legacy_json_field_conflicts(google_protobuf_EnumOptions *msg, bool value) {
|
9437
9675
|
const upb_MiniTableField field = {6, 11, 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9438
|
-
|
9676
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9439
9677
|
}
|
9440
9678
|
UPB_INLINE void google_protobuf_EnumOptions_set_features(google_protobuf_EnumOptions *msg, google_protobuf_FeatureSet* value) {
|
9441
9679
|
const upb_MiniTableField field = {7, UPB_SIZE(12, 16), 67, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9442
|
-
|
9680
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9443
9681
|
}
|
9444
9682
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumOptions_mutable_features(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
|
9445
9683
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumOptions_features(msg);
|
@@ -9599,11 +9837,11 @@ UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mut
|
|
9599
9837
|
|
9600
9838
|
UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
|
9601
9839
|
const upb_MiniTableField field = {1, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9602
|
-
|
9840
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9603
9841
|
}
|
9604
9842
|
UPB_INLINE void google_protobuf_EnumValueOptions_set_features(google_protobuf_EnumValueOptions *msg, google_protobuf_FeatureSet* value) {
|
9605
9843
|
const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9606
|
-
|
9844
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9607
9845
|
}
|
9608
9846
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_mutable_features(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
|
9609
9847
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_EnumValueOptions_features(msg);
|
@@ -9615,7 +9853,7 @@ UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_EnumValueOptions_m
|
|
9615
9853
|
}
|
9616
9854
|
UPB_INLINE void google_protobuf_EnumValueOptions_set_debug_redact(google_protobuf_EnumValueOptions *msg, bool value) {
|
9617
9855
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 10), 66, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9618
|
-
|
9856
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9619
9857
|
}
|
9620
9858
|
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* size) {
|
9621
9859
|
upb_MiniTableField field = {999, UPB_SIZE(20, 24), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -9751,11 +9989,11 @@ UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutab
|
|
9751
9989
|
|
9752
9990
|
UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
|
9753
9991
|
const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9754
|
-
|
9992
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9755
9993
|
}
|
9756
9994
|
UPB_INLINE void google_protobuf_ServiceOptions_set_features(google_protobuf_ServiceOptions *msg, google_protobuf_FeatureSet* value) {
|
9757
9995
|
const upb_MiniTableField field = {34, UPB_SIZE(12, 16), 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9758
|
-
|
9996
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9759
9997
|
}
|
9760
9998
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_ServiceOptions_mutable_features(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
|
9761
9999
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_ServiceOptions_features(msg);
|
@@ -9915,15 +10153,15 @@ UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutabl
|
|
9915
10153
|
|
9916
10154
|
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
|
9917
10155
|
const upb_MiniTableField field = {33, 9, 64, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
9918
|
-
|
10156
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9919
10157
|
}
|
9920
10158
|
UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
|
9921
10159
|
const upb_MiniTableField field = {34, 12, 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
9922
|
-
|
10160
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9923
10161
|
}
|
9924
10162
|
UPB_INLINE void google_protobuf_MethodOptions_set_features(google_protobuf_MethodOptions *msg, google_protobuf_FeatureSet* value) {
|
9925
10163
|
const upb_MiniTableField field = {35, 16, 66, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
9926
|
-
|
10164
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
9927
10165
|
}
|
9928
10166
|
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_MethodOptions_mutable_features(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
|
9929
10167
|
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_MethodOptions_features(msg);
|
@@ -10161,27 +10399,27 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
|
|
10161
10399
|
}
|
10162
10400
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
|
10163
10401
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 24), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10164
|
-
|
10402
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10165
10403
|
}
|
10166
10404
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
|
10167
10405
|
const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 65, kUpb_NoSub, 4, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
|
10168
|
-
|
10406
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10169
10407
|
}
|
10170
10408
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
|
10171
10409
|
const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 66, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
|
10172
|
-
|
10410
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10173
10411
|
}
|
10174
10412
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
|
10175
10413
|
const upb_MiniTableField field = {6, UPB_SIZE(40, 56), 67, kUpb_NoSub, 1, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
|
10176
|
-
|
10414
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10177
10415
|
}
|
10178
10416
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
|
10179
10417
|
const upb_MiniTableField field = {7, UPB_SIZE(48, 64), 68, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10180
|
-
|
10418
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10181
10419
|
}
|
10182
10420
|
UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
|
10183
10421
|
const upb_MiniTableField field = {8, UPB_SIZE(56, 80), 69, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10184
|
-
|
10422
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10185
10423
|
}
|
10186
10424
|
|
10187
10425
|
/* google.protobuf.UninterpretedOption.NamePart */
|
@@ -10255,11 +10493,11 @@ UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(co
|
|
10255
10493
|
|
10256
10494
|
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
|
10257
10495
|
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10258
|
-
|
10496
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10259
10497
|
}
|
10260
10498
|
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
|
10261
10499
|
const upb_MiniTableField field = {2, 9, 65, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
10262
|
-
|
10500
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10263
10501
|
}
|
10264
10502
|
|
10265
10503
|
/* google.protobuf.FeatureSet */
|
@@ -10397,27 +10635,27 @@ UPB_INLINE bool google_protobuf_FeatureSet_has_json_format(const google_protobuf
|
|
10397
10635
|
|
10398
10636
|
UPB_INLINE void google_protobuf_FeatureSet_set_field_presence(google_protobuf_FeatureSet *msg, int32_t value) {
|
10399
10637
|
const upb_MiniTableField field = {1, 12, 64, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10400
|
-
|
10638
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10401
10639
|
}
|
10402
10640
|
UPB_INLINE void google_protobuf_FeatureSet_set_enum_type(google_protobuf_FeatureSet *msg, int32_t value) {
|
10403
10641
|
const upb_MiniTableField field = {2, 16, 65, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10404
|
-
|
10642
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10405
10643
|
}
|
10406
10644
|
UPB_INLINE void google_protobuf_FeatureSet_set_repeated_field_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
|
10407
10645
|
const upb_MiniTableField field = {3, 20, 66, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10408
|
-
|
10646
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10409
10647
|
}
|
10410
10648
|
UPB_INLINE void google_protobuf_FeatureSet_set_utf8_validation(google_protobuf_FeatureSet *msg, int32_t value) {
|
10411
10649
|
const upb_MiniTableField field = {4, 24, 67, 3, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10412
|
-
|
10650
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10413
10651
|
}
|
10414
10652
|
UPB_INLINE void google_protobuf_FeatureSet_set_message_encoding(google_protobuf_FeatureSet *msg, int32_t value) {
|
10415
10653
|
const upb_MiniTableField field = {5, 28, 68, 4, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10416
|
-
|
10654
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10417
10655
|
}
|
10418
10656
|
UPB_INLINE void google_protobuf_FeatureSet_set_json_format(google_protobuf_FeatureSet *msg, int32_t value) {
|
10419
10657
|
const upb_MiniTableField field = {6, 32, 69, 5, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10420
|
-
|
10658
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10421
10659
|
}
|
10422
10660
|
|
10423
10661
|
/* google.protobuf.FeatureSetDefaults */
|
@@ -10553,11 +10791,11 @@ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* g
|
|
10553
10791
|
}
|
10554
10792
|
UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
|
10555
10793
|
const upb_MiniTableField field = {4, UPB_SIZE(16, 12), 64, 1, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10556
|
-
|
10794
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10557
10795
|
}
|
10558
10796
|
UPB_INLINE void google_protobuf_FeatureSetDefaults_set_maximum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) {
|
10559
10797
|
const upb_MiniTableField field = {5, UPB_SIZE(20, 16), 65, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10560
|
-
|
10798
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10561
10799
|
}
|
10562
10800
|
|
10563
10801
|
/* google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */
|
@@ -10596,54 +10834,82 @@ UPB_INLINE char* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_ser
|
|
10596
10834
|
(void)upb_Encode(UPB_UPCAST(msg), &google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init, options, arena, &ptr, len);
|
10597
10835
|
return ptr;
|
10598
10836
|
}
|
10599
|
-
UPB_INLINE void
|
10600
|
-
const upb_MiniTableField field = {
|
10837
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10838
|
+
const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10839
|
+
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
10840
|
+
}
|
10841
|
+
UPB_INLINE int32_t google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10842
|
+
int32_t default_val = 0;
|
10843
|
+
int32_t ret;
|
10844
|
+
const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10845
|
+
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
10846
|
+
&default_val, &ret);
|
10847
|
+
return ret;
|
10848
|
+
}
|
10849
|
+
UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_edition(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10850
|
+
const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10851
|
+
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
10852
|
+
}
|
10853
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10854
|
+
const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10601
10855
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
10602
10856
|
}
|
10603
|
-
UPB_INLINE const google_protobuf_FeatureSet*
|
10857
|
+
UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10604
10858
|
const google_protobuf_FeatureSet* default_val = NULL;
|
10605
10859
|
const google_protobuf_FeatureSet* ret;
|
10606
|
-
const upb_MiniTableField field = {
|
10860
|
+
const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10607
10861
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
10608
10862
|
&default_val, &ret);
|
10609
10863
|
return ret;
|
10610
10864
|
}
|
10611
|
-
UPB_INLINE bool
|
10612
|
-
const upb_MiniTableField field = {
|
10865
|
+
UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_overridable_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10866
|
+
const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10613
10867
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
10614
10868
|
}
|
10615
|
-
UPB_INLINE void
|
10616
|
-
const upb_MiniTableField field = {
|
10869
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_clear_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10870
|
+
const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10617
10871
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
10618
10872
|
}
|
10619
|
-
UPB_INLINE
|
10620
|
-
|
10621
|
-
|
10622
|
-
const upb_MiniTableField field = {
|
10873
|
+
UPB_INLINE const google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10874
|
+
const google_protobuf_FeatureSet* default_val = NULL;
|
10875
|
+
const google_protobuf_FeatureSet* ret;
|
10876
|
+
const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10623
10877
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
10624
10878
|
&default_val, &ret);
|
10625
10879
|
return ret;
|
10626
10880
|
}
|
10627
|
-
UPB_INLINE bool
|
10628
|
-
const upb_MiniTableField field = {
|
10881
|
+
UPB_INLINE bool google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_has_fixed_features(const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg) {
|
10882
|
+
const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10629
10883
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
10630
10884
|
}
|
10631
10885
|
|
10632
|
-
UPB_INLINE void
|
10633
|
-
const upb_MiniTableField field = {
|
10634
|
-
|
10886
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_edition(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, int32_t value) {
|
10887
|
+
const upb_MiniTableField field = {3, 12, 64, 2, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
10888
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10889
|
+
}
|
10890
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
|
10891
|
+
const upb_MiniTableField field = {4, 16, 65, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10892
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10635
10893
|
}
|
10636
|
-
UPB_INLINE struct google_protobuf_FeatureSet*
|
10637
|
-
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)
|
10894
|
+
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_overridable_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
|
10895
|
+
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_overridable_features(msg);
|
10638
10896
|
if (sub == NULL) {
|
10639
10897
|
sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
|
10640
|
-
if (sub)
|
10898
|
+
if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_overridable_features(msg, sub);
|
10641
10899
|
}
|
10642
10900
|
return sub;
|
10643
10901
|
}
|
10644
|
-
UPB_INLINE void
|
10645
|
-
const upb_MiniTableField field = {
|
10646
|
-
|
10902
|
+
UPB_INLINE void google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault *msg, google_protobuf_FeatureSet* value) {
|
10903
|
+
const upb_MiniTableField field = {5, UPB_SIZE(20, 24), 66, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
10904
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10905
|
+
}
|
10906
|
+
UPB_INLINE struct google_protobuf_FeatureSet* google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_mutable_fixed_features(google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* msg, upb_Arena* arena) {
|
10907
|
+
struct google_protobuf_FeatureSet* sub = (struct google_protobuf_FeatureSet*)google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_fixed_features(msg);
|
10908
|
+
if (sub == NULL) {
|
10909
|
+
sub = (struct google_protobuf_FeatureSet*)_upb_Message_New(&google__protobuf__FeatureSet_msg_init, arena);
|
10910
|
+
if (sub) google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault_set_fixed_features(msg, sub);
|
10911
|
+
}
|
10912
|
+
return sub;
|
10647
10913
|
}
|
10648
10914
|
|
10649
10915
|
/* google.protobuf.SourceCodeInfo */
|
@@ -10969,11 +11235,11 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf
|
|
10969
11235
|
}
|
10970
11236
|
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
|
10971
11237
|
const upb_MiniTableField field = {3, UPB_SIZE(24, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10972
|
-
|
11238
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10973
11239
|
}
|
10974
11240
|
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
|
10975
11241
|
const upb_MiniTableField field = {4, UPB_SIZE(32, 48), 65, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
10976
|
-
|
11242
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
10977
11243
|
}
|
10978
11244
|
UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) {
|
10979
11245
|
upb_MiniTableField field = {6, UPB_SIZE(20, 64), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Array | (int)kUpb_LabelFlags_IsAlternate | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
@@ -11267,19 +11533,19 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
|
|
11267
11533
|
}
|
11268
11534
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
|
11269
11535
|
const upb_MiniTableField field = {2, UPB_SIZE(28, 32), 64, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
11270
|
-
|
11536
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
11271
11537
|
}
|
11272
11538
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
|
11273
11539
|
const upb_MiniTableField field = {3, UPB_SIZE(16, 12), 65, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
11274
|
-
|
11540
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
11275
11541
|
}
|
11276
11542
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
|
11277
11543
|
const upb_MiniTableField field = {4, UPB_SIZE(20, 16), 66, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
11278
|
-
|
11544
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
11279
11545
|
}
|
11280
11546
|
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
|
11281
11547
|
const upb_MiniTableField field = {5, UPB_SIZE(24, 20), 67, 0, 14, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
|
11282
|
-
|
11548
|
+
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
|
11283
11549
|
}
|
11284
11550
|
|
11285
11551
|
/* Max size 32 is google.protobuf.FileOptions */
|
@@ -11421,8 +11687,8 @@ const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
|
|
11421
11687
|
const upb_MessageDef* m,
|
11422
11688
|
int32_t fieldnum);
|
11423
11689
|
|
11424
|
-
const upb_ServiceDef* upb_DefPool_FindServiceByName(
|
11425
|
-
|
11690
|
+
UPB_API const upb_ServiceDef* upb_DefPool_FindServiceByName(
|
11691
|
+
const upb_DefPool* s, const char* name);
|
11426
11692
|
|
11427
11693
|
const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
|
11428
11694
|
const upb_DefPool* s, const char* name, size_t size);
|
@@ -11473,6 +11739,7 @@ UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(
|
|
11473
11739
|
UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e);
|
11474
11740
|
bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
|
11475
11741
|
bool upb_EnumDef_IsClosed(const upb_EnumDef* e);
|
11742
|
+
bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e);
|
11476
11743
|
|
11477
11744
|
// Creates a mini descriptor string for an enum, returns true on success.
|
11478
11745
|
bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a,
|
@@ -11601,8 +11868,10 @@ bool upb_FieldDef_IsString(const upb_FieldDef* f);
|
|
11601
11868
|
UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
|
11602
11869
|
UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
|
11603
11870
|
UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
|
11871
|
+
uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
|
11604
11872
|
UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
|
11605
11873
|
bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
|
11874
|
+
bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
|
11606
11875
|
|
11607
11876
|
// Creates a mini descriptor string for a field, returns true on success.
|
11608
11877
|
bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,
|
@@ -11671,6 +11940,9 @@ int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
|
|
11671
11940
|
const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
|
11672
11941
|
int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
|
11673
11942
|
|
11943
|
+
// Returns whether |symbol| is transitively included by |f|
|
11944
|
+
bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);
|
11945
|
+
|
11674
11946
|
#ifdef __cplusplus
|
11675
11947
|
} /* extern "C" */
|
11676
11948
|
#endif
|
@@ -11838,18 +12110,19 @@ UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
|
|
11838
12110
|
extern "C" {
|
11839
12111
|
#endif
|
11840
12112
|
|
11841
|
-
bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
|
12113
|
+
UPB_API bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
|
11842
12114
|
const char* upb_MethodDef_FullName(const upb_MethodDef* m);
|
11843
12115
|
bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
|
11844
12116
|
int upb_MethodDef_Index(const upb_MethodDef* m);
|
11845
|
-
const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
|
11846
|
-
const char* upb_MethodDef_Name(const upb_MethodDef* m);
|
11847
|
-
const UPB_DESC(MethodOptions) *
|
12117
|
+
UPB_API const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
|
12118
|
+
UPB_API const char* upb_MethodDef_Name(const upb_MethodDef* m);
|
12119
|
+
UPB_API const UPB_DESC(MethodOptions) *
|
12120
|
+
upb_MethodDef_Options(const upb_MethodDef* m);
|
11848
12121
|
const UPB_DESC(FeatureSet) *
|
11849
12122
|
upb_MethodDef_ResolvedFeatures(const upb_MethodDef* m);
|
11850
|
-
const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
|
11851
|
-
bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
|
11852
|
-
const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
|
12123
|
+
UPB_API const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
|
12124
|
+
UPB_API bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
|
12125
|
+
UPB_API const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
|
11853
12126
|
|
11854
12127
|
#ifdef __cplusplus
|
11855
12128
|
} /* extern "C" */
|
@@ -11910,16 +12183,17 @@ const UPB_DESC(FeatureSet*)
|
|
11910
12183
|
extern "C" {
|
11911
12184
|
#endif
|
11912
12185
|
|
11913
|
-
const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
|
12186
|
+
UPB_API const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
|
11914
12187
|
const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
|
11915
12188
|
const char* name);
|
11916
|
-
const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
|
12189
|
+
UPB_API const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
|
11917
12190
|
bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
|
11918
12191
|
int upb_ServiceDef_Index(const upb_ServiceDef* s);
|
11919
|
-
const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s,
|
11920
|
-
int
|
12192
|
+
UPB_API const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s,
|
12193
|
+
int i);
|
12194
|
+
UPB_API int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
|
11921
12195
|
const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
|
11922
|
-
const UPB_DESC(ServiceOptions) *
|
12196
|
+
UPB_API const UPB_DESC(ServiceOptions) *
|
11923
12197
|
upb_ServiceDef_Options(const upb_ServiceDef* s);
|
11924
12198
|
const UPB_DESC(FeatureSet) *
|
11925
12199
|
upb_ServiceDef_ResolvedFeatures(const upb_ServiceDef* s);
|
@@ -12293,9 +12567,9 @@ extern "C" {
|
|
12293
12567
|
const upb_MiniTableExtension* upb_Message_ExtensionByIndex(
|
12294
12568
|
const upb_Message* msg, size_t index);
|
12295
12569
|
|
12296
|
-
// Returns the
|
12297
|
-
const
|
12298
|
-
|
12570
|
+
// Returns the minitable with the given field number, or NULL on failure.
|
12571
|
+
const upb_MiniTableExtension* upb_Message_FindExtensionByNumber(
|
12572
|
+
const upb_Message* msg, uint32_t field_number);
|
12299
12573
|
|
12300
12574
|
#ifdef __cplusplus
|
12301
12575
|
} /* extern "C" */
|
@@ -12390,9 +12664,9 @@ UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s,
|
|
12390
12664
|
|
12391
12665
|
UPB_INLINE bool _upb_sortedmap_nextext(_upb_mapsorter* s,
|
12392
12666
|
_upb_sortedmap* sorted,
|
12393
|
-
const
|
12667
|
+
const upb_Extension** ext) {
|
12394
12668
|
if (sorted->pos == sorted->end) return false;
|
12395
|
-
*ext = (const
|
12669
|
+
*ext = (const upb_Extension*)s->entries[sorted->pos++];
|
12396
12670
|
return true;
|
12397
12671
|
}
|
12398
12672
|
|
@@ -12404,9 +12678,8 @@ UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
|
|
12404
12678
|
bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
|
12405
12679
|
const struct upb_Map* map, _upb_sortedmap* sorted);
|
12406
12680
|
|
12407
|
-
bool _upb_mapsorter_pushexts(_upb_mapsorter* s,
|
12408
|
-
|
12409
|
-
_upb_sortedmap* sorted);
|
12681
|
+
bool _upb_mapsorter_pushexts(_upb_mapsorter* s, const upb_Extension* exts,
|
12682
|
+
size_t count, _upb_sortedmap* sorted);
|
12410
12683
|
|
12411
12684
|
#ifdef __cplusplus
|
12412
12685
|
} /* extern "C" */
|
@@ -12447,17 +12720,62 @@ UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); }
|
|
12447
12720
|
#ifndef UPB_MESSAGE_COMPARE_H_
|
12448
12721
|
#define UPB_MESSAGE_COMPARE_H_
|
12449
12722
|
|
12723
|
+
#include <stddef.h>
|
12724
|
+
|
12450
12725
|
|
12451
12726
|
// Must be last.
|
12452
12727
|
|
12728
|
+
enum {
|
12729
|
+
// If set, upb_Message_IsEqual() will attempt to compare unknown fields.
|
12730
|
+
// By its very nature this comparison is inexact.
|
12731
|
+
kUpb_CompareOption_IncludeUnknownFields = (1 << 0)
|
12732
|
+
};
|
12733
|
+
|
12453
12734
|
#ifdef __cplusplus
|
12454
12735
|
extern "C" {
|
12455
12736
|
#endif
|
12456
12737
|
|
12457
|
-
//
|
12458
|
-
UPB_API bool
|
12459
|
-
|
12460
|
-
|
12738
|
+
// Returns true if no known fields or extensions are set in the message.
|
12739
|
+
UPB_API bool upb_Message_IsEmpty(const upb_Message* msg,
|
12740
|
+
const upb_MiniTable* m);
|
12741
|
+
|
12742
|
+
UPB_API bool upb_Message_IsEqual(const upb_Message* msg1,
|
12743
|
+
const upb_Message* msg2,
|
12744
|
+
const upb_MiniTable* m, int options);
|
12745
|
+
|
12746
|
+
// If |ctype| is a message then |m| must point to its minitable.
|
12747
|
+
UPB_API_INLINE bool upb_MessageValue_IsEqual(upb_MessageValue val1,
|
12748
|
+
upb_MessageValue val2,
|
12749
|
+
upb_CType ctype,
|
12750
|
+
const upb_MiniTable* m,
|
12751
|
+
int options) {
|
12752
|
+
switch (ctype) {
|
12753
|
+
case kUpb_CType_Bool:
|
12754
|
+
return val1.bool_val == val2.bool_val;
|
12755
|
+
|
12756
|
+
case kUpb_CType_Float:
|
12757
|
+
case kUpb_CType_Int32:
|
12758
|
+
case kUpb_CType_UInt32:
|
12759
|
+
case kUpb_CType_Enum:
|
12760
|
+
return val1.int32_val == val2.int32_val;
|
12761
|
+
|
12762
|
+
case kUpb_CType_Double:
|
12763
|
+
case kUpb_CType_Int64:
|
12764
|
+
case kUpb_CType_UInt64:
|
12765
|
+
return val1.int64_val == val2.int64_val;
|
12766
|
+
|
12767
|
+
case kUpb_CType_String:
|
12768
|
+
case kUpb_CType_Bytes:
|
12769
|
+
return upb_StringView_IsEqual(val1.str_val, val2.str_val);
|
12770
|
+
|
12771
|
+
case kUpb_CType_Message:
|
12772
|
+
return upb_Message_IsEqual(val1.msg_val, val2.msg_val, m, options);
|
12773
|
+
|
12774
|
+
default:
|
12775
|
+
UPB_UNREACHABLE();
|
12776
|
+
return false;
|
12777
|
+
}
|
12778
|
+
}
|
12461
12779
|
|
12462
12780
|
#ifdef __cplusplus
|
12463
12781
|
} /* extern "C" */
|
@@ -12466,6 +12784,47 @@ UPB_API bool upb_Message_IsExactlyEqual(const upb_Message* msg1,
|
|
12466
12784
|
|
12467
12785
|
#endif // UPB_MESSAGE_COMPARE_H_
|
12468
12786
|
|
12787
|
+
#ifndef UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
|
12788
|
+
#define UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
|
12789
|
+
|
12790
|
+
#include <stddef.h>
|
12791
|
+
|
12792
|
+
// Must be last.
|
12793
|
+
|
12794
|
+
#ifdef __cplusplus
|
12795
|
+
extern "C" {
|
12796
|
+
#endif
|
12797
|
+
|
12798
|
+
// Returns true if unknown fields from the two messages are equal when sorted
|
12799
|
+
// and varints are made canonical.
|
12800
|
+
//
|
12801
|
+
// This function is discouraged, as the comparison is inherently lossy without
|
12802
|
+
// schema data:
|
12803
|
+
//
|
12804
|
+
// 1. We don't know whether delimited fields are sub-messages. Unknown
|
12805
|
+
// sub-messages will therefore not have their fields sorted and varints
|
12806
|
+
// canonicalized.
|
12807
|
+
// 2. We don't know about oneof/non-repeated fields, which should semantically
|
12808
|
+
// discard every value except the last.
|
12809
|
+
|
12810
|
+
typedef enum {
|
12811
|
+
kUpb_UnknownCompareResult_Equal = 0,
|
12812
|
+
kUpb_UnknownCompareResult_NotEqual = 1,
|
12813
|
+
kUpb_UnknownCompareResult_OutOfMemory = 2,
|
12814
|
+
kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
|
12815
|
+
} upb_UnknownCompareResult;
|
12816
|
+
|
12817
|
+
upb_UnknownCompareResult UPB_PRIVATE(_upb_Message_UnknownFieldsAreEqual)(
|
12818
|
+
const char* buf1, size_t size1, const char* buf2, size_t size2,
|
12819
|
+
int max_depth);
|
12820
|
+
|
12821
|
+
#ifdef __cplusplus
|
12822
|
+
} /* extern "C" */
|
12823
|
+
#endif
|
12824
|
+
|
12825
|
+
|
12826
|
+
#endif /* UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_ */
|
12827
|
+
|
12469
12828
|
#ifndef UPB_MESSAGE_COPY_H_
|
12470
12829
|
#define UPB_MESSAGE_COPY_H_
|
12471
12830
|
|
@@ -12962,7 +13321,7 @@ extern "C" {
|
|
12962
13321
|
UPB_PRIVATE(_upb_WireReader_LongVarint)
|
12963
13322
|
UPB_PRIVATE(_upb_WireReader_ReadLongVarint)(const char* ptr, uint64_t val);
|
12964
13323
|
|
12965
|
-
|
13324
|
+
UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)(
|
12966
13325
|
const char* ptr, uint64_t* val, int maxlen, uint64_t maxval) {
|
12967
13326
|
uint64_t byte = (uint8_t)*ptr;
|
12968
13327
|
if (UPB_LIKELY((byte & 0x80) == 0)) {
|
@@ -12980,11 +13339,11 @@ static UPB_FORCEINLINE const char* UPB_PRIVATE(_upb_WireReader_ReadVarint)(
|
|
12980
13339
|
return res.ptr;
|
12981
13340
|
}
|
12982
13341
|
|
12983
|
-
|
13342
|
+
UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag) {
|
12984
13343
|
return tag >> kUpb_WireReader_WireTypeBits;
|
12985
13344
|
}
|
12986
13345
|
|
12987
|
-
|
13346
|
+
UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag) {
|
12988
13347
|
return tag & kUpb_WireReader_WireTypeMask;
|
12989
13348
|
}
|
12990
13349
|
|
@@ -13028,8 +13387,8 @@ extern "C" {
|
|
13028
13387
|
// REQUIRES: there must be at least 10 bytes of data available at `ptr`.
|
13029
13388
|
// Bounds checks must be performed before calling this function, preferably
|
13030
13389
|
// by calling upb_EpsCopyInputStream_IsDone().
|
13031
|
-
|
13032
|
-
|
13390
|
+
UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr,
|
13391
|
+
uint32_t* tag) {
|
13033
13392
|
uint64_t val;
|
13034
13393
|
ptr = UPB_PRIVATE(_upb_WireReader_ReadVarint)(ptr, &val, 5, UINT32_MAX);
|
13035
13394
|
if (!ptr) return NULL;
|
@@ -13038,14 +13397,10 @@ static UPB_FORCEINLINE const char* upb_WireReader_ReadTag(const char* ptr,
|
|
13038
13397
|
}
|
13039
13398
|
|
13040
13399
|
// Given a tag, returns the field number.
|
13041
|
-
|
13042
|
-
return UPB_PRIVATE(_upb_WireReader_GetFieldNumber)(tag);
|
13043
|
-
}
|
13400
|
+
UPB_API_INLINE uint32_t upb_WireReader_GetFieldNumber(uint32_t tag);
|
13044
13401
|
|
13045
13402
|
// Given a tag, returns the wire type.
|
13046
|
-
|
13047
|
-
return UPB_PRIVATE(_upb_WireReader_GetWireType)(tag);
|
13048
|
-
}
|
13403
|
+
UPB_API_INLINE uint8_t upb_WireReader_GetWireType(uint32_t tag);
|
13049
13404
|
|
13050
13405
|
UPB_INLINE const char* upb_WireReader_ReadVarint(const char* ptr,
|
13051
13406
|
uint64_t* val) {
|
@@ -13673,7 +14028,7 @@ upb_ServiceDef* _upb_ServiceDefs_New(upb_DefBuilder* ctx, int n,
|
|
13673
14028
|
// features. This is used for feature resolution under Editions.
|
13674
14029
|
// NOLINTBEGIN
|
13675
14030
|
// clang-format off
|
13676
|
-
#define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\
|
14031
|
+
#define UPB_INTERNAL_UPB_EDITION_DEFAULTS "\n\023\030\346\007\"\000*\014\010\001\020\002\030\002 \003(\0010\002\n\023\030\347\007\"\000*\014\010\002\020\001\030\001 \002(\0010\001\n\023\030\350\007\"\014\010\001\020\001\030\001 \002(\0010\001*\000 \346\007(\350\007"
|
13677
14032
|
// clang-format on
|
13678
14033
|
// NOLINTEND
|
13679
14034
|
|
@@ -13953,7 +14308,7 @@ upb_MethodDef* _upb_MethodDefs_New(upb_DefBuilder* ctx, int n,
|
|
13953
14308
|
#undef UPB_ASAN
|
13954
14309
|
#undef UPB_ASAN_GUARD_SIZE
|
13955
14310
|
#undef UPB_CLANG_ASAN
|
13956
|
-
#undef
|
14311
|
+
#undef UPB_TREAT_CLOSED_ENUMS_LIKE_OPEN
|
13957
14312
|
#undef UPB_DEPRECATED
|
13958
14313
|
#undef UPB_GNUC_MIN
|
13959
14314
|
#undef UPB_DESCRIPTOR_UPB_H_FILENAME
|