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