xref: /aosp_15_r20/external/protobuf/ruby/ext/google/protobuf_c/ruby-upb.h (revision 1b3f573f81763fcece89efc2b6a5209149e44ab8)
1 // Ruby is still using proto3 enum semantics for proto2
2 #define UPB_DISABLE_PROTO2_ENUM_CHECKING
3 /* Amalgamated source file */
4 /*
5  * Copyright (c) 2009-2021, Google LLC
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above copyright
13  *       notice, this list of conditions and the following disclaimer in the
14  *       documentation and/or other materials provided with the distribution.
15  *     * Neither the name of Google LLC nor the
16  *       names of its contributors may be used to endorse or promote products
17  *       derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
23  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /*
32  * This is where we define macros used across upb.
33  *
34  * All of these macros are undef'd in port_undef.inc to avoid leaking them to
35  * users.
36  *
37  * The correct usage is:
38  *
39  *   #include "upb/foobar.h"
40  *   #include "upb/baz.h"
41  *
42  *   // MUST be last included header.
43  *   #include "upb/port_def.inc"
44  *
45  *   // Code for this file.
46  *   // <...>
47  *
48  *   // Can be omitted for .c files, required for .h.
49  *   #include "upb/port_undef.inc"
50  *
51  * This file is private and must not be included by users!
52  */
53 
54 #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
55       (defined(__cplusplus) && __cplusplus >= 201103L) ||           \
56       (defined(_MSC_VER) && _MSC_VER >= 1900))
57 #error upb requires C99 or C++11 or MSVC >= 2015.
58 #endif
59 
60 #include <stdint.h>
61 #include <stddef.h>
62 
63 #if UINTPTR_MAX == 0xffffffff
64 #define UPB_SIZE(size32, size64) size32
65 #else
66 #define UPB_SIZE(size32, size64) size64
67 #endif
68 
69 /* If we always read/write as a consistent type to each address, this shouldn't
70  * violate aliasing.
71  */
72 #define UPB_PTR_AT(msg, ofs, type) ((type*)((char*)(msg) + (ofs)))
73 
74 #define UPB_READ_ONEOF(msg, fieldtype, offset, case_offset, case_val, default) \
75   *UPB_PTR_AT(msg, case_offset, int) == case_val                              \
76       ? *UPB_PTR_AT(msg, offset, fieldtype)                                   \
77       : default
78 
79 #define UPB_WRITE_ONEOF(msg, fieldtype, offset, value, case_offset, case_val) \
80   *UPB_PTR_AT(msg, case_offset, int) = case_val;                             \
81   *UPB_PTR_AT(msg, offset, fieldtype) = value;
82 
83 #define UPB_MAPTYPE_STRING 0
84 
85 /* UPB_INLINE: inline if possible, emit standalone code if required. */
86 #ifdef __cplusplus
87 #define UPB_INLINE inline
88 #elif defined (__GNUC__) || defined(__clang__)
89 #define UPB_INLINE static __inline__
90 #else
91 #define UPB_INLINE static
92 #endif
93 
94 #define UPB_MALLOC_ALIGN 8
95 #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align))
96 #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align))
97 #define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN)
98 #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member)
99 
100 // Hints to the compiler about likely/unlikely branches.
101 #if defined (__GNUC__) || defined(__clang__)
102 #define UPB_LIKELY(x) __builtin_expect((bool)(x), 1)
103 #define UPB_UNLIKELY(x) __builtin_expect((bool)(x), 0)
104 #else
105 #define UPB_LIKELY(x) (x)
106 #define UPB_UNLIKELY(x) (x)
107 #endif
108 
109 // Macros for function attributes on compilers that support them.
110 #ifdef __GNUC__
111 #define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
112 #define UPB_NOINLINE __attribute__((noinline))
113 #define UPB_NORETURN __attribute__((__noreturn__))
114 #define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
115 #elif defined(_MSC_VER)
116 #define UPB_NOINLINE
117 #define UPB_FORCEINLINE
118 #define UPB_NORETURN __declspec(noreturn)
119 #define UPB_PRINTF(str, first_vararg)
120 #else  /* !defined(__GNUC__) */
121 #define UPB_FORCEINLINE
122 #define UPB_NOINLINE
123 #define UPB_NORETURN
124 #define UPB_PRINTF(str, first_vararg)
125 #endif
126 
127 #define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
128 #define UPB_MIN(x, y) ((x) < (y) ? (x) : (y))
129 
130 #define UPB_UNUSED(var) (void)var
131 
132 // UPB_ASSUME(): in release mode, we tell the compiler to assume this is true.
133 #ifdef NDEBUG
134 #ifdef __GNUC__
135 #define UPB_ASSUME(expr) if (!(expr)) __builtin_unreachable()
136 #elif defined _MSC_VER
137 #define UPB_ASSUME(expr) if (!(expr)) __assume(0)
138 #else
139 #define UPB_ASSUME(expr) do {} while (false && (expr))
140 #endif
141 #else
142 #define UPB_ASSUME(expr) assert(expr)
143 #endif
144 
145 /* UPB_ASSERT(): in release mode, we use the expression without letting it be
146  * evaluated.  This prevents "unused variable" warnings. */
147 #ifdef NDEBUG
148 #define UPB_ASSERT(expr) do {} while (false && (expr))
149 #else
150 #define UPB_ASSERT(expr) assert(expr)
151 #endif
152 
153 #if defined(__GNUC__) || defined(__clang__)
154 #define UPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
155 #else
156 #define UPB_UNREACHABLE() do { assert(0); } while(0)
157 #endif
158 
159 /* UPB_SETJMP() / UPB_LONGJMP(): avoid setting/restoring signal mask. */
160 #ifdef __APPLE__
161 #define UPB_SETJMP(buf) _setjmp(buf)
162 #define UPB_LONGJMP(buf, val) _longjmp(buf, val)
163 #else
164 #define UPB_SETJMP(buf) setjmp(buf)
165 #define UPB_LONGJMP(buf, val) longjmp(buf, val)
166 #endif
167 
168 /* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
169 #define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
170 
171 /* Configure whether fasttable is switched on or not. *************************/
172 
173 #ifdef __has_attribute
174 #define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
175 #else
176 #define UPB_HAS_ATTRIBUTE(x) 0
177 #endif
178 
179 #if UPB_HAS_ATTRIBUTE(musttail)
180 #define UPB_MUSTTAIL __attribute__((musttail))
181 #else
182 #define UPB_MUSTTAIL
183 #endif
184 
185 #undef UPB_HAS_ATTRIBUTE
186 
187 /* This check is not fully robust: it does not require that we have "musttail"
188  * support available. We need tail calls to avoid consuming arbitrary amounts
189  * of stack space.
190  *
191  * GCC/Clang can mostly be trusted to generate tail calls as long as
192  * optimization is enabled, but, debug builds will not generate tail calls
193  * unless "musttail" is available.
194  *
195  * We should probably either:
196  *   1. require that the compiler supports musttail.
197  *   2. add some fallback code for when musttail isn't available (ie. return
198  *      instead of tail calling). This is safe and portable, but this comes at
199  *      a CPU cost.
200  */
201 #if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
202 #define UPB_FASTTABLE_SUPPORTED 1
203 #else
204 #define UPB_FASTTABLE_SUPPORTED 0
205 #endif
206 
207 /* define UPB_ENABLE_FASTTABLE to force fast table support.
208  * This is useful when we want to ensure we are really getting fasttable,
209  * for example for testing or benchmarking. */
210 #if defined(UPB_ENABLE_FASTTABLE)
211 #if !UPB_FASTTABLE_SUPPORTED
212 #error fasttable is x86-64/ARM64 only and requires GCC or Clang.
213 #endif
214 #define UPB_FASTTABLE 1
215 /* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
216  * This is useful for releasing code that might be used on multiple platforms,
217  * for example the PHP or Ruby C extensions. */
218 #elif defined(UPB_TRY_ENABLE_FASTTABLE)
219 #define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
220 #else
221 #define UPB_FASTTABLE 0
222 #endif
223 
224 /* UPB_FASTTABLE_INIT() allows protos compiled for fasttable to gracefully
225  * degrade to non-fasttable if we are using UPB_TRY_ENABLE_FASTTABLE. */
226 #if !UPB_FASTTABLE && defined(UPB_TRY_ENABLE_FASTTABLE)
227 #define UPB_FASTTABLE_INIT(...)
228 #else
229 #define UPB_FASTTABLE_INIT(...) __VA_ARGS__
230 #endif
231 
232 #undef UPB_FASTTABLE_SUPPORTED
233 
234 /* ASAN poisoning (for arena) *************************************************/
235 
236 #if defined(__SANITIZE_ADDRESS__)
237 #define UPB_ASAN 1
238 #ifdef __cplusplus
239 extern "C" {
240 #endif
241 void __asan_poison_memory_region(void const volatile *addr, size_t size);
242 void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
243 #ifdef __cplusplus
244 }  /* extern "C" */
245 #endif
246 #define UPB_POISON_MEMORY_REGION(addr, size) \
247   __asan_poison_memory_region((addr), (size))
248 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
249   __asan_unpoison_memory_region((addr), (size))
250 #else
251 #define UPB_ASAN 0
252 #define UPB_POISON_MEMORY_REGION(addr, size) \
253   ((void)(addr), (void)(size))
254 #define UPB_UNPOISON_MEMORY_REGION(addr, size) \
255   ((void)(addr), (void)(size))
256 #endif
257 
258 /* Disable proto2 arena behavior (TEMPORARY) **********************************/
259 
260 #ifdef UPB_DISABLE_PROTO2_ENUM_CHECKING
261 #define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 1
262 #else
263 #define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 0
264 #endif
265 
266 /** upb/collections.h ************************************************************/
267 #ifndef UPB_COLLECTIONS_H_
268 #define UPB_COLLECTIONS_H_
269 
270 
271 /** google/protobuf/descriptor.upb.h ************************************************************//* This file was generated by upbc (the upb compiler) from the input
272  * file:
273  *
274  *     google/protobuf/descriptor.proto
275  *
276  * Do not edit -- your changes will be discarded when the file is
277  * regenerated. */
278 
279 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
280 #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
281 
282 
283 /** upb/msg_internal.h ************************************************************/
284 /*
285 ** Our memory representation for parsing tables and messages themselves.
286 ** Functions in this file are used by generated code and possibly reflection.
287 **
288 ** The definitions in this file are internal to upb.
289 **/
290 
291 #ifndef UPB_MSG_INT_H_
292 #define UPB_MSG_INT_H_
293 
294 #include <stdint.h>
295 #include <stdlib.h>
296 #include <string.h>
297 
298 
299 /** upb/msg.h ************************************************************/
300 /*
301  * Public APIs for message operations that do not require descriptors.
302  * These functions can be used even in build that does not want to depend on
303  * reflection or descriptors.
304  *
305  * Descriptor-based reflection functionality lives in reflection.h.
306  */
307 
308 #ifndef UPB_MSG_H_
309 #define UPB_MSG_H_
310 
311 #include <stddef.h>
312 
313 
314 /** upb/upb.h ************************************************************/
315 /*
316  * This file contains shared definitions that are widely used across upb.
317  */
318 
319 #ifndef UPB_H_
320 #define UPB_H_
321 
322 #include <assert.h>
323 #include <stdarg.h>
324 #include <stdbool.h>
325 #include <stddef.h>
326 #include <stdint.h>
327 #include <string.h>
328 
329 
330 #ifdef __cplusplus
331 extern "C" {
332 #endif
333 
334 /* upb_Status *****************************************************************/
335 
336 #define _kUpb_Status_MaxMessage 127
337 
338 typedef struct {
339   bool ok;
340   char msg[_kUpb_Status_MaxMessage]; /* Error message; NULL-terminated. */
341 } upb_Status;
342 
343 const char* upb_Status_ErrorMessage(const upb_Status* status);
344 bool upb_Status_IsOk(const upb_Status* status);
345 
346 /* These are no-op if |status| is NULL. */
347 void upb_Status_Clear(upb_Status* status);
348 void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
349 void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
350     UPB_PRINTF(2, 3);
351 void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
352                                 va_list args) UPB_PRINTF(2, 0);
353 void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
354                                    va_list args) UPB_PRINTF(2, 0);
355 
356 /** upb_StringView ************************************************************/
357 
358 typedef struct {
359   const char* data;
360   size_t size;
361 } upb_StringView;
362 
upb_StringView_FromDataAndSize(const char * data,size_t size)363 UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data,
364                                                          size_t size) {
365   upb_StringView ret;
366   ret.data = data;
367   ret.size = size;
368   return ret;
369 }
370 
upb_StringView_FromString(const char * data)371 UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) {
372   return upb_StringView_FromDataAndSize(data, strlen(data));
373 }
374 
upb_StringView_IsEqual(upb_StringView a,upb_StringView b)375 UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
376   return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
377 }
378 
379 #define UPB_STRINGVIEW_INIT(ptr, len) \
380   { ptr, len }
381 
382 #define UPB_STRINGVIEW_FORMAT "%.*s"
383 #define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
384 
385 /** upb_alloc *****************************************************************/
386 
387 /* A upb_alloc is a possibly-stateful allocator object.
388  *
389  * It could either be an arena allocator (which doesn't require individual
390  * free() calls) or a regular malloc() (which does).  The client must therefore
391  * free memory unless it knows that the allocator is an arena allocator. */
392 
393 struct upb_alloc;
394 typedef struct upb_alloc upb_alloc;
395 
396 /* A malloc()/free() function.
397  * If "size" is 0 then the function acts like free(), otherwise it acts like
398  * realloc().  Only "oldsize" bytes from a previous allocation are preserved. */
399 typedef void* upb_alloc_func(upb_alloc* alloc, void* ptr, size_t oldsize,
400                              size_t size);
401 
402 struct upb_alloc {
403   upb_alloc_func* func;
404 };
405 
upb_malloc(upb_alloc * alloc,size_t size)406 UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) {
407   UPB_ASSERT(alloc);
408   return alloc->func(alloc, NULL, 0, size);
409 }
410 
upb_realloc(upb_alloc * alloc,void * ptr,size_t oldsize,size_t size)411 UPB_INLINE void* upb_realloc(upb_alloc* alloc, void* ptr, size_t oldsize,
412                              size_t size) {
413   UPB_ASSERT(alloc);
414   return alloc->func(alloc, ptr, oldsize, size);
415 }
416 
upb_free(upb_alloc * alloc,void * ptr)417 UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) {
418   assert(alloc);
419   alloc->func(alloc, ptr, 0, 0);
420 }
421 
422 /* The global allocator used by upb.  Uses the standard malloc()/free(). */
423 
424 extern upb_alloc upb_alloc_global;
425 
426 /* Functions that hard-code the global malloc.
427  *
428  * We still get benefit because we can put custom logic into our global
429  * allocator, like injecting out-of-memory faults in debug/testing builds. */
430 
upb_gmalloc(size_t size)431 UPB_INLINE void* upb_gmalloc(size_t size) {
432   return upb_malloc(&upb_alloc_global, size);
433 }
434 
upb_grealloc(void * ptr,size_t oldsize,size_t size)435 UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
436   return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
437 }
438 
upb_gfree(void * ptr)439 UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
440 
441 /* upb_Arena ******************************************************************/
442 
443 /* upb_Arena is a specific allocator implementation that uses arena allocation.
444  * The user provides an allocator that will be used to allocate the underlying
445  * arena blocks.  Arenas by nature do not require the individual allocations
446  * to be freed.  However the Arena does allow users to register cleanup
447  * functions that will run when the arena is destroyed.
448  *
449  * A upb_Arena is *not* thread-safe.
450  *
451  * You could write a thread-safe arena allocator that satisfies the
452  * upb_alloc interface, but it would not be as efficient for the
453  * single-threaded case. */
454 
455 typedef void upb_CleanupFunc(void* ud);
456 
457 struct upb_Arena;
458 typedef struct upb_Arena upb_Arena;
459 
460 typedef struct {
461   /* We implement the allocator interface.
462    * This must be the first member of upb_Arena!
463    * TODO(haberman): remove once handlers are gone. */
464   upb_alloc alloc;
465 
466   char *ptr, *end;
467 } _upb_ArenaHead;
468 
469 /* Creates an arena from the given initial block (if any -- n may be 0).
470  * Additional blocks will be allocated from |alloc|.  If |alloc| is NULL, this
471  * is a fixed-size arena and cannot grow. */
472 upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
473 void upb_Arena_Free(upb_Arena* a);
474 bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func);
475 bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
476 void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t size);
477 
upb_Arena_Alloc(upb_Arena * a)478 UPB_INLINE upb_alloc* upb_Arena_Alloc(upb_Arena* a) { return (upb_alloc*)a; }
479 
_upb_ArenaHas(upb_Arena * a)480 UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) {
481   _upb_ArenaHead* h = (_upb_ArenaHead*)a;
482   return (size_t)(h->end - h->ptr);
483 }
484 
_upb_Arena_FastMalloc(upb_Arena * a,size_t size)485 UPB_INLINE void* _upb_Arena_FastMalloc(upb_Arena* a, size_t size) {
486   _upb_ArenaHead* h = (_upb_ArenaHead*)a;
487   void* ret = h->ptr;
488   UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
489   UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
490   UPB_UNPOISON_MEMORY_REGION(ret, size);
491 
492   h->ptr += size;
493 
494 #if UPB_ASAN
495   {
496     size_t guard_size = 32;
497     if (_upb_ArenaHas(a) >= guard_size) {
498       h->ptr += guard_size;
499     } else {
500       h->ptr = h->end;
501     }
502   }
503 #endif
504 
505   return ret;
506 }
507 
upb_Arena_Malloc(upb_Arena * a,size_t size)508 UPB_INLINE void* upb_Arena_Malloc(upb_Arena* a, size_t size) {
509   size = UPB_ALIGN_MALLOC(size);
510 
511   if (UPB_UNLIKELY(_upb_ArenaHas(a) < size)) {
512     return _upb_Arena_SlowMalloc(a, size);
513   }
514 
515   return _upb_Arena_FastMalloc(a, size);
516 }
517 
518 // Shrinks the last alloc from arena.
519 // REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
520 // We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
521 // this was not the last alloc.
upb_Arena_ShrinkLast(upb_Arena * a,void * ptr,size_t oldsize,size_t size)522 UPB_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr, size_t oldsize,
523                                      size_t size) {
524   _upb_ArenaHead* h = (_upb_ArenaHead*)a;
525   oldsize = UPB_ALIGN_MALLOC(oldsize);
526   size = UPB_ALIGN_MALLOC(size);
527   UPB_ASSERT((char*)ptr + oldsize == h->ptr);  // Must be the last alloc.
528   UPB_ASSERT(size <= oldsize);
529   h->ptr = (char*)ptr + size;
530 }
531 
upb_Arena_Realloc(upb_Arena * a,void * ptr,size_t oldsize,size_t size)532 UPB_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
533                                    size_t size) {
534   _upb_ArenaHead* h = (_upb_ArenaHead*)a;
535   oldsize = UPB_ALIGN_MALLOC(oldsize);
536   size = UPB_ALIGN_MALLOC(size);
537   bool is_most_recent_alloc = (uintptr_t)ptr + oldsize == (uintptr_t)h->ptr;
538 
539   if (is_most_recent_alloc) {
540     ptrdiff_t diff = size - oldsize;
541     if ((ptrdiff_t)_upb_ArenaHas(a) >= diff) {
542       h->ptr += diff;
543       return ptr;
544     }
545   } else if (size <= oldsize) {
546     return ptr;
547   }
548 
549   void* ret = upb_Arena_Malloc(a, size);
550 
551   if (ret && oldsize > 0) {
552     memcpy(ret, ptr, UPB_MIN(oldsize, size));
553   }
554 
555   return ret;
556 }
557 
upb_Arena_New(void)558 UPB_INLINE upb_Arena* upb_Arena_New(void) {
559   return upb_Arena_Init(NULL, 0, &upb_alloc_global);
560 }
561 
562 /* Constants ******************************************************************/
563 
564 /* A list of types as they are encoded on-the-wire. */
565 typedef enum {
566   kUpb_WireType_Varint = 0,
567   kUpb_WireType_64Bit = 1,
568   kUpb_WireType_Delimited = 2,
569   kUpb_WireType_StartGroup = 3,
570   kUpb_WireType_EndGroup = 4,
571   kUpb_WireType_32Bit = 5
572 } upb_WireType;
573 
574 /* The types a field can have.  Note that this list is not identical to the
575  * types defined in descriptor.proto, which gives INT32 and SINT32 separate
576  * types (we distinguish the two with the "integer encoding" enum below). */
577 typedef enum {
578   kUpb_CType_Bool = 1,
579   kUpb_CType_Float = 2,
580   kUpb_CType_Int32 = 3,
581   kUpb_CType_UInt32 = 4,
582   kUpb_CType_Enum = 5, /* Enum values are int32. */
583   kUpb_CType_Message = 6,
584   kUpb_CType_Double = 7,
585   kUpb_CType_Int64 = 8,
586   kUpb_CType_UInt64 = 9,
587   kUpb_CType_String = 10,
588   kUpb_CType_Bytes = 11
589 } upb_CType;
590 
591 /* The repeated-ness of each field; this matches descriptor.proto. */
592 typedef enum {
593   kUpb_Label_Optional = 1,
594   kUpb_Label_Required = 2,
595   kUpb_Label_Repeated = 3
596 } upb_Label;
597 
598 /* Descriptor types, as defined in descriptor.proto. */
599 typedef enum {
600   kUpb_FieldType_Double = 1,
601   kUpb_FieldType_Float = 2,
602   kUpb_FieldType_Int64 = 3,
603   kUpb_FieldType_UInt64 = 4,
604   kUpb_FieldType_Int32 = 5,
605   kUpb_FieldType_Fixed64 = 6,
606   kUpb_FieldType_Fixed32 = 7,
607   kUpb_FieldType_Bool = 8,
608   kUpb_FieldType_String = 9,
609   kUpb_FieldType_Group = 10,
610   kUpb_FieldType_Message = 11,
611   kUpb_FieldType_Bytes = 12,
612   kUpb_FieldType_UInt32 = 13,
613   kUpb_FieldType_Enum = 14,
614   kUpb_FieldType_SFixed32 = 15,
615   kUpb_FieldType_SFixed64 = 16,
616   kUpb_FieldType_SInt32 = 17,
617   kUpb_FieldType_SInt64 = 18
618 } upb_FieldType;
619 
620 #define kUpb_Map_Begin ((size_t)-1)
621 
_upb_IsLittleEndian(void)622 UPB_INLINE bool _upb_IsLittleEndian(void) {
623   int x = 1;
624   return *(char*)&x == 1;
625 }
626 
_upb_BigEndian_Swap32(uint32_t val)627 UPB_INLINE uint32_t _upb_BigEndian_Swap32(uint32_t val) {
628   if (_upb_IsLittleEndian()) {
629     return val;
630   } else {
631     return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
632            ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
633   }
634 }
635 
_upb_BigEndian_Swap64(uint64_t val)636 UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) {
637   if (_upb_IsLittleEndian()) {
638     return val;
639   } else {
640     return ((uint64_t)_upb_BigEndian_Swap32((uint32_t)val) << 32) |
641            _upb_BigEndian_Swap32((uint32_t)(val >> 32));
642   }
643 }
644 
_upb_Log2Ceiling(int x)645 UPB_INLINE int _upb_Log2Ceiling(int x) {
646   if (x <= 1) return 0;
647 #ifdef __GNUC__
648   return 32 - __builtin_clz(x - 1);
649 #else
650   int lg2 = 0;
651   while (1 << lg2 < x) lg2++;
652   return lg2;
653 #endif
654 }
655 
_upb_Log2CeilingSize(int x)656 UPB_INLINE int _upb_Log2CeilingSize(int x) { return 1 << _upb_Log2Ceiling(x); }
657 
658 
659 #ifdef __cplusplus
660 } /* extern "C" */
661 #endif
662 
663 #endif /* UPB_H_ */
664 
665 #ifdef __cplusplus
666 extern "C" {
667 #endif
668 
669 /** upb_Message ***************************************************************/
670 
671 typedef void upb_Message;
672 
673 /* For users these are opaque. They can be obtained from
674  * upb_MessageDef_MiniTable() but users cannot access any of the members. */
675 struct upb_MiniTable;
676 typedef struct upb_MiniTable upb_MiniTable;
677 
678 /* Adds unknown data (serialized protobuf data) to the given message.  The data
679  * is copied into the message instance. */
680 void upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
681                             upb_Arena* arena);
682 
683 /* Returns a reference to the message's unknown data. */
684 const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
685 
686 /* Returns the number of extensions present in this message. */
687 size_t upb_Message_ExtensionCount(const upb_Message* msg);
688 
689 /** upb_ExtensionRegistry *****************************************************/
690 
691 /* Extension registry: a dynamic data structure that stores a map of:
692  *   (upb_MiniTable, number) -> extension info
693  *
694  * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
695  * binary format.
696  *
697  * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
698  * objects. Like all mini-table objects, it is suitable for reflection-less
699  * builds that do not want to expose names into the binary.
700  *
701  * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
702  * allocation and dynamic initialization:
703  * * If reflection is being used, then upb_DefPool will construct an appropriate
704  *   upb_ExtensionRegistry automatically.
705  * * For a mini-table only build, the user must manually construct the
706  *   upb_ExtensionRegistry and populate it with all of the extensions the user
707  * cares about.
708  * * A third alternative is to manually unpack relevant extensions after the
709  *   main parse is complete, similar to how Any works. This is perhaps the
710  *   nicest solution from the perspective of reducing dependencies, avoiding
711  *   dynamic memory allocation, and avoiding the need to parse uninteresting
712  *   extensions.  The downsides are:
713  *     (1) parse errors are not caught during the main parse
714  *     (2) the CPU hit of parsing comes during access, which could cause an
715  *         undesirable stutter in application performance.
716  *
717  * Users cannot directly get or put into this map. Users can only add the
718  * extensions from a generated module and pass the extension registry to the
719  * binary decoder.
720  *
721  * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
722  * reflection do not need to populate a upb_ExtensionRegistry directly.
723  */
724 
725 struct upb_ExtensionRegistry;
726 typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
727 
728 /* Creates a upb_ExtensionRegistry in the given arena.  The arena must outlive
729  * any use of the extreg. */
730 upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
731 
732 #ifdef __cplusplus
733 } /* extern "C" */
734 #endif
735 
736 #endif /* UPB_MSG_INT_H_ */
737 
738 /** upb/table_internal.h ************************************************************/
739 /*
740  * upb_table
741  *
742  * This header is INTERNAL-ONLY!  Its interfaces are not public or stable!
743  * This file defines very fast int->upb_value (inttable) and string->upb_value
744  * (strtable) hash tables.
745  *
746  * The table uses chained scatter with Brent's variation (inspired by the Lua
747  * implementation of hash tables).  The hash function for strings is Austin
748  * Appleby's "MurmurHash."
749  *
750  * The inttable uses uintptr_t as its key, which guarantees it can be used to
751  * store pointers or integers of at least 32 bits (upb isn't really useful on
752  * systems where sizeof(void*) < 4).
753  *
754  * The table must be homogeneous (all values of the same type).  In debug
755  * mode, we check this on insert and lookup.
756  */
757 
758 #ifndef UPB_TABLE_H_
759 #define UPB_TABLE_H_
760 
761 #include <stdint.h>
762 #include <string.h>
763 
764 
765 // Must be last.
766 
767 #ifdef __cplusplus
768 extern "C" {
769 #endif
770 
771 /* upb_value ******************************************************************/
772 
773 typedef struct {
774   uint64_t val;
775 } upb_value;
776 
777 /* Variant that works with a length-delimited rather than NULL-delimited string,
778  * as supported by strtable. */
779 char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
780 
_upb_value_setval(upb_value * v,uint64_t val)781 UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
782 
783 /* For each value ctype, define the following set of functions:
784  *
785  * // Get/set an int32 from a upb_value.
786  * int32_t upb_value_getint32(upb_value val);
787  * void upb_value_setint32(upb_value *val, int32_t cval);
788  *
789  * // Construct a new upb_value from an int32.
790  * upb_value upb_value_int32(int32_t val); */
791 #define FUNCS(name, membername, type_t, converter, proto_type)       \
792   UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
793     val->val = (converter)cval;                                      \
794   }                                                                  \
795   UPB_INLINE upb_value upb_value_##name(type_t val) {                \
796     upb_value ret;                                                   \
797     upb_value_set##name(&ret, val);                                  \
798     return ret;                                                      \
799   }                                                                  \
800   UPB_INLINE type_t upb_value_get##name(upb_value val) {             \
801     return (type_t)(converter)val.val;                               \
802   }
803 
FUNCS(int32,int32,int32_t,int32_t,UPB_CTYPE_INT32)804 FUNCS(int32, int32, int32_t, int32_t, UPB_CTYPE_INT32)
805 FUNCS(int64, int64, int64_t, int64_t, UPB_CTYPE_INT64)
806 FUNCS(uint32, uint32, uint32_t, uint32_t, UPB_CTYPE_UINT32)
807 FUNCS(uint64, uint64, uint64_t, uint64_t, UPB_CTYPE_UINT64)
808 FUNCS(bool, _bool, bool, bool, UPB_CTYPE_BOOL)
809 FUNCS(cstr, cstr, char*, uintptr_t, UPB_CTYPE_CSTR)
810 FUNCS(ptr, ptr, void*, uintptr_t, UPB_CTYPE_PTR)
811 FUNCS(constptr, constptr, const void*, uintptr_t, UPB_CTYPE_CONSTPTR)
812 
813 #undef FUNCS
814 
815 UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) {
816   memcpy(&val->val, &cval, sizeof(cval));
817 }
818 
upb_value_setdouble(upb_value * val,double cval)819 UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) {
820   memcpy(&val->val, &cval, sizeof(cval));
821 }
822 
upb_value_float(float cval)823 UPB_INLINE upb_value upb_value_float(float cval) {
824   upb_value ret;
825   upb_value_setfloat(&ret, cval);
826   return ret;
827 }
828 
upb_value_double(double cval)829 UPB_INLINE upb_value upb_value_double(double cval) {
830   upb_value ret;
831   upb_value_setdouble(&ret, cval);
832   return ret;
833 }
834 
835 #undef SET_TYPE
836 
837 /* upb_tabkey *****************************************************************/
838 
839 /* Either:
840  *   1. an actual integer key, or
841  *   2. a pointer to a string prefixed by its uint32_t length, owned by us.
842  *
843  * ...depending on whether this is a string table or an int table.  We would
844  * make this a union of those two types, but C89 doesn't support statically
845  * initializing a non-first union member. */
846 typedef uintptr_t upb_tabkey;
847 
upb_tabstr(upb_tabkey key,uint32_t * len)848 UPB_INLINE char* upb_tabstr(upb_tabkey key, uint32_t* len) {
849   char* mem = (char*)key;
850   if (len) memcpy(len, mem, sizeof(*len));
851   return mem + sizeof(*len);
852 }
853 
upb_tabstrview(upb_tabkey key)854 UPB_INLINE upb_StringView upb_tabstrview(upb_tabkey key) {
855   upb_StringView ret;
856   uint32_t len;
857   ret.data = upb_tabstr(key, &len);
858   ret.size = len;
859   return ret;
860 }
861 
862 /* upb_tabval *****************************************************************/
863 
864 typedef struct upb_tabval {
865   uint64_t val;
866 } upb_tabval;
867 
868 #define UPB_TABVALUE_EMPTY_INIT \
869   { -1 }
870 
871 /* upb_table ******************************************************************/
872 
873 typedef struct _upb_tabent {
874   upb_tabkey key;
875   upb_tabval val;
876 
877   /* Internal chaining.  This is const so we can create static initializers for
878    * tables.  We cast away const sometimes, but *only* when the containing
879    * upb_table is known to be non-const.  This requires a bit of care, but
880    * the subtlety is confined to table.c. */
881   const struct _upb_tabent* next;
882 } upb_tabent;
883 
884 typedef struct {
885   size_t count;       /* Number of entries in the hash part. */
886   uint32_t mask;      /* Mask to turn hash value -> bucket. */
887   uint32_t max_count; /* Max count before we hit our load limit. */
888   uint8_t size_lg2;   /* Size of the hashtable part is 2^size_lg2 entries. */
889   upb_tabent* entries;
890 } upb_table;
891 
892 typedef struct {
893   upb_table t;
894 } upb_strtable;
895 
896 typedef struct {
897   upb_table t;             /* For entries that don't fit in the array part. */
898   const upb_tabval* array; /* Array part of the table. See const note above. */
899   size_t array_size;       /* Array part size. */
900   size_t array_count;      /* Array part number of elements. */
901 } upb_inttable;
902 
upb_table_size(const upb_table * t)903 UPB_INLINE size_t upb_table_size(const upb_table* t) {
904   if (t->size_lg2 == 0)
905     return 0;
906   else
907     return 1 << t->size_lg2;
908 }
909 
910 /* Internal-only functions, in .h file only out of necessity. */
upb_tabent_isempty(const upb_tabent * e)911 UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; }
912 
913 /* Initialize and uninitialize a table, respectively.  If memory allocation
914  * failed, false is returned that the table is uninitialized. */
915 bool upb_inttable_init(upb_inttable* table, upb_Arena* a);
916 bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a);
917 
918 /* Returns the number of values in the table. */
919 size_t upb_inttable_count(const upb_inttable* t);
upb_strtable_count(const upb_strtable * t)920 UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) {
921   return t->t.count;
922 }
923 
924 void upb_strtable_clear(upb_strtable* t);
925 
926 /* Inserts the given key into the hashtable with the given value.  The key must
927  * not already exist in the hash table.  For string tables, the key must be
928  * NULL-terminated, and the table will make an internal copy of the key.
929  * Inttables must not insert a value of UINTPTR_MAX.
930  *
931  * If a table resize was required but memory allocation failed, false is
932  * returned and the table is unchanged. */
933 bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
934                          upb_Arena* a);
935 bool upb_strtable_insert(upb_strtable* t, const char* key, size_t len,
936                          upb_value val, upb_Arena* a);
937 
938 /* Looks up key in this table, returning "true" if the key was found.
939  * If v is non-NULL, copies the value for this key into *v. */
940 bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v);
941 bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
942                           upb_value* v);
943 
944 /* For NULL-terminated strings. */
upb_strtable_lookup(const upb_strtable * t,const char * key,upb_value * v)945 UPB_INLINE bool upb_strtable_lookup(const upb_strtable* t, const char* key,
946                                     upb_value* v) {
947   return upb_strtable_lookup2(t, key, strlen(key), v);
948 }
949 
950 /* Removes an item from the table.  Returns true if the remove was successful,
951  * and stores the removed item in *val if non-NULL. */
952 bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val);
953 bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
954                           upb_value* val);
955 
upb_strtable_remove(upb_strtable * t,const char * key,upb_value * v)956 UPB_INLINE bool upb_strtable_remove(upb_strtable* t, const char* key,
957                                     upb_value* v) {
958   return upb_strtable_remove2(t, key, strlen(key), v);
959 }
960 
961 /* Updates an existing entry in an inttable.  If the entry does not exist,
962  * returns false and does nothing.  Unlike insert/remove, this does not
963  * invalidate iterators. */
964 bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val);
965 
966 /* Optimizes the table for the current set of entries, for both memory use and
967  * lookup time.  Client should call this after all entries have been inserted;
968  * inserting more entries is legal, but will likely require a table resize. */
969 void upb_inttable_compact(upb_inttable* t, upb_Arena* a);
970 
971 /* Exposed for testing only. */
972 bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
973 
974 /* Iterators ******************************************************************/
975 
976 /* Iteration over inttable.
977  *
978  *   intptr_t iter = UPB_INTTABLE_BEGIN;
979  *   uintptr_t key;
980  *   upb_value val;
981  *   while (upb_inttable_next2(t, &key, &val, &iter)) {
982  *      // ...
983  *   }
984  */
985 
986 #define UPB_INTTABLE_BEGIN -1
987 
988 bool upb_inttable_next2(const upb_inttable* t, uintptr_t* key, upb_value* val,
989                         intptr_t* iter);
990 void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter);
991 
992 /* Iteration over strtable.
993  *
994  *   intptr_t iter = UPB_INTTABLE_BEGIN;
995  *   upb_StringView key;
996  *   upb_value val;
997  *   while (upb_strtable_next2(t, &key, &val, &iter)) {
998  *      // ...
999  *   }
1000  */
1001 
1002 #define UPB_STRTABLE_BEGIN -1
1003 
1004 bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
1005                         upb_value* val, intptr_t* iter);
1006 void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
1007 
1008 /* DEPRECATED iterators, slated for removal.
1009  *
1010  * Iterators for int and string tables.  We are subject to some kind of unusual
1011  * design constraints:
1012  *
1013  * For high-level languages:
1014  *  - we must be able to guarantee that we don't crash or corrupt memory even if
1015  *    the program accesses an invalidated iterator.
1016  *
1017  * For C++11 range-based for:
1018  *  - iterators must be copyable
1019  *  - iterators must be comparable
1020  *  - it must be possible to construct an "end" value.
1021  *
1022  * Iteration order is undefined.
1023  *
1024  * Modifying the table invalidates iterators.  upb_{str,int}table_done() is
1025  * guaranteed to work even on an invalidated iterator, as long as the table it
1026  * is iterating over has not been freed.  Calling next() or accessing data from
1027  * an invalidated iterator yields unspecified elements from the table, but it is
1028  * guaranteed not to crash and to return real table elements (except when done()
1029  * is true). */
1030 
1031 /* upb_strtable_iter **********************************************************/
1032 
1033 /*   upb_strtable_iter i;
1034  *   upb_strtable_begin(&i, t);
1035  *   for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
1036  *     const char *key = upb_strtable_iter_key(&i);
1037  *     const upb_value val = upb_strtable_iter_value(&i);
1038  *     // ...
1039  *   }
1040  */
1041 
1042 typedef struct {
1043   const upb_strtable* t;
1044   size_t index;
1045 } upb_strtable_iter;
1046 
1047 void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t);
1048 void upb_strtable_next(upb_strtable_iter* i);
1049 bool upb_strtable_done(const upb_strtable_iter* i);
1050 upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i);
1051 upb_value upb_strtable_iter_value(const upb_strtable_iter* i);
1052 void upb_strtable_iter_setdone(upb_strtable_iter* i);
1053 bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
1054                                const upb_strtable_iter* i2);
1055 
1056 /* upb_inttable_iter **********************************************************/
1057 
1058 /*   upb_inttable_iter i;
1059  *   upb_inttable_begin(&i, t);
1060  *   for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
1061  *     uintptr_t key = upb_inttable_iter_key(&i);
1062  *     upb_value val = upb_inttable_iter_value(&i);
1063  *     // ...
1064  *   }
1065  */
1066 
1067 typedef struct {
1068   const upb_inttable* t;
1069   size_t index;
1070   bool array_part;
1071 } upb_inttable_iter;
1072 
str_tabent(const upb_strtable_iter * i)1073 UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) {
1074   return &i->t->t.entries[i->index];
1075 }
1076 
1077 void upb_inttable_begin(upb_inttable_iter* i, const upb_inttable* t);
1078 void upb_inttable_next(upb_inttable_iter* i);
1079 bool upb_inttable_done(const upb_inttable_iter* i);
1080 uintptr_t upb_inttable_iter_key(const upb_inttable_iter* i);
1081 upb_value upb_inttable_iter_value(const upb_inttable_iter* i);
1082 void upb_inttable_iter_setdone(upb_inttable_iter* i);
1083 bool upb_inttable_iter_isequal(const upb_inttable_iter* i1,
1084                                const upb_inttable_iter* i2);
1085 
1086 uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed);
1087 
1088 #ifdef __cplusplus
1089 } /* extern "C" */
1090 #endif
1091 
1092 
1093 #endif /* UPB_TABLE_H_ */
1094 
1095 /* Must be last. */
1096 
1097 #ifdef __cplusplus
1098 extern "C" {
1099 #endif
1100 
1101 /** upb_*Int* conversion routines ********************************************/
1102 
_upb_Int32_FromI(int v)1103 UPB_INLINE int32_t _upb_Int32_FromI(int v) { return (int32_t)v; }
1104 
_upb_Int64_FromLL(long long v)1105 UPB_INLINE int64_t _upb_Int64_FromLL(long long v) { return (int64_t)v; }
1106 
_upb_UInt32_FromU(unsigned v)1107 UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v) { return (uint32_t)v; }
1108 
_upb_UInt64_FromULL(unsigned long long v)1109 UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v) {
1110   return (uint64_t)v;
1111 }
1112 
1113 /** upb_MiniTable *************************************************************/
1114 
1115 /* upb_MiniTable represents the memory layout of a given upb_MessageDef.  The
1116  * members are public so generated code can initialize them, but users MUST NOT
1117  * read or write any of its members. */
1118 
1119 typedef struct {
1120   uint32_t number;
1121   uint16_t offset;
1122   int16_t presence;       // If >0, hasbit_index.  If <0, ~oneof_index
1123   uint16_t submsg_index;  // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM
1124   uint8_t descriptortype;
1125   uint8_t mode; /* upb_FieldMode | upb_LabelFlags |
1126                    (upb_FieldRep << kUpb_FieldRep_Shift) */
1127 } upb_MiniTable_Field;
1128 
1129 #define kUpb_NoSub ((uint16_t)-1)
1130 
1131 typedef enum {
1132   kUpb_FieldMode_Map = 0,
1133   kUpb_FieldMode_Array = 1,
1134   kUpb_FieldMode_Scalar = 2,
1135 } upb_FieldMode;
1136 
1137 // Mask to isolate the upb_FieldMode from field.mode.
1138 #define kUpb_FieldMode_Mask 3
1139 
1140 /* Extra flags on the mode field. */
1141 typedef enum {
1142   kUpb_LabelFlags_IsPacked = 4,
1143   kUpb_LabelFlags_IsExtension = 8,
1144 } upb_LabelFlags;
1145 
1146 // Note: we sort by this number when calculating layout order.
1147 typedef enum {
1148   kUpb_FieldRep_1Byte = 0,
1149   kUpb_FieldRep_4Byte = 1,
1150   kUpb_FieldRep_StringView = 2,
1151   kUpb_FieldRep_Pointer = 3,
1152   kUpb_FieldRep_8Byte = 4,
1153 
1154   kUpb_FieldRep_Shift = 5,  // Bit offset of the rep in upb_MiniTable_Field.mode
1155   kUpb_FieldRep_Max = kUpb_FieldRep_8Byte,
1156 } upb_FieldRep;
1157 
upb_FieldMode_Get(const upb_MiniTable_Field * field)1158 UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTable_Field* field) {
1159   return (upb_FieldMode)(field->mode & 3);
1160 }
1161 
upb_IsRepeatedOrMap(const upb_MiniTable_Field * field)1162 UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field* field) {
1163   /* This works because upb_FieldMode has no value 3. */
1164   return !(field->mode & kUpb_FieldMode_Scalar);
1165 }
1166 
upb_IsSubMessage(const upb_MiniTable_Field * field)1167 UPB_INLINE bool upb_IsSubMessage(const upb_MiniTable_Field* field) {
1168   return field->descriptortype == kUpb_FieldType_Message ||
1169          field->descriptortype == kUpb_FieldType_Group;
1170 }
1171 
1172 struct upb_Decoder;
1173 struct upb_MiniTable;
1174 
1175 typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
1176                                      upb_Message* msg, intptr_t table,
1177                                      uint64_t hasbits, uint64_t data);
1178 
1179 typedef struct {
1180   uint64_t field_data;
1181   _upb_FieldParser* field_parser;
1182 } _upb_FastTable_Entry;
1183 
1184 typedef struct {
1185   const int32_t* values;  // List of values <0 or >63
1186   uint64_t mask;          // Bits are set for acceptable value 0 <= x < 64
1187   int value_count;
1188 } upb_MiniTable_Enum;
1189 
1190 typedef union {
1191   const struct upb_MiniTable* submsg;
1192   const upb_MiniTable_Enum* subenum;
1193 } upb_MiniTable_Sub;
1194 
1195 typedef enum {
1196   kUpb_ExtMode_NonExtendable = 0,  // Non-extendable message.
1197   kUpb_ExtMode_Extendable = 1,     // Normal extendable message.
1198   kUpb_ExtMode_IsMessageSet = 2,   // MessageSet message.
1199   kUpb_ExtMode_IsMessageSet_ITEM =
1200       3,  // MessageSet item (temporary only, see decode.c)
1201 
1202   // During table building we steal a bit to indicate that the message is a map
1203   // entry.  *Only* used during table building!
1204   kUpb_ExtMode_IsMapEntry = 4,
1205 } upb_ExtMode;
1206 
1207 /* MessageSet wire format is:
1208  *   message MessageSet {
1209  *     repeated group Item = 1 {
1210  *       required int32 type_id = 2;
1211  *       required bytes message = 3;
1212  *     }
1213  *   }
1214  */
1215 typedef enum {
1216   _UPB_MSGSET_ITEM = 1,
1217   _UPB_MSGSET_TYPEID = 2,
1218   _UPB_MSGSET_MESSAGE = 3,
1219 } upb_msgext_fieldnum;
1220 
1221 struct upb_MiniTable {
1222   const upb_MiniTable_Sub* subs;
1223   const upb_MiniTable_Field* fields;
1224   /* Must be aligned to sizeof(void*).  Doesn't include internal members like
1225    * unknown fields, extension dict, pointer to msglayout, etc. */
1226   uint16_t size;
1227   uint16_t field_count;
1228   uint8_t ext;  // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
1229   uint8_t dense_below;
1230   uint8_t table_mask;
1231   uint8_t required_count;  // Required fields have the lowest hasbits.
1232   /* To statically initialize the tables of variable length, we need a flexible
1233    * array member, and we need to compile in gnu99 mode (constant initialization
1234    * of flexible array members is a GNU extension, not in C99 unfortunately. */
1235   _upb_FastTable_Entry fasttable[];
1236 };
1237 
1238 typedef struct {
1239   upb_MiniTable_Field field;
1240   const upb_MiniTable* extendee;
1241   upb_MiniTable_Sub sub; /* NULL unless submessage or proto2 enum */
1242 } upb_MiniTable_Extension;
1243 
1244 typedef struct {
1245   const upb_MiniTable** msgs;
1246   const upb_MiniTable_Enum** enums;
1247   const upb_MiniTable_Extension** exts;
1248   int msg_count;
1249   int enum_count;
1250   int ext_count;
1251 } upb_MiniTable_File;
1252 
1253 // Computes a bitmask in which the |l->required_count| lowest bits are set,
1254 // except that we skip the lowest bit (because upb never uses hasbit 0).
1255 //
1256 // Sample output:
1257 //    requiredmask(1) => 0b10 (0x2)
1258 //    requiredmask(5) => 0b111110 (0x3e)
upb_MiniTable_requiredmask(const upb_MiniTable * l)1259 UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
1260   int n = l->required_count;
1261   assert(0 < n && n <= 63);
1262   return ((1ULL << n) - 1) << 1;
1263 }
1264 
1265 /** upb_ExtensionRegistry *****************************************************/
1266 
1267 /* Adds the given extension info for message type |l| and field number |num|
1268  * into the registry. Returns false if this message type and field number were
1269  * already in the map, or if memory allocation fails. */
1270 bool _upb_extreg_add(upb_ExtensionRegistry* r,
1271                      const upb_MiniTable_Extension** e, size_t count);
1272 
1273 /* Looks up the extension (if any) defined for message type |l| and field
1274  * number |num|.  If an extension was found, copies the field info into |*ext|
1275  * and returns true. Otherwise returns false. */
1276 const upb_MiniTable_Extension* _upb_extreg_get(const upb_ExtensionRegistry* r,
1277                                                const upb_MiniTable* l,
1278                                                uint32_t num);
1279 
1280 /** upb_Message ***************************************************************/
1281 
1282 /* Internal members of a upb_Message that track unknown fields and/or
1283  * extensions. We can change this without breaking binary compatibility.  We put
1284  * these before the user's data.  The user's upb_Message* points after the
1285  * upb_Message_Internal. */
1286 
1287 typedef struct {
1288   /* Total size of this structure, including the data that follows.
1289    * Must be aligned to 8, which is alignof(upb_Message_Extension) */
1290   uint32_t size;
1291 
1292   /* Offsets relative to the beginning of this structure.
1293    *
1294    * Unknown data grows forward from the beginning to unknown_end.
1295    * Extension data grows backward from size to ext_begin.
1296    * When the two meet, we're out of data and have to realloc.
1297    *
1298    * If we imagine that the final member of this struct is:
1299    *   char data[size - overhead];  // overhead =
1300    * sizeof(upb_Message_InternalData)
1301    *
1302    * Then we have:
1303    *   unknown data: data[0 .. (unknown_end - overhead)]
1304    *   extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
1305   uint32_t unknown_end;
1306   uint32_t ext_begin;
1307   /* Data follows, as if there were an array:
1308    *   char data[size - sizeof(upb_Message_InternalData)]; */
1309 } upb_Message_InternalData;
1310 
1311 typedef struct {
1312   upb_Message_InternalData* internal;
1313   /* Message data follows. */
1314 } upb_Message_Internal;
1315 
1316 /* Maps upb_CType -> memory size. */
1317 extern char _upb_CTypeo_size[12];
1318 
upb_msg_sizeof(const upb_MiniTable * l)1319 UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* l) {
1320   return l->size + sizeof(upb_Message_Internal);
1321 }
1322 
_upb_Message_New_inl(const upb_MiniTable * l,upb_Arena * a)1323 UPB_INLINE upb_Message* _upb_Message_New_inl(const upb_MiniTable* l,
1324                                              upb_Arena* a) {
1325   size_t size = upb_msg_sizeof(l);
1326   void* mem = upb_Arena_Malloc(a, size + sizeof(upb_Message_Internal));
1327   upb_Message* msg;
1328   if (UPB_UNLIKELY(!mem)) return NULL;
1329   msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message);
1330   memset(mem, 0, size);
1331   return msg;
1332 }
1333 
1334 /* Creates a new messages with the given layout on the given arena. */
1335 upb_Message* _upb_Message_New(const upb_MiniTable* l, upb_Arena* a);
1336 
upb_Message_Getinternal(upb_Message * msg)1337 UPB_INLINE upb_Message_Internal* upb_Message_Getinternal(upb_Message* msg) {
1338   ptrdiff_t size = sizeof(upb_Message_Internal);
1339   return (upb_Message_Internal*)((char*)msg - size);
1340 }
1341 
1342 /* Clears the given message. */
1343 void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l);
1344 
1345 /* Discards the unknown fields for this message only. */
1346 void _upb_Message_DiscardUnknown_shallow(upb_Message* msg);
1347 
1348 /* Adds unknown data (serialized protobuf data) to the given message.  The data
1349  * is copied into the message instance. */
1350 bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
1351                              upb_Arena* arena);
1352 
1353 /** upb_Message_Extension *****************************************************/
1354 
1355 /* The internal representation of an extension is self-describing: it contains
1356  * enough information that we can serialize it to binary format without needing
1357  * to look it up in a upb_ExtensionRegistry.
1358  *
1359  * This representation allocates 16 bytes to data on 64-bit platforms.  This is
1360  * rather wasteful for scalars (in the extreme case of bool, it wastes 15
1361  * bytes). We accept this because we expect messages to be the most common
1362  * extension type. */
1363 typedef struct {
1364   const upb_MiniTable_Extension* ext;
1365   union {
1366     upb_StringView str;
1367     void* ptr;
1368     char scalar_data[8];
1369   } data;
1370 } upb_Message_Extension;
1371 
1372 /* Adds the given extension data to the given message. |ext| is copied into the
1373  * message instance. This logically replaces any previously-added extension with
1374  * this number */
1375 upb_Message_Extension* _upb_Message_GetOrCreateExtension(
1376     upb_Message* msg, const upb_MiniTable_Extension* ext, upb_Arena* arena);
1377 
1378 /* Returns an array of extensions for this message. Note: the array is
1379  * ordered in reverse relative to the order of creation. */
1380 const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg,
1381                                                   size_t* count);
1382 
1383 /* Returns an extension for the given field number, or NULL if no extension
1384  * exists for this field number. */
1385 const upb_Message_Extension* _upb_Message_Getext(
1386     const upb_Message* msg, const upb_MiniTable_Extension* ext);
1387 
1388 void _upb_Message_Clearext(upb_Message* msg,
1389                            const upb_MiniTable_Extension* ext);
1390 
1391 void _upb_Message_Clearext(upb_Message* msg,
1392                            const upb_MiniTable_Extension* ext);
1393 
1394 /** Hasbit access *************************************************************/
1395 
_upb_hasbit(const upb_Message * msg,size_t idx)1396 UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) {
1397   return (*UPB_PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
1398 }
1399 
_upb_sethas(const upb_Message * msg,size_t idx)1400 UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) {
1401   (*UPB_PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
1402 }
1403 
_upb_clearhas(const upb_Message * msg,size_t idx)1404 UPB_INLINE void _upb_clearhas(const upb_Message* msg, size_t idx) {
1405   (*UPB_PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
1406 }
1407 
_upb_Message_Hasidx(const upb_MiniTable_Field * f)1408 UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTable_Field* f) {
1409   UPB_ASSERT(f->presence > 0);
1410   return f->presence;
1411 }
1412 
_upb_hasbit_field(const upb_Message * msg,const upb_MiniTable_Field * f)1413 UPB_INLINE bool _upb_hasbit_field(const upb_Message* msg,
1414                                   const upb_MiniTable_Field* f) {
1415   return _upb_hasbit(msg, _upb_Message_Hasidx(f));
1416 }
1417 
_upb_sethas_field(const upb_Message * msg,const upb_MiniTable_Field * f)1418 UPB_INLINE void _upb_sethas_field(const upb_Message* msg,
1419                                   const upb_MiniTable_Field* f) {
1420   _upb_sethas(msg, _upb_Message_Hasidx(f));
1421 }
1422 
_upb_clearhas_field(const upb_Message * msg,const upb_MiniTable_Field * f)1423 UPB_INLINE void _upb_clearhas_field(const upb_Message* msg,
1424                                     const upb_MiniTable_Field* f) {
1425   _upb_clearhas(msg, _upb_Message_Hasidx(f));
1426 }
1427 
1428 /** Oneof case access *********************************************************/
1429 
_upb_oneofcase(upb_Message * msg,size_t case_ofs)1430 UPB_INLINE uint32_t* _upb_oneofcase(upb_Message* msg, size_t case_ofs) {
1431   return UPB_PTR_AT(msg, case_ofs, uint32_t);
1432 }
1433 
_upb_getoneofcase(const void * msg,size_t case_ofs)1434 UPB_INLINE uint32_t _upb_getoneofcase(const void* msg, size_t case_ofs) {
1435   return *UPB_PTR_AT(msg, case_ofs, uint32_t);
1436 }
1437 
_upb_oneofcase_ofs(const upb_MiniTable_Field * f)1438 UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTable_Field* f) {
1439   UPB_ASSERT(f->presence < 0);
1440   return ~(ptrdiff_t)f->presence;
1441 }
1442 
_upb_oneofcase_field(upb_Message * msg,const upb_MiniTable_Field * f)1443 UPB_INLINE uint32_t* _upb_oneofcase_field(upb_Message* msg,
1444                                           const upb_MiniTable_Field* f) {
1445   return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
1446 }
1447 
_upb_getoneofcase_field(const upb_Message * msg,const upb_MiniTable_Field * f)1448 UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message* msg,
1449                                             const upb_MiniTable_Field* f) {
1450   return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
1451 }
1452 
_upb_has_submsg_nohasbit(const upb_Message * msg,size_t ofs)1453 UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_Message* msg, size_t ofs) {
1454   return *UPB_PTR_AT(msg, ofs, const upb_Message*) != NULL;
1455 }
1456 
1457 /** upb_Array *****************************************************************/
1458 
1459 /* Our internal representation for repeated fields.  */
1460 typedef struct {
1461   uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
1462   size_t len;     /* Measured in elements. */
1463   size_t size;    /* Measured in elements. */
1464   uint64_t junk;
1465 } upb_Array;
1466 
_upb_array_constptr(const upb_Array * arr)1467 UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) {
1468   UPB_ASSERT((arr->data & 7) <= 4);
1469   return (void*)(arr->data & ~(uintptr_t)7);
1470 }
1471 
_upb_array_tagptr(void * ptr,int elem_size_lg2)1472 UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
1473   UPB_ASSERT(elem_size_lg2 <= 4);
1474   return (uintptr_t)ptr | elem_size_lg2;
1475 }
1476 
_upb_array_ptr(upb_Array * arr)1477 UPB_INLINE void* _upb_array_ptr(upb_Array* arr) {
1478   return (void*)_upb_array_constptr(arr);
1479 }
1480 
_upb_tag_arrptr(void * ptr,int elem_size_lg2)1481 UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
1482   UPB_ASSERT(elem_size_lg2 <= 4);
1483   UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
1484   return (uintptr_t)ptr | (unsigned)elem_size_lg2;
1485 }
1486 
_upb_Array_New(upb_Arena * a,size_t init_size,int elem_size_lg2)1487 UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_size,
1488                                      int elem_size_lg2) {
1489   const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), UPB_MALLOC_ALIGN);
1490   const size_t bytes = arr_size + (init_size << elem_size_lg2);
1491   upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes);
1492   if (!arr) return NULL;
1493   arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
1494   arr->len = 0;
1495   arr->size = init_size;
1496   return arr;
1497 }
1498 
1499 /* Resizes the capacity of the array to be at least min_size. */
1500 bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena);
1501 
1502 /* Fallback functions for when the accessors require a resize. */
1503 void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size,
1504                                  int elem_size_lg2, upb_Arena* arena);
1505 bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value,
1506                                 int elem_size_lg2, upb_Arena* arena);
1507 
_upb_array_reserve(upb_Array * arr,size_t size,upb_Arena * arena)1508 UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size,
1509                                    upb_Arena* arena) {
1510   if (arr->size < size) return _upb_array_realloc(arr, size, arena);
1511   return true;
1512 }
1513 
_upb_Array_Resize(upb_Array * arr,size_t size,upb_Arena * arena)1514 UPB_INLINE bool _upb_Array_Resize(upb_Array* arr, size_t size,
1515                                   upb_Arena* arena) {
1516   if (!_upb_array_reserve(arr, size, arena)) return false;
1517   arr->len = size;
1518   return true;
1519 }
1520 
_upb_array_detach(const void * msg,size_t ofs)1521 UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
1522   *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
1523 }
1524 
_upb_array_accessor(const void * msg,size_t ofs,size_t * size)1525 UPB_INLINE const void* _upb_array_accessor(const void* msg, size_t ofs,
1526                                            size_t* size) {
1527   const upb_Array* arr = *UPB_PTR_AT(msg, ofs, const upb_Array*);
1528   if (arr) {
1529     if (size) *size = arr->len;
1530     return _upb_array_constptr(arr);
1531   } else {
1532     if (size) *size = 0;
1533     return NULL;
1534   }
1535 }
1536 
_upb_array_mutable_accessor(void * msg,size_t ofs,size_t * size)1537 UPB_INLINE void* _upb_array_mutable_accessor(void* msg, size_t ofs,
1538                                              size_t* size) {
1539   upb_Array* arr = *UPB_PTR_AT(msg, ofs, upb_Array*);
1540   if (arr) {
1541     if (size) *size = arr->len;
1542     return _upb_array_ptr(arr);
1543   } else {
1544     if (size) *size = 0;
1545     return NULL;
1546   }
1547 }
1548 
_upb_Array_Resize_accessor2(void * msg,size_t ofs,size_t size,int elem_size_lg2,upb_Arena * arena)1549 UPB_INLINE void* _upb_Array_Resize_accessor2(void* msg, size_t ofs, size_t size,
1550                                              int elem_size_lg2,
1551                                              upb_Arena* arena) {
1552   upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
1553   upb_Array* arr = *arr_ptr;
1554   if (!arr || arr->size < size) {
1555     return _upb_Array_Resize_fallback(arr_ptr, size, elem_size_lg2, arena);
1556   }
1557   arr->len = size;
1558   return _upb_array_ptr(arr);
1559 }
1560 
_upb_Array_Append_accessor2(void * msg,size_t ofs,int elem_size_lg2,const void * value,upb_Arena * arena)1561 UPB_INLINE bool _upb_Array_Append_accessor2(void* msg, size_t ofs,
1562                                             int elem_size_lg2,
1563                                             const void* value,
1564                                             upb_Arena* arena) {
1565   upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
1566   size_t elem_size = 1 << elem_size_lg2;
1567   upb_Array* arr = *arr_ptr;
1568   void* ptr;
1569   if (!arr || arr->len == arr->size) {
1570     return _upb_Array_Append_fallback(arr_ptr, value, elem_size_lg2, arena);
1571   }
1572   ptr = _upb_array_ptr(arr);
1573   memcpy(UPB_PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
1574   arr->len++;
1575   return true;
1576 }
1577 
1578 /* Used by old generated code, remove once all code has been regenerated. */
_upb_sizelg2(upb_CType type)1579 UPB_INLINE int _upb_sizelg2(upb_CType type) {
1580   switch (type) {
1581     case kUpb_CType_Bool:
1582       return 0;
1583     case kUpb_CType_Float:
1584     case kUpb_CType_Int32:
1585     case kUpb_CType_UInt32:
1586     case kUpb_CType_Enum:
1587       return 2;
1588     case kUpb_CType_Message:
1589       return UPB_SIZE(2, 3);
1590     case kUpb_CType_Double:
1591     case kUpb_CType_Int64:
1592     case kUpb_CType_UInt64:
1593       return 3;
1594     case kUpb_CType_String:
1595     case kUpb_CType_Bytes:
1596       return UPB_SIZE(3, 4);
1597   }
1598   UPB_UNREACHABLE();
1599 }
_upb_Array_Resize_accessor(void * msg,size_t ofs,size_t size,upb_CType type,upb_Arena * arena)1600 UPB_INLINE void* _upb_Array_Resize_accessor(void* msg, size_t ofs, size_t size,
1601                                             upb_CType type, upb_Arena* arena) {
1602   return _upb_Array_Resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena);
1603 }
_upb_Array_Append_accessor(void * msg,size_t ofs,size_t elem_size,upb_CType type,const void * value,upb_Arena * arena)1604 UPB_INLINE bool _upb_Array_Append_accessor(void* msg, size_t ofs,
1605                                            size_t elem_size, upb_CType type,
1606                                            const void* value,
1607                                            upb_Arena* arena) {
1608   (void)elem_size;
1609   return _upb_Array_Append_accessor2(msg, ofs, _upb_sizelg2(type), value,
1610                                      arena);
1611 }
1612 
1613 /** upb_Map *******************************************************************/
1614 
1615 /* Right now we use strmaps for everything.  We'll likely want to use
1616  * integer-specific maps for integer-keyed maps.*/
1617 typedef struct {
1618   /* Size of key and val, based on the map type.  Strings are represented as '0'
1619    * because they must be handled specially. */
1620   char key_size;
1621   char val_size;
1622 
1623   upb_strtable table;
1624 } upb_Map;
1625 
1626 /* Map entries aren't actually stored, they are only used during parsing.  For
1627  * parsing, it helps a lot if all map entry messages have the same layout.
1628  * The compiler and def.c must ensure that all map entries have this layout. */
1629 typedef struct {
1630   upb_Message_Internal internal;
1631   union {
1632     upb_StringView str; /* For str/bytes. */
1633     upb_value val;      /* For all other types. */
1634   } k;
1635   union {
1636     upb_StringView str; /* For str/bytes. */
1637     upb_value val;      /* For all other types. */
1638   } v;
1639 } upb_MapEntry;
1640 
1641 /* Creates a new map on the given arena with this key/value type. */
1642 upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
1643 
1644 /* Converting between internal table representation and user values.
1645  *
1646  * _upb_map_tokey() and _upb_map_fromkey() are inverses.
1647  * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
1648  *
1649  * These functions account for the fact that strings are treated differently
1650  * from other types when stored in a map.
1651  */
1652 
_upb_map_tokey(const void * key,size_t size)1653 UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) {
1654   if (size == UPB_MAPTYPE_STRING) {
1655     return *(upb_StringView*)key;
1656   } else {
1657     return upb_StringView_FromDataAndSize((const char*)key, size);
1658   }
1659 }
1660 
_upb_map_fromkey(upb_StringView key,void * out,size_t size)1661 UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) {
1662   if (size == UPB_MAPTYPE_STRING) {
1663     memcpy(out, &key, sizeof(key));
1664   } else {
1665     memcpy(out, key.data, size);
1666   }
1667 }
1668 
_upb_map_tovalue(const void * val,size_t size,upb_value * msgval,upb_Arena * a)1669 UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
1670                                  upb_value* msgval, upb_Arena* a) {
1671   if (size == UPB_MAPTYPE_STRING) {
1672     upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
1673     if (!strp) return false;
1674     *strp = *(upb_StringView*)val;
1675     *msgval = upb_value_ptr(strp);
1676   } else {
1677     memcpy(msgval, val, size);
1678   }
1679   return true;
1680 }
1681 
_upb_map_fromvalue(upb_value val,void * out,size_t size)1682 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
1683   if (size == UPB_MAPTYPE_STRING) {
1684     const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
1685     memcpy(out, strp, sizeof(upb_StringView));
1686   } else {
1687     memcpy(out, &val, size);
1688   }
1689 }
1690 
1691 /* Map operations, shared by reflection and generated code. */
1692 
_upb_Map_Size(const upb_Map * map)1693 UPB_INLINE size_t _upb_Map_Size(const upb_Map* map) {
1694   return map->table.t.count;
1695 }
1696 
_upb_Map_Get(const upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size)1697 UPB_INLINE bool _upb_Map_Get(const upb_Map* map, const void* key,
1698                              size_t key_size, void* val, size_t val_size) {
1699   upb_value tabval;
1700   upb_StringView k = _upb_map_tokey(key, key_size);
1701   bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
1702   if (ret && val) {
1703     _upb_map_fromvalue(tabval, val, val_size);
1704   }
1705   return ret;
1706 }
1707 
_upb_map_next(const upb_Map * map,size_t * iter)1708 UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) {
1709   upb_strtable_iter it;
1710   it.t = &map->table;
1711   it.index = *iter;
1712   upb_strtable_next(&it);
1713   *iter = it.index;
1714   if (upb_strtable_done(&it)) return NULL;
1715   return (void*)str_tabent(&it);
1716 }
1717 
1718 typedef enum {
1719   // LINT.IfChange
1720   _kUpb_MapInsertStatus_Inserted = 0,
1721   _kUpb_MapInsertStatus_Replaced = 1,
1722   _kUpb_MapInsertStatus_OutOfMemory = 2,
1723   // LINT.ThenChange(//depot/google3/third_party/upb/upb/collections.h)
1724 } _upb_MapInsertStatus;
1725 
_upb_Map_Insert(upb_Map * map,const void * key,size_t key_size,void * val,size_t val_size,upb_Arena * a)1726 UPB_INLINE _upb_MapInsertStatus _upb_Map_Insert(upb_Map* map, const void* key,
1727                                                 size_t key_size, void* val,
1728                                                 size_t val_size, upb_Arena* a) {
1729   upb_StringView strkey = _upb_map_tokey(key, key_size);
1730   upb_value tabval = {0};
1731   if (!_upb_map_tovalue(val, val_size, &tabval, a)) {
1732     return _kUpb_MapInsertStatus_OutOfMemory;
1733   }
1734 
1735   /* TODO(haberman): add overwrite operation to minimize number of lookups. */
1736   bool removed =
1737       upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
1738   if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) {
1739     return _kUpb_MapInsertStatus_OutOfMemory;
1740   }
1741   return removed ? _kUpb_MapInsertStatus_Replaced
1742                  : _kUpb_MapInsertStatus_Inserted;
1743 }
1744 
_upb_Map_Delete(upb_Map * map,const void * key,size_t key_size)1745 UPB_INLINE bool _upb_Map_Delete(upb_Map* map, const void* key,
1746                                 size_t key_size) {
1747   upb_StringView k = _upb_map_tokey(key, key_size);
1748   return upb_strtable_remove2(&map->table, k.data, k.size, NULL);
1749 }
1750 
_upb_Map_Clear(upb_Map * map)1751 UPB_INLINE void _upb_Map_Clear(upb_Map* map) {
1752   upb_strtable_clear(&map->table);
1753 }
1754 
1755 /* Message map operations, these get the map from the message first. */
1756 
_upb_msg_map_size(const upb_Message * msg,size_t ofs)1757 UPB_INLINE size_t _upb_msg_map_size(const upb_Message* msg, size_t ofs) {
1758   upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
1759   return map ? _upb_Map_Size(map) : 0;
1760 }
1761 
_upb_msg_map_get(const upb_Message * msg,size_t ofs,const void * key,size_t key_size,void * val,size_t val_size)1762 UPB_INLINE bool _upb_msg_map_get(const upb_Message* msg, size_t ofs,
1763                                  const void* key, size_t key_size, void* val,
1764                                  size_t val_size) {
1765   upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
1766   if (!map) return false;
1767   return _upb_Map_Get(map, key, key_size, val, val_size);
1768 }
1769 
_upb_msg_map_next(const upb_Message * msg,size_t ofs,size_t * iter)1770 UPB_INLINE void* _upb_msg_map_next(const upb_Message* msg, size_t ofs,
1771                                    size_t* iter) {
1772   upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
1773   if (!map) return NULL;
1774   return _upb_map_next(map, iter);
1775 }
1776 
_upb_msg_map_set(upb_Message * msg,size_t ofs,const void * key,size_t key_size,void * val,size_t val_size,upb_Arena * arena)1777 UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key,
1778                                  size_t key_size, void* val, size_t val_size,
1779                                  upb_Arena* arena) {
1780   upb_Map** map = UPB_PTR_AT(msg, ofs, upb_Map*);
1781   if (!*map) {
1782     *map = _upb_Map_New(arena, key_size, val_size);
1783   }
1784   return _upb_Map_Insert(*map, key, key_size, val, val_size, arena) !=
1785          _kUpb_MapInsertStatus_OutOfMemory;
1786 }
1787 
_upb_msg_map_delete(upb_Message * msg,size_t ofs,const void * key,size_t key_size)1788 UPB_INLINE bool _upb_msg_map_delete(upb_Message* msg, size_t ofs,
1789                                     const void* key, size_t key_size) {
1790   upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
1791   if (!map) return false;
1792   return _upb_Map_Delete(map, key, key_size);
1793 }
1794 
_upb_msg_map_clear(upb_Message * msg,size_t ofs)1795 UPB_INLINE void _upb_msg_map_clear(upb_Message* msg, size_t ofs) {
1796   upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
1797   if (!map) return;
1798   _upb_Map_Clear(map);
1799 }
1800 
1801 /* Accessing map key/value from a pointer, used by generated code only. */
1802 
_upb_msg_map_key(const void * msg,void * key,size_t size)1803 UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
1804   const upb_tabent* ent = (const upb_tabent*)msg;
1805   uint32_t u32len;
1806   upb_StringView k;
1807   k.data = upb_tabstr(ent->key, &u32len);
1808   k.size = u32len;
1809   _upb_map_fromkey(k, key, size);
1810 }
1811 
_upb_msg_map_value(const void * msg,void * val,size_t size)1812 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
1813   const upb_tabent* ent = (const upb_tabent*)msg;
1814   upb_value v = {ent->val.val};
1815   _upb_map_fromvalue(v, val, size);
1816 }
1817 
_upb_msg_map_set_value(void * msg,const void * val,size_t size)1818 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
1819                                        size_t size) {
1820   upb_tabent* ent = (upb_tabent*)msg;
1821   /* This is like _upb_map_tovalue() except the entry already exists so we can
1822    * reuse the allocated upb_StringView for string fields. */
1823   if (size == UPB_MAPTYPE_STRING) {
1824     upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val;
1825     memcpy(strp, val, sizeof(*strp));
1826   } else {
1827     memcpy(&ent->val.val, val, size);
1828   }
1829 }
1830 
1831 /** _upb_mapsorter ************************************************************/
1832 
1833 /* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
1834  * Since maps can be recursive (map values can be messages which contain other
1835  * maps). _upb_mapsorter can contain a stack of maps. */
1836 
1837 typedef struct {
1838   upb_tabent const** entries;
1839   int size;
1840   int cap;
1841 } _upb_mapsorter;
1842 
1843 typedef struct {
1844   int start;
1845   int pos;
1846   int end;
1847 } _upb_sortedmap;
1848 
_upb_mapsorter_init(_upb_mapsorter * s)1849 UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
1850   s->entries = NULL;
1851   s->size = 0;
1852   s->cap = 0;
1853 }
1854 
_upb_mapsorter_destroy(_upb_mapsorter * s)1855 UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
1856   if (s->entries) free(s->entries);
1857 }
1858 
1859 bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
1860                             const upb_Map* map, _upb_sortedmap* sorted);
1861 
_upb_mapsorter_popmap(_upb_mapsorter * s,_upb_sortedmap * sorted)1862 UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
1863                                       _upb_sortedmap* sorted) {
1864   s->size = sorted->start;
1865 }
1866 
_upb_sortedmap_next(_upb_mapsorter * s,const upb_Map * map,_upb_sortedmap * sorted,upb_MapEntry * ent)1867 UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
1868                                     _upb_sortedmap* sorted, upb_MapEntry* ent) {
1869   if (sorted->pos == sorted->end) return false;
1870   const upb_tabent* tabent = s->entries[sorted->pos++];
1871   upb_StringView key = upb_tabstrview(tabent->key);
1872   _upb_map_fromkey(key, &ent->k, map->key_size);
1873   upb_value val = {tabent->val.val};
1874   _upb_map_fromvalue(val, &ent->v, map->val_size);
1875   return true;
1876 }
1877 
1878 #ifdef __cplusplus
1879 } /* extern "C" */
1880 #endif
1881 
1882 
1883 #endif /* UPB_MSG_INT_H_ */
1884 
1885 /** upb/decode.h ************************************************************/
1886 /*
1887  * upb_decode: parsing into a upb_Message using a upb_MiniTable.
1888  */
1889 
1890 #ifndef UPB_DECODE_H_
1891 #define UPB_DECODE_H_
1892 
1893 
1894 /* Must be last. */
1895 
1896 #ifdef __cplusplus
1897 extern "C" {
1898 #endif
1899 
1900 enum {
1901   /* If set, strings will alias the input buffer instead of copying into the
1902    * arena. */
1903   kUpb_DecodeOption_AliasString = 1,
1904 
1905   /* If set, the parse will return failure if any message is missing any
1906    * required fields when the message data ends.  The parse will still continue,
1907    * and the failure will only be reported at the end.
1908    *
1909    * IMPORTANT CAVEATS:
1910    *
1911    * 1. This can throw a false positive failure if an incomplete message is seen
1912    *    on the wire but is later completed when the sub-message occurs again.
1913    *    For this reason, a second pass is required to verify a failure, to be
1914    *    truly robust.
1915    *
1916    * 2. This can return a false success if you are decoding into a message that
1917    *    already has some sub-message fields present.  If the sub-message does
1918    *    not occur in the binary payload, we will never visit it and discover the
1919    *    incomplete sub-message.  For this reason, this check is only useful for
1920    *    implemting ParseFromString() semantics.  For MergeFromString(), a
1921    *    post-parse validation step will always be necessary. */
1922   kUpb_DecodeOption_CheckRequired = 2,
1923 };
1924 
1925 #define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16)
1926 
1927 typedef enum {
1928   kUpb_DecodeStatus_Ok = 0,
1929   kUpb_DecodeStatus_Malformed = 1,         // Wire format was corrupt
1930   kUpb_DecodeStatus_OutOfMemory = 2,       // Arena alloc failed
1931   kUpb_DecodeStatus_BadUtf8 = 3,           // String field had bad UTF-8
1932   kUpb_DecodeStatus_MaxDepthExceeded = 4,  // Exceeded UPB_DECODE_MAXDEPTH
1933 
1934   // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
1935   // succeeded.
1936   kUpb_DecodeStatus_MissingRequired = 5,
1937 } upb_DecodeStatus;
1938 
1939 upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
1940                             const upb_MiniTable* l,
1941                             const upb_ExtensionRegistry* extreg, int options,
1942                             upb_Arena* arena);
1943 
1944 #ifdef __cplusplus
1945 } /* extern "C" */
1946 #endif
1947 
1948 
1949 #endif /* UPB_DECODE_H_ */
1950 
1951 /** upb/decode_fast.h ************************************************************/
1952 // These are the specialized field parser functions for the fast parser.
1953 // Generated tables will refer to these by name.
1954 //
1955 // The function names are encoded with names like:
1956 //
1957 //   //  123 4
1958 //   upb_pss_1bt();   // Parse singular string, 1 byte tag.
1959 //
1960 // In position 1:
1961 //   - 'p' for parse, most function use this
1962 //   - 'c' for copy, for when we are copying strings instead of aliasing
1963 //
1964 // In position 2 (cardinality):
1965 //   - 's' for singular, with or without hasbit
1966 //   - 'o' for oneof
1967 //   - 'r' for non-packed repeated
1968 //   - 'p' for packed repeated
1969 //
1970 // In position 3 (type):
1971 //   - 'b1' for bool
1972 //   - 'v4' for 4-byte varint
1973 //   - 'v8' for 8-byte varint
1974 //   - 'z4' for zig-zag-encoded 4-byte varint
1975 //   - 'z8' for zig-zag-encoded 8-byte varint
1976 //   - 'f4' for 4-byte fixed
1977 //   - 'f8' for 8-byte fixed
1978 //   - 'm' for sub-message
1979 //   - 's' for string (validate UTF-8)
1980 //   - 'b' for bytes
1981 //
1982 // In position 4 (tag length):
1983 //   - '1' for one-byte tags (field numbers 1-15)
1984 //   - '2' for two-byte tags (field numbers 16-2048)
1985 
1986 #ifndef UPB_DECODE_FAST_H_
1987 #define UPB_DECODE_FAST_H_
1988 
1989 
1990 struct upb_Decoder;
1991 
1992 // The fallback, generic parsing function that can handle any field type.
1993 // This just uses the regular (non-fast) parser to parse a single field.
1994 const char* fastdecode_generic(struct upb_Decoder* d, const char* ptr,
1995                                upb_Message* msg, intptr_t table,
1996                                uint64_t hasbits, uint64_t data);
1997 
1998 #define UPB_PARSE_PARAMS                                                    \
1999   struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
2000       uint64_t hasbits, uint64_t data
2001 
2002 /* primitive fields ***********************************************************/
2003 
2004 #define F(card, type, valbytes, tagbytes) \
2005   const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
2006 
2007 #define TYPES(card, tagbytes) \
2008   F(card, b, 1, tagbytes)     \
2009   F(card, v, 4, tagbytes)     \
2010   F(card, v, 8, tagbytes)     \
2011   F(card, z, 4, tagbytes)     \
2012   F(card, z, 8, tagbytes)     \
2013   F(card, f, 4, tagbytes)     \
2014   F(card, f, 8, tagbytes)
2015 
2016 #define TAGBYTES(card) \
2017   TYPES(card, 1)       \
2018   TYPES(card, 2)
2019 
2020 TAGBYTES(s)
TAGBYTES(o)2021 TAGBYTES(o)
2022 TAGBYTES(r)
2023 TAGBYTES(p)
2024 
2025 #undef F
2026 #undef TYPES
2027 #undef TAGBYTES
2028 
2029 /* string fields **************************************************************/
2030 
2031 #define F(card, tagbytes, type)                                     \
2032   const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
2033   const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
2034 
2035 #define UTF8(card, tagbytes) \
2036   F(card, tagbytes, s)       \
2037   F(card, tagbytes, b)
2038 
2039 #define TAGBYTES(card) \
2040   UTF8(card, 1)        \
2041   UTF8(card, 2)
2042 
2043 TAGBYTES(s)
2044 TAGBYTES(o)
2045 TAGBYTES(r)
2046 
2047 #undef F
2048 #undef TAGBYTES
2049 
2050 /* sub-message fields *********************************************************/
2051 
2052 #define F(card, tagbytes, size_ceil, ceil_arg) \
2053   const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
2054 
2055 #define SIZES(card, tagbytes) \
2056   F(card, tagbytes, 64, 64)   \
2057   F(card, tagbytes, 128, 128) \
2058   F(card, tagbytes, 192, 192) \
2059   F(card, tagbytes, 256, 256) \
2060   F(card, tagbytes, max, -1)
2061 
2062 #define TAGBYTES(card) \
2063   SIZES(card, 1)       \
2064   SIZES(card, 2)
2065 
2066 TAGBYTES(s)
2067 TAGBYTES(o)
2068 TAGBYTES(r)
2069 
2070 #undef TAGBYTES
2071 #undef SIZES
2072 #undef F
2073 
2074 #undef UPB_PARSE_PARAMS
2075 
2076 #endif /* UPB_DECODE_FAST_H_ */
2077 
2078 /** upb/encode.h ************************************************************/
2079 /*
2080  * upb_Encode: parsing into a upb_Message using a upb_MiniTable.
2081  */
2082 
2083 #ifndef UPB_ENCODE_H_
2084 #define UPB_ENCODE_H_
2085 
2086 
2087 /* Must be last. */
2088 
2089 #ifdef __cplusplus
2090 extern "C" {
2091 #endif
2092 
2093 enum {
2094   /* If set, the results of serializing will be deterministic across all
2095    * instances of this binary. There are no guarantees across different
2096    * binary builds.
2097    *
2098    * If your proto contains maps, the encoder will need to malloc()/free()
2099    * memory during encode. */
2100   kUpb_Encode_Deterministic = 1,
2101 
2102   /* When set, unknown fields are not printed. */
2103   kUpb_Encode_SkipUnknown = 2,
2104 
2105   /* When set, the encode will fail if any required fields are missing. */
2106   kUpb_Encode_CheckRequired = 4,
2107 };
2108 
2109 #define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16)
2110 
2111 char* upb_Encode(const void* msg, const upb_MiniTable* l, int options,
2112                  upb_Arena* arena, size_t* size);
2113 
2114 
2115 #ifdef __cplusplus
2116 } /* extern "C" */
2117 #endif
2118 
2119 #endif /* UPB_ENCODE_H_ */
2120 
2121 
2122 #ifdef __cplusplus
2123 extern "C" {
2124 #endif
2125 
2126 struct google_protobuf_FileDescriptorSet;
2127 struct google_protobuf_FileDescriptorProto;
2128 struct google_protobuf_DescriptorProto;
2129 struct google_protobuf_DescriptorProto_ExtensionRange;
2130 struct google_protobuf_DescriptorProto_ReservedRange;
2131 struct google_protobuf_ExtensionRangeOptions;
2132 struct google_protobuf_FieldDescriptorProto;
2133 struct google_protobuf_OneofDescriptorProto;
2134 struct google_protobuf_EnumDescriptorProto;
2135 struct google_protobuf_EnumDescriptorProto_EnumReservedRange;
2136 struct google_protobuf_EnumValueDescriptorProto;
2137 struct google_protobuf_ServiceDescriptorProto;
2138 struct google_protobuf_MethodDescriptorProto;
2139 struct google_protobuf_FileOptions;
2140 struct google_protobuf_MessageOptions;
2141 struct google_protobuf_FieldOptions;
2142 struct google_protobuf_OneofOptions;
2143 struct google_protobuf_EnumOptions;
2144 struct google_protobuf_EnumValueOptions;
2145 struct google_protobuf_ServiceOptions;
2146 struct google_protobuf_MethodOptions;
2147 struct google_protobuf_UninterpretedOption;
2148 struct google_protobuf_UninterpretedOption_NamePart;
2149 struct google_protobuf_SourceCodeInfo;
2150 struct google_protobuf_SourceCodeInfo_Location;
2151 struct google_protobuf_GeneratedCodeInfo;
2152 struct google_protobuf_GeneratedCodeInfo_Annotation;
2153 typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet;
2154 typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto;
2155 typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto;
2156 typedef struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange;
2157 typedef struct google_protobuf_DescriptorProto_ReservedRange google_protobuf_DescriptorProto_ReservedRange;
2158 typedef struct google_protobuf_ExtensionRangeOptions google_protobuf_ExtensionRangeOptions;
2159 typedef struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto;
2160 typedef struct google_protobuf_OneofDescriptorProto google_protobuf_OneofDescriptorProto;
2161 typedef struct google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto;
2162 typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange google_protobuf_EnumDescriptorProto_EnumReservedRange;
2163 typedef struct google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto;
2164 typedef struct google_protobuf_ServiceDescriptorProto google_protobuf_ServiceDescriptorProto;
2165 typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescriptorProto;
2166 typedef struct google_protobuf_FileOptions google_protobuf_FileOptions;
2167 typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions;
2168 typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions;
2169 typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions;
2170 typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions;
2171 typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions;
2172 typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions;
2173 typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions;
2174 typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption;
2175 typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart;
2176 typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo;
2177 typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location;
2178 typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo;
2179 typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation;
2180 extern const upb_MiniTable google_protobuf_FileDescriptorSet_msginit;
2181 extern const upb_MiniTable google_protobuf_FileDescriptorProto_msginit;
2182 extern const upb_MiniTable google_protobuf_DescriptorProto_msginit;
2183 extern const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit;
2184 extern const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit;
2185 extern const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit;
2186 extern const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit;
2187 extern const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit;
2188 extern const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit;
2189 extern const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
2190 extern const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit;
2191 extern const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit;
2192 extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit;
2193 extern const upb_MiniTable google_protobuf_FileOptions_msginit;
2194 extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
2195 extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
2196 extern const upb_MiniTable google_protobuf_OneofOptions_msginit;
2197 extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
2198 extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
2199 extern const upb_MiniTable google_protobuf_ServiceOptions_msginit;
2200 extern const upb_MiniTable google_protobuf_MethodOptions_msginit;
2201 extern const upb_MiniTable google_protobuf_UninterpretedOption_msginit;
2202 extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit;
2203 extern const upb_MiniTable google_protobuf_SourceCodeInfo_msginit;
2204 extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit;
2205 extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit;
2206 extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit;
2207 
2208 typedef enum {
2209   google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
2210   google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
2211   google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
2212 } google_protobuf_FieldDescriptorProto_Label;
2213 
2214 typedef enum {
2215   google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
2216   google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
2217   google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
2218   google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
2219   google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
2220   google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
2221   google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
2222   google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
2223   google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
2224   google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
2225   google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
2226   google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
2227   google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
2228   google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
2229   google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
2230   google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
2231   google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
2232   google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
2233 } google_protobuf_FieldDescriptorProto_Type;
2234 
2235 typedef enum {
2236   google_protobuf_FieldOptions_STRING = 0,
2237   google_protobuf_FieldOptions_CORD = 1,
2238   google_protobuf_FieldOptions_STRING_PIECE = 2
2239 } google_protobuf_FieldOptions_CType;
2240 
2241 typedef enum {
2242   google_protobuf_FieldOptions_JS_NORMAL = 0,
2243   google_protobuf_FieldOptions_JS_STRING = 1,
2244   google_protobuf_FieldOptions_JS_NUMBER = 2
2245 } google_protobuf_FieldOptions_JSType;
2246 
2247 typedef enum {
2248   google_protobuf_FileOptions_SPEED = 1,
2249   google_protobuf_FileOptions_CODE_SIZE = 2,
2250   google_protobuf_FileOptions_LITE_RUNTIME = 3
2251 } google_protobuf_FileOptions_OptimizeMode;
2252 
2253 typedef enum {
2254   google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
2255   google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
2256   google_protobuf_MethodOptions_IDEMPOTENT = 2
2257 } google_protobuf_MethodOptions_IdempotencyLevel;
2258 
2259 
2260 extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit;
2261 extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit;
2262 extern const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit;
2263 extern const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit;
2264 extern const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit;
2265 extern const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit;
2266 
2267 /* google.protobuf.FileDescriptorSet */
2268 
google_protobuf_FileDescriptorSet_new(upb_Arena * arena)2269 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) {
2270   return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google_protobuf_FileDescriptorSet_msginit, arena);
2271 }
google_protobuf_FileDescriptorSet_parse(const char * buf,size_t size,upb_Arena * arena)2272 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) {
2273   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
2274   if (!ret) return NULL;
2275   if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2276     return NULL;
2277   }
2278   return ret;
2279 }
google_protobuf_FileDescriptorSet_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2280 UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size,
2281                            const upb_ExtensionRegistry* extreg,
2282                            int options, upb_Arena* arena) {
2283   google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
2284   if (!ret) return NULL;
2285   if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, extreg, options, arena) !=
2286       kUpb_DecodeStatus_Ok) {
2287     return NULL;
2288   }
2289   return ret;
2290 }
google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet * msg,upb_Arena * arena,size_t * len)2291 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) {
2292   return upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, 0, arena, len);
2293 }
google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet * msg,int options,upb_Arena * arena,size_t * len)2294 UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options,
2295                                  upb_Arena* arena, size_t* len) {
2296   return upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, options, arena, len);
2297 }
google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet * msg)2298 UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) {
2299   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
2300 }
google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet * msg)2301 UPB_INLINE void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) {
2302   _upb_array_detach(msg, UPB_SIZE(0, 0));
2303 }
google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet * msg,size_t * len)2304 UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet* msg, size_t* len) {
2305   return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
2306 }
2307 
google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet * msg,size_t * len)2308 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet* msg, size_t* len) {
2309   return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
2310 }
google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet * msg,size_t len,upb_Arena * arena)2311 UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet* msg, size_t len, upb_Arena* arena) {
2312   return (google_protobuf_FileDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
2313 }
google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet * msg,upb_Arena * arena)2314 UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) {
2315   struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena);
2316   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
2317   if (!ok) return NULL;
2318   return sub;
2319 }
2320 
2321 /* google.protobuf.FileDescriptorProto */
2322 
google_protobuf_FileDescriptorProto_new(upb_Arena * arena)2323 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) {
2324   return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena);
2325 }
google_protobuf_FileDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)2326 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
2327   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
2328   if (!ret) return NULL;
2329   if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2330     return NULL;
2331   }
2332   return ret;
2333 }
google_protobuf_FileDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2334 UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size,
2335                            const upb_ExtensionRegistry* extreg,
2336                            int options, upb_Arena* arena) {
2337   google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
2338   if (!ret) return NULL;
2339   if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, extreg, options, arena) !=
2340       kUpb_DecodeStatus_Ok) {
2341     return NULL;
2342   }
2343   return ret;
2344 }
google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto * msg,upb_Arena * arena,size_t * len)2345 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) {
2346   return upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, 0, arena, len);
2347 }
google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)2348 UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options,
2349                                  upb_Arena* arena, size_t* len) {
2350   return upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, options, arena, len);
2351 }
google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto * msg)2352 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
2353   return _upb_hasbit(msg, 1);
2354 }
google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto * msg)2355 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) {
2356   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2357   _upb_clearhas(msg, 1);
2358 }
google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto * msg)2359 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
2360   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
2361 }
google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto * msg)2362 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
2363   return _upb_hasbit(msg, 2);
2364 }
google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto * msg)2365 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) {
2366   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2367   _upb_clearhas(msg, 2);
2368 }
google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto * msg)2369 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
2370   return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
2371 }
google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto * msg)2372 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) {
2373   _upb_array_detach(msg, UPB_SIZE(20, 40));
2374 }
google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)2375 UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2376   return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
2377 }
google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto * msg)2378 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
2379   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
2380 }
google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto * msg)2381 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) {
2382   _upb_array_detach(msg, UPB_SIZE(24, 48));
2383 }
google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)2384 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2385   return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
2386 }
google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto * msg)2387 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
2388   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
2389 }
google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto * msg)2390 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) {
2391   _upb_array_detach(msg, UPB_SIZE(28, 56));
2392 }
google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto * msg,size_t * len)2393 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2394   return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
2395 }
google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto * msg)2396 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
2397   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64));
2398 }
google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto * msg)2399 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) {
2400   _upb_array_detach(msg, UPB_SIZE(32, 64));
2401 }
google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto * msg,size_t * len)2402 UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2403   return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len);
2404 }
google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto * msg)2405 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
2406   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72));
2407 }
google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto * msg)2408 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) {
2409   _upb_array_detach(msg, UPB_SIZE(36, 72));
2410 }
google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto * msg,size_t * len)2411 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2412   return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
2413 }
google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto * msg)2414 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
2415   return _upb_hasbit(msg, 3);
2416 }
google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto * msg)2417 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) {
2418   *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
2419 }
google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto * msg)2420 UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
2421   return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const google_protobuf_FileOptions*);
2422 }
google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto * msg)2423 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2424   return _upb_hasbit(msg, 4);
2425 }
google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto * msg)2426 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2427   *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
2428 }
google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto * msg)2429 UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
2430   return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const google_protobuf_SourceCodeInfo*);
2431 }
google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto * msg)2432 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
2433   _upb_array_detach(msg, UPB_SIZE(48, 96));
2434 }
google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)2435 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2436   return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len);
2437 }
google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto * msg)2438 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
2439   _upb_array_detach(msg, UPB_SIZE(52, 104));
2440 }
google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto * msg,size_t * len)2441 UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
2442   return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len);
2443 }
google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto * msg)2444 UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
2445   return _upb_hasbit(msg, 5);
2446 }
google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto * msg)2447 UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) {
2448   *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2449   _upb_clearhas(msg, 5);
2450 }
google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto * msg)2451 UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
2452   return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView);
2453 }
2454 
google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto * msg,upb_StringView value)2455 UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
2456   _upb_sethas(msg, 1);
2457   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
2458 }
google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto * msg,upb_StringView value)2459 UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
2460   _upb_sethas(msg, 2);
2461   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
2462 }
google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)2463 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2464   return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2465 }
google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2466 UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2467   return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), arena);
2468 }
google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto * msg,upb_StringView val,upb_Arena * arena)2469 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
2470   return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &val, arena);
2471 }
google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto * msg,size_t * len)2472 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2473   return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2474 }
google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2475 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2476   return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
2477 }
google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2478 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2479   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
2480   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
2481   if (!ok) return NULL;
2482   return sub;
2483 }
google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto * msg,size_t * len)2484 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2485   return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
2486 }
google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2487 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2488   return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
2489 }
google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2490 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2491   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
2492   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
2493   if (!ok) return NULL;
2494   return sub;
2495 }
google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto * msg,size_t * len)2496 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2497   return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
2498 }
google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2499 UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2500   return (google_protobuf_ServiceDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
2501 }
google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2502 UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2503   struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena);
2504   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
2505   if (!ok) return NULL;
2506   return sub;
2507 }
google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto * msg,size_t * len)2508 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2509   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
2510 }
google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2511 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2512   return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
2513 }
google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2514 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2515   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2516   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
2517   if (!ok) return NULL;
2518   return sub;
2519 }
google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto * msg,google_protobuf_FileOptions * value)2520 UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
2521   _upb_sethas(msg, 3);
2522   *UPB_PTR_AT(msg, UPB_SIZE(40, 80), google_protobuf_FileOptions*) = value;
2523 }
google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2524 UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2525   struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
2526   if (sub == NULL) {
2527     sub = (struct google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msginit, arena);
2528     if (!sub) return NULL;
2529     google_protobuf_FileDescriptorProto_set_options(msg, sub);
2530   }
2531   return sub;
2532 }
google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto * msg,google_protobuf_SourceCodeInfo * value)2533 UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
2534   _upb_sethas(msg, 4);
2535   *UPB_PTR_AT(msg, UPB_SIZE(44, 88), google_protobuf_SourceCodeInfo*) = value;
2536 }
google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto * msg,upb_Arena * arena)2537 UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) {
2538   struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
2539   if (sub == NULL) {
2540     sub = (struct google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena);
2541     if (!sub) return NULL;
2542     google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
2543   }
2544   return sub;
2545 }
google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)2546 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2547   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
2548 }
google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2549 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2550   return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, 2, arena);
2551 }
google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)2552 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
2553   return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), 2, &val, arena);
2554 }
google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t * len)2555 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
2556   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
2557 }
google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto * msg,size_t len,upb_Arena * arena)2558 UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
2559   return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, 2, arena);
2560 }
google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto * msg,int32_t val,upb_Arena * arena)2561 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
2562   return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), 2, &val, arena);
2563 }
google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto * msg,upb_StringView value)2564 UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
2565   _upb_sethas(msg, 5);
2566   *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = value;
2567 }
2568 
2569 /* google.protobuf.DescriptorProto */
2570 
google_protobuf_DescriptorProto_new(upb_Arena * arena)2571 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) {
2572   return (google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
2573 }
google_protobuf_DescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)2574 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
2575   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
2576   if (!ret) return NULL;
2577   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2578     return NULL;
2579   }
2580   return ret;
2581 }
google_protobuf_DescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2582 UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size,
2583                            const upb_ExtensionRegistry* extreg,
2584                            int options, upb_Arena* arena) {
2585   google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
2586   if (!ret) return NULL;
2587   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, extreg, options, arena) !=
2588       kUpb_DecodeStatus_Ok) {
2589     return NULL;
2590   }
2591   return ret;
2592 }
google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto * msg,upb_Arena * arena,size_t * len)2593 UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) {
2594   return upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, 0, arena, len);
2595 }
google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto * msg,int options,upb_Arena * arena,size_t * len)2596 UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options,
2597                                  upb_Arena* arena, size_t* len) {
2598   return upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, options, arena, len);
2599 }
google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto * msg)2600 UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
2601   return _upb_hasbit(msg, 1);
2602 }
google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto * msg)2603 UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) {
2604   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
2605   _upb_clearhas(msg, 1);
2606 }
google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto * msg)2607 UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
2608   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
2609 }
google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto * msg)2610 UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
2611   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
2612 }
google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto * msg)2613 UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) {
2614   _upb_array_detach(msg, UPB_SIZE(12, 24));
2615 }
google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto * msg,size_t * len)2616 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto* msg, size_t* len) {
2617   return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
2618 }
google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto * msg)2619 UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
2620   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
2621 }
google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto * msg)2622 UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) {
2623   _upb_array_detach(msg, UPB_SIZE(16, 32));
2624 }
google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto * msg,size_t * len)2625 UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
2626   return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
2627 }
google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto * msg)2628 UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
2629   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
2630 }
google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto * msg)2631 UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) {
2632   _upb_array_detach(msg, UPB_SIZE(20, 40));
2633 }
google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto * msg,size_t * len)2634 UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto* msg, size_t* len) {
2635   return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
2636 }
google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto * msg)2637 UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
2638   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
2639 }
google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto * msg)2640 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) {
2641   _upb_array_detach(msg, UPB_SIZE(24, 48));
2642 }
google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto * msg,size_t * len)2643 UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
2644   return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
2645 }
google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto * msg)2646 UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
2647   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
2648 }
google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto * msg)2649 UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) {
2650   _upb_array_detach(msg, UPB_SIZE(28, 56));
2651 }
google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto * msg,size_t * len)2652 UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto* msg, size_t* len) {
2653   return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
2654 }
google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto * msg)2655 UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
2656   return _upb_hasbit(msg, 2);
2657 }
google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto * msg)2658 UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) {
2659   *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
2660 }
google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto * msg)2661 UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
2662   return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_MessageOptions*);
2663 }
google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto * msg)2664 UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto* msg) {
2665   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72));
2666 }
google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto * msg)2667 UPB_INLINE void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) {
2668   _upb_array_detach(msg, UPB_SIZE(36, 72));
2669 }
google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto * msg,size_t * len)2670 UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto* msg, size_t* len) {
2671   return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
2672 }
google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto * msg)2673 UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto* msg) {
2674   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80));
2675 }
google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto * msg)2676 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) {
2677   _upb_array_detach(msg, UPB_SIZE(40, 80));
2678 }
google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto * msg,size_t * len)2679 UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto* msg, size_t* len) {
2680   return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len);
2681 }
google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto * msg)2682 UPB_INLINE void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) {
2683   _upb_array_detach(msg, UPB_SIZE(44, 88));
2684 }
google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto * msg,size_t * len)2685 UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) {
2686   return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len);
2687 }
2688 
google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto * msg,upb_StringView value)2689 UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView value) {
2690   _upb_sethas(msg, 1);
2691   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
2692 }
google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto * msg,size_t * len)2693 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto* msg, size_t* len) {
2694   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
2695 }
google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2696 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2697   return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
2698 }
google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2699 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2700   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2701   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
2702   if (!ok) return NULL;
2703   return sub;
2704 }
google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto * msg,size_t * len)2705 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* len) {
2706   return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
2707 }
google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2708 UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2709   return (google_protobuf_DescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
2710 }
google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2711 UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2712   struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
2713   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
2714   if (!ok) return NULL;
2715   return sub;
2716 }
google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto * msg,size_t * len)2717 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* len) {
2718   return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
2719 }
google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2720 UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2721   return (google_protobuf_EnumDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
2722 }
google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2723 UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2724   struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
2725   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
2726   if (!ok) return NULL;
2727   return sub;
2728 }
google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto * msg,size_t * len)2729 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* len) {
2730   return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
2731 }
google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2732 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2733   return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
2734 }
google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2735 UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2736   struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
2737   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
2738   if (!ok) return NULL;
2739   return sub;
2740 }
google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto * msg,size_t * len)2741 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* len) {
2742   return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
2743 }
google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2744 UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2745   return (google_protobuf_FieldDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
2746 }
google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2747 UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2748   struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
2749   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
2750   if (!ok) return NULL;
2751   return sub;
2752 }
google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto * msg,google_protobuf_MessageOptions * value)2753 UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
2754   _upb_sethas(msg, 2);
2755   *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_MessageOptions*) = value;
2756 }
google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2757 UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2758   struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
2759   if (sub == NULL) {
2760     sub = (struct google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msginit, arena);
2761     if (!sub) return NULL;
2762     google_protobuf_DescriptorProto_set_options(msg, sub);
2763   }
2764   return sub;
2765 }
google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto * msg,size_t * len)2766 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* len) {
2767   return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
2768 }
google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2769 UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2770   return (google_protobuf_OneofDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
2771 }
google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2772 UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2773   struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena);
2774   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
2775   if (!ok) return NULL;
2776   return sub;
2777 }
google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto * msg,size_t * len)2778 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* len) {
2779   return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
2780 }
google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2781 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2782   return (google_protobuf_DescriptorProto_ReservedRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena);
2783 }
google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto * msg,upb_Arena * arena)2784 UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) {
2785   struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
2786   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena);
2787   if (!ok) return NULL;
2788   return sub;
2789 }
google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto * msg,size_t * len)2790 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* len) {
2791   return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
2792 }
google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto * msg,size_t len,upb_Arena * arena)2793 UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
2794   return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
2795 }
google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto * msg,upb_StringView val,upb_Arena * arena)2796 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
2797   return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val, arena);
2798 }
2799 
2800 /* google.protobuf.DescriptorProto.ExtensionRange */
2801 
google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena * arena)2802 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) {
2803   return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
2804 }
google_protobuf_DescriptorProto_ExtensionRange_parse(const char * buf,size_t size,upb_Arena * arena)2805 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) {
2806   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
2807   if (!ret) return NULL;
2808   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2809     return NULL;
2810   }
2811   return ret;
2812 }
google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2813 UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size,
2814                            const upb_ExtensionRegistry* extreg,
2815                            int options, upb_Arena* arena) {
2816   google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
2817   if (!ret) return NULL;
2818   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, extreg, options, arena) !=
2819       kUpb_DecodeStatus_Ok) {
2820     return NULL;
2821   }
2822   return ret;
2823 }
google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena,size_t * len)2824 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) {
2825   return upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, 0, arena, len);
2826 }
google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange * msg,int options,upb_Arena * arena,size_t * len)2827 UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options,
2828                                  upb_Arena* arena, size_t* len) {
2829   return upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, options, arena, len);
2830 }
google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)2831 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2832   return _upb_hasbit(msg, 1);
2833 }
google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)2834 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2835   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
2836   _upb_clearhas(msg, 1);
2837 }
google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange * msg)2838 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2839   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
2840 }
google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)2841 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2842   return _upb_hasbit(msg, 2);
2843 }
google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)2844 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2845   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
2846   _upb_clearhas(msg, 2);
2847 }
google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange * msg)2848 UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2849   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
2850 }
google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)2851 UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2852   return _upb_hasbit(msg, 3);
2853 }
google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)2854 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2855   *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
2856 }
google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange * msg)2857 UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
2858   return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*);
2859 }
2860 
google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)2861 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
2862   _upb_sethas(msg, 1);
2863   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
2864 }
google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange * msg,int32_t value)2865 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
2866   _upb_sethas(msg, 2);
2867   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2868 }
google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange * msg,google_protobuf_ExtensionRangeOptions * value)2869 UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
2870   _upb_sethas(msg, 3);
2871   *UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value;
2872 }
google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange * msg,upb_Arena * arena)2873 UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena) {
2874   struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
2875   if (sub == NULL) {
2876     sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena);
2877     if (!sub) return NULL;
2878     google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
2879   }
2880   return sub;
2881 }
2882 
2883 /* google.protobuf.DescriptorProto.ReservedRange */
2884 
google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena * arena)2885 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) {
2886   return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
2887 }
google_protobuf_DescriptorProto_ReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)2888 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
2889   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
2890   if (!ret) return NULL;
2891   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2892     return NULL;
2893   }
2894   return ret;
2895 }
google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2896 UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size,
2897                            const upb_ExtensionRegistry* extreg,
2898                            int options, upb_Arena* arena) {
2899   google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
2900   if (!ret) return NULL;
2901   if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, extreg, options, arena) !=
2902       kUpb_DecodeStatus_Ok) {
2903     return NULL;
2904   }
2905   return ret;
2906 }
google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange * msg,upb_Arena * arena,size_t * len)2907 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) {
2908   return upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, 0, arena, len);
2909 }
google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange * msg,int options,upb_Arena * arena,size_t * len)2910 UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options,
2911                                  upb_Arena* arena, size_t* len) {
2912   return upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, options, arena, len);
2913 }
google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange * msg)2914 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2915   return _upb_hasbit(msg, 1);
2916 }
google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange * msg)2917 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2918   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
2919   _upb_clearhas(msg, 1);
2920 }
google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange * msg)2921 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2922   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
2923 }
google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange * msg)2924 UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2925   return _upb_hasbit(msg, 2);
2926 }
google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange * msg)2927 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2928   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
2929   _upb_clearhas(msg, 2);
2930 }
google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange * msg)2931 UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
2932   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
2933 }
2934 
google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)2935 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
2936   _upb_sethas(msg, 1);
2937   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
2938 }
google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange * msg,int32_t value)2939 UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
2940   _upb_sethas(msg, 2);
2941   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
2942 }
2943 
2944 /* google.protobuf.ExtensionRangeOptions */
2945 
google_protobuf_ExtensionRangeOptions_new(upb_Arena * arena)2946 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) {
2947   return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena);
2948 }
google_protobuf_ExtensionRangeOptions_parse(const char * buf,size_t size,upb_Arena * arena)2949 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
2950   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
2951   if (!ret) return NULL;
2952   if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
2953     return NULL;
2954   }
2955   return ret;
2956 }
google_protobuf_ExtensionRangeOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)2957 UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size,
2958                            const upb_ExtensionRegistry* extreg,
2959                            int options, upb_Arena* arena) {
2960   google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
2961   if (!ret) return NULL;
2962   if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, extreg, options, arena) !=
2963       kUpb_DecodeStatus_Ok) {
2964     return NULL;
2965   }
2966   return ret;
2967 }
google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena,size_t * len)2968 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) {
2969   return upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, 0, arena, len);
2970 }
google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions * msg,int options,upb_Arena * arena,size_t * len)2971 UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options,
2972                                  upb_Arena* arena, size_t* len) {
2973   return upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, options, arena, len);
2974 }
google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg)2975 UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
2976   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
2977 }
google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg)2978 UPB_INLINE void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
2979   _upb_array_detach(msg, UPB_SIZE(0, 0));
2980 }
google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions * msg,size_t * len)2981 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
2982   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
2983 }
2984 
google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t * len)2985 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t* len) {
2986   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
2987 }
google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,size_t len,upb_Arena * arena)2988 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, size_t len, upb_Arena* arena) {
2989   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
2990 }
google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions * msg,upb_Arena * arena)2991 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) {
2992   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
2993   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
2994   if (!ok) return NULL;
2995   return sub;
2996 }
2997 
2998 /* google.protobuf.FieldDescriptorProto */
2999 
google_protobuf_FieldDescriptorProto_new(upb_Arena * arena)3000 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) {
3001   return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
3002 }
google_protobuf_FieldDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3003 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3004   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
3005   if (!ret) return NULL;
3006   if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3007     return NULL;
3008   }
3009   return ret;
3010 }
google_protobuf_FieldDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3011 UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size,
3012                            const upb_ExtensionRegistry* extreg,
3013                            int options, upb_Arena* arena) {
3014   google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
3015   if (!ret) return NULL;
3016   if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, extreg, options, arena) !=
3017       kUpb_DecodeStatus_Ok) {
3018     return NULL;
3019   }
3020   return ret;
3021 }
google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena,size_t * len)3022 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3023   return upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, 0, arena, len);
3024 }
google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3025 UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options,
3026                                  upb_Arena* arena, size_t* len) {
3027   return upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, options, arena, len);
3028 }
google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto * msg)3029 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
3030   return _upb_hasbit(msg, 1);
3031 }
google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto * msg)3032 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) {
3033   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3034   _upb_clearhas(msg, 1);
3035 }
google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto * msg)3036 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
3037   return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView);
3038 }
google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto * msg)3039 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3040   return _upb_hasbit(msg, 2);
3041 }
google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto * msg)3042 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3043   *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3044   _upb_clearhas(msg, 2);
3045 }
google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto * msg)3046 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
3047   return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView);
3048 }
google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto * msg)3049 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
3050   return _upb_hasbit(msg, 3);
3051 }
google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto * msg)3052 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) {
3053   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3054   _upb_clearhas(msg, 3);
3055 }
google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto * msg)3056 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
3057   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3058 }
google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto * msg)3059 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
3060   return _upb_hasbit(msg, 4);
3061 }
google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto * msg)3062 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) {
3063   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
3064   _upb_clearhas(msg, 4);
3065 }
google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto * msg)3066 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
3067   return google_protobuf_FieldDescriptorProto_has_label(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) : 1;
3068 }
google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto * msg)3069 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
3070   return _upb_hasbit(msg, 5);
3071 }
google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto * msg)3072 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) {
3073   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
3074   _upb_clearhas(msg, 5);
3075 }
google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto * msg)3076 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
3077   return google_protobuf_FieldDescriptorProto_has_type(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) : 1;
3078 }
google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto * msg)3079 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3080   return _upb_hasbit(msg, 6);
3081 }
google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto * msg)3082 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3083   *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3084   _upb_clearhas(msg, 6);
3085 }
google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto * msg)3086 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
3087   return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView);
3088 }
google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto * msg)3089 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3090   return _upb_hasbit(msg, 7);
3091 }
google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto * msg)3092 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3093   *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3094   _upb_clearhas(msg, 7);
3095 }
google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto * msg)3096 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
3097   return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView);
3098 }
google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto * msg)3099 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
3100   return _upb_hasbit(msg, 8);
3101 }
google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto * msg)3102 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) {
3103   *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL;
3104 }
google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto * msg)3105 UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
3106   return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const google_protobuf_FieldOptions*);
3107 }
google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto * msg)3108 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3109   return _upb_hasbit(msg, 9);
3110 }
google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto * msg)3111 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3112   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
3113   _upb_clearhas(msg, 9);
3114 }
google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto * msg)3115 UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
3116   return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t);
3117 }
google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto * msg)3118 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3119   return _upb_hasbit(msg, 10);
3120 }
google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto * msg)3121 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3122   *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3123   _upb_clearhas(msg, 10);
3124 }
google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto * msg)3125 UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
3126   return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView);
3127 }
google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)3128 UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3129   return _upb_hasbit(msg, 11);
3130 }
google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)3131 UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3132   *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
3133   _upb_clearhas(msg, 11);
3134 }
google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto * msg)3135 UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
3136   return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool);
3137 }
3138 
google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)3139 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3140   _upb_sethas(msg, 1);
3141   *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = value;
3142 }
google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)3143 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3144   _upb_sethas(msg, 2);
3145   *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = value;
3146 }
google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto * msg,int32_t value)3147 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3148   _upb_sethas(msg, 3);
3149   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3150 }
google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto * msg,int32_t value)3151 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3152   _upb_sethas(msg, 4);
3153   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
3154 }
google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto * msg,int32_t value)3155 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3156   _upb_sethas(msg, 5);
3157   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
3158 }
google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)3159 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3160   _upb_sethas(msg, 6);
3161   *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = value;
3162 }
google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)3163 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3164   _upb_sethas(msg, 7);
3165   *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = value;
3166 }
google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto * msg,google_protobuf_FieldOptions * value)3167 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
3168   _upb_sethas(msg, 8);
3169   *UPB_PTR_AT(msg, UPB_SIZE(56, 88), google_protobuf_FieldOptions*) = value;
3170 }
google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto * msg,upb_Arena * arena)3171 UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena) {
3172   struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
3173   if (sub == NULL) {
3174     sub = (struct google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msginit, arena);
3175     if (!sub) return NULL;
3176     google_protobuf_FieldDescriptorProto_set_options(msg, sub);
3177   }
3178   return sub;
3179 }
google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto * msg,int32_t value)3180 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
3181   _upb_sethas(msg, 9);
3182   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
3183 }
google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto * msg,upb_StringView value)3184 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
3185   _upb_sethas(msg, 10);
3186   *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = value;
3187 }
google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto * msg,bool value)3188 UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
3189   _upb_sethas(msg, 11);
3190   *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
3191 }
3192 
3193 /* google.protobuf.OneofDescriptorProto */
3194 
google_protobuf_OneofDescriptorProto_new(upb_Arena * arena)3195 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) {
3196   return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena);
3197 }
google_protobuf_OneofDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3198 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3199   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
3200   if (!ret) return NULL;
3201   if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3202     return NULL;
3203   }
3204   return ret;
3205 }
google_protobuf_OneofDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3206 UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size,
3207                            const upb_ExtensionRegistry* extreg,
3208                            int options, upb_Arena* arena) {
3209   google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
3210   if (!ret) return NULL;
3211   if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, extreg, options, arena) !=
3212       kUpb_DecodeStatus_Ok) {
3213     return NULL;
3214   }
3215   return ret;
3216 }
google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena,size_t * len)3217 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3218   return upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, 0, arena, len);
3219 }
google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3220 UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options,
3221                                  upb_Arena* arena, size_t* len) {
3222   return upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, options, arena, len);
3223 }
google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto * msg)3224 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
3225   return _upb_hasbit(msg, 1);
3226 }
google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto * msg)3227 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) {
3228   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3229   _upb_clearhas(msg, 1);
3230 }
google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto * msg)3231 UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
3232   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3233 }
google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto * msg)3234 UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
3235   return _upb_hasbit(msg, 2);
3236 }
google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto * msg)3237 UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) {
3238   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
3239 }
google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto * msg)3240 UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto* msg) {
3241   return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*);
3242 }
3243 
google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto * msg,upb_StringView value)3244 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView value) {
3245   _upb_sethas(msg, 1);
3246   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3247 }
google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto * msg,google_protobuf_OneofOptions * value)3248 UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
3249   _upb_sethas(msg, 2);
3250   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value;
3251 }
google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto * msg,upb_Arena * arena)3252 UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena) {
3253   struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
3254   if (sub == NULL) {
3255     sub = (struct google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msginit, arena);
3256     if (!sub) return NULL;
3257     google_protobuf_OneofDescriptorProto_set_options(msg, sub);
3258   }
3259   return sub;
3260 }
3261 
3262 /* google.protobuf.EnumDescriptorProto */
3263 
google_protobuf_EnumDescriptorProto_new(upb_Arena * arena)3264 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) {
3265   return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
3266 }
google_protobuf_EnumDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3267 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3268   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
3269   if (!ret) return NULL;
3270   if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3271     return NULL;
3272   }
3273   return ret;
3274 }
google_protobuf_EnumDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3275 UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size,
3276                            const upb_ExtensionRegistry* extreg,
3277                            int options, upb_Arena* arena) {
3278   google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
3279   if (!ret) return NULL;
3280   if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, extreg, options, arena) !=
3281       kUpb_DecodeStatus_Ok) {
3282     return NULL;
3283   }
3284   return ret;
3285 }
google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena,size_t * len)3286 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3287   return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, 0, arena, len);
3288 }
google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3289 UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options,
3290                                  upb_Arena* arena, size_t* len) {
3291   return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, options, arena, len);
3292 }
google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto * msg)3293 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
3294   return _upb_hasbit(msg, 1);
3295 }
google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto * msg)3296 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) {
3297   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3298   _upb_clearhas(msg, 1);
3299 }
google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto * msg)3300 UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
3301   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3302 }
google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto * msg)3303 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
3304   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
3305 }
google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto * msg)3306 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) {
3307   _upb_array_detach(msg, UPB_SIZE(12, 24));
3308 }
google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto * msg,size_t * len)3309 UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3310   return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
3311 }
google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto * msg)3312 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
3313   return _upb_hasbit(msg, 2);
3314 }
google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto * msg)3315 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) {
3316   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
3317 }
google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto * msg)3318 UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
3319   return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_EnumOptions*);
3320 }
google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto * msg)3321 UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
3322   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
3323 }
google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto * msg)3324 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
3325   _upb_array_detach(msg, UPB_SIZE(20, 40));
3326 }
google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto * msg,size_t * len)3327 UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3328   return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
3329 }
google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto * msg)3330 UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
3331   _upb_array_detach(msg, UPB_SIZE(24, 48));
3332 }
google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto * msg,size_t * len)3333 UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3334   return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
3335 }
3336 
google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView value)3337 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView value) {
3338   _upb_sethas(msg, 1);
3339   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3340 }
google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto * msg,size_t * len)3341 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3342   return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
3343 }
google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_Arena * arena)3344 UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) {
3345   return (google_protobuf_EnumValueDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
3346 }
google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)3347 UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
3348   struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
3349   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
3350   if (!ok) return NULL;
3351   return sub;
3352 }
google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto * msg,google_protobuf_EnumOptions * value)3353 UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
3354   _upb_sethas(msg, 2);
3355   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_EnumOptions*) = value;
3356 }
google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)3357 UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
3358   struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
3359   if (sub == NULL) {
3360     sub = (struct google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msginit, arena);
3361     if (!sub) return NULL;
3362     google_protobuf_EnumDescriptorProto_set_options(msg, sub);
3363   }
3364   return sub;
3365 }
google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t * len)3366 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3367   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
3368 }
google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_Arena * arena)3369 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) {
3370   return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
3371 }
google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto * msg,upb_Arena * arena)3372 UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) {
3373   struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
3374   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
3375   if (!ok) return NULL;
3376   return sub;
3377 }
google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t * len)3378 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
3379   return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
3380 }
google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto * msg,size_t len,upb_Arena * arena)3381 UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) {
3382   return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
3383 }
google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto * msg,upb_StringView val,upb_Arena * arena)3384 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
3385   return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena);
3386 }
3387 
3388 /* google.protobuf.EnumDescriptorProto.EnumReservedRange */
3389 
google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena * arena)3390 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) {
3391   return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
3392 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char * buf,size_t size,upb_Arena * arena)3393 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
3394   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
3395   if (!ret) return NULL;
3396   if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3397     return NULL;
3398   }
3399   return ret;
3400 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3401 UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size,
3402                            const upb_ExtensionRegistry* extreg,
3403                            int options, upb_Arena* arena) {
3404   google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
3405   if (!ret) return NULL;
3406   if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, extreg, options, arena) !=
3407       kUpb_DecodeStatus_Ok) {
3408     return NULL;
3409   }
3410   return ret;
3411 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,upb_Arena * arena,size_t * len)3412 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) {
3413   return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, 0, arena, len);
3414 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int options,upb_Arena * arena,size_t * len)3415 UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options,
3416                                  upb_Arena* arena, size_t* len) {
3417   return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, options, arena, len);
3418 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3419 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3420   return _upb_hasbit(msg, 1);
3421 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3422 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3423   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3424   _upb_clearhas(msg, 1);
3425 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3426 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3427   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3428 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3429 UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3430   return _upb_hasbit(msg, 2);
3431 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3432 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3433   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
3434   _upb_clearhas(msg, 2);
3435 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange * msg)3436 UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
3437   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
3438 }
3439 
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)3440 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
3441   _upb_sethas(msg, 1);
3442   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3443 }
google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange * msg,int32_t value)3444 UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
3445   _upb_sethas(msg, 2);
3446   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
3447 }
3448 
3449 /* google.protobuf.EnumValueDescriptorProto */
3450 
google_protobuf_EnumValueDescriptorProto_new(upb_Arena * arena)3451 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) {
3452   return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
3453 }
google_protobuf_EnumValueDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3454 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3455   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
3456   if (!ret) return NULL;
3457   if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3458     return NULL;
3459   }
3460   return ret;
3461 }
google_protobuf_EnumValueDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3462 UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size,
3463                            const upb_ExtensionRegistry* extreg,
3464                            int options, upb_Arena* arena) {
3465   google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
3466   if (!ret) return NULL;
3467   if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, extreg, options, arena) !=
3468       kUpb_DecodeStatus_Ok) {
3469     return NULL;
3470   }
3471   return ret;
3472 }
google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena,size_t * len)3473 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3474   return upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, 0, arena, len);
3475 }
google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3476 UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options,
3477                                  upb_Arena* arena, size_t* len) {
3478   return upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, options, arena, len);
3479 }
google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto * msg)3480 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3481   return _upb_hasbit(msg, 1);
3482 }
google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto * msg)3483 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3484   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3485   _upb_clearhas(msg, 1);
3486 }
google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto * msg)3487 UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
3488   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
3489 }
google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto * msg)3490 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3491   return _upb_hasbit(msg, 2);
3492 }
google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto * msg)3493 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3494   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3495   _upb_clearhas(msg, 2);
3496 }
google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto * msg)3497 UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto* msg) {
3498   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
3499 }
google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto * msg)3500 UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3501   return _upb_hasbit(msg, 3);
3502 }
google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto * msg)3503 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3504   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
3505 }
google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto * msg)3506 UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto* msg) {
3507   return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*);
3508 }
3509 
google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto * msg,upb_StringView value)3510 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
3511   _upb_sethas(msg, 1);
3512   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
3513 }
google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto * msg,int32_t value)3514 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
3515   _upb_sethas(msg, 2);
3516   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3517 }
google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto * msg,google_protobuf_EnumValueOptions * value)3518 UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
3519   _upb_sethas(msg, 3);
3520   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value;
3521 }
google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto * msg,upb_Arena * arena)3522 UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena) {
3523   struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
3524   if (sub == NULL) {
3525     sub = (struct google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msginit, arena);
3526     if (!sub) return NULL;
3527     google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
3528   }
3529   return sub;
3530 }
3531 
3532 /* google.protobuf.ServiceDescriptorProto */
3533 
google_protobuf_ServiceDescriptorProto_new(upb_Arena * arena)3534 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) {
3535   return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena);
3536 }
google_protobuf_ServiceDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3537 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3538   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
3539   if (!ret) return NULL;
3540   if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3541     return NULL;
3542   }
3543   return ret;
3544 }
google_protobuf_ServiceDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3545 UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size,
3546                            const upb_ExtensionRegistry* extreg,
3547                            int options, upb_Arena* arena) {
3548   google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
3549   if (!ret) return NULL;
3550   if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, extreg, options, arena) !=
3551       kUpb_DecodeStatus_Ok) {
3552     return NULL;
3553   }
3554   return ret;
3555 }
google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena,size_t * len)3556 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3557   return upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, 0, arena, len);
3558 }
google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3559 UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options,
3560                                  upb_Arena* arena, size_t* len) {
3561   return upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, options, arena, len);
3562 }
google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto * msg)3563 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
3564   return _upb_hasbit(msg, 1);
3565 }
google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto * msg)3566 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) {
3567   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3568   _upb_clearhas(msg, 1);
3569 }
google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto * msg)3570 UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
3571   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3572 }
google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto * msg)3573 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
3574   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
3575 }
google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto * msg)3576 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) {
3577   _upb_array_detach(msg, UPB_SIZE(12, 24));
3578 }
google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto * msg,size_t * len)3579 UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
3580   return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
3581 }
google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto * msg)3582 UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
3583   return _upb_hasbit(msg, 2);
3584 }
google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto * msg)3585 UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) {
3586   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
3587 }
google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto * msg)3588 UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
3589   return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_ServiceOptions*);
3590 }
3591 
google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto * msg,upb_StringView value)3592 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView value) {
3593   _upb_sethas(msg, 1);
3594   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3595 }
google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto * msg,size_t * len)3596 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
3597   return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
3598 }
google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto * msg,size_t len,upb_Arena * arena)3599 UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto* msg, size_t len, upb_Arena* arena) {
3600   return (google_protobuf_MethodDescriptorProto**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
3601 }
google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)3602 UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
3603   struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena);
3604   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
3605   if (!ok) return NULL;
3606   return sub;
3607 }
google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto * msg,google_protobuf_ServiceOptions * value)3608 UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
3609   _upb_sethas(msg, 2);
3610   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_protobuf_ServiceOptions*) = value;
3611 }
google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto * msg,upb_Arena * arena)3612 UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) {
3613   struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
3614   if (sub == NULL) {
3615     sub = (struct google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msginit, arena);
3616     if (!sub) return NULL;
3617     google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
3618   }
3619   return sub;
3620 }
3621 
3622 /* google.protobuf.MethodDescriptorProto */
3623 
google_protobuf_MethodDescriptorProto_new(upb_Arena * arena)3624 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) {
3625   return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena);
3626 }
google_protobuf_MethodDescriptorProto_parse(const char * buf,size_t size,upb_Arena * arena)3627 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
3628   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
3629   if (!ret) return NULL;
3630   if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3631     return NULL;
3632   }
3633   return ret;
3634 }
google_protobuf_MethodDescriptorProto_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3635 UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size,
3636                            const upb_ExtensionRegistry* extreg,
3637                            int options, upb_Arena* arena) {
3638   google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
3639   if (!ret) return NULL;
3640   if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, extreg, options, arena) !=
3641       kUpb_DecodeStatus_Ok) {
3642     return NULL;
3643   }
3644   return ret;
3645 }
google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena,size_t * len)3646 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) {
3647   return upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, 0, arena, len);
3648 }
google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto * msg,int options,upb_Arena * arena,size_t * len)3649 UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options,
3650                                  upb_Arena* arena, size_t* len) {
3651   return upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, options, arena, len);
3652 }
google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto * msg)3653 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
3654   return _upb_hasbit(msg, 1);
3655 }
google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto * msg)3656 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) {
3657   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3658   _upb_clearhas(msg, 1);
3659 }
google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto * msg)3660 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
3661   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
3662 }
google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto * msg)3663 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3664   return _upb_hasbit(msg, 2);
3665 }
google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto * msg)3666 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3667   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3668   _upb_clearhas(msg, 2);
3669 }
google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto * msg)3670 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
3671   return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
3672 }
google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto * msg)3673 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3674   return _upb_hasbit(msg, 3);
3675 }
google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto * msg)3676 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3677   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3678   _upb_clearhas(msg, 3);
3679 }
google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto * msg)3680 UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
3681   return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
3682 }
google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto * msg)3683 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
3684   return _upb_hasbit(msg, 4);
3685 }
google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto * msg)3686 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) {
3687   *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
3688 }
google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto * msg)3689 UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto* msg) {
3690   return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*);
3691 }
google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto * msg)3692 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3693   return _upb_hasbit(msg, 5);
3694 }
google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto * msg)3695 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3696   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
3697   _upb_clearhas(msg, 5);
3698 }
google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto * msg)3699 UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3700   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
3701 }
google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto * msg)3702 UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3703   return _upb_hasbit(msg, 6);
3704 }
google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto * msg)3705 UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3706   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
3707   _upb_clearhas(msg, 6);
3708 }
google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto * msg)3709 UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
3710   return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
3711 }
3712 
google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)3713 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
3714   _upb_sethas(msg, 1);
3715   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
3716 }
google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)3717 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
3718   _upb_sethas(msg, 2);
3719   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
3720 }
google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto * msg,upb_StringView value)3721 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView value) {
3722   _upb_sethas(msg, 3);
3723   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
3724 }
google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto * msg,google_protobuf_MethodOptions * value)3725 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
3726   _upb_sethas(msg, 4);
3727   *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
3728 }
google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto * msg,upb_Arena * arena)3729 UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena) {
3730   struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
3731   if (sub == NULL) {
3732     sub = (struct google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msginit, arena);
3733     if (!sub) return NULL;
3734     google_protobuf_MethodDescriptorProto_set_options(msg, sub);
3735   }
3736   return sub;
3737 }
google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)3738 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
3739   _upb_sethas(msg, 5);
3740   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
3741 }
google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto * msg,bool value)3742 UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
3743   _upb_sethas(msg, 6);
3744   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
3745 }
3746 
3747 /* google.protobuf.FileOptions */
3748 
google_protobuf_FileOptions_new(upb_Arena * arena)3749 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) {
3750   return (google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msginit, arena);
3751 }
google_protobuf_FileOptions_parse(const char * buf,size_t size,upb_Arena * arena)3752 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
3753   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
3754   if (!ret) return NULL;
3755   if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
3756     return NULL;
3757   }
3758   return ret;
3759 }
google_protobuf_FileOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)3760 UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size,
3761                            const upb_ExtensionRegistry* extreg,
3762                            int options, upb_Arena* arena) {
3763   google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
3764   if (!ret) return NULL;
3765   if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, extreg, options, arena) !=
3766       kUpb_DecodeStatus_Ok) {
3767     return NULL;
3768   }
3769   return ret;
3770 }
google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions * msg,upb_Arena * arena,size_t * len)3771 UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) {
3772   return upb_Encode(msg, &google_protobuf_FileOptions_msginit, 0, arena, len);
3773 }
google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions * msg,int options,upb_Arena * arena,size_t * len)3774 UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options,
3775                                  upb_Arena* arena, size_t* len) {
3776   return upb_Encode(msg, &google_protobuf_FileOptions_msginit, options, arena, len);
3777 }
google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions * msg)3778 UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
3779   return _upb_hasbit(msg, 1);
3780 }
google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions * msg)3781 UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) {
3782   *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3783   _upb_clearhas(msg, 1);
3784 }
google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions * msg)3785 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
3786   return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView);
3787 }
google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions * msg)3788 UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
3789   return _upb_hasbit(msg, 2);
3790 }
google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions * msg)3791 UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) {
3792   *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3793   _upb_clearhas(msg, 2);
3794 }
google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions * msg)3795 UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
3796   return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView);
3797 }
google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions * msg)3798 UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
3799   return _upb_hasbit(msg, 3);
3800 }
google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions * msg)3801 UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) {
3802   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
3803   _upb_clearhas(msg, 3);
3804 }
google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions * msg)3805 UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
3806   return google_protobuf_FileOptions_has_optimize_for(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) : 1;
3807 }
google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions * msg)3808 UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
3809   return _upb_hasbit(msg, 4);
3810 }
google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions * msg)3811 UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) {
3812   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
3813   _upb_clearhas(msg, 4);
3814 }
google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions * msg)3815 UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
3816   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
3817 }
google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions * msg)3818 UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
3819   return _upb_hasbit(msg, 5);
3820 }
google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions * msg)3821 UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) {
3822   *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3823   _upb_clearhas(msg, 5);
3824 }
google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions * msg)3825 UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
3826   return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView);
3827 }
google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions * msg)3828 UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
3829   return _upb_hasbit(msg, 6);
3830 }
google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions * msg)3831 UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) {
3832   *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
3833   _upb_clearhas(msg, 6);
3834 }
google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions * msg)3835 UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
3836   return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
3837 }
google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions * msg)3838 UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
3839   return _upb_hasbit(msg, 7);
3840 }
google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions * msg)3841 UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) {
3842   *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
3843   _upb_clearhas(msg, 7);
3844 }
google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions * msg)3845 UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
3846   return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
3847 }
google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions * msg)3848 UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
3849   return _upb_hasbit(msg, 8);
3850 }
google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions * msg)3851 UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) {
3852   *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0;
3853   _upb_clearhas(msg, 8);
3854 }
google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions * msg)3855 UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
3856   return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool);
3857 }
google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)3858 UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3859   return _upb_hasbit(msg, 9);
3860 }
google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)3861 UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3862   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
3863   _upb_clearhas(msg, 9);
3864 }
google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions * msg)3865 UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
3866   return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
3867 }
google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions * msg)3868 UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
3869   return _upb_hasbit(msg, 10);
3870 }
google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions * msg)3871 UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) {
3872   *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0;
3873   _upb_clearhas(msg, 10);
3874 }
google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions * msg)3875 UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
3876   return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool);
3877 }
google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions * msg)3878 UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3879   return _upb_hasbit(msg, 11);
3880 }
google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions * msg)3881 UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3882   *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = 0;
3883   _upb_clearhas(msg, 11);
3884 }
google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions * msg)3885 UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
3886   return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool);
3887 }
google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions * msg)3888 UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3889   return _upb_hasbit(msg, 12);
3890 }
google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions * msg)3891 UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3892   *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = 0;
3893   _upb_clearhas(msg, 12);
3894 }
google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions * msg)3895 UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
3896   return google_protobuf_FileOptions_has_cc_enable_arenas(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) : true;
3897 }
google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions * msg)3898 UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3899   return _upb_hasbit(msg, 13);
3900 }
google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions * msg)3901 UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3902   *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3903   _upb_clearhas(msg, 13);
3904 }
google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions * msg)3905 UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
3906   return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView);
3907 }
google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions * msg)3908 UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
3909   return _upb_hasbit(msg, 14);
3910 }
google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions * msg)3911 UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) {
3912   *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3913   _upb_clearhas(msg, 14);
3914 }
google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions * msg)3915 UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
3916   return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView);
3917 }
google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions * msg)3918 UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
3919   return _upb_hasbit(msg, 15);
3920 }
google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions * msg)3921 UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) {
3922   *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3923   _upb_clearhas(msg, 15);
3924 }
google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions * msg)3925 UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
3926   return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView);
3927 }
google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions * msg)3928 UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
3929   return _upb_hasbit(msg, 16);
3930 }
google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions * msg)3931 UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) {
3932   *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3933   _upb_clearhas(msg, 16);
3934 }
google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions * msg)3935 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
3936   return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView);
3937 }
google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions * msg)3938 UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
3939   return _upb_hasbit(msg, 17);
3940 }
google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions * msg)3941 UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) {
3942   *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3943   _upb_clearhas(msg, 17);
3944 }
google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions * msg)3945 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
3946   return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView);
3947 }
google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions * msg)3948 UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
3949   return _upb_hasbit(msg, 18);
3950 }
google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions * msg)3951 UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) {
3952   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
3953   _upb_clearhas(msg, 18);
3954 }
google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions * msg)3955 UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) {
3956   return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
3957 }
google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions * msg)3958 UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3959   return _upb_hasbit(msg, 19);
3960 }
google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions * msg)3961 UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3962   *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3963   _upb_clearhas(msg, 19);
3964 }
google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions * msg)3965 UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
3966   return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView);
3967 }
google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions * msg)3968 UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
3969   return _upb_hasbit(msg, 20);
3970 }
google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions * msg)3971 UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) {
3972   *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
3973   _upb_clearhas(msg, 20);
3974 }
google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions * msg)3975 UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
3976   return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView);
3977 }
google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions * msg)3978 UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
3979   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184));
3980 }
google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions * msg)3981 UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) {
3982   _upb_array_detach(msg, UPB_SIZE(100, 184));
3983 }
google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions * msg,size_t * len)3984 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions* msg, size_t* len) {
3985   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len);
3986 }
3987 
google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions * msg,upb_StringView value)3988 UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
3989   _upb_sethas(msg, 1);
3990   *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = value;
3991 }
google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions * msg,upb_StringView value)3992 UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
3993   _upb_sethas(msg, 2);
3994   *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = value;
3995 }
google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions * msg,int32_t value)3996 UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
3997   _upb_sethas(msg, 3);
3998   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
3999 }
google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions * msg,bool value)4000 UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
4001   _upb_sethas(msg, 4);
4002   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
4003 }
google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions * msg,upb_StringView value)4004 UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
4005   _upb_sethas(msg, 5);
4006   *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = value;
4007 }
google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions * msg,bool value)4008 UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
4009   _upb_sethas(msg, 6);
4010   *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
4011 }
google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions * msg,bool value)4012 UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
4013   _upb_sethas(msg, 7);
4014   *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
4015 }
google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions * msg,bool value)4016 UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
4017   _upb_sethas(msg, 8);
4018   *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
4019 }
google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions * msg,bool value)4020 UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
4021   _upb_sethas(msg, 9);
4022   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
4023 }
google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions * msg,bool value)4024 UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
4025   _upb_sethas(msg, 10);
4026   *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
4027 }
google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions * msg,bool value)4028 UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
4029   _upb_sethas(msg, 11);
4030   *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
4031 }
google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions * msg,bool value)4032 UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
4033   _upb_sethas(msg, 12);
4034   *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value;
4035 }
google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)4036 UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
4037   _upb_sethas(msg, 13);
4038   *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = value;
4039 }
google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions * msg,upb_StringView value)4040 UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
4041   _upb_sethas(msg, 14);
4042   *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = value;
4043 }
google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions * msg,upb_StringView value)4044 UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
4045   _upb_sethas(msg, 15);
4046   *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = value;
4047 }
google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions * msg,upb_StringView value)4048 UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
4049   _upb_sethas(msg, 16);
4050   *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = value;
4051 }
google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions * msg,upb_StringView value)4052 UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
4053   _upb_sethas(msg, 17);
4054   *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = value;
4055 }
google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions * msg,bool value)4056 UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
4057   _upb_sethas(msg, 18);
4058   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
4059 }
google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions * msg,upb_StringView value)4060 UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
4061   _upb_sethas(msg, 19);
4062   *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = value;
4063 }
google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions * msg,upb_StringView value)4064 UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
4065   _upb_sethas(msg, 20);
4066   *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = value;
4067 }
google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions * msg,size_t * len)4068 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions* msg, size_t* len) {
4069   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 184), len);
4070 }
google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions * msg,size_t len,upb_Arena * arena)4071 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions* msg, size_t len, upb_Arena* arena) {
4072   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena);
4073 }
google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions * msg,upb_Arena * arena)4074 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) {
4075   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4076   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena);
4077   if (!ok) return NULL;
4078   return sub;
4079 }
4080 
4081 /* google.protobuf.MessageOptions */
4082 
google_protobuf_MessageOptions_new(upb_Arena * arena)4083 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) {
4084   return (google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msginit, arena);
4085 }
google_protobuf_MessageOptions_parse(const char * buf,size_t size,upb_Arena * arena)4086 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4087   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
4088   if (!ret) return NULL;
4089   if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4090     return NULL;
4091   }
4092   return ret;
4093 }
google_protobuf_MessageOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4094 UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size,
4095                            const upb_ExtensionRegistry* extreg,
4096                            int options, upb_Arena* arena) {
4097   google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
4098   if (!ret) return NULL;
4099   if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, extreg, options, arena) !=
4100       kUpb_DecodeStatus_Ok) {
4101     return NULL;
4102   }
4103   return ret;
4104 }
google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions * msg,upb_Arena * arena,size_t * len)4105 UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) {
4106   return upb_Encode(msg, &google_protobuf_MessageOptions_msginit, 0, arena, len);
4107 }
google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions * msg,int options,upb_Arena * arena,size_t * len)4108 UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options,
4109                                  upb_Arena* arena, size_t* len) {
4110   return upb_Encode(msg, &google_protobuf_MessageOptions_msginit, options, arena, len);
4111 }
google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions * msg)4112 UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4113   return _upb_hasbit(msg, 1);
4114 }
google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions * msg)4115 UPB_INLINE void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4116   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4117   _upb_clearhas(msg, 1);
4118 }
google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions * msg)4119 UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
4120   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4121 }
google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)4122 UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4123   return _upb_hasbit(msg, 2);
4124 }
google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)4125 UPB_INLINE void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4126   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
4127   _upb_clearhas(msg, 2);
4128 }
google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions * msg)4129 UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
4130   return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
4131 }
google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions * msg)4132 UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions* msg) {
4133   return _upb_hasbit(msg, 3);
4134 }
google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions * msg)4135 UPB_INLINE void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) {
4136   *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
4137   _upb_clearhas(msg, 3);
4138 }
google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions * msg)4139 UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions* msg) {
4140   return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
4141 }
google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions * msg)4142 UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions* msg) {
4143   return _upb_hasbit(msg, 4);
4144 }
google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions * msg)4145 UPB_INLINE void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) {
4146   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
4147   _upb_clearhas(msg, 4);
4148 }
google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions * msg)4149 UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions* msg) {
4150   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
4151 }
google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions * msg)4152 UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
4153   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8));
4154 }
google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions * msg)4155 UPB_INLINE void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
4156   _upb_array_detach(msg, UPB_SIZE(8, 8));
4157 }
google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions * msg,size_t * len)4158 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions* msg, size_t* len) {
4159   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
4160 }
4161 
google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions * msg,bool value)4162 UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
4163   _upb_sethas(msg, 1);
4164   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4165 }
google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions * msg,bool value)4166 UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
4167   _upb_sethas(msg, 2);
4168   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
4169 }
google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions * msg,bool value)4170 UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
4171   _upb_sethas(msg, 3);
4172   *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
4173 }
google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions * msg,bool value)4174 UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
4175   _upb_sethas(msg, 4);
4176   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
4177 }
google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t * len)4178 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t* len) {
4179   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
4180 }
google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions * msg,size_t len,upb_Arena * arena)4181 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions* msg, size_t len, upb_Arena* arena) {
4182   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena);
4183 }
google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions * msg,upb_Arena * arena)4184 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) {
4185   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4186   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
4187   if (!ok) return NULL;
4188   return sub;
4189 }
4190 
4191 /* google.protobuf.FieldOptions */
4192 
google_protobuf_FieldOptions_new(upb_Arena * arena)4193 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) {
4194   return (google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msginit, arena);
4195 }
google_protobuf_FieldOptions_parse(const char * buf,size_t size,upb_Arena * arena)4196 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4197   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
4198   if (!ret) return NULL;
4199   if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4200     return NULL;
4201   }
4202   return ret;
4203 }
google_protobuf_FieldOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4204 UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size,
4205                            const upb_ExtensionRegistry* extreg,
4206                            int options, upb_Arena* arena) {
4207   google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
4208   if (!ret) return NULL;
4209   if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, extreg, options, arena) !=
4210       kUpb_DecodeStatus_Ok) {
4211     return NULL;
4212   }
4213   return ret;
4214 }
google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions * msg,upb_Arena * arena,size_t * len)4215 UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) {
4216   return upb_Encode(msg, &google_protobuf_FieldOptions_msginit, 0, arena, len);
4217 }
google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions * msg,int options,upb_Arena * arena,size_t * len)4218 UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options,
4219                                  upb_Arena* arena, size_t* len) {
4220   return upb_Encode(msg, &google_protobuf_FieldOptions_msginit, options, arena, len);
4221 }
google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions * msg)4222 UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
4223   return _upb_hasbit(msg, 1);
4224 }
google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions * msg)4225 UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) {
4226   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
4227   _upb_clearhas(msg, 1);
4228 }
google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions * msg)4229 UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
4230   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
4231 }
google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions * msg)4232 UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
4233   return _upb_hasbit(msg, 2);
4234 }
google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions * msg)4235 UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) {
4236   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
4237   _upb_clearhas(msg, 2);
4238 }
google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions * msg)4239 UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
4240   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
4241 }
google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions * msg)4242 UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
4243   return _upb_hasbit(msg, 3);
4244 }
google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions * msg)4245 UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) {
4246   *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
4247   _upb_clearhas(msg, 3);
4248 }
google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions * msg)4249 UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
4250   return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
4251 }
google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions * msg)4252 UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
4253   return _upb_hasbit(msg, 4);
4254 }
google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions * msg)4255 UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) {
4256   *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
4257   _upb_clearhas(msg, 4);
4258 }
google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions * msg)4259 UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
4260   return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
4261 }
google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions * msg)4262 UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
4263   return _upb_hasbit(msg, 5);
4264 }
google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions * msg)4265 UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) {
4266   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
4267   _upb_clearhas(msg, 5);
4268 }
google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions * msg)4269 UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
4270   return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t);
4271 }
google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions * msg)4272 UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
4273   return _upb_hasbit(msg, 6);
4274 }
google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions * msg)4275 UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) {
4276   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
4277   _upb_clearhas(msg, 6);
4278 }
google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions * msg)4279 UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
4280   return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
4281 }
google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions * msg)4282 UPB_INLINE bool google_protobuf_FieldOptions_has_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4283   return _upb_hasbit(msg, 7);
4284 }
google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions * msg)4285 UPB_INLINE void google_protobuf_FieldOptions_clear_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4286   *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = 0;
4287   _upb_clearhas(msg, 7);
4288 }
google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions * msg)4289 UPB_INLINE bool google_protobuf_FieldOptions_unverified_lazy(const google_protobuf_FieldOptions* msg) {
4290   return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool);
4291 }
google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions * msg)4292 UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
4293   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24));
4294 }
google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions * msg)4295 UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
4296   _upb_array_detach(msg, UPB_SIZE(20, 24));
4297 }
google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions * msg,size_t * len)4298 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions* msg, size_t* len) {
4299   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len);
4300 }
4301 
google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions * msg,int32_t value)4302 UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
4303   _upb_sethas(msg, 1);
4304   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
4305 }
google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions * msg,bool value)4306 UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
4307   _upb_sethas(msg, 2);
4308   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
4309 }
google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions * msg,bool value)4310 UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
4311   _upb_sethas(msg, 3);
4312   *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
4313 }
google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions * msg,bool value)4314 UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
4315   _upb_sethas(msg, 4);
4316   *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
4317 }
google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions * msg,int32_t value)4318 UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
4319   _upb_sethas(msg, 5);
4320   *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
4321 }
google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions * msg,bool value)4322 UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
4323   _upb_sethas(msg, 6);
4324   *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
4325 }
google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions * msg,bool value)4326 UPB_INLINE void google_protobuf_FieldOptions_set_unverified_lazy(google_protobuf_FieldOptions *msg, bool value) {
4327   _upb_sethas(msg, 7);
4328   *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
4329 }
google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t * len)4330 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t* len) {
4331   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
4332 }
google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions * msg,size_t len,upb_Arena * arena)4333 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions* msg, size_t len, upb_Arena* arena) {
4334   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 24), len, UPB_SIZE(2, 3), arena);
4335 }
google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions * msg,upb_Arena * arena)4336 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) {
4337   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4338   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 24), UPB_SIZE(2, 3), &sub, arena);
4339   if (!ok) return NULL;
4340   return sub;
4341 }
4342 
4343 /* google.protobuf.OneofOptions */
4344 
google_protobuf_OneofOptions_new(upb_Arena * arena)4345 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) {
4346   return (google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msginit, arena);
4347 }
google_protobuf_OneofOptions_parse(const char * buf,size_t size,upb_Arena * arena)4348 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4349   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
4350   if (!ret) return NULL;
4351   if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4352     return NULL;
4353   }
4354   return ret;
4355 }
google_protobuf_OneofOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4356 UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size,
4357                            const upb_ExtensionRegistry* extreg,
4358                            int options, upb_Arena* arena) {
4359   google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
4360   if (!ret) return NULL;
4361   if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, extreg, options, arena) !=
4362       kUpb_DecodeStatus_Ok) {
4363     return NULL;
4364   }
4365   return ret;
4366 }
google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions * msg,upb_Arena * arena,size_t * len)4367 UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) {
4368   return upb_Encode(msg, &google_protobuf_OneofOptions_msginit, 0, arena, len);
4369 }
google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions * msg,int options,upb_Arena * arena,size_t * len)4370 UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options,
4371                                  upb_Arena* arena, size_t* len) {
4372   return upb_Encode(msg, &google_protobuf_OneofOptions_msginit, options, arena, len);
4373 }
google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions * msg)4374 UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
4375   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
4376 }
google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions * msg)4377 UPB_INLINE void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
4378   _upb_array_detach(msg, UPB_SIZE(0, 0));
4379 }
google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions * msg,size_t * len)4380 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions* msg, size_t* len) {
4381   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
4382 }
4383 
google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t * len)4384 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t* len) {
4385   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
4386 }
google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions * msg,size_t len,upb_Arena * arena)4387 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions* msg, size_t len, upb_Arena* arena) {
4388   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
4389 }
google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions * msg,upb_Arena * arena)4390 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) {
4391   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4392   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
4393   if (!ok) return NULL;
4394   return sub;
4395 }
4396 
4397 /* google.protobuf.EnumOptions */
4398 
google_protobuf_EnumOptions_new(upb_Arena * arena)4399 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) {
4400   return (google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msginit, arena);
4401 }
google_protobuf_EnumOptions_parse(const char * buf,size_t size,upb_Arena * arena)4402 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4403   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
4404   if (!ret) return NULL;
4405   if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4406     return NULL;
4407   }
4408   return ret;
4409 }
google_protobuf_EnumOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4410 UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size,
4411                            const upb_ExtensionRegistry* extreg,
4412                            int options, upb_Arena* arena) {
4413   google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
4414   if (!ret) return NULL;
4415   if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, extreg, options, arena) !=
4416       kUpb_DecodeStatus_Ok) {
4417     return NULL;
4418   }
4419   return ret;
4420 }
google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions * msg,upb_Arena * arena,size_t * len)4421 UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) {
4422   return upb_Encode(msg, &google_protobuf_EnumOptions_msginit, 0, arena, len);
4423 }
google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions * msg,int options,upb_Arena * arena,size_t * len)4424 UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options,
4425                                  upb_Arena* arena, size_t* len) {
4426   return upb_Encode(msg, &google_protobuf_EnumOptions_msginit, options, arena, len);
4427 }
google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions * msg)4428 UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
4429   return _upb_hasbit(msg, 1);
4430 }
google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions * msg)4431 UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) {
4432   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4433   _upb_clearhas(msg, 1);
4434 }
google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions * msg)4435 UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions* msg) {
4436   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4437 }
google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions * msg)4438 UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions* msg) {
4439   return _upb_hasbit(msg, 2);
4440 }
google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions * msg)4441 UPB_INLINE void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) {
4442   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
4443   _upb_clearhas(msg, 2);
4444 }
google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions * msg)4445 UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions* msg) {
4446   return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
4447 }
google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions * msg)4448 UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
4449   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4450 }
google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions * msg)4451 UPB_INLINE void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
4452   _upb_array_detach(msg, UPB_SIZE(4, 8));
4453 }
google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions * msg,size_t * len)4454 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions* msg, size_t* len) {
4455   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4456 }
4457 
google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions * msg,bool value)4458 UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
4459   _upb_sethas(msg, 1);
4460   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4461 }
google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions * msg,bool value)4462 UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
4463   _upb_sethas(msg, 2);
4464   *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
4465 }
google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t * len)4466 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t* len) {
4467   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4468 }
google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions * msg,size_t len,upb_Arena * arena)4469 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions* msg, size_t len, upb_Arena* arena) {
4470   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
4471 }
google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions * msg,upb_Arena * arena)4472 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) {
4473   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4474   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
4475   if (!ok) return NULL;
4476   return sub;
4477 }
4478 
4479 /* google.protobuf.EnumValueOptions */
4480 
google_protobuf_EnumValueOptions_new(upb_Arena * arena)4481 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) {
4482   return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msginit, arena);
4483 }
google_protobuf_EnumValueOptions_parse(const char * buf,size_t size,upb_Arena * arena)4484 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4485   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
4486   if (!ret) return NULL;
4487   if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4488     return NULL;
4489   }
4490   return ret;
4491 }
google_protobuf_EnumValueOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4492 UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size,
4493                            const upb_ExtensionRegistry* extreg,
4494                            int options, upb_Arena* arena) {
4495   google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
4496   if (!ret) return NULL;
4497   if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, extreg, options, arena) !=
4498       kUpb_DecodeStatus_Ok) {
4499     return NULL;
4500   }
4501   return ret;
4502 }
google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions * msg,upb_Arena * arena,size_t * len)4503 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) {
4504   return upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, 0, arena, len);
4505 }
google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions * msg,int options,upb_Arena * arena,size_t * len)4506 UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options,
4507                                  upb_Arena* arena, size_t* len) {
4508   return upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, options, arena, len);
4509 }
google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions * msg)4510 UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
4511   return _upb_hasbit(msg, 1);
4512 }
google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions * msg)4513 UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) {
4514   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4515   _upb_clearhas(msg, 1);
4516 }
google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions * msg)4517 UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions* msg) {
4518   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4519 }
google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions * msg)4520 UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
4521   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4522 }
google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions * msg)4523 UPB_INLINE void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
4524   _upb_array_detach(msg, UPB_SIZE(4, 8));
4525 }
google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions * msg,size_t * len)4526 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions* msg, size_t* len) {
4527   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4528 }
4529 
google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions * msg,bool value)4530 UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
4531   _upb_sethas(msg, 1);
4532   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4533 }
google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t * len)4534 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t* len) {
4535   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4536 }
google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions * msg,size_t len,upb_Arena * arena)4537 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions* msg, size_t len, upb_Arena* arena) {
4538   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
4539 }
google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions * msg,upb_Arena * arena)4540 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) {
4541   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4542   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
4543   if (!ok) return NULL;
4544   return sub;
4545 }
4546 
4547 /* google.protobuf.ServiceOptions */
4548 
google_protobuf_ServiceOptions_new(upb_Arena * arena)4549 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) {
4550   return (google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msginit, arena);
4551 }
google_protobuf_ServiceOptions_parse(const char * buf,size_t size,upb_Arena * arena)4552 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4553   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
4554   if (!ret) return NULL;
4555   if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4556     return NULL;
4557   }
4558   return ret;
4559 }
google_protobuf_ServiceOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4560 UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size,
4561                            const upb_ExtensionRegistry* extreg,
4562                            int options, upb_Arena* arena) {
4563   google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
4564   if (!ret) return NULL;
4565   if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, extreg, options, arena) !=
4566       kUpb_DecodeStatus_Ok) {
4567     return NULL;
4568   }
4569   return ret;
4570 }
google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions * msg,upb_Arena * arena,size_t * len)4571 UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) {
4572   return upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, 0, arena, len);
4573 }
google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions * msg,int options,upb_Arena * arena,size_t * len)4574 UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options,
4575                                  upb_Arena* arena, size_t* len) {
4576   return upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, options, arena, len);
4577 }
google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions * msg)4578 UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) {
4579   return _upb_hasbit(msg, 1);
4580 }
google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions * msg)4581 UPB_INLINE void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) {
4582   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4583   _upb_clearhas(msg, 1);
4584 }
google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions * msg)4585 UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions* msg) {
4586   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4587 }
google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions * msg)4588 UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
4589   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4590 }
google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions * msg)4591 UPB_INLINE void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
4592   _upb_array_detach(msg, UPB_SIZE(4, 8));
4593 }
google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions * msg,size_t * len)4594 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions* msg, size_t* len) {
4595   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4596 }
4597 
google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions * msg,bool value)4598 UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
4599   _upb_sethas(msg, 1);
4600   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4601 }
google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t * len)4602 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t* len) {
4603   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4604 }
google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions * msg,size_t len,upb_Arena * arena)4605 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions* msg, size_t len, upb_Arena* arena) {
4606   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
4607 }
google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions * msg,upb_Arena * arena)4608 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) {
4609   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4610   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
4611   if (!ok) return NULL;
4612   return sub;
4613 }
4614 
4615 /* google.protobuf.MethodOptions */
4616 
google_protobuf_MethodOptions_new(upb_Arena * arena)4617 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) {
4618   return (google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msginit, arena);
4619 }
google_protobuf_MethodOptions_parse(const char * buf,size_t size,upb_Arena * arena)4620 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
4621   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
4622   if (!ret) return NULL;
4623   if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4624     return NULL;
4625   }
4626   return ret;
4627 }
google_protobuf_MethodOptions_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4628 UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size,
4629                            const upb_ExtensionRegistry* extreg,
4630                            int options, upb_Arena* arena) {
4631   google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
4632   if (!ret) return NULL;
4633   if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, extreg, options, arena) !=
4634       kUpb_DecodeStatus_Ok) {
4635     return NULL;
4636   }
4637   return ret;
4638 }
google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions * msg,upb_Arena * arena,size_t * len)4639 UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) {
4640   return upb_Encode(msg, &google_protobuf_MethodOptions_msginit, 0, arena, len);
4641 }
google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions * msg,int options,upb_Arena * arena,size_t * len)4642 UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options,
4643                                  upb_Arena* arena, size_t* len) {
4644   return upb_Encode(msg, &google_protobuf_MethodOptions_msginit, options, arena, len);
4645 }
google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions * msg)4646 UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
4647   return _upb_hasbit(msg, 1);
4648 }
google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions * msg)4649 UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) {
4650   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4651   _upb_clearhas(msg, 1);
4652 }
google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions * msg)4653 UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
4654   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4655 }
google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions * msg)4656 UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
4657   return _upb_hasbit(msg, 2);
4658 }
google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions * msg)4659 UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) {
4660   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
4661   _upb_clearhas(msg, 2);
4662 }
google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions * msg)4663 UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
4664   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
4665 }
google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions * msg)4666 UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
4667   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8));
4668 }
google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions * msg)4669 UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
4670   _upb_array_detach(msg, UPB_SIZE(8, 8));
4671 }
google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions * msg,size_t * len)4672 UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions* msg, size_t* len) {
4673   return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
4674 }
4675 
google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions * msg,bool value)4676 UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
4677   _upb_sethas(msg, 1);
4678   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4679 }
google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions * msg,int32_t value)4680 UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
4681   _upb_sethas(msg, 2);
4682   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
4683 }
google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t * len)4684 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t* len) {
4685   return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
4686 }
google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions * msg,size_t len,upb_Arena * arena)4687 UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions* msg, size_t len, upb_Arena* arena) {
4688   return (google_protobuf_UninterpretedOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena);
4689 }
google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions * msg,upb_Arena * arena)4690 UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) {
4691   struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4692   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
4693   if (!ok) return NULL;
4694   return sub;
4695 }
4696 
4697 /* google.protobuf.UninterpretedOption */
4698 
google_protobuf_UninterpretedOption_new(upb_Arena * arena)4699 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) {
4700   return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
4701 }
google_protobuf_UninterpretedOption_parse(const char * buf,size_t size,upb_Arena * arena)4702 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) {
4703   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
4704   if (!ret) return NULL;
4705   if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4706     return NULL;
4707   }
4708   return ret;
4709 }
google_protobuf_UninterpretedOption_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4710 UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size,
4711                            const upb_ExtensionRegistry* extreg,
4712                            int options, upb_Arena* arena) {
4713   google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
4714   if (!ret) return NULL;
4715   if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, extreg, options, arena) !=
4716       kUpb_DecodeStatus_Ok) {
4717     return NULL;
4718   }
4719   return ret;
4720 }
google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption * msg,upb_Arena * arena,size_t * len)4721 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) {
4722   return upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, 0, arena, len);
4723 }
google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption * msg,int options,upb_Arena * arena,size_t * len)4724 UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options,
4725                                  upb_Arena* arena, size_t* len) {
4726   return upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, options, arena, len);
4727 }
google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption * msg)4728 UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
4729   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
4730 }
google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption * msg)4731 UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) {
4732   _upb_array_detach(msg, UPB_SIZE(4, 8));
4733 }
google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption * msg,size_t * len)4734 UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption* msg, size_t* len) {
4735   return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4736 }
google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption * msg)4737 UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4738   return _upb_hasbit(msg, 1);
4739 }
google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption * msg)4740 UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4741   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4742   _upb_clearhas(msg, 1);
4743 }
google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption * msg)4744 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
4745   return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
4746 }
google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption * msg)4747 UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4748   return _upb_hasbit(msg, 2);
4749 }
google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption * msg)4750 UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4751   *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0;
4752   _upb_clearhas(msg, 2);
4753 }
google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption * msg)4754 UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
4755   return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t);
4756 }
google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption * msg)4757 UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4758   return _upb_hasbit(msg, 3);
4759 }
google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption * msg)4760 UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4761   *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = 0;
4762   _upb_clearhas(msg, 3);
4763 }
google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption * msg)4764 UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
4765   return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t);
4766 }
google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption * msg)4767 UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
4768   return _upb_hasbit(msg, 4);
4769 }
google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption * msg)4770 UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) {
4771   *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = 0;
4772   _upb_clearhas(msg, 4);
4773 }
google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption * msg)4774 UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
4775   return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double);
4776 }
google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption * msg)4777 UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
4778   return _upb_hasbit(msg, 5);
4779 }
google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption * msg)4780 UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) {
4781   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4782   _upb_clearhas(msg, 5);
4783 }
google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption * msg)4784 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
4785   return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
4786 }
google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption * msg)4787 UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4788   return _upb_hasbit(msg, 6);
4789 }
google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption * msg)4790 UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4791   *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4792   _upb_clearhas(msg, 6);
4793 }
google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption * msg)4794 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
4795   return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
4796 }
4797 
google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption * msg,size_t * len)4798 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption* msg, size_t* len) {
4799   return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
4800 }
google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption * msg,size_t len,upb_Arena * arena)4801 UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption* msg, size_t len, upb_Arena* arena) {
4802   return (google_protobuf_UninterpretedOption_NamePart**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
4803 }
google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption * msg,upb_Arena * arena)4804 UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) {
4805   struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
4806   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
4807   if (!ok) return NULL;
4808   return sub;
4809 }
google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)4810 UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4811   _upb_sethas(msg, 1);
4812   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
4813 }
google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption * msg,uint64_t value)4814 UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
4815   _upb_sethas(msg, 2);
4816   *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = value;
4817 }
google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption * msg,int64_t value)4818 UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
4819   _upb_sethas(msg, 3);
4820   *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = value;
4821 }
google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption * msg,double value)4822 UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
4823   _upb_sethas(msg, 4);
4824   *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = value;
4825 }
google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)4826 UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4827   _upb_sethas(msg, 5);
4828   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
4829 }
google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption * msg,upb_StringView value)4830 UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
4831   _upb_sethas(msg, 6);
4832   *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value;
4833 }
4834 
4835 /* google.protobuf.UninterpretedOption.NamePart */
4836 
google_protobuf_UninterpretedOption_NamePart_new(upb_Arena * arena)4837 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) {
4838   return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
4839 }
google_protobuf_UninterpretedOption_NamePart_parse(const char * buf,size_t size,upb_Arena * arena)4840 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse(const char* buf, size_t size, upb_Arena* arena) {
4841   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
4842   if (!ret) return NULL;
4843   if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4844     return NULL;
4845   }
4846   return ret;
4847 }
google_protobuf_UninterpretedOption_NamePart_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4848 UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size,
4849                            const upb_ExtensionRegistry* extreg,
4850                            int options, upb_Arena* arena) {
4851   google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
4852   if (!ret) return NULL;
4853   if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, extreg, options, arena) !=
4854       kUpb_DecodeStatus_Ok) {
4855     return NULL;
4856   }
4857   return ret;
4858 }
google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart * msg,upb_Arena * arena,size_t * len)4859 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) {
4860   return upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, 0, arena, len);
4861 }
google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart * msg,int options,upb_Arena * arena,size_t * len)4862 UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options,
4863                                  upb_Arena* arena, size_t* len) {
4864   return upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, options, arena, len);
4865 }
google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)4866 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4867   return _upb_hasbit(msg, 1);
4868 }
google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)4869 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4870   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4871   _upb_clearhas(msg, 1);
4872 }
google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart * msg)4873 UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
4874   return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
4875 }
google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)4876 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4877   return _upb_hasbit(msg, 2);
4878 }
google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)4879 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4880   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
4881   _upb_clearhas(msg, 2);
4882 }
google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart * msg)4883 UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
4884   return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
4885 }
4886 
google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart * msg,upb_StringView value)4887 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView value) {
4888   _upb_sethas(msg, 1);
4889   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
4890 }
google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart * msg,bool value)4891 UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
4892   _upb_sethas(msg, 2);
4893   *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
4894 }
4895 
4896 /* google.protobuf.SourceCodeInfo */
4897 
google_protobuf_SourceCodeInfo_new(upb_Arena * arena)4898 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) {
4899   return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena);
4900 }
google_protobuf_SourceCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)4901 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
4902   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
4903   if (!ret) return NULL;
4904   if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4905     return NULL;
4906   }
4907   return ret;
4908 }
google_protobuf_SourceCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4909 UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size,
4910                            const upb_ExtensionRegistry* extreg,
4911                            int options, upb_Arena* arena) {
4912   google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
4913   if (!ret) return NULL;
4914   if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, extreg, options, arena) !=
4915       kUpb_DecodeStatus_Ok) {
4916     return NULL;
4917   }
4918   return ret;
4919 }
google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo * msg,upb_Arena * arena,size_t * len)4920 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) {
4921   return upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, 0, arena, len);
4922 }
google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo * msg,int options,upb_Arena * arena,size_t * len)4923 UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options,
4924                                  upb_Arena* arena, size_t* len) {
4925   return upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, options, arena, len);
4926 }
google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo * msg)4927 UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) {
4928   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
4929 }
google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo * msg)4930 UPB_INLINE void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) {
4931   _upb_array_detach(msg, UPB_SIZE(0, 0));
4932 }
google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo * msg,size_t * len)4933 UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo* msg, size_t* len) {
4934   return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
4935 }
4936 
google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo * msg,size_t * len)4937 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo* msg, size_t* len) {
4938   return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
4939 }
google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo * msg,size_t len,upb_Arena * arena)4940 UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo* msg, size_t len, upb_Arena* arena) {
4941   return (google_protobuf_SourceCodeInfo_Location**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
4942 }
google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo * msg,upb_Arena * arena)4943 UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) {
4944   struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
4945   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
4946   if (!ok) return NULL;
4947   return sub;
4948 }
4949 
4950 /* google.protobuf.SourceCodeInfo.Location */
4951 
google_protobuf_SourceCodeInfo_Location_new(upb_Arena * arena)4952 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) {
4953   return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
4954 }
google_protobuf_SourceCodeInfo_Location_parse(const char * buf,size_t size,upb_Arena * arena)4955 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) {
4956   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
4957   if (!ret) return NULL;
4958   if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
4959     return NULL;
4960   }
4961   return ret;
4962 }
google_protobuf_SourceCodeInfo_Location_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)4963 UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size,
4964                            const upb_ExtensionRegistry* extreg,
4965                            int options, upb_Arena* arena) {
4966   google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
4967   if (!ret) return NULL;
4968   if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, extreg, options, arena) !=
4969       kUpb_DecodeStatus_Ok) {
4970     return NULL;
4971   }
4972   return ret;
4973 }
google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location * msg,upb_Arena * arena,size_t * len)4974 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) {
4975   return upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, 0, arena, len);
4976 }
google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location * msg,int options,upb_Arena * arena,size_t * len)4977 UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options,
4978                                  upb_Arena* arena, size_t* len) {
4979   return upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, options, arena, len);
4980 }
google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location * msg)4981 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) {
4982   _upb_array_detach(msg, UPB_SIZE(4, 8));
4983 }
google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)4984 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4985   return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
4986 }
google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location * msg)4987 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) {
4988   _upb_array_detach(msg, UPB_SIZE(8, 16));
4989 }
google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)4990 UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
4991   return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
4992 }
google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)4993 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4994   return _upb_hasbit(msg, 1);
4995 }
google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)4996 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
4997   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
4998   _upb_clearhas(msg, 1);
4999 }
google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location * msg)5000 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5001   return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
5002 }
google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)5003 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5004   return _upb_hasbit(msg, 2);
5005 }
google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)5006 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5007   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
5008   _upb_clearhas(msg, 2);
5009 }
google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location * msg)5010 UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5011   return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
5012 }
google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location * msg)5013 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
5014   _upb_array_detach(msg, UPB_SIZE(28, 56));
5015 }
google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location * msg,size_t * len)5016 UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
5017   return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
5018 }
5019 
google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)5020 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
5021   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
5022 }
google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_Arena * arena)5023 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
5024   return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena);
5025 }
google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)5026 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
5027   return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 2, &val, arena);
5028 }
google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)5029 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
5030   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
5031 }
google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_Arena * arena)5032 UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
5033   return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 2, arena);
5034 }
google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location * msg,int32_t val,upb_Arena * arena)5035 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) {
5036   return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 2, &val, arena);
5037 }
google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)5038 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
5039   _upb_sethas(msg, 1);
5040   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
5041 }
google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView value)5042 UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
5043   _upb_sethas(msg, 2);
5044   *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
5045 }
google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t * len)5046 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
5047   return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
5048 }
google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,size_t len,upb_Arena * arena)5049 UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
5050   return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
5051 }
google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location * msg,upb_StringView val,upb_Arena * arena)5052 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) {
5053   return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val, arena);
5054 }
5055 
5056 /* google.protobuf.GeneratedCodeInfo */
5057 
google_protobuf_GeneratedCodeInfo_new(upb_Arena * arena)5058 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) {
5059   return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_msginit, arena);
5060 }
google_protobuf_GeneratedCodeInfo_parse(const char * buf,size_t size,upb_Arena * arena)5061 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
5062   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
5063   if (!ret) return NULL;
5064   if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
5065     return NULL;
5066   }
5067   return ret;
5068 }
google_protobuf_GeneratedCodeInfo_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5069 UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size,
5070                            const upb_ExtensionRegistry* extreg,
5071                            int options, upb_Arena* arena) {
5072   google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
5073   if (!ret) return NULL;
5074   if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, extreg, options, arena) !=
5075       kUpb_DecodeStatus_Ok) {
5076     return NULL;
5077   }
5078   return ret;
5079 }
google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena,size_t * len)5080 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) {
5081   return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, 0, arena, len);
5082 }
google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo * msg,int options,upb_Arena * arena,size_t * len)5083 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options,
5084                                  upb_Arena* arena, size_t* len) {
5085   return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, options, arena, len);
5086 }
google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo * msg)5087 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
5088   return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
5089 }
google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo * msg)5090 UPB_INLINE void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
5091   _upb_array_detach(msg, UPB_SIZE(0, 0));
5092 }
google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo * msg,size_t * len)5093 UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
5094   return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
5095 }
5096 
google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t * len)5097 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t* len) {
5098   return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
5099 }
google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo * msg,size_t len,upb_Arena * arena)5100 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo* msg, size_t len, upb_Arena* arena) {
5101   return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
5102 }
google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo * msg,upb_Arena * arena)5103 UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) {
5104   struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
5105   bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
5106   if (!ok) return NULL;
5107   return sub;
5108 }
5109 
5110 /* google.protobuf.GeneratedCodeInfo.Annotation */
5111 
google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena * arena)5112 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) {
5113   return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
5114 }
google_protobuf_GeneratedCodeInfo_Annotation_parse(const char * buf,size_t size,upb_Arena * arena)5115 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) {
5116   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
5117   if (!ret) return NULL;
5118   if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
5119     return NULL;
5120   }
5121   return ret;
5122 }
google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)5123 UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size,
5124                            const upb_ExtensionRegistry* extreg,
5125                            int options, upb_Arena* arena) {
5126   google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
5127   if (!ret) return NULL;
5128   if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, extreg, options, arena) !=
5129       kUpb_DecodeStatus_Ok) {
5130     return NULL;
5131   }
5132   return ret;
5133 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_Arena * arena,size_t * len)5134 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) {
5135   return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, 0, arena, len);
5136 }
google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation * msg,int options,upb_Arena * arena,size_t * len)5137 UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options,
5138                                  upb_Arena* arena, size_t* len) {
5139   return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, options, arena, len);
5140 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5141 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5142   _upb_array_detach(msg, UPB_SIZE(12, 16));
5143 }
google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * len)5144 UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
5145   return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
5146 }
google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5147 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5148   return _upb_hasbit(msg, 1);
5149 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5150 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5151   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
5152   _upb_clearhas(msg, 1);
5153 }
google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5154 UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5155   return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
5156 }
google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5157 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5158   return _upb_hasbit(msg, 2);
5159 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5160 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5161   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
5162   _upb_clearhas(msg, 2);
5163 }
google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5164 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5165   return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
5166 }
google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5167 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5168   return _upb_hasbit(msg, 3);
5169 }
google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5170 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5171   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
5172   _upb_clearhas(msg, 3);
5173 }
google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation * msg)5174 UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
5175   return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
5176 }
5177 
google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t * len)5178 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
5179   return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
5180 }
google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,size_t len,upb_Arena * arena)5181 UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t len, upb_Arena* arena) {
5182   return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena);
5183 }
google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t val,upb_Arena * arena)5184 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) {
5185   return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena);
5186 }
google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation * msg,upb_StringView value)5187 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
5188   _upb_sethas(msg, 1);
5189   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
5190 }
google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)5191 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
5192   _upb_sethas(msg, 2);
5193   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
5194 }
google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation * msg,int32_t value)5195 UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
5196   _upb_sethas(msg, 3);
5197   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
5198 }
5199 
5200 extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout;
5201 
5202 /* Max size 32 is google.protobuf.FileOptions */
5203 /* Max size 64 is google.protobuf.FileOptions */
5204 #define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192)
5205 
5206 #ifdef __cplusplus
5207 }  /* extern "C" */
5208 #endif
5209 
5210 
5211 #endif  /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
5212 
5213 #ifdef __cplusplus
5214 extern "C" {
5215 #endif
5216 
5217 typedef union {
5218   bool bool_val;
5219   float float_val;
5220   double double_val;
5221   int32_t int32_val;
5222   int64_t int64_val;
5223   uint32_t uint32_val;
5224   uint64_t uint64_val;
5225   const upb_Map* map_val;
5226   const upb_Message* msg_val;
5227   const upb_Array* array_val;
5228   upb_StringView str_val;
5229 } upb_MessageValue;
5230 
5231 typedef union {
5232   upb_Map* map;
5233   upb_Message* msg;
5234   upb_Array* array;
5235 } upb_MutableMessageValue;
5236 
5237 /** upb_Array *****************************************************************/
5238 
5239 /* Creates a new array on the given arena that holds elements of this type. */
5240 upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
5241 
5242 /* Returns the size of the array. */
5243 size_t upb_Array_Size(const upb_Array* arr);
5244 
5245 /* Returns the given element, which must be within the array's current size. */
5246 upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
5247 
5248 /* Sets the given element, which must be within the array's current size. */
5249 void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
5250 
5251 /* Appends an element to the array.  Returns false on allocation failure. */
5252 bool upb_Array_Append(upb_Array* array, upb_MessageValue val, upb_Arena* arena);
5253 
5254 /* Moves elements within the array using memmove(). Like memmove(), the source
5255  * and destination elements may be overlapping. */
5256 void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
5257                     size_t count);
5258 
5259 /* Inserts one or more empty elements into the array.  Existing elements are
5260  * shifted right.  The new elements have undefined state and must be set with
5261  * `upb_Array_Set()`.
5262  * REQUIRES: `i <= upb_Array_Size(arr)` */
5263 bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
5264                       upb_Arena* arena);
5265 
5266 /* Deletes one or more elements from the array.  Existing elements are shifted
5267  * left.
5268  * REQUIRES: `i + count <= upb_Array_Size(arr)` */
5269 void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
5270 
5271 /* Changes the size of a vector.  New elements are initialized to empty/0.
5272  * Returns false on allocation failure. */
5273 bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
5274 
5275 /** upb_Map *******************************************************************/
5276 
5277 /* Creates a new map on the given arena with the given key/value size. */
5278 upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, upb_CType value_type);
5279 
5280 /* Returns the number of entries in the map. */
5281 size_t upb_Map_Size(const upb_Map* map);
5282 
5283 /* Stores a value for the given key into |*val| (or the zero value if the key is
5284  * not present).  Returns whether the key was present.  The |val| pointer may be
5285  * NULL, in which case the function tests whether the given key is present.  */
5286 bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
5287                  upb_MessageValue* val);
5288 
5289 /* Removes all entries in the map. */
5290 void upb_Map_Clear(upb_Map* map);
5291 
5292 typedef enum {
5293   // LINT.IfChange
5294   kUpb_MapInsertStatus_Inserted = 0,
5295   kUpb_MapInsertStatus_Replaced = 1,
5296   kUpb_MapInsertStatus_OutOfMemory = 2,
5297   // LINT.ThenChange(//depot/google3/third_party/upb/upb/msg_internal.h)
5298 } upb_MapInsertStatus;
5299 
5300 /* Sets the given key to the given value, returning whether the key was inserted
5301  * or replaced.  If the key was inserted, then any existing iterators will be
5302  * invalidated. */
5303 upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key,
5304                                    upb_MessageValue val, upb_Arena* arena);
5305 
5306 /* Sets the given key to the given value.  Returns false if memory allocation
5307  * failed. If the key is newly inserted, then any existing iterators will be
5308  * invalidated. */
upb_Map_Set(upb_Map * map,upb_MessageValue key,upb_MessageValue val,upb_Arena * arena)5309 UPB_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key,
5310                             upb_MessageValue val, upb_Arena* arena) {
5311   return upb_Map_Insert(map, key, val, arena) !=
5312          kUpb_MapInsertStatus_OutOfMemory;
5313 }
5314 
5315 /* Deletes this key from the table.  Returns true if the key was present. */
5316 bool upb_Map_Delete(upb_Map* map, upb_MessageValue key);
5317 
5318 /* Map iteration:
5319  *
5320  * size_t iter = kUpb_Map_Begin;
5321  * while (upb_MapIterator_Next(map, &iter)) {
5322  *   upb_MessageValue key = upb_MapIterator_Key(map, iter);
5323  *   upb_MessageValue val = upb_MapIterator_Value(map, iter);
5324  *
5325  *   // If mutating is desired.
5326  *   upb_MapIterator_SetValue(map, iter, value2);
5327  * }
5328  */
5329 
5330 /* Advances to the next entry.  Returns false if no more entries are present. */
5331 bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
5332 
5333 /* Returns true if the iterator still points to a valid entry, or false if the
5334  * iterator is past the last element. It is an error to call this function with
5335  * kUpb_Map_Begin (you must call next() at least once first). */
5336 bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
5337 
5338 /* Returns the key and value for this entry of the map. */
5339 upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
5340 upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
5341 
5342 /* Sets the value for this entry.  The iterator must not be done, and the
5343  * iterator must not have been initialized const. */
5344 void upb_MapIterator_SetValue(upb_Map* map, size_t iter,
5345                               upb_MessageValue value);
5346 
5347 #ifdef __cplusplus
5348 } /* extern "C" */
5349 #endif
5350 
5351 
5352 #endif /* UPB_COLLECTIONS_H_ */
5353 
5354 /** upb/decode_internal.h ************************************************************/
5355 /*
5356  * Internal implementation details of the decoder that are shared between
5357  * decode.c and decode_fast.c.
5358  */
5359 
5360 #ifndef UPB_DECODE_INT_H_
5361 #define UPB_DECODE_INT_H_
5362 
5363 #include <setjmp.h>
5364 
5365 #include "third_party/utf8_range/utf8_range.h"
5366 
5367 /** upb/upb_internal.h ************************************************************/
5368 #ifndef UPB_INT_H_
5369 #define UPB_INT_H_
5370 
5371 
5372 struct mem_block;
5373 typedef struct mem_block mem_block;
5374 
5375 struct upb_Arena {
5376   _upb_ArenaHead head;
5377   /* Stores cleanup metadata for this arena.
5378    * - a pointer to the current cleanup counter.
5379    * - a boolean indicating if there is an unowned initial block.  */
5380   uintptr_t cleanup_metadata;
5381 
5382   /* Allocator to allocate arena blocks.  We are responsible for freeing these
5383    * when we are destroyed. */
5384   upb_alloc* block_alloc;
5385   uint32_t last_size;
5386 
5387   /* When multiple arenas are fused together, each arena points to a parent
5388    * arena (root points to itself). The root tracks how many live arenas
5389    * reference it. */
5390   uint32_t refcount; /* Only used when a->parent == a */
5391   struct upb_Arena* parent;
5392 
5393   /* Linked list of blocks to free/cleanup. */
5394   mem_block *freelist, *freelist_tail;
5395 };
5396 
5397 // Encodes a float or double that is round-trippable, but as short as possible.
5398 // These routines are not fully optimal (not guaranteed to be shortest), but are
5399 // short-ish and match the implementation that has been used in protobuf since
5400 // the beginning.
5401 //
5402 // The given buffer size must be at least kUpb_RoundTripBufferSize.
5403 enum { kUpb_RoundTripBufferSize = 32 };
5404 void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
5405 void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
5406 
5407 #endif /* UPB_INT_H_ */
5408 
5409 /* Must be last. */
5410 
5411 #define DECODE_NOGROUP (uint32_t) - 1
5412 
5413 typedef struct upb_Decoder {
5414   const char* end;          /* Can read up to 16 bytes slop beyond this. */
5415   const char* limit_ptr;    /* = end + UPB_MIN(limit, 0) */
5416   upb_Message* unknown_msg; /* Used for preserving unknown data. */
5417   const char* unknown; /* Start of unknown data, preserve at buffer flip. */
5418   const upb_ExtensionRegistry*
5419       extreg;         /* For looking up extensions during the parse. */
5420   int limit;          /* Submessage limit relative to end. */
5421   int depth;          /* Tracks recursion depth to bound stack usage. */
5422   uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
5423   uint16_t options;
5424   bool missing_required;
5425   char patch[32];
5426   upb_Arena arena;
5427   jmp_buf err;
5428 
5429 #ifndef NDEBUG
5430   const char* debug_tagstart;
5431   const char* debug_valstart;
5432 #endif
5433 } upb_Decoder;
5434 
5435 /* Error function that will abort decoding with longjmp(). We can't declare this
5436  * UPB_NORETURN, even though it is appropriate, because if we do then compilers
5437  * will "helpfully" refuse to tailcall to it
5438  * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
5439  * of our optimizations. That is also why we must declare it in a separate file,
5440  * otherwise the compiler will see that it calls longjmp() and deduce that it is
5441  * noreturn. */
5442 const char* fastdecode_err(upb_Decoder* d, int status);
5443 
5444 extern const uint8_t upb_utf8_offsets[];
5445 
5446 UPB_INLINE
decode_verifyutf8_inl(const char * ptr,int len)5447 bool decode_verifyutf8_inl(const char* ptr, int len) {
5448   const char* end = ptr + len;
5449 
5450   // Check 8 bytes at a time for any non-ASCII char.
5451   while (end - ptr >= 8) {
5452     uint64_t data;
5453     memcpy(&data, ptr, 8);
5454     if (data & 0x8080808080808080) goto non_ascii;
5455     ptr += 8;
5456   }
5457 
5458   // Check one byte at a time for non-ASCII.
5459   while (ptr < end) {
5460     if (*ptr & 0x80) goto non_ascii;
5461     ptr++;
5462   }
5463 
5464   return true;
5465 
5466 non_ascii:
5467   return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
5468 }
5469 
5470 const char* decode_checkrequired(upb_Decoder* d, const char* ptr,
5471                                  const upb_Message* msg,
5472                                  const upb_MiniTable* l);
5473 
5474 /* x86-64 pointers always have the high 16 bits matching. So we can shift
5475  * left 8 and right 8 without loss of information. */
decode_totable(const upb_MiniTable * tablep)5476 UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
5477   return ((intptr_t)tablep << 8) | tablep->table_mask;
5478 }
5479 
decode_totablep(intptr_t table)5480 UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
5481   return (const upb_MiniTable*)(table >> 8);
5482 }
5483 
5484 UPB_INLINE
decode_isdonefallback_inl(upb_Decoder * d,const char * ptr,int overrun,int * status)5485 const char* decode_isdonefallback_inl(upb_Decoder* d, const char* ptr,
5486                                       int overrun, int* status) {
5487   if (overrun < d->limit) {
5488     /* Need to copy remaining data into patch buffer. */
5489     UPB_ASSERT(overrun < 16);
5490     if (d->unknown) {
5491       if (!_upb_Message_AddUnknown(d->unknown_msg, d->unknown, ptr - d->unknown,
5492                                    &d->arena)) {
5493         *status = kUpb_DecodeStatus_OutOfMemory;
5494         return NULL;
5495       }
5496       d->unknown = &d->patch[0] + overrun;
5497     }
5498     memset(d->patch + 16, 0, 16);
5499     memcpy(d->patch, d->end, 16);
5500     ptr = &d->patch[0] + overrun;
5501     d->end = &d->patch[16];
5502     d->limit -= 16;
5503     d->limit_ptr = d->end + d->limit;
5504     d->options &= ~kUpb_DecodeOption_AliasString;
5505     UPB_ASSERT(ptr < d->limit_ptr);
5506     return ptr;
5507   } else {
5508     *status = kUpb_DecodeStatus_Malformed;
5509     return NULL;
5510   }
5511 }
5512 
5513 const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, int overrun);
5514 
5515 UPB_INLINE
decode_isdone(upb_Decoder * d,const char ** ptr)5516 bool decode_isdone(upb_Decoder* d, const char** ptr) {
5517   int overrun = *ptr - d->end;
5518   if (UPB_LIKELY(*ptr < d->limit_ptr)) {
5519     return false;
5520   } else if (UPB_LIKELY(overrun == d->limit)) {
5521     return true;
5522   } else {
5523     *ptr = decode_isdonefallback(d, *ptr, overrun);
5524     return false;
5525   }
5526 }
5527 
5528 #if UPB_FASTTABLE
5529 UPB_INLINE
fastdecode_tagdispatch(upb_Decoder * d,const char * ptr,upb_Message * msg,intptr_t table,uint64_t hasbits,uint64_t tag)5530 const char* fastdecode_tagdispatch(upb_Decoder* d, const char* ptr,
5531                                    upb_Message* msg, intptr_t table,
5532                                    uint64_t hasbits, uint64_t tag) {
5533   const upb_MiniTable* table_p = decode_totablep(table);
5534   uint8_t mask = table;
5535   uint64_t data;
5536   size_t idx = tag & mask;
5537   UPB_ASSUME((idx & 7) == 0);
5538   idx >>= 3;
5539   data = table_p->fasttable[idx].field_data ^ tag;
5540   UPB_MUSTTAIL return table_p->fasttable[idx].field_parser(d, ptr, msg, table,
5541                                                            hasbits, data);
5542 }
5543 #endif
5544 
fastdecode_loadtag(const char * ptr)5545 UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
5546   uint16_t tag;
5547   memcpy(&tag, ptr, 2);
5548   return tag;
5549 }
5550 
decode_checklimit(upb_Decoder * d)5551 UPB_INLINE void decode_checklimit(upb_Decoder* d) {
5552   UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
5553 }
5554 
decode_pushlimit(upb_Decoder * d,const char * ptr,int size)5555 UPB_INLINE int decode_pushlimit(upb_Decoder* d, const char* ptr, int size) {
5556   int limit = size + (int)(ptr - d->end);
5557   int delta = d->limit - limit;
5558   decode_checklimit(d);
5559   d->limit = limit;
5560   d->limit_ptr = d->end + UPB_MIN(0, limit);
5561   decode_checklimit(d);
5562   return delta;
5563 }
5564 
decode_poplimit(upb_Decoder * d,const char * ptr,int saved_delta)5565 UPB_INLINE void decode_poplimit(upb_Decoder* d, const char* ptr,
5566                                 int saved_delta) {
5567   UPB_ASSERT(ptr - d->end == d->limit);
5568   decode_checklimit(d);
5569   d->limit += saved_delta;
5570   d->limit_ptr = d->end + UPB_MIN(0, d->limit);
5571   decode_checklimit(d);
5572 }
5573 
5574 
5575 #endif /* UPB_DECODE_INT_H_ */
5576 
5577 /** upb/json_decode.h ************************************************************/
5578 #ifndef UPB_JSONDECODE_H_
5579 #define UPB_JSONDECODE_H_
5580 
5581 
5582 /** upb/def.h ************************************************************/
5583 #ifndef UPB_DEF_H_
5584 #define UPB_DEF_H_
5585 
5586 
5587 /* Must be last. */
5588 
5589 #ifdef __cplusplus
5590 extern "C" {
5591 #endif /* __cplusplus */
5592 
5593 struct upb_EnumDef;
5594 typedef struct upb_EnumDef upb_EnumDef;
5595 struct upb_EnumValueDef;
5596 typedef struct upb_EnumValueDef upb_EnumValueDef;
5597 struct upb_ExtensionRange;
5598 typedef struct upb_ExtensionRange upb_ExtensionRange;
5599 struct upb_FieldDef;
5600 typedef struct upb_FieldDef upb_FieldDef;
5601 struct upb_FileDef;
5602 typedef struct upb_FileDef upb_FileDef;
5603 struct upb_MethodDef;
5604 typedef struct upb_MethodDef upb_MethodDef;
5605 struct upb_MessageDef;
5606 typedef struct upb_MessageDef upb_MessageDef;
5607 struct upb_OneofDef;
5608 typedef struct upb_OneofDef upb_OneofDef;
5609 struct upb_ServiceDef;
5610 typedef struct upb_ServiceDef upb_ServiceDef;
5611 struct upb_streamdef;
5612 typedef struct upb_streamdef upb_streamdef;
5613 struct upb_DefPool;
5614 typedef struct upb_DefPool upb_DefPool;
5615 typedef struct upb_EnumReservedRange upb_EnumReservedRange;
5616 typedef struct upb_MessageReservedRange upb_MessageReservedRange;
5617 typedef struct symtab_addctx symtab_addctx;
5618 
5619 typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax;
5620 
5621 /* All the different kind of well known type messages. For simplicity of check,
5622  * number wrappers and string wrappers are grouped together. Make sure the
5623  * order and merber of these groups are not changed.
5624  */
5625 typedef enum {
5626   kUpb_WellKnown_Unspecified,
5627   kUpb_WellKnown_Any,
5628   kUpb_WellKnown_FieldMask,
5629   kUpb_WellKnown_Duration,
5630   kUpb_WellKnown_Timestamp,
5631   /* number wrappers */
5632   kUpb_WellKnown_DoubleValue,
5633   kUpb_WellKnown_FloatValue,
5634   kUpb_WellKnown_Int64Value,
5635   kUpb_WellKnown_UInt64Value,
5636   kUpb_WellKnown_Int32Value,
5637   kUpb_WellKnown_UInt32Value,
5638   /* string wrappers */
5639   kUpb_WellKnown_StringValue,
5640   kUpb_WellKnown_BytesValue,
5641   kUpb_WellKnown_BoolValue,
5642   kUpb_WellKnown_Value,
5643   kUpb_WellKnown_ListValue,
5644   kUpb_WellKnown_Struct
5645 } upb_WellKnown;
5646 
5647 /* upb_FieldDef ***************************************************************/
5648 
5649 /* Maximum field number allowed for FieldDefs.  This is an inherent limit of the
5650  * protobuf wire format. */
5651 #define kUpb_MaxFieldNumber ((1 << 29) - 1)
5652 
5653 const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f);
5654 bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
5655 const char* upb_FieldDef_FullName(const upb_FieldDef* f);
5656 upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
5657 upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
5658 upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
5659 uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
5660 const char* upb_FieldDef_Name(const upb_FieldDef* f);
5661 const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
5662 bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
5663 bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
5664 bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
5665 const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
5666 const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f);
5667 const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
5668 const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
5669 const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f);
5670 uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
5671 bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
5672 bool upb_FieldDef_IsString(const upb_FieldDef* f);
5673 bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
5674 bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
5675 bool upb_FieldDef_IsMap(const upb_FieldDef* f);
5676 bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
5677 bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
5678 bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
5679 const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
5680 const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
5681 const upb_MiniTable_Field* upb_FieldDef_MiniTable(const upb_FieldDef* f);
5682 const upb_MiniTable_Extension* _upb_FieldDef_ExtensionMiniTable(
5683     const upb_FieldDef* f);
5684 bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f);
5685 
5686 /* upb_OneofDef ***************************************************************/
5687 
5688 const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o);
5689 bool upb_OneofDef_HasOptions(const upb_OneofDef* o);
5690 const char* upb_OneofDef_Name(const upb_OneofDef* o);
5691 const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o);
5692 uint32_t upb_OneofDef_Index(const upb_OneofDef* o);
5693 bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o);
5694 int upb_OneofDef_FieldCount(const upb_OneofDef* o);
5695 const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i);
5696 
5697 /* Oneof lookups:
5698  * - ntof:  look up a field by name.
5699  * - ntofz: look up a field by name (as a null-terminated string).
5700  * - itof:  look up a field by number. */
5701 const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
5702                                                     const char* name,
5703                                                     size_t length);
upb_OneofDef_LookupName(const upb_OneofDef * o,const char * name)5704 UPB_INLINE const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o,
5705                                                        const char* name) {
5706   return upb_OneofDef_LookupNameWithSize(o, name, strlen(name));
5707 }
5708 const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
5709                                               uint32_t num);
5710 
5711 /* upb_MessageDef *************************************************************/
5712 
5713 /* Well-known field tag numbers for map-entry messages. */
5714 #define kUpb_MapEntry_KeyFieldNumber 1
5715 #define kUpb_MapEntry_ValueFieldNumber 2
5716 
5717 /* Well-known field tag numbers for Any messages. */
5718 #define kUpb_Any_TypeFieldNumber 1
5719 #define kUpb_Any_ValueFieldNumber 2
5720 
5721 /* Well-known field tag numbers for duration messages. */
5722 #define kUpb_Duration_SecondsFieldNumber 1
5723 #define kUpb_Duration_NanosFieldNumber 2
5724 
5725 /* Well-known field tag numbers for timestamp messages. */
5726 #define kUpb_Timestamp_SecondsFieldNumber 1
5727 #define kUpb_Timestamp_NanosFieldNumber 2
5728 
5729 const google_protobuf_MessageOptions* upb_MessageDef_Options(
5730     const upb_MessageDef* m);
5731 bool upb_MessageDef_HasOptions(const upb_MessageDef* m);
5732 const char* upb_MessageDef_FullName(const upb_MessageDef* m);
5733 const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m);
5734 const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m);
5735 const char* upb_MessageDef_Name(const upb_MessageDef* m);
5736 upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m);
5737 upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
5738 int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m);
5739 int upb_MessageDef_FieldCount(const upb_MessageDef* m);
5740 int upb_MessageDef_OneofCount(const upb_MessageDef* m);
5741 const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
5742                                                         int i);
5743 const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i);
5744 const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i);
5745 const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m,
5746                                                      uint32_t i);
5747 const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
5748     const upb_MessageDef* m, const char* name, size_t len);
5749 const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
5750     const upb_MessageDef* m, const char* name, size_t len);
5751 const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
5752 
upb_MessageDef_FindOneofByName(const upb_MessageDef * m,const char * name)5753 UPB_INLINE const upb_OneofDef* upb_MessageDef_FindOneofByName(
5754     const upb_MessageDef* m, const char* name) {
5755   return upb_MessageDef_FindOneofByNameWithSize(m, name, strlen(name));
5756 }
5757 
upb_MessageDef_FindFieldByName(const upb_MessageDef * m,const char * name)5758 UPB_INLINE const upb_FieldDef* upb_MessageDef_FindFieldByName(
5759     const upb_MessageDef* m, const char* name) {
5760   return upb_MessageDef_FindFieldByNameWithSize(m, name, strlen(name));
5761 }
5762 
upb_MessageDef_IsMapEntry(const upb_MessageDef * m)5763 UPB_INLINE bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) {
5764   return google_protobuf_MessageOptions_map_entry(upb_MessageDef_Options(m));
5765 }
5766 
upb_MessageDef_IsMessageSet(const upb_MessageDef * m)5767 UPB_INLINE bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) {
5768   return google_protobuf_MessageOptions_message_set_wire_format(
5769       upb_MessageDef_Options(m));
5770 }
5771 
5772 /* Nested entities. */
5773 int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
5774 int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
5775 int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m);
5776 const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
5777                                                    int i);
5778 const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i);
5779 const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
5780                                                    int i);
5781 
5782 /* Lookup of either field or oneof by name.  Returns whether either was found.
5783  * If the return is true, then the found def will be set, and the non-found
5784  * one set to NULL. */
5785 bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
5786                                        const char* name, size_t len,
5787                                        const upb_FieldDef** f,
5788                                        const upb_OneofDef** o);
5789 
upb_MessageDef_FindByName(const upb_MessageDef * m,const char * name,const upb_FieldDef ** f,const upb_OneofDef ** o)5790 UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m,
5791                                           const char* name,
5792                                           const upb_FieldDef** f,
5793                                           const upb_OneofDef** o) {
5794   return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o);
5795 }
5796 
5797 /* Returns a field by either JSON name or regular proto name. */
5798 const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
5799     const upb_MessageDef* m, const char* name, size_t len);
upb_MessageDef_FindByJsonName(const upb_MessageDef * m,const char * name)5800 UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
5801     const upb_MessageDef* m, const char* name) {
5802   return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
5803 }
5804 
5805 upb_StringView upb_MessageDef_ReservedName(const upb_MessageDef* m, int i);
5806 int upb_MessageDef_ReservedNameCount(const upb_MessageDef* m);
5807 
5808 const upb_MessageReservedRange* upb_MessageDef_ReservedRange(
5809     const upb_MessageDef* m, int i);
5810 int upb_MessageDef_ReservedRangeCount(const upb_MessageDef* m);
5811 
5812 int32_t upb_MessageReservedRange_Start(const upb_MessageReservedRange* r);
5813 int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r);
5814 
5815 /* upb_ExtensionRange *********************************************************/
5816 
5817 const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options(
5818     const upb_ExtensionRange* r);
5819 bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r);
5820 int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r);
5821 int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r);
5822 
5823 /* upb_EnumDef ****************************************************************/
5824 
5825 const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e);
5826 bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
5827 const char* upb_EnumDef_FullName(const upb_EnumDef* e);
5828 const char* upb_EnumDef_Name(const upb_EnumDef* e);
5829 const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
5830 const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
5831 int32_t upb_EnumDef_Default(const upb_EnumDef* e);
5832 int upb_EnumDef_ValueCount(const upb_EnumDef* e);
5833 const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
5834 
5835 const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
5836     const upb_EnumDef* e, const char* name, size_t len);
5837 const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* e,
5838                                                       int32_t num);
5839 bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
5840 
5841 // Convenience wrapper.
upb_EnumDef_FindValueByName(const upb_EnumDef * e,const char * name)5842 UPB_INLINE const upb_EnumValueDef* upb_EnumDef_FindValueByName(
5843     const upb_EnumDef* e, const char* name) {
5844   return upb_EnumDef_FindValueByNameWithSize(e, name, strlen(name));
5845 }
5846 
5847 upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
5848 int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
5849 
5850 const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
5851                                                        int i);
5852 int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
5853 
5854 int32_t upb_EnumReservedRange_Start(const upb_EnumReservedRange* r);
5855 int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r);
5856 
5857 /* upb_EnumValueDef ***********************************************************/
5858 
5859 const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options(
5860     const upb_EnumValueDef* e);
5861 bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* e);
5862 const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* e);
5863 const char* upb_EnumValueDef_Name(const upb_EnumValueDef* e);
5864 int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* e);
5865 uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* e);
5866 const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* e);
5867 
5868 /* upb_FileDef ****************************************************************/
5869 
5870 const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f);
5871 bool upb_FileDef_HasOptions(const upb_FileDef* f);
5872 const char* upb_FileDef_Name(const upb_FileDef* f);
5873 const char* upb_FileDef_Package(const upb_FileDef* f);
5874 upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f);
5875 int upb_FileDef_DependencyCount(const upb_FileDef* f);
5876 int upb_FileDef_PublicDependencyCount(const upb_FileDef* f);
5877 int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
5878 int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
5879 int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f);
5880 int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f);
5881 int upb_FileDef_ServiceCount(const upb_FileDef* f);
5882 const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i);
5883 const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
5884 const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
5885 const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i);
5886 const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i);
5887 const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i);
5888 const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i);
5889 const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
5890 const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f);
5891 const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f);
5892 
5893 /* upb_MethodDef **************************************************************/
5894 
5895 const google_protobuf_MethodOptions* upb_MethodDef_Options(
5896     const upb_MethodDef* m);
5897 bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
5898 const char* upb_MethodDef_FullName(const upb_MethodDef* m);
5899 int upb_MethodDef_Index(const upb_MethodDef* m);
5900 const char* upb_MethodDef_Name(const upb_MethodDef* m);
5901 const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
5902 const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
5903 const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
5904 bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
5905 bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
5906 
5907 /* upb_ServiceDef *************************************************************/
5908 
5909 const google_protobuf_ServiceOptions* upb_ServiceDef_Options(
5910     const upb_ServiceDef* s);
5911 bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
5912 const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
5913 const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
5914 int upb_ServiceDef_Index(const upb_ServiceDef* s);
5915 const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
5916 int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
5917 const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i);
5918 const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
5919                                                      const char* name);
5920 
5921 /* upb_DefPool ****************************************************************/
5922 
5923 upb_DefPool* upb_DefPool_New(void);
5924 void upb_DefPool_Free(upb_DefPool* s);
5925 const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s,
5926                                                     const char* sym);
5927 const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
5928     const upb_DefPool* s, const char* sym, size_t len);
5929 const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
5930                                               const char* sym);
5931 const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
5932                                                       const char* sym);
5933 const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
5934                                                     const char* sym);
5935 const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
5936     const upb_DefPool* s, const char* sym, size_t len);
5937 const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
5938                                               const char* name);
5939 const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s,
5940                                                     const char* name);
5941 const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
5942     const upb_DefPool* s, const char* name, size_t size);
5943 const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
5944                                                         const char* name);
5945 const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
5946                                                       const char* name,
5947                                                       size_t len);
5948 const upb_FileDef* upb_DefPool_AddFile(
5949     upb_DefPool* s, const google_protobuf_FileDescriptorProto* file,
5950     upb_Status* status);
5951 size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
5952 upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s);
5953 const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable(
5954     const upb_DefPool* s, const upb_MiniTable_Extension* ext);
5955 const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
5956                                                       const upb_MessageDef* m,
5957                                                       int32_t fieldnum);
5958 const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
5959     const upb_DefPool* s);
5960 const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
5961                                                   const upb_MessageDef* m,
5962                                                   size_t* count);
5963 
5964 /* For generated code only: loads a generated descriptor. */
5965 typedef struct _upb_DefPool_Init {
5966   struct _upb_DefPool_Init** deps; /* Dependencies of this file. */
5967   const upb_MiniTable_File* layout;
5968   const char* filename;
5969   upb_StringView descriptor; /* Serialized descriptor. */
5970 } _upb_DefPool_Init;
5971 
5972 // Should only be directly called by tests.  This variant lets us suppress
5973 // the use of compiled-in tables, forcing a rebuild of the tables at runtime.
5974 bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
5975                                 bool rebuild_minitable);
5976 
_upb_DefPool_LoadDefInit(upb_DefPool * s,const _upb_DefPool_Init * init)5977 UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s,
5978                                          const _upb_DefPool_Init* init) {
5979   return _upb_DefPool_LoadDefInitEx(s, init, false);
5980 }
5981 
5982 
5983 #ifdef __cplusplus
5984 } /* extern "C" */
5985 #endif /* __cplusplus */
5986 
5987 #endif /* UPB_DEF_H_ */
5988 
5989 #ifdef __cplusplus
5990 extern "C" {
5991 #endif
5992 
5993 enum { upb_JsonDecode_IgnoreUnknown = 1 };
5994 
5995 bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
5996                     const upb_MessageDef* m, const upb_DefPool* symtab,
5997                     int options, upb_Arena* arena, upb_Status* status);
5998 
5999 #ifdef __cplusplus
6000 } /* extern "C" */
6001 #endif
6002 
6003 #endif /* UPB_JSONDECODE_H_ */
6004 
6005 /** upb/reflection.h ************************************************************/
6006 #ifndef UPB_REFLECTION_H_
6007 #define UPB_REFLECTION_H_
6008 
6009 
6010 #ifdef __cplusplus
6011 extern "C" {
6012 #endif
6013 
6014 upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
6015 
6016 /** upb_Message
6017  * *******************************************************************/
6018 
6019 /* Creates a new message of the given type in the given arena. */
6020 upb_Message* upb_Message_New(const upb_MessageDef* m, upb_Arena* a);
6021 
6022 /* Returns the value associated with this field. */
6023 upb_MessageValue upb_Message_Get(const upb_Message* msg, const upb_FieldDef* f);
6024 
6025 /* Returns a mutable pointer to a map, array, or submessage value.  If the given
6026  * arena is non-NULL this will construct a new object if it was not previously
6027  * present.  May not be called for primitive fields. */
6028 upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
6029                                             const upb_FieldDef* f,
6030                                             upb_Arena* a);
6031 
6032 /* May only be called for fields where upb_FieldDef_HasPresence(f) == true. */
6033 bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f);
6034 
6035 /* Returns the field that is set in the oneof, or NULL if none are set. */
6036 const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg,
6037                                            const upb_OneofDef* o);
6038 
6039 /* Sets the given field to the given value.  For a msg/array/map/string, the
6040  * caller must ensure that the target data outlives |msg| (by living either in
6041  * the same arena or a different arena that outlives it).
6042  *
6043  * Returns false if allocation fails. */
6044 bool upb_Message_Set(upb_Message* msg, const upb_FieldDef* f,
6045                      upb_MessageValue val, upb_Arena* a);
6046 
6047 /* Clears any field presence and sets the value back to its default. */
6048 void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f);
6049 
6050 /* Clear all data and unknown fields. */
6051 void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m);
6052 
6053 /* Iterate over present fields.
6054  *
6055  * size_t iter = kUpb_Message_Begin;
6056  * const upb_FieldDef *f;
6057  * upb_MessageValue val;
6058  * while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) {
6059  *   process_field(f, val);
6060  * }
6061  *
6062  * If ext_pool is NULL, no extensions will be returned.  If the given symtab
6063  * returns extensions that don't match what is in this message, those extensions
6064  * will be skipped.
6065  */
6066 
6067 #define kUpb_Message_Begin -1
6068 bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
6069                       const upb_DefPool* ext_pool, const upb_FieldDef** f,
6070                       upb_MessageValue* val, size_t* iter);
6071 
6072 /* Clears all unknown field data from this message and all submessages. */
6073 bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m,
6074                                 int maxdepth);
6075 
6076 #ifdef __cplusplus
6077 } /* extern "C" */
6078 #endif
6079 
6080 
6081 #endif /* UPB_REFLECTION_H_ */
6082 
6083 /** upb/json_encode.h ************************************************************/
6084 #ifndef UPB_JSONENCODE_H_
6085 #define UPB_JSONENCODE_H_
6086 
6087 
6088 #ifdef __cplusplus
6089 extern "C" {
6090 #endif
6091 
6092 enum {
6093   /* When set, emits 0/default values.  TODO(haberman): proto3 only? */
6094   upb_JsonEncode_EmitDefaults = 1,
6095 
6096   /* When set, use normal (snake_caes) field names instead of JSON (camelCase)
6097      names. */
6098   upb_JsonEncode_UseProtoNames = 2
6099 };
6100 
6101 /* Encodes the given |msg| to JSON format.  The message's reflection is given in
6102  * |m|.  The symtab in |symtab| is used to find extensions (if NULL, extensions
6103  * will not be printed).
6104  *
6105  * Output is placed in the given buffer, and always NULL-terminated.  The output
6106  * size (excluding NULL) is returned.  This means that a return value >= |size|
6107  * implies that the output was truncated.  (These are the same semantics as
6108  * snprintf()). */
6109 size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
6110                       const upb_DefPool* ext_pool, int options, char* buf,
6111                       size_t size, upb_Status* status);
6112 
6113 #ifdef __cplusplus
6114 } /* extern "C" */
6115 #endif
6116 
6117 #endif /* UPB_JSONENCODE_H_ */
6118 
6119 /** upb/internal/vsnprintf_compat.h ************************************************************/
6120 #ifndef UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6121 #define UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6122 
6123 #include <stdio.h>
6124 
6125 // Must be last.
6126 
_upb_vsnprintf(char * buf,size_t size,const char * fmt,va_list ap)6127 UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
6128                               va_list ap) {
6129 #if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
6130   // The msvc runtime has a non-conforming vsnprintf() that requires the
6131   // following compatibility code to become conformant.
6132   int n = -1;
6133   if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
6134   if (n == -1) n = _vscprintf(fmt, ap);
6135   return n;
6136 #else
6137   return vsnprintf(buf, size, fmt, ap);
6138 #endif
6139 }
6140 
6141 
6142 #endif  // UPB_INTERNAL_VSNPRINTF_COMPAT_H_
6143 
6144 /** upb/mini_table.h ************************************************************/
6145 #ifndef UPB_MINI_TABLE_H_
6146 #define UPB_MINI_TABLE_H_
6147 
6148 
6149 // Must be last.
6150 
6151 #ifdef __cplusplus
6152 extern "C" {
6153 #endif
6154 
6155 const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber(
6156     const upb_MiniTable* table, uint32_t number);
6157 
upb_MiniTable_GetSubMessageTable(const upb_MiniTable * mini_table,const upb_MiniTable_Field * field)6158 UPB_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable(
6159     const upb_MiniTable* mini_table, const upb_MiniTable_Field* field) {
6160   return mini_table->subs[field->submsg_index].submsg;
6161 }
6162 
upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum * e,int32_t val)6163 UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum* e,
6164                                               int32_t val) {
6165   uint32_t uval = (uint32_t)val;
6166   if (uval < 64) return e->mask & (1ULL << uval);
6167   // OPT: binary search long lists?
6168   int n = e->value_count;
6169   for (int i = 0; i < n; i++) {
6170     if (e->values[i] == val) return true;
6171   }
6172   return false;
6173 }
6174 
6175 /** upb_MtDataEncoder *********************************************************/
6176 
6177 // Functions to encode a string in a format that can be loaded by
6178 // upb_MiniTable_Build().
6179 
6180 typedef enum {
6181   kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
6182   kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
6183   kUpb_MessageModifier_IsExtendable = 1 << 2,
6184 } kUpb_MessageModifier;
6185 
6186 typedef enum {
6187   kUpb_FieldModifier_IsRepeated = 1 << 0,
6188   kUpb_FieldModifier_IsPacked = 1 << 1,
6189   kUpb_FieldModifier_IsClosedEnum = 1 << 2,
6190   kUpb_FieldModifier_IsProto3Singular = 1 << 3,
6191   kUpb_FieldModifier_IsRequired = 1 << 4,
6192 } kUpb_FieldModifier;
6193 
6194 typedef struct {
6195   char* end;  // Limit of the buffer passed as a parameter.
6196   // Aliased to internal-only members in .cc.
6197   char internal[32];
6198 } upb_MtDataEncoder;
6199 
6200 // If the input buffer has at least this many bytes available, the encoder call
6201 // is guaranteed to succeed (as long as field number order is maintained).
6202 #define kUpb_MtDataEncoder_MinSize 16
6203 
6204 // Encodes field/oneof information for a given message.  The sequence of calls
6205 // should look like:
6206 //
6207 //   upb_MtDataEncoder e;
6208 //   char buf[256];
6209 //   char* ptr = buf;
6210 //   e.end = ptr + sizeof(buf);
6211 //   ptr = upb_MtDataEncoder_StartMessage(&e, ptr);
6212 //   // Fields *must* be in field number order.
6213 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6214 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6215 //   ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
6216 //
6217 //   // If oneofs are present.  Oneofs must be encoded after regular fields.
6218 //   ptr = upb_MiniTable_StartOneof(&e, ptr)
6219 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6220 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6221 //
6222 //   ptr = upb_MiniTable_StartOneof(&e, ptr);
6223 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6224 //   ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
6225 //
6226 // Oneofs must be encoded after all regular fields.
6227 char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
6228                                      uint64_t msg_mod);
6229 char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
6230                                  upb_FieldType type, uint32_t field_num,
6231                                  uint64_t field_mod);
6232 char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
6233 char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
6234                                       uint32_t field_num);
6235 
6236 // Encodes the set of values for a given enum.  The values must be given in
6237 // order (after casting to uint32_t), and repeats are not allowed.
6238 void upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e);
6239 char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
6240                                      uint32_t val);
6241 char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr);
6242 
6243 /** upb_MiniTable *************************************************************/
6244 
6245 typedef enum {
6246   kUpb_MiniTablePlatform_32Bit,
6247   kUpb_MiniTablePlatform_64Bit,
6248   kUpb_MiniTablePlatform_Native =
6249       UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
6250 } upb_MiniTablePlatform;
6251 
6252 // Builds a mini table from the data encoded in the buffer [data, len]. If any
6253 // errors occur, returns NULL and sets a status message. In the success case,
6254 // the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
6255 // fields to link the table to the appropriate sub-tables.
6256 upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
6257                                    upb_MiniTablePlatform platform,
6258                                    upb_Arena* arena, upb_Status* status);
6259 void upb_MiniTable_SetSubMessage(upb_MiniTable* table,
6260                                  upb_MiniTable_Field* field,
6261                                  const upb_MiniTable* sub);
6262 void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field,
6263                               const upb_MiniTable_Enum* sub);
6264 
6265 bool upb_MiniTable_BuildExtension(const char* data, size_t len,
6266                                   upb_MiniTable_Extension* ext,
6267                                   upb_MiniTable_Sub sub, upb_Status* status);
6268 
6269 // Special-case functions for MessageSet layout and map entries.
6270 upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform,
6271                                              upb_Arena* arena);
6272 upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
6273                                            upb_FieldType value_type,
6274                                            bool value_is_proto3_enum,
6275                                            upb_MiniTablePlatform platform,
6276                                            upb_Arena* arena);
6277 
6278 upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len,
6279                                             upb_Arena* arena,
6280                                             upb_Status* status);
6281 
6282 // Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
6283 // it can be reused from call to call, avoiding repeated realloc()/free().
6284 //
6285 // The caller owns `*buf` both before and after the call, and must free() it
6286 // when it is no longer in use.  The function will realloc() `*buf` as
6287 // necessary, updating `*size` accordingly.
6288 upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
6289                                           upb_MiniTablePlatform platform,
6290                                           upb_Arena* arena, void** buf,
6291                                           size_t* buf_size, upb_Status* status);
6292 
6293 // For testing only.
6294 char upb_ToBase92(int8_t ch);
6295 char upb_FromBase92(uint8_t ch);
6296 bool upb_IsTypePackable(upb_FieldType type);
6297 
6298 #ifdef __cplusplus
6299 } /* extern "C" */
6300 #endif
6301 
6302 
6303 #endif /* UPB_MINI_TABLE_H_ */
6304 
6305 /** upb/port_undef.inc ************************************************************/
6306 /* See port_def.inc.  This should #undef all macros #defined there. */
6307 
6308 #undef UPB_SIZE
6309 #undef UPB_PTR_AT
6310 #undef UPB_READ_ONEOF
6311 #undef UPB_WRITE_ONEOF
6312 #undef UPB_MAPTYPE_STRING
6313 #undef UPB_INLINE
6314 #undef UPB_ALIGN_UP
6315 #undef UPB_ALIGN_DOWN
6316 #undef UPB_ALIGN_MALLOC
6317 #undef UPB_ALIGN_OF
6318 #undef UPB_MALLOC_ALIGN
6319 #undef UPB_LIKELY
6320 #undef UPB_UNLIKELY
6321 #undef UPB_FORCEINLINE
6322 #undef UPB_NOINLINE
6323 #undef UPB_NORETURN
6324 #undef UPB_PRINTF
6325 #undef UPB_MAX
6326 #undef UPB_MIN
6327 #undef UPB_UNUSED
6328 #undef UPB_ASSUME
6329 #undef UPB_ASSERT
6330 #undef UPB_UNREACHABLE
6331 #undef UPB_SETJMP
6332 #undef UPB_LONGJMP
6333 #undef UPB_PTRADD
6334 #undef UPB_MUSTTAIL
6335 #undef UPB_FASTTABLE_SUPPORTED
6336 #undef UPB_FASTTABLE
6337 #undef UPB_FASTTABLE_INIT
6338 #undef UPB_POISON_MEMORY_REGION
6339 #undef UPB_UNPOISON_MEMORY_REGION
6340 #undef UPB_ASAN
6341 #undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3
6342