1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * google/protobuf/wrappers.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
10 #define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
11
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20
21 // Must be last.
22 #include "upb/port/def.inc"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct google_protobuf_DoubleValue google_protobuf_DoubleValue;
29 typedef struct google_protobuf_FloatValue google_protobuf_FloatValue;
30 typedef struct google_protobuf_Int64Value google_protobuf_Int64Value;
31 typedef struct google_protobuf_UInt64Value google_protobuf_UInt64Value;
32 typedef struct google_protobuf_Int32Value google_protobuf_Int32Value;
33 typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value;
34 typedef struct google_protobuf_BoolValue google_protobuf_BoolValue;
35 typedef struct google_protobuf_StringValue google_protobuf_StringValue;
36 typedef struct google_protobuf_BytesValue google_protobuf_BytesValue;
37 extern const upb_MiniTable google_protobuf_DoubleValue_msg_init;
38 extern const upb_MiniTable google_protobuf_FloatValue_msg_init;
39 extern const upb_MiniTable google_protobuf_Int64Value_msg_init;
40 extern const upb_MiniTable google_protobuf_UInt64Value_msg_init;
41 extern const upb_MiniTable google_protobuf_Int32Value_msg_init;
42 extern const upb_MiniTable google_protobuf_UInt32Value_msg_init;
43 extern const upb_MiniTable google_protobuf_BoolValue_msg_init;
44 extern const upb_MiniTable google_protobuf_StringValue_msg_init;
45 extern const upb_MiniTable google_protobuf_BytesValue_msg_init;
46
47
48
49 /* google.protobuf.DoubleValue */
50
google_protobuf_DoubleValue_new(upb_Arena * arena)51 UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_new(upb_Arena* arena) {
52 return (google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msg_init, arena);
53 }
google_protobuf_DoubleValue_parse(const char * buf,size_t size,upb_Arena * arena)54 UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse(const char* buf, size_t size, upb_Arena* arena) {
55 google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena);
56 if (!ret) return NULL;
57 if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
58 return NULL;
59 }
60 return ret;
61 }
google_protobuf_DoubleValue_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)62 UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse_ex(const char* buf, size_t size,
63 const upb_ExtensionRegistry* extreg,
64 int options, upb_Arena* arena) {
65 google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena);
66 if (!ret) return NULL;
67 if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msg_init, extreg, options, arena) !=
68 kUpb_DecodeStatus_Ok) {
69 return NULL;
70 }
71 return ret;
72 }
google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue * msg,upb_Arena * arena,size_t * len)73 UPB_INLINE char* google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue* msg, upb_Arena* arena, size_t* len) {
74 char* ptr;
75 (void)upb_Encode(msg, &google_protobuf_DoubleValue_msg_init, 0, arena, &ptr, len);
76 return ptr;
77 }
google_protobuf_DoubleValue_serialize_ex(const google_protobuf_DoubleValue * msg,int options,upb_Arena * arena,size_t * len)78 UPB_INLINE char* google_protobuf_DoubleValue_serialize_ex(const google_protobuf_DoubleValue* msg, int options,
79 upb_Arena* arena, size_t* len) {
80 char* ptr;
81 (void)upb_Encode(msg, &google_protobuf_DoubleValue_msg_init, options, arena, &ptr, len);
82 return ptr;
83 }
google_protobuf_DoubleValue_clear_value(google_protobuf_DoubleValue * msg)84 UPB_INLINE void google_protobuf_DoubleValue_clear_value(google_protobuf_DoubleValue* msg) {
85 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
86 _upb_Message_ClearNonExtensionField(msg, &field);
87 }
google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue * msg)88 UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue* msg) {
89 double default_val = 0;
90 double ret;
91 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
92 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
93 return ret;
94 }
95
google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue * msg,double value)96 UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) {
97 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
98 _upb_Message_SetNonExtensionField(msg, &field, &value);
99 }
100
101 /* google.protobuf.FloatValue */
102
google_protobuf_FloatValue_new(upb_Arena * arena)103 UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_new(upb_Arena* arena) {
104 return (google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msg_init, arena);
105 }
google_protobuf_FloatValue_parse(const char * buf,size_t size,upb_Arena * arena)106 UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse(const char* buf, size_t size, upb_Arena* arena) {
107 google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena);
108 if (!ret) return NULL;
109 if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
110 return NULL;
111 }
112 return ret;
113 }
google_protobuf_FloatValue_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)114 UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse_ex(const char* buf, size_t size,
115 const upb_ExtensionRegistry* extreg,
116 int options, upb_Arena* arena) {
117 google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena);
118 if (!ret) return NULL;
119 if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msg_init, extreg, options, arena) !=
120 kUpb_DecodeStatus_Ok) {
121 return NULL;
122 }
123 return ret;
124 }
google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue * msg,upb_Arena * arena,size_t * len)125 UPB_INLINE char* google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue* msg, upb_Arena* arena, size_t* len) {
126 char* ptr;
127 (void)upb_Encode(msg, &google_protobuf_FloatValue_msg_init, 0, arena, &ptr, len);
128 return ptr;
129 }
google_protobuf_FloatValue_serialize_ex(const google_protobuf_FloatValue * msg,int options,upb_Arena * arena,size_t * len)130 UPB_INLINE char* google_protobuf_FloatValue_serialize_ex(const google_protobuf_FloatValue* msg, int options,
131 upb_Arena* arena, size_t* len) {
132 char* ptr;
133 (void)upb_Encode(msg, &google_protobuf_FloatValue_msg_init, options, arena, &ptr, len);
134 return ptr;
135 }
google_protobuf_FloatValue_clear_value(google_protobuf_FloatValue * msg)136 UPB_INLINE void google_protobuf_FloatValue_clear_value(google_protobuf_FloatValue* msg) {
137 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
138 _upb_Message_ClearNonExtensionField(msg, &field);
139 }
google_protobuf_FloatValue_value(const google_protobuf_FloatValue * msg)140 UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue* msg) {
141 float default_val = 0;
142 float ret;
143 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
144 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
145 return ret;
146 }
147
google_protobuf_FloatValue_set_value(google_protobuf_FloatValue * msg,float value)148 UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) {
149 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
150 _upb_Message_SetNonExtensionField(msg, &field, &value);
151 }
152
153 /* google.protobuf.Int64Value */
154
google_protobuf_Int64Value_new(upb_Arena * arena)155 UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_new(upb_Arena* arena) {
156 return (google_protobuf_Int64Value*)_upb_Message_New(&google_protobuf_Int64Value_msg_init, arena);
157 }
google_protobuf_Int64Value_parse(const char * buf,size_t size,upb_Arena * arena)158 UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse(const char* buf, size_t size, upb_Arena* arena) {
159 google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena);
160 if (!ret) return NULL;
161 if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
162 return NULL;
163 }
164 return ret;
165 }
google_protobuf_Int64Value_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)166 UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse_ex(const char* buf, size_t size,
167 const upb_ExtensionRegistry* extreg,
168 int options, upb_Arena* arena) {
169 google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena);
170 if (!ret) return NULL;
171 if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msg_init, extreg, options, arena) !=
172 kUpb_DecodeStatus_Ok) {
173 return NULL;
174 }
175 return ret;
176 }
google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value * msg,upb_Arena * arena,size_t * len)177 UPB_INLINE char* google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value* msg, upb_Arena* arena, size_t* len) {
178 char* ptr;
179 (void)upb_Encode(msg, &google_protobuf_Int64Value_msg_init, 0, arena, &ptr, len);
180 return ptr;
181 }
google_protobuf_Int64Value_serialize_ex(const google_protobuf_Int64Value * msg,int options,upb_Arena * arena,size_t * len)182 UPB_INLINE char* google_protobuf_Int64Value_serialize_ex(const google_protobuf_Int64Value* msg, int options,
183 upb_Arena* arena, size_t* len) {
184 char* ptr;
185 (void)upb_Encode(msg, &google_protobuf_Int64Value_msg_init, options, arena, &ptr, len);
186 return ptr;
187 }
google_protobuf_Int64Value_clear_value(google_protobuf_Int64Value * msg)188 UPB_INLINE void google_protobuf_Int64Value_clear_value(google_protobuf_Int64Value* msg) {
189 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
190 _upb_Message_ClearNonExtensionField(msg, &field);
191 }
google_protobuf_Int64Value_value(const google_protobuf_Int64Value * msg)192 UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value* msg) {
193 int64_t default_val = (int64_t)0ll;
194 int64_t ret;
195 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
196 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
197 return ret;
198 }
199
google_protobuf_Int64Value_set_value(google_protobuf_Int64Value * msg,int64_t value)200 UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) {
201 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
202 _upb_Message_SetNonExtensionField(msg, &field, &value);
203 }
204
205 /* google.protobuf.UInt64Value */
206
google_protobuf_UInt64Value_new(upb_Arena * arena)207 UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_new(upb_Arena* arena) {
208 return (google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena);
209 }
google_protobuf_UInt64Value_parse(const char * buf,size_t size,upb_Arena * arena)210 UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse(const char* buf, size_t size, upb_Arena* arena) {
211 google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena);
212 if (!ret) return NULL;
213 if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
214 return NULL;
215 }
216 return ret;
217 }
google_protobuf_UInt64Value_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)218 UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse_ex(const char* buf, size_t size,
219 const upb_ExtensionRegistry* extreg,
220 int options, upb_Arena* arena) {
221 google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena);
222 if (!ret) return NULL;
223 if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msg_init, extreg, options, arena) !=
224 kUpb_DecodeStatus_Ok) {
225 return NULL;
226 }
227 return ret;
228 }
google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value * msg,upb_Arena * arena,size_t * len)229 UPB_INLINE char* google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value* msg, upb_Arena* arena, size_t* len) {
230 char* ptr;
231 (void)upb_Encode(msg, &google_protobuf_UInt64Value_msg_init, 0, arena, &ptr, len);
232 return ptr;
233 }
google_protobuf_UInt64Value_serialize_ex(const google_protobuf_UInt64Value * msg,int options,upb_Arena * arena,size_t * len)234 UPB_INLINE char* google_protobuf_UInt64Value_serialize_ex(const google_protobuf_UInt64Value* msg, int options,
235 upb_Arena* arena, size_t* len) {
236 char* ptr;
237 (void)upb_Encode(msg, &google_protobuf_UInt64Value_msg_init, options, arena, &ptr, len);
238 return ptr;
239 }
google_protobuf_UInt64Value_clear_value(google_protobuf_UInt64Value * msg)240 UPB_INLINE void google_protobuf_UInt64Value_clear_value(google_protobuf_UInt64Value* msg) {
241 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
242 _upb_Message_ClearNonExtensionField(msg, &field);
243 }
google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value * msg)244 UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value* msg) {
245 uint64_t default_val = (uint64_t)0ull;
246 uint64_t ret;
247 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
248 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
249 return ret;
250 }
251
google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value * msg,uint64_t value)252 UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) {
253 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
254 _upb_Message_SetNonExtensionField(msg, &field, &value);
255 }
256
257 /* google.protobuf.Int32Value */
258
google_protobuf_Int32Value_new(upb_Arena * arena)259 UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_new(upb_Arena* arena) {
260 return (google_protobuf_Int32Value*)_upb_Message_New(&google_protobuf_Int32Value_msg_init, arena);
261 }
google_protobuf_Int32Value_parse(const char * buf,size_t size,upb_Arena * arena)262 UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse(const char* buf, size_t size, upb_Arena* arena) {
263 google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena);
264 if (!ret) return NULL;
265 if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
266 return NULL;
267 }
268 return ret;
269 }
google_protobuf_Int32Value_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)270 UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse_ex(const char* buf, size_t size,
271 const upb_ExtensionRegistry* extreg,
272 int options, upb_Arena* arena) {
273 google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena);
274 if (!ret) return NULL;
275 if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msg_init, extreg, options, arena) !=
276 kUpb_DecodeStatus_Ok) {
277 return NULL;
278 }
279 return ret;
280 }
google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value * msg,upb_Arena * arena,size_t * len)281 UPB_INLINE char* google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value* msg, upb_Arena* arena, size_t* len) {
282 char* ptr;
283 (void)upb_Encode(msg, &google_protobuf_Int32Value_msg_init, 0, arena, &ptr, len);
284 return ptr;
285 }
google_protobuf_Int32Value_serialize_ex(const google_protobuf_Int32Value * msg,int options,upb_Arena * arena,size_t * len)286 UPB_INLINE char* google_protobuf_Int32Value_serialize_ex(const google_protobuf_Int32Value* msg, int options,
287 upb_Arena* arena, size_t* len) {
288 char* ptr;
289 (void)upb_Encode(msg, &google_protobuf_Int32Value_msg_init, options, arena, &ptr, len);
290 return ptr;
291 }
google_protobuf_Int32Value_clear_value(google_protobuf_Int32Value * msg)292 UPB_INLINE void google_protobuf_Int32Value_clear_value(google_protobuf_Int32Value* msg) {
293 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
294 _upb_Message_ClearNonExtensionField(msg, &field);
295 }
google_protobuf_Int32Value_value(const google_protobuf_Int32Value * msg)296 UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value* msg) {
297 int32_t default_val = (int32_t)0;
298 int32_t ret;
299 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
300 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
301 return ret;
302 }
303
google_protobuf_Int32Value_set_value(google_protobuf_Int32Value * msg,int32_t value)304 UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) {
305 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
306 _upb_Message_SetNonExtensionField(msg, &field, &value);
307 }
308
309 /* google.protobuf.UInt32Value */
310
google_protobuf_UInt32Value_new(upb_Arena * arena)311 UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_new(upb_Arena* arena) {
312 return (google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msg_init, arena);
313 }
google_protobuf_UInt32Value_parse(const char * buf,size_t size,upb_Arena * arena)314 UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse(const char* buf, size_t size, upb_Arena* arena) {
315 google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena);
316 if (!ret) return NULL;
317 if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
318 return NULL;
319 }
320 return ret;
321 }
google_protobuf_UInt32Value_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)322 UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse_ex(const char* buf, size_t size,
323 const upb_ExtensionRegistry* extreg,
324 int options, upb_Arena* arena) {
325 google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena);
326 if (!ret) return NULL;
327 if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msg_init, extreg, options, arena) !=
328 kUpb_DecodeStatus_Ok) {
329 return NULL;
330 }
331 return ret;
332 }
google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value * msg,upb_Arena * arena,size_t * len)333 UPB_INLINE char* google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value* msg, upb_Arena* arena, size_t* len) {
334 char* ptr;
335 (void)upb_Encode(msg, &google_protobuf_UInt32Value_msg_init, 0, arena, &ptr, len);
336 return ptr;
337 }
google_protobuf_UInt32Value_serialize_ex(const google_protobuf_UInt32Value * msg,int options,upb_Arena * arena,size_t * len)338 UPB_INLINE char* google_protobuf_UInt32Value_serialize_ex(const google_protobuf_UInt32Value* msg, int options,
339 upb_Arena* arena, size_t* len) {
340 char* ptr;
341 (void)upb_Encode(msg, &google_protobuf_UInt32Value_msg_init, options, arena, &ptr, len);
342 return ptr;
343 }
google_protobuf_UInt32Value_clear_value(google_protobuf_UInt32Value * msg)344 UPB_INLINE void google_protobuf_UInt32Value_clear_value(google_protobuf_UInt32Value* msg) {
345 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
346 _upb_Message_ClearNonExtensionField(msg, &field);
347 }
google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value * msg)348 UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value* msg) {
349 uint32_t default_val = (uint32_t)0u;
350 uint32_t ret;
351 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
352 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
353 return ret;
354 }
355
google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value * msg,uint32_t value)356 UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) {
357 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
358 _upb_Message_SetNonExtensionField(msg, &field, &value);
359 }
360
361 /* google.protobuf.BoolValue */
362
google_protobuf_BoolValue_new(upb_Arena * arena)363 UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_new(upb_Arena* arena) {
364 return (google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena);
365 }
google_protobuf_BoolValue_parse(const char * buf,size_t size,upb_Arena * arena)366 UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse(const char* buf, size_t size, upb_Arena* arena) {
367 google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena);
368 if (!ret) return NULL;
369 if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
370 return NULL;
371 }
372 return ret;
373 }
google_protobuf_BoolValue_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)374 UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse_ex(const char* buf, size_t size,
375 const upb_ExtensionRegistry* extreg,
376 int options, upb_Arena* arena) {
377 google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena);
378 if (!ret) return NULL;
379 if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msg_init, extreg, options, arena) !=
380 kUpb_DecodeStatus_Ok) {
381 return NULL;
382 }
383 return ret;
384 }
google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue * msg,upb_Arena * arena,size_t * len)385 UPB_INLINE char* google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue* msg, upb_Arena* arena, size_t* len) {
386 char* ptr;
387 (void)upb_Encode(msg, &google_protobuf_BoolValue_msg_init, 0, arena, &ptr, len);
388 return ptr;
389 }
google_protobuf_BoolValue_serialize_ex(const google_protobuf_BoolValue * msg,int options,upb_Arena * arena,size_t * len)390 UPB_INLINE char* google_protobuf_BoolValue_serialize_ex(const google_protobuf_BoolValue* msg, int options,
391 upb_Arena* arena, size_t* len) {
392 char* ptr;
393 (void)upb_Encode(msg, &google_protobuf_BoolValue_msg_init, options, arena, &ptr, len);
394 return ptr;
395 }
google_protobuf_BoolValue_clear_value(google_protobuf_BoolValue * msg)396 UPB_INLINE void google_protobuf_BoolValue_clear_value(google_protobuf_BoolValue* msg) {
397 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
398 _upb_Message_ClearNonExtensionField(msg, &field);
399 }
google_protobuf_BoolValue_value(const google_protobuf_BoolValue * msg)400 UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue* msg) {
401 bool default_val = false;
402 bool ret;
403 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
404 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
405 return ret;
406 }
407
google_protobuf_BoolValue_set_value(google_protobuf_BoolValue * msg,bool value)408 UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) {
409 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
410 _upb_Message_SetNonExtensionField(msg, &field, &value);
411 }
412
413 /* google.protobuf.StringValue */
414
google_protobuf_StringValue_new(upb_Arena * arena)415 UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_new(upb_Arena* arena) {
416 return (google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msg_init, arena);
417 }
google_protobuf_StringValue_parse(const char * buf,size_t size,upb_Arena * arena)418 UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse(const char* buf, size_t size, upb_Arena* arena) {
419 google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena);
420 if (!ret) return NULL;
421 if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
422 return NULL;
423 }
424 return ret;
425 }
google_protobuf_StringValue_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)426 UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse_ex(const char* buf, size_t size,
427 const upb_ExtensionRegistry* extreg,
428 int options, upb_Arena* arena) {
429 google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena);
430 if (!ret) return NULL;
431 if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msg_init, extreg, options, arena) !=
432 kUpb_DecodeStatus_Ok) {
433 return NULL;
434 }
435 return ret;
436 }
google_protobuf_StringValue_serialize(const google_protobuf_StringValue * msg,upb_Arena * arena,size_t * len)437 UPB_INLINE char* google_protobuf_StringValue_serialize(const google_protobuf_StringValue* msg, upb_Arena* arena, size_t* len) {
438 char* ptr;
439 (void)upb_Encode(msg, &google_protobuf_StringValue_msg_init, 0, arena, &ptr, len);
440 return ptr;
441 }
google_protobuf_StringValue_serialize_ex(const google_protobuf_StringValue * msg,int options,upb_Arena * arena,size_t * len)442 UPB_INLINE char* google_protobuf_StringValue_serialize_ex(const google_protobuf_StringValue* msg, int options,
443 upb_Arena* arena, size_t* len) {
444 char* ptr;
445 (void)upb_Encode(msg, &google_protobuf_StringValue_msg_init, options, arena, &ptr, len);
446 return ptr;
447 }
google_protobuf_StringValue_clear_value(google_protobuf_StringValue * msg)448 UPB_INLINE void google_protobuf_StringValue_clear_value(google_protobuf_StringValue* msg) {
449 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
450 _upb_Message_ClearNonExtensionField(msg, &field);
451 }
google_protobuf_StringValue_value(const google_protobuf_StringValue * msg)452 UPB_INLINE upb_StringView google_protobuf_StringValue_value(const google_protobuf_StringValue* msg) {
453 upb_StringView default_val = upb_StringView_FromString("");
454 upb_StringView ret;
455 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
456 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
457 return ret;
458 }
459
google_protobuf_StringValue_set_value(google_protobuf_StringValue * msg,upb_StringView value)460 UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_StringView value) {
461 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
462 _upb_Message_SetNonExtensionField(msg, &field, &value);
463 }
464
465 /* google.protobuf.BytesValue */
466
google_protobuf_BytesValue_new(upb_Arena * arena)467 UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_new(upb_Arena* arena) {
468 return (google_protobuf_BytesValue*)_upb_Message_New(&google_protobuf_BytesValue_msg_init, arena);
469 }
google_protobuf_BytesValue_parse(const char * buf,size_t size,upb_Arena * arena)470 UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse(const char* buf, size_t size, upb_Arena* arena) {
471 google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena);
472 if (!ret) return NULL;
473 if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
474 return NULL;
475 }
476 return ret;
477 }
google_protobuf_BytesValue_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)478 UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse_ex(const char* buf, size_t size,
479 const upb_ExtensionRegistry* extreg,
480 int options, upb_Arena* arena) {
481 google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena);
482 if (!ret) return NULL;
483 if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msg_init, extreg, options, arena) !=
484 kUpb_DecodeStatus_Ok) {
485 return NULL;
486 }
487 return ret;
488 }
google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue * msg,upb_Arena * arena,size_t * len)489 UPB_INLINE char* google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue* msg, upb_Arena* arena, size_t* len) {
490 char* ptr;
491 (void)upb_Encode(msg, &google_protobuf_BytesValue_msg_init, 0, arena, &ptr, len);
492 return ptr;
493 }
google_protobuf_BytesValue_serialize_ex(const google_protobuf_BytesValue * msg,int options,upb_Arena * arena,size_t * len)494 UPB_INLINE char* google_protobuf_BytesValue_serialize_ex(const google_protobuf_BytesValue* msg, int options,
495 upb_Arena* arena, size_t* len) {
496 char* ptr;
497 (void)upb_Encode(msg, &google_protobuf_BytesValue_msg_init, options, arena, &ptr, len);
498 return ptr;
499 }
google_protobuf_BytesValue_clear_value(google_protobuf_BytesValue * msg)500 UPB_INLINE void google_protobuf_BytesValue_clear_value(google_protobuf_BytesValue* msg) {
501 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
502 _upb_Message_ClearNonExtensionField(msg, &field);
503 }
google_protobuf_BytesValue_value(const google_protobuf_BytesValue * msg)504 UPB_INLINE upb_StringView google_protobuf_BytesValue_value(const google_protobuf_BytesValue* msg) {
505 upb_StringView default_val = upb_StringView_FromString("");
506 upb_StringView ret;
507 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
508 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
509 return ret;
510 }
511
google_protobuf_BytesValue_set_value(google_protobuf_BytesValue * msg,upb_StringView value)512 UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_StringView value) {
513 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
514 _upb_Message_SetNonExtensionField(msg, &field, &value);
515 }
516
517 extern const upb_MiniTableFile google_protobuf_wrappers_proto_upb_file_layout;
518
519 #ifdef __cplusplus
520 } /* extern "C" */
521 #endif
522
523 #include "upb/port/undef.inc"
524
525 #endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ */
526