• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Amalgamated source file */
2 #include <stdint.h>/*
3 * This is where we define macros used across upb.
4 *
5 * All of these macros are undef'd in port_undef.inc to avoid leaking them to
6 * users.
7 *
8 * The correct usage is:
9 *
10 *   #include "upb/foobar.h"
11 *   #include "upb/baz.h"
12 *
13 *   // MUST be last included header.
14 *   #include "upb/port_def.inc"
15 *
16 *   // Code for this file.
17 *   // <...>
18 *
19 *   // Can be omitted for .c files, required for .h.
20 *   #include "upb/port_undef.inc"
21 *
22 * This file is private and must not be included by users!
23 */
24 #include <stdint.h>
25 #include <stddef.h>
26 
27 #if UINTPTR_MAX == 0xffffffff
28 #define UPB_SIZE(size32, size64) size32
29 #else
30 #define UPB_SIZE(size32, size64) size64
31 #endif
32 
33 /* If we always read/write as a consistent type to each address, this shouldn't
34  * violate aliasing.
35  */
36 #define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
37 
38 #define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
39   *UPB_PTR_AT(msg, case_offset, int) == case_val                              \
40       ? *UPB_PTR_AT(msg, offset, fieldtype)                                   \
41       : default
42 
43 #define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
44   *UPB_PTR_AT(msg, case_offset, int) = case_val;                             \
45   *UPB_PTR_AT(msg, offset, fieldtype) = value;
46 
47 #define UPB_MAPTYPE_STRING 0
48 
49 /* UPB_INLINE: inline if possible, emit standalone code if required. */
50 #ifdef __cplusplus
51 #define UPB_INLINE inline
52 #elif defined (__GNUC__) || defined(__clang__)
53 #define UPB_INLINE static __inline__
54 #else
55 #define UPB_INLINE static
56 #endif
57 
58 #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align))
59 #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align))
60 #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, 16)
61 #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
62 
63 /* Hints to the compiler about likely/unlikely branches. */
64 #if defined (__GNUC__) || defined(__clang__)
65 #define UPB_LIKELY(x) __builtin_expect((x),1)
66 #define UPB_UNLIKELY(x) __builtin_expect((x),0)
67 #else
68 #define UPB_LIKELY(x) (x)
69 #define UPB_UNLIKELY(x) (x)
70 #endif
71 
72 /* Define UPB_BIG_ENDIAN manually if you're on big endian and your compiler
73  * doesn't provide these preprocessor symbols. */
74 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
75 #define UPB_BIG_ENDIAN
76 #endif
77 
78 /* Macros for function attributes on compilers that support them. */
79 #ifdef __GNUC__
80 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
81 #define UPB_NOINLINE __attribute__((noinline))
82 #define UPB_NORETURN __attribute__((__noreturn__))
83 #else  /* !defined(__GNUC__) */
84 #define UPB_FORCEINLINE
85 #define UPB_NOINLINE
86 #define UPB_NORETURN
87 #endif
88 
89 #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
90 /* C99/C++11 versions. */
91 #include <stdio.h>
92 #define _upb_snprintf snprintf
93 #define _upb_vsnprintf vsnprintf
94 #define _upb_va_copy(a, b) va_copy(a, b)
95 #elif defined(_MSC_VER)
96 /* Microsoft C/C++ versions. */
97 #include <stdarg.h>
98 #include <stdio.h>
99 #if _MSC_VER < 1900
100 int msvc_snprintf(char* s, size_t n, const char* format, ...);
101 int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
102 #define UPB_MSVC_VSNPRINTF
103 #define _upb_snprintf msvc_snprintf
104 #define _upb_vsnprintf msvc_vsnprintf
105 #else
106 #define _upb_snprintf snprintf
107 #define _upb_vsnprintf vsnprintf
108 #endif
109 #define _upb_va_copy(a, b) va_copy(a, b)
110 #elif defined __GNUC__
111 /* A few hacky workarounds for functions not in C89.
112  * For internal use only!
113  * TODO(haberman): fix these by including our own implementations, or finding
114  * another workaround.
115  */
116 #define _upb_snprintf __builtin_snprintf
117 #define _upb_vsnprintf __builtin_vsnprintf
118 #define _upb_va_copy(a, b) __va_copy(a, b)
119 #else
120 #error Need implementations of [v]snprintf and va_copy
121 #endif
122 
123 #ifdef __cplusplus
124 #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \
125     (defined(_MSC_VER) && _MSC_VER >= 1900)
126 /* C++11 is present */
127 #else
128 #error upb requires C++11 for C++ support
129 #endif
130 #endif
131 
132 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
133 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
134 
135 #define UPB_UNUSED(var) (void)var
136 
137 /* UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
138  */
139 #ifdef NDEBUG
140 #ifdef __GNUC__
141 #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
142 #elif defined _MSC_VER
143 #define UPB_ASSUME(expr) if (!(expr)) __assume(0)
144 #else
145 #define UPB_ASSUME(expr) do {} if (false && (expr))
146 #endif
147 #else
148 #define UPB_ASSUME(expr) assert(expr)
149 #endif
150 
151 /* UPB_ASSERT(): in release mode, we use the expression without letting it be
152  * evaluated.  This prevents "unused variable" warnings. */
153 #ifdef NDEBUG
154 #define UPB_ASSERT(expr) do {} while (false && (expr))
155 #else
156 #define UPB_ASSERT(expr) assert(expr)
157 #endif
158 
159 /* UPB_ASSERT_DEBUGVAR(): assert that uses functions or variables that only
160  * exist in debug mode.  This turns into regular assert. */
161 #define UPB_ASSERT_DEBUGVAR(expr) assert(expr)
162 
163 #if defined(__GNUC__) || defined(__clang__)
164 #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
165 #else
166 #define UPB_UNREACHABLE() do { assert(0); } while(0)
167 #endif
168 
169 /* UPB_INFINITY representing floating-point positive infinity. */
170 #include <math.h>
171 #ifdef INFINITY
172 #define UPB_INFINITY INFINITY
173 #else
174 #define UPB_INFINITY (1.0 / 0.0)
175 #endif
176 #ifdef NAN
177 #define UPB_NAN NAN
178 #else
179 #define UPB_NAN (0.0 / 0.0)
180 #endif
181 /*
182 ** upb_decode: parsing into a upb_msg using a upb_msglayout.
183 */
184 
185 #ifndef UPB_DECODE_H_
186 #define UPB_DECODE_H_
187 
188 /*
189 ** Our memory representation for parsing tables and messages themselves.
190 ** Functions in this file are used by generated code and possibly reflection.
191 **
192 ** The definitions in this file are internal to upb.
193 **/
194 
195 #ifndef UPB_MSG_H_
196 #define UPB_MSG_H_
197 
198 #include <stdint.h>
199 #include <string.h>
200 
201 /*
202 ** upb_table
203 **
204 ** This header is INTERNAL-ONLY!  Its interfaces are not public or stable!
205 ** This file defines very fast int->upb_value (inttable) and string->upb_value
206 ** (strtable) hash tables.
207 **
208 ** The table uses chained scatter with Brent's variation (inspired by the Lua
209 ** implementation of hash tables).  The hash function for strings is Austin
210 ** Appleby's "MurmurHash."
211 **
212 ** The inttable uses uintptr_t as its key, which guarantees it can be used to
213 ** store pointers or integers of at least 32 bits (upb isn't really useful on
214 ** systems where sizeof(void*) < 4).
215 **
216 ** The table must be homogenous (all values of the same type).  In debug
217 ** mode, we check this on insert and lookup.
218 */
219 
220 #ifndef UPB_TABLE_H_
221 #define UPB_TABLE_H_
222 
223 #include <stdint.h>
224 #include <string.h>
225 /*
226 ** This file contains shared definitions that are widely used across upb.
227 */
228 
229 #ifndef UPB_H_
230 #define UPB_H_
231 
232 #include <assert.h>
233 #include <stdarg.h>
234 #include <stdbool.h>
235 #include <stddef.h>
236 #include <stdint.h>
237 #include <string.h>
238 
239 
240 #ifdef __cplusplus
241 extern "C" {
242 #endif
243 
244 /* upb_status *****************************************************************/
245 
246 #define UPB_STATUS_MAX_MESSAGE 127
247 
248 typedef struct {
249   bool ok;
250   char msg[UPB_STATUS_MAX_MESSAGE];  /* Error message; NULL-terminated. */
251 } upb_status;
252 
253 const char *upb_status_errmsg(const upb_status *status);
254 bool upb_ok(const upb_status *status);
255 
256 /* These are no-op if |status| is NULL. */
257 void upb_status_clear(upb_status *status);
258 void upb_status_seterrmsg(upb_status *status, const char *msg);
259 void upb_status_seterrf(upb_status *status, const char *fmt, ...);
260 void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args);
261 void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args);
262 
263 /** upb_strview ************************************************************/
264 
265 typedef struct {
266   const char *data;
267   size_t size;
268 } upb_strview;
269 
upb_strview_make(const char * data,size_t size)270 UPB_INLINE upb_strview upb_strview_make(const char *data, size_t size) {
271   upb_strview ret;
272   ret.data = data;
273   ret.size = size;
274   return ret;
275 }
276 
upb_strview_makez(const char * data)277 UPB_INLINE upb_strview upb_strview_makez(const char *data) {
278   return upb_strview_make(data, strlen(data));
279 }
280 
upb_strview_eql(upb_strview a,upb_strview b)281 UPB_INLINE bool upb_strview_eql(upb_strview a, upb_strview b) {
282   return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
283 }
284 
285 #define UPB_STRVIEW_INIT(ptr, len) {ptr, len}
286 
287 #define UPB_STRVIEW_FORMAT "%.*s"
288 #define UPB_STRVIEW_ARGS(view) (int)(view).size, (view).data
289 
290 /** upb_alloc *****************************************************************/
291 
292 /* A upb_alloc is a possibly-stateful allocator object.
293  *
294  * It could either be an arena allocator (which doesn't require individual
295  * free() calls) or a regular malloc() (which does).  The client must therefore
296  * free memory unless it knows that the allocator is an arena allocator. */
297 
298 struct upb_alloc;
299 typedef struct upb_alloc upb_alloc;
300 
301 /* A malloc()/free() function.
302  * If "size" is 0 then the function acts like free(), otherwise it acts like
303  * realloc().  Only "oldsize" bytes from a previous allocation are preserved. */
304 typedef void *upb_alloc_func(upb_alloc *alloc, void *ptr, size_t oldsize,
305                              size_t size);
306 
307 struct upb_alloc {
308   upb_alloc_func *func;
309 };
310 
upb_malloc(upb_alloc * alloc,size_t size)311 UPB_INLINE void *upb_malloc(upb_alloc *alloc, size_t size) {
312   UPB_ASSERT(alloc);
313   return alloc->func(alloc, NULL, 0, size);
314 }
315 
upb_realloc(upb_alloc * alloc,void * ptr,size_t oldsize,size_t size)316 UPB_INLINE void *upb_realloc(upb_alloc *alloc, void *ptr, size_t oldsize,
317                              size_t size) {
318   UPB_ASSERT(alloc);
319   return alloc->func(alloc, ptr, oldsize, size);
320 }
321 
upb_free(upb_alloc * alloc,void * ptr)322 UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr) {
323   assert(alloc);
324   alloc->func(alloc, ptr, 0, 0);
325 }
326 
327 /* The global allocator used by upb.  Uses the standard malloc()/free(). */
328 
329 extern upb_alloc upb_alloc_global;
330 
331 /* Functions that hard-code the global malloc.
332  *
333  * We still get benefit because we can put custom logic into our global
334  * allocator, like injecting out-of-memory faults in debug/testing builds. */
335 
upb_gmalloc(size_t size)336 UPB_INLINE void *upb_gmalloc(size_t size) {
337   return upb_malloc(&upb_alloc_global, size);
338 }
339 
upb_grealloc(void * ptr,size_t oldsize,size_t size)340 UPB_INLINE void *upb_grealloc(void *ptr, size_t oldsize, size_t size) {
341   return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
342 }
343 
upb_gfree(void * ptr)344 UPB_INLINE void upb_gfree(void *ptr) {
345   upb_free(&upb_alloc_global, ptr);
346 }
347 
348 /* upb_arena ******************************************************************/
349 
350 /* upb_arena is a specific allocator implementation that uses arena allocation.
351  * The user provides an allocator that will be used to allocate the underlying
352  * arena blocks.  Arenas by nature do not require the individual allocations
353  * to be freed.  However the Arena does allow users to register cleanup
354  * functions that will run when the arena is destroyed.
355  *
356  * A upb_arena is *not* thread-safe.
357  *
358  * You could write a thread-safe arena allocator that satisfies the
359  * upb_alloc interface, but it would not be as efficient for the
360  * single-threaded case. */
361 
362 typedef void upb_cleanup_func(void *ud);
363 
364 struct upb_arena;
365 typedef struct upb_arena upb_arena;
366 
367 typedef struct {
368   /* We implement the allocator interface.
369    * This must be the first member of upb_arena!
370    * TODO(haberman): remove once handlers are gone. */
371   upb_alloc alloc;
372 
373   char *ptr, *end;
374 } _upb_arena_head;
375 
376 /* Creates an arena from the given initial block (if any -- n may be 0).
377  * Additional blocks will be allocated from |alloc|.  If |alloc| is NULL, this
378  * is a fixed-size arena and cannot grow. */
379 upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc);
380 void upb_arena_free(upb_arena *a);
381 bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func);
382 void upb_arena_fuse(upb_arena *a, upb_arena *b);
383 void *_upb_arena_slowmalloc(upb_arena *a, size_t size);
384 
upb_arena_alloc(upb_arena * a)385 UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
386 
upb_arena_malloc(upb_arena * a,size_t size)387 UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
388   _upb_arena_head *h = (_upb_arena_head*)a;
389   void* ret;
390   size = UPB_ALIGN_MALLOC(size);
391 
392   if (UPB_UNLIKELY((size_t)(h->end - h->ptr) < size)) {
393     return _upb_arena_slowmalloc(a, size);
394   }
395 
396   ret = h->ptr;
397   h->ptr += size;
398   return ret;
399 }
400 
upb_arena_realloc(upb_arena * a,void * ptr,size_t oldsize,size_t size)401 UPB_INLINE void *upb_arena_realloc(upb_arena *a, void *ptr, size_t oldsize,
402                                    size_t size) {
403   void *ret = upb_arena_malloc(a, size);
404 
405   if (ret && oldsize > 0) {
406     memcpy(ret, ptr, oldsize);
407   }
408 
409   return ret;
410 }
411 
upb_arena_new(void)412 UPB_INLINE upb_arena *upb_arena_new(void) {
413   return upb_arena_init(NULL, 0, &upb_alloc_global);
414 }
415 
416 /* Constants ******************************************************************/
417 
418 /* Generic function type. */
419 typedef void upb_func(void);
420 
421 /* A list of types as they are encoded on-the-wire. */
422 typedef enum {
423   UPB_WIRE_TYPE_VARINT      = 0,
424   UPB_WIRE_TYPE_64BIT       = 1,
425   UPB_WIRE_TYPE_DELIMITED   = 2,
426   UPB_WIRE_TYPE_START_GROUP = 3,
427   UPB_WIRE_TYPE_END_GROUP   = 4,
428   UPB_WIRE_TYPE_32BIT       = 5
429 } upb_wiretype_t;
430 
431 /* The types a field can have.  Note that this list is not identical to the
432  * types defined in descriptor.proto, which gives INT32 and SINT32 separate
433  * types (we distinguish the two with the "integer encoding" enum below). */
434 typedef enum {
435   UPB_TYPE_BOOL     = 1,
436   UPB_TYPE_FLOAT    = 2,
437   UPB_TYPE_INT32    = 3,
438   UPB_TYPE_UINT32   = 4,
439   UPB_TYPE_ENUM     = 5,  /* Enum values are int32. */
440   UPB_TYPE_MESSAGE  = 6,
441   UPB_TYPE_DOUBLE   = 7,
442   UPB_TYPE_INT64    = 8,
443   UPB_TYPE_UINT64   = 9,
444   UPB_TYPE_STRING   = 10,
445   UPB_TYPE_BYTES    = 11
446 } upb_fieldtype_t;
447 
448 /* The repeated-ness of each field; this matches descriptor.proto. */
449 typedef enum {
450   UPB_LABEL_OPTIONAL = 1,
451   UPB_LABEL_REQUIRED = 2,
452   UPB_LABEL_REPEATED = 3
453 } upb_label_t;
454 
455 /* Descriptor types, as defined in descriptor.proto. */
456 typedef enum {
457   /* Old (long) names.  TODO(haberman): remove */
458   UPB_DESCRIPTOR_TYPE_DOUBLE   = 1,
459   UPB_DESCRIPTOR_TYPE_FLOAT    = 2,
460   UPB_DESCRIPTOR_TYPE_INT64    = 3,
461   UPB_DESCRIPTOR_TYPE_UINT64   = 4,
462   UPB_DESCRIPTOR_TYPE_INT32    = 5,
463   UPB_DESCRIPTOR_TYPE_FIXED64  = 6,
464   UPB_DESCRIPTOR_TYPE_FIXED32  = 7,
465   UPB_DESCRIPTOR_TYPE_BOOL     = 8,
466   UPB_DESCRIPTOR_TYPE_STRING   = 9,
467   UPB_DESCRIPTOR_TYPE_GROUP    = 10,
468   UPB_DESCRIPTOR_TYPE_MESSAGE  = 11,
469   UPB_DESCRIPTOR_TYPE_BYTES    = 12,
470   UPB_DESCRIPTOR_TYPE_UINT32   = 13,
471   UPB_DESCRIPTOR_TYPE_ENUM     = 14,
472   UPB_DESCRIPTOR_TYPE_SFIXED32 = 15,
473   UPB_DESCRIPTOR_TYPE_SFIXED64 = 16,
474   UPB_DESCRIPTOR_TYPE_SINT32   = 17,
475   UPB_DESCRIPTOR_TYPE_SINT64   = 18,
476 
477   UPB_DTYPE_DOUBLE   = 1,
478   UPB_DTYPE_FLOAT    = 2,
479   UPB_DTYPE_INT64    = 3,
480   UPB_DTYPE_UINT64   = 4,
481   UPB_DTYPE_INT32    = 5,
482   UPB_DTYPE_FIXED64  = 6,
483   UPB_DTYPE_FIXED32  = 7,
484   UPB_DTYPE_BOOL     = 8,
485   UPB_DTYPE_STRING   = 9,
486   UPB_DTYPE_GROUP    = 10,
487   UPB_DTYPE_MESSAGE  = 11,
488   UPB_DTYPE_BYTES    = 12,
489   UPB_DTYPE_UINT32   = 13,
490   UPB_DTYPE_ENUM     = 14,
491   UPB_DTYPE_SFIXED32 = 15,
492   UPB_DTYPE_SFIXED64 = 16,
493   UPB_DTYPE_SINT32   = 17,
494   UPB_DTYPE_SINT64   = 18
495 } upb_descriptortype_t;
496 
497 #define UPB_MAP_BEGIN ((size_t)-1)
498 
499 
500 #ifdef __cplusplus
501 }  /* extern "C" */
502 #endif
503 
504 #endif  /* UPB_H_ */
505 
506 
507 #ifdef __cplusplus
508 extern "C" {
509 #endif
510 
511 
512 /* upb_value ******************************************************************/
513 
514 /* A tagged union (stored untagged inside the table) so that we can check that
515  * clients calling table accessors are correctly typed without having to have
516  * an explosion of accessors. */
517 typedef enum {
518   UPB_CTYPE_INT32    = 1,
519   UPB_CTYPE_INT64    = 2,
520   UPB_CTYPE_UINT32   = 3,
521   UPB_CTYPE_UINT64   = 4,
522   UPB_CTYPE_BOOL     = 5,
523   UPB_CTYPE_CSTR     = 6,
524   UPB_CTYPE_PTR      = 7,
525   UPB_CTYPE_CONSTPTR = 8,
526   UPB_CTYPE_FPTR     = 9,
527   UPB_CTYPE_FLOAT    = 10,
528   UPB_CTYPE_DOUBLE   = 11
529 } upb_ctype_t;
530 
531 typedef struct {
532   uint64_t val;
533 } upb_value;
534 
535 /* Like strdup(), which isn't always available since it's not ANSI C. */
536 char *upb_strdup(const char *s, upb_alloc *a);
537 /* Variant that works with a length-delimited rather than NULL-delimited string,
538  * as supported by strtable. */
539 char *upb_strdup2(const char *s, size_t len, upb_alloc *a);
540 
upb_gstrdup(const char * s)541 UPB_INLINE char *upb_gstrdup(const char *s) {
542   return upb_strdup(s, &upb_alloc_global);
543 }
544 
_upb_value_setval(upb_value * v,uint64_t val)545 UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val) {
546   v->val = val;
547 }
548 
_upb_value_val(uint64_t val)549 UPB_INLINE upb_value _upb_value_val(uint64_t val) {
550   upb_value ret;
551   _upb_value_setval(&ret, val);
552   return ret;
553 }
554 
555 /* For each value ctype, define the following set of functions:
556  *
557  * // Get/set an int32 from a upb_value.
558  * int32_t upb_value_getint32(upb_value val);
559  * void upb_value_setint32(upb_value *val, int32_t cval);
560  *
561  * // Construct a new upb_value from an int32.
562  * upb_value upb_value_int32(int32_t val); */
563 #define FUNCS(name, membername, type_t, converter, proto_type) \
564   UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \
565     val->val = (converter)cval; \
566   } \
567   UPB_INLINE upb_value upb_value_ ## name(type_t val) { \
568     upb_value ret; \
569     upb_value_set ## name(&ret, val); \
570     return ret; \
571   } \
572   UPB_INLINE type_t upb_value_get ## name(upb_value val) { \
573     return (type_t)(converter)val.val; \
574   }
575 
FUNCS(int32,int32,int32_t,int32_t,UPB_CTYPE_INT32)576 FUNCS(int32,    int32,        int32_t,      int32_t,    UPB_CTYPE_INT32)
577 FUNCS(int64,    int64,        int64_t,      int64_t,    UPB_CTYPE_INT64)
578 FUNCS(uint32,   uint32,       uint32_t,     uint32_t,   UPB_CTYPE_UINT32)
579 FUNCS(uint64,   uint64,       uint64_t,     uint64_t,   UPB_CTYPE_UINT64)
580 FUNCS(bool,     _bool,        bool,         bool,       UPB_CTYPE_BOOL)
581 FUNCS(cstr,     cstr,         char*,        uintptr_t,  UPB_CTYPE_CSTR)
582 FUNCS(ptr,      ptr,          void*,        uintptr_t,  UPB_CTYPE_PTR)
583 FUNCS(constptr, constptr,     const void*,  uintptr_t,  UPB_CTYPE_CONSTPTR)
584 FUNCS(fptr,     fptr,         upb_func*,    uintptr_t,  UPB_CTYPE_FPTR)
585 
586 #undef FUNCS
587 
588 UPB_INLINE void upb_value_setfloat(upb_value *val, float cval) {
589   memcpy(&val->val, &cval, sizeof(cval));
590 }
591 
upb_value_setdouble(upb_value * val,double cval)592 UPB_INLINE void upb_value_setdouble(upb_value *val, double cval) {
593   memcpy(&val->val, &cval, sizeof(cval));
594 }
595 
upb_value_float(float cval)596 UPB_INLINE upb_value upb_value_float(float cval) {
597   upb_value ret;
598   upb_value_setfloat(&ret, cval);
599   return ret;
600 }
601 
upb_value_double(double cval)602 UPB_INLINE upb_value upb_value_double(double cval) {
603   upb_value ret;
604   upb_value_setdouble(&ret, cval);
605   return ret;
606 }
607 
608 #undef SET_TYPE
609 
610 
611 /* upb_tabkey *****************************************************************/
612 
613 /* Either:
614  *   1. an actual integer key, or
615  *   2. a pointer to a string prefixed by its uint32_t length, owned by us.
616  *
617  * ...depending on whether this is a string table or an int table.  We would
618  * make this a union of those two types, but C89 doesn't support statically
619  * initializing a non-first union member. */
620 typedef uintptr_t upb_tabkey;
621 
upb_tabstr(upb_tabkey key,uint32_t * len)622 UPB_INLINE char *upb_tabstr(upb_tabkey key, uint32_t *len) {
623   char* mem = (char*)key;
624   if (len) memcpy(len, mem, sizeof(*len));
625   return mem + sizeof(*len);
626 }
627 
628 
629 /* upb_tabval *****************************************************************/
630 
631 typedef struct {
632   uint64_t val;
633 } upb_tabval;
634 
635 #define UPB_TABVALUE_EMPTY_INIT  {-1}
636 
637 /* upb_table ******************************************************************/
638 
639 typedef struct _upb_tabent {
640   upb_tabkey key;
641   upb_tabval val;
642 
643   /* Internal chaining.  This is const so we can create static initializers for
644    * tables.  We cast away const sometimes, but *only* when the containing
645    * upb_table is known to be non-const.  This requires a bit of care, but
646    * the subtlety is confined to table.c. */
647   const struct _upb_tabent *next;
648 } upb_tabent;
649 
650 typedef struct {
651   size_t count;          /* Number of entries in the hash part. */
652   size_t mask;           /* Mask to turn hash value -> bucket. */
653   uint8_t size_lg2;      /* Size of the hashtable part is 2^size_lg2 entries. */
654 
655   /* Hash table entries.
656    * Making this const isn't entirely accurate; what we really want is for it to
657    * have the same const-ness as the table it's inside.  But there's no way to
658    * declare that in C.  So we have to make it const so that we can statically
659    * initialize const hash tables.  Then we cast away const when we have to.
660    */
661   const upb_tabent *entries;
662 } upb_table;
663 
664 typedef struct {
665   upb_table t;
666 } upb_strtable;
667 
668 typedef struct {
669   upb_table t;              /* For entries that don't fit in the array part. */
670   const upb_tabval *array;  /* Array part of the table. See const note above. */
671   size_t array_size;        /* Array part size. */
672   size_t array_count;       /* Array part number of elements. */
673 } upb_inttable;
674 
675 #define UPB_ARRAY_EMPTYENT -1
676 
upb_table_size(const upb_table * t)677 UPB_INLINE size_t upb_table_size(const upb_table *t) {
678   if (t->size_lg2 == 0)
679     return 0;
680   else
681     return 1 << t->size_lg2;
682 }
683 
684 /* Internal-only functions, in .h file only out of necessity. */
upb_tabent_isempty(const upb_tabent * e)685 UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e) {
686   return e->key == 0;
687 }
688 
689 /* Used by some of the unit tests for generic hashing functionality. */
690 uint32_t upb_murmur_hash2(const void * key, size_t len, uint32_t seed);
691 
upb_intkey(uintptr_t key)692 UPB_INLINE uintptr_t upb_intkey(uintptr_t key) {
693   return key;
694 }
695 
upb_inthash(uintptr_t key)696 UPB_INLINE uint32_t upb_inthash(uintptr_t key) {
697   return (uint32_t)key;
698 }
699 
upb_getentry(const upb_table * t,uint32_t hash)700 static const upb_tabent *upb_getentry(const upb_table *t, uint32_t hash) {
701   return t->entries + (hash & t->mask);
702 }
703 
upb_arrhas(upb_tabval key)704 UPB_INLINE bool upb_arrhas(upb_tabval key) {
705   return key.val != (uint64_t)-1;
706 }
707 
708 /* Initialize and uninitialize a table, respectively.  If memory allocation
709  * failed, false is returned that the table is uninitialized. */
710 bool upb_inttable_init2(upb_inttable *table, upb_ctype_t ctype, upb_alloc *a);
711 bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype, upb_alloc *a);
712 void upb_inttable_uninit2(upb_inttable *table, upb_alloc *a);
713 void upb_strtable_uninit2(upb_strtable *table, upb_alloc *a);
714 
upb_inttable_init(upb_inttable * table,upb_ctype_t ctype)715 UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype) {
716   return upb_inttable_init2(table, ctype, &upb_alloc_global);
717 }
718 
upb_strtable_init(upb_strtable * table,upb_ctype_t ctype)719 UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype) {
720   return upb_strtable_init2(table, ctype, &upb_alloc_global);
721 }
722 
upb_inttable_uninit(upb_inttable * table)723 UPB_INLINE void upb_inttable_uninit(upb_inttable *table) {
724   upb_inttable_uninit2(table, &upb_alloc_global);
725 }
726 
upb_strtable_uninit(upb_strtable * table)727 UPB_INLINE void upb_strtable_uninit(upb_strtable *table) {
728   upb_strtable_uninit2(table, &upb_alloc_global);
729 }
730 
731 /* Returns the number of values in the table. */
732 size_t upb_inttable_count(const upb_inttable *t);
upb_strtable_count(const upb_strtable * t)733 UPB_INLINE size_t upb_strtable_count(const upb_strtable *t) {
734   return t->t.count;
735 }
736 
737 void upb_inttable_packedsize(const upb_inttable *t, size_t *size);
738 void upb_strtable_packedsize(const upb_strtable *t, size_t *size);
739 upb_inttable *upb_inttable_pack(const upb_inttable *t, void *p, size_t *ofs,
740                                 size_t size);
741 upb_strtable *upb_strtable_pack(const upb_strtable *t, void *p, size_t *ofs,
742                                 size_t size);
743 void upb_strtable_clear(upb_strtable *t);
744 
745 /* Inserts the given key into the hashtable with the given value.  The key must
746  * not already exist in the hash table.  For string tables, the key must be
747  * NULL-terminated, and the table will make an internal copy of the key.
748  * Inttables must not insert a value of UINTPTR_MAX.
749  *
750  * If a table resize was required but memory allocation failed, false is
751  * returned and the table is unchanged. */
752 bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
753                           upb_alloc *a);
754 bool upb_strtable_insert3(upb_strtable *t, const char *key, size_t len,
755                           upb_value val, upb_alloc *a);
756 
upb_inttable_insert(upb_inttable * t,uintptr_t key,upb_value val)757 UPB_INLINE bool upb_inttable_insert(upb_inttable *t, uintptr_t key,
758                                     upb_value val) {
759   return upb_inttable_insert2(t, key, val, &upb_alloc_global);
760 }
761 
upb_strtable_insert2(upb_strtable * t,const char * key,size_t len,upb_value val)762 UPB_INLINE bool upb_strtable_insert2(upb_strtable *t, const char *key,
763                                      size_t len, upb_value val) {
764   return upb_strtable_insert3(t, key, len, val, &upb_alloc_global);
765 }
766 
767 /* For NULL-terminated strings. */
upb_strtable_insert(upb_strtable * t,const char * key,upb_value val)768 UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key,
769                                     upb_value val) {
770   return upb_strtable_insert2(t, key, strlen(key), val);
771 }
772 
773 /* Looks up key in this table, returning "true" if the key was found.
774  * If v is non-NULL, copies the value for this key into *v. */
775 bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v);
776 bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len,
777                           upb_value *v);
778 
779 /* For NULL-terminated strings. */
upb_strtable_lookup(const upb_strtable * t,const char * key,upb_value * v)780 UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key,
781                                     upb_value *v) {
782   return upb_strtable_lookup2(t, key, strlen(key), v);
783 }
784 
785 /* Removes an item from the table.  Returns true if the remove was successful,
786  * and stores the removed item in *val if non-NULL. */
787 bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val);
788 bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len,
789                           upb_value *val, upb_alloc *alloc);
790 
upb_strtable_remove2(upb_strtable * t,const char * key,size_t len,upb_value * val)791 UPB_INLINE bool upb_strtable_remove2(upb_strtable *t, const char *key,
792                                      size_t len, upb_value *val) {
793   return upb_strtable_remove3(t, key, len, val, &upb_alloc_global);
794 }
795 
796 /* For NULL-terminated strings. */
upb_strtable_remove(upb_strtable * t,const char * key,upb_value * v)797 UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key,
798                                     upb_value *v) {
799   return upb_strtable_remove2(t, key, strlen(key), v);
800 }
801 
802 /* Updates an existing entry in an inttable.  If the entry does not exist,
803  * returns false and does nothing.  Unlike insert/remove, this does not
804  * invalidate iterators. */
805 bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val);
806 
807 /* Convenience routines for inttables with pointer keys. */
808 bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
809                              upb_alloc *a);
810 bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val);
811 bool upb_inttable_lookupptr(
812     const upb_inttable *t, const void *key, upb_value *val);
813 
upb_inttable_insertptr(upb_inttable * t,const void * key,upb_value val)814 UPB_INLINE bool upb_inttable_insertptr(upb_inttable *t, const void *key,
815                                        upb_value val) {
816   return upb_inttable_insertptr2(t, key, val, &upb_alloc_global);
817 }
818 
819 /* Optimizes the table for the current set of entries, for both memory use and
820  * lookup time.  Client should call this after all entries have been inserted;
821  * inserting more entries is legal, but will likely require a table resize. */
822 void upb_inttable_compact2(upb_inttable *t, upb_alloc *a);
823 
upb_inttable_compact(upb_inttable * t)824 UPB_INLINE void upb_inttable_compact(upb_inttable *t) {
825   upb_inttable_compact2(t, &upb_alloc_global);
826 }
827 
828 /* A special-case inlinable version of the lookup routine for 32-bit
829  * integers. */
upb_inttable_lookup32(const upb_inttable * t,uint32_t key,upb_value * v)830 UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key,
831                                       upb_value *v) {
832   *v = upb_value_int32(0);  /* Silence compiler warnings. */
833   if (key < t->array_size) {
834     upb_tabval arrval = t->array[key];
835     if (upb_arrhas(arrval)) {
836       _upb_value_setval(v, arrval.val);
837       return true;
838     } else {
839       return false;
840     }
841   } else {
842     const upb_tabent *e;
843     if (t->t.entries == NULL) return false;
844     for (e = upb_getentry(&t->t, upb_inthash(key)); true; e = e->next) {
845       if ((uint32_t)e->key == key) {
846         _upb_value_setval(v, e->val.val);
847         return true;
848       }
849       if (e->next == NULL) return false;
850     }
851   }
852 }
853 
854 /* Exposed for testing only. */
855 bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a);
856 
857 /* Iterators ******************************************************************/
858 
859 /* Iterators for int and string tables.  We are subject to some kind of unusual
860  * design constraints:
861  *
862  * For high-level languages:
863  *  - we must be able to guarantee that we don't crash or corrupt memory even if
864  *    the program accesses an invalidated iterator.
865  *
866  * For C++11 range-based for:
867  *  - iterators must be copyable
868  *  - iterators must be comparable
869  *  - it must be possible to construct an "end" value.
870  *
871  * Iteration order is undefined.
872  *
873  * Modifying the table invalidates iterators.  upb_{str,int}table_done() is
874  * guaranteed to work even on an invalidated iterator, as long as the table it
875  * is iterating over has not been freed.  Calling next() or accessing data from
876  * an invalidated iterator yields unspecified elements from the table, but it is
877  * guaranteed not to crash and to return real table elements (except when done()
878  * is true). */
879 
880 
881 /* upb_strtable_iter **********************************************************/
882 
883 /*   upb_strtable_iter i;
884  *   upb_strtable_begin(&i, t);
885  *   for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
886  *     const char *key = upb_strtable_iter_key(&i);
887  *     const upb_value val = upb_strtable_iter_value(&i);
888  *     // ...
889  *   }
890  */
891 
892 typedef struct {
893   const upb_strtable *t;
894   size_t index;
895 } upb_strtable_iter;
896 
897 void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t);
898 void upb_strtable_next(upb_strtable_iter *i);
899 bool upb_strtable_done(const upb_strtable_iter *i);
900 upb_strview upb_strtable_iter_key(const upb_strtable_iter *i);
901 upb_value upb_strtable_iter_value(const upb_strtable_iter *i);
902 void upb_strtable_iter_setdone(upb_strtable_iter *i);
903 bool upb_strtable_iter_isequal(const upb_strtable_iter *i1,
904                                const upb_strtable_iter *i2);
905 
906 
907 /* upb_inttable_iter **********************************************************/
908 
909 /*   upb_inttable_iter i;
910  *   upb_inttable_begin(&i, t);
911  *   for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
912  *     uintptr_t key = upb_inttable_iter_key(&i);
913  *     upb_value val = upb_inttable_iter_value(&i);
914  *     // ...
915  *   }
916  */
917 
918 typedef struct {
919   const upb_inttable *t;
920   size_t index;
921   bool array_part;
922 } upb_inttable_iter;
923 
str_tabent(const upb_strtable_iter * i)924 UPB_INLINE const upb_tabent *str_tabent(const upb_strtable_iter *i) {
925   return &i->t->t.entries[i->index];
926 }
927 
928 void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t);
929 void upb_inttable_next(upb_inttable_iter *i);
930 bool upb_inttable_done(const upb_inttable_iter *i);
931 uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i);
932 upb_value upb_inttable_iter_value(const upb_inttable_iter *i);
933 void upb_inttable_iter_setdone(upb_inttable_iter *i);
934 bool upb_inttable_iter_isequal(const upb_inttable_iter *i1,
935                                const upb_inttable_iter *i2);
936 
937 
938 #ifdef __cplusplus
939 }  /* extern "C" */
940 #endif
941 
942 
943 #endif  /* UPB_TABLE_H_ */
944 
945 
946 #ifdef __cplusplus
947 extern "C" {
948 #endif
949 
950 #define PTR_AT(msg, ofs, type) (type*)((const char*)msg + ofs)
951 
952 typedef void upb_msg;
953 
954 /** upb_msglayout *************************************************************/
955 
956 /* upb_msglayout represents the memory layout of a given upb_msgdef.  The
957  * members are public so generated code can initialize them, but users MUST NOT
958  * read or write any of its members. */
959 
960 /* These aren't real labels according to descriptor.proto, but in the table we
961  * use these for map/packed fields instead of UPB_LABEL_REPEATED. */
962 enum {
963   _UPB_LABEL_MAP = 4,
964   _UPB_LABEL_PACKED = 7  /* Low 3 bits are common with UPB_LABEL_REPEATED. */
965 };
966 
967 typedef struct {
968   uint32_t number;
969   uint16_t offset;
970   int16_t presence;       /* If >0, hasbit_index.  If <0, ~oneof_index. */
971   uint16_t submsg_index;  /* undefined if descriptortype != MESSAGE or GROUP. */
972   uint8_t descriptortype;
973   uint8_t label;          /* google.protobuf.Label or _UPB_LABEL_* above. */
974 } upb_msglayout_field;
975 
976 typedef struct upb_msglayout {
977   const struct upb_msglayout *const* submsgs;
978   const upb_msglayout_field *fields;
979   /* Must be aligned to sizeof(void*).  Doesn't include internal members like
980    * unknown fields, extension dict, pointer to msglayout, etc. */
981   uint16_t size;
982   uint16_t field_count;
983   bool extendable;
984 } upb_msglayout;
985 
986 /** upb_msg *******************************************************************/
987 
988 /* Internal members of a upb_msg.  We can change this without breaking binary
989  * compatibility.  We put these before the user's data.  The user's upb_msg*
990  * points after the upb_msg_internal. */
991 
992 /* Used when a message is not extendable. */
993 typedef struct {
994   char *unknown;
995   size_t unknown_len;
996   size_t unknown_size;
997 } upb_msg_internal;
998 
999 /* Used when a message is extendable. */
1000 typedef struct {
1001   upb_inttable *extdict;
1002   upb_msg_internal base;
1003 } upb_msg_internal_withext;
1004 
1005 /* Maps upb_fieldtype_t -> memory size. */
1006 extern char _upb_fieldtype_to_size[12];
1007 
1008 /* Creates a new messages with the given layout on the given arena. */
1009 upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a);
1010 
1011 /* Clears the given message. */
1012 void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l);
1013 
1014 /* Discards the unknown fields for this message only. */
1015 void _upb_msg_discardunknown_shallow(upb_msg *msg);
1016 
1017 /* Adds unknown data (serialized protobuf data) to the given message.  The data
1018  * is copied into the message instance. */
1019 bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
1020                          upb_arena *arena);
1021 
1022 /* Returns a reference to the message's unknown data. */
1023 const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
1024 
1025 /** Hasbit access *************************************************************/
1026 
_upb_hasbit(const upb_msg * msg,size_t idx)1027 UPB_INLINE bool _upb_hasbit(const upb_msg *msg, size_t idx) {
1028   return (*PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
1029 }
1030 
_upb_sethas(const upb_msg * msg,size_t idx)1031 UPB_INLINE void _upb_sethas(const upb_msg *msg, size_t idx) {
1032   (*PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
1033 }
1034 
_upb_clearhas(const upb_msg * msg,size_t idx)1035 UPB_INLINE void _upb_clearhas(const upb_msg *msg, size_t idx) {
1036   (*PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
1037 }
1038 
_upb_msg_hasidx(const upb_msglayout_field * f)1039 UPB_INLINE size_t _upb_msg_hasidx(const upb_msglayout_field *f) {
1040   UPB_ASSERT(f->presence > 0);
1041   return f->presence;
1042 }
1043 
_upb_hasbit_field(const upb_msg * msg,const upb_msglayout_field * f)1044 UPB_INLINE bool _upb_hasbit_field(const upb_msg *msg,
1045                                   const upb_msglayout_field *f) {
1046   return _upb_hasbit(msg, _upb_msg_hasidx(f));
1047 }
1048 
_upb_sethas_field(const upb_msg * msg,const upb_msglayout_field * f)1049 UPB_INLINE void _upb_sethas_field(const upb_msg *msg,
1050                                   const upb_msglayout_field *f) {
1051   _upb_sethas(msg, _upb_msg_hasidx(f));
1052 }
1053 
_upb_clearhas_field(const upb_msg * msg,const upb_msglayout_field * f)1054 UPB_INLINE void _upb_clearhas_field(const upb_msg *msg,
1055                                     const upb_msglayout_field *f) {
1056   _upb_clearhas(msg, _upb_msg_hasidx(f));
1057 }
1058 
1059 /** Oneof case access *********************************************************/
1060 
_upb_oneofcase(upb_msg * msg,size_t case_ofs)1061 UPB_INLINE uint32_t *_upb_oneofcase(upb_msg *msg, size_t case_ofs) {
1062   return PTR_AT(msg, case_ofs, uint32_t);
1063 }
1064 
_upb_getoneofcase(const void * msg,size_t case_ofs)1065 UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs) {
1066   return *PTR_AT(msg, case_ofs, uint32_t);
1067 }
1068 
_upb_oneofcase_ofs(const upb_msglayout_field * f)1069 UPB_INLINE size_t _upb_oneofcase_ofs(const upb_msglayout_field *f) {
1070   UPB_ASSERT(f->presence < 0);
1071   return ~(ptrdiff_t)f->presence;
1072 }
1073 
_upb_oneofcase_field(upb_msg * msg,const upb_msglayout_field * f)1074 UPB_INLINE uint32_t *_upb_oneofcase_field(upb_msg *msg,
1075                                           const upb_msglayout_field *f) {
1076   return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
1077 }
1078 
_upb_getoneofcase_field(const upb_msg * msg,const upb_msglayout_field * f)1079 UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_msg *msg,
1080                                             const upb_msglayout_field *f) {
1081   return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
1082 }
1083 
_upb_has_submsg_nohasbit(const upb_msg * msg,size_t ofs)1084 UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_msg *msg, size_t ofs) {
1085   return *PTR_AT(msg, ofs, const upb_msg*) != NULL;
1086 }
1087 
_upb_isrepeated(const upb_msglayout_field * field)1088 UPB_INLINE bool _upb_isrepeated(const upb_msglayout_field *field) {
1089   return (field->label & 3) == UPB_LABEL_REPEATED;
1090 }
1091 
_upb_repeated_or_map(const upb_msglayout_field * field)1092 UPB_INLINE bool _upb_repeated_or_map(const upb_msglayout_field *field) {
1093   return field->label >= UPB_LABEL_REPEATED;
1094 }
1095 
1096 /** upb_array *****************************************************************/
1097 
1098 /* Our internal representation for repeated fields.  */
1099 typedef struct {
1100   uintptr_t data;   /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
1101   size_t len;   /* Measured in elements. */
1102   size_t size;  /* Measured in elements. */
1103 } upb_array;
1104 
_upb_array_constptr(const upb_array * arr)1105 UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) {
1106   return (void*)(arr->data & ~(uintptr_t)7);
1107 }
1108 
_upb_array_ptr(upb_array * arr)1109 UPB_INLINE void *_upb_array_ptr(upb_array *arr) {
1110   return (void*)_upb_array_constptr(arr);
1111 }
1112 
1113 /* Creates a new array on the given arena. */
1114 upb_array *_upb_array_new(upb_arena *a, upb_fieldtype_t type);
1115 
1116 /* Resizes the capacity of the array to be at least min_size. */
1117 bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena);
1118 
1119 /* Fallback functions for when the accessors require a resize. */
1120 void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
1121                                  upb_fieldtype_t type, upb_arena *arena);
1122 bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
1123                                 upb_fieldtype_t type, upb_arena *arena);
1124 
_upb_array_reserve(upb_array * arr,size_t size,upb_arena * arena)1125 UPB_INLINE bool _upb_array_reserve(upb_array *arr, size_t size,
1126                                    upb_arena *arena) {
1127   if (arr->size < size) return _upb_array_realloc(arr, size, arena);
1128   return true;
1129 }
1130 
_upb_array_resize(upb_array * arr,size_t size,upb_arena * arena)1131 UPB_INLINE bool _upb_array_resize(upb_array *arr, size_t size,
1132                                   upb_arena *arena) {
1133   if (!_upb_array_reserve(arr, size, arena)) return false;
1134   arr->len = size;
1135   return true;
1136 }
1137 
_upb_array_accessor(const void * msg,size_t ofs,size_t * size)1138 UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
1139                                            size_t *size) {
1140   const upb_array *arr = *PTR_AT(msg, ofs, const upb_array*);
1141   if (arr) {
1142     if (size) *size = arr->len;
1143     return _upb_array_constptr(arr);
1144   } else {
1145     if (size) *size = 0;
1146     return NULL;
1147   }
1148 }
1149 
_upb_array_mutable_accessor(void * msg,size_t ofs,size_t * size)1150 UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
1151                                              size_t *size) {
1152   upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
1153   if (arr) {
1154     if (size) *size = arr->len;
1155     return _upb_array_ptr(arr);
1156   } else {
1157     if (size) *size = 0;
1158     return NULL;
1159   }
1160 }
1161 
_upb_array_resize_accessor(void * msg,size_t ofs,size_t size,upb_fieldtype_t type,upb_arena * arena)1162 UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
1163                                             upb_fieldtype_t type,
1164                                             upb_arena *arena) {
1165   upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*);
1166   upb_array *arr = *arr_ptr;
1167   if (!arr || arr->size < size) {
1168     return _upb_array_resize_fallback(arr_ptr, size, type, arena);
1169   }
1170   arr->len = size;
1171   return _upb_array_ptr(arr);
1172 }
1173 
1174 
_upb_array_append_accessor(void * msg,size_t ofs,size_t elem_size,upb_fieldtype_t type,const void * value,upb_arena * arena)1175 UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
1176                                            size_t elem_size,
1177                                            upb_fieldtype_t type,
1178                                            const void *value,
1179                                            upb_arena *arena) {
1180   upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array*);
1181   upb_array *arr = *arr_ptr;
1182   void* ptr;
1183   if (!arr || arr->len == arr->size) {
1184     return _upb_array_append_fallback(arr_ptr, value, type, arena);
1185   }
1186   ptr = _upb_array_ptr(arr);
1187   memcpy(PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
1188   arr->len++;
1189   return true;
1190 }
1191 
1192 /** upb_map *******************************************************************/
1193 
1194 /* Right now we use strmaps for everything.  We'll likely want to use
1195  * integer-specific maps for integer-keyed maps.*/
1196 typedef struct {
1197   /* Size of key and val, based on the map type.  Strings are represented as '0'
1198    * because they must be handled specially. */
1199   char key_size;
1200   char val_size;
1201 
1202   upb_strtable table;
1203 } upb_map;
1204 
1205 /* Map entries aren't actually stored, they are only used during parsing.  For
1206  * parsing, it helps a lot if all map entry messages have the same layout.
1207  * The compiler and def.c must ensure that all map entries have this layout. */
1208 typedef struct {
1209   upb_msg_internal internal;
1210   union {
1211     upb_strview str;  /* For str/bytes. */
1212     upb_value val;    /* For all other types. */
1213   } k;
1214   union {
1215     upb_strview str;  /* For str/bytes. */
1216     upb_value val;    /* For all other types. */
1217   } v;
1218 } upb_map_entry;
1219 
1220 /* Creates a new map on the given arena with this key/value type. */
1221 upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size);
1222 
1223 /* Converting between internal table representation and user values.
1224  *
1225  * _upb_map_tokey() and _upb_map_fromkey() are inverses.
1226  * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
1227  *
1228  * These functions account for the fact that strings are treated differently
1229  * from other types when stored in a map.
1230  */
1231 
_upb_map_tokey(const void * key,size_t size)1232 UPB_INLINE upb_strview _upb_map_tokey(const void *key, size_t size) {
1233   if (size == UPB_MAPTYPE_STRING) {
1234     return *(upb_strview*)key;
1235   } else {
1236     return upb_strview_make((const char*)key, size);
1237   }
1238 }
1239 
_upb_map_fromkey(upb_strview key,void * out,size_t size)1240 UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) {
1241   if (size == UPB_MAPTYPE_STRING) {
1242     memcpy(out, &key, sizeof(key));
1243   } else {
1244     memcpy(out, key.data, size);
1245   }
1246 }
1247 
_upb_map_tovalue(const void * val,size_t size,upb_arena * a)1248 UPB_INLINE upb_value _upb_map_tovalue(const void *val, size_t size,
1249                                       upb_arena *a) {
1250   upb_value ret = {0};
1251   if (size == UPB_MAPTYPE_STRING) {
1252     upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp));
1253     *strp = *(upb_strview*)val;
1254     memcpy(&ret, &strp, sizeof(strp));
1255   } else {
1256     memcpy(&ret, val, size);
1257   }
1258   return ret;
1259 }
1260 
_upb_map_fromvalue(upb_value val,void * out,size_t size)1261 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
1262   if (size == UPB_MAPTYPE_STRING) {
1263     const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
1264     memcpy(out, strp, sizeof(upb_strview));
1265   } else {
1266     memcpy(out, &val, size);
1267   }
1268 }
1269 
1270 /* Map operations, shared by reflection and generated code. */
1271 
_upb_map_size(const upb_map * map)1272 UPB_INLINE size_t _upb_map_size(const upb_map *map) {
1273   return map->table.t.count;
1274 }
1275 
_upb_map_get(const upb_map * map,const void * key,size_t key_size,void * val,size_t val_size)1276 UPB_INLINE bool _upb_map_get(const upb_map *map, const void *key,
1277                              size_t key_size, void *val, size_t val_size) {
1278   upb_value tabval;
1279   upb_strview k = _upb_map_tokey(key, key_size);
1280   bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
1281   if (ret && val) {
1282     _upb_map_fromvalue(tabval, val, val_size);
1283   }
1284   return ret;
1285 }
1286 
_upb_map_next(const upb_map * map,size_t * iter)1287 UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) {
1288   upb_strtable_iter it;
1289   it.t = &map->table;
1290   it.index = *iter;
1291   upb_strtable_next(&it);
1292   *iter = it.index;
1293   if (upb_strtable_done(&it)) return NULL;
1294   return (void*)str_tabent(&it);
1295 }
1296 
_upb_map_set(upb_map * map,const void * key,size_t key_size,void * val,size_t val_size,upb_arena * arena)1297 UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size,
1298                              void *val, size_t val_size, upb_arena *arena) {
1299   upb_strview strkey = _upb_map_tokey(key, key_size);
1300   upb_value tabval = _upb_map_tovalue(val, val_size, arena);
1301   upb_alloc *a = upb_arena_alloc(arena);
1302 
1303   /* TODO(haberman): add overwrite operation to minimize number of lookups. */
1304   upb_strtable_remove3(&map->table, strkey.data, strkey.size, NULL, a);
1305   return upb_strtable_insert3(&map->table, strkey.data, strkey.size, tabval, a);
1306 }
1307 
_upb_map_delete(upb_map * map,const void * key,size_t key_size)1308 UPB_INLINE bool _upb_map_delete(upb_map *map, const void *key, size_t key_size) {
1309   upb_strview k = _upb_map_tokey(key, key_size);
1310   return upb_strtable_remove3(&map->table, k.data, k.size, NULL, NULL);
1311 }
1312 
_upb_map_clear(upb_map * map)1313 UPB_INLINE void _upb_map_clear(upb_map *map) {
1314   upb_strtable_clear(&map->table);
1315 }
1316 
1317 /* Message map operations, these get the map from the message first. */
1318 
_upb_msg_map_size(const upb_msg * msg,size_t ofs)1319 UPB_INLINE size_t _upb_msg_map_size(const upb_msg *msg, size_t ofs) {
1320   upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
1321   return map ? _upb_map_size(map) : 0;
1322 }
1323 
_upb_msg_map_get(const upb_msg * msg,size_t ofs,const void * key,size_t key_size,void * val,size_t val_size)1324 UPB_INLINE bool _upb_msg_map_get(const upb_msg *msg, size_t ofs,
1325                                  const void *key, size_t key_size, void *val,
1326                                  size_t val_size) {
1327   upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
1328   if (!map) return false;
1329   return _upb_map_get(map, key, key_size, val, val_size);
1330 }
1331 
_upb_msg_map_next(const upb_msg * msg,size_t ofs,size_t * iter)1332 UPB_INLINE void *_upb_msg_map_next(const upb_msg *msg, size_t ofs,
1333                                    size_t *iter) {
1334   upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
1335   if (!map) return NULL;
1336   return _upb_map_next(map, iter);
1337 }
1338 
_upb_msg_map_set(upb_msg * msg,size_t ofs,const void * key,size_t key_size,void * val,size_t val_size,upb_arena * arena)1339 UPB_INLINE bool _upb_msg_map_set(upb_msg *msg, size_t ofs, const void *key,
1340                                  size_t key_size, void *val, size_t val_size,
1341                                  upb_arena *arena) {
1342   upb_map **map = PTR_AT(msg, ofs, upb_map *);
1343   if (!*map) {
1344     *map = _upb_map_new(arena, key_size, val_size);
1345   }
1346   return _upb_map_set(*map, key, key_size, val, val_size, arena);
1347 }
1348 
_upb_msg_map_delete(upb_msg * msg,size_t ofs,const void * key,size_t key_size)1349 UPB_INLINE bool _upb_msg_map_delete(upb_msg *msg, size_t ofs, const void *key,
1350                                     size_t key_size) {
1351   upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
1352   if (!map) return false;
1353   return _upb_map_delete(map, key, key_size);
1354 }
1355 
_upb_msg_map_clear(upb_msg * msg,size_t ofs)1356 UPB_INLINE void _upb_msg_map_clear(upb_msg *msg, size_t ofs) {
1357   upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
1358   if (!map) return;
1359   _upb_map_clear(map);
1360 }
1361 
1362 /* Accessing map key/value from a pointer, used by generated code only. */
1363 
_upb_msg_map_key(const void * msg,void * key,size_t size)1364 UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
1365   const upb_tabent *ent = (const upb_tabent*)msg;
1366   uint32_t u32len;
1367   upb_strview k;
1368   k.data = upb_tabstr(ent->key, &u32len);
1369   k.size = u32len;
1370   _upb_map_fromkey(k, key, size);
1371 }
1372 
_upb_msg_map_value(const void * msg,void * val,size_t size)1373 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
1374   const upb_tabent *ent = (const upb_tabent*)msg;
1375   upb_value v;
1376   _upb_value_setval(&v, ent->val.val);
1377   _upb_map_fromvalue(v, val, size);
1378 }
1379 
_upb_msg_map_set_value(void * msg,const void * val,size_t size)1380 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
1381   upb_tabent *ent = (upb_tabent*)msg;
1382   /* This is like _upb_map_tovalue() except the entry already exists so we can
1383    * reuse the allocated upb_strview for string fields. */
1384   if (size == UPB_MAPTYPE_STRING) {
1385     upb_strview *strp = (upb_strview*)ent->val.val;
1386     memcpy(strp, val, sizeof(*strp));
1387   } else {
1388     memcpy(&ent->val.val, val, size);
1389   }
1390 }
1391 
1392 #undef PTR_AT
1393 
1394 #ifdef __cplusplus
1395 }  /* extern "C" */
1396 #endif
1397 
1398 
1399 #endif /* UPB_MSG_H_ */
1400 
1401 #ifdef __cplusplus
1402 extern "C" {
1403 #endif
1404 
1405 bool upb_decode(const char *buf, size_t size, upb_msg *msg,
1406                 const upb_msglayout *l, upb_arena *arena);
1407 
1408 #ifdef __cplusplus
1409 }  /* extern "C" */
1410 #endif
1411 
1412 #endif  /* UPB_DECODE_H_ */
1413 /*
1414 ** upb_encode: parsing into a upb_msg using a upb_msglayout.
1415 */
1416 
1417 #ifndef UPB_ENCODE_H_
1418 #define UPB_ENCODE_H_
1419 
1420 
1421 #ifdef __cplusplus
1422 extern "C" {
1423 #endif
1424 
1425 char *upb_encode(const void *msg, const upb_msglayout *l, upb_arena *arena,
1426                  size_t *size);
1427 
1428 #ifdef __cplusplus
1429 }  /* extern "C" */
1430 #endif
1431 
1432 #endif  /* UPB_ENCODE_H_ */
1433 /* This file was generated by upbc (the upb compiler) from the input
1434  * file:
1435  *
1436  *     google/protobuf/descriptor.proto
1437  *
1438  * Do not edit -- your changes will be discarded when the file is
1439  * regenerated. */
1440 
1441 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
1442 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
1443 
1444 
1445 
1446 #ifdef __cplusplus
1447 extern "C" {
1448 #endif
1449 
1450 struct google_protobuf_FileDescriptorSet;
1451 struct google_protobuf_FileDescriptorProto;
1452 struct google_protobuf_DescriptorProto;
1453 struct google_protobuf_DescriptorProto_ExtensionRange;
1454 struct google_protobuf_DescriptorProto_ReservedRange;
1455 struct google_protobuf_ExtensionRangeOptions;
1456 struct google_protobuf_FieldDescriptorProto;
1457 struct google_protobuf_OneofDescriptorProto;
1458 struct google_protobuf_EnumDescriptorProto;
1459 struct google_protobuf_EnumDescriptorProto_EnumReservedRange;
1460 struct google_protobuf_EnumValueDescriptorProto;
1461 struct google_protobuf_ServiceDescriptorProto;
1462 struct google_protobuf_MethodDescriptorProto;
1463 struct google_protobuf_FileOptions;
1464 struct google_protobuf_MessageOptions;
1465 struct google_protobuf_FieldOptions;
1466 struct google_protobuf_OneofOptions;
1467 struct google_protobuf_EnumOptions;
1468 struct google_protobuf_EnumValueOptions;
1469 struct google_protobuf_ServiceOptions;
1470 struct google_protobuf_MethodOptions;
1471 struct google_protobuf_UninterpretedOption;
1472 struct google_protobuf_UninterpretedOption_NamePart;
1473 struct google_protobuf_SourceCodeInfo;
1474 struct google_protobuf_SourceCodeInfo_Location;
1475 struct google_protobuf_GeneratedCodeInfo;
1476 struct google_protobuf_GeneratedCodeInfo_Annotation;
1477 typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet;
1478 typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto;
1479 typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto;
1480 typedef struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange;
1481 typedef struct google_protobuf_DescriptorProto_ReservedRange google_protobuf_DescriptorProto_ReservedRange;
1482 typedef struct google_protobuf_ExtensionRangeOptions google_protobuf_ExtensionRangeOptions;
1483 typedef struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto;
1484 typedef struct google_protobuf_OneofDescriptorProto google_protobuf_OneofDescriptorProto;
1485 typedef struct google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto;
1486 typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange google_protobuf_EnumDescriptorProto_EnumReservedRange;
1487 typedef struct google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto;
1488 typedef struct google_protobuf_ServiceDescriptorProto google_protobuf_ServiceDescriptorProto;
1489 typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescriptorProto;
1490 typedef struct google_protobuf_FileOptions google_protobuf_FileOptions;
1491 typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions;
1492 typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions;
1493 typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions;
1494 typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions;
1495 typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions;
1496 typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions;
1497 typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions;
1498 typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption;
1499 typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart;
1500 typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo;
1501 typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location;
1502 typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo;
1503 typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation;
1504 extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
1505 extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
1506 extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
1507 extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
1508 extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
1509 extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
1510 extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
1511 extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
1512 extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
1513 extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
1514 extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
1515 extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
1516 extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
1517 extern const upb_msglayout google_protobuf_FileOptions_msginit;
1518 extern const upb_msglayout google_protobuf_MessageOptions_msginit;
1519 extern const upb_msglayout google_protobuf_FieldOptions_msginit;
1520 extern const upb_msglayout google_protobuf_OneofOptions_msginit;
1521 extern const upb_msglayout google_protobuf_EnumOptions_msginit;
1522 extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
1523 extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
1524 extern const upb_msglayout google_protobuf_MethodOptions_msginit;
1525 extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
1526 extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
1527 extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
1528 extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
1529 extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
1530 extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
1531 
1532 typedef enum {
1533   google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
1534   google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
1535   google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
1536 } google_protobuf_FieldDescriptorProto_Label;
1537 
1538 typedef enum {
1539   google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
1540   google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
1541   google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
1542   google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
1543   google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
1544   google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
1545   google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
1546   google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
1547   google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
1548   google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
1549   google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
1550   google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
1551   google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
1552   google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
1553   google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
1554   google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
1555   google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
1556   google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
1557 } google_protobuf_FieldDescriptorProto_Type;
1558 
1559 typedef enum {
1560   google_protobuf_FieldOptions_STRING = 0,
1561   google_protobuf_FieldOptions_CORD = 1,
1562   google_protobuf_FieldOptions_STRING_PIECE = 2
1563 } google_protobuf_FieldOptions_CType;
1564 
1565 typedef enum {
1566   google_protobuf_FieldOptions_JS_NORMAL = 0,
1567   google_protobuf_FieldOptions_JS_STRING = 1,
1568   google_protobuf_FieldOptions_JS_NUMBER = 2
1569 } google_protobuf_FieldOptions_JSType;
1570 
1571 typedef enum {
1572   google_protobuf_FileOptions_SPEED = 1,
1573   google_protobuf_FileOptions_CODE_SIZE = 2,
1574   google_protobuf_FileOptions_LITE_RUNTIME = 3
1575 } google_protobuf_FileOptions_OptimizeMode;
1576 
1577 typedef enum {
1578   google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
1579   google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
1580   google_protobuf_MethodOptions_IDEMPOTENT = 2
1581 } google_protobuf_MethodOptions_IdempotencyLevel;
1582 
1583 
1584 /* google.protobuf.FileDescriptorSet */
1585 
google_protobuf_FileDescriptorSet_new(upb_arena * arena)1586 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
1587   return (google_protobuf_FileDescriptorSet *)_upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
1588 }
google_protobuf_FileDescriptorSet_parse(const char * buf,size_t size,upb_arena * arena)1589 UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
1590                         upb_arena *arena) {
1591   google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
1592   return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena)) ? ret : NULL;
1593 }
google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet * msg,upb_arena * arena,size_t * len)1594 UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
1595   return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
1596 }
1597 
google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet * msg)1598 UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet * msg,size_t * len)1599 UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet *msg, size_t *len) { return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
1600 
google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet * msg,size_t * len)1601 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet *msg, size_t *len) {
1602   return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
1603 }
google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet * msg,size_t len,upb_arena * arena)1604 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet *msg, size_t len, upb_arena *arena) {
1605   return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
1606 }
google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet * msg,upb_arena * arena)1607 UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet *msg, upb_arena *arena) {
1608   struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
1609   bool ok = _upb_array_append_accessor(
1610       msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1611   if (!ok) return NULL;
1612   return sub;
1613 }
1614 
1615 /* google.protobuf.FileDescriptorProto */
1616 
google_protobuf_FileDescriptorProto_new(upb_arena * arena)1617 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
1618   return (google_protobuf_FileDescriptorProto *)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
1619 }
google_protobuf_FileDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1620 UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
1621                         upb_arena *arena) {
1622   google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
1623   return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena)) ? ret : NULL;
1624 }
google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto * msg,upb_arena * arena,size_t * len)1625 UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
1626   return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
1627 }
1628 
google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto * msg)1629 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto * msg)1630 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto * msg)1631 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto * msg)1632 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1633 UPB_INLINE upb_strview const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto * msg)1634 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)1635 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto * msg)1636 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)1637 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto * msg)1638 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto * msg,size_t * len)1639 UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto * msg)1640 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto * msg,size_t * len)1641 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); }
google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto * msg)1642 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto * msg)1643 UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*); }
google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto * msg)1644 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto * msg)1645 UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*); }
google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1646 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len); }
google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)1647 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len); }
google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto * msg)1648 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto * msg)1649 UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
1650 
google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto * msg,upb_strview value)1651 UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1652   _upb_sethas(msg, 1);
1653   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
1654 }
google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto * msg,upb_strview value)1655 UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1656   _upb_sethas(msg, 2);
1657   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
1658 }
google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1659 UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1660   return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
1661 }
google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1662 UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1663   return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
1664 }
google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto * msg,upb_strview val,upb_arena * arena)1665 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
1666   return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
1667       arena);
1668 }
google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto * msg,size_t * len)1669 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1670   return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
1671 }
google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1672 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1673   return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
1674 }
google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1675 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1676   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1677   bool ok = _upb_array_append_accessor(
1678       msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1679   if (!ok) return NULL;
1680   return sub;
1681 }
google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto * msg,size_t * len)1682 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1683   return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
1684 }
google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1685 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1686   return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_MESSAGE, arena);
1687 }
google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1688 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1689   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
1690   bool ok = _upb_array_append_accessor(
1691       msg, UPB_SIZE(44, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1692   if (!ok) return NULL;
1693   return sub;
1694 }
google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto * msg,size_t * len)1695 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1696   return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
1697 }
google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1698 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1699   return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
1700 }
google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1701 UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1702   struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
1703   bool ok = _upb_array_append_accessor(
1704       msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1705   if (!ok) return NULL;
1706   return sub;
1707 }
google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto * msg,size_t * len)1708 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1709   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
1710 }
google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1711 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1712   return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_TYPE_MESSAGE, arena);
1713 }
google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1714 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1715   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1716   bool ok = _upb_array_append_accessor(
1717       msg, UPB_SIZE(52, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1718   if (!ok) return NULL;
1719   return sub;
1720 }
google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto * msg,google_protobuf_FileOptions * value)1721 UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
1722   _upb_sethas(msg, 4);
1723   *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
1724 }
google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1725 UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1726   struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
1727   if (sub == NULL) {
1728     sub = (struct google_protobuf_FileOptions*)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
1729     if (!sub) return NULL;
1730     google_protobuf_FileDescriptorProto_set_options(msg, sub);
1731   }
1732   return sub;
1733 }
google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto * msg,google_protobuf_SourceCodeInfo * value)1734 UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
1735   _upb_sethas(msg, 5);
1736   *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
1737 }
google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto * msg,upb_arena * arena)1738 UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
1739   struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
1740   if (sub == NULL) {
1741     sub = (struct google_protobuf_SourceCodeInfo*)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
1742     if (!sub) return NULL;
1743     google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
1744   }
1745   return sub;
1746 }
google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1747 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1748   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
1749 }
google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1750 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1751   return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_TYPE_INT32, arena);
1752 }
google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_arena * arena)1753 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1754   return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
1755       arena);
1756 }
google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)1757 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
1758   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len);
1759 }
google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_arena * arena)1760 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
1761   return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_TYPE_INT32, arena);
1762 }
google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_arena * arena)1763 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1764   return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
1765       arena);
1766 }
google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto * msg,upb_strview value)1767 UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
1768   _upb_sethas(msg, 3);
1769   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
1770 }
1771 
1772 /* google.protobuf.DescriptorProto */
1773 
google_protobuf_DescriptorProto_new(upb_arena * arena)1774 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
1775   return (google_protobuf_DescriptorProto *)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1776 }
google_protobuf_DescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)1777 UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
1778                         upb_arena *arena) {
1779   google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
1780   return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena)) ? ret : NULL;
1781 }
google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto * msg,upb_arena * arena,size_t * len)1782 UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
1783   return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
1784 }
1785 
google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto * msg)1786 UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto * msg)1787 UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto * msg)1788 UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto * msg,size_t * len)1789 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto * msg)1790 UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto * msg,size_t * len)1791 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto * msg)1792 UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto * msg,size_t * len)1793 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto * msg)1794 UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto * msg,size_t * len)1795 UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto * msg)1796 UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto * msg,size_t * len)1797 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto * msg)1798 UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto * msg)1799 UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_MessageOptions*); }
google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto * msg)1800 UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto * msg,size_t * len)1801 UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto * msg)1802 UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto * msg,size_t * len)1803 UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto * msg,size_t * len)1804 UPB_INLINE upb_strview const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
1805 
google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto * msg,upb_strview value)1806 UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_strview value) {
1807   _upb_sethas(msg, 1);
1808   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
1809 }
google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto * msg,size_t * len)1810 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto *msg, size_t *len) {
1811   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
1812 }
google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1813 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1814   return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
1815 }
google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto * msg,upb_arena * arena)1816 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1817   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1818   bool ok = _upb_array_append_accessor(
1819       msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1820   if (!ok) return NULL;
1821   return sub;
1822 }
google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto * msg,size_t * len)1823 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto *msg, size_t *len) {
1824   return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
1825 }
google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1826 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1827   return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
1828 }
google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto * msg,upb_arena * arena)1829 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1830   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
1831   bool ok = _upb_array_append_accessor(
1832       msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1833   if (!ok) return NULL;
1834   return sub;
1835 }
google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto * msg,size_t * len)1836 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto *msg, size_t *len) {
1837   return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
1838 }
google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1839 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1840   return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
1841 }
google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto * msg,upb_arena * arena)1842 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1843   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
1844   bool ok = _upb_array_append_accessor(
1845       msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1846   if (!ok) return NULL;
1847   return sub;
1848 }
google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto * msg,size_t * len)1849 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto *msg, size_t *len) {
1850   return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
1851 }
google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1852 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1853   return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
1854 }
google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto * msg,upb_arena * arena)1855 UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1856   struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
1857   bool ok = _upb_array_append_accessor(
1858       msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1859   if (!ok) return NULL;
1860   return sub;
1861 }
google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto * msg,size_t * len)1862 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto *msg, size_t *len) {
1863   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
1864 }
google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1865 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1866   return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
1867 }
google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto * msg,upb_arena * arena)1868 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1869   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
1870   bool ok = _upb_array_append_accessor(
1871       msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1872   if (!ok) return NULL;
1873   return sub;
1874 }
google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto * msg,google_protobuf_MessageOptions * value)1875 UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
1876   _upb_sethas(msg, 2);
1877   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_MessageOptions*) = value;
1878 }
google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto * msg,upb_arena * arena)1879 UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1880   struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
1881   if (sub == NULL) {
1882     sub = (struct google_protobuf_MessageOptions*)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
1883     if (!sub) return NULL;
1884     google_protobuf_DescriptorProto_set_options(msg, sub);
1885   }
1886   return sub;
1887 }
google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto * msg,size_t * len)1888 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto *msg, size_t *len) {
1889   return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
1890 }
google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1891 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1892   return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
1893 }
google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto * msg,upb_arena * arena)1894 UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1895   struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
1896   bool ok = _upb_array_append_accessor(
1897       msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1898   if (!ok) return NULL;
1899   return sub;
1900 }
google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto * msg,size_t * len)1901 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto *msg, size_t *len) {
1902   return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
1903 }
google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1904 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1905   return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
1906 }
google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto * msg,upb_arena * arena)1907 UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
1908   struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
1909   bool ok = _upb_array_append_accessor(
1910       msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
1911   if (!ok) return NULL;
1912   return sub;
1913 }
google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto * msg,size_t * len)1914 UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto *msg, size_t *len) {
1915   return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
1916 }
google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto * msg,size_t len,upb_arena * arena)1917 UPB_INLINE upb_strview* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
1918   return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_STRING, arena);
1919 }
google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto * msg,upb_strview val,upb_arena * arena)1920 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
1921   return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
1922       arena);
1923 }
1924 
1925 /* google.protobuf.DescriptorProto.ExtensionRange */
1926 
google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena * arena)1927 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
1928   return (google_protobuf_DescriptorProto_ExtensionRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
1929 }
google_protobuf_DescriptorProto_ExtensionRange_parse(const char * buf,size_t size,upb_arena * arena)1930 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
1931                         upb_arena *arena) {
1932   google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
1933   return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena)) ? ret : NULL;
1934 }
google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange * msg,upb_arena * arena,size_t * len)1935 UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
1936   return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
1937 }
1938 
google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)1939 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)1940 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)1941 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)1942 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)1943 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)1944 UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*); }
1945 
google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)1946 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
1947   _upb_sethas(msg, 1);
1948   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
1949 }
google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)1950 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
1951   _upb_sethas(msg, 2);
1952   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
1953 }
google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange * msg,google_protobuf_ExtensionRangeOptions * value)1954 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
1955   _upb_sethas(msg, 3);
1956   *UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value;
1957 }
google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange * msg,upb_arena * arena)1958 UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena) {
1959   struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
1960   if (sub == NULL) {
1961     sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
1962     if (!sub) return NULL;
1963     google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
1964   }
1965   return sub;
1966 }
1967 
1968 /* google.protobuf.DescriptorProto.ReservedRange */
1969 
google_protobuf_DescriptorProto_ReservedRange_new(upb_arena * arena)1970 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
1971   return (google_protobuf_DescriptorProto_ReservedRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
1972 }
google_protobuf_DescriptorProto_ReservedRange_parse(const char * buf,size_t size,upb_arena * arena)1973 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
1974                         upb_arena *arena) {
1975   google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
1976   return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena)) ? ret : NULL;
1977 }
google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange * msg,upb_arena * arena,size_t * len)1978 UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
1979   return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
1980 }
1981 
google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange * msg)1982 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange * msg)1983 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange * msg)1984 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange * msg)1985 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
1986 
google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)1987 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
1988   _upb_sethas(msg, 1);
1989   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
1990 }
google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)1991 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
1992   _upb_sethas(msg, 2);
1993   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
1994 }
1995 
1996 /* google.protobuf.ExtensionRangeOptions */
1997 
google_protobuf_ExtensionRangeOptions_new(upb_arena * arena)1998 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
1999   return (google_protobuf_ExtensionRangeOptions *)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
2000 }
google_protobuf_ExtensionRangeOptions_parse(const char * buf,size_t size,upb_arena * arena)2001 UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
2002                         upb_arena *arena) {
2003   google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
2004   return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena)) ? ret : NULL;
2005 }
google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions * msg,upb_arena * arena,size_t * len)2006 UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
2007   return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
2008 }
2009 
google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg)2010 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg,size_t * len)2011 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
2012 
google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t * len)2013 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t *len) {
2014   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
2015 }
google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t len,upb_arena * arena)2016 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t len, upb_arena *arena) {
2017   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
2018 }
google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,upb_arena * arena)2019 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena) {
2020   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2021   bool ok = _upb_array_append_accessor(
2022       msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2023   if (!ok) return NULL;
2024   return sub;
2025 }
2026 
2027 /* google.protobuf.FieldDescriptorProto */
2028 
google_protobuf_FieldDescriptorProto_new(upb_arena * arena)2029 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
2030   return (google_protobuf_FieldDescriptorProto *)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
2031 }
google_protobuf_FieldDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2032 UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
2033                         upb_arena *arena) {
2034   google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
2035   return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena)) ? ret : NULL;
2036 }
google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto * msg,upb_arena * arena,size_t * len)2037 UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
2038   return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
2039 }
2040 
google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto * msg)2041 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto * msg)2042 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto * msg)2043 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto * msg)2044 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto * msg)2045 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto * msg)2046 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); }
google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto * msg)2047 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto * msg)2048 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto * msg)2049 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto * msg)2050 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto * msg)2051 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto * msg)2052 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto * msg)2053 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto * msg)2054 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); }
google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto * msg)2055 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto * msg)2056 UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const google_protobuf_FieldOptions*); }
google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto * msg)2057 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto * msg)2058 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); }
google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto * msg)2059 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 10); }
google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto * msg)2060 UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); }
google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)2061 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)2062 UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
2063 
google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)2064 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
2065   _upb_sethas(msg, 6);
2066   *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
2067 }
google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto * msg,upb_strview value)2068 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
2069   _upb_sethas(msg, 7);
2070   *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
2071 }
google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto * msg,int32_t value)2072 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
2073   _upb_sethas(msg, 3);
2074   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t) = value;
2075 }
google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto * msg,int32_t value)2076 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
2077   _upb_sethas(msg, 1);
2078   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2079 }
google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto * msg,int32_t value)2080 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
2081   _upb_sethas(msg, 2);
2082   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
2083 }
google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)2084 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
2085   _upb_sethas(msg, 8);
2086   *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
2087 }
google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto * msg,upb_strview value)2088 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
2089   _upb_sethas(msg, 9);
2090   *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value;
2091 }
google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto * msg,google_protobuf_FieldOptions * value)2092 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
2093   _upb_sethas(msg, 11);
2094   *UPB_PTR_AT(msg, UPB_SIZE(76, 120), google_protobuf_FieldOptions*) = value;
2095 }
google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto * msg,upb_arena * arena)2096 UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
2097   struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
2098   if (sub == NULL) {
2099     sub = (struct google_protobuf_FieldOptions*)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
2100     if (!sub) return NULL;
2101     google_protobuf_FieldDescriptorProto_set_options(msg, sub);
2102   }
2103   return sub;
2104 }
google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto * msg,int32_t value)2105 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
2106   _upb_sethas(msg, 4);
2107   *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t) = value;
2108 }
google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto * msg,upb_strview value)2109 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
2110   _upb_sethas(msg, 10);
2111   *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value;
2112 }
google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto * msg,bool value)2113 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
2114   _upb_sethas(msg, 5);
2115   *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
2116 }
2117 
2118 /* google.protobuf.OneofDescriptorProto */
2119 
google_protobuf_OneofDescriptorProto_new(upb_arena * arena)2120 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
2121   return (google_protobuf_OneofDescriptorProto *)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
2122 }
google_protobuf_OneofDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2123 UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
2124                         upb_arena *arena) {
2125   google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
2126   return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena)) ? ret : NULL;
2127 }
google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto * msg,upb_arena * arena,size_t * len)2128 UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
2129   return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
2130 }
2131 
google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto * msg)2132 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto * msg)2133 UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto * msg)2134 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto * msg)2135 UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*); }
2136 
google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto * msg,upb_strview value)2137 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_strview value) {
2138   _upb_sethas(msg, 1);
2139   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
2140 }
google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto * msg,google_protobuf_OneofOptions * value)2141 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
2142   _upb_sethas(msg, 2);
2143   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value;
2144 }
google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto * msg,upb_arena * arena)2145 UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto *msg, upb_arena *arena) {
2146   struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
2147   if (sub == NULL) {
2148     sub = (struct google_protobuf_OneofOptions*)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
2149     if (!sub) return NULL;
2150     google_protobuf_OneofDescriptorProto_set_options(msg, sub);
2151   }
2152   return sub;
2153 }
2154 
2155 /* google.protobuf.EnumDescriptorProto */
2156 
google_protobuf_EnumDescriptorProto_new(upb_arena * arena)2157 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
2158   return (google_protobuf_EnumDescriptorProto *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
2159 }
google_protobuf_EnumDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2160 UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
2161                         upb_arena *arena) {
2162   google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
2163   return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena)) ? ret : NULL;
2164 }
google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto * msg,upb_arena * arena,size_t * len)2165 UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
2166   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
2167 }
2168 
google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto * msg)2169 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto * msg)2170 UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto * msg)2171 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto * msg,size_t * len)2172 UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto * msg)2173 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto * msg)2174 UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_EnumOptions*); }
google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto * msg)2175 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto * msg,size_t * len)2176 UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto * msg,size_t * len)2177 UPB_INLINE upb_strview const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
2178 
google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto * msg,upb_strview value)2179 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_strview value) {
2180   _upb_sethas(msg, 1);
2181   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
2182 }
google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto * msg,size_t * len)2183 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
2184   return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
2185 }
google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)2186 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
2187   return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
2188 }
google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)2189 UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
2190   struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
2191   bool ok = _upb_array_append_accessor(
2192       msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2193   if (!ok) return NULL;
2194   return sub;
2195 }
google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto * msg,google_protobuf_EnumOptions * value)2196 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
2197   _upb_sethas(msg, 2);
2198   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_EnumOptions*) = value;
2199 }
google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)2200 UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
2201   struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
2202   if (sub == NULL) {
2203     sub = (struct google_protobuf_EnumOptions*)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
2204     if (!sub) return NULL;
2205     google_protobuf_EnumDescriptorProto_set_options(msg, sub);
2206   }
2207   return sub;
2208 }
google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t * len)2209 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
2210   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2211 }
google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)2212 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
2213   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
2214 }
google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto * msg,upb_arena * arena)2215 UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
2216   struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
2217   bool ok = _upb_array_append_accessor(
2218       msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2219   if (!ok) return NULL;
2220   return sub;
2221 }
google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t * len)2222 UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
2223   return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2224 }
google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_arena * arena)2225 UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
2226   return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
2227 }
google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto * msg,upb_strview val,upb_arena * arena)2228 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
2229   return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
2230       arena);
2231 }
2232 
2233 /* google.protobuf.EnumDescriptorProto.EnumReservedRange */
2234 
google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena * arena)2235 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
2236   return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
2237 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char * buf,size_t size,upb_arena * arena)2238 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
2239                         upb_arena *arena) {
2240   google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
2241   return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena)) ? ret : NULL;
2242 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,upb_arena * arena,size_t * len)2243 UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
2244   return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
2245 }
2246 
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)2247 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)2248 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)2249 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)2250 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
2251 
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)2252 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
2253   _upb_sethas(msg, 1);
2254   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
2255 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)2256 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
2257   _upb_sethas(msg, 2);
2258   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2259 }
2260 
2261 /* google.protobuf.EnumValueDescriptorProto */
2262 
google_protobuf_EnumValueDescriptorProto_new(upb_arena * arena)2263 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
2264   return (google_protobuf_EnumValueDescriptorProto *)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
2265 }
google_protobuf_EnumValueDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2266 UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
2267                         upb_arena *arena) {
2268   google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
2269   return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena)) ? ret : NULL;
2270 }
google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto * msg,upb_arena * arena,size_t * len)2271 UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
2272   return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
2273 }
2274 
google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto * msg)2275 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto * msg)2276 UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto * msg)2277 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto * msg)2278 UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto * msg)2279 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto * msg)2280 UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); }
2281 
google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto * msg,upb_strview value)2282 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_strview value) {
2283   _upb_sethas(msg, 2);
2284   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
2285 }
google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto * msg,int32_t value)2286 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
2287   _upb_sethas(msg, 1);
2288   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
2289 }
google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto * msg,google_protobuf_EnumValueOptions * value)2290 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
2291   _upb_sethas(msg, 3);
2292   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value;
2293 }
google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto * msg,upb_arena * arena)2294 UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena) {
2295   struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
2296   if (sub == NULL) {
2297     sub = (struct google_protobuf_EnumValueOptions*)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
2298     if (!sub) return NULL;
2299     google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
2300   }
2301   return sub;
2302 }
2303 
2304 /* google.protobuf.ServiceDescriptorProto */
2305 
google_protobuf_ServiceDescriptorProto_new(upb_arena * arena)2306 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
2307   return (google_protobuf_ServiceDescriptorProto *)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
2308 }
google_protobuf_ServiceDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2309 UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
2310                         upb_arena *arena) {
2311   google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
2312   return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena)) ? ret : NULL;
2313 }
google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena,size_t * len)2314 UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
2315   return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
2316 }
2317 
google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto * msg)2318 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto * msg)2319 UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto * msg)2320 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto * msg,size_t * len)2321 UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto *msg, size_t *len) { return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto * msg)2322 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto * msg)2323 UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_ServiceOptions*); }
2324 
google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto * msg,upb_strview value)2325 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_strview value) {
2326   _upb_sethas(msg, 1);
2327   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
2328 }
google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto * msg,size_t * len)2329 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto *msg, size_t *len) {
2330   return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
2331 }
google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto * msg,size_t len,upb_arena * arena)2332 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto *msg, size_t len, upb_arena *arena) {
2333   return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
2334 }
google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena)2335 UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
2336   struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
2337   bool ok = _upb_array_append_accessor(
2338       msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2339   if (!ok) return NULL;
2340   return sub;
2341 }
google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto * msg,google_protobuf_ServiceOptions * value)2342 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
2343   _upb_sethas(msg, 2);
2344   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_ServiceOptions*) = value;
2345 }
google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto * msg,upb_arena * arena)2346 UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
2347   struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
2348   if (sub == NULL) {
2349     sub = (struct google_protobuf_ServiceOptions*)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
2350     if (!sub) return NULL;
2351     google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
2352   }
2353   return sub;
2354 }
2355 
2356 /* google.protobuf.MethodDescriptorProto */
2357 
google_protobuf_MethodDescriptorProto_new(upb_arena * arena)2358 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
2359   return (google_protobuf_MethodDescriptorProto *)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
2360 }
google_protobuf_MethodDescriptorProto_parse(const char * buf,size_t size,upb_arena * arena)2361 UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
2362                         upb_arena *arena) {
2363   google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
2364   return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena)) ? ret : NULL;
2365 }
google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto * msg,upb_arena * arena,size_t * len)2366 UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
2367   return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
2368 }
2369 
google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto * msg)2370 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto * msg)2371 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto * msg)2372 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto * msg)2373 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto * msg)2374 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto * msg)2375 UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto * msg)2376 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto * msg)2377 UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); }
google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto * msg)2378 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto * msg)2379 UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto * msg)2380 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto * msg)2381 UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
2382 
google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto * msg,upb_strview value)2383 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
2384   _upb_sethas(msg, 3);
2385   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
2386 }
google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto * msg,upb_strview value)2387 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
2388   _upb_sethas(msg, 4);
2389   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
2390 }
google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto * msg,upb_strview value)2391 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
2392   _upb_sethas(msg, 5);
2393   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
2394 }
google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto * msg,google_protobuf_MethodOptions * value)2395 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
2396   _upb_sethas(msg, 6);
2397   *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
2398 }
google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto * msg,upb_arena * arena)2399 UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto *msg, upb_arena *arena) {
2400   struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
2401   if (sub == NULL) {
2402     sub = (struct google_protobuf_MethodOptions*)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
2403     if (!sub) return NULL;
2404     google_protobuf_MethodDescriptorProto_set_options(msg, sub);
2405   }
2406   return sub;
2407 }
google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)2408 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
2409   _upb_sethas(msg, 1);
2410   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2411 }
google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)2412 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
2413   _upb_sethas(msg, 2);
2414   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
2415 }
2416 
2417 /* google.protobuf.FileOptions */
2418 
google_protobuf_FileOptions_new(upb_arena * arena)2419 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
2420   return (google_protobuf_FileOptions *)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
2421 }
google_protobuf_FileOptions_parse(const char * buf,size_t size,upb_arena * arena)2422 UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
2423                         upb_arena *arena) {
2424   google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
2425   return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena)) ? ret : NULL;
2426 }
google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions * msg,upb_arena * arena,size_t * len)2427 UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
2428   return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
2429 }
2430 
google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions * msg)2431 UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions * msg)2432 UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); }
google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions * msg)2433 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions * msg)2434 UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); }
google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions * msg)2435 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions * msg)2436 UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions * msg)2437 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions * msg)2438 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions * msg)2439 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions * msg)2440 UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); }
google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions * msg)2441 UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions * msg)2442 UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions * msg)2443 UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions * msg)2444 UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); }
google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions * msg)2445 UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions * msg)2446 UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); }
google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)2447 UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)2448 UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions * msg)2449 UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions * msg)2450 UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions * msg)2451 UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions * msg)2452 UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); }
google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions * msg)2453 UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions * msg)2454 UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); }
google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions * msg)2455 UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions * msg)2456 UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview); }
google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions * msg)2457 UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions * msg)2458 UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview); }
google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions * msg)2459 UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions * msg)2460 UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview); }
google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions * msg)2461 UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions * msg)2462 UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview); }
google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions * msg)2463 UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions * msg)2464 UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview); }
google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions * msg)2465 UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions * msg)2466 UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions * msg)2467 UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 19); }
google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions * msg)2468 UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview); }
google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions * msg)2469 UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 20); }
google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions * msg)2470 UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview); }
google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions * msg)2471 UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 192)); }
google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions * msg,size_t * len)2472 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(108, 192), len); }
2473 
google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions * msg,upb_strview value)2474 UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
2475   _upb_sethas(msg, 11);
2476   *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value;
2477 }
google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions * msg,upb_strview value)2478 UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
2479   _upb_sethas(msg, 12);
2480   *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value;
2481 }
google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions * msg,int32_t value)2482 UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
2483   _upb_sethas(msg, 1);
2484   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2485 }
google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions * msg,bool value)2486 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
2487   _upb_sethas(msg, 2);
2488   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
2489 }
google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions * msg,upb_strview value)2490 UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
2491   _upb_sethas(msg, 13);
2492   *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value;
2493 }
google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions * msg,bool value)2494 UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
2495   _upb_sethas(msg, 3);
2496   *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
2497 }
google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions * msg,bool value)2498 UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
2499   _upb_sethas(msg, 4);
2500   *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value;
2501 }
google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions * msg,bool value)2502 UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
2503   _upb_sethas(msg, 5);
2504   *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool) = value;
2505 }
google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions * msg,bool value)2506 UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
2507   _upb_sethas(msg, 6);
2508   *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
2509 }
google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions * msg,bool value)2510 UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
2511   _upb_sethas(msg, 7);
2512   *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
2513 }
google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions * msg,bool value)2514 UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
2515   _upb_sethas(msg, 8);
2516   *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value;
2517 }
google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions * msg,bool value)2518 UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
2519   _upb_sethas(msg, 9);
2520   *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value;
2521 }
google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions * msg,upb_strview value)2522 UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
2523   _upb_sethas(msg, 14);
2524   *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview) = value;
2525 }
google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions * msg,upb_strview value)2526 UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
2527   _upb_sethas(msg, 15);
2528   *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview) = value;
2529 }
google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions * msg,upb_strview value)2530 UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
2531   _upb_sethas(msg, 16);
2532   *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview) = value;
2533 }
google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions * msg,upb_strview value)2534 UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
2535   _upb_sethas(msg, 17);
2536   *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview) = value;
2537 }
google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions * msg,upb_strview value)2538 UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
2539   _upb_sethas(msg, 18);
2540   *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview) = value;
2541 }
google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions * msg,bool value)2542 UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
2543   _upb_sethas(msg, 10);
2544   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
2545 }
google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions * msg,upb_strview value)2546 UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
2547   _upb_sethas(msg, 19);
2548   *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview) = value;
2549 }
google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions * msg,upb_strview value)2550 UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_strview value) {
2551   _upb_sethas(msg, 20);
2552   *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview) = value;
2553 }
google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions * msg,size_t * len)2554 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions *msg, size_t *len) {
2555   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 192), len);
2556 }
google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions * msg,size_t len,upb_arena * arena)2557 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions *msg, size_t len, upb_arena *arena) {
2558   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len, UPB_TYPE_MESSAGE, arena);
2559 }
google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions * msg,upb_arena * arena)2560 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions *msg, upb_arena *arena) {
2561   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2562   bool ok = _upb_array_append_accessor(
2563       msg, UPB_SIZE(108, 192), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2564   if (!ok) return NULL;
2565   return sub;
2566 }
2567 
2568 /* google.protobuf.MessageOptions */
2569 
google_protobuf_MessageOptions_new(upb_arena * arena)2570 UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(upb_arena *arena) {
2571   return (google_protobuf_MessageOptions *)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
2572 }
google_protobuf_MessageOptions_parse(const char * buf,size_t size,upb_arena * arena)2573 UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
2574                         upb_arena *arena) {
2575   google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
2576   return (ret && upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena)) ? ret : NULL;
2577 }
google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions * msg,upb_arena * arena,size_t * len)2578 UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
2579   return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
2580 }
2581 
google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions * msg)2582 UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions * msg)2583 UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)2584 UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)2585 UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions * msg)2586 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions * msg)2587 UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions * msg)2588 UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions * msg)2589 UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions * msg)2590 UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions * msg,size_t * len)2591 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); }
2592 
google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions * msg,bool value)2593 UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
2594   _upb_sethas(msg, 1);
2595   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2596 }
google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg,bool value)2597 UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
2598   _upb_sethas(msg, 2);
2599   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
2600 }
google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions * msg,bool value)2601 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
2602   _upb_sethas(msg, 3);
2603   *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
2604 }
google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions * msg,bool value)2605 UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
2606   _upb_sethas(msg, 4);
2607   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
2608 }
google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t * len)2609 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t *len) {
2610   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
2611 }
google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t len,upb_arena * arena)2612 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t len, upb_arena *arena) {
2613   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_TYPE_MESSAGE, arena);
2614 }
google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions * msg,upb_arena * arena)2615 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions *msg, upb_arena *arena) {
2616   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2617   bool ok = _upb_array_append_accessor(
2618       msg, UPB_SIZE(8, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2619   if (!ok) return NULL;
2620   return sub;
2621 }
2622 
2623 /* google.protobuf.FieldOptions */
2624 
google_protobuf_FieldOptions_new(upb_arena * arena)2625 UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_arena *arena) {
2626   return (google_protobuf_FieldOptions *)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
2627 }
google_protobuf_FieldOptions_parse(const char * buf,size_t size,upb_arena * arena)2628 UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
2629                         upb_arena *arena) {
2630   google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
2631   return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena)) ? ret : NULL;
2632 }
google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions * msg,upb_arena * arena,size_t * len)2633 UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
2634   return upb_encode(msg, &google_protobuf_FieldOptions_msginit, arena, len);
2635 }
2636 
google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions * msg)2637 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions * msg)2638 UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions * msg)2639 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions * msg)2640 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions * msg)2641 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions * msg)2642 UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions * msg)2643 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions * msg)2644 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions * msg)2645 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions * msg)2646 UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions * msg)2647 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 6); }
google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions * msg)2648 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions * msg)2649 UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions * msg,size_t * len)2650 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
2651 
google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions * msg,int32_t value)2652 UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
2653   _upb_sethas(msg, 1);
2654   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2655 }
google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions * msg,bool value)2656 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
2657   _upb_sethas(msg, 3);
2658   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
2659 }
google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions * msg,bool value)2660 UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
2661   _upb_sethas(msg, 4);
2662   *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
2663 }
google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions * msg,bool value)2664 UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
2665   _upb_sethas(msg, 5);
2666   *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
2667 }
google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions * msg,int32_t value)2668 UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
2669   _upb_sethas(msg, 2);
2670   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
2671 }
google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions * msg,bool value)2672 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
2673   _upb_sethas(msg, 6);
2674   *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
2675 }
google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t * len)2676 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t *len) {
2677   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
2678 }
google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t len,upb_arena * arena)2679 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t len, upb_arena *arena) {
2680   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_MESSAGE, arena);
2681 }
google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions * msg,upb_arena * arena)2682 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions *msg, upb_arena *arena) {
2683   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2684   bool ok = _upb_array_append_accessor(
2685       msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2686   if (!ok) return NULL;
2687   return sub;
2688 }
2689 
2690 /* google.protobuf.OneofOptions */
2691 
google_protobuf_OneofOptions_new(upb_arena * arena)2692 UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_arena *arena) {
2693   return (google_protobuf_OneofOptions *)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
2694 }
google_protobuf_OneofOptions_parse(const char * buf,size_t size,upb_arena * arena)2695 UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
2696                         upb_arena *arena) {
2697   google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
2698   return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena)) ? ret : NULL;
2699 }
google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions * msg,upb_arena * arena,size_t * len)2700 UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
2701   return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
2702 }
2703 
google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions * msg)2704 UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions * msg,size_t * len)2705 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
2706 
google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t * len)2707 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t *len) {
2708   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
2709 }
google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t len,upb_arena * arena)2710 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t len, upb_arena *arena) {
2711   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
2712 }
google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions * msg,upb_arena * arena)2713 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions *msg, upb_arena *arena) {
2714   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2715   bool ok = _upb_array_append_accessor(
2716       msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2717   if (!ok) return NULL;
2718   return sub;
2719 }
2720 
2721 /* google.protobuf.EnumOptions */
2722 
google_protobuf_EnumOptions_new(upb_arena * arena)2723 UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_arena *arena) {
2724   return (google_protobuf_EnumOptions *)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
2725 }
google_protobuf_EnumOptions_parse(const char * buf,size_t size,upb_arena * arena)2726 UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
2727                         upb_arena *arena) {
2728   google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
2729   return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena)) ? ret : NULL;
2730 }
google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions * msg,upb_arena * arena,size_t * len)2731 UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
2732   return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
2733 }
2734 
google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions * msg)2735 UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions * msg)2736 UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions * msg)2737 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions * msg)2738 UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions * msg)2739 UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions * msg,size_t * len)2740 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
2741 
google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions * msg,bool value)2742 UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
2743   _upb_sethas(msg, 1);
2744   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2745 }
google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions * msg,bool value)2746 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
2747   _upb_sethas(msg, 2);
2748   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
2749 }
google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t * len)2750 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t *len) {
2751   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
2752 }
google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t len,upb_arena * arena)2753 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t len, upb_arena *arena) {
2754   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
2755 }
google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions * msg,upb_arena * arena)2756 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions *msg, upb_arena *arena) {
2757   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2758   bool ok = _upb_array_append_accessor(
2759       msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2760   if (!ok) return NULL;
2761   return sub;
2762 }
2763 
2764 /* google.protobuf.EnumValueOptions */
2765 
google_protobuf_EnumValueOptions_new(upb_arena * arena)2766 UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_new(upb_arena *arena) {
2767   return (google_protobuf_EnumValueOptions *)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
2768 }
google_protobuf_EnumValueOptions_parse(const char * buf,size_t size,upb_arena * arena)2769 UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
2770                         upb_arena *arena) {
2771   google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
2772   return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena)) ? ret : NULL;
2773 }
google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions * msg,upb_arena * arena,size_t * len)2774 UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
2775   return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
2776 }
2777 
google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions * msg)2778 UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions * msg)2779 UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions * msg)2780 UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions * msg,size_t * len)2781 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
2782 
google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions * msg,bool value)2783 UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
2784   _upb_sethas(msg, 1);
2785   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2786 }
google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t * len)2787 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t *len) {
2788   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
2789 }
google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t len,upb_arena * arena)2790 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t len, upb_arena *arena) {
2791   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
2792 }
google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions * msg,upb_arena * arena)2793 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions *msg, upb_arena *arena) {
2794   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2795   bool ok = _upb_array_append_accessor(
2796       msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2797   if (!ok) return NULL;
2798   return sub;
2799 }
2800 
2801 /* google.protobuf.ServiceOptions */
2802 
google_protobuf_ServiceOptions_new(upb_arena * arena)2803 UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(upb_arena *arena) {
2804   return (google_protobuf_ServiceOptions *)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
2805 }
google_protobuf_ServiceOptions_parse(const char * buf,size_t size,upb_arena * arena)2806 UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
2807                         upb_arena *arena) {
2808   google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
2809   return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena)) ? ret : NULL;
2810 }
google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions * msg,upb_arena * arena,size_t * len)2811 UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
2812   return upb_encode(msg, &google_protobuf_ServiceOptions_msginit, arena, len);
2813 }
2814 
google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions * msg)2815 UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions * msg)2816 UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions * msg)2817 UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions * msg,size_t * len)2818 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
2819 
google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions * msg,bool value)2820 UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
2821   _upb_sethas(msg, 1);
2822   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2823 }
google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t * len)2824 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t *len) {
2825   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
2826 }
google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t len,upb_arena * arena)2827 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t len, upb_arena *arena) {
2828   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
2829 }
google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions * msg,upb_arena * arena)2830 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions *msg, upb_arena *arena) {
2831   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2832   bool ok = _upb_array_append_accessor(
2833       msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2834   if (!ok) return NULL;
2835   return sub;
2836 }
2837 
2838 /* google.protobuf.MethodOptions */
2839 
google_protobuf_MethodOptions_new(upb_arena * arena)2840 UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_arena *arena) {
2841   return (google_protobuf_MethodOptions *)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
2842 }
google_protobuf_MethodOptions_parse(const char * buf,size_t size,upb_arena * arena)2843 UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
2844                         upb_arena *arena) {
2845   google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
2846   return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena)) ? ret : NULL;
2847 }
google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions * msg,upb_arena * arena,size_t * len)2848 UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
2849   return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
2850 }
2851 
google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions * msg)2852 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions * msg)2853 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions * msg)2854 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions * msg)2855 UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions * msg)2856 UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions * msg,size_t * len)2857 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
2858 
google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions * msg,bool value)2859 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
2860   _upb_sethas(msg, 2);
2861   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
2862 }
google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions * msg,int32_t value)2863 UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
2864   _upb_sethas(msg, 1);
2865   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2866 }
google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t * len)2867 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
2868   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
2869 }
google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t len,upb_arena * arena)2870 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t len, upb_arena *arena) {
2871   return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_MESSAGE, arena);
2872 }
google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions * msg,upb_arena * arena)2873 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions *msg, upb_arena *arena) {
2874   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2875   bool ok = _upb_array_append_accessor(
2876       msg, UPB_SIZE(20, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2877   if (!ok) return NULL;
2878   return sub;
2879 }
2880 
2881 /* google.protobuf.UninterpretedOption */
2882 
google_protobuf_UninterpretedOption_new(upb_arena * arena)2883 UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_new(upb_arena *arena) {
2884   return (google_protobuf_UninterpretedOption *)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
2885 }
google_protobuf_UninterpretedOption_parse(const char * buf,size_t size,upb_arena * arena)2886 UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
2887                         upb_arena *arena) {
2888   google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
2889   return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena)) ? ret : NULL;
2890 }
google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption * msg,upb_arena * arena,size_t * len)2891 UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
2892   return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
2893 }
2894 
google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption * msg)2895 UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption * msg,size_t * len)2896 UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption *msg, size_t *len) { return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(56, 80), len); }
google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption * msg)2897 UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 4); }
google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption * msg)2898 UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption * msg)2899 UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption * msg)2900 UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption * msg)2901 UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption * msg)2902 UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption * msg)2903 UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption * msg)2904 UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption * msg)2905 UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 5); }
google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption * msg)2906 UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption * msg)2907 UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 6); }
google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption * msg)2908 UPB_INLINE upb_strview google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
2909 
google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption * msg,size_t * len)2910 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption *msg, size_t *len) {
2911   return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 80), len);
2912 }
google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption * msg,size_t len,upb_arena * arena)2913 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption *msg, size_t len, upb_arena *arena) {
2914   return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len, UPB_TYPE_MESSAGE, arena);
2915 }
google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption * msg,upb_arena * arena)2916 UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption *msg, upb_arena *arena) {
2917   struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
2918   bool ok = _upb_array_append_accessor(
2919       msg, UPB_SIZE(56, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
2920   if (!ok) return NULL;
2921   return sub;
2922 }
google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption * msg,upb_strview value)2923 UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
2924   _upb_sethas(msg, 4);
2925   *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
2926 }
google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption * msg,uint64_t value)2927 UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
2928   _upb_sethas(msg, 1);
2929   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
2930 }
google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption * msg,int64_t value)2931 UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
2932   _upb_sethas(msg, 2);
2933   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
2934 }
google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption * msg,double value)2935 UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
2936   _upb_sethas(msg, 3);
2937   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
2938 }
google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption * msg,upb_strview value)2939 UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
2940   _upb_sethas(msg, 5);
2941   *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
2942 }
google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption * msg,upb_strview value)2943 UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
2944   _upb_sethas(msg, 6);
2945   *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
2946 }
2947 
2948 /* google.protobuf.UninterpretedOption.NamePart */
2949 
google_protobuf_UninterpretedOption_NamePart_new(upb_arena * arena)2950 UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_new(upb_arena *arena) {
2951   return (google_protobuf_UninterpretedOption_NamePart *)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
2952 }
google_protobuf_UninterpretedOption_NamePart_parse(const char * buf,size_t size,upb_arena * arena)2953 UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
2954                         upb_arena *arena) {
2955   google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
2956   return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena)) ? ret : NULL;
2957 }
google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart * msg,upb_arena * arena,size_t * len)2958 UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
2959   return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
2960 }
2961 
google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)2962 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)2963 UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)2964 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)2965 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
2966 
google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart * msg,upb_strview value)2967 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_strview value) {
2968   _upb_sethas(msg, 2);
2969   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
2970 }
google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart * msg,bool value)2971 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
2972   _upb_sethas(msg, 1);
2973   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
2974 }
2975 
2976 /* google.protobuf.SourceCodeInfo */
2977 
google_protobuf_SourceCodeInfo_new(upb_arena * arena)2978 UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(upb_arena *arena) {
2979   return (google_protobuf_SourceCodeInfo *)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
2980 }
google_protobuf_SourceCodeInfo_parse(const char * buf,size_t size,upb_arena * arena)2981 UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
2982                         upb_arena *arena) {
2983   google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
2984   return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena)) ? ret : NULL;
2985 }
google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo * msg,upb_arena * arena,size_t * len)2986 UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
2987   return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
2988 }
2989 
google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo * msg)2990 UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo * msg,size_t * len)2991 UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo *msg, size_t *len) { return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
2992 
google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo * msg,size_t * len)2993 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo *msg, size_t *len) {
2994   return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
2995 }
google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo * msg,size_t len,upb_arena * arena)2996 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo *msg, size_t len, upb_arena *arena) {
2997   return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
2998 }
google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo * msg,upb_arena * arena)2999 UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo *msg, upb_arena *arena) {
3000   struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
3001   bool ok = _upb_array_append_accessor(
3002       msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
3003   if (!ok) return NULL;
3004   return sub;
3005 }
3006 
3007 /* google.protobuf.SourceCodeInfo.Location */
3008 
google_protobuf_SourceCodeInfo_Location_new(upb_arena * arena)3009 UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_new(upb_arena *arena) {
3010   return (google_protobuf_SourceCodeInfo_Location *)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
3011 }
google_protobuf_SourceCodeInfo_Location_parse(const char * buf,size_t size,upb_arena * arena)3012 UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
3013                         upb_arena *arena) {
3014   google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
3015   return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena)) ? ret : NULL;
3016 }
google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location * msg,upb_arena * arena,size_t * len)3017 UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
3018   return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
3019 }
3020 
google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3021 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3022 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)3023 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)3024 UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)3025 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)3026 UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3027 UPB_INLINE upb_strview const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
3028 
google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3029 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
3030   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
3031 }
google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_arena * arena)3032 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
3033   return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_INT32, arena);
3034 }
google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_arena * arena)3035 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
3036   return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
3037       arena);
3038 }
google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3039 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
3040   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
3041 }
google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_arena * arena)3042 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
3043   return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_INT32, arena);
3044 }
google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_arena * arena)3045 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
3046   return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
3047       arena);
3048 }
google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_strview value)3049 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
3050   _upb_sethas(msg, 1);
3051   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
3052 }
google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_strview value)3053 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
3054   _upb_sethas(msg, 2);
3055   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
3056 }
google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)3057 UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
3058   return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
3059 }
google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_arena * arena)3060 UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
3061   return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
3062 }
google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_strview val,upb_arena * arena)3063 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview val, upb_arena *arena) {
3064   return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
3065       arena);
3066 }
3067 
3068 /* google.protobuf.GeneratedCodeInfo */
3069 
google_protobuf_GeneratedCodeInfo_new(upb_arena * arena)3070 UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_new(upb_arena *arena) {
3071   return (google_protobuf_GeneratedCodeInfo *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
3072 }
google_protobuf_GeneratedCodeInfo_parse(const char * buf,size_t size,upb_arena * arena)3073 UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
3074                         upb_arena *arena) {
3075   google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
3076   return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena)) ? ret : NULL;
3077 }
google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo * msg,upb_arena * arena,size_t * len)3078 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
3079   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
3080 }
3081 
google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo * msg)3082 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo * msg,size_t * len)3083 UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo *msg, size_t *len) { return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
3084 
google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t * len)3085 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t *len) {
3086   return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
3087 }
google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t len,upb_arena * arena)3088 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t len, upb_arena *arena) {
3089   return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
3090 }
google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo * msg,upb_arena * arena)3091 UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena) {
3092   struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
3093   bool ok = _upb_array_append_accessor(
3094       msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
3095   if (!ok) return NULL;
3096   return sub;
3097 }
3098 
3099 /* google.protobuf.GeneratedCodeInfo.Annotation */
3100 
google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena * arena)3101 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena *arena) {
3102   return (google_protobuf_GeneratedCodeInfo_Annotation *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
3103 }
google_protobuf_GeneratedCodeInfo_Annotation_parse(const char * buf,size_t size,upb_arena * arena)3104 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
3105                         upb_arena *arena) {
3106   google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
3107   return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena)) ? ret : NULL;
3108 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_arena * arena,size_t * len)3109 UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
3110   return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
3111 }
3112 
google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * len)3113 UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); }
google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3114 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 3); }
google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3115 UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3116 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 1); }
google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3117 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3118 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 2); }
google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)3119 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
3120 
google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * len)3121 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) {
3122   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
3123 }
google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t len,upb_arena * arena)3124 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t len, upb_arena *arena) {
3125   return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_TYPE_INT32, arena);
3126 }
google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t val,upb_arena * arena)3127 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t val, upb_arena *arena) {
3128   return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
3129       arena);
3130 }
google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_strview value)3131 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
3132   _upb_sethas(msg, 3);
3133   *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
3134 }
google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)3135 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
3136   _upb_sethas(msg, 1);
3137   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3138 }
google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)3139 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
3140   _upb_sethas(msg, 2);
3141   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
3142 }
3143 
3144 #ifdef __cplusplus
3145 }  /* extern "C" */
3146 #endif
3147 
3148 
3149 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
3150 /*
3151 ** Defs are upb's internal representation of the constructs that can appear
3152 ** in a .proto file:
3153 **
3154 ** - upb_msgdef: describes a "message" construct.
3155 ** - upb_fielddef: describes a message field.
3156 ** - upb_filedef: describes a .proto file and its defs.
3157 ** - upb_enumdef: describes an enum.
3158 ** - upb_oneofdef: describes a oneof.
3159 **
3160 ** TODO: definitions of services.
3161 */
3162 
3163 #ifndef UPB_DEF_H_
3164 #define UPB_DEF_H_
3165 
3166 
3167 
3168 #ifdef __cplusplus
3169 extern "C" {
3170 #endif  /* __cplusplus */
3171 
3172 struct upb_enumdef;
3173 typedef struct upb_enumdef upb_enumdef;
3174 struct upb_fielddef;
3175 typedef struct upb_fielddef upb_fielddef;
3176 struct upb_filedef;
3177 typedef struct upb_filedef upb_filedef;
3178 struct upb_msgdef;
3179 typedef struct upb_msgdef upb_msgdef;
3180 struct upb_oneofdef;
3181 typedef struct upb_oneofdef upb_oneofdef;
3182 struct upb_symtab;
3183 typedef struct upb_symtab upb_symtab;
3184 
3185 typedef enum {
3186   UPB_SYNTAX_PROTO2 = 2,
3187   UPB_SYNTAX_PROTO3 = 3
3188 } upb_syntax_t;
3189 
3190 /* All the different kind of well known type messages. For simplicity of check,
3191  * number wrappers and string wrappers are grouped together. Make sure the
3192  * order and merber of these groups are not changed.
3193  */
3194 typedef enum {
3195   UPB_WELLKNOWN_UNSPECIFIED,
3196   UPB_WELLKNOWN_ANY,
3197   UPB_WELLKNOWN_FIELDMASK,
3198   UPB_WELLKNOWN_DURATION,
3199   UPB_WELLKNOWN_TIMESTAMP,
3200   /* number wrappers */
3201   UPB_WELLKNOWN_DOUBLEVALUE,
3202   UPB_WELLKNOWN_FLOATVALUE,
3203   UPB_WELLKNOWN_INT64VALUE,
3204   UPB_WELLKNOWN_UINT64VALUE,
3205   UPB_WELLKNOWN_INT32VALUE,
3206   UPB_WELLKNOWN_UINT32VALUE,
3207   /* string wrappers */
3208   UPB_WELLKNOWN_STRINGVALUE,
3209   UPB_WELLKNOWN_BYTESVALUE,
3210   UPB_WELLKNOWN_BOOLVALUE,
3211   UPB_WELLKNOWN_VALUE,
3212   UPB_WELLKNOWN_LISTVALUE,
3213   UPB_WELLKNOWN_STRUCT
3214 } upb_wellknowntype_t;
3215 
3216 /* upb_fielddef ***************************************************************/
3217 
3218 /* Maximum field number allowed for FieldDefs.  This is an inherent limit of the
3219  * protobuf wire format. */
3220 #define UPB_MAX_FIELDNUMBER ((1 << 29) - 1)
3221 
3222 const char *upb_fielddef_fullname(const upb_fielddef *f);
3223 upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f);
3224 upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f);
3225 upb_label_t upb_fielddef_label(const upb_fielddef *f);
3226 uint32_t upb_fielddef_number(const upb_fielddef *f);
3227 const char *upb_fielddef_name(const upb_fielddef *f);
3228 const char *upb_fielddef_jsonname(const upb_fielddef *f);
3229 bool upb_fielddef_isextension(const upb_fielddef *f);
3230 bool upb_fielddef_lazy(const upb_fielddef *f);
3231 bool upb_fielddef_packed(const upb_fielddef *f);
3232 const upb_filedef *upb_fielddef_file(const upb_fielddef *f);
3233 const upb_msgdef *upb_fielddef_containingtype(const upb_fielddef *f);
3234 const upb_oneofdef *upb_fielddef_containingoneof(const upb_fielddef *f);
3235 const upb_oneofdef *upb_fielddef_realcontainingoneof(const upb_fielddef *f);
3236 uint32_t upb_fielddef_index(const upb_fielddef *f);
3237 bool upb_fielddef_issubmsg(const upb_fielddef *f);
3238 bool upb_fielddef_isstring(const upb_fielddef *f);
3239 bool upb_fielddef_isseq(const upb_fielddef *f);
3240 bool upb_fielddef_isprimitive(const upb_fielddef *f);
3241 bool upb_fielddef_ismap(const upb_fielddef *f);
3242 int64_t upb_fielddef_defaultint64(const upb_fielddef *f);
3243 int32_t upb_fielddef_defaultint32(const upb_fielddef *f);
3244 uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f);
3245 uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f);
3246 bool upb_fielddef_defaultbool(const upb_fielddef *f);
3247 float upb_fielddef_defaultfloat(const upb_fielddef *f);
3248 double upb_fielddef_defaultdouble(const upb_fielddef *f);
3249 const char *upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len);
3250 bool upb_fielddef_hassubdef(const upb_fielddef *f);
3251 bool upb_fielddef_haspresence(const upb_fielddef *f);
3252 const upb_msgdef *upb_fielddef_msgsubdef(const upb_fielddef *f);
3253 const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f);
3254 const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f);
3255 
3256 /* Internal only. */
3257 uint32_t upb_fielddef_selectorbase(const upb_fielddef *f);
3258 
3259 /* upb_oneofdef ***************************************************************/
3260 
3261 typedef upb_inttable_iter upb_oneof_iter;
3262 
3263 const char *upb_oneofdef_name(const upb_oneofdef *o);
3264 const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o);
3265 int upb_oneofdef_numfields(const upb_oneofdef *o);
3266 uint32_t upb_oneofdef_index(const upb_oneofdef *o);
3267 bool upb_oneofdef_issynthetic(const upb_oneofdef *o);
3268 
3269 /* Oneof lookups:
3270  * - ntof:  look up a field by name.
3271  * - ntofz: look up a field by name (as a null-terminated string).
3272  * - itof:  look up a field by number. */
3273 const upb_fielddef *upb_oneofdef_ntof(const upb_oneofdef *o,
3274                                       const char *name, size_t length);
upb_oneofdef_ntofz(const upb_oneofdef * o,const char * name)3275 UPB_INLINE const upb_fielddef *upb_oneofdef_ntofz(const upb_oneofdef *o,
3276                                                   const char *name) {
3277   return upb_oneofdef_ntof(o, name, strlen(name));
3278 }
3279 const upb_fielddef *upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num);
3280 
3281 /*  upb_oneof_iter i;
3282  *  for(upb_oneof_begin(&i, e); !upb_oneof_done(&i); upb_oneof_next(&i)) {
3283  *    // ...
3284  *  }
3285  */
3286 void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o);
3287 void upb_oneof_next(upb_oneof_iter *iter);
3288 bool upb_oneof_done(upb_oneof_iter *iter);
3289 upb_fielddef *upb_oneof_iter_field(const upb_oneof_iter *iter);
3290 void upb_oneof_iter_setdone(upb_oneof_iter *iter);
3291 bool upb_oneof_iter_isequal(const upb_oneof_iter *iter1,
3292                             const upb_oneof_iter *iter2);
3293 
3294 /* upb_msgdef *****************************************************************/
3295 
3296 typedef upb_inttable_iter upb_msg_field_iter;
3297 typedef upb_strtable_iter upb_msg_oneof_iter;
3298 
3299 /* Well-known field tag numbers for map-entry messages. */
3300 #define UPB_MAPENTRY_KEY   1
3301 #define UPB_MAPENTRY_VALUE 2
3302 
3303 /* Well-known field tag numbers for Any messages. */
3304 #define UPB_ANY_TYPE 1
3305 #define UPB_ANY_VALUE 2
3306 
3307 /* Well-known field tag numbers for timestamp messages. */
3308 #define UPB_DURATION_SECONDS 1
3309 #define UPB_DURATION_NANOS 2
3310 
3311 /* Well-known field tag numbers for duration messages. */
3312 #define UPB_TIMESTAMP_SECONDS 1
3313 #define UPB_TIMESTAMP_NANOS 2
3314 
3315 const char *upb_msgdef_fullname(const upb_msgdef *m);
3316 const upb_filedef *upb_msgdef_file(const upb_msgdef *m);
3317 const char *upb_msgdef_name(const upb_msgdef *m);
3318 int upb_msgdef_numfields(const upb_msgdef *m);
3319 int upb_msgdef_numoneofs(const upb_msgdef *m);
3320 int upb_msgdef_numrealoneofs(const upb_msgdef *m);
3321 upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m);
3322 bool upb_msgdef_mapentry(const upb_msgdef *m);
3323 upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m);
3324 bool upb_msgdef_iswrapper(const upb_msgdef *m);
3325 bool upb_msgdef_isnumberwrapper(const upb_msgdef *m);
3326 const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i);
3327 const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
3328                                     size_t len);
3329 const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name,
3330                                     size_t len);
3331 const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m);
3332 const upb_fielddef *_upb_msgdef_field(const upb_msgdef *m, int i);
3333 
upb_msgdef_ntooz(const upb_msgdef * m,const char * name)3334 UPB_INLINE const upb_oneofdef *upb_msgdef_ntooz(const upb_msgdef *m,
3335                                                const char *name) {
3336   return upb_msgdef_ntoo(m, name, strlen(name));
3337 }
3338 
upb_msgdef_ntofz(const upb_msgdef * m,const char * name)3339 UPB_INLINE const upb_fielddef *upb_msgdef_ntofz(const upb_msgdef *m,
3340                                                 const char *name) {
3341   return upb_msgdef_ntof(m, name, strlen(name));
3342 }
3343 
3344 /* Internal-only. */
3345 size_t upb_msgdef_selectorcount(const upb_msgdef *m);
3346 uint32_t upb_msgdef_submsgfieldcount(const upb_msgdef *m);
3347 
3348 /* Lookup of either field or oneof by name.  Returns whether either was found.
3349  * If the return is true, then the found def will be set, and the non-found
3350  * one set to NULL. */
3351 bool upb_msgdef_lookupname(const upb_msgdef *m, const char *name, size_t len,
3352                            const upb_fielddef **f, const upb_oneofdef **o);
3353 
upb_msgdef_lookupnamez(const upb_msgdef * m,const char * name,const upb_fielddef ** f,const upb_oneofdef ** o)3354 UPB_INLINE bool upb_msgdef_lookupnamez(const upb_msgdef *m, const char *name,
3355                                        const upb_fielddef **f,
3356                                        const upb_oneofdef **o) {
3357   return upb_msgdef_lookupname(m, name, strlen(name), f, o);
3358 }
3359 
3360 /* Returns a field by either JSON name or regular proto name. */
3361 const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m,
3362                                               const char *name, size_t len);
3363 
3364 /* Iteration over fields and oneofs.  For example:
3365  *
3366  * upb_msg_field_iter i;
3367  * for(upb_msg_field_begin(&i, m);
3368  *     !upb_msg_field_done(&i);
3369  *     upb_msg_field_next(&i)) {
3370  *   upb_fielddef *f = upb_msg_iter_field(&i);
3371  *   // ...
3372  * }
3373  *
3374  * For C we don't have separate iterators for const and non-const.
3375  * It is the caller's responsibility to cast the upb_fielddef* to
3376  * const if the upb_msgdef* is const. */
3377 void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m);
3378 void upb_msg_field_next(upb_msg_field_iter *iter);
3379 bool upb_msg_field_done(const upb_msg_field_iter *iter);
3380 upb_fielddef *upb_msg_iter_field(const upb_msg_field_iter *iter);
3381 void upb_msg_field_iter_setdone(upb_msg_field_iter *iter);
3382 bool upb_msg_field_iter_isequal(const upb_msg_field_iter * iter1,
3383                                 const upb_msg_field_iter * iter2);
3384 
3385 /* Similar to above, we also support iterating through the oneofs in a
3386  * msgdef. */
3387 void upb_msg_oneof_begin(upb_msg_oneof_iter * iter, const upb_msgdef *m);
3388 void upb_msg_oneof_next(upb_msg_oneof_iter * iter);
3389 bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter);
3390 const upb_oneofdef *upb_msg_iter_oneof(const upb_msg_oneof_iter *iter);
3391 void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter * iter);
3392 bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1,
3393                                 const upb_msg_oneof_iter *iter2);
3394 
3395 /* upb_enumdef ****************************************************************/
3396 
3397 typedef upb_strtable_iter upb_enum_iter;
3398 
3399 const char *upb_enumdef_fullname(const upb_enumdef *e);
3400 const char *upb_enumdef_name(const upb_enumdef *e);
3401 const upb_filedef *upb_enumdef_file(const upb_enumdef *e);
3402 int32_t upb_enumdef_default(const upb_enumdef *e);
3403 int upb_enumdef_numvals(const upb_enumdef *e);
3404 
3405 /* Enum lookups:
3406  * - ntoi:  look up a name with specified length.
3407  * - ntoiz: look up a name provided as a null-terminated string.
3408  * - iton:  look up an integer, returning the name as a null-terminated
3409  *          string. */
3410 bool upb_enumdef_ntoi(const upb_enumdef *e, const char *name, size_t len,
3411                       int32_t *num);
upb_enumdef_ntoiz(const upb_enumdef * e,const char * name,int32_t * num)3412 UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e,
3413                                   const char *name, int32_t *num) {
3414   return upb_enumdef_ntoi(e, name, strlen(name), num);
3415 }
3416 const char *upb_enumdef_iton(const upb_enumdef *e, int32_t num);
3417 
3418 /*  upb_enum_iter i;
3419  *  for(upb_enum_begin(&i, e); !upb_enum_done(&i); upb_enum_next(&i)) {
3420  *    // ...
3421  *  }
3422  */
3423 void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e);
3424 void upb_enum_next(upb_enum_iter *iter);
3425 bool upb_enum_done(upb_enum_iter *iter);
3426 const char *upb_enum_iter_name(upb_enum_iter *iter);
3427 int32_t upb_enum_iter_number(upb_enum_iter *iter);
3428 
3429 /* upb_filedef ****************************************************************/
3430 
3431 const char *upb_filedef_name(const upb_filedef *f);
3432 const char *upb_filedef_package(const upb_filedef *f);
3433 const char *upb_filedef_phpprefix(const upb_filedef *f);
3434 const char *upb_filedef_phpnamespace(const upb_filedef *f);
3435 upb_syntax_t upb_filedef_syntax(const upb_filedef *f);
3436 int upb_filedef_depcount(const upb_filedef *f);
3437 int upb_filedef_msgcount(const upb_filedef *f);
3438 int upb_filedef_enumcount(const upb_filedef *f);
3439 const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i);
3440 const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i);
3441 const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i);
3442 
3443 /* upb_symtab *****************************************************************/
3444 
3445 upb_symtab *upb_symtab_new(void);
3446 void upb_symtab_free(upb_symtab* s);
3447 const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym);
3448 const upb_msgdef *upb_symtab_lookupmsg2(
3449     const upb_symtab *s, const char *sym, size_t len);
3450 const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym);
3451 const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name);
3452 const upb_filedef *upb_symtab_lookupfile2(
3453     const upb_symtab *s, const char *name, size_t len);
3454 int upb_symtab_filecount(const upb_symtab *s);
3455 const upb_filedef *upb_symtab_addfile(
3456     upb_symtab *s, const google_protobuf_FileDescriptorProto *file,
3457     upb_status *status);
3458 
3459 /* For generated code only: loads a generated descriptor. */
3460 typedef struct upb_def_init {
3461   struct upb_def_init **deps;     /* Dependencies of this file. */
3462   const upb_msglayout **layouts;  /* Pre-order layouts of all messages. */
3463   const char *filename;
3464   upb_strview descriptor;         /* Serialized descriptor. */
3465 } upb_def_init;
3466 
3467 bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init);
3468 
3469 
3470 #ifdef __cplusplus
3471 }  /* extern "C" */
3472 #endif  /* __cplusplus */
3473 
3474 #endif /* UPB_DEF_H_ */
3475 /* This file was generated by upbc (the upb compiler) from the input
3476  * file:
3477  *
3478  *     google/protobuf/descriptor.proto
3479  *
3480  * Do not edit -- your changes will be discarded when the file is
3481  * regenerated. */
3482 
3483 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_
3484 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_
3485 
3486 #ifdef __cplusplus
3487 extern "C" {
3488 #endif
3489 
3490 
3491 
3492 extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
3493 
google_protobuf_FileDescriptorSet_getmsgdef(upb_symtab * s)3494 UPB_INLINE const upb_msgdef *google_protobuf_FileDescriptorSet_getmsgdef(upb_symtab *s) {
3495   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3496   return upb_symtab_lookupmsg(s, "google.protobuf.FileDescriptorSet");
3497 }
3498 
google_protobuf_FileDescriptorProto_getmsgdef(upb_symtab * s)3499 UPB_INLINE const upb_msgdef *google_protobuf_FileDescriptorProto_getmsgdef(upb_symtab *s) {
3500   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3501   return upb_symtab_lookupmsg(s, "google.protobuf.FileDescriptorProto");
3502 }
3503 
google_protobuf_DescriptorProto_getmsgdef(upb_symtab * s)3504 UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_getmsgdef(upb_symtab *s) {
3505   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3506   return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto");
3507 }
3508 
google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_symtab * s)3509 UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_symtab *s) {
3510   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3511   return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto.ExtensionRange");
3512 }
3513 
google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_symtab * s)3514 UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_symtab *s) {
3515   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3516   return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto.ReservedRange");
3517 }
3518 
google_protobuf_ExtensionRangeOptions_getmsgdef(upb_symtab * s)3519 UPB_INLINE const upb_msgdef *google_protobuf_ExtensionRangeOptions_getmsgdef(upb_symtab *s) {
3520   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3521   return upb_symtab_lookupmsg(s, "google.protobuf.ExtensionRangeOptions");
3522 }
3523 
google_protobuf_FieldDescriptorProto_getmsgdef(upb_symtab * s)3524 UPB_INLINE const upb_msgdef *google_protobuf_FieldDescriptorProto_getmsgdef(upb_symtab *s) {
3525   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3526   return upb_symtab_lookupmsg(s, "google.protobuf.FieldDescriptorProto");
3527 }
3528 
google_protobuf_OneofDescriptorProto_getmsgdef(upb_symtab * s)3529 UPB_INLINE const upb_msgdef *google_protobuf_OneofDescriptorProto_getmsgdef(upb_symtab *s) {
3530   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3531   return upb_symtab_lookupmsg(s, "google.protobuf.OneofDescriptorProto");
3532 }
3533 
google_protobuf_EnumDescriptorProto_getmsgdef(upb_symtab * s)3534 UPB_INLINE const upb_msgdef *google_protobuf_EnumDescriptorProto_getmsgdef(upb_symtab *s) {
3535   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3536   return upb_symtab_lookupmsg(s, "google.protobuf.EnumDescriptorProto");
3537 }
3538 
google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_symtab * s)3539 UPB_INLINE const upb_msgdef *google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_symtab *s) {
3540   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3541   return upb_symtab_lookupmsg(s, "google.protobuf.EnumDescriptorProto.EnumReservedRange");
3542 }
3543 
google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_symtab * s)3544 UPB_INLINE const upb_msgdef *google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_symtab *s) {
3545   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3546   return upb_symtab_lookupmsg(s, "google.protobuf.EnumValueDescriptorProto");
3547 }
3548 
google_protobuf_ServiceDescriptorProto_getmsgdef(upb_symtab * s)3549 UPB_INLINE const upb_msgdef *google_protobuf_ServiceDescriptorProto_getmsgdef(upb_symtab *s) {
3550   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3551   return upb_symtab_lookupmsg(s, "google.protobuf.ServiceDescriptorProto");
3552 }
3553 
google_protobuf_MethodDescriptorProto_getmsgdef(upb_symtab * s)3554 UPB_INLINE const upb_msgdef *google_protobuf_MethodDescriptorProto_getmsgdef(upb_symtab *s) {
3555   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3556   return upb_symtab_lookupmsg(s, "google.protobuf.MethodDescriptorProto");
3557 }
3558 
google_protobuf_FileOptions_getmsgdef(upb_symtab * s)3559 UPB_INLINE const upb_msgdef *google_protobuf_FileOptions_getmsgdef(upb_symtab *s) {
3560   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3561   return upb_symtab_lookupmsg(s, "google.protobuf.FileOptions");
3562 }
3563 
google_protobuf_MessageOptions_getmsgdef(upb_symtab * s)3564 UPB_INLINE const upb_msgdef *google_protobuf_MessageOptions_getmsgdef(upb_symtab *s) {
3565   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3566   return upb_symtab_lookupmsg(s, "google.protobuf.MessageOptions");
3567 }
3568 
google_protobuf_FieldOptions_getmsgdef(upb_symtab * s)3569 UPB_INLINE const upb_msgdef *google_protobuf_FieldOptions_getmsgdef(upb_symtab *s) {
3570   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3571   return upb_symtab_lookupmsg(s, "google.protobuf.FieldOptions");
3572 }
3573 
google_protobuf_OneofOptions_getmsgdef(upb_symtab * s)3574 UPB_INLINE const upb_msgdef *google_protobuf_OneofOptions_getmsgdef(upb_symtab *s) {
3575   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3576   return upb_symtab_lookupmsg(s, "google.protobuf.OneofOptions");
3577 }
3578 
google_protobuf_EnumOptions_getmsgdef(upb_symtab * s)3579 UPB_INLINE const upb_msgdef *google_protobuf_EnumOptions_getmsgdef(upb_symtab *s) {
3580   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3581   return upb_symtab_lookupmsg(s, "google.protobuf.EnumOptions");
3582 }
3583 
google_protobuf_EnumValueOptions_getmsgdef(upb_symtab * s)3584 UPB_INLINE const upb_msgdef *google_protobuf_EnumValueOptions_getmsgdef(upb_symtab *s) {
3585   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3586   return upb_symtab_lookupmsg(s, "google.protobuf.EnumValueOptions");
3587 }
3588 
google_protobuf_ServiceOptions_getmsgdef(upb_symtab * s)3589 UPB_INLINE const upb_msgdef *google_protobuf_ServiceOptions_getmsgdef(upb_symtab *s) {
3590   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3591   return upb_symtab_lookupmsg(s, "google.protobuf.ServiceOptions");
3592 }
3593 
google_protobuf_MethodOptions_getmsgdef(upb_symtab * s)3594 UPB_INLINE const upb_msgdef *google_protobuf_MethodOptions_getmsgdef(upb_symtab *s) {
3595   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3596   return upb_symtab_lookupmsg(s, "google.protobuf.MethodOptions");
3597 }
3598 
google_protobuf_UninterpretedOption_getmsgdef(upb_symtab * s)3599 UPB_INLINE const upb_msgdef *google_protobuf_UninterpretedOption_getmsgdef(upb_symtab *s) {
3600   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3601   return upb_symtab_lookupmsg(s, "google.protobuf.UninterpretedOption");
3602 }
3603 
google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_symtab * s)3604 UPB_INLINE const upb_msgdef *google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_symtab *s) {
3605   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3606   return upb_symtab_lookupmsg(s, "google.protobuf.UninterpretedOption.NamePart");
3607 }
3608 
google_protobuf_SourceCodeInfo_getmsgdef(upb_symtab * s)3609 UPB_INLINE const upb_msgdef *google_protobuf_SourceCodeInfo_getmsgdef(upb_symtab *s) {
3610   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3611   return upb_symtab_lookupmsg(s, "google.protobuf.SourceCodeInfo");
3612 }
3613 
google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_symtab * s)3614 UPB_INLINE const upb_msgdef *google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_symtab *s) {
3615   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3616   return upb_symtab_lookupmsg(s, "google.protobuf.SourceCodeInfo.Location");
3617 }
3618 
google_protobuf_GeneratedCodeInfo_getmsgdef(upb_symtab * s)3619 UPB_INLINE const upb_msgdef *google_protobuf_GeneratedCodeInfo_getmsgdef(upb_symtab *s) {
3620   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3621   return upb_symtab_lookupmsg(s, "google.protobuf.GeneratedCodeInfo");
3622 }
3623 
google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_symtab * s)3624 UPB_INLINE const upb_msgdef *google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_symtab *s) {
3625   _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
3626   return upb_symtab_lookupmsg(s, "google.protobuf.GeneratedCodeInfo.Annotation");
3627 }
3628 
3629 #ifdef __cplusplus
3630 }  /* extern "C" */
3631 #endif
3632 
3633 
3634 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPBDEFS_H_ */
3635 
3636 #ifndef UPB_REFLECTION_H_
3637 #define UPB_REFLECTION_H_
3638 
3639 
3640 
3641 typedef union {
3642   bool bool_val;
3643   float float_val;
3644   double double_val;
3645   int32_t int32_val;
3646   int64_t int64_val;
3647   uint32_t uint32_val;
3648   uint64_t uint64_val;
3649   const upb_map* map_val;
3650   const upb_msg* msg_val;
3651   const upb_array* array_val;
3652   upb_strview str_val;
3653 } upb_msgval;
3654 
3655 typedef union {
3656   upb_map* map;
3657   upb_msg* msg;
3658   upb_array* array;
3659 } upb_mutmsgval;
3660 
3661 /** upb_msg *******************************************************************/
3662 
3663 /* Creates a new message of the given type in the given arena. */
3664 upb_msg *upb_msg_new(const upb_msgdef *m, upb_arena *a);
3665 
3666 /* Returns the value associated with this field. */
3667 upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f);
3668 
3669 /* Returns a mutable pointer to a map, array, or submessage value.  If the given
3670  * arena is non-NULL this will construct a new object if it was not previously
3671  * present.  May not be called for primitive fields. */
3672 upb_mutmsgval upb_msg_mutable(upb_msg *msg, const upb_fielddef *f, upb_arena *a);
3673 
3674 /* May only be called for fields where upb_fielddef_haspresence(f) == true. */
3675 bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f);
3676 
3677 /* Returns the field that is set in the oneof, or NULL if none are set. */
3678 const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg,
3679                                        const upb_oneofdef *o);
3680 
3681 /* Sets the given field to the given value.  For a msg/array/map/string, the
3682  * value must be in the same arena.  */
3683 void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
3684                  upb_arena *a);
3685 
3686 /* Clears any field presence and sets the value back to its default. */
3687 void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f);
3688 
3689 /* Clear all data and unknown fields. */
3690 void upb_msg_clear(upb_msg *msg, const upb_msgdef *m);
3691 
3692 /* Iterate over present fields.
3693  *
3694  * size_t iter = UPB_MSG_BEGIN;
3695  * const upb_fielddef *f;
3696  * upb_msgval val;
3697  * while (upb_msg_next(msg, m, ext_pool, &f, &val, &iter)) {
3698  *   process_field(f, val);
3699  * }
3700  *
3701  * If ext_pool is NULL, no extensions will be returned.  If the given symtab
3702  * returns extensions that don't match what is in this message, those extensions
3703  * will be skipped.
3704  */
3705 
3706 #define UPB_MSG_BEGIN -1
3707 bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
3708                   const upb_symtab *ext_pool, const upb_fielddef **f,
3709                   upb_msgval *val, size_t *iter);
3710 
3711 /* Adds unknown data (serialized protobuf data) to the given message.  The data
3712  * is copied into the message instance. */
3713 void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
3714                         upb_arena *arena);
3715 
3716 /* Clears all unknown field data from this message and all submessages. */
3717 bool upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int maxdepth);
3718 
3719 /* Returns a reference to the message's unknown data. */
3720 const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
3721 
3722 /** upb_array *****************************************************************/
3723 
3724 /* Creates a new array on the given arena that holds elements of this type. */
3725 upb_array *upb_array_new(upb_arena *a, upb_fieldtype_t type);
3726 
3727 /* Returns the size of the array. */
3728 size_t upb_array_size(const upb_array *arr);
3729 
3730 /* Returns the given element, which must be within the array's current size. */
3731 upb_msgval upb_array_get(const upb_array *arr, size_t i);
3732 
3733 /* Sets the given element, which must be within the array's current size. */
3734 void upb_array_set(upb_array *arr, size_t i, upb_msgval val);
3735 
3736 /* Appends an element to the array.  Returns false on allocation failure. */
3737 bool upb_array_append(upb_array *array, upb_msgval val, upb_arena *arena);
3738 
3739 /* Changes the size of a vector.  New elements are initialized to empty/0.
3740  * Returns false on allocation failure. */
3741 bool upb_array_resize(upb_array *array, size_t size, upb_arena *arena);
3742 
3743 /** upb_map *******************************************************************/
3744 
3745 /* Creates a new map on the given arena with the given key/value size. */
3746 upb_map *upb_map_new(upb_arena *a, upb_fieldtype_t key_type,
3747                      upb_fieldtype_t value_type);
3748 
3749 /* Returns the number of entries in the map. */
3750 size_t upb_map_size(const upb_map *map);
3751 
3752 /* Stores a value for the given key into |*val| (or the zero value if the key is
3753  * not present).  Returns whether the key was present.  The |val| pointer may be
3754  * NULL, in which case the function tests whether the given key is present.  */
3755 bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val);
3756 
3757 /* Removes all entries in the map. */
3758 void upb_map_clear(upb_map *map);
3759 
3760 /* Sets the given key to the given value.  Returns true if this was a new key in
3761  * the map, or false if an existing key was replaced. */
3762 bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
3763                  upb_arena *arena);
3764 
3765 /* Deletes this key from the table.  Returns true if the key was present. */
3766 bool upb_map_delete(upb_map *map, upb_msgval key);
3767 
3768 /* Map iteration:
3769  *
3770  * size_t iter = UPB_MAP_BEGIN;
3771  * while (upb_mapiter_next(map, &iter)) {
3772  *   upb_msgval key = upb_mapiter_key(map, iter);
3773  *   upb_msgval val = upb_mapiter_value(map, iter);
3774  *
3775  *   // If mutating is desired.
3776  *   upb_mapiter_setvalue(map, iter, value2);
3777  * }
3778  */
3779 
3780 /* Advances to the next entry.  Returns false if no more entries are present. */
3781 bool upb_mapiter_next(const upb_map *map, size_t *iter);
3782 
3783 /* Returns true if the iterator still points to a valid entry, or false if the
3784  * iterator is past the last element. It is an error to call this function with
3785  * UPB_MAP_BEGIN (you must call next() at least once first). */
3786 bool upb_mapiter_done(const upb_map *map, size_t iter);
3787 
3788 /* Returns the key and value for this entry of the map. */
3789 upb_msgval upb_mapiter_key(const upb_map *map, size_t iter);
3790 upb_msgval upb_mapiter_value(const upb_map *map, size_t iter);
3791 
3792 /* Sets the value for this entry.  The iterator must not be done, and the
3793  * iterator must not have been initialized const. */
3794 void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value);
3795 
3796 
3797 #endif /* UPB_REFLECTION_H_ */
3798 
3799 #ifndef UPB_JSONDECODE_H_
3800 #define UPB_JSONDECODE_H_
3801 
3802 
3803 #ifdef __cplusplus
3804 extern "C" {
3805 #endif
3806 
3807 enum {
3808   UPB_JSONDEC_IGNOREUNKNOWN = 1
3809 };
3810 
3811 bool upb_json_decode(const char *buf, size_t size, upb_msg *msg,
3812                      const upb_msgdef *m, const upb_symtab *any_pool,
3813                      int options, upb_arena *arena, upb_status *status);
3814 
3815 #ifdef __cplusplus
3816 }  /* extern "C" */
3817 #endif
3818 
3819 #endif  /* UPB_JSONDECODE_H_ */
3820 
3821 #ifndef UPB_JSONENCODE_H_
3822 #define UPB_JSONENCODE_H_
3823 
3824 
3825 #ifdef __cplusplus
3826 extern "C" {
3827 #endif
3828 
3829 enum {
3830   /* When set, emits 0/default values.  TOOD(haberman): proto3 only? */
3831   UPB_JSONENC_EMITDEFAULTS = 1,
3832 
3833   /* When set, use normal (snake_caes) field names instead of JSON (camelCase)
3834      names. */
3835   UPB_JSONENC_PROTONAMES = 2
3836 };
3837 
3838 /* Encodes the given |msg| to JSON format.  The message's reflection is given in
3839  * |m|.  The symtab in |symtab| is used to find extensions (if NULL, extensions
3840  * will not be printed).
3841  *
3842  * Output is placed in the given buffer, and always NULL-terminated.  The output
3843  * size (excluding NULL) is returned.  This means that a return value >= |size|
3844  * implies that the output was truncated.  (These are the same semantics as
3845  * snprintf()). */
3846 size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m,
3847                        const upb_symtab *ext_pool, int options, char *buf,
3848                        size_t size, upb_status *status);
3849 
3850 #ifdef __cplusplus
3851 }  /* extern "C" */
3852 #endif
3853 
3854 #endif  /* UPB_JSONENCODE_H_ */
3855 /* See port_def.inc.  This should #undef all macros #defined there. */
3856 
3857 #undef UPB_MAPTYPE_STRING
3858 #undef UPB_SIZE
3859 #undef UPB_PTR_AT
3860 #undef UPB_READ_ONEOF
3861 #undef UPB_WRITE_ONEOF
3862 #undef UPB_INLINE
3863 #undef UPB_ALIGN_UP
3864 #undef UPB_ALIGN_DOWN
3865 #undef UPB_ALIGN_MALLOC
3866 #undef UPB_ALIGN_OF
3867 #undef UPB_FORCEINLINE
3868 #undef UPB_NOINLINE
3869 #undef UPB_NORETURN
3870 #undef UPB_MAX
3871 #undef UPB_MIN
3872 #undef UPB_UNUSED
3873 #undef UPB_ASSUME
3874 #undef UPB_ASSERT
3875 #undef UPB_ASSERT_DEBUGVAR
3876 #undef UPB_UNREACHABLE
3877 #undef UPB_INFINITY
3878 #undef UPB_NAN
3879 #undef UPB_MSVC_VSNPRINTF
3880 #undef _upb_snprintf
3881 #undef _upb_vsnprintf
3882 #undef _upb_va_copy
3883